@jinn-network/client 0.1.7-canary.d4e4e183 → 0.1.7-canary.f3c8e0db

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.
Files changed (83) hide show
  1. package/README.md +67 -1
  2. package/dist/adapters/mech/adapter.js +27 -3
  3. package/dist/adapters/mech/adapter.js.map +1 -1
  4. package/dist/adapters/mech/safe.d.ts +1 -1
  5. package/dist/adapters/mech/safe.js +5 -3
  6. package/dist/adapters/mech/safe.js.map +1 -1
  7. package/dist/adapters/mech/types.d.ts +6 -1
  8. package/dist/adapters/mech/types.js.map +1 -1
  9. package/dist/api/activity-events-endpoint.d.ts +14 -0
  10. package/dist/api/activity-events-endpoint.js +59 -0
  11. package/dist/api/activity-events-endpoint.js.map +1 -0
  12. package/dist/api/gather-status.d.ts +3 -0
  13. package/dist/api/gather-status.js +84 -4
  14. package/dist/api/gather-status.js.map +1 -1
  15. package/dist/api/server.js +4 -0
  16. package/dist/api/server.js.map +1 -1
  17. package/dist/api/status-build.d.ts +40 -0
  18. package/dist/api/status-build.js +25 -0
  19. package/dist/api/status-build.js.map +1 -1
  20. package/dist/build-info.json +4 -4
  21. package/dist/build-meta.json +1 -1
  22. package/dist/config.d.ts +89 -39
  23. package/dist/config.js +97 -30
  24. package/dist/config.js.map +1 -1
  25. package/dist/daemon/daemon.d.ts +3 -0
  26. package/dist/daemon/daemon.js +88 -22
  27. package/dist/daemon/daemon.js.map +1 -1
  28. package/dist/daemon/gate-logger.d.ts +9 -0
  29. package/dist/daemon/gate-logger.js +2 -0
  30. package/dist/daemon/gate-logger.js.map +1 -0
  31. package/dist/daemon/readiness-gate.d.ts +1 -4
  32. package/dist/daemon/readiness-gate.js.map +1 -1
  33. package/dist/daemon/spend-cap-gate.d.ts +40 -0
  34. package/dist/daemon/spend-cap-gate.js +46 -0
  35. package/dist/daemon/spend-cap-gate.js.map +1 -0
  36. package/dist/dashboard/assets/index-CKTc0D37.css +32 -0
  37. package/dist/dashboard/assets/index-nbNLLn9_.js +345 -0
  38. package/dist/dashboard/index.html +2 -2
  39. package/dist/earning/safe-adapter.js +23 -11
  40. package/dist/earning/safe-adapter.js.map +1 -1
  41. package/dist/earning/types.d.ts +6 -6
  42. package/dist/earning/viem-clients.d.ts +11 -4
  43. package/dist/earning/viem-clients.js +14 -5
  44. package/dist/earning/viem-clients.js.map +1 -1
  45. package/dist/events/types.d.ts +2 -2
  46. package/dist/harnesses/engine/engine.js +13 -0
  47. package/dist/harnesses/engine/engine.js.map +1 -1
  48. package/dist/main.js +24 -11
  49. package/dist/main.js.map +1 -1
  50. package/dist/observability/emit-event.d.ts +3 -2
  51. package/dist/observability/emit-event.js +22 -1
  52. package/dist/observability/emit-event.js.map +1 -1
  53. package/dist/preflight/rpc-network.d.ts +40 -0
  54. package/dist/preflight/rpc-network.js +67 -1
  55. package/dist/preflight/rpc-network.js.map +1 -1
  56. package/dist/rpc/transport.d.ts +109 -0
  57. package/dist/rpc/transport.js +220 -0
  58. package/dist/rpc/transport.js.map +1 -0
  59. package/dist/spend/credential.d.ts +8 -0
  60. package/dist/spend/credential.js +30 -0
  61. package/dist/spend/credential.js.map +1 -0
  62. package/dist/spend/daemon-config.d.ts +13 -0
  63. package/dist/spend/daemon-config.js +24 -0
  64. package/dist/spend/daemon-config.js.map +1 -0
  65. package/dist/spend/pricing.d.ts +16 -0
  66. package/dist/spend/pricing.js +26 -0
  67. package/dist/spend/pricing.js.map +1 -0
  68. package/dist/spend/record.d.ts +13 -0
  69. package/dist/spend/record.js +30 -0
  70. package/dist/spend/record.js.map +1 -0
  71. package/dist/spend/usage.d.ts +27 -0
  72. package/dist/spend/usage.js +113 -0
  73. package/dist/spend/usage.js.map +1 -0
  74. package/dist/store/store.d.ts +28 -0
  75. package/dist/store/store.js +118 -4
  76. package/dist/store/store.js.map +1 -1
  77. package/dist/trajectory/transcript-parsers/types.d.ts +8 -8
  78. package/dist/tx-retry.d.ts +15 -0
  79. package/dist/tx-retry.js +30 -6
  80. package/dist/tx-retry.js.map +1 -1
  81. package/package.json +2 -1
  82. package/dist/dashboard/assets/index-BUlE8F3Y.js +0 -330
  83. package/dist/dashboard/assets/index-blqc7eqq.css +0 -32
@@ -0,0 +1,345 @@
1
+ var $g=e=>{throw TypeError(e)};var Pd=(e,t,r)=>t.has(e)||$g("Cannot "+r);var F=(e,t,r)=>(Pd(e,t,"read from private field"),r?r.call(e):t.get(e)),xe=(e,t,r)=>t.has(e)?$g("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),ue=(e,t,r,n)=>(Pd(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Re=(e,t,r)=>(Pd(e,t,"access private method"),r);var tc=(e,t,r,n)=>({set _(s){ue(e,t,s,r)},get _(){return F(e,t,n)}});function Rk(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(n,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>n[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&n(l)}).observe(document,{childList:!0,subtree:!0});function r(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(s){if(s.ep)return;s.ep=!0;const i=r(s);fetch(s.href,i)}})();function Ey(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var jy={exports:{}},Uu={},Ny={exports:{}},Ae={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its 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 Ol=Symbol.for("react.element"),Pk=Symbol.for("react.portal"),Tk=Symbol.for("react.fragment"),Ak=Symbol.for("react.strict_mode"),Dk=Symbol.for("react.profiler"),Lk=Symbol.for("react.provider"),Mk=Symbol.for("react.context"),Ok=Symbol.for("react.forward_ref"),Ik=Symbol.for("react.suspense"),Fk=Symbol.for("react.memo"),Bk=Symbol.for("react.lazy"),Hg=Symbol.iterator;function $k(e){return e===null||typeof e!="object"?null:(e=Hg&&e[Hg]||e["@@iterator"],typeof e=="function"?e:null)}var Ry={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Py=Object.assign,Ty={};function ca(e,t,r){this.props=e,this.context=t,this.refs=Ty,this.updater=r||Ry}ca.prototype.isReactComponent={};ca.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ca.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Ay(){}Ay.prototype=ca.prototype;function Sp(e,t,r){this.props=e,this.context=t,this.refs=Ty,this.updater=r||Ry}var Cp=Sp.prototype=new Ay;Cp.constructor=Sp;Py(Cp,ca.prototype);Cp.isPureReactComponent=!0;var zg=Array.isArray,Dy=Object.prototype.hasOwnProperty,kp={current:null},Ly={key:!0,ref:!0,__self:!0,__source:!0};function My(e,t,r){var n,s={},i=null,l=null;if(t!=null)for(n in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(i=""+t.key),t)Dy.call(t,n)&&!Ly.hasOwnProperty(n)&&(s[n]=t[n]);var a=arguments.length-2;if(a===1)s.children=r;else if(1<a){for(var c=Array(a),u=0;u<a;u++)c[u]=arguments[u+2];s.children=c}if(e&&e.defaultProps)for(n in a=e.defaultProps,a)s[n]===void 0&&(s[n]=a[n]);return{$$typeof:Ol,type:e,key:i,ref:l,props:s,_owner:kp.current}}function Hk(e,t){return{$$typeof:Ol,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Ep(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ol}function zk(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var Ug=/\/+/g;function Td(e,t){return typeof e=="object"&&e!==null&&e.key!=null?zk(""+e.key):t.toString(36)}function Ac(e,t,r,n,s){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var l=!1;if(e===null)l=!0;else switch(i){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case Ol:case Pk:l=!0}}if(l)return l=e,s=s(l),e=n===""?"."+Td(l,0):n,zg(s)?(r="",e!=null&&(r=e.replace(Ug,"$&/")+"/"),Ac(s,t,r,"",function(u){return u})):s!=null&&(Ep(s)&&(s=Hk(s,r+(!s.key||l&&l.key===s.key?"":(""+s.key).replace(Ug,"$&/")+"/")+e)),t.push(s)),1;if(l=0,n=n===""?".":n+":",zg(e))for(var a=0;a<e.length;a++){i=e[a];var c=n+Td(i,a);l+=Ac(i,t,r,c,s)}else if(c=$k(e),typeof c=="function")for(e=c.call(e),a=0;!(i=e.next()).done;)i=i.value,c=n+Td(i,a++),l+=Ac(i,t,r,c,s);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return l}function rc(e,t,r){if(e==null)return e;var n=[],s=0;return Ac(e,n,"","",function(i){return t.call(r,i,s++)}),n}function Uk(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Yt={current:null},Dc={transition:null},Wk={ReactCurrentDispatcher:Yt,ReactCurrentBatchConfig:Dc,ReactCurrentOwner:kp};function Oy(){throw Error("act(...) is not supported in production builds of React.")}Ae.Children={map:rc,forEach:function(e,t,r){rc(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return rc(e,function(){t++}),t},toArray:function(e){return rc(e,function(t){return t})||[]},only:function(e){if(!Ep(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ae.Component=ca;Ae.Fragment=Tk;Ae.Profiler=Dk;Ae.PureComponent=Sp;Ae.StrictMode=Ak;Ae.Suspense=Ik;Ae.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Wk;Ae.act=Oy;Ae.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=Py({},e.props),s=e.key,i=e.ref,l=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,l=kp.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(c in t)Dy.call(t,c)&&!Ly.hasOwnProperty(c)&&(n[c]=t[c]===void 0&&a!==void 0?a[c]:t[c])}var c=arguments.length-2;if(c===1)n.children=r;else if(1<c){a=Array(c);for(var u=0;u<c;u++)a[u]=arguments[u+2];n.children=a}return{$$typeof:Ol,type:e.type,key:s,ref:i,props:n,_owner:l}};Ae.createContext=function(e){return e={$$typeof:Mk,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Lk,_context:e},e.Consumer=e};Ae.createElement=My;Ae.createFactory=function(e){var t=My.bind(null,e);return t.type=e,t};Ae.createRef=function(){return{current:null}};Ae.forwardRef=function(e){return{$$typeof:Ok,render:e}};Ae.isValidElement=Ep;Ae.lazy=function(e){return{$$typeof:Bk,_payload:{_status:-1,_result:e},_init:Uk}};Ae.memo=function(e,t){return{$$typeof:Fk,type:e,compare:t===void 0?null:t}};Ae.startTransition=function(e){var t=Dc.transition;Dc.transition={};try{e()}finally{Dc.transition=t}};Ae.unstable_act=Oy;Ae.useCallback=function(e,t){return Yt.current.useCallback(e,t)};Ae.useContext=function(e){return Yt.current.useContext(e)};Ae.useDebugValue=function(){};Ae.useDeferredValue=function(e){return Yt.current.useDeferredValue(e)};Ae.useEffect=function(e,t){return Yt.current.useEffect(e,t)};Ae.useId=function(){return Yt.current.useId()};Ae.useImperativeHandle=function(e,t,r){return Yt.current.useImperativeHandle(e,t,r)};Ae.useInsertionEffect=function(e,t){return Yt.current.useInsertionEffect(e,t)};Ae.useLayoutEffect=function(e,t){return Yt.current.useLayoutEffect(e,t)};Ae.useMemo=function(e,t){return Yt.current.useMemo(e,t)};Ae.useReducer=function(e,t,r){return Yt.current.useReducer(e,t,r)};Ae.useRef=function(e){return Yt.current.useRef(e)};Ae.useState=function(e){return Yt.current.useState(e)};Ae.useSyncExternalStore=function(e,t,r){return Yt.current.useSyncExternalStore(e,t,r)};Ae.useTransition=function(){return Yt.current.useTransition()};Ae.version="18.3.1";Ny.exports=Ae;var C=Ny.exports;const Z=Ey(C),Wu=Rk({__proto__:null,default:Z},[C]);/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its 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 Vk=C,qk=Symbol.for("react.element"),Kk=Symbol.for("react.fragment"),Gk=Object.prototype.hasOwnProperty,Qk=Vk.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Yk={key:!0,ref:!0,__self:!0,__source:!0};function Iy(e,t,r){var n,s={},i=null,l=null;r!==void 0&&(i=""+r),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(l=t.ref);for(n in t)Gk.call(t,n)&&!Yk.hasOwnProperty(n)&&(s[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)s[n]===void 0&&(s[n]=t[n]);return{$$typeof:qk,type:e,key:i,ref:l,props:s,_owner:Qk.current}}Uu.Fragment=Kk;Uu.jsx=Iy;Uu.jsxs=Iy;jy.exports=Uu;var o=jy.exports,Ph={},Fy={exports:{}},Er={},By={exports:{}},$y={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its 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
+ */(function(e){function t(N,T){var D=N.length;N.push(T);e:for(;0<D;){var O=D-1>>>1,$=N[O];if(0<s($,T))N[O]=T,N[D]=$,D=O;else break e}}function r(N){return N.length===0?null:N[0]}function n(N){if(N.length===0)return null;var T=N[0],D=N.pop();if(D!==T){N[0]=D;e:for(var O=0,$=N.length,Y=$>>>1;O<Y;){var J=2*(O+1)-1,re=N[J],ye=J+1,P=N[ye];if(0>s(re,D))ye<$&&0>s(P,re)?(N[O]=P,N[ye]=D,O=ye):(N[O]=re,N[J]=D,O=J);else if(ye<$&&0>s(P,D))N[O]=P,N[ye]=D,O=ye;else break e}}return T}function s(N,T){var D=N.sortIndex-T.sortIndex;return D!==0?D:N.id-T.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,a=l.now();e.unstable_now=function(){return l.now()-a}}var c=[],u=[],g=1,d=null,_=3,v=!1,x=!1,y=!1,f=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,h=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function m(N){for(var T=r(u);T!==null;){if(T.callback===null)n(u);else if(T.startTime<=N)n(u),T.sortIndex=T.expirationTime,t(c,T);else break;T=r(u)}}function b(N){if(y=!1,m(N),!x)if(r(c)!==null)x=!0,W(w);else{var T=r(u);T!==null&&q(b,T.startTime-N)}}function w(N,T){x=!1,y&&(y=!1,p(S),S=-1),v=!0;var D=_;try{for(m(T),d=r(c);d!==null&&(!(d.expirationTime>T)||N&&!M());){var O=d.callback;if(typeof O=="function"){d.callback=null,_=d.priorityLevel;var $=O(d.expirationTime<=T);T=e.unstable_now(),typeof $=="function"?d.callback=$:d===r(c)&&n(c),m(T)}else n(c);d=r(c)}if(d!==null)var Y=!0;else{var J=r(u);J!==null&&q(b,J.startTime-T),Y=!1}return Y}finally{d=null,_=D,v=!1}}var k=!1,j=null,S=-1,E=5,R=-1;function M(){return!(e.unstable_now()-R<E)}function A(){if(j!==null){var N=e.unstable_now();R=N;var T=!0;try{T=j(!0,N)}finally{T?L():(k=!1,j=null)}}else k=!1}var L;if(typeof h=="function")L=function(){h(A)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,U=B.port2;B.port1.onmessage=A,L=function(){U.postMessage(null)}}else L=function(){f(A,0)};function W(N){j=N,k||(k=!0,L())}function q(N,T){S=f(function(){N(e.unstable_now())},T)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(N){N.callback=null},e.unstable_continueExecution=function(){x||v||(x=!0,W(w))},e.unstable_forceFrameRate=function(N){0>N||125<N?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<N?Math.floor(1e3/N):5},e.unstable_getCurrentPriorityLevel=function(){return _},e.unstable_getFirstCallbackNode=function(){return r(c)},e.unstable_next=function(N){switch(_){case 1:case 2:case 3:var T=3;break;default:T=_}var D=_;_=T;try{return N()}finally{_=D}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(N,T){switch(N){case 1:case 2:case 3:case 4:case 5:break;default:N=3}var D=_;_=N;try{return T()}finally{_=D}},e.unstable_scheduleCallback=function(N,T,D){var O=e.unstable_now();switch(typeof D=="object"&&D!==null?(D=D.delay,D=typeof D=="number"&&0<D?O+D:O):D=O,N){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=D+$,N={id:g++,callback:T,priorityLevel:N,startTime:D,expirationTime:$,sortIndex:-1},D>O?(N.sortIndex=D,t(u,N),r(c)===null&&N===r(u)&&(y?(p(S),S=-1):y=!0,q(b,D-O))):(N.sortIndex=$,t(c,N),x||v||(x=!0,W(w))),N},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(N){var T=_;return function(){var D=_;_=T;try{return N.apply(this,arguments)}finally{_=D}}}})($y);By.exports=$y;var Zk=By.exports;/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var Xk=C,Sr=Zk;function se(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);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."}var Hy=new Set,sl={};function Fi(e,t){qo(e,t),qo(e+"Capture",t)}function qo(e,t){for(sl[e]=t,e=0;e<t.length;e++)Hy.add(t[e])}var Qn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Th=Object.prototype.hasOwnProperty,Jk=/^[: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]*$/,Wg={},Vg={};function eE(e){return Th.call(Vg,e)?!0:Th.call(Wg,e)?!1:Jk.test(e)?Vg[e]=!0:(Wg[e]=!0,!1)}function tE(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function rE(e,t,r,n){if(t===null||typeof t>"u"||tE(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Zt(e,t,r,n,s,i,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=s,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=l}var At={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){At[e]=new Zt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];At[t]=new Zt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){At[e]=new Zt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){At[e]=new Zt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){At[e]=new Zt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){At[e]=new Zt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){At[e]=new Zt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){At[e]=new Zt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){At[e]=new Zt(e,5,!1,e.toLowerCase(),null,!1,!1)});var jp=/[\-:]([a-z])/g;function Np(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(jp,Np);At[t]=new Zt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(jp,Np);At[t]=new Zt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(jp,Np);At[t]=new Zt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){At[e]=new Zt(e,1,!1,e.toLowerCase(),null,!1,!1)});At.xlinkHref=new Zt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){At[e]=new Zt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Rp(e,t,r,n){var s=At.hasOwnProperty(t)?At[t]:null;(s!==null?s.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(rE(t,r,s,n)&&(r=null),n||s===null?eE(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):s.mustUseProperty?e[s.propertyName]=r===null?s.type===3?!1:"":r:(t=s.attributeName,n=s.attributeNamespace,r===null?e.removeAttribute(t):(s=s.type,r=s===3||s===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}var ns=Xk.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,nc=Symbol.for("react.element"),ao=Symbol.for("react.portal"),lo=Symbol.for("react.fragment"),Pp=Symbol.for("react.strict_mode"),Ah=Symbol.for("react.profiler"),zy=Symbol.for("react.provider"),Uy=Symbol.for("react.context"),Tp=Symbol.for("react.forward_ref"),Dh=Symbol.for("react.suspense"),Lh=Symbol.for("react.suspense_list"),Ap=Symbol.for("react.memo"),ms=Symbol.for("react.lazy"),Wy=Symbol.for("react.offscreen"),qg=Symbol.iterator;function wa(e){return e===null||typeof e!="object"?null:(e=qg&&e[qg]||e["@@iterator"],typeof e=="function"?e:null)}var ct=Object.assign,Ad;function Ba(e){if(Ad===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);Ad=t&&t[1]||""}return`
34
+ `+Ad+e}var Dd=!1;function Ld(e,t){if(!e||Dd)return"";Dd=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var n=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){n=u}e.call(t.prototype)}else{try{throw Error()}catch(u){n=u}e()}}catch(u){if(u&&n&&typeof u.stack=="string"){for(var s=u.stack.split(`
35
+ `),i=n.stack.split(`
36
+ `),l=s.length-1,a=i.length-1;1<=l&&0<=a&&s[l]!==i[a];)a--;for(;1<=l&&0<=a;l--,a--)if(s[l]!==i[a]){if(l!==1||a!==1)do if(l--,a--,0>a||s[l]!==i[a]){var c=`
37
+ `+s[l].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=l&&0<=a);break}}}finally{Dd=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Ba(e):""}function nE(e){switch(e.tag){case 5:return Ba(e.type);case 16:return Ba("Lazy");case 13:return Ba("Suspense");case 19:return Ba("SuspenseList");case 0:case 2:case 15:return e=Ld(e.type,!1),e;case 11:return e=Ld(e.type.render,!1),e;case 1:return e=Ld(e.type,!0),e;default:return""}}function Mh(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case lo:return"Fragment";case ao:return"Portal";case Ah:return"Profiler";case Pp:return"StrictMode";case Dh:return"Suspense";case Lh:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Uy:return(e.displayName||"Context")+".Consumer";case zy:return(e._context.displayName||"Context")+".Provider";case Tp:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ap:return t=e.displayName||null,t!==null?t:Mh(e.type)||"Memo";case ms:t=e._payload,e=e._init;try{return Mh(e(t))}catch{}}return null}function sE(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Mh(t);case 8:return t===Pp?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function qs(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Vy(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function iE(e){var t=Vy(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var s=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(l){n=""+l,i.call(this,l)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(l){n=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function sc(e){e._valueTracker||(e._valueTracker=iE(e))}function qy(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=Vy(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Qc(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Oh(e,t){var r=t.checked;return ct({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Kg(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=qs(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Ky(e,t){t=t.checked,t!=null&&Rp(e,"checked",t,!1)}function Ih(e,t){Ky(e,t);var r=qs(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Fh(e,t.type,r):t.hasOwnProperty("defaultValue")&&Fh(e,t.type,qs(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Gg(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Fh(e,t,r){(t!=="number"||Qc(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var $a=Array.isArray;function bo(e,t,r,n){if(e=e.options,t){t={};for(var s=0;s<r.length;s++)t["$"+r[s]]=!0;for(r=0;r<e.length;r++)s=t.hasOwnProperty("$"+e[r].value),e[r].selected!==s&&(e[r].selected=s),s&&n&&(e[r].defaultSelected=!0)}else{for(r=""+qs(r),t=null,s=0;s<e.length;s++){if(e[s].value===r){e[s].selected=!0,n&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function Bh(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(se(91));return ct({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Qg(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(se(92));if($a(r)){if(1<r.length)throw Error(se(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:qs(r)}}function Gy(e,t){var r=qs(t.value),n=qs(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function Yg(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Qy(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function $h(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Qy(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ic,Yy=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,s){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(ic=ic||document.createElement("div"),ic.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ic.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function il(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Ka={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},oE=["Webkit","ms","Moz","O"];Object.keys(Ka).forEach(function(e){oE.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ka[t]=Ka[e]})});function Zy(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Ka.hasOwnProperty(e)&&Ka[e]?(""+t).trim():t+"px"}function Xy(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,s=Zy(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,s):e[r]=s}}var aE=ct({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Hh(e,t){if(t){if(aE[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(se(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(se(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(se(61))}if(t.style!=null&&typeof t.style!="object")throw Error(se(62))}}function zh(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Uh=null;function Dp(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Wh=null,wo=null,So=null;function Zg(e){if(e=Bl(e)){if(typeof Wh!="function")throw Error(se(280));var t=e.stateNode;t&&(t=Qu(t),Wh(e.stateNode,e.type,t))}}function Jy(e){wo?So?So.push(e):So=[e]:wo=e}function e0(){if(wo){var e=wo,t=So;if(So=wo=null,Zg(e),t)for(e=0;e<t.length;e++)Zg(t[e])}}function t0(e,t){return e(t)}function r0(){}var Md=!1;function n0(e,t,r){if(Md)return e(t,r);Md=!0;try{return t0(e,t,r)}finally{Md=!1,(wo!==null||So!==null)&&(r0(),e0())}}function ol(e,t){var r=e.stateNode;if(r===null)return null;var n=Qu(r);if(n===null)return null;r=n[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":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(se(231,t,typeof r));return r}var Vh=!1;if(Qn)try{var Sa={};Object.defineProperty(Sa,"passive",{get:function(){Vh=!0}}),window.addEventListener("test",Sa,Sa),window.removeEventListener("test",Sa,Sa)}catch{Vh=!1}function lE(e,t,r,n,s,i,l,a,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(r,u)}catch(g){this.onError(g)}}var Ga=!1,Yc=null,Zc=!1,qh=null,cE={onError:function(e){Ga=!0,Yc=e}};function uE(e,t,r,n,s,i,l,a,c){Ga=!1,Yc=null,lE.apply(cE,arguments)}function dE(e,t,r,n,s,i,l,a,c){if(uE.apply(this,arguments),Ga){if(Ga){var u=Yc;Ga=!1,Yc=null}else throw Error(se(198));Zc||(Zc=!0,qh=u)}}function Bi(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function s0(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 Xg(e){if(Bi(e)!==e)throw Error(se(188))}function hE(e){var t=e.alternate;if(!t){if(t=Bi(e),t===null)throw Error(se(188));return t!==e?null:e}for(var r=e,n=t;;){var s=r.return;if(s===null)break;var i=s.alternate;if(i===null){if(n=s.return,n!==null){r=n;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===r)return Xg(s),e;if(i===n)return Xg(s),t;i=i.sibling}throw Error(se(188))}if(r.return!==n.return)r=s,n=i;else{for(var l=!1,a=s.child;a;){if(a===r){l=!0,r=s,n=i;break}if(a===n){l=!0,n=s,r=i;break}a=a.sibling}if(!l){for(a=i.child;a;){if(a===r){l=!0,r=i,n=s;break}if(a===n){l=!0,n=i,r=s;break}a=a.sibling}if(!l)throw Error(se(189))}}if(r.alternate!==n)throw Error(se(190))}if(r.tag!==3)throw Error(se(188));return r.stateNode.current===r?e:t}function i0(e){return e=hE(e),e!==null?o0(e):null}function o0(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=o0(e);if(t!==null)return t;e=e.sibling}return null}var a0=Sr.unstable_scheduleCallback,Jg=Sr.unstable_cancelCallback,fE=Sr.unstable_shouldYield,pE=Sr.unstable_requestPaint,gt=Sr.unstable_now,mE=Sr.unstable_getCurrentPriorityLevel,Lp=Sr.unstable_ImmediatePriority,l0=Sr.unstable_UserBlockingPriority,Xc=Sr.unstable_NormalPriority,gE=Sr.unstable_LowPriority,c0=Sr.unstable_IdlePriority,Vu=null,Cn=null;function vE(e){if(Cn&&typeof Cn.onCommitFiberRoot=="function")try{Cn.onCommitFiberRoot(Vu,e,void 0,(e.current.flags&128)===128)}catch{}}var an=Math.clz32?Math.clz32:yE,_E=Math.log,xE=Math.LN2;function yE(e){return e>>>=0,e===0?32:31-(_E(e)/xE|0)|0}var oc=64,ac=4194304;function Ha(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Jc(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,s=e.suspendedLanes,i=e.pingedLanes,l=r&268435455;if(l!==0){var a=l&~s;a!==0?n=Ha(a):(i&=l,i!==0&&(n=Ha(i)))}else l=r&~s,l!==0?n=Ha(l):i!==0&&(n=Ha(i));if(n===0)return 0;if(t!==0&&t!==n&&!(t&s)&&(s=n&-n,i=t&-t,s>=i||s===16&&(i&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0<t;)r=31-an(t),s=1<<r,n|=e[r],t&=~s;return n}function bE(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function wE(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes;0<i;){var l=31-an(i),a=1<<l,c=s[l];c===-1?(!(a&r)||a&n)&&(s[l]=bE(a,t)):c<=t&&(e.expiredLanes|=a),i&=~a}}function Kh(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function u0(){var e=oc;return oc<<=1,!(oc&4194240)&&(oc=64),e}function Od(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Il(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-an(t),e[t]=r}function SE(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0<r;){var s=31-an(r),i=1<<s;t[s]=0,n[s]=-1,e[s]=-1,r&=~i}}function Mp(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-an(r),s=1<<n;s&t|e[n]&t&&(e[n]|=t),r&=~s}}var qe=0;function d0(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var h0,Op,f0,p0,m0,Gh=!1,lc=[],Ls=null,Ms=null,Os=null,al=new Map,ll=new Map,xs=[],CE="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function ev(e,t){switch(e){case"focusin":case"focusout":Ls=null;break;case"dragenter":case"dragleave":Ms=null;break;case"mouseover":case"mouseout":Os=null;break;case"pointerover":case"pointerout":al.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ll.delete(t.pointerId)}}function Ca(e,t,r,n,s,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:i,targetContainers:[s]},t!==null&&(t=Bl(t),t!==null&&Op(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function kE(e,t,r,n,s){switch(t){case"focusin":return Ls=Ca(Ls,e,t,r,n,s),!0;case"dragenter":return Ms=Ca(Ms,e,t,r,n,s),!0;case"mouseover":return Os=Ca(Os,e,t,r,n,s),!0;case"pointerover":var i=s.pointerId;return al.set(i,Ca(al.get(i)||null,e,t,r,n,s)),!0;case"gotpointercapture":return i=s.pointerId,ll.set(i,Ca(ll.get(i)||null,e,t,r,n,s)),!0}return!1}function g0(e){var t=di(e.target);if(t!==null){var r=Bi(t);if(r!==null){if(t=r.tag,t===13){if(t=s0(r),t!==null){e.blockedOn=t,m0(e.priority,function(){f0(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Lc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=Qh(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);Uh=n,r.target.dispatchEvent(n),Uh=null}else return t=Bl(r),t!==null&&Op(t),e.blockedOn=r,!1;t.shift()}return!0}function tv(e,t,r){Lc(e)&&r.delete(t)}function EE(){Gh=!1,Ls!==null&&Lc(Ls)&&(Ls=null),Ms!==null&&Lc(Ms)&&(Ms=null),Os!==null&&Lc(Os)&&(Os=null),al.forEach(tv),ll.forEach(tv)}function ka(e,t){e.blockedOn===t&&(e.blockedOn=null,Gh||(Gh=!0,Sr.unstable_scheduleCallback(Sr.unstable_NormalPriority,EE)))}function cl(e){function t(s){return ka(s,e)}if(0<lc.length){ka(lc[0],e);for(var r=1;r<lc.length;r++){var n=lc[r];n.blockedOn===e&&(n.blockedOn=null)}}for(Ls!==null&&ka(Ls,e),Ms!==null&&ka(Ms,e),Os!==null&&ka(Os,e),al.forEach(t),ll.forEach(t),r=0;r<xs.length;r++)n=xs[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<xs.length&&(r=xs[0],r.blockedOn===null);)g0(r),r.blockedOn===null&&xs.shift()}var Co=ns.ReactCurrentBatchConfig,eu=!0;function jE(e,t,r,n){var s=qe,i=Co.transition;Co.transition=null;try{qe=1,Ip(e,t,r,n)}finally{qe=s,Co.transition=i}}function NE(e,t,r,n){var s=qe,i=Co.transition;Co.transition=null;try{qe=4,Ip(e,t,r,n)}finally{qe=s,Co.transition=i}}function Ip(e,t,r,n){if(eu){var s=Qh(e,t,r,n);if(s===null)qd(e,t,n,tu,r),ev(e,n);else if(kE(s,e,t,r,n))n.stopPropagation();else if(ev(e,n),t&4&&-1<CE.indexOf(e)){for(;s!==null;){var i=Bl(s);if(i!==null&&h0(i),i=Qh(e,t,r,n),i===null&&qd(e,t,n,tu,r),i===s)break;s=i}s!==null&&n.stopPropagation()}else qd(e,t,n,null,r)}}var tu=null;function Qh(e,t,r,n){if(tu=null,e=Dp(n),e=di(e),e!==null)if(t=Bi(e),t===null)e=null;else if(r=t.tag,r===13){if(e=s0(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return tu=e,null}function v0(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(mE()){case Lp:return 1;case l0:return 4;case Xc:case gE:return 16;case c0:return 536870912;default:return 16}default:return 16}}var Ps=null,Fp=null,Mc=null;function _0(){if(Mc)return Mc;var e,t=Fp,r=t.length,n,s="value"in Ps?Ps.value:Ps.textContent,i=s.length;for(e=0;e<r&&t[e]===s[e];e++);var l=r-e;for(n=1;n<=l&&t[r-n]===s[i-n];n++);return Mc=s.slice(e,1<n?1-n:void 0)}function Oc(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 cc(){return!0}function rv(){return!1}function jr(e){function t(r,n,s,i,l){this._reactName=r,this._targetInst=s,this.type=n,this.nativeEvent=i,this.target=l,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(r=e[a],this[a]=r?r(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?cc:rv,this.isPropagationStopped=rv,this}return ct(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=cc)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=cc)},persist:function(){},isPersistent:cc}),t}var ua={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bp=jr(ua),Fl=ct({},ua,{view:0,detail:0}),RE=jr(Fl),Id,Fd,Ea,qu=ct({},Fl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:$p,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!==Ea&&(Ea&&e.type==="mousemove"?(Id=e.screenX-Ea.screenX,Fd=e.screenY-Ea.screenY):Fd=Id=0,Ea=e),Id)},movementY:function(e){return"movementY"in e?e.movementY:Fd}}),nv=jr(qu),PE=ct({},qu,{dataTransfer:0}),TE=jr(PE),AE=ct({},Fl,{relatedTarget:0}),Bd=jr(AE),DE=ct({},ua,{animationName:0,elapsedTime:0,pseudoElement:0}),LE=jr(DE),ME=ct({},ua,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),OE=jr(ME),IE=ct({},ua,{data:0}),sv=jr(IE),FE={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},BE={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"},$E={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function HE(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=$E[e])?!!t[e]:!1}function $p(){return HE}var zE=ct({},Fl,{key:function(e){if(e.key){var t=FE[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Oc(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?BE[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:$p,charCode:function(e){return e.type==="keypress"?Oc(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Oc(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),UE=jr(zE),WE=ct({},qu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),iv=jr(WE),VE=ct({},Fl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:$p}),qE=jr(VE),KE=ct({},ua,{propertyName:0,elapsedTime:0,pseudoElement:0}),GE=jr(KE),QE=ct({},qu,{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}),YE=jr(QE),ZE=[9,13,27,32],Hp=Qn&&"CompositionEvent"in window,Qa=null;Qn&&"documentMode"in document&&(Qa=document.documentMode);var XE=Qn&&"TextEvent"in window&&!Qa,x0=Qn&&(!Hp||Qa&&8<Qa&&11>=Qa),ov=" ",av=!1;function y0(e,t){switch(e){case"keyup":return ZE.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function b0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var co=!1;function JE(e,t){switch(e){case"compositionend":return b0(t);case"keypress":return t.which!==32?null:(av=!0,ov);case"textInput":return e=t.data,e===ov&&av?null:e;default:return null}}function ej(e,t){if(co)return e==="compositionend"||!Hp&&y0(e,t)?(e=_0(),Mc=Fp=Ps=null,co=!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 x0&&t.locale!=="ko"?null:t.data;default:return null}}var tj={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 lv(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!tj[e.type]:t==="textarea"}function w0(e,t,r,n){Jy(n),t=ru(t,"onChange"),0<t.length&&(r=new Bp("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var Ya=null,ul=null;function rj(e){D0(e,0)}function Ku(e){var t=fo(e);if(qy(t))return e}function nj(e,t){if(e==="change")return t}var S0=!1;if(Qn){var $d;if(Qn){var Hd="oninput"in document;if(!Hd){var cv=document.createElement("div");cv.setAttribute("oninput","return;"),Hd=typeof cv.oninput=="function"}$d=Hd}else $d=!1;S0=$d&&(!document.documentMode||9<document.documentMode)}function uv(){Ya&&(Ya.detachEvent("onpropertychange",C0),ul=Ya=null)}function C0(e){if(e.propertyName==="value"&&Ku(ul)){var t=[];w0(t,ul,e,Dp(e)),n0(rj,t)}}function sj(e,t,r){e==="focusin"?(uv(),Ya=t,ul=r,Ya.attachEvent("onpropertychange",C0)):e==="focusout"&&uv()}function ij(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ku(ul)}function oj(e,t){if(e==="click")return Ku(t)}function aj(e,t){if(e==="input"||e==="change")return Ku(t)}function lj(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var cn=typeof Object.is=="function"?Object.is:lj;function dl(e,t){if(cn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var s=r[n];if(!Th.call(t,s)||!cn(e[s],t[s]))return!1}return!0}function dv(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function hv(e,t){var r=dv(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=dv(r)}}function k0(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?k0(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function E0(){for(var e=window,t=Qc();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Qc(e.document)}return t}function zp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function cj(e){var t=E0(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&k0(r.ownerDocument.documentElement,r)){if(n!==null&&zp(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=r.textContent.length,i=Math.min(n.start,s);n=n.end===void 0?i:Math.min(n.end,s),!e.extend&&i>n&&(s=n,n=i,i=s),s=hv(r,i);var l=hv(r,n);s&&l&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),i>n?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var uj=Qn&&"documentMode"in document&&11>=document.documentMode,uo=null,Yh=null,Za=null,Zh=!1;function fv(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Zh||uo==null||uo!==Qc(n)||(n=uo,"selectionStart"in n&&zp(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Za&&dl(Za,n)||(Za=n,n=ru(Yh,"onSelect"),0<n.length&&(t=new Bp("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=uo)))}function uc(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var ho={animationend:uc("Animation","AnimationEnd"),animationiteration:uc("Animation","AnimationIteration"),animationstart:uc("Animation","AnimationStart"),transitionend:uc("Transition","TransitionEnd")},zd={},j0={};Qn&&(j0=document.createElement("div").style,"AnimationEvent"in window||(delete ho.animationend.animation,delete ho.animationiteration.animation,delete ho.animationstart.animation),"TransitionEvent"in window||delete ho.transitionend.transition);function Gu(e){if(zd[e])return zd[e];if(!ho[e])return e;var t=ho[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in j0)return zd[e]=t[r];return e}var N0=Gu("animationend"),R0=Gu("animationiteration"),P0=Gu("animationstart"),T0=Gu("transitionend"),A0=new Map,pv="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function ei(e,t){A0.set(e,t),Fi(t,[e])}for(var Ud=0;Ud<pv.length;Ud++){var Wd=pv[Ud],dj=Wd.toLowerCase(),hj=Wd[0].toUpperCase()+Wd.slice(1);ei(dj,"on"+hj)}ei(N0,"onAnimationEnd");ei(R0,"onAnimationIteration");ei(P0,"onAnimationStart");ei("dblclick","onDoubleClick");ei("focusin","onFocus");ei("focusout","onBlur");ei(T0,"onTransitionEnd");qo("onMouseEnter",["mouseout","mouseover"]);qo("onMouseLeave",["mouseout","mouseover"]);qo("onPointerEnter",["pointerout","pointerover"]);qo("onPointerLeave",["pointerout","pointerover"]);Fi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Fi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Fi("onBeforeInput",["compositionend","keypress","textInput","paste"]);Fi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Fi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Fi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var za="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(" "),fj=new Set("cancel close invalid load scroll toggle".split(" ").concat(za));function mv(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,dE(n,t,void 0,e),e.currentTarget=null}function D0(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],s=n.event;n=n.listeners;e:{var i=void 0;if(t)for(var l=n.length-1;0<=l;l--){var a=n[l],c=a.instance,u=a.currentTarget;if(a=a.listener,c!==i&&s.isPropagationStopped())break e;mv(s,a,u),i=c}else for(l=0;l<n.length;l++){if(a=n[l],c=a.instance,u=a.currentTarget,a=a.listener,c!==i&&s.isPropagationStopped())break e;mv(s,a,u),i=c}}}if(Zc)throw e=qh,Zc=!1,qh=null,e}function Je(e,t){var r=t[rf];r===void 0&&(r=t[rf]=new Set);var n=e+"__bubble";r.has(n)||(L0(t,e,2,!1),r.add(n))}function Vd(e,t,r){var n=0;t&&(n|=4),L0(r,e,n,t)}var dc="_reactListening"+Math.random().toString(36).slice(2);function hl(e){if(!e[dc]){e[dc]=!0,Hy.forEach(function(r){r!=="selectionchange"&&(fj.has(r)||Vd(r,!1,e),Vd(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[dc]||(t[dc]=!0,Vd("selectionchange",!1,t))}}function L0(e,t,r,n){switch(v0(t)){case 1:var s=jE;break;case 4:s=NE;break;default:s=Ip}r=s.bind(null,t,r,e),s=void 0,!Vh||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),n?s!==void 0?e.addEventListener(t,r,{capture:!0,passive:s}):e.addEventListener(t,r,!0):s!==void 0?e.addEventListener(t,r,{passive:s}):e.addEventListener(t,r,!1)}function qd(e,t,r,n,s){var i=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var l=n.tag;if(l===3||l===4){var a=n.stateNode.containerInfo;if(a===s||a.nodeType===8&&a.parentNode===s)break;if(l===4)for(l=n.return;l!==null;){var c=l.tag;if((c===3||c===4)&&(c=l.stateNode.containerInfo,c===s||c.nodeType===8&&c.parentNode===s))return;l=l.return}for(;a!==null;){if(l=di(a),l===null)return;if(c=l.tag,c===5||c===6){n=i=l;continue e}a=a.parentNode}}n=n.return}n0(function(){var u=i,g=Dp(r),d=[];e:{var _=A0.get(e);if(_!==void 0){var v=Bp,x=e;switch(e){case"keypress":if(Oc(r)===0)break e;case"keydown":case"keyup":v=UE;break;case"focusin":x="focus",v=Bd;break;case"focusout":x="blur",v=Bd;break;case"beforeblur":case"afterblur":v=Bd;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":v=nv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":v=TE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":v=qE;break;case N0:case R0:case P0:v=LE;break;case T0:v=GE;break;case"scroll":v=RE;break;case"wheel":v=YE;break;case"copy":case"cut":case"paste":v=OE;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":v=iv}var y=(t&4)!==0,f=!y&&e==="scroll",p=y?_!==null?_+"Capture":null:_;y=[];for(var h=u,m;h!==null;){m=h;var b=m.stateNode;if(m.tag===5&&b!==null&&(m=b,p!==null&&(b=ol(h,p),b!=null&&y.push(fl(h,b,m)))),f)break;h=h.return}0<y.length&&(_=new v(_,x,null,r,g),d.push({event:_,listeners:y}))}}if(!(t&7)){e:{if(_=e==="mouseover"||e==="pointerover",v=e==="mouseout"||e==="pointerout",_&&r!==Uh&&(x=r.relatedTarget||r.fromElement)&&(di(x)||x[Yn]))break e;if((v||_)&&(_=g.window===g?g:(_=g.ownerDocument)?_.defaultView||_.parentWindow:window,v?(x=r.relatedTarget||r.toElement,v=u,x=x?di(x):null,x!==null&&(f=Bi(x),x!==f||x.tag!==5&&x.tag!==6)&&(x=null)):(v=null,x=u),v!==x)){if(y=nv,b="onMouseLeave",p="onMouseEnter",h="mouse",(e==="pointerout"||e==="pointerover")&&(y=iv,b="onPointerLeave",p="onPointerEnter",h="pointer"),f=v==null?_:fo(v),m=x==null?_:fo(x),_=new y(b,h+"leave",v,r,g),_.target=f,_.relatedTarget=m,b=null,di(g)===u&&(y=new y(p,h+"enter",x,r,g),y.target=m,y.relatedTarget=f,b=y),f=b,v&&x)t:{for(y=v,p=x,h=0,m=y;m;m=Qi(m))h++;for(m=0,b=p;b;b=Qi(b))m++;for(;0<h-m;)y=Qi(y),h--;for(;0<m-h;)p=Qi(p),m--;for(;h--;){if(y===p||p!==null&&y===p.alternate)break t;y=Qi(y),p=Qi(p)}y=null}else y=null;v!==null&&gv(d,_,v,y,!1),x!==null&&f!==null&&gv(d,f,x,y,!0)}}e:{if(_=u?fo(u):window,v=_.nodeName&&_.nodeName.toLowerCase(),v==="select"||v==="input"&&_.type==="file")var w=nj;else if(lv(_))if(S0)w=aj;else{w=ij;var k=sj}else(v=_.nodeName)&&v.toLowerCase()==="input"&&(_.type==="checkbox"||_.type==="radio")&&(w=oj);if(w&&(w=w(e,u))){w0(d,w,r,g);break e}k&&k(e,_,u),e==="focusout"&&(k=_._wrapperState)&&k.controlled&&_.type==="number"&&Fh(_,"number",_.value)}switch(k=u?fo(u):window,e){case"focusin":(lv(k)||k.contentEditable==="true")&&(uo=k,Yh=u,Za=null);break;case"focusout":Za=Yh=uo=null;break;case"mousedown":Zh=!0;break;case"contextmenu":case"mouseup":case"dragend":Zh=!1,fv(d,r,g);break;case"selectionchange":if(uj)break;case"keydown":case"keyup":fv(d,r,g)}var j;if(Hp)e:{switch(e){case"compositionstart":var S="onCompositionStart";break e;case"compositionend":S="onCompositionEnd";break e;case"compositionupdate":S="onCompositionUpdate";break e}S=void 0}else co?y0(e,r)&&(S="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(S="onCompositionStart");S&&(x0&&r.locale!=="ko"&&(co||S!=="onCompositionStart"?S==="onCompositionEnd"&&co&&(j=_0()):(Ps=g,Fp="value"in Ps?Ps.value:Ps.textContent,co=!0)),k=ru(u,S),0<k.length&&(S=new sv(S,e,null,r,g),d.push({event:S,listeners:k}),j?S.data=j:(j=b0(r),j!==null&&(S.data=j)))),(j=XE?JE(e,r):ej(e,r))&&(u=ru(u,"onBeforeInput"),0<u.length&&(g=new sv("onBeforeInput","beforeinput",null,r,g),d.push({event:g,listeners:u}),g.data=j))}D0(d,t)})}function fl(e,t,r){return{instance:e,listener:t,currentTarget:r}}function ru(e,t){for(var r=t+"Capture",n=[];e!==null;){var s=e,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=ol(e,r),i!=null&&n.unshift(fl(e,i,s)),i=ol(e,t),i!=null&&n.push(fl(e,i,s))),e=e.return}return n}function Qi(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function gv(e,t,r,n,s){for(var i=t._reactName,l=[];r!==null&&r!==n;){var a=r,c=a.alternate,u=a.stateNode;if(c!==null&&c===n)break;a.tag===5&&u!==null&&(a=u,s?(c=ol(r,i),c!=null&&l.unshift(fl(r,c,a))):s||(c=ol(r,i),c!=null&&l.push(fl(r,c,a)))),r=r.return}l.length!==0&&e.push({event:t,listeners:l})}var pj=/\r\n?/g,mj=/\u0000|\uFFFD/g;function vv(e){return(typeof e=="string"?e:""+e).replace(pj,`
38
+ `).replace(mj,"")}function hc(e,t,r){if(t=vv(t),vv(e)!==t&&r)throw Error(se(425))}function nu(){}var Xh=null,Jh=null;function ef(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var tf=typeof setTimeout=="function"?setTimeout:void 0,gj=typeof clearTimeout=="function"?clearTimeout:void 0,_v=typeof Promise=="function"?Promise:void 0,vj=typeof queueMicrotask=="function"?queueMicrotask:typeof _v<"u"?function(e){return _v.resolve(null).then(e).catch(_j)}:tf;function _j(e){setTimeout(function(){throw e})}function Kd(e,t){var r=t,n=0;do{var s=r.nextSibling;if(e.removeChild(r),s&&s.nodeType===8)if(r=s.data,r==="/$"){if(n===0){e.removeChild(s),cl(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=s}while(r);cl(t)}function Is(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==="$?")break;if(t==="/$")return null}}return e}function xv(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var da=Math.random().toString(36).slice(2),bn="__reactFiber$"+da,pl="__reactProps$"+da,Yn="__reactContainer$"+da,rf="__reactEvents$"+da,xj="__reactListeners$"+da,yj="__reactHandles$"+da;function di(e){var t=e[bn];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Yn]||r[bn]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=xv(e);e!==null;){if(r=e[bn])return r;e=xv(e)}return t}e=r,r=e.parentNode}return null}function Bl(e){return e=e[bn]||e[Yn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function fo(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(se(33))}function Qu(e){return e[pl]||null}var nf=[],po=-1;function ti(e){return{current:e}}function tt(e){0>po||(e.current=nf[po],nf[po]=null,po--)}function Ye(e,t){po++,nf[po]=e.current,e.current=t}var Ks={},Ut=ti(Ks),ir=ti(!1),Ri=Ks;function Ko(e,t){var r=e.type.contextTypes;if(!r)return Ks;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in r)s[i]=t[i];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function or(e){return e=e.childContextTypes,e!=null}function su(){tt(ir),tt(Ut)}function yv(e,t,r){if(Ut.current!==Ks)throw Error(se(168));Ye(Ut,t),Ye(ir,r)}function M0(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var s in n)if(!(s in t))throw Error(se(108,sE(e)||"Unknown",s));return ct({},r,n)}function iu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ks,Ri=Ut.current,Ye(Ut,e),Ye(ir,ir.current),!0}function bv(e,t,r){var n=e.stateNode;if(!n)throw Error(se(169));r?(e=M0(e,t,Ri),n.__reactInternalMemoizedMergedChildContext=e,tt(ir),tt(Ut),Ye(Ut,e)):tt(ir),Ye(ir,r)}var Bn=null,Yu=!1,Gd=!1;function O0(e){Bn===null?Bn=[e]:Bn.push(e)}function bj(e){Yu=!0,O0(e)}function ri(){if(!Gd&&Bn!==null){Gd=!0;var e=0,t=qe;try{var r=Bn;for(qe=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}Bn=null,Yu=!1}catch(s){throw Bn!==null&&(Bn=Bn.slice(e+1)),a0(Lp,ri),s}finally{qe=t,Gd=!1}}return null}var mo=[],go=0,ou=null,au=0,Rr=[],Pr=0,Pi=null,Wn=1,Vn="";function ci(e,t){mo[go++]=au,mo[go++]=ou,ou=e,au=t}function I0(e,t,r){Rr[Pr++]=Wn,Rr[Pr++]=Vn,Rr[Pr++]=Pi,Pi=e;var n=Wn;e=Vn;var s=32-an(n)-1;n&=~(1<<s),r+=1;var i=32-an(t)+s;if(30<i){var l=s-s%5;i=(n&(1<<l)-1).toString(32),n>>=l,s-=l,Wn=1<<32-an(t)+s|r<<s|n,Vn=i+e}else Wn=1<<i|r<<s|n,Vn=e}function Up(e){e.return!==null&&(ci(e,1),I0(e,1,0))}function Wp(e){for(;e===ou;)ou=mo[--go],mo[go]=null,au=mo[--go],mo[go]=null;for(;e===Pi;)Pi=Rr[--Pr],Rr[Pr]=null,Vn=Rr[--Pr],Rr[Pr]=null,Wn=Rr[--Pr],Rr[Pr]=null}var xr=null,_r=null,st=!1,nn=null;function F0(e,t){var r=Mr(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function wv(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,xr=e,_r=Is(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,xr=e,_r=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Pi!==null?{id:Wn,overflow:Vn}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=Mr(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,xr=e,_r=null,!0):!1;default:return!1}}function sf(e){return(e.mode&1)!==0&&(e.flags&128)===0}function of(e){if(st){var t=_r;if(t){var r=t;if(!wv(e,t)){if(sf(e))throw Error(se(418));t=Is(r.nextSibling);var n=xr;t&&wv(e,t)?F0(n,r):(e.flags=e.flags&-4097|2,st=!1,xr=e)}}else{if(sf(e))throw Error(se(418));e.flags=e.flags&-4097|2,st=!1,xr=e}}}function Sv(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;xr=e}function fc(e){if(e!==xr)return!1;if(!st)return Sv(e),st=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!ef(e.type,e.memoizedProps)),t&&(t=_r)){if(sf(e))throw B0(),Error(se(418));for(;t;)F0(e,t),t=Is(t.nextSibling)}if(Sv(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(se(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){_r=Is(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}_r=null}}else _r=xr?Is(e.stateNode.nextSibling):null;return!0}function B0(){for(var e=_r;e;)e=Is(e.nextSibling)}function Go(){_r=xr=null,st=!1}function Vp(e){nn===null?nn=[e]:nn.push(e)}var wj=ns.ReactCurrentBatchConfig;function ja(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(se(309));var n=r.stateNode}if(!n)throw Error(se(147,e));var s=n,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(l){var a=s.refs;l===null?delete a[i]:a[i]=l},t._stringRef=i,t)}if(typeof e!="string")throw Error(se(284));if(!r._owner)throw Error(se(290,e))}return e}function pc(e,t){throw e=Object.prototype.toString.call(t),Error(se(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Cv(e){var t=e._init;return t(e._payload)}function $0(e){function t(p,h){if(e){var m=p.deletions;m===null?(p.deletions=[h],p.flags|=16):m.push(h)}}function r(p,h){if(!e)return null;for(;h!==null;)t(p,h),h=h.sibling;return null}function n(p,h){for(p=new Map;h!==null;)h.key!==null?p.set(h.key,h):p.set(h.index,h),h=h.sibling;return p}function s(p,h){return p=Hs(p,h),p.index=0,p.sibling=null,p}function i(p,h,m){return p.index=m,e?(m=p.alternate,m!==null?(m=m.index,m<h?(p.flags|=2,h):m):(p.flags|=2,h)):(p.flags|=1048576,h)}function l(p){return e&&p.alternate===null&&(p.flags|=2),p}function a(p,h,m,b){return h===null||h.tag!==6?(h=th(m,p.mode,b),h.return=p,h):(h=s(h,m),h.return=p,h)}function c(p,h,m,b){var w=m.type;return w===lo?g(p,h,m.props.children,b,m.key):h!==null&&(h.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===ms&&Cv(w)===h.type)?(b=s(h,m.props),b.ref=ja(p,h,m),b.return=p,b):(b=Uc(m.type,m.key,m.props,null,p.mode,b),b.ref=ja(p,h,m),b.return=p,b)}function u(p,h,m,b){return h===null||h.tag!==4||h.stateNode.containerInfo!==m.containerInfo||h.stateNode.implementation!==m.implementation?(h=rh(m,p.mode,b),h.return=p,h):(h=s(h,m.children||[]),h.return=p,h)}function g(p,h,m,b,w){return h===null||h.tag!==7?(h=Ni(m,p.mode,b,w),h.return=p,h):(h=s(h,m),h.return=p,h)}function d(p,h,m){if(typeof h=="string"&&h!==""||typeof h=="number")return h=th(""+h,p.mode,m),h.return=p,h;if(typeof h=="object"&&h!==null){switch(h.$$typeof){case nc:return m=Uc(h.type,h.key,h.props,null,p.mode,m),m.ref=ja(p,null,h),m.return=p,m;case ao:return h=rh(h,p.mode,m),h.return=p,h;case ms:var b=h._init;return d(p,b(h._payload),m)}if($a(h)||wa(h))return h=Ni(h,p.mode,m,null),h.return=p,h;pc(p,h)}return null}function _(p,h,m,b){var w=h!==null?h.key:null;if(typeof m=="string"&&m!==""||typeof m=="number")return w!==null?null:a(p,h,""+m,b);if(typeof m=="object"&&m!==null){switch(m.$$typeof){case nc:return m.key===w?c(p,h,m,b):null;case ao:return m.key===w?u(p,h,m,b):null;case ms:return w=m._init,_(p,h,w(m._payload),b)}if($a(m)||wa(m))return w!==null?null:g(p,h,m,b,null);pc(p,m)}return null}function v(p,h,m,b,w){if(typeof b=="string"&&b!==""||typeof b=="number")return p=p.get(m)||null,a(h,p,""+b,w);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case nc:return p=p.get(b.key===null?m:b.key)||null,c(h,p,b,w);case ao:return p=p.get(b.key===null?m:b.key)||null,u(h,p,b,w);case ms:var k=b._init;return v(p,h,m,k(b._payload),w)}if($a(b)||wa(b))return p=p.get(m)||null,g(h,p,b,w,null);pc(h,b)}return null}function x(p,h,m,b){for(var w=null,k=null,j=h,S=h=0,E=null;j!==null&&S<m.length;S++){j.index>S?(E=j,j=null):E=j.sibling;var R=_(p,j,m[S],b);if(R===null){j===null&&(j=E);break}e&&j&&R.alternate===null&&t(p,j),h=i(R,h,S),k===null?w=R:k.sibling=R,k=R,j=E}if(S===m.length)return r(p,j),st&&ci(p,S),w;if(j===null){for(;S<m.length;S++)j=d(p,m[S],b),j!==null&&(h=i(j,h,S),k===null?w=j:k.sibling=j,k=j);return st&&ci(p,S),w}for(j=n(p,j);S<m.length;S++)E=v(j,p,S,m[S],b),E!==null&&(e&&E.alternate!==null&&j.delete(E.key===null?S:E.key),h=i(E,h,S),k===null?w=E:k.sibling=E,k=E);return e&&j.forEach(function(M){return t(p,M)}),st&&ci(p,S),w}function y(p,h,m,b){var w=wa(m);if(typeof w!="function")throw Error(se(150));if(m=w.call(m),m==null)throw Error(se(151));for(var k=w=null,j=h,S=h=0,E=null,R=m.next();j!==null&&!R.done;S++,R=m.next()){j.index>S?(E=j,j=null):E=j.sibling;var M=_(p,j,R.value,b);if(M===null){j===null&&(j=E);break}e&&j&&M.alternate===null&&t(p,j),h=i(M,h,S),k===null?w=M:k.sibling=M,k=M,j=E}if(R.done)return r(p,j),st&&ci(p,S),w;if(j===null){for(;!R.done;S++,R=m.next())R=d(p,R.value,b),R!==null&&(h=i(R,h,S),k===null?w=R:k.sibling=R,k=R);return st&&ci(p,S),w}for(j=n(p,j);!R.done;S++,R=m.next())R=v(j,p,S,R.value,b),R!==null&&(e&&R.alternate!==null&&j.delete(R.key===null?S:R.key),h=i(R,h,S),k===null?w=R:k.sibling=R,k=R);return e&&j.forEach(function(A){return t(p,A)}),st&&ci(p,S),w}function f(p,h,m,b){if(typeof m=="object"&&m!==null&&m.type===lo&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case nc:e:{for(var w=m.key,k=h;k!==null;){if(k.key===w){if(w=m.type,w===lo){if(k.tag===7){r(p,k.sibling),h=s(k,m.props.children),h.return=p,p=h;break e}}else if(k.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===ms&&Cv(w)===k.type){r(p,k.sibling),h=s(k,m.props),h.ref=ja(p,k,m),h.return=p,p=h;break e}r(p,k);break}else t(p,k);k=k.sibling}m.type===lo?(h=Ni(m.props.children,p.mode,b,m.key),h.return=p,p=h):(b=Uc(m.type,m.key,m.props,null,p.mode,b),b.ref=ja(p,h,m),b.return=p,p=b)}return l(p);case ao:e:{for(k=m.key;h!==null;){if(h.key===k)if(h.tag===4&&h.stateNode.containerInfo===m.containerInfo&&h.stateNode.implementation===m.implementation){r(p,h.sibling),h=s(h,m.children||[]),h.return=p,p=h;break e}else{r(p,h);break}else t(p,h);h=h.sibling}h=rh(m,p.mode,b),h.return=p,p=h}return l(p);case ms:return k=m._init,f(p,h,k(m._payload),b)}if($a(m))return x(p,h,m,b);if(wa(m))return y(p,h,m,b);pc(p,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,h!==null&&h.tag===6?(r(p,h.sibling),h=s(h,m),h.return=p,p=h):(r(p,h),h=th(m,p.mode,b),h.return=p,p=h),l(p)):r(p,h)}return f}var Qo=$0(!0),H0=$0(!1),lu=ti(null),cu=null,vo=null,qp=null;function Kp(){qp=vo=cu=null}function Gp(e){var t=lu.current;tt(lu),e._currentValue=t}function af(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function ko(e,t){cu=e,qp=vo=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(sr=!0),e.firstContext=null)}function Hr(e){var t=e._currentValue;if(qp!==e)if(e={context:e,memoizedValue:t,next:null},vo===null){if(cu===null)throw Error(se(308));vo=e,cu.dependencies={lanes:0,firstContext:e}}else vo=vo.next=e;return t}var hi=null;function Qp(e){hi===null?hi=[e]:hi.push(e)}function z0(e,t,r,n){var s=t.interleaved;return s===null?(r.next=r,Qp(t)):(r.next=s.next,s.next=r),t.interleaved=r,Zn(e,n)}function Zn(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var gs=!1;function Yp(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function U0(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function qn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Fs(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,Oe&2){var s=n.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),n.pending=t,Zn(e,r)}return s=n.interleaved,s===null?(t.next=t,Qp(n)):(t.next=s.next,s.next=t),n.interleaved=t,Zn(e,r)}function Ic(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Mp(e,r)}}function kv(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var s=null,i=null;if(r=r.firstBaseUpdate,r!==null){do{var l={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};i===null?s=i=l:i=i.next=l,r=r.next}while(r!==null);i===null?s=i=t:i=i.next=t}else s=i=t;r={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function uu(e,t,r,n){var s=e.updateQueue;gs=!1;var i=s.firstBaseUpdate,l=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var c=a,u=c.next;c.next=null,l===null?i=u:l.next=u,l=c;var g=e.alternate;g!==null&&(g=g.updateQueue,a=g.lastBaseUpdate,a!==l&&(a===null?g.firstBaseUpdate=u:a.next=u,g.lastBaseUpdate=c))}if(i!==null){var d=s.baseState;l=0,g=u=c=null,a=i;do{var _=a.lane,v=a.eventTime;if((n&_)===_){g!==null&&(g=g.next={eventTime:v,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var x=e,y=a;switch(_=t,v=r,y.tag){case 1:if(x=y.payload,typeof x=="function"){d=x.call(v,d,_);break e}d=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=y.payload,_=typeof x=="function"?x.call(v,d,_):x,_==null)break e;d=ct({},d,_);break e;case 2:gs=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,_=s.effects,_===null?s.effects=[a]:_.push(a))}else v={eventTime:v,lane:_,tag:a.tag,payload:a.payload,callback:a.callback,next:null},g===null?(u=g=v,c=d):g=g.next=v,l|=_;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;_=a,a=_.next,_.next=null,s.lastBaseUpdate=_,s.shared.pending=null}}while(!0);if(g===null&&(c=d),s.baseState=c,s.firstBaseUpdate=u,s.lastBaseUpdate=g,t=s.shared.interleaved,t!==null){s=t;do l|=s.lane,s=s.next;while(s!==t)}else i===null&&(s.shared.lanes=0);Ai|=l,e.lanes=l,e.memoizedState=d}}function Ev(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],s=n.callback;if(s!==null){if(n.callback=null,n=r,typeof s!="function")throw Error(se(191,s));s.call(n)}}}var $l={},kn=ti($l),ml=ti($l),gl=ti($l);function fi(e){if(e===$l)throw Error(se(174));return e}function Zp(e,t){switch(Ye(gl,t),Ye(ml,e),Ye(kn,$l),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:$h(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=$h(t,e)}tt(kn),Ye(kn,t)}function Yo(){tt(kn),tt(ml),tt(gl)}function W0(e){fi(gl.current);var t=fi(kn.current),r=$h(t,e.type);t!==r&&(Ye(ml,e),Ye(kn,r))}function Xp(e){ml.current===e&&(tt(kn),tt(ml))}var ot=ti(0);function du(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)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 Qd=[];function Jp(){for(var e=0;e<Qd.length;e++)Qd[e]._workInProgressVersionPrimary=null;Qd.length=0}var Fc=ns.ReactCurrentDispatcher,Yd=ns.ReactCurrentBatchConfig,Ti=0,lt=null,bt=null,Et=null,hu=!1,Xa=!1,vl=0,Sj=0;function Mt(){throw Error(se(321))}function em(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!cn(e[r],t[r]))return!1;return!0}function tm(e,t,r,n,s,i){if(Ti=i,lt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Fc.current=e===null||e.memoizedState===null?jj:Nj,e=r(n,s),Xa){i=0;do{if(Xa=!1,vl=0,25<=i)throw Error(se(301));i+=1,Et=bt=null,t.updateQueue=null,Fc.current=Rj,e=r(n,s)}while(Xa)}if(Fc.current=fu,t=bt!==null&&bt.next!==null,Ti=0,Et=bt=lt=null,hu=!1,t)throw Error(se(300));return e}function rm(){var e=vl!==0;return vl=0,e}function vn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Et===null?lt.memoizedState=Et=e:Et=Et.next=e,Et}function zr(){if(bt===null){var e=lt.alternate;e=e!==null?e.memoizedState:null}else e=bt.next;var t=Et===null?lt.memoizedState:Et.next;if(t!==null)Et=t,bt=e;else{if(e===null)throw Error(se(310));bt=e,e={memoizedState:bt.memoizedState,baseState:bt.baseState,baseQueue:bt.baseQueue,queue:bt.queue,next:null},Et===null?lt.memoizedState=Et=e:Et=Et.next=e}return Et}function _l(e,t){return typeof t=="function"?t(e):t}function Zd(e){var t=zr(),r=t.queue;if(r===null)throw Error(se(311));r.lastRenderedReducer=e;var n=bt,s=n.baseQueue,i=r.pending;if(i!==null){if(s!==null){var l=s.next;s.next=i.next,i.next=l}n.baseQueue=s=i,r.pending=null}if(s!==null){i=s.next,n=n.baseState;var a=l=null,c=null,u=i;do{var g=u.lane;if((Ti&g)===g)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),n=u.hasEagerState?u.eagerState:e(n,u.action);else{var d={lane:g,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(a=c=d,l=n):c=c.next=d,lt.lanes|=g,Ai|=g}u=u.next}while(u!==null&&u!==i);c===null?l=n:c.next=a,cn(n,t.memoizedState)||(sr=!0),t.memoizedState=n,t.baseState=l,t.baseQueue=c,r.lastRenderedState=n}if(e=r.interleaved,e!==null){s=e;do i=s.lane,lt.lanes|=i,Ai|=i,s=s.next;while(s!==e)}else s===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Xd(e){var t=zr(),r=t.queue;if(r===null)throw Error(se(311));r.lastRenderedReducer=e;var n=r.dispatch,s=r.pending,i=t.memoizedState;if(s!==null){r.pending=null;var l=s=s.next;do i=e(i,l.action),l=l.next;while(l!==s);cn(i,t.memoizedState)||(sr=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),r.lastRenderedState=i}return[i,n]}function V0(){}function q0(e,t){var r=lt,n=zr(),s=t(),i=!cn(n.memoizedState,s);if(i&&(n.memoizedState=s,sr=!0),n=n.queue,nm(Q0.bind(null,r,n,e),[e]),n.getSnapshot!==t||i||Et!==null&&Et.memoizedState.tag&1){if(r.flags|=2048,xl(9,G0.bind(null,r,n,s,t),void 0,null),jt===null)throw Error(se(349));Ti&30||K0(r,t,s)}return s}function K0(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=lt.updateQueue,t===null?(t={lastEffect:null,stores:null},lt.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function G0(e,t,r,n){t.value=r,t.getSnapshot=n,Y0(t)&&Z0(e)}function Q0(e,t,r){return r(function(){Y0(t)&&Z0(e)})}function Y0(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!cn(e,r)}catch{return!0}}function Z0(e){var t=Zn(e,1);t!==null&&ln(t,e,1,-1)}function jv(e){var t=vn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:_l,lastRenderedState:e},t.queue=e,e=e.dispatch=Ej.bind(null,lt,e),[t.memoizedState,e]}function xl(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=lt.updateQueue,t===null?(t={lastEffect:null,stores:null},lt.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function X0(){return zr().memoizedState}function Bc(e,t,r,n){var s=vn();lt.flags|=e,s.memoizedState=xl(1|t,r,void 0,n===void 0?null:n)}function Zu(e,t,r,n){var s=zr();n=n===void 0?null:n;var i=void 0;if(bt!==null){var l=bt.memoizedState;if(i=l.destroy,n!==null&&em(n,l.deps)){s.memoizedState=xl(t,r,i,n);return}}lt.flags|=e,s.memoizedState=xl(1|t,r,i,n)}function Nv(e,t){return Bc(8390656,8,e,t)}function nm(e,t){return Zu(2048,8,e,t)}function J0(e,t){return Zu(4,2,e,t)}function eb(e,t){return Zu(4,4,e,t)}function tb(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function rb(e,t,r){return r=r!=null?r.concat([e]):null,Zu(4,4,tb.bind(null,t,e),r)}function sm(){}function nb(e,t){var r=zr();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&em(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function sb(e,t){var r=zr();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&em(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function ib(e,t,r){return Ti&21?(cn(r,t)||(r=u0(),lt.lanes|=r,Ai|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,sr=!0),e.memoizedState=r)}function Cj(e,t){var r=qe;qe=r!==0&&4>r?r:4,e(!0);var n=Yd.transition;Yd.transition={};try{e(!1),t()}finally{qe=r,Yd.transition=n}}function ob(){return zr().memoizedState}function kj(e,t,r){var n=$s(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},ab(e))lb(t,r);else if(r=z0(e,t,r,n),r!==null){var s=Qt();ln(r,e,n,s),cb(r,t,n)}}function Ej(e,t,r){var n=$s(e),s={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(ab(e))lb(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var l=t.lastRenderedState,a=i(l,r);if(s.hasEagerState=!0,s.eagerState=a,cn(a,l)){var c=t.interleaved;c===null?(s.next=s,Qp(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}r=z0(e,t,s,n),r!==null&&(s=Qt(),ln(r,e,n,s),cb(r,t,n))}}function ab(e){var t=e.alternate;return e===lt||t!==null&&t===lt}function lb(e,t){Xa=hu=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function cb(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Mp(e,r)}}var fu={readContext:Hr,useCallback:Mt,useContext:Mt,useEffect:Mt,useImperativeHandle:Mt,useInsertionEffect:Mt,useLayoutEffect:Mt,useMemo:Mt,useReducer:Mt,useRef:Mt,useState:Mt,useDebugValue:Mt,useDeferredValue:Mt,useTransition:Mt,useMutableSource:Mt,useSyncExternalStore:Mt,useId:Mt,unstable_isNewReconciler:!1},jj={readContext:Hr,useCallback:function(e,t){return vn().memoizedState=[e,t===void 0?null:t],e},useContext:Hr,useEffect:Nv,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Bc(4194308,4,tb.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Bc(4194308,4,e,t)},useInsertionEffect:function(e,t){return Bc(4,2,e,t)},useMemo:function(e,t){var r=vn();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=vn();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=kj.bind(null,lt,e),[n.memoizedState,e]},useRef:function(e){var t=vn();return e={current:e},t.memoizedState=e},useState:jv,useDebugValue:sm,useDeferredValue:function(e){return vn().memoizedState=e},useTransition:function(){var e=jv(!1),t=e[0];return e=Cj.bind(null,e[1]),vn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=lt,s=vn();if(st){if(r===void 0)throw Error(se(407));r=r()}else{if(r=t(),jt===null)throw Error(se(349));Ti&30||K0(n,t,r)}s.memoizedState=r;var i={value:r,getSnapshot:t};return s.queue=i,Nv(Q0.bind(null,n,i,e),[e]),n.flags|=2048,xl(9,G0.bind(null,n,i,r,t),void 0,null),r},useId:function(){var e=vn(),t=jt.identifierPrefix;if(st){var r=Vn,n=Wn;r=(n&~(1<<32-an(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=vl++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=Sj++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Nj={readContext:Hr,useCallback:nb,useContext:Hr,useEffect:nm,useImperativeHandle:rb,useInsertionEffect:J0,useLayoutEffect:eb,useMemo:sb,useReducer:Zd,useRef:X0,useState:function(){return Zd(_l)},useDebugValue:sm,useDeferredValue:function(e){var t=zr();return ib(t,bt.memoizedState,e)},useTransition:function(){var e=Zd(_l)[0],t=zr().memoizedState;return[e,t]},useMutableSource:V0,useSyncExternalStore:q0,useId:ob,unstable_isNewReconciler:!1},Rj={readContext:Hr,useCallback:nb,useContext:Hr,useEffect:nm,useImperativeHandle:rb,useInsertionEffect:J0,useLayoutEffect:eb,useMemo:sb,useReducer:Xd,useRef:X0,useState:function(){return Xd(_l)},useDebugValue:sm,useDeferredValue:function(e){var t=zr();return bt===null?t.memoizedState=e:ib(t,bt.memoizedState,e)},useTransition:function(){var e=Xd(_l)[0],t=zr().memoizedState;return[e,t]},useMutableSource:V0,useSyncExternalStore:q0,useId:ob,unstable_isNewReconciler:!1};function en(e,t){if(e&&e.defaultProps){t=ct({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function lf(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:ct({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Xu={isMounted:function(e){return(e=e._reactInternals)?Bi(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=Qt(),s=$s(e),i=qn(n,s);i.payload=t,r!=null&&(i.callback=r),t=Fs(e,i,s),t!==null&&(ln(t,e,s,n),Ic(t,e,s))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=Qt(),s=$s(e),i=qn(n,s);i.tag=1,i.payload=t,r!=null&&(i.callback=r),t=Fs(e,i,s),t!==null&&(ln(t,e,s,n),Ic(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Qt(),n=$s(e),s=qn(r,n);s.tag=2,t!=null&&(s.callback=t),t=Fs(e,s,n),t!==null&&(ln(t,e,n,r),Ic(t,e,n))}};function Rv(e,t,r,n,s,i,l){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,i,l):t.prototype&&t.prototype.isPureReactComponent?!dl(r,n)||!dl(s,i):!0}function ub(e,t,r){var n=!1,s=Ks,i=t.contextType;return typeof i=="object"&&i!==null?i=Hr(i):(s=or(t)?Ri:Ut.current,n=t.contextTypes,i=(n=n!=null)?Ko(e,s):Ks),t=new t(r,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Xu,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=i),t}function Pv(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&Xu.enqueueReplaceState(t,t.state,null)}function cf(e,t,r,n){var s=e.stateNode;s.props=r,s.state=e.memoizedState,s.refs={},Yp(e);var i=t.contextType;typeof i=="object"&&i!==null?s.context=Hr(i):(i=or(t)?Ri:Ut.current,s.context=Ko(e,i)),s.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(lf(e,t,i,r),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&Xu.enqueueReplaceState(s,s.state,null),uu(e,r,s,n),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function Zo(e,t){try{var r="",n=t;do r+=nE(n),n=n.return;while(n);var s=r}catch(i){s=`
39
+ Error generating stack: `+i.message+`
40
+ `+i.stack}return{value:e,source:t,stack:s,digest:null}}function Jd(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function uf(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var Pj=typeof WeakMap=="function"?WeakMap:Map;function db(e,t,r){r=qn(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){mu||(mu=!0,yf=n),uf(e,t)},r}function hb(e,t,r){r=qn(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var s=t.value;r.payload=function(){return n(s)},r.callback=function(){uf(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(r.callback=function(){uf(e,t),typeof n!="function"&&(Bs===null?Bs=new Set([this]):Bs.add(this));var l=t.stack;this.componentDidCatch(t.value,{componentStack:l!==null?l:""})}),r}function Tv(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new Pj;var s=new Set;n.set(t,s)}else s=n.get(t),s===void 0&&(s=new Set,n.set(t,s));s.has(r)||(s.add(r),e=Wj.bind(null,e,t,r),t.then(e,e))}function Av(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Dv(e,t,r,n,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=qn(-1,1),t.tag=2,Fs(r,t,1))),r.lanes|=1),e)}var Tj=ns.ReactCurrentOwner,sr=!1;function Kt(e,t,r,n){t.child=e===null?H0(t,null,r,n):Qo(t,e.child,r,n)}function Lv(e,t,r,n,s){r=r.render;var i=t.ref;return ko(t,s),n=tm(e,t,r,n,i,s),r=rm(),e!==null&&!sr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Xn(e,t,s)):(st&&r&&Up(t),t.flags|=1,Kt(e,t,n,s),t.child)}function Mv(e,t,r,n,s){if(e===null){var i=r.type;return typeof i=="function"&&!hm(i)&&i.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=i,fb(e,t,i,n,s)):(e=Uc(r.type,null,n,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&s)){var l=i.memoizedProps;if(r=r.compare,r=r!==null?r:dl,r(l,n)&&e.ref===t.ref)return Xn(e,t,s)}return t.flags|=1,e=Hs(i,n),e.ref=t.ref,e.return=t,t.child=e}function fb(e,t,r,n,s){if(e!==null){var i=e.memoizedProps;if(dl(i,n)&&e.ref===t.ref)if(sr=!1,t.pendingProps=n=i,(e.lanes&s)!==0)e.flags&131072&&(sr=!0);else return t.lanes=e.lanes,Xn(e,t,s)}return df(e,t,r,n,s)}function pb(e,t,r){var n=t.pendingProps,s=n.children,i=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ye(xo,hr),hr|=r;else{if(!(r&1073741824))return e=i!==null?i.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ye(xo,hr),hr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=i!==null?i.baseLanes:r,Ye(xo,hr),hr|=n}else i!==null?(n=i.baseLanes|r,t.memoizedState=null):n=r,Ye(xo,hr),hr|=n;return Kt(e,t,s,r),t.child}function mb(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function df(e,t,r,n,s){var i=or(r)?Ri:Ut.current;return i=Ko(t,i),ko(t,s),r=tm(e,t,r,n,i,s),n=rm(),e!==null&&!sr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Xn(e,t,s)):(st&&n&&Up(t),t.flags|=1,Kt(e,t,r,s),t.child)}function Ov(e,t,r,n,s){if(or(r)){var i=!0;iu(t)}else i=!1;if(ko(t,s),t.stateNode===null)$c(e,t),ub(t,r,n),cf(t,r,n,s),n=!0;else if(e===null){var l=t.stateNode,a=t.memoizedProps;l.props=a;var c=l.context,u=r.contextType;typeof u=="object"&&u!==null?u=Hr(u):(u=or(r)?Ri:Ut.current,u=Ko(t,u));var g=r.getDerivedStateFromProps,d=typeof g=="function"||typeof l.getSnapshotBeforeUpdate=="function";d||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(a!==n||c!==u)&&Pv(t,l,n,u),gs=!1;var _=t.memoizedState;l.state=_,uu(t,n,l,s),c=t.memoizedState,a!==n||_!==c||ir.current||gs?(typeof g=="function"&&(lf(t,r,g,n),c=t.memoizedState),(a=gs||Rv(t,r,a,n,_,c,u))?(d||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(t.flags|=4194308)):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=c),l.props=n,l.state=c,l.context=u,n=a):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{l=t.stateNode,U0(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:en(t.type,a),l.props=u,d=t.pendingProps,_=l.context,c=r.contextType,typeof c=="object"&&c!==null?c=Hr(c):(c=or(r)?Ri:Ut.current,c=Ko(t,c));var v=r.getDerivedStateFromProps;(g=typeof v=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(a!==d||_!==c)&&Pv(t,l,n,c),gs=!1,_=t.memoizedState,l.state=_,uu(t,n,l,s);var x=t.memoizedState;a!==d||_!==x||ir.current||gs?(typeof v=="function"&&(lf(t,r,v,n),x=t.memoizedState),(u=gs||Rv(t,r,u,n,_,x,c)||!1)?(g||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(n,x,c),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(n,x,c)),typeof l.componentDidUpdate=="function"&&(t.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof l.componentDidUpdate!="function"||a===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=x),l.props=n,l.state=x,l.context=c,n=u):(typeof l.componentDidUpdate!="function"||a===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),n=!1)}return hf(e,t,r,n,i,s)}function hf(e,t,r,n,s,i){mb(e,t);var l=(t.flags&128)!==0;if(!n&&!l)return s&&bv(t,r,!1),Xn(e,t,i);n=t.stateNode,Tj.current=t;var a=l&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&l?(t.child=Qo(t,e.child,null,i),t.child=Qo(t,null,a,i)):Kt(e,t,a,i),t.memoizedState=n.state,s&&bv(t,r,!0),t.child}function gb(e){var t=e.stateNode;t.pendingContext?yv(e,t.pendingContext,t.pendingContext!==t.context):t.context&&yv(e,t.context,!1),Zp(e,t.containerInfo)}function Iv(e,t,r,n,s){return Go(),Vp(s),t.flags|=256,Kt(e,t,r,n),t.child}var ff={dehydrated:null,treeContext:null,retryLane:0};function pf(e){return{baseLanes:e,cachePool:null,transitions:null}}function vb(e,t,r){var n=t.pendingProps,s=ot.current,i=!1,l=(t.flags&128)!==0,a;if((a=l)||(a=e!==null&&e.memoizedState===null?!1:(s&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),Ye(ot,s&1),e===null)return of(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(l=n.children,e=n.fallback,i?(n=t.mode,i=t.child,l={mode:"hidden",children:l},!(n&1)&&i!==null?(i.childLanes=0,i.pendingProps=l):i=td(l,n,0,null),e=Ni(e,n,r,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=pf(r),t.memoizedState=ff,e):im(t,l));if(s=e.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return Aj(e,t,l,n,a,s,r);if(i){i=n.fallback,l=t.mode,s=e.child,a=s.sibling;var c={mode:"hidden",children:n.children};return!(l&1)&&t.child!==s?(n=t.child,n.childLanes=0,n.pendingProps=c,t.deletions=null):(n=Hs(s,c),n.subtreeFlags=s.subtreeFlags&14680064),a!==null?i=Hs(a,i):(i=Ni(i,l,r,null),i.flags|=2),i.return=t,n.return=t,n.sibling=i,t.child=n,n=i,i=t.child,l=e.child.memoizedState,l=l===null?pf(r):{baseLanes:l.baseLanes|r,cachePool:null,transitions:l.transitions},i.memoizedState=l,i.childLanes=e.childLanes&~r,t.memoizedState=ff,n}return i=e.child,e=i.sibling,n=Hs(i,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function im(e,t){return t=td({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function mc(e,t,r,n){return n!==null&&Vp(n),Qo(t,e.child,null,r),e=im(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Aj(e,t,r,n,s,i,l){if(r)return t.flags&256?(t.flags&=-257,n=Jd(Error(se(422))),mc(e,t,l,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=n.fallback,s=t.mode,n=td({mode:"visible",children:n.children},s,0,null),i=Ni(i,s,l,null),i.flags|=2,n.return=t,i.return=t,n.sibling=i,t.child=n,t.mode&1&&Qo(t,e.child,null,l),t.child.memoizedState=pf(l),t.memoizedState=ff,i);if(!(t.mode&1))return mc(e,t,l,null);if(s.data==="$!"){if(n=s.nextSibling&&s.nextSibling.dataset,n)var a=n.dgst;return n=a,i=Error(se(419)),n=Jd(i,n,void 0),mc(e,t,l,n)}if(a=(l&e.childLanes)!==0,sr||a){if(n=jt,n!==null){switch(l&-l){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(n.suspendedLanes|l)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,Zn(e,s),ln(n,e,s,-1))}return dm(),n=Jd(Error(se(421))),mc(e,t,l,n)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=Vj.bind(null,e),s._reactRetry=t,null):(e=i.treeContext,_r=Is(s.nextSibling),xr=t,st=!0,nn=null,e!==null&&(Rr[Pr++]=Wn,Rr[Pr++]=Vn,Rr[Pr++]=Pi,Wn=e.id,Vn=e.overflow,Pi=t),t=im(t,n.children),t.flags|=4096,t)}function Fv(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),af(e.return,t,r)}function eh(e,t,r,n,s){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:s}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=n,i.tail=r,i.tailMode=s)}function _b(e,t,r){var n=t.pendingProps,s=n.revealOrder,i=n.tail;if(Kt(e,t,n.children,r),n=ot.current,n&2)n=n&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Fv(e,r,t);else if(e.tag===19)Fv(e,r,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}n&=1}if(Ye(ot,n),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(r=t.child,s=null;r!==null;)e=r.alternate,e!==null&&du(e)===null&&(s=r),r=r.sibling;r=s,r===null?(s=t.child,t.child=null):(s=r.sibling,r.sibling=null),eh(t,!1,s,r,i);break;case"backwards":for(r=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&du(e)===null){t.child=s;break}e=s.sibling,s.sibling=r,r=s,s=e}eh(t,!0,r,null,i);break;case"together":eh(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function $c(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Xn(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Ai|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(se(153));if(t.child!==null){for(e=t.child,r=Hs(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Hs(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function Dj(e,t,r){switch(t.tag){case 3:gb(t),Go();break;case 5:W0(t);break;case 1:or(t.type)&&iu(t);break;case 4:Zp(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,s=t.memoizedProps.value;Ye(lu,n._currentValue),n._currentValue=s;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(Ye(ot,ot.current&1),t.flags|=128,null):r&t.child.childLanes?vb(e,t,r):(Ye(ot,ot.current&1),e=Xn(e,t,r),e!==null?e.sibling:null);Ye(ot,ot.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return _b(e,t,r);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Ye(ot,ot.current),n)break;return null;case 22:case 23:return t.lanes=0,pb(e,t,r)}return Xn(e,t,r)}var xb,mf,yb,bb;xb=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};mf=function(){};yb=function(e,t,r,n){var s=e.memoizedProps;if(s!==n){e=t.stateNode,fi(kn.current);var i=null;switch(r){case"input":s=Oh(e,s),n=Oh(e,n),i=[];break;case"select":s=ct({},s,{value:void 0}),n=ct({},n,{value:void 0}),i=[];break;case"textarea":s=Bh(e,s),n=Bh(e,n),i=[];break;default:typeof s.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=nu)}Hh(r,n);var l;r=null;for(u in s)if(!n.hasOwnProperty(u)&&s.hasOwnProperty(u)&&s[u]!=null)if(u==="style"){var a=s[u];for(l in a)a.hasOwnProperty(l)&&(r||(r={}),r[l]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(sl.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in n){var c=n[u];if(a=s!=null?s[u]:void 0,n.hasOwnProperty(u)&&c!==a&&(c!=null||a!=null))if(u==="style")if(a){for(l in a)!a.hasOwnProperty(l)||c&&c.hasOwnProperty(l)||(r||(r={}),r[l]="");for(l in c)c.hasOwnProperty(l)&&a[l]!==c[l]&&(r||(r={}),r[l]=c[l])}else r||(i||(i=[]),i.push(u,r)),r=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,a=a?a.__html:void 0,c!=null&&a!==c&&(i=i||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(sl.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&Je("scroll",e),i||a===c||(i=[])):(i=i||[]).push(u,c))}r&&(i=i||[]).push("style",r);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};bb=function(e,t,r,n){r!==n&&(t.flags|=4)};function Na(e,t){if(!st)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Ot(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags&14680064,n|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags,n|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function Lj(e,t,r){var n=t.pendingProps;switch(Wp(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ot(t),null;case 1:return or(t.type)&&su(),Ot(t),null;case 3:return n=t.stateNode,Yo(),tt(ir),tt(Ut),Jp(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(fc(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,nn!==null&&(Sf(nn),nn=null))),mf(e,t),Ot(t),null;case 5:Xp(t);var s=fi(gl.current);if(r=t.type,e!==null&&t.stateNode!=null)yb(e,t,r,n,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(se(166));return Ot(t),null}if(e=fi(kn.current),fc(t)){n=t.stateNode,r=t.type;var i=t.memoizedProps;switch(n[bn]=t,n[pl]=i,e=(t.mode&1)!==0,r){case"dialog":Je("cancel",n),Je("close",n);break;case"iframe":case"object":case"embed":Je("load",n);break;case"video":case"audio":for(s=0;s<za.length;s++)Je(za[s],n);break;case"source":Je("error",n);break;case"img":case"image":case"link":Je("error",n),Je("load",n);break;case"details":Je("toggle",n);break;case"input":Kg(n,i),Je("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!i.multiple},Je("invalid",n);break;case"textarea":Qg(n,i),Je("invalid",n)}Hh(r,i),s=null;for(var l in i)if(i.hasOwnProperty(l)){var a=i[l];l==="children"?typeof a=="string"?n.textContent!==a&&(i.suppressHydrationWarning!==!0&&hc(n.textContent,a,e),s=["children",a]):typeof a=="number"&&n.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&hc(n.textContent,a,e),s=["children",""+a]):sl.hasOwnProperty(l)&&a!=null&&l==="onScroll"&&Je("scroll",n)}switch(r){case"input":sc(n),Gg(n,i,!0);break;case"textarea":sc(n),Yg(n);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(n.onclick=nu)}n=s,t.updateQueue=n,n!==null&&(t.flags|=4)}else{l=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Qy(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=l.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=l.createElement(r,{is:n.is}):(e=l.createElement(r),r==="select"&&(l=e,n.multiple?l.multiple=!0:n.size&&(l.size=n.size))):e=l.createElementNS(e,r),e[bn]=t,e[pl]=n,xb(e,t,!1,!1),t.stateNode=e;e:{switch(l=zh(r,n),r){case"dialog":Je("cancel",e),Je("close",e),s=n;break;case"iframe":case"object":case"embed":Je("load",e),s=n;break;case"video":case"audio":for(s=0;s<za.length;s++)Je(za[s],e);s=n;break;case"source":Je("error",e),s=n;break;case"img":case"image":case"link":Je("error",e),Je("load",e),s=n;break;case"details":Je("toggle",e),s=n;break;case"input":Kg(e,n),s=Oh(e,n),Je("invalid",e);break;case"option":s=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},s=ct({},n,{value:void 0}),Je("invalid",e);break;case"textarea":Qg(e,n),s=Bh(e,n),Je("invalid",e);break;default:s=n}Hh(r,s),a=s;for(i in a)if(a.hasOwnProperty(i)){var c=a[i];i==="style"?Xy(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&Yy(e,c)):i==="children"?typeof c=="string"?(r!=="textarea"||c!=="")&&il(e,c):typeof c=="number"&&il(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(sl.hasOwnProperty(i)?c!=null&&i==="onScroll"&&Je("scroll",e):c!=null&&Rp(e,i,c,l))}switch(r){case"input":sc(e),Gg(e,n,!1);break;case"textarea":sc(e),Yg(e);break;case"option":n.value!=null&&e.setAttribute("value",""+qs(n.value));break;case"select":e.multiple=!!n.multiple,i=n.value,i!=null?bo(e,!!n.multiple,i,!1):n.defaultValue!=null&&bo(e,!!n.multiple,n.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=nu)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Ot(t),null;case 6:if(e&&t.stateNode!=null)bb(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(se(166));if(r=fi(gl.current),fi(kn.current),fc(t)){if(n=t.stateNode,r=t.memoizedProps,n[bn]=t,(i=n.nodeValue!==r)&&(e=xr,e!==null))switch(e.tag){case 3:hc(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&hc(n.nodeValue,r,(e.mode&1)!==0)}i&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[bn]=t,t.stateNode=n}return Ot(t),null;case 13:if(tt(ot),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(st&&_r!==null&&t.mode&1&&!(t.flags&128))B0(),Go(),t.flags|=98560,i=!1;else if(i=fc(t),n!==null&&n.dehydrated!==null){if(e===null){if(!i)throw Error(se(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(se(317));i[bn]=t}else Go(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ot(t),i=!1}else nn!==null&&(Sf(nn),nn=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||ot.current&1?St===0&&(St=3):dm())),t.updateQueue!==null&&(t.flags|=4),Ot(t),null);case 4:return Yo(),mf(e,t),e===null&&hl(t.stateNode.containerInfo),Ot(t),null;case 10:return Gp(t.type._context),Ot(t),null;case 17:return or(t.type)&&su(),Ot(t),null;case 19:if(tt(ot),i=t.memoizedState,i===null)return Ot(t),null;if(n=(t.flags&128)!==0,l=i.rendering,l===null)if(n)Na(i,!1);else{if(St!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(l=du(e),l!==null){for(t.flags|=128,Na(i,!1),n=l.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)i=r,e=n,i.flags&=14680066,l=i.alternate,l===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=l.childLanes,i.lanes=l.lanes,i.child=l.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=l.memoizedProps,i.memoizedState=l.memoizedState,i.updateQueue=l.updateQueue,i.type=l.type,e=l.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Ye(ot,ot.current&1|2),t.child}e=e.sibling}i.tail!==null&&gt()>Xo&&(t.flags|=128,n=!0,Na(i,!1),t.lanes=4194304)}else{if(!n)if(e=du(l),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Na(i,!0),i.tail===null&&i.tailMode==="hidden"&&!l.alternate&&!st)return Ot(t),null}else 2*gt()-i.renderingStartTime>Xo&&r!==1073741824&&(t.flags|=128,n=!0,Na(i,!1),t.lanes=4194304);i.isBackwards?(l.sibling=t.child,t.child=l):(r=i.last,r!==null?r.sibling=l:t.child=l,i.last=l)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=gt(),t.sibling=null,r=ot.current,Ye(ot,n?r&1|2:r&1),t):(Ot(t),null);case 22:case 23:return um(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?hr&1073741824&&(Ot(t),t.subtreeFlags&6&&(t.flags|=8192)):Ot(t),null;case 24:return null;case 25:return null}throw Error(se(156,t.tag))}function Mj(e,t){switch(Wp(t),t.tag){case 1:return or(t.type)&&su(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Yo(),tt(ir),tt(Ut),Jp(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Xp(t),null;case 13:if(tt(ot),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(se(340));Go()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return tt(ot),null;case 4:return Yo(),null;case 10:return Gp(t.type._context),null;case 22:case 23:return um(),null;case 24:return null;default:return null}}var gc=!1,Bt=!1,Oj=typeof WeakSet=="function"?WeakSet:Set,pe=null;function _o(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){ht(e,t,n)}else r.current=null}function gf(e,t,r){try{r()}catch(n){ht(e,t,n)}}var Bv=!1;function Ij(e,t){if(Xh=eu,e=E0(),zp(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var s=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var l=0,a=-1,c=-1,u=0,g=0,d=e,_=null;t:for(;;){for(var v;d!==r||s!==0&&d.nodeType!==3||(a=l+s),d!==i||n!==0&&d.nodeType!==3||(c=l+n),d.nodeType===3&&(l+=d.nodeValue.length),(v=d.firstChild)!==null;)_=d,d=v;for(;;){if(d===e)break t;if(_===r&&++u===s&&(a=l),_===i&&++g===n&&(c=l),(v=d.nextSibling)!==null)break;d=_,_=d.parentNode}d=v}r=a===-1||c===-1?null:{start:a,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(Jh={focusedElem:e,selectionRange:r},eu=!1,pe=t;pe!==null;)if(t=pe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,pe=e;else for(;pe!==null;){t=pe;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var y=x.memoizedProps,f=x.memoizedState,p=t.stateNode,h=p.getSnapshotBeforeUpdate(t.elementType===t.type?y:en(t.type,y),f);p.__reactInternalSnapshotBeforeUpdate=h}break;case 3:var m=t.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(se(163))}}catch(b){ht(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,pe=e;break}pe=t.return}return x=Bv,Bv=!1,x}function Ja(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var s=n=n.next;do{if((s.tag&e)===e){var i=s.destroy;s.destroy=void 0,i!==void 0&&gf(t,r,i)}s=s.next}while(s!==n)}}function Ju(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function vf(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function wb(e){var t=e.alternate;t!==null&&(e.alternate=null,wb(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[bn],delete t[pl],delete t[rf],delete t[xj],delete t[yj])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Sb(e){return e.tag===5||e.tag===3||e.tag===4}function $v(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Sb(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function _f(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=nu));else if(n!==4&&(e=e.child,e!==null))for(_f(e,t,r),e=e.sibling;e!==null;)_f(e,t,r),e=e.sibling}function xf(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(xf(e,t,r),e=e.sibling;e!==null;)xf(e,t,r),e=e.sibling}var Rt=null,rn=!1;function cs(e,t,r){for(r=r.child;r!==null;)Cb(e,t,r),r=r.sibling}function Cb(e,t,r){if(Cn&&typeof Cn.onCommitFiberUnmount=="function")try{Cn.onCommitFiberUnmount(Vu,r)}catch{}switch(r.tag){case 5:Bt||_o(r,t);case 6:var n=Rt,s=rn;Rt=null,cs(e,t,r),Rt=n,rn=s,Rt!==null&&(rn?(e=Rt,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Rt.removeChild(r.stateNode));break;case 18:Rt!==null&&(rn?(e=Rt,r=r.stateNode,e.nodeType===8?Kd(e.parentNode,r):e.nodeType===1&&Kd(e,r),cl(e)):Kd(Rt,r.stateNode));break;case 4:n=Rt,s=rn,Rt=r.stateNode.containerInfo,rn=!0,cs(e,t,r),Rt=n,rn=s;break;case 0:case 11:case 14:case 15:if(!Bt&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){s=n=n.next;do{var i=s,l=i.destroy;i=i.tag,l!==void 0&&(i&2||i&4)&&gf(r,t,l),s=s.next}while(s!==n)}cs(e,t,r);break;case 1:if(!Bt&&(_o(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){ht(r,t,a)}cs(e,t,r);break;case 21:cs(e,t,r);break;case 22:r.mode&1?(Bt=(n=Bt)||r.memoizedState!==null,cs(e,t,r),Bt=n):cs(e,t,r);break;default:cs(e,t,r)}}function Hv(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Oj),t.forEach(function(n){var s=qj.bind(null,e,n);r.has(n)||(r.add(n),n.then(s,s))})}}function Zr(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var s=r[n];try{var i=e,l=t,a=l;e:for(;a!==null;){switch(a.tag){case 5:Rt=a.stateNode,rn=!1;break e;case 3:Rt=a.stateNode.containerInfo,rn=!0;break e;case 4:Rt=a.stateNode.containerInfo,rn=!0;break e}a=a.return}if(Rt===null)throw Error(se(160));Cb(i,l,s),Rt=null,rn=!1;var c=s.alternate;c!==null&&(c.return=null),s.return=null}catch(u){ht(s,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)kb(t,e),t=t.sibling}function kb(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Zr(t,e),gn(e),n&4){try{Ja(3,e,e.return),Ju(3,e)}catch(y){ht(e,e.return,y)}try{Ja(5,e,e.return)}catch(y){ht(e,e.return,y)}}break;case 1:Zr(t,e),gn(e),n&512&&r!==null&&_o(r,r.return);break;case 5:if(Zr(t,e),gn(e),n&512&&r!==null&&_o(r,r.return),e.flags&32){var s=e.stateNode;try{il(s,"")}catch(y){ht(e,e.return,y)}}if(n&4&&(s=e.stateNode,s!=null)){var i=e.memoizedProps,l=r!==null?r.memoizedProps:i,a=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&Ky(s,i),zh(a,l);var u=zh(a,i);for(l=0;l<c.length;l+=2){var g=c[l],d=c[l+1];g==="style"?Xy(s,d):g==="dangerouslySetInnerHTML"?Yy(s,d):g==="children"?il(s,d):Rp(s,g,d,u)}switch(a){case"input":Ih(s,i);break;case"textarea":Gy(s,i);break;case"select":var _=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var v=i.value;v!=null?bo(s,!!i.multiple,v,!1):_!==!!i.multiple&&(i.defaultValue!=null?bo(s,!!i.multiple,i.defaultValue,!0):bo(s,!!i.multiple,i.multiple?[]:"",!1))}s[pl]=i}catch(y){ht(e,e.return,y)}}break;case 6:if(Zr(t,e),gn(e),n&4){if(e.stateNode===null)throw Error(se(162));s=e.stateNode,i=e.memoizedProps;try{s.nodeValue=i}catch(y){ht(e,e.return,y)}}break;case 3:if(Zr(t,e),gn(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{cl(t.containerInfo)}catch(y){ht(e,e.return,y)}break;case 4:Zr(t,e),gn(e);break;case 13:Zr(t,e),gn(e),s=e.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(lm=gt())),n&4&&Hv(e);break;case 22:if(g=r!==null&&r.memoizedState!==null,e.mode&1?(Bt=(u=Bt)||g,Zr(t,e),Bt=u):Zr(t,e),gn(e),n&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!g&&e.mode&1)for(pe=e,g=e.child;g!==null;){for(d=pe=g;pe!==null;){switch(_=pe,v=_.child,_.tag){case 0:case 11:case 14:case 15:Ja(4,_,_.return);break;case 1:_o(_,_.return);var x=_.stateNode;if(typeof x.componentWillUnmount=="function"){n=_,r=_.return;try{t=n,x.props=t.memoizedProps,x.state=t.memoizedState,x.componentWillUnmount()}catch(y){ht(n,r,y)}}break;case 5:_o(_,_.return);break;case 22:if(_.memoizedState!==null){Uv(d);continue}}v!==null?(v.return=_,pe=v):Uv(d)}g=g.sibling}e:for(g=null,d=e;;){if(d.tag===5){if(g===null){g=d;try{s=d.stateNode,u?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=d.stateNode,c=d.memoizedProps.style,l=c!=null&&c.hasOwnProperty("display")?c.display:null,a.style.display=Zy("display",l))}catch(y){ht(e,e.return,y)}}}else if(d.tag===6){if(g===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(y){ht(e,e.return,y)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;g===d&&(g=null),d=d.return}g===d&&(g=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:Zr(t,e),gn(e),n&4&&Hv(e);break;case 21:break;default:Zr(t,e),gn(e)}}function gn(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(Sb(r)){var n=r;break e}r=r.return}throw Error(se(160))}switch(n.tag){case 5:var s=n.stateNode;n.flags&32&&(il(s,""),n.flags&=-33);var i=$v(e);xf(e,i,s);break;case 3:case 4:var l=n.stateNode.containerInfo,a=$v(e);_f(e,a,l);break;default:throw Error(se(161))}}catch(c){ht(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Fj(e,t,r){pe=e,Eb(e)}function Eb(e,t,r){for(var n=(e.mode&1)!==0;pe!==null;){var s=pe,i=s.child;if(s.tag===22&&n){var l=s.memoizedState!==null||gc;if(!l){var a=s.alternate,c=a!==null&&a.memoizedState!==null||Bt;a=gc;var u=Bt;if(gc=l,(Bt=c)&&!u)for(pe=s;pe!==null;)l=pe,c=l.child,l.tag===22&&l.memoizedState!==null?Wv(s):c!==null?(c.return=l,pe=c):Wv(s);for(;i!==null;)pe=i,Eb(i),i=i.sibling;pe=s,gc=a,Bt=u}zv(e)}else s.subtreeFlags&8772&&i!==null?(i.return=s,pe=i):zv(e)}}function zv(e){for(;pe!==null;){var t=pe;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Bt||Ju(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!Bt)if(r===null)n.componentDidMount();else{var s=t.elementType===t.type?r.memoizedProps:en(t.type,r.memoizedProps);n.componentDidUpdate(s,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Ev(t,i,n);break;case 3:var l=t.updateQueue;if(l!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}Ev(t,l,r)}break;case 5:var a=t.stateNode;if(r===null&&t.flags&4){r=a;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&r.focus();break;case"img":c.src&&(r.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var g=u.memoizedState;if(g!==null){var d=g.dehydrated;d!==null&&cl(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(se(163))}Bt||t.flags&512&&vf(t)}catch(_){ht(t,t.return,_)}}if(t===e){pe=null;break}if(r=t.sibling,r!==null){r.return=t.return,pe=r;break}pe=t.return}}function Uv(e){for(;pe!==null;){var t=pe;if(t===e){pe=null;break}var r=t.sibling;if(r!==null){r.return=t.return,pe=r;break}pe=t.return}}function Wv(e){for(;pe!==null;){var t=pe;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{Ju(4,t)}catch(c){ht(t,r,c)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var s=t.return;try{n.componentDidMount()}catch(c){ht(t,s,c)}}var i=t.return;try{vf(t)}catch(c){ht(t,i,c)}break;case 5:var l=t.return;try{vf(t)}catch(c){ht(t,l,c)}}}catch(c){ht(t,t.return,c)}if(t===e){pe=null;break}var a=t.sibling;if(a!==null){a.return=t.return,pe=a;break}pe=t.return}}var Bj=Math.ceil,pu=ns.ReactCurrentDispatcher,om=ns.ReactCurrentOwner,Or=ns.ReactCurrentBatchConfig,Oe=0,jt=null,yt=null,Tt=0,hr=0,xo=ti(0),St=0,yl=null,Ai=0,ed=0,am=0,el=null,nr=null,lm=0,Xo=1/0,In=null,mu=!1,yf=null,Bs=null,vc=!1,Ts=null,gu=0,tl=0,bf=null,Hc=-1,zc=0;function Qt(){return Oe&6?gt():Hc!==-1?Hc:Hc=gt()}function $s(e){return e.mode&1?Oe&2&&Tt!==0?Tt&-Tt:wj.transition!==null?(zc===0&&(zc=u0()),zc):(e=qe,e!==0||(e=window.event,e=e===void 0?16:v0(e.type)),e):1}function ln(e,t,r,n){if(50<tl)throw tl=0,bf=null,Error(se(185));Il(e,r,n),(!(Oe&2)||e!==jt)&&(e===jt&&(!(Oe&2)&&(ed|=r),St===4&&ys(e,Tt)),ar(e,n),r===1&&Oe===0&&!(t.mode&1)&&(Xo=gt()+500,Yu&&ri()))}function ar(e,t){var r=e.callbackNode;wE(e,t);var n=Jc(e,e===jt?Tt:0);if(n===0)r!==null&&Jg(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&Jg(r),t===1)e.tag===0?bj(Vv.bind(null,e)):O0(Vv.bind(null,e)),vj(function(){!(Oe&6)&&ri()}),r=null;else{switch(d0(n)){case 1:r=Lp;break;case 4:r=l0;break;case 16:r=Xc;break;case 536870912:r=c0;break;default:r=Xc}r=Lb(r,jb.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function jb(e,t){if(Hc=-1,zc=0,Oe&6)throw Error(se(327));var r=e.callbackNode;if(Eo()&&e.callbackNode!==r)return null;var n=Jc(e,e===jt?Tt:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=vu(e,n);else{t=n;var s=Oe;Oe|=2;var i=Rb();(jt!==e||Tt!==t)&&(In=null,Xo=gt()+500,ji(e,t));do try{zj();break}catch(a){Nb(e,a)}while(!0);Kp(),pu.current=i,Oe=s,yt!==null?t=0:(jt=null,Tt=0,t=St)}if(t!==0){if(t===2&&(s=Kh(e),s!==0&&(n=s,t=wf(e,s))),t===1)throw r=yl,ji(e,0),ys(e,n),ar(e,gt()),r;if(t===6)ys(e,n);else{if(s=e.current.alternate,!(n&30)&&!$j(s)&&(t=vu(e,n),t===2&&(i=Kh(e),i!==0&&(n=i,t=wf(e,i))),t===1))throw r=yl,ji(e,0),ys(e,n),ar(e,gt()),r;switch(e.finishedWork=s,e.finishedLanes=n,t){case 0:case 1:throw Error(se(345));case 2:ui(e,nr,In);break;case 3:if(ys(e,n),(n&130023424)===n&&(t=lm+500-gt(),10<t)){if(Jc(e,0)!==0)break;if(s=e.suspendedLanes,(s&n)!==n){Qt(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=tf(ui.bind(null,e,nr,In),t);break}ui(e,nr,In);break;case 4:if(ys(e,n),(n&4194240)===n)break;for(t=e.eventTimes,s=-1;0<n;){var l=31-an(n);i=1<<l,l=t[l],l>s&&(s=l),n&=~i}if(n=s,n=gt()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Bj(n/1960))-n,10<n){e.timeoutHandle=tf(ui.bind(null,e,nr,In),n);break}ui(e,nr,In);break;case 5:ui(e,nr,In);break;default:throw Error(se(329))}}}return ar(e,gt()),e.callbackNode===r?jb.bind(null,e):null}function wf(e,t){var r=el;return e.current.memoizedState.isDehydrated&&(ji(e,t).flags|=256),e=vu(e,t),e!==2&&(t=nr,nr=r,t!==null&&Sf(t)),e}function Sf(e){nr===null?nr=e:nr.push.apply(nr,e)}function $j(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var s=r[n],i=s.getSnapshot;s=s.value;try{if(!cn(i(),s))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;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 ys(e,t){for(t&=~am,t&=~ed,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-an(t),n=1<<r;e[r]=-1,t&=~n}}function Vv(e){if(Oe&6)throw Error(se(327));Eo();var t=Jc(e,0);if(!(t&1))return ar(e,gt()),null;var r=vu(e,t);if(e.tag!==0&&r===2){var n=Kh(e);n!==0&&(t=n,r=wf(e,n))}if(r===1)throw r=yl,ji(e,0),ys(e,t),ar(e,gt()),r;if(r===6)throw Error(se(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,ui(e,nr,In),ar(e,gt()),null}function cm(e,t){var r=Oe;Oe|=1;try{return e(t)}finally{Oe=r,Oe===0&&(Xo=gt()+500,Yu&&ri())}}function Di(e){Ts!==null&&Ts.tag===0&&!(Oe&6)&&Eo();var t=Oe;Oe|=1;var r=Or.transition,n=qe;try{if(Or.transition=null,qe=1,e)return e()}finally{qe=n,Or.transition=r,Oe=t,!(Oe&6)&&ri()}}function um(){hr=xo.current,tt(xo)}function ji(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,gj(r)),yt!==null)for(r=yt.return;r!==null;){var n=r;switch(Wp(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&su();break;case 3:Yo(),tt(ir),tt(Ut),Jp();break;case 5:Xp(n);break;case 4:Yo();break;case 13:tt(ot);break;case 19:tt(ot);break;case 10:Gp(n.type._context);break;case 22:case 23:um()}r=r.return}if(jt=e,yt=e=Hs(e.current,null),Tt=hr=t,St=0,yl=null,am=ed=Ai=0,nr=el=null,hi!==null){for(t=0;t<hi.length;t++)if(r=hi[t],n=r.interleaved,n!==null){r.interleaved=null;var s=n.next,i=r.pending;if(i!==null){var l=i.next;i.next=s,n.next=l}r.pending=n}hi=null}return e}function Nb(e,t){do{var r=yt;try{if(Kp(),Fc.current=fu,hu){for(var n=lt.memoizedState;n!==null;){var s=n.queue;s!==null&&(s.pending=null),n=n.next}hu=!1}if(Ti=0,Et=bt=lt=null,Xa=!1,vl=0,om.current=null,r===null||r.return===null){St=1,yl=t,yt=null;break}e:{var i=e,l=r.return,a=r,c=t;if(t=Tt,a.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,g=a,d=g.tag;if(!(g.mode&1)&&(d===0||d===11||d===15)){var _=g.alternate;_?(g.updateQueue=_.updateQueue,g.memoizedState=_.memoizedState,g.lanes=_.lanes):(g.updateQueue=null,g.memoizedState=null)}var v=Av(l);if(v!==null){v.flags&=-257,Dv(v,l,a,i,t),v.mode&1&&Tv(i,u,t),t=v,c=u;var x=t.updateQueue;if(x===null){var y=new Set;y.add(c),t.updateQueue=y}else x.add(c);break e}else{if(!(t&1)){Tv(i,u,t),dm();break e}c=Error(se(426))}}else if(st&&a.mode&1){var f=Av(l);if(f!==null){!(f.flags&65536)&&(f.flags|=256),Dv(f,l,a,i,t),Vp(Zo(c,a));break e}}i=c=Zo(c,a),St!==4&&(St=2),el===null?el=[i]:el.push(i),i=l;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var p=db(i,c,t);kv(i,p);break e;case 1:a=c;var h=i.type,m=i.stateNode;if(!(i.flags&128)&&(typeof h.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(Bs===null||!Bs.has(m)))){i.flags|=65536,t&=-t,i.lanes|=t;var b=hb(i,a,t);kv(i,b);break e}}i=i.return}while(i!==null)}Tb(r)}catch(w){t=w,yt===r&&r!==null&&(yt=r=r.return);continue}break}while(!0)}function Rb(){var e=pu.current;return pu.current=fu,e===null?fu:e}function dm(){(St===0||St===3||St===2)&&(St=4),jt===null||!(Ai&268435455)&&!(ed&268435455)||ys(jt,Tt)}function vu(e,t){var r=Oe;Oe|=2;var n=Rb();(jt!==e||Tt!==t)&&(In=null,ji(e,t));do try{Hj();break}catch(s){Nb(e,s)}while(!0);if(Kp(),Oe=r,pu.current=n,yt!==null)throw Error(se(261));return jt=null,Tt=0,St}function Hj(){for(;yt!==null;)Pb(yt)}function zj(){for(;yt!==null&&!fE();)Pb(yt)}function Pb(e){var t=Db(e.alternate,e,hr);e.memoizedProps=e.pendingProps,t===null?Tb(e):yt=t,om.current=null}function Tb(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=Mj(r,t),r!==null){r.flags&=32767,yt=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{St=6,yt=null;return}}else if(r=Lj(r,t,hr),r!==null){yt=r;return}if(t=t.sibling,t!==null){yt=t;return}yt=t=e}while(t!==null);St===0&&(St=5)}function ui(e,t,r){var n=qe,s=Or.transition;try{Or.transition=null,qe=1,Uj(e,t,r,n)}finally{Or.transition=s,qe=n}return null}function Uj(e,t,r,n){do Eo();while(Ts!==null);if(Oe&6)throw Error(se(327));r=e.finishedWork;var s=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(se(177));e.callbackNode=null,e.callbackPriority=0;var i=r.lanes|r.childLanes;if(SE(e,i),e===jt&&(yt=jt=null,Tt=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||vc||(vc=!0,Lb(Xc,function(){return Eo(),null})),i=(r.flags&15990)!==0,r.subtreeFlags&15990||i){i=Or.transition,Or.transition=null;var l=qe;qe=1;var a=Oe;Oe|=4,om.current=null,Ij(e,r),kb(r,e),cj(Jh),eu=!!Xh,Jh=Xh=null,e.current=r,Fj(r),pE(),Oe=a,qe=l,Or.transition=i}else e.current=r;if(vc&&(vc=!1,Ts=e,gu=s),i=e.pendingLanes,i===0&&(Bs=null),vE(r.stateNode),ar(e,gt()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)s=t[r],n(s.value,{componentStack:s.stack,digest:s.digest});if(mu)throw mu=!1,e=yf,yf=null,e;return gu&1&&e.tag!==0&&Eo(),i=e.pendingLanes,i&1?e===bf?tl++:(tl=0,bf=e):tl=0,ri(),null}function Eo(){if(Ts!==null){var e=d0(gu),t=Or.transition,r=qe;try{if(Or.transition=null,qe=16>e?16:e,Ts===null)var n=!1;else{if(e=Ts,Ts=null,gu=0,Oe&6)throw Error(se(331));var s=Oe;for(Oe|=4,pe=e.current;pe!==null;){var i=pe,l=i.child;if(pe.flags&16){var a=i.deletions;if(a!==null){for(var c=0;c<a.length;c++){var u=a[c];for(pe=u;pe!==null;){var g=pe;switch(g.tag){case 0:case 11:case 15:Ja(8,g,i)}var d=g.child;if(d!==null)d.return=g,pe=d;else for(;pe!==null;){g=pe;var _=g.sibling,v=g.return;if(wb(g),g===u){pe=null;break}if(_!==null){_.return=v,pe=_;break}pe=v}}}var x=i.alternate;if(x!==null){var y=x.child;if(y!==null){x.child=null;do{var f=y.sibling;y.sibling=null,y=f}while(y!==null)}}pe=i}}if(i.subtreeFlags&2064&&l!==null)l.return=i,pe=l;else e:for(;pe!==null;){if(i=pe,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Ja(9,i,i.return)}var p=i.sibling;if(p!==null){p.return=i.return,pe=p;break e}pe=i.return}}var h=e.current;for(pe=h;pe!==null;){l=pe;var m=l.child;if(l.subtreeFlags&2064&&m!==null)m.return=l,pe=m;else e:for(l=h;pe!==null;){if(a=pe,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Ju(9,a)}}catch(w){ht(a,a.return,w)}if(a===l){pe=null;break e}var b=a.sibling;if(b!==null){b.return=a.return,pe=b;break e}pe=a.return}}if(Oe=s,ri(),Cn&&typeof Cn.onPostCommitFiberRoot=="function")try{Cn.onPostCommitFiberRoot(Vu,e)}catch{}n=!0}return n}finally{qe=r,Or.transition=t}}return!1}function qv(e,t,r){t=Zo(r,t),t=db(e,t,1),e=Fs(e,t,1),t=Qt(),e!==null&&(Il(e,1,t),ar(e,t))}function ht(e,t,r){if(e.tag===3)qv(e,e,r);else for(;t!==null;){if(t.tag===3){qv(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Bs===null||!Bs.has(n))){e=Zo(r,e),e=hb(t,e,1),t=Fs(t,e,1),e=Qt(),t!==null&&(Il(t,1,e),ar(t,e));break}}t=t.return}}function Wj(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=Qt(),e.pingedLanes|=e.suspendedLanes&r,jt===e&&(Tt&r)===r&&(St===4||St===3&&(Tt&130023424)===Tt&&500>gt()-lm?ji(e,0):am|=r),ar(e,t)}function Ab(e,t){t===0&&(e.mode&1?(t=ac,ac<<=1,!(ac&130023424)&&(ac=4194304)):t=1);var r=Qt();e=Zn(e,t),e!==null&&(Il(e,t,r),ar(e,r))}function Vj(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Ab(e,r)}function qj(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,s=e.memoizedState;s!==null&&(r=s.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(se(314))}n!==null&&n.delete(t),Ab(e,r)}var Db;Db=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||ir.current)sr=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return sr=!1,Dj(e,t,r);sr=!!(e.flags&131072)}else sr=!1,st&&t.flags&1048576&&I0(t,au,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;$c(e,t),e=t.pendingProps;var s=Ko(t,Ut.current);ko(t,r),s=tm(null,t,n,e,s,r);var i=rm();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,or(n)?(i=!0,iu(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Yp(t),s.updater=Xu,t.stateNode=s,s._reactInternals=t,cf(t,n,e,r),t=hf(null,t,n,!0,i,r)):(t.tag=0,st&&i&&Up(t),Kt(null,t,s,r),t=t.child),t;case 16:n=t.elementType;e:{switch($c(e,t),e=t.pendingProps,s=n._init,n=s(n._payload),t.type=n,s=t.tag=Gj(n),e=en(n,e),s){case 0:t=df(null,t,n,e,r);break e;case 1:t=Ov(null,t,n,e,r);break e;case 11:t=Lv(null,t,n,e,r);break e;case 14:t=Mv(null,t,n,en(n.type,e),r);break e}throw Error(se(306,n,""))}return t;case 0:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:en(n,s),df(e,t,n,s,r);case 1:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:en(n,s),Ov(e,t,n,s,r);case 3:e:{if(gb(t),e===null)throw Error(se(387));n=t.pendingProps,i=t.memoizedState,s=i.element,U0(e,t),uu(t,n,null,r);var l=t.memoizedState;if(n=l.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){s=Zo(Error(se(423)),t),t=Iv(e,t,n,r,s);break e}else if(n!==s){s=Zo(Error(se(424)),t),t=Iv(e,t,n,r,s);break e}else for(_r=Is(t.stateNode.containerInfo.firstChild),xr=t,st=!0,nn=null,r=H0(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Go(),n===s){t=Xn(e,t,r);break e}Kt(e,t,n,r)}t=t.child}return t;case 5:return W0(t),e===null&&of(t),n=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,l=s.children,ef(n,s)?l=null:i!==null&&ef(n,i)&&(t.flags|=32),mb(e,t),Kt(e,t,l,r),t.child;case 6:return e===null&&of(t),null;case 13:return vb(e,t,r);case 4:return Zp(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Qo(t,null,n,r):Kt(e,t,n,r),t.child;case 11:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:en(n,s),Lv(e,t,n,s,r);case 7:return Kt(e,t,t.pendingProps,r),t.child;case 8:return Kt(e,t,t.pendingProps.children,r),t.child;case 12:return Kt(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,s=t.pendingProps,i=t.memoizedProps,l=s.value,Ye(lu,n._currentValue),n._currentValue=l,i!==null)if(cn(i.value,l)){if(i.children===s.children&&!ir.current){t=Xn(e,t,r);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){l=i.child;for(var c=a.firstContext;c!==null;){if(c.context===n){if(i.tag===1){c=qn(-1,r&-r),c.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var g=u.pending;g===null?c.next=c:(c.next=g.next,g.next=c),u.pending=c}}i.lanes|=r,c=i.alternate,c!==null&&(c.lanes|=r),af(i.return,r,t),a.lanes|=r;break}c=c.next}}else if(i.tag===10)l=i.type===t.type?null:i.child;else if(i.tag===18){if(l=i.return,l===null)throw Error(se(341));l.lanes|=r,a=l.alternate,a!==null&&(a.lanes|=r),af(l,r,t),l=i.sibling}else l=i.child;if(l!==null)l.return=i;else for(l=i;l!==null;){if(l===t){l=null;break}if(i=l.sibling,i!==null){i.return=l.return,l=i;break}l=l.return}i=l}Kt(e,t,s.children,r),t=t.child}return t;case 9:return s=t.type,n=t.pendingProps.children,ko(t,r),s=Hr(s),n=n(s),t.flags|=1,Kt(e,t,n,r),t.child;case 14:return n=t.type,s=en(n,t.pendingProps),s=en(n.type,s),Mv(e,t,n,s,r);case 15:return fb(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:en(n,s),$c(e,t),t.tag=1,or(n)?(e=!0,iu(t)):e=!1,ko(t,r),ub(t,n,s),cf(t,n,s,r),hf(null,t,n,!0,e,r);case 19:return _b(e,t,r);case 22:return pb(e,t,r)}throw Error(se(156,t.tag))};function Lb(e,t){return a0(e,t)}function Kj(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Mr(e,t,r,n){return new Kj(e,t,r,n)}function hm(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Gj(e){if(typeof e=="function")return hm(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Tp)return 11;if(e===Ap)return 14}return 2}function Hs(e,t){var r=e.alternate;return r===null?(r=Mr(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Uc(e,t,r,n,s,i){var l=2;if(n=e,typeof e=="function")hm(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case lo:return Ni(r.children,s,i,t);case Pp:l=8,s|=8;break;case Ah:return e=Mr(12,r,t,s|2),e.elementType=Ah,e.lanes=i,e;case Dh:return e=Mr(13,r,t,s),e.elementType=Dh,e.lanes=i,e;case Lh:return e=Mr(19,r,t,s),e.elementType=Lh,e.lanes=i,e;case Wy:return td(r,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case zy:l=10;break e;case Uy:l=9;break e;case Tp:l=11;break e;case Ap:l=14;break e;case ms:l=16,n=null;break e}throw Error(se(130,e==null?e:typeof e,""))}return t=Mr(l,r,t,s),t.elementType=e,t.type=n,t.lanes=i,t}function Ni(e,t,r,n){return e=Mr(7,e,n,t),e.lanes=r,e}function td(e,t,r,n){return e=Mr(22,e,n,t),e.elementType=Wy,e.lanes=r,e.stateNode={isHidden:!1},e}function th(e,t,r){return e=Mr(6,e,null,t),e.lanes=r,e}function rh(e,t,r){return t=Mr(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Qj(e,t,r,n,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Od(0),this.expirationTimes=Od(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Od(0),this.identifierPrefix=n,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function fm(e,t,r,n,s,i,l,a,c){return e=new Qj(e,t,r,a,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Mr(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Yp(i),e}function Yj(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ao,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function Mb(e){if(!e)return Ks;e=e._reactInternals;e:{if(Bi(e)!==e||e.tag!==1)throw Error(se(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(or(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(se(171))}if(e.tag===1){var r=e.type;if(or(r))return M0(e,r,t)}return t}function Ob(e,t,r,n,s,i,l,a,c){return e=fm(r,n,!0,e,s,i,l,a,c),e.context=Mb(null),r=e.current,n=Qt(),s=$s(r),i=qn(n,s),i.callback=t??null,Fs(r,i,s),e.current.lanes=s,Il(e,s,n),ar(e,n),e}function rd(e,t,r,n){var s=t.current,i=Qt(),l=$s(s);return r=Mb(r),t.context===null?t.context=r:t.pendingContext=r,t=qn(i,l),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=Fs(s,t,l),e!==null&&(ln(e,s,l,i),Ic(e,s,l)),l}function _u(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Kv(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function pm(e,t){Kv(e,t),(e=e.alternate)&&Kv(e,t)}function Zj(){return null}var Ib=typeof reportError=="function"?reportError:function(e){console.error(e)};function mm(e){this._internalRoot=e}nd.prototype.render=mm.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(se(409));rd(e,t,null,null)};nd.prototype.unmount=mm.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Di(function(){rd(null,e,null,null)}),t[Yn]=null}};function nd(e){this._internalRoot=e}nd.prototype.unstable_scheduleHydration=function(e){if(e){var t=p0();e={blockedOn:null,target:e,priority:t};for(var r=0;r<xs.length&&t!==0&&t<xs[r].priority;r++);xs.splice(r,0,e),r===0&&g0(e)}};function gm(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function sd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Gv(){}function Xj(e,t,r,n,s){if(s){if(typeof n=="function"){var i=n;n=function(){var u=_u(l);i.call(u)}}var l=Ob(t,n,e,0,null,!1,!1,"",Gv);return e._reactRootContainer=l,e[Yn]=l.current,hl(e.nodeType===8?e.parentNode:e),Di(),l}for(;s=e.lastChild;)e.removeChild(s);if(typeof n=="function"){var a=n;n=function(){var u=_u(c);a.call(u)}}var c=fm(e,0,!1,null,null,!1,!1,"",Gv);return e._reactRootContainer=c,e[Yn]=c.current,hl(e.nodeType===8?e.parentNode:e),Di(function(){rd(t,c,r,n)}),c}function id(e,t,r,n,s){var i=r._reactRootContainer;if(i){var l=i;if(typeof s=="function"){var a=s;s=function(){var c=_u(l);a.call(c)}}rd(t,l,e,s)}else l=Xj(r,t,e,s,n);return _u(l)}h0=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Ha(t.pendingLanes);r!==0&&(Mp(t,r|1),ar(t,gt()),!(Oe&6)&&(Xo=gt()+500,ri()))}break;case 13:Di(function(){var n=Zn(e,1);if(n!==null){var s=Qt();ln(n,e,1,s)}}),pm(e,1)}};Op=function(e){if(e.tag===13){var t=Zn(e,134217728);if(t!==null){var r=Qt();ln(t,e,134217728,r)}pm(e,134217728)}};f0=function(e){if(e.tag===13){var t=$s(e),r=Zn(e,t);if(r!==null){var n=Qt();ln(r,e,t,n)}pm(e,t)}};p0=function(){return qe};m0=function(e,t){var r=qe;try{return qe=e,t()}finally{qe=r}};Wh=function(e,t,r){switch(t){case"input":if(Ih(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var s=Qu(n);if(!s)throw Error(se(90));qy(n),Ih(n,s)}}}break;case"textarea":Gy(e,r);break;case"select":t=r.value,t!=null&&bo(e,!!r.multiple,t,!1)}};t0=cm;r0=Di;var Jj={usingClientEntryPoint:!1,Events:[Bl,fo,Qu,Jy,e0,cm]},Ra={findFiberByHostInstance:di,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},eN={bundleType:Ra.bundleType,version:Ra.version,rendererPackageName:Ra.rendererPackageName,rendererConfig:Ra.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ns.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=i0(e),e===null?null:e.stateNode},findFiberByHostInstance:Ra.findFiberByHostInstance||Zj,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var _c=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!_c.isDisabled&&_c.supportsFiber)try{Vu=_c.inject(eN),Cn=_c}catch{}}Er.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Jj;Er.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!gm(t))throw Error(se(200));return Yj(e,t,null,r)};Er.createRoot=function(e,t){if(!gm(e))throw Error(se(299));var r=!1,n="",s=Ib;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=fm(e,1,!1,null,null,r,!1,n,s),e[Yn]=t.current,hl(e.nodeType===8?e.parentNode:e),new mm(t)};Er.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(se(188)):(e=Object.keys(e).join(","),Error(se(268,e)));return e=i0(t),e=e===null?null:e.stateNode,e};Er.flushSync=function(e){return Di(e)};Er.hydrate=function(e,t,r){if(!sd(t))throw Error(se(200));return id(null,e,t,!0,r)};Er.hydrateRoot=function(e,t,r){if(!gm(e))throw Error(se(405));var n=r!=null&&r.hydratedSources||null,s=!1,i="",l=Ib;if(r!=null&&(r.unstable_strictMode===!0&&(s=!0),r.identifierPrefix!==void 0&&(i=r.identifierPrefix),r.onRecoverableError!==void 0&&(l=r.onRecoverableError)),t=Ob(t,null,e,1,r??null,s,!1,i,l),e[Yn]=t.current,hl(e),n)for(e=0;e<n.length;e++)r=n[e],s=r._getVersion,s=s(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,s]:t.mutableSourceEagerHydrationData.push(r,s);return new nd(t)};Er.render=function(e,t,r){if(!sd(t))throw Error(se(200));return id(null,e,t,!1,r)};Er.unmountComponentAtNode=function(e){if(!sd(e))throw Error(se(40));return e._reactRootContainer?(Di(function(){id(null,null,e,!1,function(){e._reactRootContainer=null,e[Yn]=null})}),!0):!1};Er.unstable_batchedUpdates=cm;Er.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!sd(r))throw Error(se(200));if(e==null||e._reactInternals===void 0)throw Error(se(38));return id(e,t,r,!1,n)};Er.version="18.3.1-next-f1338f8080-20240426";function Fb(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Fb)}catch(e){console.error(e)}}Fb(),Fy.exports=Er;var od=Fy.exports;const Bb=Ey(od);var Qv=od;Ph.createRoot=Qv.createRoot,Ph.hydrateRoot=Qv.hydrateRoot;var ha=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},_i,bs,Do,my,tN=(my=class extends ha{constructor(){super();xe(this,_i);xe(this,bs);xe(this,Do);ue(this,Do,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){F(this,bs)||this.setEventListener(F(this,Do))}onUnsubscribe(){var t;this.hasListeners()||((t=F(this,bs))==null||t.call(this),ue(this,bs,void 0))}setEventListener(t){var r;ue(this,Do,t),(r=F(this,bs))==null||r.call(this),ue(this,bs,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){F(this,_i)!==t&&(ue(this,_i,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof F(this,_i)=="boolean"?F(this,_i):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},_i=new WeakMap,bs=new WeakMap,Do=new WeakMap,my),vm=new tN,rN={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},ws,wp,gy,nN=(gy=class{constructor(){xe(this,ws,rN);xe(this,wp,!1)}setTimeoutProvider(e){ue(this,ws,e)}setTimeout(e,t){return F(this,ws).setTimeout(e,t)}clearTimeout(e){F(this,ws).clearTimeout(e)}setInterval(e,t){return F(this,ws).setInterval(e,t)}clearInterval(e){F(this,ws).clearInterval(e)}},ws=new WeakMap,wp=new WeakMap,gy),pi=new nN;function sN(e){setTimeout(e,0)}var iN=typeof window>"u"||"Deno"in globalThis;function Gt(){}function oN(e,t){return typeof e=="function"?e(t):e}function Cf(e){return typeof e=="number"&&e>=0&&e!==1/0}function $b(e,t){return Math.max(e+(t||0)-Date.now(),0)}function zs(e,t){return typeof e=="function"?e(t):e}function pr(e,t){return typeof e=="function"?e(t):e}function Yv(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:i,queryKey:l,stale:a}=e;if(l){if(n){if(t.queryHash!==_m(l,t.options))return!1}else if(!bl(t.queryKey,l))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||s&&s!==t.state.fetchStatus||i&&!i(t))}function Zv(e,t){const{exact:r,status:n,predicate:s,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(r){if(Li(t.options.mutationKey)!==Li(i))return!1}else if(!bl(t.options.mutationKey,i))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function _m(e,t){return((t==null?void 0:t.queryKeyHashFn)||Li)(e)}function Li(e){return JSON.stringify(e,(t,r)=>kf(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function bl(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>bl(e[r],t[r])):!1}var aN=Object.prototype.hasOwnProperty;function Hb(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=Xv(e)&&Xv(t);if(!n&&!(kf(e)&&kf(t)))return t;const i=(n?e:Object.keys(e)).length,l=n?t:Object.keys(t),a=l.length,c=n?new Array(a):{};let u=0;for(let g=0;g<a;g++){const d=n?g:l[g],_=e[d],v=t[d];if(_===v){c[d]=_,(n?g<i:aN.call(e,d))&&u++;continue}if(_===null||v===null||typeof _!="object"||typeof v!="object"){c[d]=v;continue}const x=Hb(_,v,r+1);c[d]=x,x===_&&u++}return i===a&&u===i?e:c}function xu(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function Xv(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function kf(e){if(!Jv(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!Jv(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Jv(e){return Object.prototype.toString.call(e)==="[object Object]"}function lN(e){return new Promise(t=>{pi.setTimeout(t,e)})}function Ef(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?Hb(e,t):t}function cN(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function uN(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var xm=Symbol();function zb(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===xm?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ym(e,t){return typeof e=="function"?e(...t):!!e}function dN(e,t,r){let n=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=t()),n||(n=!0,s.aborted?r():s.addEventListener("abort",r,{once:!0})),s)}),e}var wl=(()=>{let e=()=>iN;return{isServer(){return e()},setIsServer(t){e=t}}})();function jf(){let e,t;const r=new Promise((s,i)=>{e=s,t=i});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),e(s)},r.reject=s=>{n({status:"rejected",reason:s}),t(s)},r}var hN=sN;function fN(){let e=[],t=0,r=a=>{a()},n=a=>{a()},s=hN;const i=a=>{t?e.push(a):s(()=>{r(a)})},l=()=>{const a=e;e=[],a.length&&s(()=>{n(()=>{a.forEach(c=>{r(c)})})})};return{batch:a=>{let c;t++;try{c=a()}finally{t--,t||l()}return c},batchCalls:a=>(...c)=>{i(()=>{a(...c)})},schedule:i,setNotifyFunction:a=>{r=a},setBatchNotifyFunction:a=>{n=a},setScheduler:a=>{s=a}}}var wt=fN(),Lo,Ss,Mo,vy,pN=(vy=class extends ha{constructor(){super();xe(this,Lo,!0);xe(this,Ss);xe(this,Mo);ue(this,Mo,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){F(this,Ss)||this.setEventListener(F(this,Mo))}onUnsubscribe(){var t;this.hasListeners()||((t=F(this,Ss))==null||t.call(this),ue(this,Ss,void 0))}setEventListener(t){var r;ue(this,Mo,t),(r=F(this,Ss))==null||r.call(this),ue(this,Ss,t(this.setOnline.bind(this)))}setOnline(t){F(this,Lo)!==t&&(ue(this,Lo,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return F(this,Lo)}},Lo=new WeakMap,Ss=new WeakMap,Mo=new WeakMap,vy),yu=new pN;function mN(e){return Math.min(1e3*2**e,3e4)}function Ub(e){return(e??"online")==="online"?yu.isOnline():!0}var Nf=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Wb(e){let t=!1,r=0,n;const s=jf(),i=()=>s.status!=="pending",l=y=>{var f;if(!i()){const p=new Nf(y);_(p),(f=e.onCancel)==null||f.call(e,p)}},a=()=>{t=!0},c=()=>{t=!1},u=()=>vm.isFocused()&&(e.networkMode==="always"||yu.isOnline())&&e.canRun(),g=()=>Ub(e.networkMode)&&e.canRun(),d=y=>{i()||(n==null||n(),s.resolve(y))},_=y=>{i()||(n==null||n(),s.reject(y))},v=()=>new Promise(y=>{var f;n=p=>{(i()||u())&&y(p)},(f=e.onPause)==null||f.call(e)}).then(()=>{var y;n=void 0,i()||(y=e.onContinue)==null||y.call(e)}),x=()=>{if(i())return;let y;const f=r===0?e.initialPromise:void 0;try{y=f??e.fn()}catch(p){y=Promise.reject(p)}Promise.resolve(y).then(d).catch(p=>{var k;if(i())return;const h=e.retry??(wl.isServer()?0:3),m=e.retryDelay??mN,b=typeof m=="function"?m(r,p):m,w=h===!0||typeof h=="number"&&r<h||typeof h=="function"&&h(r,p);if(t||!w){_(p);return}r++,(k=e.onFail)==null||k.call(e,r,p),lN(b).then(()=>u()?void 0:v()).then(()=>{t?_(p):x()})})};return{promise:s,status:()=>s.status,cancel:l,continue:()=>(n==null||n(),s),cancelRetry:a,continueRetry:c,canStart:g,start:()=>(g()?x():v().then(x),s)}}var xi,_y,Vb=(_y=class{constructor(){xe(this,xi)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Cf(this.gcTime)&&ue(this,xi,pi.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(wl.isServer()?1/0:5*60*1e3))}clearGcTimeout(){F(this,xi)!==void 0&&(pi.clearTimeout(F(this,xi)),ue(this,xi,void 0))}},xi=new WeakMap,_y);function gN(e){return{onFetch:(t,r)=>{var g,d,_,v,x;const n=t.options,s=(_=(d=(g=t.fetchOptions)==null?void 0:g.meta)==null?void 0:d.fetchMore)==null?void 0:_.direction,i=((v=t.state.data)==null?void 0:v.pages)||[],l=((x=t.state.data)==null?void 0:x.pageParams)||[];let a={pages:[],pageParams:[]},c=0;const u=async()=>{let y=!1;const f=m=>{dN(m,()=>t.signal,()=>y=!0)},p=zb(t.options,t.fetchOptions),h=async(m,b,w)=>{if(y)return Promise.reject(t.signal.reason);if(b==null&&m.pages.length)return Promise.resolve(m);const j=(()=>{const M={client:t.client,queryKey:t.queryKey,pageParam:b,direction:w?"backward":"forward",meta:t.options.meta};return f(M),M})(),S=await p(j),{maxPages:E}=t.options,R=w?uN:cN;return{pages:R(m.pages,S,E),pageParams:R(m.pageParams,b,E)}};if(s&&i.length){const m=s==="backward",b=m?qb:Rf,w={pages:i,pageParams:l},k=b(n,w);a=await h(w,k,m)}else{const m=e??i.length;do{const b=c===0?l[0]??n.initialPageParam:Rf(n,a);if(c>0&&b==null)break;a=await h(a,b),c++}while(c<m)}return a};t.options.persister?t.fetchFn=()=>{var y,f;return(f=(y=t.options).persister)==null?void 0:f.call(y,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=u}}}function Rf(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function qb(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}function vN(e,t){return t?Rf(e,t)!=null:!1}function _N(e,t){return!t||!e.getPreviousPageParam?!1:qb(e,t)!=null}var Oo,yi,Io,Nr,bi,kt,Tl,wi,fr,Kb,On,xy,xN=(xy=class extends Vb{constructor(t){super();xe(this,fr);xe(this,Oo);xe(this,yi);xe(this,Io);xe(this,Nr);xe(this,bi);xe(this,kt);xe(this,Tl);xe(this,wi);ue(this,wi,!1),ue(this,Tl,t.defaultOptions),this.setOptions(t.options),this.observers=[],ue(this,bi,t.client),ue(this,Nr,F(this,bi).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ue(this,yi,t_(this.options)),this.state=t.state??F(this,yi),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return F(this,Oo)}get promise(){var t;return(t=F(this,kt))==null?void 0:t.promise}setOptions(t){if(this.options={...F(this,Tl),...t},t!=null&&t._type&&ue(this,Oo,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=t_(this.options);r.data!==void 0&&(this.setState(e_(r.data,r.dataUpdatedAt)),ue(this,yi,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&F(this,Nr).remove(this)}setData(t,r){const n=Ef(this.state.data,t,this.options);return Re(this,fr,On).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t){Re(this,fr,On).call(this,{type:"setState",state:t})}cancel(t){var n,s;const r=(n=F(this,kt))==null?void 0:n.promise;return(s=F(this,kt))==null||s.cancel(t),r?r.then(Gt).catch(Gt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return F(this,yi)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>pr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===xm||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>zs(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!$b(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=F(this,kt))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=F(this,kt))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),F(this,Nr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(F(this,kt)&&(F(this,wi)||Re(this,fr,Kb).call(this)?F(this,kt).cancel({revert:!0}):F(this,kt).cancelRetry()),this.scheduleGc()),F(this,Nr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Re(this,fr,On).call(this,{type:"invalidate"})}async fetch(t,r){var u,g,d,_,v,x,y,f,p,h,m;if(this.state.fetchStatus!=="idle"&&((u=F(this,kt))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(F(this,kt))return F(this,kt).continueRetry(),F(this,kt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const b=this.observers.find(w=>w.options.queryFn);b&&this.setOptions(b.options)}const n=new AbortController,s=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(ue(this,wi,!0),n.signal)})},i=()=>{const b=zb(this.options,r),k=(()=>{const j={client:F(this,bi),queryKey:this.queryKey,meta:this.meta};return s(j),j})();return ue(this,wi,!1),this.options.persister?this.options.persister(b,k,this):b(k)},a=(()=>{const b={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:F(this,bi),state:this.state,fetchFn:i};return s(b),b})(),c=F(this,Oo)==="infinite"?gN(this.options.pages):this.options.behavior;c==null||c.onFetch(a,this),ue(this,Io,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((g=a.fetchOptions)==null?void 0:g.meta))&&Re(this,fr,On).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta}),ue(this,kt,Wb({initialPromise:r==null?void 0:r.initialPromise,fn:a.fetchFn,onCancel:b=>{b instanceof Nf&&b.revert&&this.setState({...F(this,Io),fetchStatus:"idle"}),n.abort()},onFail:(b,w)=>{Re(this,fr,On).call(this,{type:"failed",failureCount:b,error:w})},onPause:()=>{Re(this,fr,On).call(this,{type:"pause"})},onContinue:()=>{Re(this,fr,On).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const b=await F(this,kt).start();if(b===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(b),(v=(_=F(this,Nr).config).onSuccess)==null||v.call(_,b,this),(y=(x=F(this,Nr).config).onSettled)==null||y.call(x,b,this.state.error,this),b}catch(b){if(b instanceof Nf){if(b.silent)return F(this,kt).promise;if(b.revert){if(this.state.data===void 0)throw b;return this.state.data}}throw Re(this,fr,On).call(this,{type:"error",error:b}),(p=(f=F(this,Nr).config).onError)==null||p.call(f,b,this),(m=(h=F(this,Nr).config).onSettled)==null||m.call(h,this.state.data,b,this),b}finally{this.scheduleGc()}}},Oo=new WeakMap,yi=new WeakMap,Io=new WeakMap,Nr=new WeakMap,bi=new WeakMap,kt=new WeakMap,Tl=new WeakMap,wi=new WeakMap,fr=new WeakSet,Kb=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},On=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Gb(n.data,this.options),fetchMeta:t.meta??null};case"success":const s={...n,...e_(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ue(this,Io,t.manual?s:void 0),s;case"error":const i=t.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),wt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),F(this,Nr).notify({query:this,type:"updated",action:t})})},xy);function Gb(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ub(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function e_(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function t_(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var er,Le,Al,qt,Si,Fo,$n,Cs,Dl,Bo,$o,Ci,ki,ks,Ho,ze,Ua,Pf,Tf,Af,Df,Lf,Mf,Of,Yb,yy,Qb=(yy=class extends ha{constructor(t,r){super();xe(this,ze);xe(this,er);xe(this,Le);xe(this,Al);xe(this,qt);xe(this,Si);xe(this,Fo);xe(this,$n);xe(this,Cs);xe(this,Dl);xe(this,Bo);xe(this,$o);xe(this,Ci);xe(this,ki);xe(this,ks);xe(this,Ho,new Set);this.options=r,ue(this,er,t),ue(this,Cs,null),ue(this,$n,jf()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(F(this,Le).addObserver(this),r_(F(this,Le),this.options)?Re(this,ze,Ua).call(this):this.updateResult(),Re(this,ze,Df).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return If(F(this,Le),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return If(F(this,Le),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Re(this,ze,Lf).call(this),Re(this,ze,Mf).call(this),F(this,Le).removeObserver(this)}setOptions(t){const r=this.options,n=F(this,Le);if(this.options=F(this,er).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof pr(this.options.enabled,F(this,Le))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Re(this,ze,Of).call(this),F(this,Le).setOptions(this.options),r._defaulted&&!xu(this.options,r)&&F(this,er).getQueryCache().notify({type:"observerOptionsUpdated",query:F(this,Le),observer:this});const s=this.hasListeners();s&&n_(F(this,Le),n,this.options,r)&&Re(this,ze,Ua).call(this),this.updateResult(),s&&(F(this,Le)!==n||pr(this.options.enabled,F(this,Le))!==pr(r.enabled,F(this,Le))||zs(this.options.staleTime,F(this,Le))!==zs(r.staleTime,F(this,Le)))&&Re(this,ze,Pf).call(this);const i=Re(this,ze,Tf).call(this);s&&(F(this,Le)!==n||pr(this.options.enabled,F(this,Le))!==pr(r.enabled,F(this,Le))||i!==F(this,ks))&&Re(this,ze,Af).call(this,i)}getOptimisticResult(t){const r=F(this,er).getQueryCache().build(F(this,er),t),n=this.createResult(r,t);return bN(this,n)&&(ue(this,qt,n),ue(this,Fo,this.options),ue(this,Si,F(this,Le).state)),n}getCurrentResult(){return F(this,qt)}trackResult(t,r){return new Proxy(t,{get:(n,s)=>(this.trackProp(s),r==null||r(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&F(this,$n).status==="pending"&&F(this,$n).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,s))})}trackProp(t){F(this,Ho).add(t)}getCurrentQuery(){return F(this,Le)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=F(this,er).defaultQueryOptions(t),n=F(this,er).getQueryCache().build(F(this,er),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return Re(this,ze,Ua).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),F(this,qt)))}createResult(t,r){var E;const n=F(this,Le),s=this.options,i=F(this,qt),l=F(this,Si),a=F(this,Fo),u=t!==n?t.state:F(this,Al),{state:g}=t;let d={...g},_=!1,v;if(r._optimisticResults){const R=this.hasListeners(),M=!R&&r_(t,r),A=R&&n_(t,n,r,s);(M||A)&&(d={...d,...Gb(g.data,t.options)}),r._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:x,errorUpdatedAt:y,status:f}=d;v=d.data;let p=!1;if(r.placeholderData!==void 0&&v===void 0&&f==="pending"){let R;i!=null&&i.isPlaceholderData&&r.placeholderData===(a==null?void 0:a.placeholderData)?(R=i.data,p=!0):R=typeof r.placeholderData=="function"?r.placeholderData((E=F(this,$o))==null?void 0:E.state.data,F(this,$o)):r.placeholderData,R!==void 0&&(f="success",v=Ef(i==null?void 0:i.data,R,r),_=!0)}if(r.select&&v!==void 0&&!p)if(i&&v===(l==null?void 0:l.data)&&r.select===F(this,Dl))v=F(this,Bo);else try{ue(this,Dl,r.select),v=r.select(v),v=Ef(i==null?void 0:i.data,v,r),ue(this,Bo,v),ue(this,Cs,null)}catch(R){ue(this,Cs,R)}F(this,Cs)&&(x=F(this,Cs),v=F(this,Bo),y=Date.now(),f="error");const h=d.fetchStatus==="fetching",m=f==="pending",b=f==="error",w=m&&h,k=v!==void 0,S={status:f,fetchStatus:d.fetchStatus,isPending:m,isSuccess:f==="success",isError:b,isInitialLoading:w,isLoading:w,data:v,dataUpdatedAt:d.dataUpdatedAt,error:x,errorUpdatedAt:y,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:d.dataUpdateCount>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:h,isRefetching:h&&!m,isLoadingError:b&&!k,isPaused:d.fetchStatus==="paused",isPlaceholderData:_,isRefetchError:b&&k,isStale:bm(t,r),refetch:this.refetch,promise:F(this,$n),isEnabled:pr(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const R=S.data!==void 0,M=S.status==="error"&&!R,A=U=>{M?U.reject(S.error):R&&U.resolve(S.data)},L=()=>{const U=ue(this,$n,S.promise=jf());A(U)},B=F(this,$n);switch(B.status){case"pending":t.queryHash===n.queryHash&&A(B);break;case"fulfilled":(M||S.data!==B.value)&&L();break;case"rejected":(!M||S.error!==B.reason)&&L();break}}return S}updateResult(){const t=F(this,qt),r=this.createResult(F(this,Le),this.options);if(ue(this,Si,F(this,Le).state),ue(this,Fo,this.options),F(this,Si).data!==void 0&&ue(this,$o,F(this,Le)),xu(r,t))return;ue(this,qt,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!F(this,Ho).size)return!0;const l=new Set(i??F(this,Ho));return this.options.throwOnError&&l.add("error"),Object.keys(F(this,qt)).some(a=>{const c=a;return F(this,qt)[c]!==t[c]&&l.has(c)})};Re(this,ze,Yb).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Re(this,ze,Df).call(this)}},er=new WeakMap,Le=new WeakMap,Al=new WeakMap,qt=new WeakMap,Si=new WeakMap,Fo=new WeakMap,$n=new WeakMap,Cs=new WeakMap,Dl=new WeakMap,Bo=new WeakMap,$o=new WeakMap,Ci=new WeakMap,ki=new WeakMap,ks=new WeakMap,Ho=new WeakMap,ze=new WeakSet,Ua=function(t){Re(this,ze,Of).call(this);let r=F(this,Le).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Gt)),r},Pf=function(){Re(this,ze,Lf).call(this);const t=zs(this.options.staleTime,F(this,Le));if(wl.isServer()||F(this,qt).isStale||!Cf(t))return;const n=$b(F(this,qt).dataUpdatedAt,t)+1;ue(this,Ci,pi.setTimeout(()=>{F(this,qt).isStale||this.updateResult()},n))},Tf=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(F(this,Le)):this.options.refetchInterval)??!1},Af=function(t){Re(this,ze,Mf).call(this),ue(this,ks,t),!(wl.isServer()||pr(this.options.enabled,F(this,Le))===!1||!Cf(F(this,ks))||F(this,ks)===0)&&ue(this,ki,pi.setInterval(()=>{(this.options.refetchIntervalInBackground||vm.isFocused())&&Re(this,ze,Ua).call(this)},F(this,ks)))},Df=function(){Re(this,ze,Pf).call(this),Re(this,ze,Af).call(this,Re(this,ze,Tf).call(this))},Lf=function(){F(this,Ci)!==void 0&&(pi.clearTimeout(F(this,Ci)),ue(this,Ci,void 0))},Mf=function(){F(this,ki)!==void 0&&(pi.clearInterval(F(this,ki)),ue(this,ki,void 0))},Of=function(){const t=F(this,er).getQueryCache().build(F(this,er),this.options);if(t===F(this,Le))return;const r=F(this,Le);ue(this,Le,t),ue(this,Al,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},Yb=function(t){wt.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(F(this,qt))}),F(this,er).getQueryCache().notify({query:F(this,Le),type:"observerResultsUpdated"})})},yy);function yN(e,t){return pr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&pr(t.retryOnMount,e)===!1)}function r_(e,t){return yN(e,t)||e.state.data!==void 0&&If(e,t,t.refetchOnMount)}function If(e,t,r){if(pr(t.enabled,e)!==!1&&zs(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&bm(e,t)}return!1}function n_(e,t,r,n){return(e!==t||pr(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&bm(e,r)}function bm(e,t){return pr(t.enabled,e)!==!1&&e.isStaleByTime(zs(t.staleTime,e))}function bN(e,t){return!xu(e.getCurrentResult(),t)}var wN=class extends Qb{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){var x,y;const{state:r}=e,n=super.createResult(e,t),{isFetching:s,isRefetching:i,isError:l,isRefetchError:a}=n,c=(y=(x=r.fetchMeta)==null?void 0:x.fetchMore)==null?void 0:y.direction,u=l&&c==="forward",g=s&&c==="forward",d=l&&c==="backward",_=s&&c==="backward";return{...n,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:vN(t,r.data),hasPreviousPage:_N(t,r.data),isFetchNextPageError:u,isFetchingNextPage:g,isFetchPreviousPageError:d,isFetchingPreviousPage:_,isRefetchError:a&&!u&&!d,isRefetching:i&&!g&&!_}}},Ll,_n,It,Ei,xn,fs,by,SN=(by=class extends Vb{constructor(t){super();xe(this,xn);xe(this,Ll);xe(this,_n);xe(this,It);xe(this,Ei);ue(this,Ll,t.client),this.mutationId=t.mutationId,ue(this,It,t.mutationCache),ue(this,_n,[]),this.state=t.state||Zb(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){F(this,_n).includes(t)||(F(this,_n).push(t),this.clearGcTimeout(),F(this,It).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ue(this,_n,F(this,_n).filter(r=>r!==t)),this.scheduleGc(),F(this,It).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){F(this,_n).length||(this.state.status==="pending"?this.scheduleGc():F(this,It).remove(this))}continue(){var t;return((t=F(this,Ei))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,a,c,u,g,d,_,v,x,y,f,p,h,m,b,w,k,j;const r=()=>{Re(this,xn,fs).call(this,{type:"continue"})},n={client:F(this,Ll),meta:this.options.meta,mutationKey:this.options.mutationKey};ue(this,Ei,Wb({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(S,E)=>{Re(this,xn,fs).call(this,{type:"failed",failureCount:S,error:E})},onPause:()=>{Re(this,xn,fs).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>F(this,It).canRun(this)}));const s=this.state.status==="pending",i=!F(this,Ei).canStart();try{if(s)r();else{Re(this,xn,fs).call(this,{type:"pending",variables:t,isPaused:i}),F(this,It).config.onMutate&&await F(this,It).config.onMutate(t,this,n);const E=await((a=(l=this.options).onMutate)==null?void 0:a.call(l,t,n));E!==this.state.context&&Re(this,xn,fs).call(this,{type:"pending",context:E,variables:t,isPaused:i})}const S=await F(this,Ei).start();return await((u=(c=F(this,It).config).onSuccess)==null?void 0:u.call(c,S,t,this.state.context,this,n)),await((d=(g=this.options).onSuccess)==null?void 0:d.call(g,S,t,this.state.context,n)),await((v=(_=F(this,It).config).onSettled)==null?void 0:v.call(_,S,null,this.state.variables,this.state.context,this,n)),await((y=(x=this.options).onSettled)==null?void 0:y.call(x,S,null,t,this.state.context,n)),Re(this,xn,fs).call(this,{type:"success",data:S}),S}catch(S){try{await((p=(f=F(this,It).config).onError)==null?void 0:p.call(f,S,t,this.state.context,this,n))}catch(E){Promise.reject(E)}try{await((m=(h=this.options).onError)==null?void 0:m.call(h,S,t,this.state.context,n))}catch(E){Promise.reject(E)}try{await((w=(b=F(this,It).config).onSettled)==null?void 0:w.call(b,void 0,S,this.state.variables,this.state.context,this,n))}catch(E){Promise.reject(E)}try{await((j=(k=this.options).onSettled)==null?void 0:j.call(k,void 0,S,t,this.state.context,n))}catch(E){Promise.reject(E)}throw Re(this,xn,fs).call(this,{type:"error",error:S}),S}finally{F(this,It).runNext(this)}}},Ll=new WeakMap,_n=new WeakMap,It=new WeakMap,Ei=new WeakMap,xn=new WeakSet,fs=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),wt.batch(()=>{F(this,_n).forEach(n=>{n.onMutationUpdate(t)}),F(this,It).notify({mutation:this,type:"updated",action:t})})},by);function Zb(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Hn,tn,Ml,wy,CN=(wy=class extends ha{constructor(t={}){super();xe(this,Hn);xe(this,tn);xe(this,Ml);this.config=t,ue(this,Hn,new Set),ue(this,tn,new Map),ue(this,Ml,0)}build(t,r,n){const s=new SN({client:t,mutationCache:this,mutationId:++tc(this,Ml)._,options:t.defaultMutationOptions(r),state:n});return this.add(s),s}add(t){F(this,Hn).add(t);const r=xc(t);if(typeof r=="string"){const n=F(this,tn).get(r);n?n.push(t):F(this,tn).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(F(this,Hn).delete(t)){const r=xc(t);if(typeof r=="string"){const n=F(this,tn).get(r);if(n)if(n.length>1){const s=n.indexOf(t);s!==-1&&n.splice(s,1)}else n[0]===t&&F(this,tn).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=xc(t);if(typeof r=="string"){const n=F(this,tn).get(r),s=n==null?void 0:n.find(i=>i.state.status==="pending");return!s||s===t}else return!0}runNext(t){var n;const r=xc(t);if(typeof r=="string"){const s=(n=F(this,tn).get(r))==null?void 0:n.find(i=>i!==t&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){wt.batch(()=>{F(this,Hn).forEach(t=>{this.notify({type:"removed",mutation:t})}),F(this,Hn).clear(),F(this,tn).clear()})}getAll(){return Array.from(F(this,Hn))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Zv(r,n))}findAll(t={}){return this.getAll().filter(r=>Zv(t,r))}notify(t){wt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return wt.batch(()=>Promise.all(t.map(r=>r.continue().catch(Gt))))}},Hn=new WeakMap,tn=new WeakMap,Ml=new WeakMap,wy);function xc(e){var t;return(t=e.options.scope)==null?void 0:t.id}var zn,Es,tr,Un,Gn,Wc,Ff,Sy,kN=(Sy=class extends ha{constructor(r,n){super();xe(this,Gn);xe(this,zn);xe(this,Es);xe(this,tr);xe(this,Un);ue(this,zn,r),this.setOptions(n),this.bindMethods(),Re(this,Gn,Wc).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var s;const n=this.options;this.options=F(this,zn).defaultMutationOptions(r),xu(this.options,n)||F(this,zn).getMutationCache().notify({type:"observerOptionsUpdated",mutation:F(this,tr),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&Li(n.mutationKey)!==Li(this.options.mutationKey)?this.reset():((s=F(this,tr))==null?void 0:s.state.status)==="pending"&&F(this,tr).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=F(this,tr))==null||r.removeObserver(this)}onMutationUpdate(r){Re(this,Gn,Wc).call(this),Re(this,Gn,Ff).call(this,r)}getCurrentResult(){return F(this,Es)}reset(){var r;(r=F(this,tr))==null||r.removeObserver(this),ue(this,tr,void 0),Re(this,Gn,Wc).call(this),Re(this,Gn,Ff).call(this)}mutate(r,n){var s;return ue(this,Un,n),(s=F(this,tr))==null||s.removeObserver(this),ue(this,tr,F(this,zn).getMutationCache().build(F(this,zn),this.options)),F(this,tr).addObserver(this),F(this,tr).execute(r)}},zn=new WeakMap,Es=new WeakMap,tr=new WeakMap,Un=new WeakMap,Gn=new WeakSet,Wc=function(){var n;const r=((n=F(this,tr))==null?void 0:n.state)??Zb();ue(this,Es,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},Ff=function(r){wt.batch(()=>{var n,s,i,l,a,c,u,g;if(F(this,Un)&&this.hasListeners()){const d=F(this,Es).variables,_=F(this,Es).context,v={client:F(this,zn),meta:this.options.meta,mutationKey:this.options.mutationKey};if((r==null?void 0:r.type)==="success"){try{(s=(n=F(this,Un)).onSuccess)==null||s.call(n,r.data,d,_,v)}catch(x){Promise.reject(x)}try{(l=(i=F(this,Un)).onSettled)==null||l.call(i,r.data,null,d,_,v)}catch(x){Promise.reject(x)}}else if((r==null?void 0:r.type)==="error"){try{(c=(a=F(this,Un)).onError)==null||c.call(a,r.error,d,_,v)}catch(x){Promise.reject(x)}try{(g=(u=F(this,Un)).onSettled)==null||g.call(u,void 0,r.error,d,_,v)}catch(x){Promise.reject(x)}}}this.listeners.forEach(d=>{d(F(this,Es))})})},Sy),yn,Cy,EN=(Cy=class extends ha{constructor(t={}){super();xe(this,yn);this.config=t,ue(this,yn,new Map)}build(t,r,n){const s=r.queryKey,i=r.queryHash??_m(s,r);let l=this.get(i);return l||(l=new xN({client:t,queryKey:s,queryHash:i,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(s)}),this.add(l)),l}add(t){F(this,yn).has(t.queryHash)||(F(this,yn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=F(this,yn).get(t.queryHash);r&&(t.destroy(),r===t&&F(this,yn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){wt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return F(this,yn).get(t)}getAll(){return[...F(this,yn).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Yv(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>Yv(t,n)):r}notify(t){wt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){wt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){wt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},yn=new WeakMap,Cy),dt,js,Ns,zo,Uo,Rs,Wo,Vo,ky,jN=(ky=class{constructor(e={}){xe(this,dt);xe(this,js);xe(this,Ns);xe(this,zo);xe(this,Uo);xe(this,Rs);xe(this,Wo);xe(this,Vo);ue(this,dt,e.queryCache||new EN),ue(this,js,e.mutationCache||new CN),ue(this,Ns,e.defaultOptions||{}),ue(this,zo,new Map),ue(this,Uo,new Map),ue(this,Rs,0)}mount(){tc(this,Rs)._++,F(this,Rs)===1&&(ue(this,Wo,vm.subscribe(async e=>{e&&(await this.resumePausedMutations(),F(this,dt).onFocus())})),ue(this,Vo,yu.subscribe(async e=>{e&&(await this.resumePausedMutations(),F(this,dt).onOnline())})))}unmount(){var e,t;tc(this,Rs)._--,F(this,Rs)===0&&((e=F(this,Wo))==null||e.call(this),ue(this,Wo,void 0),(t=F(this,Vo))==null||t.call(this),ue(this,Vo,void 0))}isFetching(e){return F(this,dt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return F(this,js).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=F(this,dt).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=F(this,dt).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(zs(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return F(this,dt).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),s=F(this,dt).get(n.queryHash),i=s==null?void 0:s.state.data,l=oN(t,i);if(l!==void 0)return F(this,dt).build(this,n).setData(l,{...r,manual:!0})}setQueriesData(e,t,r){return wt.batch(()=>F(this,dt).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=F(this,dt).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=F(this,dt);wt.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=F(this,dt);return wt.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=wt.batch(()=>F(this,dt).findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(Gt).catch(Gt)}invalidateQueries(e,t={}){return wt.batch(()=>(F(this,dt).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=wt.batch(()=>F(this,dt).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,r);return r.throwOnError||(i=i.catch(Gt)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(n).then(Gt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=F(this,dt).build(this,t);return r.isStaleByTime(zs(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Gt).catch(Gt)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Gt).catch(Gt)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return yu.isOnline()?F(this,js).resumePausedMutations():Promise.resolve()}getQueryCache(){return F(this,dt)}getMutationCache(){return F(this,js)}getDefaultOptions(){return F(this,Ns)}setDefaultOptions(e){ue(this,Ns,e)}setQueryDefaults(e,t){F(this,zo).set(Li(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...F(this,zo).values()],r={};return t.forEach(n=>{bl(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){F(this,Uo).set(Li(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...F(this,Uo).values()],r={};return t.forEach(n=>{bl(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...F(this,Ns).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=_m(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===xm&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...F(this,Ns).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){F(this,dt).clear(),F(this,js).clear()}},dt=new WeakMap,js=new WeakMap,Ns=new WeakMap,zo=new WeakMap,Uo=new WeakMap,Rs=new WeakMap,Wo=new WeakMap,Vo=new WeakMap,ky),Xb=C.createContext(void 0),ni=e=>{const t=C.useContext(Xb);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},NN=({client:e,children:t})=>(C.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),o.jsx(Xb.Provider,{value:e,children:t})),Jb=C.createContext(!1),RN=()=>C.useContext(Jb);Jb.Provider;function PN(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var TN=C.createContext(PN()),AN=()=>C.useContext(TN),DN=(e,t,r)=>{const n=r!=null&&r.state.error&&typeof e.throwOnError=="function"?ym(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},LN=e=>{C.useEffect(()=>{e.clearReset()},[e])},MN=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&e.data===void 0||ym(r,[e.error,n])),ON=e=>{if(e.suspense){const r=s=>s==="static"?s:Math.max(s??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...s)=>r(n(...s)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},IN=(e,t)=>e.isLoading&&e.isFetching&&!t,FN=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,s_=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function ew(e,t,r){var _,v,x,y;const n=RN(),s=AN(),i=ni(),l=i.defaultQueryOptions(e);(v=(_=i.getDefaultOptions().queries)==null?void 0:_._experimental_beforeQuery)==null||v.call(_,l);const a=i.getQueryCache().get(l.queryHash);l._optimisticResults=n?"isRestoring":"optimistic",ON(l),DN(l,s,a),LN(s);const c=!i.getQueryCache().get(l.queryHash),[u]=C.useState(()=>new t(i,l)),g=u.getOptimisticResult(l),d=!n&&e.subscribed!==!1;if(C.useSyncExternalStore(C.useCallback(f=>{const p=d?u.subscribe(wt.batchCalls(f)):Gt;return u.updateResult(),p},[u,d]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),C.useEffect(()=>{u.setOptions(l)},[l,u]),FN(l,g))throw s_(l,u,s);if(MN({result:g,errorResetBoundary:s,throwOnError:l.throwOnError,query:a,suspense:l.suspense}))throw g.error;if((y=(x=i.getDefaultOptions().queries)==null?void 0:x._experimental_afterQuery)==null||y.call(x,l,g),l.experimental_prefetchInRender&&!wl.isServer()&&IN(g,n)){const f=c?s_(l,u,s):a==null?void 0:a.promise;f==null||f.catch(Gt).finally(()=>{u.updateResult()})}return l.notifyOnChangeProps?g:u.trackResult(g)}function Me(e,t){return ew(e,Qb)}function Kn(e,t){const r=ni(),[n]=C.useState(()=>new kN(r,e));C.useEffect(()=>{n.setOptions(e)},[n,e]);const s=C.useSyncExternalStore(C.useCallback(l=>n.subscribe(wt.batchCalls(l)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),i=C.useCallback((l,a)=>{n.mutate(l,a).catch(Gt)},[n]);if(s.error&&ym(n.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}function BN(e,t){return ew(e,wN)}function $N(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var r,n,s,i,l=[],a="",c=e.split("/");for(c[0]||c.shift();s=c.shift();)r=s[0],r==="*"?(l.push(r),a+=s[1]==="?"?"(?:/(.*))?":"/(.*)"):r===":"?(n=s.indexOf("?",1),i=s.indexOf(".",1),l.push(s.substring(1,~n?n:~i?i:s.length)),a+=~n&&!~i?"(?:/([^/]+?))?":"/([^/]+?)",~i&&(a+=(~n?"?":"")+"\\"+s.substring(i))):a+="/"+s;return{keys:l,pattern:new RegExp("^"+a+(t?"(?=$|/)":"/?$"),"i")}}var tw={exports:{}},rw={};/**
41
+ * @license React
42
+ * use-sync-external-store-shim.production.js
43
+ *
44
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
45
+ *
46
+ * This source code is licensed under the MIT license found in the
47
+ * LICENSE file in the root directory of this source tree.
48
+ */var Jo=C;function HN(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var zN=typeof Object.is=="function"?Object.is:HN,UN=Jo.useState,WN=Jo.useEffect,VN=Jo.useLayoutEffect,qN=Jo.useDebugValue;function KN(e,t){var r=t(),n=UN({inst:{value:r,getSnapshot:t}}),s=n[0].inst,i=n[1];return VN(function(){s.value=r,s.getSnapshot=t,nh(s)&&i({inst:s})},[e,r,t]),WN(function(){return nh(s)&&i({inst:s}),e(function(){nh(s)&&i({inst:s})})},[e]),qN(r),r}function nh(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!zN(e,r)}catch{return!0}}function GN(e,t){return t()}var QN=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?GN:KN;rw.useSyncExternalStore=Jo.useSyncExternalStore!==void 0?Jo.useSyncExternalStore:QN;tw.exports=rw;var YN=tw.exports;const ZN=Wu.useInsertionEffect,XN=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",nw=XN?C.useLayoutEffect:C.useEffect,JN=ZN||nw,wm=e=>{const t=C.useRef([e,(...r)=>t[0](...r)]).current;return JN(()=>{t[0]=e}),t[1]},e2="popstate",Sm="pushState",Cm="replaceState",t2="hashchange",i_=[e2,Sm,Cm,t2],r2=e=>{for(const t of i_)addEventListener(t,e);return()=>{for(const t of i_)removeEventListener(t,e)}},sw=(e,t)=>YN.useSyncExternalStore(r2,e,t),o_=()=>location.search,n2=({ssrSearch:e}={})=>sw(o_,e!=null?()=>e:o_),a_=()=>location.pathname,s2=({ssrPath:e}={})=>sw(a_,e!=null?()=>e:a_),i2=(e,{replace:t=!1,state:r=null}={})=>history[t?Cm:Sm](r,"",e),o2=(e={})=>[s2(e),i2],l_=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[l_]>"u"){for(const e of[Sm,Cm]){const t=history[e];history[e]=function(){const r=t.apply(this,arguments),n=new Event(e);return n.arguments=arguments,dispatchEvent(n),r}}Object.defineProperty(window,l_,{value:!0})}const a2=(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())?"~"+t:t.slice(e.length)||"/",iw=(e="")=>e==="/"?"":e,l2=(e,t)=>e[0]==="~"?e.slice(1):iw(t)+e,c2=(e="",t)=>a2(c_(iw(e)),c_(t)),c_=e=>{try{return decodeURI(e)}catch{return e}},ow={hook:o2,searchHook:n2,parser:$N,base:"",ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:e=>e,aroundNav:(e,t,r)=>e(t,r)},aw=C.createContext(ow),$i=()=>C.useContext(aw),lw={},cw=C.createContext(lw),ad=()=>C.useContext(cw),Hl=e=>{const[t,r]=e.hook(e);return[c2(e.base,t),wm((n,s)=>e.aroundNav(r,l2(n,e.base),s))]},hn=()=>Hl($i()),km=(e,t,r,n)=>{const{pattern:s,keys:i}=t instanceof RegExp?{keys:!1,pattern:t}:e(t||"*",n),l=s.exec(r)||[],[a,...c]=l;return a!==void 0?[!0,(()=>{const u=i!==!1?Object.fromEntries(i.map((d,_)=>[d,c[_]])):l.groups;let g={...c};return u&&Object.assign(g,u),g})(),...n?[a]:[]]:[!1,null]},u2=e=>km($i().parser,e,hn()[0]),uw=({children:e,...t})=>{var g,d,_;const r=$i(),n=t.hook?ow:r;let s=n;const[i,l=t.ssrSearch??""]=((g=t.ssrPath)==null?void 0:g.split("?"))??[];i&&(t.ssrSearch=l,t.ssrPath=i),t.hrefs=t.hrefs??((d=t.hook)==null?void 0:d.hrefs),t.searchHook=t.searchHook??((_=t.hook)==null?void 0:_.searchHook);let a=C.useRef({}),c=a.current,u=c;for(let v in n){const x=v==="base"?n[v]+(t[v]??""):t[v]??n[v];c===u&&x!==u[v]&&(a.current=u={...u}),u[v]=x,(x!==n[v]||x!==s[v])&&(s=u)}return C.createElement(aw.Provider,{value:s,children:e})},u_=({children:e,component:t},r)=>t?C.createElement(t,{params:r}):typeof e=="function"?e(r):e,d2=e=>{let t=C.useRef(lw);const r=t.current;return t.current=Object.keys(e).length!==Object.keys(r).length||Object.entries(e).some(([n,s])=>s!==r[n])?e:r},Nt=({path:e,nest:t,match:r,...n})=>{const s=$i(),[i]=Hl(s),[l,a,c]=r??km(s.parser,e,i,t),u=d2({...ad(),...a});if(!l)return null;const g=c?C.createElement(uw,{base:c},u_(n,u)):u_(n,u);return C.createElement(cw.Provider,{value:u,children:g})},lr=C.forwardRef((e,t)=>{const r=$i(),[n,s]=Hl(r),{to:i="",href:l=i,onClick:a,asChild:c,children:u,className:g,replace:d,state:_,transition:v,...x}=e,y=wm(p=>{p.ctrlKey||p.metaKey||p.altKey||p.shiftKey||p.button!==0||(a==null||a(p),p.defaultPrevented||(p.preventDefault(),s(l,e)))}),f=r.hrefs(l[0]==="~"?l.slice(1):r.base+l,r);return c&&C.isValidElement(u)?C.cloneElement(u,{onClick:y,href:f}):C.createElement("a",{...x,onClick:y,href:f,className:g!=null&&g.call?g(n===l):g,children:u,ref:t})}),dw=e=>Array.isArray(e)?e.flatMap(t=>dw(t&&t.type===C.Fragment?t.props.children:t)):[e],h2=({children:e,location:t})=>{const r=$i(),[n]=Hl(r);for(const s of dw(e)){let i=0;if(C.isValidElement(s)&&(i=km(r.parser,s.props.path,t||n,s.props.nest))[0])return C.cloneElement(s,{match:i})}return null},Wa=e=>{const{to:t,href:r=t}=e,n=$i(),[,s]=Hl(n),i=wm(()=>s(t||r,e)),{ssrContext:l}=n;return nw(()=>{i()},[]),l&&(l.redirectTo=t),null};async function f2(e){if(!(e.headers.get("content-type")??"").includes("application/json"))return null;try{const r=await e.json();if(typeof r!="object"||r===null)return null;const n=r;return{error:typeof n.error=="string"?n.error:void 0,message:typeof n.message=="string"?n.message:void 0}}catch{return null}}async function be(e,t){const r=await fetch(e,{credentials:"same-origin",headers:{Accept:"application/json",...(t==null?void 0:t.headers)??{}},...t});if(!r.ok){const n=await f2(r),s=(n==null?void 0:n.message)??(n==null?void 0:n.error),i=new Error(s?`${r.status} ${r.statusText}: ${s} on ${e}`:`${r.status} ${r.statusText} on ${e}`);throw i.status=r.status,i.code=n==null?void 0:n.error,i}return r.json()}const ge={getStatus:()=>be("/v1/status"),getBootstrap:()=>be("/v1/bootstrap"),getRecentEvents:(e,t=100)=>{const r=new URLSearchParams;return e&&e.length>0&&r.set("kinds",e.join(",")),r.set("limit",String(t)),be(`/v1/events/recent?${r.toString()}`)},getActivityEvents:e=>{const t=new URLSearchParams;e!=null&&e.kinds&&e.kinds.length>0&&t.set("kinds",e.kinds.join(",")),e!=null&&e.outcome&&t.set("outcome",e.outcome),e!=null&&e.requestId&&t.set("requestId",e.requestId),(e==null?void 0:e.beforeId)!==void 0&&t.set("beforeId",String(e.beforeId)),(e==null?void 0:e.limit)!==void 0&&t.set("limit",String(e.limit));const r=t.toString();return be(`/v1/activity-events${r?`?${r}`:""}`)},getActivityEvent:e=>be(`/v1/activity-events/${encodeURIComponent(String(e))}`),getClaudeAuth:()=>be("/v1/auth/claude"),installClaudeCode:()=>be("/v1/setup/claude/install",{method:"POST"}),signInClaude:()=>be("/v1/auth/claude/spawn",{method:"POST"}),triggerDrip:e=>be(e!=null&&e.singleDrip?"/v1/setup/drip?singleDrip=true":"/v1/setup/drip",{method:"POST"}),changeKeystorePassword:(e,t)=>be("/v1/setup/change-password",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({current:e,next:t})}),restartDaemon:e=>be("/api/admin/restart",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e??{})}),stopDaemon:()=>be("/api/admin/stop",{method:"POST"}),getSolverNets:()=>be("/v1/solvernets"),updateSolverNet:(e,t)=>be(`/v1/setup/solvernets/${encodeURIComponent(e)}`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),updateNetwork:e=>be("/v1/setup/network",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)}),restake:e=>be(`/v1/setup/restake/${encodeURIComponent(String(e))}`,{method:"POST"}),retryAgentBinding:e=>be("/v1/setup/agent-binding/retry",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e??{})}),retryBootstrap:()=>be("/v1/setup/bootstrap/retry",{method:"POST"}),updateHarnessMode:e=>be("/v1/setup/harness",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({mode:e})}),hermesDoctor:()=>be("/api/hermes/doctor"),harnessReadiness:e=>be(`/v1/harnesses/${encodeURIComponent(e)}/readiness`),fetchLauncherStatus:()=>be("/v1/launcher/status"),fetchLauncherTasks:(e={})=>{const t=new URLSearchParams;e.cursor&&t.set("cursor",e.cursor),e.limit!==void 0&&t.set("limit",String(e.limit));const r=t.toString();return be(`/v1/launcher/tasks${r?`?${r}`:""}`)},patchLauncherSolverNet:(e,t)=>be(`/v1/launcher/solvernets/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),solvernets:{listDrafts:()=>be("/v1/solvernets/drafts"),getDraft:e=>be(`/v1/solvernets/drafts/${encodeURIComponent(e)}`),createDraft:e=>be("/v1/solvernets/drafts",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e??{})}),updateDraft:(e,t)=>be(`/v1/solvernets/drafts/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),deleteDraft:e=>be(`/v1/solvernets/drafts/${encodeURIComponent(e)}`,{method:"DELETE"}),launch:e=>be(`/v1/solvernets/drafts/${encodeURIComponent(e)}/launch`,{method:"POST"}),transitionLifecycle:(e,t)=>be(`/v1/solvernets/launched/${encodeURIComponent(e)}/lifecycle`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify({target:t})}),updateGeneratorConfig:(e,t)=>be(`/v1/solvernets/launched/${encodeURIComponent(e)}/generator-config`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),get:e=>be(`/v1/solvernets/launched/${encodeURIComponent(e)}`),listLaunched:e=>{const t=new URLSearchParams;e!=null&&e.status&&t.set("status",e.status);const r=t.toString();return be(`/v1/solvernets/launched${r?`?${r}`:""}`)},listRegistry:e=>{const t=new URLSearchParams;e!=null&&e.status&&t.set("status",e.status),e!=null&&e.refresh&&t.set("refresh","1");const r=t.toString();return be(`/v1/solvernets/registry${r?`?${r}`:""}`)},getManifest:e=>be(`/v1/solvernets/registry/${encodeURIComponent(e)}`)},operator:{listArtifacts:(e={})=>{const t=new URLSearchParams;e.source&&t.set("source",e.source),e.artifactType&&t.set("artifactType",e.artifactType),e.limit!==void 0&&t.set("limit",String(e.limit));const r=t.toString();return be(`/v1/operator/execution-data${r?`?${r}`:""}`)},updatePricing:e=>be("/v1/operator/pricing",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)}),join:(e,t)=>be(`/v1/operator/join/${encodeURIComponent(e)}`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),leave:e=>be(`/v1/operator/join/${encodeURIComponent(e)}`,{method:"DELETE"}),listJoined:()=>be("/v1/operator/joined")},captures:{listPending:()=>be("/api/captures/pending"),get:e=>be(`/api/captures/${encodeURIComponent(e)}`),approve:e=>be(`/api/captures/${encodeURIComponent(e)}/approve`,{method:"POST"}),skip:e=>be(`/api/captures/${encodeURIComponent(e)}/skip`,{method:"POST"}),trustRepo:(e,t)=>be("/api/captures/trust-repos",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({repoRemoteUrl:e,trusted:t})})},discovery:{listPluginPublications:e=>{const t=new URLSearchParams;e!=null&&e.solverType&&t.set("solverType",e.solverType),e!=null&&e.builderAgentId&&t.set("builderAgentId",e.builderAgentId),(e==null?void 0:e.includeRevoked)!==void 0&&t.set("includeRevoked",String(e.includeRevoked));const r=t.toString();return be(`/v1/discovery/plugin-publications${r?`?${r}`:""}`)},listBuilderArtifacts:(e,t)=>{const r=new URLSearchParams({builderAgentId:e});return t!==void 0&&r.set("limit",String(t)),be(`/v1/discovery/builder-artifacts?${r.toString()}`)},getPluginScores:(e,t)=>{const r=new URLSearchParams({cid:e});return t!==void 0&&r.set("limit",String(t)),be(`/v1/discovery/plugin-scores?${r.toString()}`)},getSolverNetOperatorCount:e=>{const t=new URLSearchParams({cid:e});return be(`/v1/discovery/solvernet-operator-count?${t.toString()}`)}}};async function p2(){const e=new URL(window.location.href),t=e.searchParams.get("k");if(t){try{await fetch(`/auth/handshake?k=${encodeURIComponent(t)}`,{credentials:"same-origin"})}catch{}e.searchParams.delete("k"),window.history.replaceState({},"",e.toString())}}/**
49
+ * @license lucide-react v0.454.0 - ISC
50
+ *
51
+ * This source code is licensed under the ISC license.
52
+ * See the LICENSE file in the root directory of this source tree.
53
+ */const m2=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),hw=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/**
54
+ * @license lucide-react v0.454.0 - ISC
55
+ *
56
+ * This source code is licensed under the ISC license.
57
+ * See the LICENSE file in the root directory of this source tree.
58
+ */var g2={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
59
+ * @license lucide-react v0.454.0 - ISC
60
+ *
61
+ * This source code is licensed under the ISC license.
62
+ * See the LICENSE file in the root directory of this source tree.
63
+ */const v2=C.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:i,iconNode:l,...a},c)=>C.createElement("svg",{ref:c,...g2,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:hw("lucide",s),...a},[...l.map(([u,g])=>C.createElement(u,g)),...Array.isArray(i)?i:[i]]));/**
64
+ * @license lucide-react v0.454.0 - ISC
65
+ *
66
+ * This source code is licensed under the ISC license.
67
+ * See the LICENSE file in the root directory of this source tree.
68
+ */const ut=(e,t)=>{const r=C.forwardRef(({className:n,...s},i)=>C.createElement(v2,{ref:i,iconNode:t,className:hw(`lucide-${m2(e)}`,n),...s}));return r.displayName=`${e}`,r};/**
69
+ * @license lucide-react v0.454.0 - ISC
70
+ *
71
+ * This source code is licensed under the ISC license.
72
+ * See the LICENSE file in the root directory of this source tree.
73
+ */const _2=ut("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
74
+ * @license lucide-react v0.454.0 - ISC
75
+ *
76
+ * This source code is licensed under the ISC license.
77
+ * See the LICENSE file in the root directory of this source tree.
78
+ */const x2=ut("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
79
+ * @license lucide-react v0.454.0 - ISC
80
+ *
81
+ * This source code is licensed under the ISC license.
82
+ * See the LICENSE file in the root directory of this source tree.
83
+ */const y2=ut("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
84
+ * @license lucide-react v0.454.0 - ISC
85
+ *
86
+ * This source code is licensed under the ISC license.
87
+ * See the LICENSE file in the root directory of this source tree.
88
+ */const Em=ut("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
89
+ * @license lucide-react v0.454.0 - ISC
90
+ *
91
+ * This source code is licensed under the ISC license.
92
+ * See the LICENSE file in the root directory of this source tree.
93
+ */const fw=ut("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
94
+ * @license lucide-react v0.454.0 - ISC
95
+ *
96
+ * This source code is licensed under the ISC license.
97
+ * See the LICENSE file in the root directory of this source tree.
98
+ */const pw=ut("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
99
+ * @license lucide-react v0.454.0 - ISC
100
+ *
101
+ * This source code is licensed under the ISC license.
102
+ * See the LICENSE file in the root directory of this source tree.
103
+ */const b2=ut("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
104
+ * @license lucide-react v0.454.0 - ISC
105
+ *
106
+ * This source code is licensed under the ISC license.
107
+ * See the LICENSE file in the root directory of this source tree.
108
+ */const w2=ut("Compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
109
+ * @license lucide-react v0.454.0 - ISC
110
+ *
111
+ * This source code is licensed under the ISC license.
112
+ * See the LICENSE file in the root directory of this source tree.
113
+ */const S2=ut("Diamond",[["path",{d:"M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z",key:"1f1r0c"}]]);/**
114
+ * @license lucide-react v0.454.0 - ISC
115
+ *
116
+ * This source code is licensed under the ISC license.
117
+ * See the LICENSE file in the root directory of this source tree.
118
+ */const jo=ut("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
119
+ * @license lucide-react v0.454.0 - ISC
120
+ *
121
+ * This source code is licensed under the ISC license.
122
+ * See the LICENSE file in the root directory of this source tree.
123
+ */const C2=ut("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
124
+ * @license lucide-react v0.454.0 - ISC
125
+ *
126
+ * This source code is licensed under the ISC license.
127
+ * See the LICENSE file in the root directory of this source tree.
128
+ */const k2=ut("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
129
+ * @license lucide-react v0.454.0 - ISC
130
+ *
131
+ * This source code is licensed under the ISC license.
132
+ * See the LICENSE file in the root directory of this source tree.
133
+ */const E2=ut("ListTree",[["path",{d:"M21 12h-8",key:"1bmf0i"}],["path",{d:"M21 6H8",key:"1pqkrb"}],["path",{d:"M21 18h-8",key:"1tm79t"}],["path",{d:"M3 6v4c0 1.1.9 2 2 2h3",key:"1ywdgy"}],["path",{d:"M3 10v6c0 1.1.9 2 2 2h3",key:"2wc746"}]]);/**
134
+ * @license lucide-react v0.454.0 - ISC
135
+ *
136
+ * This source code is licensed under the ISC license.
137
+ * See the LICENSE file in the root directory of this source tree.
138
+ */const Bf=ut("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
139
+ * @license lucide-react v0.454.0 - ISC
140
+ *
141
+ * This source code is licensed under the ISC license.
142
+ * See the LICENSE file in the root directory of this source tree.
143
+ */const j2=ut("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
144
+ * @license lucide-react v0.454.0 - ISC
145
+ *
146
+ * This source code is licensed under the ISC license.
147
+ * See the LICENSE file in the root directory of this source tree.
148
+ */const N2=ut("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);/**
149
+ * @license lucide-react v0.454.0 - ISC
150
+ *
151
+ * This source code is licensed under the ISC license.
152
+ * See the LICENSE file in the root directory of this source tree.
153
+ */const R2=ut("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
154
+ * @license lucide-react v0.454.0 - ISC
155
+ *
156
+ * This source code is licensed under the ISC license.
157
+ * See the LICENSE file in the root directory of this source tree.
158
+ */const P2=ut("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
159
+ * @license lucide-react v0.454.0 - ISC
160
+ *
161
+ * This source code is licensed under the ISC license.
162
+ * See the LICENSE file in the root directory of this source tree.
163
+ */const T2=ut("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
164
+ * @license lucide-react v0.454.0 - ISC
165
+ *
166
+ * This source code is licensed under the ISC license.
167
+ * See the LICENSE file in the root directory of this source tree.
168
+ */const A2=ut("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/**
169
+ * @license lucide-react v0.454.0 - ISC
170
+ *
171
+ * This source code is licensed under the ISC license.
172
+ * See the LICENSE file in the root directory of this source tree.
173
+ */const D2=ut("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/**
174
+ * @license lucide-react v0.454.0 - ISC
175
+ *
176
+ * This source code is licensed under the ISC license.
177
+ * See the LICENSE file in the root directory of this source tree.
178
+ */const jm=ut("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
179
+ * @license lucide-react v0.454.0 - ISC
180
+ *
181
+ * This source code is licensed under the ISC license.
182
+ * See the LICENSE file in the root directory of this source tree.
183
+ */const Sl=ut("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function mw(e){const[t,r]=C.useState([]),[n,s]=C.useState(!1);return C.useEffect(()=>{const i=e&&e.length>0?`?kinds=${e.join(",")}`:"",l=new EventSource(`/v1/events${i}`,{withCredentials:!0});return l.onopen=()=>s(!0),l.onerror=()=>s(!1),l.onmessage=a=>{try{const c=JSON.parse(a.data);r(u=>[...u.slice(-499),c])}catch{}},()=>{l.close()}},[e==null?void 0:e.join(",")]),{events:t,connected:n}}function d_(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ss(...e){return t=>{let r=!1;const n=e.map(s=>{const i=d_(s,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let s=0;s<n.length;s++){const i=n[s];typeof i=="function"?i():d_(e[s],null)}}}}function Be(...e){return C.useCallback(ss(...e),e)}var L2=Symbol.for("react.lazy"),bu=Wu[" use ".trim().toString()];function M2(e){return typeof e=="object"&&e!==null&&"then"in e}function gw(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===L2&&"_payload"in e&&M2(e._payload)}function Nm(e){const t=O2(e),r=C.forwardRef((n,s)=>{let{children:i,...l}=n;gw(i)&&typeof bu=="function"&&(i=bu(i._payload));const a=C.Children.toArray(i),c=a.find(F2);if(c){const u=c.props.children,g=a.map(d=>d===c?C.Children.count(u)>1?C.Children.only(null):C.isValidElement(u)?u.props.children:null:d);return o.jsx(t,{...l,ref:s,children:C.isValidElement(u)?C.cloneElement(u,void 0,g):null})}return o.jsx(t,{...l,ref:s,children:i})});return r.displayName=`${e}.Slot`,r}var vw=Nm("Slot");function O2(e){const t=C.forwardRef((r,n)=>{let{children:s,...i}=r;if(gw(s)&&typeof bu=="function"&&(s=bu(s._payload)),C.isValidElement(s)){const l=$2(s),a=B2(i,s.props);return s.type!==C.Fragment&&(a.ref=n?ss(n,l):l),C.cloneElement(s,a)}return C.Children.count(s)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var I2=Symbol("radix.slottable");function F2(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===I2}function B2(e,t){const r={...t};for(const n in t){const s=e[n],i=t[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...a)=>{const c=i(...a);return s(...a),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...e,...r}}function $2(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function _w(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=_w(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function xw(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=_w(e))&&(n&&(n+=" "),n+=t);return n}const h_=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,f_=xw,ld=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return f_(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:i}=t,l=Object.keys(s).map(u=>{const g=r==null?void 0:r[u],d=i==null?void 0:i[u];if(g===null)return null;const _=h_(g)||h_(d);return s[u][_]}),a=r&&Object.entries(r).reduce((u,g)=>{let[d,_]=g;return _===void 0||(u[d]=_),u},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,g)=>{let{class:d,className:_,...v}=g;return Object.entries(v).every(x=>{let[y,f]=x;return Array.isArray(f)?f.includes({...i,...a}[y]):{...i,...a}[y]===f})?[...u,d,_]:u},[]);return f_(e,l,c,r==null?void 0:r.class,r==null?void 0:r.className)},Rm="-",H2=e=>{const t=U2(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:l=>{const a=l.split(Rm);return a[0]===""&&a.length!==1&&a.shift(),yw(a,t)||z2(l)},getConflictingClassGroupIds:(l,a)=>{const c=r[l]||[];return a&&n[l]?[...c,...n[l]]:c}}},yw=(e,t)=>{var l;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),s=n?yw(e.slice(1),n):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join(Rm);return(l=t.validators.find(({validator:a})=>a(i)))==null?void 0:l.classGroupId},p_=/^\[(.+)\]$/,z2=e=>{if(p_.test(e)){const t=p_.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},U2=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return V2(Object.entries(e.classGroups),r).forEach(([i,l])=>{$f(l,n,i,t)}),n},$f=(e,t,r,n)=>{e.forEach(s=>{if(typeof s=="string"){const i=s===""?t:m_(t,s);i.classGroupId=r;return}if(typeof s=="function"){if(W2(s)){$f(s(n),t,r,n);return}t.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([i,l])=>{$f(l,m_(t,i),r,n)})})},m_=(e,t)=>{let r=e;return t.split(Rm).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},W2=e=>e.isThemeGetter,V2=(e,t)=>t?e.map(([r,n])=>{const s=n.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([l,a])=>[t+l,a])):i);return[r,s]}):e,q2=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const s=(i,l)=>{r.set(i,l),t++,t>e&&(t=0,n=r,r=new Map)};return{get(i){let l=r.get(i);if(l!==void 0)return l;if((l=n.get(i))!==void 0)return s(i,l),l},set(i,l){r.has(i)?r.set(i,l):s(i,l)}}},bw="!",K2=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,s=t[0],i=t.length,l=a=>{const c=[];let u=0,g=0,d;for(let f=0;f<a.length;f++){let p=a[f];if(u===0){if(p===s&&(n||a.slice(f,f+i)===t)){c.push(a.slice(g,f)),g=f+i;continue}if(p==="/"){d=f;continue}}p==="["?u++:p==="]"&&u--}const _=c.length===0?a:a.substring(g),v=_.startsWith(bw),x=v?_.substring(1):_,y=d&&d>g?d-g:void 0;return{modifiers:c,hasImportantModifier:v,baseClassName:x,maybePostfixModifierPosition:y}};return r?a=>r({className:a,parseClassName:l}):l},G2=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},Q2=e=>({cache:q2(e.cacheSize),parseClassName:K2(e),...H2(e)}),Y2=/\s+/,Z2=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s}=t,i=[],l=e.trim().split(Y2);let a="";for(let c=l.length-1;c>=0;c-=1){const u=l[c],{modifiers:g,hasImportantModifier:d,baseClassName:_,maybePostfixModifierPosition:v}=r(u);let x=!!v,y=n(x?_.substring(0,v):_);if(!y){if(!x){a=u+(a.length>0?" "+a:a);continue}if(y=n(_),!y){a=u+(a.length>0?" "+a:a);continue}x=!1}const f=G2(g).join(":"),p=d?f+bw:f,h=p+y;if(i.includes(h))continue;i.push(h);const m=s(y,x);for(let b=0;b<m.length;++b){const w=m[b];i.push(p+w)}a=u+(a.length>0?" "+a:a)}return a};function X2(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=ww(t))&&(n&&(n+=" "),n+=r);return n}const ww=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=ww(e[n]))&&(r&&(r+=" "),r+=t);return r};function J2(e,...t){let r,n,s,i=l;function l(c){const u=t.reduce((g,d)=>d(g),e());return r=Q2(u),n=r.cache.get,s=r.cache.set,i=a,a(c)}function a(c){const u=n(c);if(u)return u;const g=Z2(c,r);return s(c,g),g}return function(){return i(X2.apply(null,arguments))}}const Xe=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},Sw=/^\[(?:([a-z-]+):)?(.+)\]$/i,eR=/^\d+\/\d+$/,tR=new Set(["px","full","screen"]),rR=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,nR=/\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$/,sR=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,iR=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,oR=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Mn=e=>No(e)||tR.has(e)||eR.test(e),us=e=>fa(e,"length",pR),No=e=>!!e&&!Number.isNaN(Number(e)),sh=e=>fa(e,"number",No),Pa=e=>!!e&&Number.isInteger(Number(e)),aR=e=>e.endsWith("%")&&No(e.slice(0,-1)),Pe=e=>Sw.test(e),ds=e=>rR.test(e),lR=new Set(["length","size","percentage"]),cR=e=>fa(e,lR,Cw),uR=e=>fa(e,"position",Cw),dR=new Set(["image","url"]),hR=e=>fa(e,dR,gR),fR=e=>fa(e,"",mR),Ta=()=>!0,fa=(e,t,r)=>{const n=Sw.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},pR=e=>nR.test(e)&&!sR.test(e),Cw=()=>!1,mR=e=>iR.test(e),gR=e=>oR.test(e),vR=()=>{const e=Xe("colors"),t=Xe("spacing"),r=Xe("blur"),n=Xe("brightness"),s=Xe("borderColor"),i=Xe("borderRadius"),l=Xe("borderSpacing"),a=Xe("borderWidth"),c=Xe("contrast"),u=Xe("grayscale"),g=Xe("hueRotate"),d=Xe("invert"),_=Xe("gap"),v=Xe("gradientColorStops"),x=Xe("gradientColorStopPositions"),y=Xe("inset"),f=Xe("margin"),p=Xe("opacity"),h=Xe("padding"),m=Xe("saturate"),b=Xe("scale"),w=Xe("sepia"),k=Xe("skew"),j=Xe("space"),S=Xe("translate"),E=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto",Pe,t],A=()=>[Pe,t],L=()=>["",Mn,us],B=()=>["auto",No,Pe],U=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],W=()=>["solid","dashed","dotted","double","none"],q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],N=()=>["start","end","center","between","around","evenly","stretch"],T=()=>["","0",Pe],D=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>[No,Pe];return{cacheSize:500,separator:":",theme:{colors:[Ta],spacing:[Mn,us],blur:["none","",ds,Pe],brightness:O(),borderColor:[e],borderRadius:["none","","full",ds,Pe],borderSpacing:A(),borderWidth:L(),contrast:O(),grayscale:T(),hueRotate:O(),invert:T(),gap:A(),gradientColorStops:[e],gradientColorStopPositions:[aR,us],inset:M(),margin:M(),opacity:O(),padding:A(),saturate:O(),scale:O(),sepia:T(),skew:O(),space:A(),translate:A()},classGroups:{aspect:[{aspect:["auto","square","video",Pe]}],container:["container"],columns:[{columns:[ds]}],"break-after":[{"break-after":D()}],"break-before":[{"break-before":D()}],"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"],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:[...U(),Pe]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Pa,Pe]}],basis:[{basis:M()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Pe]}],grow:[{grow:T()}],shrink:[{shrink:T()}],order:[{order:["first","last","none",Pa,Pe]}],"grid-cols":[{"grid-cols":[Ta]}],"col-start-end":[{col:["auto",{span:["full",Pa,Pe]},Pe]}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":[Ta]}],"row-start-end":[{row:["auto",{span:[Pa,Pe]},Pe]}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Pe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Pe]}],gap:[{gap:[_]}],"gap-x":[{"gap-x":[_]}],"gap-y":[{"gap-y":[_]}],"justify-content":[{justify:["normal",...N()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...N(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...N(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[h]}],px:[{px:[h]}],py:[{py:[h]}],ps:[{ps:[h]}],pe:[{pe:[h]}],pt:[{pt:[h]}],pr:[{pr:[h]}],pb:[{pb:[h]}],pl:[{pl:[h]}],m:[{m:[f]}],mx:[{mx:[f]}],my:[{my:[f]}],ms:[{ms:[f]}],me:[{me:[f]}],mt:[{mt:[f]}],mr:[{mr:[f]}],mb:[{mb:[f]}],ml:[{ml:[f]}],"space-x":[{"space-x":[j]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[j]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Pe,t]}],"min-w":[{"min-w":[Pe,t,"min","max","fit"]}],"max-w":[{"max-w":[Pe,t,"none","full","min","max","fit","prose",{screen:[ds]},ds]}],h:[{h:[Pe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Pe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Pe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Pe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",ds,us]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",sh]}],"font-family":[{font:[Ta]}],"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:["tighter","tight","normal","wide","wider","widest",Pe]}],"line-clamp":[{"line-clamp":["none",No,sh]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Mn,Pe]}],"list-image":[{"list-image":["none",Pe]}],"list-style-type":[{list:["none","disc","decimal",Pe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[p]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[p]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...W(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Mn,us]}],"underline-offset":[{"underline-offset":["auto",Mn,Pe]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Pe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Pe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[p]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...U(),uR]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",cR]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},hR]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[v]}],"gradient-via":[{via:[v]}],"gradient-to":[{to:[v]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[p]}],"border-style":[{border:[...W(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[p]}],"divide-style":[{divide:W()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...W()]}],"outline-offset":[{"outline-offset":[Mn,Pe]}],"outline-w":[{outline:[Mn,us]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[p]}],"ring-offset-w":[{"ring-offset":[Mn,us]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ds,fR]}],"shadow-color":[{shadow:[Ta]}],opacity:[{opacity:[p]}],"mix-blend":[{"mix-blend":[...q(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":q()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",ds,Pe]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[g]}],invert:[{invert:[d]}],saturate:[{saturate:[m]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[g]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[p]}],"backdrop-saturate":[{"backdrop-saturate":[m]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Pe]}],duration:[{duration:O()}],ease:[{ease:["linear","in","out","in-out",Pe]}],delay:[{delay:O()}],animate:[{animate:["none","spin","ping","pulse","bounce",Pe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[Pa,Pe]}],"translate-x":[{"translate-x":[S]}],"translate-y":[{"translate-y":[S]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Pe]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],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",Pe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"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",Pe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Mn,us,sh]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},_R=J2(vR);function X(...e){return _R(xw(e))}const Pm=ld("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md font-mono text-[11px] uppercase tracking-[0.14em] transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-[var(--accent-sky)] text-[var(--bg-sunken)] hover:bg-[var(--accent-sky-hover)]",destructive:"border border-[var(--break-red)] bg-transparent text-[var(--break-red)] hover:bg-[var(--severity-blocking-bg)]",outline:"border border-[var(--accent-sky)] bg-transparent text-[var(--accent-sky)] hover:bg-[var(--bg-sunken)]",secondary:"border border-[var(--border)] bg-transparent text-[var(--fg-muted)] hover:bg-[var(--bg-sunken)] hover:text-[var(--fg)]",ghost:"bg-transparent text-[var(--fg-muted)] hover:bg-[var(--bg-sunken)] hover:text-[var(--fg)]",link:"bg-transparent normal-case tracking-normal text-[var(--accent-sky)] hover:text-[var(--accent-sky-hover)] underline-offset-4 hover:underline"},size:{default:"h-8 px-3 py-1.5",sm:"h-7 px-2.5 text-[10px]",lg:"h-10 px-4 text-xs",icon:"h-8 w-8"}},defaultVariants:{variant:"default",size:"default"}}),ae=C.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...s},i)=>{const l=n?vw:"button";return o.jsx(l,{className:X(Pm({variant:t,size:r,className:e})),ref:i,...s})});ae.displayName="Button";const we=C.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:X("rounded-lg border border-border bg-card text-card-foreground",e),...t}));we.displayName="Card";const cr=C.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:X("flex flex-col gap-1.5 p-6 pb-3",e),...t}));cr.displayName="CardHeader";const Rn=C.forwardRef(({className:e,...t},r)=>o.jsx("h3",{ref:r,className:X("font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",e),...t}));Rn.displayName="CardTitle";const Gs=C.forwardRef(({className:e,...t},r)=>o.jsx("p",{ref:r,className:X("font-mono text-[12px] text-[var(--fg-muted)]",e),...t}));Gs.displayName="CardDescription";const Qe=C.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:X("px-6 pb-6",e),...t}));Qe.displayName="CardContent";const xR=C.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:X("flex items-center px-6 pb-6 pt-0",e),...t}));xR.displayName="CardFooter";function yR(e){const t=bR(e),r=C.forwardRef((n,s)=>{const{children:i,...l}=n,a=C.Children.toArray(i),c=a.find(SR);if(c){const u=c.props.children,g=a.map(d=>d===c?C.Children.count(u)>1?C.Children.only(null):C.isValidElement(u)?u.props.children:null:d);return o.jsx(t,{...l,ref:s,children:C.isValidElement(u)?C.cloneElement(u,void 0,g):null})}return o.jsx(t,{...l,ref:s,children:i})});return r.displayName=`${e}.Slot`,r}function bR(e){const t=C.forwardRef((r,n)=>{const{children:s,...i}=r;if(C.isValidElement(s)){const l=kR(s),a=CR(i,s.props);return s.type!==C.Fragment&&(a.ref=n?ss(n,l):l),C.cloneElement(s,a)}return C.Children.count(s)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var wR=Symbol("radix.slottable");function SR(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===wR}function CR(e,t){const r={...t};for(const n in t){const s=e[n],i=t[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...a)=>{const c=i(...a);return s(...a),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...e,...r}}function kR(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var ER=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$e=ER.reduce((e,t)=>{const r=yR(`Primitive.${t}`),n=C.forwardRef((s,i)=>{const{asChild:l,...a}=s,c=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...a,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function kw(e,t){e&&od.flushSync(()=>e.dispatchEvent(t))}var Jn=globalThis!=null&&globalThis.document?C.useLayoutEffect:()=>{};function jR(e,t){return C.useReducer((r,n)=>t[r][n]??r,e)}var Wt=e=>{const{present:t,children:r}=e,n=NR(t),s=typeof r=="function"?r({present:n.isPresent}):C.Children.only(r),i=Be(n.ref,RR(s));return typeof r=="function"||n.isPresent?C.cloneElement(s,{ref:i}):null};Wt.displayName="Presence";function NR(e){const[t,r]=C.useState(),n=C.useRef(null),s=C.useRef(e),i=C.useRef("none"),l=e?"mounted":"unmounted",[a,c]=jR(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.useEffect(()=>{const u=yc(n.current);i.current=a==="mounted"?u:"none"},[a]),Jn(()=>{const u=n.current,g=s.current;if(g!==e){const _=i.current,v=yc(u);e?c("MOUNT"):v==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(g&&_!==v?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),Jn(()=>{if(t){let u;const g=t.ownerDocument.defaultView??window,d=v=>{const y=yc(n.current).includes(CSS.escape(v.animationName));if(v.target===t&&y&&(c("ANIMATION_END"),!s.current)){const f=t.style.animationFillMode;t.style.animationFillMode="forwards",u=g.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=f)})}},_=v=>{v.target===t&&(i.current=yc(n.current))};return t.addEventListener("animationstart",_),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{g.clearTimeout(u),t.removeEventListener("animationstart",_),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:C.useCallback(u=>{n.current=u?getComputedStyle(u):null,r(u)},[])}}function yc(e){return(e==null?void 0:e.animationName)||"none"}function RR(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function PR(e,t){const r=C.createContext(t),n=i=>{const{children:l,...a}=i,c=C.useMemo(()=>a,Object.values(a));return o.jsx(r.Provider,{value:c,children:l})};n.displayName=e+"Provider";function s(i){const l=C.useContext(r);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[n,s]}function fn(e,t=[]){let r=[];function n(i,l){const a=C.createContext(l),c=r.length;r=[...r,l];const u=d=>{var p;const{scope:_,children:v,...x}=d,y=((p=_==null?void 0:_[e])==null?void 0:p[c])||a,f=C.useMemo(()=>x,Object.values(x));return o.jsx(y.Provider,{value:f,children:v})};u.displayName=i+"Provider";function g(d,_){var y;const v=((y=_==null?void 0:_[e])==null?void 0:y[c])||a,x=C.useContext(v);if(x)return x;if(l!==void 0)return l;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,g]}const s=()=>{const i=r.map(l=>C.createContext(l));return function(a){const c=(a==null?void 0:a[e])||i;return C.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return s.scopeName=e,[n,TR(s,...t)]}function TR(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const l=n.reduce((a,{useScope:c,scopeName:u})=>{const d=c(i)[`__scope${u}`];return{...a,...d}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return r.scopeName=t.scopeName,r}function Ht(e){const t=C.useRef(e);return C.useEffect(()=>{t.current=e}),C.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}var AR=C.createContext(void 0);function Tm(e){const t=C.useContext(AR);return e||t||"ltr"}function DR(e,[t,r]){return Math.min(r,Math.max(t,e))}function _e(e,t,{checkForDefaultPrevented:r=!0}={}){return function(s){if(e==null||e(s),r===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function LR(e,t){return C.useReducer((r,n)=>t[r][n]??r,e)}var Am="ScrollArea",[Ew]=fn(Am),[MR,Wr]=Ew(Am),jw=C.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:s,scrollHideDelay:i=600,...l}=e,[a,c]=C.useState(null),[u,g]=C.useState(null),[d,_]=C.useState(null),[v,x]=C.useState(null),[y,f]=C.useState(null),[p,h]=C.useState(0),[m,b]=C.useState(0),[w,k]=C.useState(!1),[j,S]=C.useState(!1),E=Be(t,M=>c(M)),R=Tm(s);return o.jsx(MR,{scope:r,type:n,dir:R,scrollHideDelay:i,scrollArea:a,viewport:u,onViewportChange:g,content:d,onContentChange:_,scrollbarX:v,onScrollbarXChange:x,scrollbarXEnabled:w,onScrollbarXEnabledChange:k,scrollbarY:y,onScrollbarYChange:f,scrollbarYEnabled:j,onScrollbarYEnabledChange:S,onCornerWidthChange:h,onCornerHeightChange:b,children:o.jsx($e.div,{dir:R,...l,ref:E,style:{position:"relative","--radix-scroll-area-corner-width":p+"px","--radix-scroll-area-corner-height":m+"px",...e.style}})})});jw.displayName=Am;var Nw="ScrollAreaViewport",Rw=C.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:s,...i}=e,l=Wr(Nw,r),a=C.useRef(null),c=Be(t,a,l.onViewportChange);return o.jsxs(o.Fragment,{children:[o.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),o.jsx($e.div,{"data-radix-scroll-area-viewport":"",...i,ref:c,style:{overflowX:l.scrollbarXEnabled?"scroll":"hidden",overflowY:l.scrollbarYEnabled?"scroll":"hidden",...e.style},children:o.jsx("div",{ref:l.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});Rw.displayName=Nw;var Pn="ScrollAreaScrollbar",Dm=C.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=Wr(Pn,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:l}=s,a=e.orientation==="horizontal";return C.useEffect(()=>(a?i(!0):l(!0),()=>{a?i(!1):l(!1)}),[a,i,l]),s.type==="hover"?o.jsx(OR,{...n,ref:t,forceMount:r}):s.type==="scroll"?o.jsx(IR,{...n,ref:t,forceMount:r}):s.type==="auto"?o.jsx(Pw,{...n,ref:t,forceMount:r}):s.type==="always"?o.jsx(Lm,{...n,ref:t}):null});Dm.displayName=Pn;var OR=C.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=Wr(Pn,e.__scopeScrollArea),[i,l]=C.useState(!1);return C.useEffect(()=>{const a=s.scrollArea;let c=0;if(a){const u=()=>{window.clearTimeout(c),l(!0)},g=()=>{c=window.setTimeout(()=>l(!1),s.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",g),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",g)}}},[s.scrollArea,s.scrollHideDelay]),o.jsx(Wt,{present:r||i,children:o.jsx(Pw,{"data-state":i?"visible":"hidden",...n,ref:t})})}),IR=C.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=Wr(Pn,e.__scopeScrollArea),i=e.orientation==="horizontal",l=ud(()=>c("SCROLL_END"),100),[a,c]=LR("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return C.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>c("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,s.scrollHideDelay,c]),C.useEffect(()=>{const u=s.viewport,g=i?"scrollLeft":"scrollTop";if(u){let d=u[g];const _=()=>{const v=u[g];d!==v&&(c("SCROLL"),l()),d=v};return u.addEventListener("scroll",_),()=>u.removeEventListener("scroll",_)}},[s.viewport,i,c,l]),o.jsx(Wt,{present:r||a!=="hidden",children:o.jsx(Lm,{"data-state":a==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:_e(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:_e(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),Pw=C.forwardRef((e,t)=>{const r=Wr(Pn,e.__scopeScrollArea),{forceMount:n,...s}=e,[i,l]=C.useState(!1),a=e.orientation==="horizontal",c=ud(()=>{if(r.viewport){const u=r.viewport.offsetWidth<r.viewport.scrollWidth,g=r.viewport.offsetHeight<r.viewport.scrollHeight;l(a?u:g)}},10);return ea(r.viewport,c),ea(r.content,c),o.jsx(Wt,{present:n||i,children:o.jsx(Lm,{"data-state":i?"visible":"hidden",...s,ref:t})})}),Lm=C.forwardRef((e,t)=>{const{orientation:r="vertical",...n}=e,s=Wr(Pn,e.__scopeScrollArea),i=C.useRef(null),l=C.useRef(0),[a,c]=C.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=Mw(a.viewport,a.content),g={...n,sizes:a,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:_=>i.current=_,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:_=>l.current=_};function d(_,v){return UR(_,l.current,a,v)}return r==="horizontal"?o.jsx(FR,{...g,ref:t,onThumbPositionChange:()=>{if(s.viewport&&i.current){const _=s.viewport.scrollLeft,v=g_(_,a,s.dir);i.current.style.transform=`translate3d(${v}px, 0, 0)`}},onWheelScroll:_=>{s.viewport&&(s.viewport.scrollLeft=_)},onDragScroll:_=>{s.viewport&&(s.viewport.scrollLeft=d(_,s.dir))}}):r==="vertical"?o.jsx(BR,{...g,ref:t,onThumbPositionChange:()=>{if(s.viewport&&i.current){const _=s.viewport.scrollTop,v=g_(_,a);i.current.style.transform=`translate3d(0, ${v}px, 0)`}},onWheelScroll:_=>{s.viewport&&(s.viewport.scrollTop=_)},onDragScroll:_=>{s.viewport&&(s.viewport.scrollTop=d(_))}}):null}),FR=C.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...s}=e,i=Wr(Pn,e.__scopeScrollArea),[l,a]=C.useState(),c=C.useRef(null),u=Be(t,c,i.onScrollbarXChange);return C.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),o.jsx(Aw,{"data-orientation":"horizontal",...s,ref:u,sizes:r,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":cd(r)+"px",...e.style},onThumbPointerDown:g=>e.onThumbPointerDown(g.x),onDragScroll:g=>e.onDragScroll(g.x),onWheelScroll:(g,d)=>{if(i.viewport){const _=i.viewport.scrollLeft+g.deltaX;e.onWheelScroll(_),Iw(_,d)&&g.preventDefault()}},onResize:()=>{c.current&&i.viewport&&l&&n({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Su(l.paddingLeft),paddingEnd:Su(l.paddingRight)}})}})}),BR=C.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...s}=e,i=Wr(Pn,e.__scopeScrollArea),[l,a]=C.useState(),c=C.useRef(null),u=Be(t,c,i.onScrollbarYChange);return C.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),o.jsx(Aw,{"data-orientation":"vertical",...s,ref:u,sizes:r,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":cd(r)+"px",...e.style},onThumbPointerDown:g=>e.onThumbPointerDown(g.y),onDragScroll:g=>e.onDragScroll(g.y),onWheelScroll:(g,d)=>{if(i.viewport){const _=i.viewport.scrollTop+g.deltaY;e.onWheelScroll(_),Iw(_,d)&&g.preventDefault()}},onResize:()=>{c.current&&i.viewport&&l&&n({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Su(l.paddingTop),paddingEnd:Su(l.paddingBottom)}})}})}),[$R,Tw]=Ew(Pn),Aw=C.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:s,onThumbChange:i,onThumbPointerUp:l,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:g,onResize:d,..._}=e,v=Wr(Pn,r),[x,y]=C.useState(null),f=Be(t,E=>y(E)),p=C.useRef(null),h=C.useRef(""),m=v.viewport,b=n.content-n.viewport,w=Ht(g),k=Ht(c),j=ud(d,10);function S(E){if(p.current){const R=E.clientX-p.current.left,M=E.clientY-p.current.top;u({x:R,y:M})}}return C.useEffect(()=>{const E=R=>{const M=R.target;(x==null?void 0:x.contains(M))&&w(R,b)};return document.addEventListener("wheel",E,{passive:!1}),()=>document.removeEventListener("wheel",E,{passive:!1})},[m,x,b,w]),C.useEffect(k,[n,k]),ea(x,j),ea(v.content,j),o.jsx($R,{scope:r,scrollbar:x,hasThumb:s,onThumbChange:Ht(i),onThumbPointerUp:Ht(l),onThumbPositionChange:k,onThumbPointerDown:Ht(a),children:o.jsx($e.div,{..._,ref:f,style:{position:"absolute",..._.style},onPointerDown:_e(e.onPointerDown,E=>{E.button===0&&(E.target.setPointerCapture(E.pointerId),p.current=x.getBoundingClientRect(),h.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",v.viewport&&(v.viewport.style.scrollBehavior="auto"),S(E))}),onPointerMove:_e(e.onPointerMove,S),onPointerUp:_e(e.onPointerUp,E=>{const R=E.target;R.hasPointerCapture(E.pointerId)&&R.releasePointerCapture(E.pointerId),document.body.style.webkitUserSelect=h.current,v.viewport&&(v.viewport.style.scrollBehavior=""),p.current=null})})})}),wu="ScrollAreaThumb",Dw=C.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=Tw(wu,e.__scopeScrollArea);return o.jsx(Wt,{present:r||s.hasThumb,children:o.jsx(HR,{ref:t,...n})})}),HR=C.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...s}=e,i=Wr(wu,r),l=Tw(wu,r),{onThumbPositionChange:a}=l,c=Be(t,d=>l.onThumbChange(d)),u=C.useRef(void 0),g=ud(()=>{u.current&&(u.current(),u.current=void 0)},100);return C.useEffect(()=>{const d=i.viewport;if(d){const _=()=>{if(g(),!u.current){const v=WR(d,a);u.current=v,a()}};return a(),d.addEventListener("scroll",_),()=>d.removeEventListener("scroll",_)}},[i.viewport,g,a]),o.jsx($e.div,{"data-state":l.hasThumb?"visible":"hidden",...s,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:_e(e.onPointerDownCapture,d=>{const v=d.target.getBoundingClientRect(),x=d.clientX-v.left,y=d.clientY-v.top;l.onThumbPointerDown({x,y})}),onPointerUp:_e(e.onPointerUp,l.onThumbPointerUp)})});Dw.displayName=wu;var Mm="ScrollAreaCorner",Lw=C.forwardRef((e,t)=>{const r=Wr(Mm,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?o.jsx(zR,{...e,ref:t}):null});Lw.displayName=Mm;var zR=C.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,s=Wr(Mm,r),[i,l]=C.useState(0),[a,c]=C.useState(0),u=!!(i&&a);return ea(s.scrollbarX,()=>{var d;const g=((d=s.scrollbarX)==null?void 0:d.offsetHeight)||0;s.onCornerHeightChange(g),c(g)}),ea(s.scrollbarY,()=>{var d;const g=((d=s.scrollbarY)==null?void 0:d.offsetWidth)||0;s.onCornerWidthChange(g),l(g)}),u?o.jsx($e.div,{...n,ref:t,style:{width:i,height:a,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Su(e){return e?parseInt(e,10):0}function Mw(e,t){const r=e/t;return isNaN(r)?0:r}function cd(e){const t=Mw(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function UR(e,t,r,n="ltr"){const s=cd(r),i=s/2,l=t||i,a=s-l,c=r.scrollbar.paddingStart+l,u=r.scrollbar.size-r.scrollbar.paddingEnd-a,g=r.content-r.viewport,d=n==="ltr"?[0,g]:[g*-1,0];return Ow([c,u],d)(e)}function g_(e,t,r="ltr"){const n=cd(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-s,l=t.content-t.viewport,a=i-n,c=r==="ltr"?[0,l]:[l*-1,0],u=DR(e,c);return Ow([0,l],[0,a])(u)}function Ow(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function Iw(e,t){return e>0&&e<t}var WR=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function s(){const i={left:e.scrollLeft,top:e.scrollTop},l=r.left!==i.left,a=r.top!==i.top;(l||a)&&t(),r=i,n=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(n)};function ud(e,t){const r=Ht(e),n=C.useRef(0);return C.useEffect(()=>()=>window.clearTimeout(n.current),[]),C.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function ea(e,t){const r=Ht(t);Jn(()=>{let n=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return s.observe(e),()=>{window.cancelAnimationFrame(n),s.unobserve(e)}}},[e,r])}var Fw=jw,VR=Rw,qR=Lw;const zl=C.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(Fw,{ref:n,className:X("relative overflow-hidden",e),...r,children:[o.jsx(VR,{className:"h-full w-full rounded-[inherit]",children:t}),o.jsx(Bw,{}),o.jsx(qR,{})]}));zl.displayName=Fw.displayName;const Bw=C.forwardRef(({className:e,orientation:t="vertical",...r},n)=>o.jsx(Dm,{ref:n,orientation:t,className:X("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2 border-l border-l-transparent p-px",t==="horizontal"&&"h-2 flex-col border-t border-t-transparent p-px",e),...r,children:o.jsx(Dw,{className:"relative flex-1 rounded-full bg-[var(--border-strong)]"})}));Bw.displayName=Dm.displayName;const KR="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--accent-gold)]",GR="font-serif font-normal leading-[1.05] text-foreground text-[64px]";function QR({headline:e}){const[t,r]=C.useState(!1),{events:n}=mw(),s=n.length>0?n[n.length-1]:null;return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background px-10 py-16 text-foreground",children:o.jsxs("div",{className:"flex w-full max-w-xl flex-col gap-6",children:[o.jsx("span",{className:KR,children:"Jinn · starting up"}),o.jsxs("h1",{className:GR,children:[e,"."]}),o.jsx("p",{className:"min-h-[1.5em] font-mono text-sm text-[var(--fg-muted)]",children:s?YR(s):"The daemon is booting. This usually takes a second."}),o.jsxs(ae,{type:"button",variant:"ghost",size:"sm",className:"self-start text-[var(--fg-dim)] hover:text-foreground",onClick:()=>r(i=>!i),"aria-expanded":t,children:[t?o.jsx(pw,{}):o.jsx(Em,{}),t?"Hide details":"Show details"]}),t&&o.jsx(we,{className:"bg-[var(--bg-elevated)]",children:o.jsx(Qe,{className:"p-0",children:o.jsx(zl,{className:"h-64",children:o.jsxs("div",{className:"px-3 py-2 font-mono text-xs",children:[n.length===0&&o.jsx("div",{className:"text-[var(--fg-dim)]",children:"no events yet"}),n.slice().reverse().map(i=>o.jsxs("div",{className:"grid grid-cols-[68px_84px_1fr] gap-3 py-0.5",children:[o.jsx("span",{className:"text-[var(--fg-dim)]",children:i.ts.slice(11,19)}),o.jsx("span",{className:X(i.kind==="error"?"text-[var(--break-red)]":i.kind==="system"?"text-[var(--accent-sky)]":"text-[var(--fg-dim)]"),children:i.kind}),o.jsx("span",{className:"text-foreground",children:i.message})]},i.id))]})})})})]})})}function YR(e){return e.kind==="error"?`Error: ${e.message}`:e.message}const ZR=ld("relative w-full border-l-2 px-4 py-2 font-mono text-[12px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-3 [&>svg+div]:translate-y-[-3px]",{variants:{variant:{default:"border-[var(--severity-info-fg)] bg-transparent text-foreground",info:"border-[var(--severity-info-fg)] bg-transparent text-foreground",warning:"border-[var(--severity-warning-fg)] bg-[var(--severity-warning-bg)] text-foreground",blocking:"border-[var(--severity-blocking-fg)] bg-[var(--severity-blocking-bg)] text-foreground",success:"border-[var(--vow-green)] bg-transparent text-foreground"}},defaultVariants:{variant:"default"}}),rt=C.forwardRef(({className:e,variant:t,...r},n)=>o.jsx("div",{ref:n,role:"alert",className:X(ZR({variant:t}),e),...r}));rt.displayName="Alert";const Dt=C.forwardRef(({className:e,...t},r)=>o.jsx("h5",{ref:r,className:X("mb-0.5 font-mono text-[11px] uppercase tracking-[0.14em]",e),...t}));Dt.displayName="AlertTitle";const it=C.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:X("text-[12px] [&_p]:leading-relaxed",e),...t}));it.displayName="AlertDescription";function XR(e,t=[]){let r=[];function n(i,l){const a=C.createContext(l);a.displayName=i+"Context";const c=r.length;r=[...r,l];const u=d=>{var p;const{scope:_,children:v,...x}=d,y=((p=_==null?void 0:_[e])==null?void 0:p[c])||a,f=C.useMemo(()=>x,Object.values(x));return o.jsx(y.Provider,{value:f,children:v})};u.displayName=i+"Provider";function g(d,_){var y;const v=((y=_==null?void 0:_[e])==null?void 0:y[c])||a,x=C.useContext(v);if(x)return x;if(l!==void 0)return l;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,g]}const s=()=>{const i=r.map(l=>C.createContext(l));return function(a){const c=(a==null?void 0:a[e])||i;return C.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return s.scopeName=e,[n,JR(s,...t)]}function JR(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const l=n.reduce((a,{useScope:c,scopeName:u})=>{const d=c(i)[`__scope${u}`];return{...a,...d}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return r.scopeName=t.scopeName,r}var eP=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$w=eP.reduce((e,t)=>{const r=Nm(`Primitive.${t}`),n=C.forwardRef((s,i)=>{const{asChild:l,...a}=s,c=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...a,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Om="Progress",Im=100,[tP]=XR(Om),[rP,nP]=tP(Om),Hw=C.forwardRef((e,t)=>{const{__scopeProgress:r,value:n=null,max:s,getValueLabel:i=sP,...l}=e;(s||s===0)&&!v_(s)&&console.error(iP(`${s}`,"Progress"));const a=v_(s)?s:Im;n!==null&&!__(n,a)&&console.error(oP(`${n}`,"Progress"));const c=__(n,a)?n:null,u=Cu(c)?i(c,a):void 0;return o.jsx(rP,{scope:r,value:c,max:a,children:o.jsx($w.div,{"aria-valuemax":a,"aria-valuemin":0,"aria-valuenow":Cu(c)?c:void 0,"aria-valuetext":u,role:"progressbar","data-state":Ww(c,a),"data-value":c??void 0,"data-max":a,...l,ref:t})})});Hw.displayName=Om;var zw="ProgressIndicator",Uw=C.forwardRef((e,t)=>{const{__scopeProgress:r,...n}=e,s=nP(zw,r);return o.jsx($w.div,{"data-state":Ww(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...n,ref:t})});Uw.displayName=zw;function sP(e,t){return`${Math.round(e/t*100)}%`}function Ww(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Cu(e){return typeof e=="number"}function v_(e){return Cu(e)&&!isNaN(e)&&e>0}function __(e,t){return Cu(e)&&!isNaN(e)&&e<=t&&e>=0}function iP(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Im}\`.`}function oP(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
184
+ - a positive number
185
+ - less than the value passed to \`max\` (or ${Im} if no \`max\` prop is set)
186
+ - \`null\` or \`undefined\` if the progress is indeterminate.
187
+
188
+ Defaulting to \`null\`.`}var Vw=Hw,aP=Uw;const Fm=C.forwardRef(({className:e,value:t,...r},n)=>o.jsx(Vw,{ref:n,className:X("relative h-1.5 w-full overflow-hidden rounded-full bg-[var(--bg-sunken)]",e),...r,children:o.jsx(aP,{className:"h-full w-full flex-1 bg-[var(--accent-sky)] transition-all",style:{transform:`translateX(-${100-(t??0)}%)`}})}));Fm.displayName=Vw.displayName;const lP={base:"Base","base-sepolia":"Base Sepolia"},cP="font-mono text-[11px] font-medium uppercase tracking-[0.14em]";function uP({address:e,minimumWei:t,chainExplorerBase:r,chain:n,onSharedDefaultRpc:s=!1}){var j;const[i,l]=C.useState(!1),[a,c]=C.useState(null),[u,g]=C.useState(0),d=C.useRef(!1),[_,v]=C.useState({state:"idle"});C.useEffect(()=>{if(a===null)return;g(Math.max(0,Math.floor((Date.now()-a)/1e3)));const S=window.setInterval(()=>{g(Math.max(0,Math.floor((Date.now()-a)/1e3)))},1e3);return()=>window.clearInterval(S)},[a]);const x=async()=>{await navigator.clipboard.writeText(e),l(!0),setTimeout(()=>l(!1),1500)},y=async()=>{var S;d.current=!0,c(Date.now()),g(0),v({state:"requesting"});try{const E=await ge.triggerDrip();c(null),E.ok?v({state:"sent",txHash:E.txHash??((S=E.txHashes)==null?void 0:S.at(-1)),txHashes:E.txHashes,attempts:E.attempts,balanceWei:E.balanceWei,targetWei:E.targetWei}):E.rateLimited||E.reason&&/rate|claimed|429/i.test(E.reason)?v({state:"rate_limited",reason:E.reason??"faucet rate-limited"}):v({state:"failed",reason:E.reason??"faucet funding failed"})}catch(E){c(null),v({state:"failed",reason:E instanceof Error?E.message:"drip failed"})}},f=C.useRef(t);C.useEffect(()=>{f.current!==t&&(f.current=t,v({state:"idle"}),d.current&&y())},[t]);const p=S=>{if(!S)return"unknown";try{const E=Number(BigInt(S))/1e18;return`${E.toFixed(E<.001?4:3)} ETH`}catch{return`${S} wei`}},h=p(t),m=C.useMemo(()=>_.state!=="requesting"?0:Math.min(92,Math.max(8,Math.round(u/60*92))),[_.state,u]),b=_.state==="sent"?((j=_.txHashes)==null?void 0:j.length)??_.attempts??(_.txHash?1:0):0,w=_.state==="sent"&&_.balanceWei!==void 0&&_.targetWei!==void 0&&(()=>{try{return BigInt(_.balanceWei)>=BigInt(_.targetWei)}catch{return!1}})(),k=_.state==="sent"&&!w;return o.jsxs(rt,{variant:"warning",className:"flex flex-col gap-4 border-l-2 px-6 py-5",children:[o.jsxs("div",{className:"flex items-baseline justify-between",children:[o.jsx(Dt,{className:X(cP,"text-[var(--accent-gold)]"),children:"Action needed · fund the master EOA"}),o.jsx("span",{className:"font-mono text-[10px] text-[var(--fg-dim)]",children:"auto-detected on chain"})]}),o.jsxs(it,{className:"flex flex-col gap-1",children:[o.jsx("span",{className:"break-all font-mono text-xs text-foreground",children:e}),o.jsxs("span",{className:"font-mono text-xs text-[var(--fg-muted)]",children:["send at least ",h," on ",lP[n??""]??"this chain"]})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(ae,{type:"button",onClick:y,disabled:_.state==="requesting"||w,className:"bg-[var(--accent-gold)] text-[var(--bg)] hover:bg-[var(--accent-gold-hover)]",children:_.state==="requesting"?"Funding...":w?"Faucet funded":k?"Fund more":"Fund from faucet"}),o.jsx(ae,{type:"button",variant:"secondary",onClick:x,children:i?"Copied":"Copy address"}),o.jsx(ae,{asChild:!0,variant:"ghost",children:o.jsxs("a",{href:`${r}/address/${e}`,target:"_blank",rel:"noopener noreferrer",children:[o.jsx(jo,{}),"View on explorer"]})})]}),_.state==="sent"&&o.jsxs("p",{className:X("font-mono text-[11px]",w?"text-[var(--vow-green)]":"text-[var(--accent-gold)]"),children:[w?"Faucet funding complete":"Faucet funding partial",b>0?` (${b} drip${b===1?"":"s"})`:"",".",_.balanceWei&&_.targetWei?` Balance ${p(_.balanceWei)} / target ${p(_.targetWei)}.`:"",k?' Click "Fund more" to top up.':"",_.txHash&&o.jsxs(o.Fragment,{children:[" ",o.jsx("a",{href:`${r}/tx/${_.txHash}`,target:"_blank",rel:"noopener noreferrer",className:"text-[var(--accent-sky)] hover:underline",children:"view latest tx"})]})]}),_.state==="requesting"&&o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx(Fm,{value:m,className:"h-1.5 rounded-full [&>div]:bg-[var(--accent-gold)]"}),o.jsxs("p",{className:"font-mono text-[11px] text-[var(--fg-muted)]",children:["Requesting faucet drips for ",dP(e),". Elapsed ",u,"s; this can take about a minute on a fresh wallet."]})]}),_.state==="rate_limited"&&o.jsx("p",{className:"font-mono text-[11px] text-[var(--wane)]",children:"Faucet rate-limited. Send manually or wait before trying again."}),_.state==="failed"&&o.jsx("p",{className:"font-mono text-[11px] text-[var(--break-red)]",children:_.reason}),s&&o.jsx("p",{"data-testid":"onboarding-shared-rpc-nudge",className:"font-mono text-[11px] text-[var(--fg-dim)]",children:"Using a shared trial RPC — add your own key in the Network section for reliable operation."})]})}const dP=e=>`${e.slice(0,6)}…${e.slice(-4)}`;var qw={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(self,()=>(()=>{var r={4567:function(l,a,c){var u=this&&this.__decorate||function(m,b,w,k){var j,S=arguments.length,E=S<3?b:k===null?k=Object.getOwnPropertyDescriptor(b,w):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(m,b,w,k);else for(var R=m.length-1;R>=0;R--)(j=m[R])&&(E=(S<3?j(E):S>3?j(b,w,E):j(b,w))||E);return S>3&&E&&Object.defineProperty(b,w,E),E},g=this&&this.__param||function(m,b){return function(w,k){b(w,k,m)}};Object.defineProperty(a,"__esModule",{value:!0}),a.AccessibilityManager=void 0;const d=c(9042),_=c(6114),v=c(9924),x=c(844),y=c(5596),f=c(4725),p=c(3656);let h=a.AccessibilityManager=class extends x.Disposable{constructor(m,b){super(),this._terminal=m,this._renderService=b,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=document.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=document.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let w=0;w<this._terminal.rows;w++)this._rowElements[w]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[w]);if(this._topBoundaryFocusListener=w=>this._handleBoundaryFocus(w,0),this._bottomBoundaryFocusListener=w=>this._handleBoundaryFocus(w,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=document.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new v.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize(w=>this._handleResize(w.rows))),this.register(this._terminal.onRender(w=>this._refreshRows(w.start,w.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(w=>this._handleChar(w))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
189
+ `))),this.register(this._terminal.onA11yTab(w=>this._handleTab(w))),this.register(this._terminal.onKey(w=>this._handleKey(w.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._screenDprMonitor=new y.ScreenDprMonitor(window),this.register(this._screenDprMonitor),this._screenDprMonitor.setListener(()=>this._refreshRowsDimensions()),this.register((0,p.addDisposableDomListener)(window,"resize",()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,x.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(m){for(let b=0;b<m;b++)this._handleChar(" ")}_handleChar(m){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==m&&(this._charsToAnnounce+=m):this._charsToAnnounce+=m,m===`
190
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=d.tooMuchOutput)),_.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout(()=>{this._accessibilityContainer.appendChild(this._liveRegion)},0))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0,_.isMac&&this._liveRegion.remove()}_handleKey(m){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(m)||this._charsToConsume.push(m)}_refreshRows(m,b){this._liveRegionDebouncer.refresh(m,b,this._terminal.rows)}_renderRows(m,b){const w=this._terminal.buffer,k=w.lines.length.toString();for(let j=m;j<=b;j++){const S=w.translateBufferLineToString(w.ydisp+j,!0),E=(w.ydisp+j+1).toString(),R=this._rowElements[j];R&&(S.length===0?R.innerText=" ":R.textContent=S,R.setAttribute("aria-posinset",E),R.setAttribute("aria-setsize",k))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(m,b){const w=m.target,k=this._rowElements[b===0?1:this._rowElements.length-2];if(w.getAttribute("aria-posinset")===(b===0?"1":`${this._terminal.buffer.lines.length}`)||m.relatedTarget!==k)return;let j,S;if(b===0?(j=w,S=this._rowElements.pop(),this._rowContainer.removeChild(S)):(j=this._rowElements.shift(),S=w,this._rowContainer.removeChild(j)),j.removeEventListener("focus",this._topBoundaryFocusListener),S.removeEventListener("focus",this._bottomBoundaryFocusListener),b===0){const E=this._createAccessibilityTreeNode();this._rowElements.unshift(E),this._rowContainer.insertAdjacentElement("afterbegin",E)}else{const E=this._createAccessibilityTreeNode();this._rowElements.push(E),this._rowContainer.appendChild(E)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(b===0?-1:1),this._rowElements[b===0?1:this._rowElements.length-2].focus(),m.preventDefault(),m.stopImmediatePropagation()}_handleResize(m){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let b=this._rowContainer.children.length;b<this._terminal.rows;b++)this._rowElements[b]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[b]);for(;this._rowElements.length>m;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const m=document.createElement("div");return m.setAttribute("role","listitem"),m.tabIndex=-1,this._refreshRowDimensions(m),m}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let m=0;m<this._terminal.rows;m++)this._refreshRowDimensions(this._rowElements[m])}}_refreshRowDimensions(m){m.style.height=`${this._renderService.dimensions.css.cell.height}px`}};a.AccessibilityManager=h=u([g(1,f.IRenderService)],h)},3614:(l,a)=>{function c(_){return _.replace(/\r?\n/g,"\r")}function u(_,v){return v?"\x1B[200~"+_+"\x1B[201~":_}function g(_,v,x,y){_=u(_=c(_),x.decPrivateModes.bracketedPasteMode&&y.rawOptions.ignoreBracketedPasteMode!==!0),x.triggerDataEvent(_,!0),v.value=""}function d(_,v,x){const y=x.getBoundingClientRect(),f=_.clientX-y.left-10,p=_.clientY-y.top-10;v.style.width="20px",v.style.height="20px",v.style.left=`${f}px`,v.style.top=`${p}px`,v.style.zIndex="1000",v.focus()}Object.defineProperty(a,"__esModule",{value:!0}),a.rightClickHandler=a.moveTextAreaUnderMouseCursor=a.paste=a.handlePasteEvent=a.copyHandler=a.bracketTextForPaste=a.prepareTextForTerminal=void 0,a.prepareTextForTerminal=c,a.bracketTextForPaste=u,a.copyHandler=function(_,v){_.clipboardData&&_.clipboardData.setData("text/plain",v.selectionText),_.preventDefault()},a.handlePasteEvent=function(_,v,x,y){_.stopPropagation(),_.clipboardData&&g(_.clipboardData.getData("text/plain"),v,x,y)},a.paste=g,a.moveTextAreaUnderMouseCursor=d,a.rightClickHandler=function(_,v,x,y,f){d(_,v,x),f&&y.rightClickSelect(_),v.value=y.selectionText,v.select()}},7239:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorContrastCache=void 0;const u=c(1505);a.ColorContrastCache=class{constructor(){this._color=new u.TwoKeyMap,this._css=new u.TwoKeyMap}setCss(g,d,_){this._css.set(g,d,_)}getCss(g,d){return this._css.get(g,d)}setColor(g,d,_){this._color.set(g,d,_)}getColor(g,d){return this._color.get(g,d)}clear(){this._color.clear(),this._css.clear()}}},3656:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.addDisposableDomListener=void 0,a.addDisposableDomListener=function(c,u,g,d){c.addEventListener(u,g,d);let _=!1;return{dispose:()=>{_||(_=!0,c.removeEventListener(u,g,d))}}}},6465:function(l,a,c){var u=this&&this.__decorate||function(f,p,h,m){var b,w=arguments.length,k=w<3?p:m===null?m=Object.getOwnPropertyDescriptor(p,h):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(f,p,h,m);else for(var j=f.length-1;j>=0;j--)(b=f[j])&&(k=(w<3?b(k):w>3?b(p,h,k):b(p,h))||k);return w>3&&k&&Object.defineProperty(p,h,k),k},g=this&&this.__param||function(f,p){return function(h,m){p(h,m,f)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Linkifier2=void 0;const d=c(3656),_=c(8460),v=c(844),x=c(2585);let y=a.Linkifier2=class extends v.Disposable{get currentLink(){return this._currentLink}constructor(f){super(),this._bufferService=f,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new _.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new _.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,v.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,v.toDisposable)(()=>{this._lastMouseEvent=void 0})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0}))}registerLinkProvider(f){return this._linkProviders.push(f),{dispose:()=>{const p=this._linkProviders.indexOf(f);p!==-1&&this._linkProviders.splice(p,1)}}}attachToDom(f,p,h){this._element=f,this._mouseService=p,this._renderService=h,this.register((0,d.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,d.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(f){if(this._lastMouseEvent=f,!this._element||!this._mouseService)return;const p=this._positionFromMouseEvent(f,this._element,this._mouseService);if(!p)return;this._isMouseOut=!1;const h=f.composedPath();for(let m=0;m<h.length;m++){const b=h[m];if(b.classList.contains("xterm"))break;if(b.classList.contains("xterm-hover"))return}this._lastBufferCell&&p.x===this._lastBufferCell.x&&p.y===this._lastBufferCell.y||(this._handleHover(p),this._lastBufferCell=p)}_handleHover(f){if(this._activeLine!==f.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(f,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,f)||(this._clearCurrentLink(),this._askForLink(f,!0))}_askForLink(f,p){var h,m;this._activeProviderReplies&&p||((h=this._activeProviderReplies)===null||h===void 0||h.forEach(w=>{w==null||w.forEach(k=>{k.link.dispose&&k.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=f.y);let b=!1;for(const[w,k]of this._linkProviders.entries())p?!((m=this._activeProviderReplies)===null||m===void 0)&&m.get(w)&&(b=this._checkLinkProviderResult(w,f,b)):k.provideLinks(f.y,j=>{var S,E;if(this._isMouseOut)return;const R=j==null?void 0:j.map(M=>({link:M}));(S=this._activeProviderReplies)===null||S===void 0||S.set(w,R),b=this._checkLinkProviderResult(w,f,b),((E=this._activeProviderReplies)===null||E===void 0?void 0:E.size)===this._linkProviders.length&&this._removeIntersectingLinks(f.y,this._activeProviderReplies)})}_removeIntersectingLinks(f,p){const h=new Set;for(let m=0;m<p.size;m++){const b=p.get(m);if(b)for(let w=0;w<b.length;w++){const k=b[w],j=k.link.range.start.y<f?0:k.link.range.start.x,S=k.link.range.end.y>f?this._bufferService.cols:k.link.range.end.x;for(let E=j;E<=S;E++){if(h.has(E)){b.splice(w--,1);break}h.add(E)}}}}_checkLinkProviderResult(f,p,h){var m;if(!this._activeProviderReplies)return h;const b=this._activeProviderReplies.get(f);let w=!1;for(let k=0;k<f;k++)this._activeProviderReplies.has(k)&&!this._activeProviderReplies.get(k)||(w=!0);if(!w&&b){const k=b.find(j=>this._linkAtPosition(j.link,p));k&&(h=!0,this._handleNewLink(k))}if(this._activeProviderReplies.size===this._linkProviders.length&&!h)for(let k=0;k<this._activeProviderReplies.size;k++){const j=(m=this._activeProviderReplies.get(k))===null||m===void 0?void 0:m.find(S=>this._linkAtPosition(S.link,p));if(j){h=!0,this._handleNewLink(j);break}}return h}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(f){if(!this._element||!this._mouseService||!this._currentLink)return;const p=this._positionFromMouseEvent(f,this._element,this._mouseService);p&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,p)&&this._currentLink.link.activate(f,this._currentLink.link.text)}_clearCurrentLink(f,p){this._element&&this._currentLink&&this._lastMouseEvent&&(!f||!p||this._currentLink.link.range.start.y>=f&&this._currentLink.link.range.end.y<=p)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,v.disposeArray)(this._linkCacheDisposables))}_handleNewLink(f){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;const p=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);p&&this._linkAtPosition(f.link,p)&&(this._currentLink=f,this._currentLink.state={decorations:{underline:f.link.decorations===void 0||f.link.decorations.underline,pointerCursor:f.link.decorations===void 0||f.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,f.link,this._lastMouseEvent),f.link.decorations={},Object.defineProperties(f.link.decorations,{pointerCursor:{get:()=>{var h,m;return(m=(h=this._currentLink)===null||h===void 0?void 0:h.state)===null||m===void 0?void 0:m.decorations.pointerCursor},set:h=>{var m,b;!((m=this._currentLink)===null||m===void 0)&&m.state&&this._currentLink.state.decorations.pointerCursor!==h&&(this._currentLink.state.decorations.pointerCursor=h,this._currentLink.state.isHovered&&((b=this._element)===null||b===void 0||b.classList.toggle("xterm-cursor-pointer",h)))}},underline:{get:()=>{var h,m;return(m=(h=this._currentLink)===null||h===void 0?void 0:h.state)===null||m===void 0?void 0:m.decorations.underline},set:h=>{var m,b,w;!((m=this._currentLink)===null||m===void 0)&&m.state&&((w=(b=this._currentLink)===null||b===void 0?void 0:b.state)===null||w===void 0?void 0:w.decorations.underline)!==h&&(this._currentLink.state.decorations.underline=h,this._currentLink.state.isHovered&&this._fireUnderlineEvent(f.link,h))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(h=>{if(!this._currentLink)return;const m=h.start===0?0:h.start+1+this._bufferService.buffer.ydisp,b=this._bufferService.buffer.ydisp+1+h.end;if(this._currentLink.link.range.start.y>=m&&this._currentLink.link.range.end.y<=b&&(this._clearCurrentLink(m,b),this._lastMouseEvent&&this._element)){const w=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);w&&this._askForLink(w,!1)}})))}_linkHover(f,p,h){var m;!((m=this._currentLink)===null||m===void 0)&&m.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(p,!0),this._currentLink.state.decorations.pointerCursor&&f.classList.add("xterm-cursor-pointer")),p.hover&&p.hover(h,p.text)}_fireUnderlineEvent(f,p){const h=f.range,m=this._bufferService.buffer.ydisp,b=this._createLinkUnderlineEvent(h.start.x-1,h.start.y-m-1,h.end.x,h.end.y-m-1,void 0);(p?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(b)}_linkLeave(f,p,h){var m;!((m=this._currentLink)===null||m===void 0)&&m.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(p,!1),this._currentLink.state.decorations.pointerCursor&&f.classList.remove("xterm-cursor-pointer")),p.leave&&p.leave(h,p.text)}_linkAtPosition(f,p){const h=f.range.start.y*this._bufferService.cols+f.range.start.x,m=f.range.end.y*this._bufferService.cols+f.range.end.x,b=p.y*this._bufferService.cols+p.x;return h<=b&&b<=m}_positionFromMouseEvent(f,p,h){const m=h.getCoords(f,p,this._bufferService.cols,this._bufferService.rows);if(m)return{x:m[0],y:m[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(f,p,h,m,b){return{x1:f,y1:p,x2:h,y2:m,cols:this._bufferService.cols,fg:b}}};a.Linkifier2=y=u([g(0,x.IBufferService)],y)},9042:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.tooMuchOutput=a.promptLabel=void 0,a.promptLabel="Terminal input",a.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(l,a,c){var u=this&&this.__decorate||function(y,f,p,h){var m,b=arguments.length,w=b<3?f:h===null?h=Object.getOwnPropertyDescriptor(f,p):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(y,f,p,h);else for(var k=y.length-1;k>=0;k--)(m=y[k])&&(w=(b<3?m(w):b>3?m(f,p,w):m(f,p))||w);return b>3&&w&&Object.defineProperty(f,p,w),w},g=this&&this.__param||function(y,f){return function(p,h){f(p,h,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkProvider=void 0;const d=c(511),_=c(2585);let v=a.OscLinkProvider=class{constructor(y,f,p){this._bufferService=y,this._optionsService=f,this._oscLinkService=p}provideLinks(y,f){var p;const h=this._bufferService.buffer.lines.get(y-1);if(!h)return void f(void 0);const m=[],b=this._optionsService.rawOptions.linkHandler,w=new d.CellData,k=h.getTrimmedLength();let j=-1,S=-1,E=!1;for(let R=0;R<k;R++)if(S!==-1||h.hasContent(R)){if(h.loadCell(R,w),w.hasExtendedAttrs()&&w.extended.urlId){if(S===-1){S=R,j=w.extended.urlId;continue}E=w.extended.urlId!==j}else S!==-1&&(E=!0);if(E||S!==-1&&R===k-1){const M=(p=this._oscLinkService.getLinkData(j))===null||p===void 0?void 0:p.uri;if(M){const A={start:{x:S+1,y},end:{x:R+(E||R!==k-1?0:1),y}};let L=!1;if(!(b!=null&&b.allowNonHttpProtocols))try{const B=new URL(M);["http:","https:"].includes(B.protocol)||(L=!0)}catch{L=!0}L||m.push({text:M,range:A,activate:(B,U)=>b?b.activate(B,U,A):x(0,U),hover:(B,U)=>{var W;return(W=b==null?void 0:b.hover)===null||W===void 0?void 0:W.call(b,B,U,A)},leave:(B,U)=>{var W;return(W=b==null?void 0:b.leave)===null||W===void 0?void 0:W.call(b,B,U,A)}})}E=!1,w.hasExtendedAttrs()&&w.extended.urlId?(S=R,j=w.extended.urlId):(S=-1,j=-1)}}f(m)}};function x(y,f){if(confirm(`Do you want to navigate to ${f}?
191
+
192
+ WARNING: This link could potentially be dangerous`)){const p=window.open();if(p){try{p.opener=null}catch{}p.location.href=f}else console.warn("Opening link blocked as opener could not be cleared")}}a.OscLinkProvider=v=u([g(0,_.IBufferService),g(1,_.IOptionsService),g(2,_.IOscLinkService)],v)},6193:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.RenderDebouncer=void 0,a.RenderDebouncer=class{constructor(c,u){this._parentWindow=c,this._renderCallback=u,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._parentWindow.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(c){return this._refreshCallbacks.push(c),this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(c,u,g){this._rowCount=g,c=c!==void 0?c:0,u=u!==void 0?u:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,u):u,this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const c=Math.max(this._rowStart,0),u=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,u),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},5596:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ScreenDprMonitor=void 0;const u=c(844);class g extends u.Disposable{constructor(_){super(),this._parentWindow=_,this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this.register((0,u.toDisposable)(()=>{this.clearListener()}))}setListener(_){this._listener&&this.clearListener(),this._listener=_,this._outerListener=()=>{this._listener&&(this._listener(this._parentWindow.devicePixelRatio,this._currentDevicePixelRatio),this._updateDpr())},this._updateDpr()}_updateDpr(){var _;this._outerListener&&((_=this._resolutionMediaMatchList)===null||_===void 0||_.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)}}a.ScreenDprMonitor=g},3236:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;const u=c(3614),g=c(3656),d=c(6465),_=c(9042),v=c(3730),x=c(1680),y=c(3107),f=c(5744),p=c(2950),h=c(1296),m=c(428),b=c(4269),w=c(5114),k=c(8934),j=c(3230),S=c(9312),E=c(4725),R=c(6731),M=c(8055),A=c(8969),L=c(8460),B=c(844),U=c(6114),W=c(8437),q=c(2584),N=c(7399),T=c(5941),D=c(9074),O=c(2585),$=c(5435),Y=c(4567),J=typeof window<"u"?window.document:null;class re extends A.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(P={}){super(P),this.browser=U,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new B.MutableDisposable),this._onCursorMove=this.register(new L.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new L.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new L.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new L.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new L.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new L.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new L.EventEmitter),this._onBlur=this.register(new L.EventEmitter),this._onA11yCharEmitter=this.register(new L.EventEmitter),this._onA11yTabEmitter=this.register(new L.EventEmitter),this._onWillOpen=this.register(new L.EventEmitter),this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(d.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(v.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(D.DecorationService),this._instantiationService.setService(O.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((z,G)=>this.refresh(z,G))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(z=>this._reportWindowsOptions(z))),this.register(this._inputHandler.onColor(z=>this._handleColorEvent(z))),this.register((0,L.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,L.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,L.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,L.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(z=>this._afterResize(z.cols,z.rows))),this.register((0,B.toDisposable)(()=>{var z,G;this._customKeyEventHandler=void 0,(G=(z=this.element)===null||z===void 0?void 0:z.parentNode)===null||G===void 0||G.removeChild(this.element)}))}_handleColorEvent(P){if(this._themeService)for(const z of P){let G,K="";switch(z.index){case 256:G="foreground",K="10";break;case 257:G="background",K="11";break;case 258:G="cursor",K="12";break;default:G="ansi",K="4;"+z.index}switch(z.type){case 0:const Q=M.color.toColorRGB(G==="ansi"?this._themeService.colors.ansi[z.index]:this._themeService.colors[G]);this.coreService.triggerDataEvent(`${q.C0.ESC}]${K};${(0,T.toRgbString)(Q)}${q.C1_ESCAPED.ST}`);break;case 1:if(G==="ansi")this._themeService.modifyColors(ee=>ee.ansi[z.index]=M.rgba.toColor(...z.color));else{const ee=G;this._themeService.modifyColors(de=>de[ee]=M.rgba.toColor(...z.color))}break;case 2:this._themeService.restoreColor(z.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(P){P?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Y.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(P){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(q.C0.ESC+"[I"),this.updateCursorStyle(P),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var P;return(P=this.textarea)===null||P===void 0?void 0:P.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(q.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const P=this.buffer.ybase+this.buffer.y,z=this.buffer.lines.get(P);if(!z)return;const G=Math.min(this.buffer.x,this.cols-1),K=this._renderService.dimensions.css.cell.height,Q=z.getWidth(G),ee=this._renderService.dimensions.css.cell.width*Q,de=this.buffer.y*this._renderService.dimensions.css.cell.height,De=G*this._renderService.dimensions.css.cell.width;this.textarea.style.left=De+"px",this.textarea.style.top=de+"px",this.textarea.style.width=ee+"px",this.textarea.style.height=K+"px",this.textarea.style.lineHeight=K+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,g.addDisposableDomListener)(this.element,"copy",z=>{this.hasSelection()&&(0,u.copyHandler)(z,this._selectionService)}));const P=z=>(0,u.handlePasteEvent)(z,this.textarea,this.coreService,this.optionsService);this.register((0,g.addDisposableDomListener)(this.textarea,"paste",P)),this.register((0,g.addDisposableDomListener)(this.element,"paste",P)),U.isFirefox?this.register((0,g.addDisposableDomListener)(this.element,"mousedown",z=>{z.button===2&&(0,u.rightClickHandler)(z,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,g.addDisposableDomListener)(this.element,"contextmenu",z=>{(0,u.rightClickHandler)(z,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),U.isLinux&&this.register((0,g.addDisposableDomListener)(this.element,"auxclick",z=>{z.button===1&&(0,u.moveTextAreaUnderMouseCursor)(z,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,g.addDisposableDomListener)(this.textarea,"keyup",P=>this._keyUp(P),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keydown",P=>this._keyDown(P),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keypress",P=>this._keyPress(P),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionupdate",P=>this._compositionHelper.compositionupdate(P))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,g.addDisposableDomListener)(this.textarea,"input",P=>this._inputEvent(P),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(P){var z;if(!P)throw new Error("Terminal requires a parent element.");P.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=P.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),P.appendChild(this.element);const G=J.createDocumentFragment();this._viewportElement=J.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),G.appendChild(this._viewportElement),this._viewportScrollArea=J.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=J.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=J.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),G.appendChild(this.screenElement),this.textarea=J.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",_.promptLabel),U.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this._instantiationService.createInstance(w.CoreBrowserService,this.textarea,(z=this._document.defaultView)!==null&&z!==void 0?z:window),this._instantiationService.setService(E.ICoreBrowserService,this._coreBrowserService),this.register((0,g.addDisposableDomListener)(this.textarea,"focus",K=>this._handleTextAreaFocus(K))),this.register((0,g.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(m.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(E.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(R.ThemeService),this._instantiationService.setService(E.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(b.CharacterJoinerService),this._instantiationService.setService(E.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(j.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(E.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(K=>this._onRender.fire(K))),this.onResize(K=>this._renderService.resize(K.cols,K.rows)),this._compositionView=J.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(p.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(G);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._mouseService=this._instantiationService.createInstance(k.MouseService),this._instantiationService.setService(E.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(x.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(K=>this.scrollLines(K.amount,K.suppressScrollEvent,1)),this.register(this._inputHandler.onRequestSyncScrollBar(()=>this.viewport.syncScrollArea())),this.register(this.viewport),this.register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this.register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this.register(this.onBlur(()=>this._renderService.handleBlur())),this.register(this.onFocus(()=>this._renderService.handleFocus())),this.register(this._renderService.onDimensionsChange(()=>this.viewport.syncScrollArea())),this._selectionService=this.register(this._instantiationService.createInstance(S.SelectionService,this.element,this.screenElement,this.linkifier2)),this._instantiationService.setService(E.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(K=>this.scrollLines(K.amount,K.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(K=>this._renderService.handleSelectionChanged(K.start,K.end,K.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(K=>{this.textarea.value=K,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(K=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,g.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.linkifier2.attachToDom(this.screenElement,this._mouseService,this._renderService),this.register(this._instantiationService.createInstance(y.BufferDecorationRenderer,this.screenElement)),this.register((0,g.addDisposableDomListener)(this.element,"mousedown",K=>this._selectionService.handleMouseDown(K))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(Y.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",K=>this._handleScreenReaderModeOptionChange(K))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(f.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",K=>{!this._overviewRulerRenderer&&K&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(f.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(h.DomRenderer,this.element,this.screenElement,this._viewportElement,this.linkifier2)}bindMouse(){const P=this,z=this.element;function G(ee){const de=P._mouseService.getMouseReportCoords(ee,P.screenElement);if(!de)return!1;let De,He;switch(ee.overrideType||ee.type){case"mousemove":He=32,ee.buttons===void 0?(De=3,ee.button!==void 0&&(De=ee.button<3?ee.button:3)):De=1&ee.buttons?0:4&ee.buttons?1:2&ee.buttons?2:3;break;case"mouseup":He=0,De=ee.button<3?ee.button:3;break;case"mousedown":He=1,De=ee.button<3?ee.button:3;break;case"wheel":if(P.viewport.getLinesScrolled(ee)===0)return!1;He=ee.deltaY<0?0:1,De=4;break;default:return!1}return!(He===void 0||De===void 0||De>4)&&P.coreMouseService.triggerMouseEvent({col:de.col,row:de.row,x:de.x,y:de.y,button:De,action:He,ctrl:ee.ctrlKey,alt:ee.altKey,shift:ee.shiftKey})}const K={mouseup:null,wheel:null,mousedrag:null,mousemove:null},Q={mouseup:ee=>(G(ee),ee.buttons||(this._document.removeEventListener("mouseup",K.mouseup),K.mousedrag&&this._document.removeEventListener("mousemove",K.mousedrag)),this.cancel(ee)),wheel:ee=>(G(ee),this.cancel(ee,!0)),mousedrag:ee=>{ee.buttons&&G(ee)},mousemove:ee=>{ee.buttons||G(ee)}};this.register(this.coreMouseService.onProtocolChange(ee=>{ee?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(ee)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&ee?K.mousemove||(z.addEventListener("mousemove",Q.mousemove),K.mousemove=Q.mousemove):(z.removeEventListener("mousemove",K.mousemove),K.mousemove=null),16&ee?K.wheel||(z.addEventListener("wheel",Q.wheel,{passive:!1}),K.wheel=Q.wheel):(z.removeEventListener("wheel",K.wheel),K.wheel=null),2&ee?K.mouseup||(z.addEventListener("mouseup",Q.mouseup),K.mouseup=Q.mouseup):(this._document.removeEventListener("mouseup",K.mouseup),z.removeEventListener("mouseup",K.mouseup),K.mouseup=null),4&ee?K.mousedrag||(K.mousedrag=Q.mousedrag):(this._document.removeEventListener("mousemove",K.mousedrag),K.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,g.addDisposableDomListener)(z,"mousedown",ee=>{if(ee.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(ee))return G(ee),K.mouseup&&this._document.addEventListener("mouseup",K.mouseup),K.mousedrag&&this._document.addEventListener("mousemove",K.mousedrag),this.cancel(ee)})),this.register((0,g.addDisposableDomListener)(z,"wheel",ee=>{if(!K.wheel){if(!this.buffer.hasScrollback){const de=this.viewport.getLinesScrolled(ee);if(de===0)return;const De=q.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(ee.deltaY<0?"A":"B");let He="";for(let Lt=0;Lt<Math.abs(de);Lt++)He+=De;return this.coreService.triggerDataEvent(He,!0),this.cancel(ee,!0)}return this.viewport.handleWheel(ee)?this.cancel(ee):void 0}},{passive:!1})),this.register((0,g.addDisposableDomListener)(z,"touchstart",ee=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(ee),this.cancel(ee)},{passive:!0})),this.register((0,g.addDisposableDomListener)(z,"touchmove",ee=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(ee)?void 0:this.cancel(ee)},{passive:!1}))}refresh(P,z){var G;(G=this._renderService)===null||G===void 0||G.refreshRows(P,z)}updateCursorStyle(P){var z;!((z=this._selectionService)===null||z===void 0)&&z.shouldColumnSelect(P)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(P,z,G=0){var K;G===1?(super.scrollLines(P,z,G),this.refresh(0,this.rows-1)):(K=this.viewport)===null||K===void 0||K.scrollLines(P)}paste(P){(0,u.paste)(P,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(P){this._customKeyEventHandler=P}registerLinkProvider(P){return this.linkifier2.registerLinkProvider(P)}registerCharacterJoiner(P){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const z=this._characterJoinerService.register(P);return this.refresh(0,this.rows-1),z}deregisterCharacterJoiner(P){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(P)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(P){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+P)}registerDecoration(P){return this._decorationService.registerDecoration(P)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(P,z,G){this._selectionService.setSelection(P,z,G)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var P;(P=this._selectionService)===null||P===void 0||P.clearSelection()}selectAll(){var P;(P=this._selectionService)===null||P===void 0||P.selectAll()}selectLines(P,z){var G;(G=this._selectionService)===null||G===void 0||G.selectLines(P,z)}_keyDown(P){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(P)===!1)return!1;const z=this.browser.isMac&&this.options.macOptionIsMeta&&P.altKey;if(!z&&!this._compositionHelper.keydown(P))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;z||P.key!=="Dead"&&P.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const G=(0,N.evaluateKeyboardEvent)(P,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(P),G.type===3||G.type===2){const K=this.rows-1;return this.scrollLines(G.type===2?-K:K),this.cancel(P,!0)}return G.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,P)||(G.cancel&&this.cancel(P,!0),!G.key||!!(P.key&&!P.ctrlKey&&!P.altKey&&!P.metaKey&&P.key.length===1&&P.key.charCodeAt(0)>=65&&P.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(G.key!==q.C0.ETX&&G.key!==q.C0.CR||(this.textarea.value=""),this._onKey.fire({key:G.key,domEvent:P}),this._showCursor(),this.coreService.triggerDataEvent(G.key,!0),!this.optionsService.rawOptions.screenReaderMode||P.altKey||P.ctrlKey?this.cancel(P,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(P,z){const G=P.isMac&&!this.options.macOptionIsMeta&&z.altKey&&!z.ctrlKey&&!z.metaKey||P.isWindows&&z.altKey&&z.ctrlKey&&!z.metaKey||P.isWindows&&z.getModifierState("AltGraph");return z.type==="keypress"?G:G&&(!z.keyCode||z.keyCode>47)}_keyUp(P){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(P)===!1||(function(z){return z.keyCode===16||z.keyCode===17||z.keyCode===18}(P)||this.focus(),this.updateCursorStyle(P),this._keyPressHandled=!1)}_keyPress(P){let z;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(P)===!1)return!1;if(this.cancel(P),P.charCode)z=P.charCode;else if(P.which===null||P.which===void 0)z=P.keyCode;else{if(P.which===0||P.charCode===0)return!1;z=P.which}return!(!z||(P.altKey||P.ctrlKey||P.metaKey)&&!this._isThirdLevelShift(this.browser,P)||(z=String.fromCharCode(z),this._onKey.fire({key:z,domEvent:P}),this._showCursor(),this.coreService.triggerDataEvent(z,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(P){if(P.data&&P.inputType==="insertText"&&(!P.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const z=P.data;return this.coreService.triggerDataEvent(z,!0),this.cancel(P),!0}return!1}resize(P,z){P!==this.cols||z!==this.rows?super.resize(P,z):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(P,z){var G,K;(G=this._charSizeService)===null||G===void 0||G.measure(),(K=this.viewport)===null||K===void 0||K.syncScrollArea(!0)}clear(){var P;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let z=1;z<this.rows;z++)this.buffer.lines.push(this.buffer.getBlankLine(W.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(P=this.viewport)===null||P===void 0||P.reset(),this.refresh(0,this.rows-1)}}reset(){var P,z;this.options.rows=this.rows,this.options.cols=this.cols;const G=this._customKeyEventHandler;this._setup(),super.reset(),(P=this._selectionService)===null||P===void 0||P.reset(),this._decorationService.reset(),(z=this.viewport)===null||z===void 0||z.reset(),this._customKeyEventHandler=G,this.refresh(0,this.rows-1)}clearTextureAtlas(){var P;(P=this._renderService)===null||P===void 0||P.clearTextureAtlas()}_reportFocus(){var P;!((P=this.element)===null||P===void 0)&&P.classList.contains("focus")?this.coreService.triggerDataEvent(q.C0.ESC+"[I"):this.coreService.triggerDataEvent(q.C0.ESC+"[O")}_reportWindowsOptions(P){if(this._renderService)switch(P){case $.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const z=this._renderService.dimensions.css.canvas.width.toFixed(0),G=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${q.C0.ESC}[4;${G};${z}t`);break;case $.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const K=this._renderService.dimensions.css.cell.width.toFixed(0),Q=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${q.C0.ESC}[6;${Q};${K}t`)}}cancel(P,z){if(this.options.cancelEvents||z)return P.preventDefault(),P.stopPropagation(),!1}}a.Terminal=re},9924:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TimeBasedDebouncer=void 0,a.TimeBasedDebouncer=class{constructor(c,u=1e3){this._renderCallback=c,this._debounceThresholdMS=u,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,u,g){this._rowCount=g,c=c!==void 0?c:0,u=u!==void 0?u:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,u):u;const d=Date.now();if(d-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=d,this._innerRefresh();else if(!this._additionalRefreshRequested){const _=d-this._lastRefreshMs,v=this._debounceThresholdMS-_;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},v)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),u=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,u)}}},1680:function(l,a,c){var u=this&&this.__decorate||function(p,h,m,b){var w,k=arguments.length,j=k<3?h:b===null?b=Object.getOwnPropertyDescriptor(h,m):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(p,h,m,b);else for(var S=p.length-1;S>=0;S--)(w=p[S])&&(j=(k<3?w(j):k>3?w(h,m,j):w(h,m))||j);return k>3&&j&&Object.defineProperty(h,m,j),j},g=this&&this.__param||function(p,h){return function(m,b){h(m,b,p)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Viewport=void 0;const d=c(3656),_=c(4725),v=c(8460),x=c(844),y=c(2585);let f=a.Viewport=class extends x.Disposable{constructor(p,h,m,b,w,k,j,S){super(),this._viewportElement=p,this._scrollArea=h,this._bufferService=m,this._optionsService=b,this._charSizeService=w,this._renderService=k,this._coreBrowserService=j,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new v.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,d.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(E=>this._activeBuffer=E.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(E=>this._renderDimensions=E)),this._handleThemeChange(S.colors),this.register(S.onChangeColors(E=>this._handleThemeChange(E))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(p){this._viewportElement.style.backgroundColor=p.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame(()=>this.syncScrollArea())}_refresh(p){if(p)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderService.dimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderService.dimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const h=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.css.canvas.height);this._lastRecordedBufferHeight!==h&&(this._lastRecordedBufferHeight=h,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const p=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==p&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=p),this._refreshAnimationFrame=null}syncScrollArea(p=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(p);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(p)}_handleScroll(p){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const h=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:h,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const p=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(p*(this._smoothScrollState.target-this._smoothScrollState.origin)),p<1?this._coreBrowserService.window.requestAnimationFrame(()=>this._smoothScroll()):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(p,h){const m=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(h<0&&this._viewportElement.scrollTop!==0||h>0&&m<this._lastRecordedBufferHeight)||(p.cancelable&&p.preventDefault(),!1)}handleWheel(p){const h=this._getPixelsScrolled(p);return h!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+h:this._smoothScrollState.target+=h,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=h,this._bubbleScroll(p,h))}scrollLines(p){if(p!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const h=p*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+h,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:p,suppressScrollEvent:!1})}_getPixelsScrolled(p){if(p.deltaY===0||p.shiftKey)return 0;let h=this._applyScrollModifier(p.deltaY,p);return p.deltaMode===WheelEvent.DOM_DELTA_LINE?h*=this._currentRowHeight:p.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(h*=this._currentRowHeight*this._bufferService.rows),h}getBufferElements(p,h){var m;let b,w="";const k=[],j=h??this._bufferService.buffer.lines.length,S=this._bufferService.buffer.lines;for(let E=p;E<j;E++){const R=S.get(E);if(!R)continue;const M=(m=S.get(E+1))===null||m===void 0?void 0:m.isWrapped;if(w+=R.translateToString(!M),!M||E===S.length-1){const A=document.createElement("div");A.textContent=w,k.push(A),w.length>0&&(b=A),w=""}}return{bufferElements:k,cursorElement:b}}getLinesScrolled(p){if(p.deltaY===0||p.shiftKey)return 0;let h=this._applyScrollModifier(p.deltaY,p);return p.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(h/=this._currentRowHeight+0,this._wheelPartialScroll+=h,h=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):p.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(h*=this._bufferService.rows),h}_applyScrollModifier(p,h){const m=this._optionsService.rawOptions.fastScrollModifier;return m==="alt"&&h.altKey||m==="ctrl"&&h.ctrlKey||m==="shift"&&h.shiftKey?p*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:p*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(p){this._lastTouchY=p.touches[0].pageY}handleTouchMove(p){const h=this._lastTouchY-p.touches[0].pageY;return this._lastTouchY=p.touches[0].pageY,h!==0&&(this._viewportElement.scrollTop+=h,this._bubbleScroll(p,h))}};a.Viewport=f=u([g(2,y.IBufferService),g(3,y.IOptionsService),g(4,_.ICharSizeService),g(5,_.IRenderService),g(6,_.ICoreBrowserService),g(7,_.IThemeService)],f)},3107:function(l,a,c){var u=this&&this.__decorate||function(f,p,h,m){var b,w=arguments.length,k=w<3?p:m===null?m=Object.getOwnPropertyDescriptor(p,h):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(f,p,h,m);else for(var j=f.length-1;j>=0;j--)(b=f[j])&&(k=(w<3?b(k):w>3?b(p,h,k):b(p,h))||k);return w>3&&k&&Object.defineProperty(p,h,k),k},g=this&&this.__param||function(f,p){return function(h,m){p(h,m,f)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferDecorationRenderer=void 0;const d=c(3656),_=c(4725),v=c(844),x=c(2585);let y=a.BufferDecorationRenderer=class extends v.Disposable{constructor(f,p,h,m){super(),this._screenElement=f,this._bufferService=p,this._decorationService=h,this._renderService=m,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this.register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this.register((0,d.addDisposableDomListener)(window,"resize",()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this.register(this._decorationService.onDecorationRemoved(b=>this._removeDecoration(b))),this.register((0,v.toDisposable)(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(const f of this._decorationService.decorations)this._renderDecoration(f);this._dimensionsChanged=!1}_renderDecoration(f){this._refreshStyle(f),this._dimensionsChanged&&this._refreshXPosition(f)}_createElement(f){var p,h;const m=document.createElement("div");m.classList.add("xterm-decoration"),m.classList.toggle("xterm-decoration-top-layer",((p=f==null?void 0:f.options)===null||p===void 0?void 0:p.layer)==="top"),m.style.width=`${Math.round((f.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,m.style.height=(f.options.height||1)*this._renderService.dimensions.css.cell.height+"px",m.style.top=(f.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",m.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const b=(h=f.options.x)!==null&&h!==void 0?h:0;return b&&b>this._bufferService.cols&&(m.style.display="none"),this._refreshXPosition(f,m),m}_refreshStyle(f){const p=f.marker.line-this._bufferService.buffers.active.ydisp;if(p<0||p>=this._bufferService.rows)f.element&&(f.element.style.display="none",f.onRenderEmitter.fire(f.element));else{let h=this._decorationElements.get(f);h||(h=this._createElement(f),f.element=h,this._decorationElements.set(f,h),this._container.appendChild(h),f.onDispose(()=>{this._decorationElements.delete(f),h.remove()})),h.style.top=p*this._renderService.dimensions.css.cell.height+"px",h.style.display=this._altBufferIsActive?"none":"block",f.onRenderEmitter.fire(h)}}_refreshXPosition(f,p=f.element){var h;if(!p)return;const m=(h=f.options.x)!==null&&h!==void 0?h:0;(f.options.anchor||"left")==="right"?p.style.right=m?m*this._renderService.dimensions.css.cell.width+"px":"":p.style.left=m?m*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(f){var p;(p=this._decorationElements.get(f))===null||p===void 0||p.remove(),this._decorationElements.delete(f),f.dispose()}};a.BufferDecorationRenderer=y=u([g(1,x.IBufferService),g(2,x.IDecorationService),g(3,_.IRenderService)],y)},5871:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorZoneStore=void 0,a.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(c){if(c.options.overviewRulerOptions){for(const u of this._zones)if(u.color===c.options.overviewRulerOptions.color&&u.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(u,c.marker.line))return;if(this._lineAdjacentToZone(u,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(u,c.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=c.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=c.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=c.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=c.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:c.options.overviewRulerOptions.color,position:c.options.overviewRulerOptions.position,startBufferLine:c.marker.line,endBufferLine:c.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(c){this._linePadding=c}_lineIntersectsZone(c,u){return u>=c.startBufferLine&&u<=c.endBufferLine}_lineAdjacentToZone(c,u,g){return u>=c.startBufferLine-this._linePadding[g||"full"]&&u<=c.endBufferLine+this._linePadding[g||"full"]}_addLineToZone(c,u){c.startBufferLine=Math.min(c.startBufferLine,u),c.endBufferLine=Math.max(c.endBufferLine,u)}}},5744:function(l,a,c){var u=this&&this.__decorate||function(b,w,k,j){var S,E=arguments.length,R=E<3?w:j===null?j=Object.getOwnPropertyDescriptor(w,k):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(b,w,k,j);else for(var M=b.length-1;M>=0;M--)(S=b[M])&&(R=(E<3?S(R):E>3?S(w,k,R):S(w,k))||R);return E>3&&R&&Object.defineProperty(w,k,R),R},g=this&&this.__param||function(b,w){return function(k,j){w(k,j,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OverviewRulerRenderer=void 0;const d=c(5871),_=c(3656),v=c(4725),x=c(844),y=c(2585),f={full:0,left:0,center:0,right:0},p={full:0,left:0,center:0,right:0},h={full:0,left:0,center:0,right:0};let m=a.OverviewRulerRenderer=class extends x.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(b,w,k,j,S,E,R){var M;super(),this._viewportElement=b,this._screenElement=w,this._bufferService=k,this._decorationService=j,this._renderService=S,this._optionsService=E,this._coreBrowseService=R,this._colorZoneStore=new d.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(M=this._viewportElement.parentElement)===null||M===void 0||M.insertBefore(this._canvas,this._viewportElement);const A=this._canvas.getContext("2d");if(!A)throw new Error("Ctx cannot be null");this._ctx=A,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,x.toDisposable)(()=>{var L;(L=this._canvas)===null||L===void 0||L.remove()}))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this.register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0)))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this.register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())}))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender(()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",()=>this._queueRefresh(!0))),this.register((0,_.addDisposableDomListener)(this._coreBrowseService.window,"resize",()=>this._queueRefresh(!0))),this._queueRefresh(!0)}_refreshDrawConstants(){const b=Math.floor(this._canvas.width/3),w=Math.ceil(this._canvas.width/3);p.full=this._canvas.width,p.left=b,p.center=w,p.right=b,this._refreshDrawHeightConstants(),h.full=0,h.left=0,h.center=p.left,h.right=p.left+p.center}_refreshDrawHeightConstants(){f.full=Math.round(2*this._coreBrowseService.dpr);const b=this._canvas.height/this._bufferService.buffer.lines.length,w=Math.round(Math.max(Math.min(b,12),6)*this._coreBrowseService.dpr);f.left=w,f.center=w,f.right=w}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*f.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*f.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*f.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*f.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowseService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowseService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const w of this._decorationService.decorations)this._colorZoneStore.addDecoration(w);this._ctx.lineWidth=1;const b=this._colorZoneStore.zones;for(const w of b)w.position!=="full"&&this._renderColorZone(w);for(const w of b)w.position==="full"&&this._renderColorZone(w);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(b){this._ctx.fillStyle=b.color,this._ctx.fillRect(h[b.position||"full"],Math.round((this._canvas.height-1)*(b.startBufferLine/this._bufferService.buffers.active.lines.length)-f[b.position||"full"]/2),p[b.position||"full"],Math.round((this._canvas.height-1)*((b.endBufferLine-b.startBufferLine)/this._bufferService.buffers.active.lines.length)+f[b.position||"full"]))}_queueRefresh(b,w){this._shouldUpdateDimensions=b||this._shouldUpdateDimensions,this._shouldUpdateAnchor=w||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowseService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};a.OverviewRulerRenderer=m=u([g(2,y.IBufferService),g(3,y.IDecorationService),g(4,v.IRenderService),g(5,y.IOptionsService),g(6,v.ICoreBrowserService)],m)},2950:function(l,a,c){var u=this&&this.__decorate||function(y,f,p,h){var m,b=arguments.length,w=b<3?f:h===null?h=Object.getOwnPropertyDescriptor(f,p):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(y,f,p,h);else for(var k=y.length-1;k>=0;k--)(m=y[k])&&(w=(b<3?m(w):b>3?m(f,p,w):m(f,p))||w);return b>3&&w&&Object.defineProperty(f,p,w),w},g=this&&this.__param||function(y,f){return function(p,h){f(p,h,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CompositionHelper=void 0;const d=c(4725),_=c(2585),v=c(2584);let x=a.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(y,f,p,h,m,b){this._textarea=y,this._compositionView=f,this._bufferService=p,this._optionsService=h,this._coreService=m,this._renderService=b,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(y){this._compositionView.textContent=y.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(y){if(this._isComposing||this._isSendingComposition){if(y.keyCode===229||y.keyCode===16||y.keyCode===17||y.keyCode===18)return!1;this._finalizeComposition(!1)}return y.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(y){if(this._compositionView.classList.remove("active"),this._isComposing=!1,y){const f={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let p;this._isSendingComposition=!1,f.start+=this._dataAlreadySent.length,p=this._isComposing?this._textarea.value.substring(f.start,f.end):this._textarea.value.substring(f.start),p.length>0&&this._coreService.triggerDataEvent(p,!0)}},0)}else{this._isSendingComposition=!1;const f=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(f,!0)}}_handleAnyTextareaChanges(){const y=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const f=this._textarea.value,p=f.replace(y,"");this._dataAlreadySent=p,f.length>y.length?this._coreService.triggerDataEvent(p,!0):f.length<y.length?this._coreService.triggerDataEvent(`${v.C0.DEL}`,!0):f.length===y.length&&f!==y&&this._coreService.triggerDataEvent(f,!0)}},0)}updateCompositionElements(y){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const f=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),p=this._renderService.dimensions.css.cell.height,h=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,m=f*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=m+"px",this._compositionView.style.top=h+"px",this._compositionView.style.height=p+"px",this._compositionView.style.lineHeight=p+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const b=this._compositionView.getBoundingClientRect();this._textarea.style.left=m+"px",this._textarea.style.top=h+"px",this._textarea.style.width=Math.max(b.width,1)+"px",this._textarea.style.height=Math.max(b.height,1)+"px",this._textarea.style.lineHeight=b.height+"px"}y||setTimeout(()=>this.updateCompositionElements(!0),0)}}};a.CompositionHelper=x=u([g(2,_.IBufferService),g(3,_.IOptionsService),g(4,_.ICoreService),g(5,d.IRenderService)],x)},9806:(l,a)=>{function c(u,g,d){const _=d.getBoundingClientRect(),v=u.getComputedStyle(d),x=parseInt(v.getPropertyValue("padding-left")),y=parseInt(v.getPropertyValue("padding-top"));return[g.clientX-_.left-x,g.clientY-_.top-y]}Object.defineProperty(a,"__esModule",{value:!0}),a.getCoords=a.getCoordsRelativeToElement=void 0,a.getCoordsRelativeToElement=c,a.getCoords=function(u,g,d,_,v,x,y,f,p){if(!x)return;const h=c(u,g,d);return h?(h[0]=Math.ceil((h[0]+(p?y/2:0))/y),h[1]=Math.ceil(h[1]/f),h[0]=Math.min(Math.max(h[0],1),_+(p?1:0)),h[1]=Math.min(Math.max(h[1],1),v),h):void 0}},9504:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.moveToCellSequence=void 0;const u=c(2584);function g(f,p,h,m){const b=f-d(f,h),w=p-d(p,h),k=Math.abs(b-w)-function(j,S,E){let R=0;const M=j-d(j,E),A=S-d(S,E);for(let L=0;L<Math.abs(M-A);L++){const B=_(j,S)==="A"?-1:1,U=E.buffer.lines.get(M+B*L);U!=null&&U.isWrapped&&R++}return R}(f,p,h);return y(k,x(_(f,p),m))}function d(f,p){let h=0,m=p.buffer.lines.get(f),b=m==null?void 0:m.isWrapped;for(;b&&f>=0&&f<p.rows;)h++,m=p.buffer.lines.get(--f),b=m==null?void 0:m.isWrapped;return h}function _(f,p){return f>p?"A":"B"}function v(f,p,h,m,b,w){let k=f,j=p,S="";for(;k!==h||j!==m;)k+=b?1:-1,b&&k>w.cols-1?(S+=w.buffer.translateBufferLineToString(j,!1,f,k),k=0,f=0,j++):!b&&k<0&&(S+=w.buffer.translateBufferLineToString(j,!1,0,f+1),k=w.cols-1,f=k,j--);return S+w.buffer.translateBufferLineToString(j,!1,f,k)}function x(f,p){const h=p?"O":"[";return u.C0.ESC+h+f}function y(f,p){f=Math.floor(f);let h="";for(let m=0;m<f;m++)h+=p;return h}a.moveToCellSequence=function(f,p,h,m){const b=h.buffer.x,w=h.buffer.y;if(!h.buffer.hasScrollback)return function(S,E,R,M,A,L){return g(E,M,A,L).length===0?"":y(v(S,E,S,E-d(E,A),!1,A).length,x("D",L))}(b,w,0,p,h,m)+g(w,p,h,m)+function(S,E,R,M,A,L){let B;B=g(E,M,A,L).length>0?M-d(M,A):E;const U=M,W=function(q,N,T,D,O,$){let Y;return Y=g(T,D,O,$).length>0?D-d(D,O):N,q<T&&Y<=D||q>=T&&Y<D?"C":"D"}(S,E,R,M,A,L);return y(v(S,B,R,U,W==="C",A).length,x(W,L))}(b,w,f,p,h,m);let k;if(w===p)return k=b>f?"D":"C",y(Math.abs(b-f),x(k,m));k=w>p?"D":"C";const j=Math.abs(w-p);return y(function(S,E){return E.cols-S}(w>p?f:b,h)+(j-1)*h.cols+1+((w>p?b:f)-1),x(k,m))}},1296:function(l,a,c){var u=this&&this.__decorate||function(A,L,B,U){var W,q=arguments.length,N=q<3?L:U===null?U=Object.getOwnPropertyDescriptor(L,B):U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(A,L,B,U);else for(var T=A.length-1;T>=0;T--)(W=A[T])&&(N=(q<3?W(N):q>3?W(L,B,N):W(L,B))||N);return q>3&&N&&Object.defineProperty(L,B,N),N},g=this&&this.__param||function(A,L){return function(B,U){L(B,U,A)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRenderer=void 0;const d=c(3787),_=c(2550),v=c(2223),x=c(6171),y=c(4725),f=c(8055),p=c(8460),h=c(844),m=c(2585),b="xterm-dom-renderer-owner-",w="xterm-rows",k="xterm-fg-",j="xterm-bg-",S="xterm-focus",E="xterm-selection";let R=1,M=a.DomRenderer=class extends h.Disposable{constructor(A,L,B,U,W,q,N,T,D,O){super(),this._element=A,this._screenElement=L,this._viewportElement=B,this._linkifier2=U,this._charSizeService=q,this._optionsService=N,this._bufferService=T,this._coreBrowserService=D,this._themeService=O,this._terminalClass=R++,this._rowElements=[],this.onRequestRedraw=this.register(new p.EventEmitter).event,this._rowContainer=document.createElement("div"),this._rowContainer.classList.add(w),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=document.createElement("div"),this._selectionContainer.classList.add(E),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,x.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors($=>this._injectCss($))),this._injectCss(this._themeService.colors),this._rowFactory=W.createInstance(d.DomRendererRowFactory,document),this._element.classList.add(b+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline($=>this._handleLinkHover($))),this.register(this._linkifier2.onHideLinkUnderline($=>this._handleLinkLeave($))),this.register((0,h.toDisposable)(()=>{this._element.classList.remove(b+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new _.WidthCache(document),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const A=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*A,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*A),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/A),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/A),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const B of this._rowElements)B.style.width=`${this.dimensions.css.canvas.width}px`,B.style.height=`${this.dimensions.css.cell.height}px`,B.style.lineHeight=`${this.dimensions.css.cell.height}px`,B.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const L=`${this._terminalSelector} .${w} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=L,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(A){this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let L=`${this._terminalSelector} .${w} { color: ${A.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;L+=`${this._terminalSelector} .${w} .xterm-dim { color: ${f.color.multiplyOpacity(A.foreground,.5).css};}`,L+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`,L+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { border-bottom-style: hidden; }}",L+="@keyframes blink_block_"+this._terminalClass+` { 0% { background-color: ${A.cursor.css}; color: ${A.cursorAccent.css}; } 50% { background-color: inherit; color: ${A.cursor.css}; }}`,L+=`${this._terminalSelector} .${w}.${S} .xterm-cursor.xterm-cursor-blink:not(.xterm-cursor-block) { animation: blink_box_shadow_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${w}.${S} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: blink_block_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-block { background-color: ${A.cursor.css}; color: ${A.cursorAccent.css};}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${A.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${A.cursor.css} inset;}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${A.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,L+=`${this._terminalSelector} .${E} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${E} div { position: absolute; background-color: ${A.selectionBackgroundOpaque.css};}${this._terminalSelector} .${E} div { position: absolute; background-color: ${A.selectionInactiveBackgroundOpaque.css};}`;for(const[B,U]of A.ansi.entries())L+=`${this._terminalSelector} .${k}${B} { color: ${U.css}; }${this._terminalSelector} .${k}${B}.xterm-dim { color: ${f.color.multiplyOpacity(U,.5).css}; }${this._terminalSelector} .${j}${B} { background-color: ${U.css}; }`;L+=`${this._terminalSelector} .${k}${v.INVERTED_DEFAULT_COLOR} { color: ${f.color.opaque(A.background).css}; }${this._terminalSelector} .${k}${v.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${f.color.multiplyOpacity(f.color.opaque(A.background),.5).css}; }${this._terminalSelector} .${j}${v.INVERTED_DEFAULT_COLOR} { background-color: ${A.foreground.css}; }`,this._themeStyleElement.textContent=L}_setDefaultSpacing(){const A=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${A}px`,this._rowFactory.defaultSpacing=A}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(A,L){for(let B=this._rowElements.length;B<=L;B++){const U=document.createElement("div");this._rowContainer.appendChild(U),this._rowElements.push(U)}for(;this._rowElements.length>L;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(A,L){this._refreshRowElements(A,L),this._updateDimensions()}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(S)}handleFocus(){this._rowContainer.classList.add(S),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(A,L,B){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(A,L,B),this.renderRows(0,this._bufferService.rows-1),!A||!L)return;const U=A[1]-this._bufferService.buffer.ydisp,W=L[1]-this._bufferService.buffer.ydisp,q=Math.max(U,0),N=Math.min(W,this._bufferService.rows-1);if(q>=this._bufferService.rows||N<0)return;const T=document.createDocumentFragment();if(B){const D=A[0]>L[0];T.appendChild(this._createSelectionElement(q,D?L[0]:A[0],D?A[0]:L[0],N-q+1))}else{const D=U===q?A[0]:0,O=q===W?L[0]:this._bufferService.cols;T.appendChild(this._createSelectionElement(q,D,O));const $=N-q-1;if(T.appendChild(this._createSelectionElement(q+1,0,this._bufferService.cols,$)),q!==N){const Y=W===N?L[0]:this._bufferService.cols;T.appendChild(this._createSelectionElement(N,0,Y))}}this._selectionContainer.appendChild(T)}_createSelectionElement(A,L,B,U=1){const W=document.createElement("div");return W.style.height=U*this.dimensions.css.cell.height+"px",W.style.top=A*this.dimensions.css.cell.height+"px",W.style.left=L*this.dimensions.css.cell.width+"px",W.style.width=this.dimensions.css.cell.width*(B-L)+"px",W}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const A of this._rowElements)A.replaceChildren()}renderRows(A,L){const B=this._bufferService.buffer,U=B.ybase+B.y,W=Math.min(B.x,this._bufferService.cols-1),q=this._optionsService.rawOptions.cursorBlink,N=this._optionsService.rawOptions.cursorStyle,T=this._optionsService.rawOptions.cursorInactiveStyle;for(let D=A;D<=L;D++){const O=D+B.ydisp,$=this._rowElements[D],Y=B.lines.get(O);if(!$||!Y)break;$.replaceChildren(...this._rowFactory.createRow(Y,O,O===U,N,T,W,q,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${b}${this._terminalClass}`}_handleLinkHover(A){this._setCellUnderline(A.x1,A.x2,A.y1,A.y2,A.cols,!0)}_handleLinkLeave(A){this._setCellUnderline(A.x1,A.x2,A.y1,A.y2,A.cols,!1)}_setCellUnderline(A,L,B,U,W,q){B<0&&(A=0),U<0&&(L=0);const N=this._bufferService.rows-1;B=Math.max(Math.min(B,N),0),U=Math.max(Math.min(U,N),0),W=Math.min(W,this._bufferService.cols);const T=this._bufferService.buffer,D=T.ybase+T.y,O=Math.min(T.x,W-1),$=this._optionsService.rawOptions.cursorBlink,Y=this._optionsService.rawOptions.cursorStyle,J=this._optionsService.rawOptions.cursorInactiveStyle;for(let re=B;re<=U;++re){const ye=re+T.ydisp,P=this._rowElements[re],z=T.lines.get(ye);if(!P||!z)break;P.replaceChildren(...this._rowFactory.createRow(z,ye,ye===D,Y,J,O,$,this.dimensions.css.cell.width,this._widthCache,q?re===B?A:0:-1,q?(re===U?L:W)-1:-1))}}};a.DomRenderer=M=u([g(4,m.IInstantiationService),g(5,y.ICharSizeService),g(6,m.IOptionsService),g(7,m.IBufferService),g(8,y.ICoreBrowserService),g(9,y.IThemeService)],M)},3787:function(l,a,c){var u=this&&this.__decorate||function(k,j,S,E){var R,M=arguments.length,A=M<3?j:E===null?E=Object.getOwnPropertyDescriptor(j,S):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(k,j,S,E);else for(var L=k.length-1;L>=0;L--)(R=k[L])&&(A=(M<3?R(A):M>3?R(j,S,A):R(j,S))||A);return M>3&&A&&Object.defineProperty(j,S,A),A},g=this&&this.__param||function(k,j){return function(S,E){j(S,E,k)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRendererRowFactory=void 0;const d=c(2223),_=c(643),v=c(511),x=c(2585),y=c(8055),f=c(4725),p=c(4269),h=c(6171),m=c(3734);let b=a.DomRendererRowFactory=class{constructor(k,j,S,E,R,M,A){this._document=k,this._characterJoinerService=j,this._optionsService=S,this._coreBrowserService=E,this._coreService=R,this._decorationService=M,this._themeService=A,this._workCell=new v.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(k,j,S){this._selectionStart=k,this._selectionEnd=j,this._columnSelectMode=S}createRow(k,j,S,E,R,M,A,L,B,U,W){const q=[],N=this._characterJoinerService.getJoinedCharacters(j),T=this._themeService.colors;let D,O=k.getNoBgTrimmedLength();S&&O<M+1&&(O=M+1);let $=0,Y="",J=0,re=0,ye=0,P=!1,z=0,G=!1,K=0;const Q=[],ee=U!==-1&&W!==-1;for(let de=0;de<O;de++){k.loadCell(de,this._workCell);let De=this._workCell.getWidth();if(De===0)continue;let He=!1,Lt=de,Se=this._workCell;if(N.length>0&&de===N[0][0]){He=!0;const fe=N.shift();Se=new p.JoinedCellData(this._workCell,k.translateToString(!0,fe[0],fe[1]),fe[1]-fe[0]),Lt=fe[1]-1,De=Se.getWidth()}const ur=this._isCellInSelection(de,j),dr=S&&de===M,An=ee&&de>=U&&de<=W;let qr=!1;this._decorationService.forEachDecorationAtCell(de,j,void 0,fe=>{qr=!0});let Dn=Se.getChars()||_.WHITESPACE_CELL_CHAR;if(Dn===" "&&(Se.isUnderline()||Se.isOverline())&&(Dn=" "),K=De*L-B.get(Dn,Se.isBold(),Se.isItalic()),D){if($&&(ur&&G||!ur&&!G&&Se.bg===J)&&(ur&&G&&T.selectionForeground||Se.fg===re)&&Se.extended.ext===ye&&An===P&&K===z&&!dr&&!He&&!qr){Y+=Dn,$++;continue}$&&(D.textContent=Y),D=this._document.createElement("span"),$=0,Y=""}else D=this._document.createElement("span");if(J=Se.bg,re=Se.fg,ye=Se.extended.ext,P=An,z=K,G=ur,He&&M>=de&&M<=Lt&&(M=de),!this._coreService.isCursorHidden&&dr){if(Q.push("xterm-cursor"),this._coreBrowserService.isFocused)A&&Q.push("xterm-cursor-blink"),Q.push(E==="bar"?"xterm-cursor-bar":E==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(R)switch(R){case"outline":Q.push("xterm-cursor-outline");break;case"block":Q.push("xterm-cursor-block");break;case"bar":Q.push("xterm-cursor-bar");break;case"underline":Q.push("xterm-cursor-underline")}}if(Se.isBold()&&Q.push("xterm-bold"),Se.isItalic()&&Q.push("xterm-italic"),Se.isDim()&&Q.push("xterm-dim"),Y=Se.isInvisible()?_.WHITESPACE_CELL_CHAR:Se.getChars()||_.WHITESPACE_CELL_CHAR,Se.isUnderline()&&(Q.push(`xterm-underline-${Se.extended.underlineStyle}`),Y===" "&&(Y=" "),!Se.isUnderlineColorDefault()))if(Se.isUnderlineColorRGB())D.style.textDecorationColor=`rgb(${m.AttributeData.toColorRGB(Se.getUnderlineColor()).join(",")})`;else{let fe=Se.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Se.isBold()&&fe<8&&(fe+=8),D.style.textDecorationColor=T.ansi[fe].css}Se.isOverline()&&(Q.push("xterm-overline"),Y===" "&&(Y=" ")),Se.isStrikethrough()&&Q.push("xterm-strikethrough"),An&&(D.style.textDecoration="underline");let pt=Se.getFgColor(),mn=Se.getFgColorMode(),I=Se.getBgColor(),H=Se.getBgColorMode();const V=!!Se.isInverse();if(V){const fe=pt;pt=I,I=fe;const Ne=mn;mn=H,H=Ne}let ne,ie,te,ce=!1;switch(this._decorationService.forEachDecorationAtCell(de,j,void 0,fe=>{fe.options.layer!=="top"&&ce||(fe.backgroundColorRGB&&(H=50331648,I=fe.backgroundColorRGB.rgba>>8&16777215,ne=fe.backgroundColorRGB),fe.foregroundColorRGB&&(mn=50331648,pt=fe.foregroundColorRGB.rgba>>8&16777215,ie=fe.foregroundColorRGB),ce=fe.options.layer==="top")}),!ce&&ur&&(ne=this._coreBrowserService.isFocused?T.selectionBackgroundOpaque:T.selectionInactiveBackgroundOpaque,I=ne.rgba>>8&16777215,H=50331648,ce=!0,T.selectionForeground&&(mn=50331648,pt=T.selectionForeground.rgba>>8&16777215,ie=T.selectionForeground)),ce&&Q.push("xterm-decoration-top"),H){case 16777216:case 33554432:te=T.ansi[I],Q.push(`xterm-bg-${I}`);break;case 50331648:te=y.rgba.toColor(I>>16,I>>8&255,255&I),this._addStyle(D,`background-color:#${w((I>>>0).toString(16),"0",6)}`);break;default:V?(te=T.foreground,Q.push(`xterm-bg-${d.INVERTED_DEFAULT_COLOR}`)):te=T.background}switch(ne||Se.isDim()&&(ne=y.color.multiplyOpacity(te,.5)),mn){case 16777216:case 33554432:Se.isBold()&&pt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(pt+=8),this._applyMinimumContrast(D,te,T.ansi[pt],Se,ne,void 0)||Q.push(`xterm-fg-${pt}`);break;case 50331648:const fe=y.rgba.toColor(pt>>16&255,pt>>8&255,255&pt);this._applyMinimumContrast(D,te,fe,Se,ne,ie)||this._addStyle(D,`color:#${w(pt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(D,te,T.foreground,Se,ne,void 0)||V&&Q.push(`xterm-fg-${d.INVERTED_DEFAULT_COLOR}`)}Q.length&&(D.className=Q.join(" "),Q.length=0),dr||He||qr?D.textContent=Y:$++,K!==this.defaultSpacing&&(D.style.letterSpacing=`${K}px`),q.push(D),de=Lt}return D&&$&&(D.textContent=Y),q}_applyMinimumContrast(k,j,S,E,R,M){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,h.excludeFromContrastRatioDemands)(E.getCode()))return!1;const A=this._getContrastCache(E);let L;if(R||M||(L=A.getColor(j.rgba,S.rgba)),L===void 0){const B=this._optionsService.rawOptions.minimumContrastRatio/(E.isDim()?2:1);L=y.color.ensureContrastRatio(R||j,M||S,B),A.setColor((R||j).rgba,(M||S).rgba,L??null)}return!!L&&(this._addStyle(k,`color:${L.css}`),!0)}_getContrastCache(k){return k.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(k,j){k.setAttribute("style",`${k.getAttribute("style")||""}${j};`)}_isCellInSelection(k,j){const S=this._selectionStart,E=this._selectionEnd;return!(!S||!E)&&(this._columnSelectMode?S[0]<=E[0]?k>=S[0]&&j>=S[1]&&k<E[0]&&j<=E[1]:k<S[0]&&j>=S[1]&&k>=E[0]&&j<=E[1]:j>S[1]&&j<E[1]||S[1]===E[1]&&j===S[1]&&k>=S[0]&&k<E[0]||S[1]<E[1]&&j===E[1]&&k<E[0]||S[1]<E[1]&&j===S[1]&&k>=S[0])}};function w(k,j,S){for(;k.length<S;)k=j+k;return k}a.DomRendererRowFactory=b=u([g(1,f.ICharacterJoinerService),g(2,x.IOptionsService),g(3,f.ICoreBrowserService),g(4,x.ICoreService),g(5,x.IDecorationService),g(6,f.IThemeService)],b)},2550:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WidthCache=void 0,a.WidthCache=class{constructor(c){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=c.createElement("div"),this._container.style.position="absolute",this._container.style.top="-50000px",this._container.style.width="50000px",this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const u=c.createElement("span"),g=c.createElement("span");g.style.fontWeight="bold";const d=c.createElement("span");d.style.fontStyle="italic";const _=c.createElement("span");_.style.fontWeight="bold",_.style.fontStyle="italic",this._measureElements=[u,g,d,_],this._container.appendChild(u),this._container.appendChild(g),this._container.appendChild(d),this._container.appendChild(_),c.body.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(c,u,g,d){c===this._font&&u===this._fontSize&&g===this._weight&&d===this._weightBold||(this._font=c,this._fontSize=u,this._weight=g,this._weightBold=d,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${g}`,this._measureElements[1].style.fontWeight=`${d}`,this._measureElements[2].style.fontWeight=`${g}`,this._measureElements[3].style.fontWeight=`${d}`,this.clear())}get(c,u,g){let d=0;if(!u&&!g&&c.length===1&&(d=c.charCodeAt(0))<256)return this._flat[d]!==-9999?this._flat[d]:this._flat[d]=this._measure(c,0);let _=c;u&&(_+="B"),g&&(_+="I");let v=this._holey.get(_);if(v===void 0){let x=0;u&&(x|=1),g&&(x|=2),v=this._measure(c,x),this._holey.set(_,v)}return v}_measure(c,u){const g=this._measureElements[u];return g.textContent=c.repeat(32),g.offsetWidth/32}}},2223:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TEXT_BASELINE=a.DIM_OPACITY=a.INVERTED_DEFAULT_COLOR=void 0;const u=c(6114);a.INVERTED_DEFAULT_COLOR=257,a.DIM_OPACITY=.5,a.TEXT_BASELINE=u.isFirefox||u.isLegacyEdge?"bottom":"ideographic"},6171:(l,a)=>{function c(u){return 57508<=u&&u<=57558}Object.defineProperty(a,"__esModule",{value:!0}),a.createRenderDimensions=a.excludeFromContrastRatioDemands=a.isRestrictedPowerlineGlyph=a.isPowerlineGlyph=a.throwIfFalsy=void 0,a.throwIfFalsy=function(u){if(!u)throw new Error("value must not be falsy");return u},a.isPowerlineGlyph=c,a.isRestrictedPowerlineGlyph=function(u){return 57520<=u&&u<=57527},a.excludeFromContrastRatioDemands=function(u){return c(u)||function(g){return 9472<=g&&g<=9631}(u)},a.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}}},456:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionModel=void 0,a.SelectionModel=class{constructor(c){this._bufferService=c,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,u=this.selectionEnd;return!(!c||!u)&&(c[1]>u[1]||c[1]===u[1]&&c[0]>u[0])}handleTrim(c){return this.selectionStart&&(this.selectionStart[1]-=c),this.selectionEnd&&(this.selectionEnd[1]-=c),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(l,a,c){var u=this&&this.__decorate||function(f,p,h,m){var b,w=arguments.length,k=w<3?p:m===null?m=Object.getOwnPropertyDescriptor(p,h):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(f,p,h,m);else for(var j=f.length-1;j>=0;j--)(b=f[j])&&(k=(w<3?b(k):w>3?b(p,h,k):b(p,h))||k);return w>3&&k&&Object.defineProperty(p,h,k),k},g=this&&this.__param||function(f,p){return function(h,m){p(h,m,f)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharSizeService=void 0;const d=c(2585),_=c(8460),v=c(844);let x=a.CharSizeService=class extends v.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(f,p,h){super(),this._optionsService=h,this.width=0,this.height=0,this._onCharSizeChange=this.register(new _.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event,this._measureStrategy=new y(f,p,this._optionsService),this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const f=this._measureStrategy.measure();f.width===this.width&&f.height===this.height||(this.width=f.width,this.height=f.height,this._onCharSizeChange.fire())}};a.CharSizeService=x=u([g(2,d.IOptionsService)],x);class y{constructor(p,h,m){this._document=p,this._parentElement=h,this._optionsService=m,this._result={width:0,height:0},this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`;const p={height:Number(this._measureElement.offsetHeight),width:Number(this._measureElement.offsetWidth)};return p.width!==0&&p.height!==0&&(this._result.width=p.width/32,this._result.height=Math.ceil(p.height)),this._result}}},4269:function(l,a,c){var u=this&&this.__decorate||function(p,h,m,b){var w,k=arguments.length,j=k<3?h:b===null?b=Object.getOwnPropertyDescriptor(h,m):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(p,h,m,b);else for(var S=p.length-1;S>=0;S--)(w=p[S])&&(j=(k<3?w(j):k>3?w(h,m,j):w(h,m))||j);return k>3&&j&&Object.defineProperty(h,m,j),j},g=this&&this.__param||function(p,h){return function(m,b){h(m,b,p)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharacterJoinerService=a.JoinedCellData=void 0;const d=c(3734),_=c(643),v=c(511),x=c(2585);class y extends d.AttributeData{constructor(h,m,b){super(),this.content=0,this.combinedData="",this.fg=h.fg,this.bg=h.bg,this.combinedData=m,this._width=b}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(h){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.JoinedCellData=y;let f=a.CharacterJoinerService=class Kw{constructor(h){this._bufferService=h,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new v.CellData}register(h){const m={id:this._nextCharacterJoinerId++,handler:h};return this._characterJoiners.push(m),m.id}deregister(h){for(let m=0;m<this._characterJoiners.length;m++)if(this._characterJoiners[m].id===h)return this._characterJoiners.splice(m,1),!0;return!1}getJoinedCharacters(h){if(this._characterJoiners.length===0)return[];const m=this._bufferService.buffer.lines.get(h);if(!m||m.length===0)return[];const b=[],w=m.translateToString(!0);let k=0,j=0,S=0,E=m.getFg(0),R=m.getBg(0);for(let M=0;M<m.getTrimmedLength();M++)if(m.loadCell(M,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==E||this._workCell.bg!==R){if(M-k>1){const A=this._getJoinedRanges(w,S,j,m,k);for(let L=0;L<A.length;L++)b.push(A[L])}k=M,S=j,E=this._workCell.fg,R=this._workCell.bg}j+=this._workCell.getChars().length||_.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-k>1){const M=this._getJoinedRanges(w,S,j,m,k);for(let A=0;A<M.length;A++)b.push(M[A])}return b}_getJoinedRanges(h,m,b,w,k){const j=h.substring(m,b);let S=[];try{S=this._characterJoiners[0].handler(j)}catch(E){console.error(E)}for(let E=1;E<this._characterJoiners.length;E++)try{const R=this._characterJoiners[E].handler(j);for(let M=0;M<R.length;M++)Kw._mergeRanges(S,R[M])}catch(R){console.error(R)}return this._stringRangesToCellRanges(S,w,k),S}_stringRangesToCellRanges(h,m,b){let w=0,k=!1,j=0,S=h[w];if(S){for(let E=b;E<this._bufferService.cols;E++){const R=m.getWidth(E),M=m.getString(E).length||_.WHITESPACE_CELL_CHAR.length;if(R!==0){if(!k&&S[0]<=j&&(S[0]=E,k=!0),S[1]<=j){if(S[1]=E,S=h[++w],!S)break;S[0]<=j?(S[0]=E,k=!0):k=!1}j+=M}}S&&(S[1]=this._bufferService.cols)}}static _mergeRanges(h,m){let b=!1;for(let w=0;w<h.length;w++){const k=h[w];if(b){if(m[1]<=k[0])return h[w-1][1]=m[1],h;if(m[1]<=k[1])return h[w-1][1]=Math.max(m[1],k[1]),h.splice(w,1),h;h.splice(w,1),w--}else{if(m[1]<=k[0])return h.splice(w,0,m),h;if(m[1]<=k[1])return k[0]=Math.min(m[0],k[0]),h;m[0]<k[1]&&(k[0]=Math.min(m[0],k[0]),b=!0)}}return b?h[h.length-1][1]=m[1]:h.push(m),h}};a.CharacterJoinerService=f=u([g(0,x.IBufferService)],f)},5114:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreBrowserService=void 0,a.CoreBrowserService=class{constructor(c,u){this._textarea=c,this.window=u,this._isFocused=!1,this._cachedIsFocused=void 0,this._textarea.addEventListener("focus",()=>this._isFocused=!0),this._textarea.addEventListener("blur",()=>this._isFocused=!1)}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}}},8934:function(l,a,c){var u=this&&this.__decorate||function(x,y,f,p){var h,m=arguments.length,b=m<3?y:p===null?p=Object.getOwnPropertyDescriptor(y,f):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(x,y,f,p);else for(var w=x.length-1;w>=0;w--)(h=x[w])&&(b=(m<3?h(b):m>3?h(y,f,b):h(y,f))||b);return m>3&&b&&Object.defineProperty(y,f,b),b},g=this&&this.__param||function(x,y){return function(f,p){y(f,p,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.MouseService=void 0;const d=c(4725),_=c(9806);let v=a.MouseService=class{constructor(x,y){this._renderService=x,this._charSizeService=y}getCoords(x,y,f,p,h){return(0,_.getCoords)(window,x,y,f,p,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,h)}getMouseReportCoords(x,y){const f=(0,_.getCoordsRelativeToElement)(window,x,y);if(this._charSizeService.hasValidSize)return f[0]=Math.min(Math.max(f[0],0),this._renderService.dimensions.css.canvas.width-1),f[1]=Math.min(Math.max(f[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(f[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(f[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(f[0]),y:Math.floor(f[1])}}};a.MouseService=v=u([g(0,d.IRenderService),g(1,d.ICharSizeService)],v)},3230:function(l,a,c){var u=this&&this.__decorate||function(b,w,k,j){var S,E=arguments.length,R=E<3?w:j===null?j=Object.getOwnPropertyDescriptor(w,k):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(b,w,k,j);else for(var M=b.length-1;M>=0;M--)(S=b[M])&&(R=(E<3?S(R):E>3?S(w,k,R):S(w,k))||R);return E>3&&R&&Object.defineProperty(w,k,R),R},g=this&&this.__param||function(b,w){return function(k,j){w(k,j,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.RenderService=void 0;const d=c(3656),_=c(6193),v=c(5596),x=c(4725),y=c(8460),f=c(844),p=c(7226),h=c(2585);let m=a.RenderService=class extends f.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(b,w,k,j,S,E,R,M){if(super(),this._rowCount=b,this._charSizeService=j,this._renderer=this.register(new f.MutableDisposable),this._pausedResizeTask=new p.DebouncedIdleTask,this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new y.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new y.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new y.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new y.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new _.RenderDebouncer(R.window,(A,L)=>this._renderRows(A,L)),this.register(this._renderDebouncer),this._screenDprMonitor=new v.ScreenDprMonitor(R.window),this._screenDprMonitor.setListener(()=>this.handleDevicePixelRatioChange()),this.register(this._screenDprMonitor),this.register(E.onResize(()=>this._fullRefresh())),this.register(E.buffers.onBufferActivate(()=>{var A;return(A=this._renderer.value)===null||A===void 0?void 0:A.clear()})),this.register(k.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(S.onDecorationRegistered(()=>this._fullRefresh())),this.register(S.onDecorationRemoved(()=>this._fullRefresh())),this.register(k.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio"],()=>{this.clear(),this.handleResize(E.cols,E.rows),this._fullRefresh()})),this.register(k.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(E.buffer.y,E.buffer.y,!0))),this.register((0,d.addDisposableDomListener)(R.window,"resize",()=>this.handleDevicePixelRatioChange())),this.register(M.onChangeColors(()=>this._fullRefresh())),"IntersectionObserver"in R.window){const A=new R.window.IntersectionObserver(L=>this._handleIntersectionChange(L[L.length-1]),{threshold:0});A.observe(w),this.register({dispose:()=>A.disconnect()})}}_handleIntersectionChange(b){this._isPaused=b.isIntersecting===void 0?b.intersectionRatio===0:!b.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(b,w,k=!1){this._isPaused?this._needsFullRefresh=!0:(k||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(b,w,this._rowCount))}_renderRows(b,w){this._renderer.value&&(b=Math.min(b,this._rowCount-1),w=Math.min(w,this._rowCount-1),this._renderer.value.renderRows(b,w),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:b,end:w}),this._onRender.fire({start:b,end:w}),this._isNextRenderRedrawOnly=!0)}resize(b,w){this._rowCount=w,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(b){this._renderer.value=b,this._renderer.value.onRequestRedraw(w=>this.refreshRows(w.start,w.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh()}addRefreshCallback(b){return this._renderDebouncer.addRefreshCallback(b)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var b,w;this._renderer.value&&((w=(b=this._renderer.value).clearTextureAtlas)===null||w===void 0||w.call(b),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(b,w){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value.handleResize(b,w)):this._renderer.value.handleResize(b,w),this._fullRefresh())}handleCharSizeChanged(){var b;(b=this._renderer.value)===null||b===void 0||b.handleCharSizeChanged()}handleBlur(){var b;(b=this._renderer.value)===null||b===void 0||b.handleBlur()}handleFocus(){var b;(b=this._renderer.value)===null||b===void 0||b.handleFocus()}handleSelectionChanged(b,w,k){var j;this._selectionState.start=b,this._selectionState.end=w,this._selectionState.columnSelectMode=k,(j=this._renderer.value)===null||j===void 0||j.handleSelectionChanged(b,w,k)}handleCursorMove(){var b;(b=this._renderer.value)===null||b===void 0||b.handleCursorMove()}clear(){var b;(b=this._renderer.value)===null||b===void 0||b.clear()}};a.RenderService=m=u([g(2,h.IOptionsService),g(3,x.ICharSizeService),g(4,h.IDecorationService),g(5,h.IBufferService),g(6,x.ICoreBrowserService),g(7,x.IThemeService)],m)},9312:function(l,a,c){var u=this&&this.__decorate||function(S,E,R,M){var A,L=arguments.length,B=L<3?E:M===null?M=Object.getOwnPropertyDescriptor(E,R):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(S,E,R,M);else for(var U=S.length-1;U>=0;U--)(A=S[U])&&(B=(L<3?A(B):L>3?A(E,R,B):A(E,R))||B);return L>3&&B&&Object.defineProperty(E,R,B),B},g=this&&this.__param||function(S,E){return function(R,M){E(R,M,S)}};Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionService=void 0;const d=c(9806),_=c(9504),v=c(456),x=c(4725),y=c(8460),f=c(844),p=c(6114),h=c(4841),m=c(511),b=c(2585),w=" ",k=new RegExp(w,"g");let j=a.SelectionService=class extends f.Disposable{constructor(S,E,R,M,A,L,B,U,W){super(),this._element=S,this._screenElement=E,this._linkifier=R,this._bufferService=M,this._coreService=A,this._mouseService=L,this._optionsService=B,this._renderService=U,this._coreBrowserService=W,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new m.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new y.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new y.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new y.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new y.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=q=>this._handleMouseMove(q),this._mouseUpListener=q=>this._handleMouseUp(q),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(q=>this._handleTrim(q)),this.register(this._bufferService.buffers.onBufferActivate(q=>this._handleBufferActivate(q))),this.enable(),this._model=new v.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,f.toDisposable)(()=>{this._removeMouseDownListeners()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const S=this._model.finalSelectionStart,E=this._model.finalSelectionEnd;return!(!S||!E||S[0]===E[0]&&S[1]===E[1])}get selectionText(){const S=this._model.finalSelectionStart,E=this._model.finalSelectionEnd;if(!S||!E)return"";const R=this._bufferService.buffer,M=[];if(this._activeSelectionMode===3){if(S[0]===E[0])return"";const A=S[0]<E[0]?S[0]:E[0],L=S[0]<E[0]?E[0]:S[0];for(let B=S[1];B<=E[1];B++){const U=R.translateBufferLineToString(B,!0,A,L);M.push(U)}}else{const A=S[1]===E[1]?E[0]:void 0;M.push(R.translateBufferLineToString(S[1],!0,S[0],A));for(let L=S[1]+1;L<=E[1]-1;L++){const B=R.lines.get(L),U=R.translateBufferLineToString(L,!0);B!=null&&B.isWrapped?M[M.length-1]+=U:M.push(U)}if(S[1]!==E[1]){const L=R.lines.get(E[1]),B=R.translateBufferLineToString(E[1],!0,0,E[0]);L&&L.isWrapped?M[M.length-1]+=B:M.push(B)}}return M.map(A=>A.replace(k," ")).join(p.isWindows?`\r
193
+ `:`
194
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(S){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),p.isLinux&&S&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(S){const E=this._getMouseBufferCoords(S),R=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!!(R&&M&&E)&&this._areCoordsInSelection(E,R,M)}isCellInSelection(S,E){const R=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!(!R||!M)&&this._areCoordsInSelection([S,E],R,M)}_areCoordsInSelection(S,E,R){return S[1]>E[1]&&S[1]<R[1]||E[1]===R[1]&&S[1]===E[1]&&S[0]>=E[0]&&S[0]<R[0]||E[1]<R[1]&&S[1]===R[1]&&S[0]<R[0]||E[1]<R[1]&&S[1]===E[1]&&S[0]>=E[0]}_selectWordAtCursor(S,E){var R,M;const A=(M=(R=this._linkifier.currentLink)===null||R===void 0?void 0:R.link)===null||M===void 0?void 0:M.range;if(A)return this._model.selectionStart=[A.start.x-1,A.start.y-1],this._model.selectionStartLength=(0,h.getRangeLength)(A,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const L=this._getMouseBufferCoords(S);return!!L&&(this._selectWordAt(L,E),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(S,E){this._model.clearSelection(),S=Math.max(S,0),E=Math.min(E,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,S],this._model.selectionEnd=[this._bufferService.cols,E],this.refresh(),this._onSelectionChange.fire()}_handleTrim(S){this._model.handleTrim(S)&&this.refresh()}_getMouseBufferCoords(S){const E=this._mouseService.getCoords(S,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(E)return E[0]--,E[1]--,E[1]+=this._bufferService.buffer.ydisp,E}_getMouseEventScrollAmount(S){let E=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,S,this._screenElement)[1];const R=this._renderService.dimensions.css.canvas.height;return E>=0&&E<=R?0:(E>R&&(E-=R),E=Math.min(Math.max(E,-50),50),E/=50,E/Math.abs(E)+Math.round(14*E))}shouldForceSelection(S){return p.isMac?S.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:S.shiftKey}handleMouseDown(S){if(this._mouseDownTimeStamp=S.timeStamp,(S.button!==2||!this.hasSelection)&&S.button===0){if(!this._enabled){if(!this.shouldForceSelection(S))return;S.stopPropagation()}S.preventDefault(),this._dragScrollAmount=0,this._enabled&&S.shiftKey?this._handleIncrementalClick(S):S.detail===1?this._handleSingleClick(S):S.detail===2?this._handleDoubleClick(S):S.detail===3&&this._handleTripleClick(S),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(S){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(S))}_handleSingleClick(S){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(S)?3:0,this._model.selectionStart=this._getMouseBufferCoords(S),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const E=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);E&&E.length!==this._model.selectionStart[0]&&E.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(S){this._selectWordAtCursor(S,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(S){const E=this._getMouseBufferCoords(S);E&&(this._activeSelectionMode=2,this._selectLineAt(E[1]))}shouldColumnSelect(S){return S.altKey&&!(p.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(S){if(S.stopImmediatePropagation(),!this._model.selectionStart)return;const E=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(S),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(S),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const R=this._bufferService.buffer;if(this._model.selectionEnd[1]<R.lines.length){const M=R.lines.get(this._model.selectionEnd[1]);M&&M.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]++}E&&E[0]===this._model.selectionEnd[0]&&E[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const S=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(S.ydisp+this._bufferService.rows,S.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=S.ydisp),this.refresh()}}_handleMouseUp(S){const E=S.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&E<500&&S.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const R=this._mouseService.getCoords(S,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(R&&R[0]!==void 0&&R[1]!==void 0){const M=(0,_.moveToCellSequence)(R[0]-1,R[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(M,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const S=this._model.finalSelectionStart,E=this._model.finalSelectionEnd,R=!(!S||!E||S[0]===E[0]&&S[1]===E[1]);R?S&&E&&(this._oldSelectionStart&&this._oldSelectionEnd&&S[0]===this._oldSelectionStart[0]&&S[1]===this._oldSelectionStart[1]&&E[0]===this._oldSelectionEnd[0]&&E[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(S,E,R)):this._oldHasSelection&&this._fireOnSelectionChange(S,E,R)}_fireOnSelectionChange(S,E,R){this._oldSelectionStart=S,this._oldSelectionEnd=E,this._oldHasSelection=R,this._onSelectionChange.fire()}_handleBufferActivate(S){this.clearSelection(),this._trimListener.dispose(),this._trimListener=S.activeBuffer.lines.onTrim(E=>this._handleTrim(E))}_convertViewportColToCharacterIndex(S,E){let R=E;for(let M=0;E>=M;M++){const A=S.loadCell(M,this._workCell).getChars().length;this._workCell.getWidth()===0?R--:A>1&&E!==M&&(R+=A-1)}return R}setSelection(S,E,R){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[S,E],this._model.selectionStartLength=R,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(S){this._isClickInSelection(S)||(this._selectWordAtCursor(S,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(S,E,R=!0,M=!0){if(S[0]>=this._bufferService.cols)return;const A=this._bufferService.buffer,L=A.lines.get(S[1]);if(!L)return;const B=A.translateBufferLineToString(S[1],!1);let U=this._convertViewportColToCharacterIndex(L,S[0]),W=U;const q=S[0]-U;let N=0,T=0,D=0,O=0;if(B.charAt(U)===" "){for(;U>0&&B.charAt(U-1)===" ";)U--;for(;W<B.length&&B.charAt(W+1)===" ";)W++}else{let J=S[0],re=S[0];L.getWidth(J)===0&&(N++,J--),L.getWidth(re)===2&&(T++,re++);const ye=L.getString(re).length;for(ye>1&&(O+=ye-1,W+=ye-1);J>0&&U>0&&!this._isCharWordSeparator(L.loadCell(J-1,this._workCell));){L.loadCell(J-1,this._workCell);const P=this._workCell.getChars().length;this._workCell.getWidth()===0?(N++,J--):P>1&&(D+=P-1,U-=P-1),U--,J--}for(;re<L.length&&W+1<B.length&&!this._isCharWordSeparator(L.loadCell(re+1,this._workCell));){L.loadCell(re+1,this._workCell);const P=this._workCell.getChars().length;this._workCell.getWidth()===2?(T++,re++):P>1&&(O+=P-1,W+=P-1),W++,re++}}W++;let $=U+q-N+D,Y=Math.min(this._bufferService.cols,W-U+N+T-D-O);if(E||B.slice(U,W).trim()!==""){if(R&&$===0&&L.getCodePoint(0)!==32){const J=A.lines.get(S[1]-1);if(J&&L.isWrapped&&J.getCodePoint(this._bufferService.cols-1)!==32){const re=this._getWordAt([this._bufferService.cols-1,S[1]-1],!1,!0,!1);if(re){const ye=this._bufferService.cols-re.start;$-=ye,Y+=ye}}}if(M&&$+Y===this._bufferService.cols&&L.getCodePoint(this._bufferService.cols-1)!==32){const J=A.lines.get(S[1]+1);if(J!=null&&J.isWrapped&&J.getCodePoint(0)!==32){const re=this._getWordAt([0,S[1]+1],!1,!1,!0);re&&(Y+=re.length)}}return{start:$,length:Y}}}_selectWordAt(S,E){const R=this._getWordAt(S,E);if(R){for(;R.start<0;)R.start+=this._bufferService.cols,S[1]--;this._model.selectionStart=[R.start,S[1]],this._model.selectionStartLength=R.length}}_selectToWordAt(S){const E=this._getWordAt(S,!0);if(E){let R=S[1];for(;E.start<0;)E.start+=this._bufferService.cols,R--;if(!this._model.areSelectionValuesReversed())for(;E.start+E.length>this._bufferService.cols;)E.length-=this._bufferService.cols,R++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?E.start:E.start+E.length,R]}}_isCharWordSeparator(S){return S.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(S.getChars())>=0}_selectLineAt(S){const E=this._bufferService.buffer.getWrappedRangeForLine(S),R={start:{x:0,y:E.first},end:{x:this._bufferService.cols-1,y:E.last}};this._model.selectionStart=[0,E.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,h.getRangeLength)(R,this._bufferService.cols)}};a.SelectionService=j=u([g(3,b.IBufferService),g(4,b.ICoreService),g(5,x.IMouseService),g(6,b.IOptionsService),g(7,x.IRenderService),g(8,x.ICoreBrowserService)],j)},4725:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.IThemeService=a.ICharacterJoinerService=a.ISelectionService=a.IRenderService=a.IMouseService=a.ICoreBrowserService=a.ICharSizeService=void 0;const u=c(8343);a.ICharSizeService=(0,u.createDecorator)("CharSizeService"),a.ICoreBrowserService=(0,u.createDecorator)("CoreBrowserService"),a.IMouseService=(0,u.createDecorator)("MouseService"),a.IRenderService=(0,u.createDecorator)("RenderService"),a.ISelectionService=(0,u.createDecorator)("SelectionService"),a.ICharacterJoinerService=(0,u.createDecorator)("CharacterJoinerService"),a.IThemeService=(0,u.createDecorator)("ThemeService")},6731:function(l,a,c){var u=this&&this.__decorate||function(j,S,E,R){var M,A=arguments.length,L=A<3?S:R===null?R=Object.getOwnPropertyDescriptor(S,E):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(j,S,E,R);else for(var B=j.length-1;B>=0;B--)(M=j[B])&&(L=(A<3?M(L):A>3?M(S,E,L):M(S,E))||L);return A>3&&L&&Object.defineProperty(S,E,L),L},g=this&&this.__param||function(j,S){return function(E,R){S(E,R,j)}};Object.defineProperty(a,"__esModule",{value:!0}),a.ThemeService=a.DEFAULT_ANSI_COLORS=void 0;const d=c(7239),_=c(8055),v=c(8460),x=c(844),y=c(2585),f=_.css.toColor("#ffffff"),p=_.css.toColor("#000000"),h=_.css.toColor("#ffffff"),m=_.css.toColor("#000000"),b={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};a.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const j=[_.css.toColor("#2e3436"),_.css.toColor("#cc0000"),_.css.toColor("#4e9a06"),_.css.toColor("#c4a000"),_.css.toColor("#3465a4"),_.css.toColor("#75507b"),_.css.toColor("#06989a"),_.css.toColor("#d3d7cf"),_.css.toColor("#555753"),_.css.toColor("#ef2929"),_.css.toColor("#8ae234"),_.css.toColor("#fce94f"),_.css.toColor("#729fcf"),_.css.toColor("#ad7fa8"),_.css.toColor("#34e2e2"),_.css.toColor("#eeeeec")],S=[0,95,135,175,215,255];for(let E=0;E<216;E++){const R=S[E/36%6|0],M=S[E/6%6|0],A=S[E%6];j.push({css:_.channels.toCss(R,M,A),rgba:_.channels.toRgba(R,M,A)})}for(let E=0;E<24;E++){const R=8+10*E;j.push({css:_.channels.toCss(R,R,R),rgba:_.channels.toRgba(R,R,R)})}return j})());let w=a.ThemeService=class extends x.Disposable{get colors(){return this._colors}constructor(j){super(),this._optionsService=j,this._contrastCache=new d.ColorContrastCache,this._halfContrastCache=new d.ColorContrastCache,this._onChangeColors=this.register(new v.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:f,background:p,cursor:h,cursorAccent:m,selectionForeground:void 0,selectionBackgroundTransparent:b,selectionBackgroundOpaque:_.color.blend(p,b),selectionInactiveBackgroundTransparent:b,selectionInactiveBackgroundOpaque:_.color.blend(p,b),ansi:a.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this.register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}_setTheme(j={}){const S=this._colors;if(S.foreground=k(j.foreground,f),S.background=k(j.background,p),S.cursor=k(j.cursor,h),S.cursorAccent=k(j.cursorAccent,m),S.selectionBackgroundTransparent=k(j.selectionBackground,b),S.selectionBackgroundOpaque=_.color.blend(S.background,S.selectionBackgroundTransparent),S.selectionInactiveBackgroundTransparent=k(j.selectionInactiveBackground,S.selectionBackgroundTransparent),S.selectionInactiveBackgroundOpaque=_.color.blend(S.background,S.selectionInactiveBackgroundTransparent),S.selectionForeground=j.selectionForeground?k(j.selectionForeground,_.NULL_COLOR):void 0,S.selectionForeground===_.NULL_COLOR&&(S.selectionForeground=void 0),_.color.isOpaque(S.selectionBackgroundTransparent)&&(S.selectionBackgroundTransparent=_.color.opacity(S.selectionBackgroundTransparent,.3)),_.color.isOpaque(S.selectionInactiveBackgroundTransparent)&&(S.selectionInactiveBackgroundTransparent=_.color.opacity(S.selectionInactiveBackgroundTransparent,.3)),S.ansi=a.DEFAULT_ANSI_COLORS.slice(),S.ansi[0]=k(j.black,a.DEFAULT_ANSI_COLORS[0]),S.ansi[1]=k(j.red,a.DEFAULT_ANSI_COLORS[1]),S.ansi[2]=k(j.green,a.DEFAULT_ANSI_COLORS[2]),S.ansi[3]=k(j.yellow,a.DEFAULT_ANSI_COLORS[3]),S.ansi[4]=k(j.blue,a.DEFAULT_ANSI_COLORS[4]),S.ansi[5]=k(j.magenta,a.DEFAULT_ANSI_COLORS[5]),S.ansi[6]=k(j.cyan,a.DEFAULT_ANSI_COLORS[6]),S.ansi[7]=k(j.white,a.DEFAULT_ANSI_COLORS[7]),S.ansi[8]=k(j.brightBlack,a.DEFAULT_ANSI_COLORS[8]),S.ansi[9]=k(j.brightRed,a.DEFAULT_ANSI_COLORS[9]),S.ansi[10]=k(j.brightGreen,a.DEFAULT_ANSI_COLORS[10]),S.ansi[11]=k(j.brightYellow,a.DEFAULT_ANSI_COLORS[11]),S.ansi[12]=k(j.brightBlue,a.DEFAULT_ANSI_COLORS[12]),S.ansi[13]=k(j.brightMagenta,a.DEFAULT_ANSI_COLORS[13]),S.ansi[14]=k(j.brightCyan,a.DEFAULT_ANSI_COLORS[14]),S.ansi[15]=k(j.brightWhite,a.DEFAULT_ANSI_COLORS[15]),j.extendedAnsi){const E=Math.min(S.ansi.length-16,j.extendedAnsi.length);for(let R=0;R<E;R++)S.ansi[R+16]=k(j.extendedAnsi[R],a.DEFAULT_ANSI_COLORS[R+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(j){this._restoreColor(j),this._onChangeColors.fire(this.colors)}_restoreColor(j){if(j!==void 0)switch(j){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[j]=this._restoreColors.ansi[j]}else for(let S=0;S<this._restoreColors.ansi.length;++S)this._colors.ansi[S]=this._restoreColors.ansi[S]}modifyColors(j){j(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function k(j,S){if(j!==void 0)try{return _.css.toColor(j)}catch{}return S}a.ThemeService=w=u([g(0,y.IOptionsService)],w)},6349:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CircularList=void 0;const u=c(8460),g=c(844);class d extends g.Disposable{constructor(v){super(),this._maxLength=v,this.onDeleteEmitter=this.register(new u.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new u.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new u.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(v){if(this._maxLength===v)return;const x=new Array(v);for(let y=0;y<Math.min(v,this.length);y++)x[y]=this._array[this._getCyclicIndex(y)];this._array=x,this._maxLength=v,this._startIndex=0}get length(){return this._length}set length(v){if(v>this._length)for(let x=this._length;x<v;x++)this._array[x]=void 0;this._length=v}get(v){return this._array[this._getCyclicIndex(v)]}set(v,x){this._array[this._getCyclicIndex(v)]=x}push(v){this._array[this._getCyclicIndex(this._length)]=v,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(v,x,...y){if(x){for(let f=v;f<this._length-x;f++)this._array[this._getCyclicIndex(f)]=this._array[this._getCyclicIndex(f+x)];this._length-=x,this.onDeleteEmitter.fire({index:v,amount:x})}for(let f=this._length-1;f>=v;f--)this._array[this._getCyclicIndex(f+y.length)]=this._array[this._getCyclicIndex(f)];for(let f=0;f<y.length;f++)this._array[this._getCyclicIndex(v+f)]=y[f];if(y.length&&this.onInsertEmitter.fire({index:v,amount:y.length}),this._length+y.length>this._maxLength){const f=this._length+y.length-this._maxLength;this._startIndex+=f,this._length=this._maxLength,this.onTrimEmitter.fire(f)}else this._length+=y.length}trimStart(v){v>this._length&&(v=this._length),this._startIndex+=v,this._length-=v,this.onTrimEmitter.fire(v)}shiftElements(v,x,y){if(!(x<=0)){if(v<0||v>=this._length)throw new Error("start argument out of range");if(v+y<0)throw new Error("Cannot shift elements in list beyond index 0");if(y>0){for(let p=x-1;p>=0;p--)this.set(v+p+y,this.get(v+p));const f=v+x+y-this._length;if(f>0)for(this._length+=f;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let f=0;f<x;f++)this.set(v+f+y,this.get(v+f))}}_getCyclicIndex(v){return(this._startIndex+v)%this._maxLength}}a.CircularList=d},1439:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.clone=void 0,a.clone=function c(u,g=5){if(typeof u!="object")return u;const d=Array.isArray(u)?[]:{};for(const _ in u)d[_]=g<=1?u[_]:u[_]&&c(u[_],g-1);return d}},8055:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.contrastRatio=a.toPaddedHex=a.rgba=a.rgb=a.css=a.color=a.channels=a.NULL_COLOR=void 0;const u=c(6114);let g=0,d=0,_=0,v=0;var x,y,f,p,h;function m(w){const k=w.toString(16);return k.length<2?"0"+k:k}function b(w,k){return w<k?(k+.05)/(w+.05):(w+.05)/(k+.05)}a.NULL_COLOR={css:"#00000000",rgba:0},function(w){w.toCss=function(k,j,S,E){return E!==void 0?`#${m(k)}${m(j)}${m(S)}${m(E)}`:`#${m(k)}${m(j)}${m(S)}`},w.toRgba=function(k,j,S,E=255){return(k<<24|j<<16|S<<8|E)>>>0}}(x||(a.channels=x={})),function(w){function k(j,S){return v=Math.round(255*S),[g,d,_]=h.toChannels(j.rgba),{css:x.toCss(g,d,_,v),rgba:x.toRgba(g,d,_,v)}}w.blend=function(j,S){if(v=(255&S.rgba)/255,v===1)return{css:S.css,rgba:S.rgba};const E=S.rgba>>24&255,R=S.rgba>>16&255,M=S.rgba>>8&255,A=j.rgba>>24&255,L=j.rgba>>16&255,B=j.rgba>>8&255;return g=A+Math.round((E-A)*v),d=L+Math.round((R-L)*v),_=B+Math.round((M-B)*v),{css:x.toCss(g,d,_),rgba:x.toRgba(g,d,_)}},w.isOpaque=function(j){return(255&j.rgba)==255},w.ensureContrastRatio=function(j,S,E){const R=h.ensureContrastRatio(j.rgba,S.rgba,E);if(R)return h.toColor(R>>24&255,R>>16&255,R>>8&255)},w.opaque=function(j){const S=(255|j.rgba)>>>0;return[g,d,_]=h.toChannels(S),{css:x.toCss(g,d,_),rgba:S}},w.opacity=k,w.multiplyOpacity=function(j,S){return v=255&j.rgba,k(j,v*S/255)},w.toColorRGB=function(j){return[j.rgba>>24&255,j.rgba>>16&255,j.rgba>>8&255]}}(y||(a.color=y={})),function(w){let k,j;if(!u.isNode){const S=document.createElement("canvas");S.width=1,S.height=1;const E=S.getContext("2d",{willReadFrequently:!0});E&&(k=E,k.globalCompositeOperation="copy",j=k.createLinearGradient(0,0,1,1))}w.toColor=function(S){if(S.match(/#[\da-f]{3,8}/i))switch(S.length){case 4:return g=parseInt(S.slice(1,2).repeat(2),16),d=parseInt(S.slice(2,3).repeat(2),16),_=parseInt(S.slice(3,4).repeat(2),16),h.toColor(g,d,_);case 5:return g=parseInt(S.slice(1,2).repeat(2),16),d=parseInt(S.slice(2,3).repeat(2),16),_=parseInt(S.slice(3,4).repeat(2),16),v=parseInt(S.slice(4,5).repeat(2),16),h.toColor(g,d,_,v);case 7:return{css:S,rgba:(parseInt(S.slice(1),16)<<8|255)>>>0};case 9:return{css:S,rgba:parseInt(S.slice(1),16)>>>0}}const E=S.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(E)return g=parseInt(E[1]),d=parseInt(E[2]),_=parseInt(E[3]),v=Math.round(255*(E[5]===void 0?1:parseFloat(E[5]))),h.toColor(g,d,_,v);if(!k||!j)throw new Error("css.toColor: Unsupported css format");if(k.fillStyle=j,k.fillStyle=S,typeof k.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(k.fillRect(0,0,1,1),[g,d,_,v]=k.getImageData(0,0,1,1).data,v!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:x.toRgba(g,d,_,v),css:S}}}(f||(a.css=f={})),function(w){function k(j,S,E){const R=j/255,M=S/255,A=E/255;return .2126*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))+.7152*(M<=.03928?M/12.92:Math.pow((M+.055)/1.055,2.4))+.0722*(A<=.03928?A/12.92:Math.pow((A+.055)/1.055,2.4))}w.relativeLuminance=function(j){return k(j>>16&255,j>>8&255,255&j)},w.relativeLuminance2=k}(p||(a.rgb=p={})),function(w){function k(S,E,R){const M=S>>24&255,A=S>>16&255,L=S>>8&255;let B=E>>24&255,U=E>>16&255,W=E>>8&255,q=b(p.relativeLuminance2(B,U,W),p.relativeLuminance2(M,A,L));for(;q<R&&(B>0||U>0||W>0);)B-=Math.max(0,Math.ceil(.1*B)),U-=Math.max(0,Math.ceil(.1*U)),W-=Math.max(0,Math.ceil(.1*W)),q=b(p.relativeLuminance2(B,U,W),p.relativeLuminance2(M,A,L));return(B<<24|U<<16|W<<8|255)>>>0}function j(S,E,R){const M=S>>24&255,A=S>>16&255,L=S>>8&255;let B=E>>24&255,U=E>>16&255,W=E>>8&255,q=b(p.relativeLuminance2(B,U,W),p.relativeLuminance2(M,A,L));for(;q<R&&(B<255||U<255||W<255);)B=Math.min(255,B+Math.ceil(.1*(255-B))),U=Math.min(255,U+Math.ceil(.1*(255-U))),W=Math.min(255,W+Math.ceil(.1*(255-W))),q=b(p.relativeLuminance2(B,U,W),p.relativeLuminance2(M,A,L));return(B<<24|U<<16|W<<8|255)>>>0}w.ensureContrastRatio=function(S,E,R){const M=p.relativeLuminance(S>>8),A=p.relativeLuminance(E>>8);if(b(M,A)<R){if(A<M){const U=k(S,E,R),W=b(M,p.relativeLuminance(U>>8));if(W<R){const q=j(S,E,R);return W>b(M,p.relativeLuminance(q>>8))?U:q}return U}const L=j(S,E,R),B=b(M,p.relativeLuminance(L>>8));if(B<R){const U=k(S,E,R);return B>b(M,p.relativeLuminance(U>>8))?L:U}return L}},w.reduceLuminance=k,w.increaseLuminance=j,w.toChannels=function(S){return[S>>24&255,S>>16&255,S>>8&255,255&S]},w.toColor=function(S,E,R,M){return{css:x.toCss(S,E,R,M),rgba:x.toRgba(S,E,R,M)}}}(h||(a.rgba=h={})),a.toPaddedHex=m,a.contrastRatio=b},8969:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreTerminal=void 0;const u=c(844),g=c(2585),d=c(4348),_=c(7866),v=c(744),x=c(7302),y=c(6975),f=c(8460),p=c(1753),h=c(1480),m=c(7994),b=c(9282),w=c(5435),k=c(5981),j=c(2660);let S=!1;class E extends u.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new f.EventEmitter),this._onScroll.event(M=>{var A;(A=this._onScrollApi)===null||A===void 0||A.fire(M.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(M){for(const A in M)this.optionsService.options[A]=M[A]}constructor(M){super(),this._windowsWrappingHeuristics=this.register(new u.MutableDisposable),this._onBinary=this.register(new f.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new f.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new f.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new f.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new f.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new f.EventEmitter),this._instantiationService=new d.InstantiationService,this.optionsService=this.register(new x.OptionsService(M)),this._instantiationService.setService(g.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(v.BufferService)),this._instantiationService.setService(g.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(_.LogService)),this._instantiationService.setService(g.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(y.CoreService)),this._instantiationService.setService(g.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(p.CoreMouseService)),this._instantiationService.setService(g.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(h.UnicodeService)),this._instantiationService.setService(g.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(m.CharsetService),this._instantiationService.setService(g.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(j.OscLinkService),this._instantiationService.setService(g.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new w.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,f.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,f.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,f.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,f.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom())),this.register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this.register(this._bufferService.onScroll(A=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this.register(this._inputHandler.onScroll(A=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this.register(new k.WriteBuffer((A,L)=>this._inputHandler.parse(A,L))),this.register((0,f.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(M,A){this._writeBuffer.write(M,A)}writeSync(M,A){this._logService.logLevel<=g.LogLevelEnum.WARN&&!S&&(this._logService.warn("writeSync is unreliable and will be removed soon."),S=!0),this._writeBuffer.writeSync(M,A)}resize(M,A){isNaN(M)||isNaN(A)||(M=Math.max(M,v.MINIMUM_COLS),A=Math.max(A,v.MINIMUM_ROWS),this._bufferService.resize(M,A))}scroll(M,A=!1){this._bufferService.scroll(M,A)}scrollLines(M,A,L){this._bufferService.scrollLines(M,A,L)}scrollPages(M){this.scrollLines(M*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(M){const A=M-this._bufferService.buffer.ydisp;A!==0&&this.scrollLines(A)}registerEscHandler(M,A){return this._inputHandler.registerEscHandler(M,A)}registerDcsHandler(M,A){return this._inputHandler.registerDcsHandler(M,A)}registerCsiHandler(M,A){return this._inputHandler.registerCsiHandler(M,A)}registerOscHandler(M,A){return this._inputHandler.registerOscHandler(M,A)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let M=!1;const A=this.optionsService.rawOptions.windowsPty;A&&A.buildNumber!==void 0&&A.buildNumber!==void 0?M=A.backend==="conpty"&&A.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(M=!0),M?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const M=[];M.push(this.onLineFeed(b.updateWindowsModeWrappedState.bind(null,this._bufferService))),M.push(this.registerCsiHandler({final:"H"},()=>((0,b.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,u.toDisposable)(()=>{for(const A of M)A.dispose()})}}}a.CoreTerminal=E},8460:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.forwardEvent=a.EventEmitter=void 0,a.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let u=0;u<this._listeners.length;u++)if(this._listeners[u]===c)return void this._listeners.splice(u,1)}}})),this._event}fire(c,u){const g=[];for(let d=0;d<this._listeners.length;d++)g.push(this._listeners[d]);for(let d=0;d<g.length;d++)g[d].call(void 0,c,u)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},a.forwardEvent=function(c,u){return c(g=>u.fire(g))}},5435:function(l,a,c){var u=this&&this.__decorate||function(q,N,T,D){var O,$=arguments.length,Y=$<3?N:D===null?D=Object.getOwnPropertyDescriptor(N,T):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Y=Reflect.decorate(q,N,T,D);else for(var J=q.length-1;J>=0;J--)(O=q[J])&&(Y=($<3?O(Y):$>3?O(N,T,Y):O(N,T))||Y);return $>3&&Y&&Object.defineProperty(N,T,Y),Y},g=this&&this.__param||function(q,N){return function(T,D){N(T,D,q)}};Object.defineProperty(a,"__esModule",{value:!0}),a.InputHandler=a.WindowsOptionsReportType=void 0;const d=c(2584),_=c(7116),v=c(2015),x=c(844),y=c(482),f=c(8437),p=c(8460),h=c(643),m=c(511),b=c(3734),w=c(2585),k=c(6242),j=c(6351),S=c(5941),E={"(":0,")":1,"*":2,"+":3,"-":1,".":2},R=131072;function M(q,N){if(q>24)return N.setWinLines||!1;switch(q){case 1:return!!N.restoreWin;case 2:return!!N.minimizeWin;case 3:return!!N.setWinPosition;case 4:return!!N.setWinSizePixels;case 5:return!!N.raiseWin;case 6:return!!N.lowerWin;case 7:return!!N.refreshWin;case 8:return!!N.setWinSizeChars;case 9:return!!N.maximizeWin;case 10:return!!N.fullscreenWin;case 11:return!!N.getWinState;case 13:return!!N.getWinPosition;case 14:return!!N.getWinSizePixels;case 15:return!!N.getScreenSizePixels;case 16:return!!N.getCellSizePixels;case 18:return!!N.getWinSizeChars;case 19:return!!N.getScreenSizeChars;case 20:return!!N.getIconTitle;case 21:return!!N.getWinTitle;case 22:return!!N.pushTitle;case 23:return!!N.popTitle;case 24:return!!N.setWinLines}return!1}var A;(function(q){q[q.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",q[q.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(A||(a.WindowsOptionsReportType=A={}));let L=0;class B extends x.Disposable{getAttrData(){return this._curAttrData}constructor(N,T,D,O,$,Y,J,re,ye=new v.EscapeSequenceParser){super(),this._bufferService=N,this._charsetService=T,this._coreService=D,this._logService=O,this._optionsService=$,this._oscLinkService=Y,this._coreMouseService=J,this._unicodeService=re,this._parser=ye,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new y.StringToUtf32,this._utf8Decoder=new y.Utf8ToUtf32,this._workCell=new m.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=f.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=f.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new p.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new p.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new p.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new p.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new p.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new p.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new p.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new p.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new p.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new p.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new p.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new p.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new p.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new U(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(P=>this._activeBuffer=P.activeBuffer)),this._parser.setCsiHandlerFallback((P,z)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(P),params:z.toArray()})}),this._parser.setEscHandlerFallback(P=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(P)})}),this._parser.setExecuteHandlerFallback(P=>{this._logService.debug("Unknown EXECUTE code: ",{code:P})}),this._parser.setOscHandlerFallback((P,z,G)=>{this._logService.debug("Unknown OSC code: ",{identifier:P,action:z,data:G})}),this._parser.setDcsHandlerFallback((P,z,G)=>{z==="HOOK"&&(G=G.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(P),action:z,payload:G})}),this._parser.setPrintHandler((P,z,G)=>this.print(P,z,G)),this._parser.registerCsiHandler({final:"@"},P=>this.insertChars(P)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},P=>this.scrollLeft(P)),this._parser.registerCsiHandler({final:"A"},P=>this.cursorUp(P)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},P=>this.scrollRight(P)),this._parser.registerCsiHandler({final:"B"},P=>this.cursorDown(P)),this._parser.registerCsiHandler({final:"C"},P=>this.cursorForward(P)),this._parser.registerCsiHandler({final:"D"},P=>this.cursorBackward(P)),this._parser.registerCsiHandler({final:"E"},P=>this.cursorNextLine(P)),this._parser.registerCsiHandler({final:"F"},P=>this.cursorPrecedingLine(P)),this._parser.registerCsiHandler({final:"G"},P=>this.cursorCharAbsolute(P)),this._parser.registerCsiHandler({final:"H"},P=>this.cursorPosition(P)),this._parser.registerCsiHandler({final:"I"},P=>this.cursorForwardTab(P)),this._parser.registerCsiHandler({final:"J"},P=>this.eraseInDisplay(P,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},P=>this.eraseInDisplay(P,!0)),this._parser.registerCsiHandler({final:"K"},P=>this.eraseInLine(P,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},P=>this.eraseInLine(P,!0)),this._parser.registerCsiHandler({final:"L"},P=>this.insertLines(P)),this._parser.registerCsiHandler({final:"M"},P=>this.deleteLines(P)),this._parser.registerCsiHandler({final:"P"},P=>this.deleteChars(P)),this._parser.registerCsiHandler({final:"S"},P=>this.scrollUp(P)),this._parser.registerCsiHandler({final:"T"},P=>this.scrollDown(P)),this._parser.registerCsiHandler({final:"X"},P=>this.eraseChars(P)),this._parser.registerCsiHandler({final:"Z"},P=>this.cursorBackwardTab(P)),this._parser.registerCsiHandler({final:"`"},P=>this.charPosAbsolute(P)),this._parser.registerCsiHandler({final:"a"},P=>this.hPositionRelative(P)),this._parser.registerCsiHandler({final:"b"},P=>this.repeatPrecedingCharacter(P)),this._parser.registerCsiHandler({final:"c"},P=>this.sendDeviceAttributesPrimary(P)),this._parser.registerCsiHandler({prefix:">",final:"c"},P=>this.sendDeviceAttributesSecondary(P)),this._parser.registerCsiHandler({final:"d"},P=>this.linePosAbsolute(P)),this._parser.registerCsiHandler({final:"e"},P=>this.vPositionRelative(P)),this._parser.registerCsiHandler({final:"f"},P=>this.hVPosition(P)),this._parser.registerCsiHandler({final:"g"},P=>this.tabClear(P)),this._parser.registerCsiHandler({final:"h"},P=>this.setMode(P)),this._parser.registerCsiHandler({prefix:"?",final:"h"},P=>this.setModePrivate(P)),this._parser.registerCsiHandler({final:"l"},P=>this.resetMode(P)),this._parser.registerCsiHandler({prefix:"?",final:"l"},P=>this.resetModePrivate(P)),this._parser.registerCsiHandler({final:"m"},P=>this.charAttributes(P)),this._parser.registerCsiHandler({final:"n"},P=>this.deviceStatus(P)),this._parser.registerCsiHandler({prefix:"?",final:"n"},P=>this.deviceStatusPrivate(P)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},P=>this.softReset(P)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},P=>this.setCursorStyle(P)),this._parser.registerCsiHandler({final:"r"},P=>this.setScrollRegion(P)),this._parser.registerCsiHandler({final:"s"},P=>this.saveCursor(P)),this._parser.registerCsiHandler({final:"t"},P=>this.windowOptions(P)),this._parser.registerCsiHandler({final:"u"},P=>this.restoreCursor(P)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},P=>this.insertColumns(P)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},P=>this.deleteColumns(P)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},P=>this.selectProtected(P)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},P=>this.requestMode(P,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},P=>this.requestMode(P,!1)),this._parser.setExecuteHandler(d.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(d.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(d.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(d.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(d.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(d.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(d.C1.IND,()=>this.index()),this._parser.setExecuteHandler(d.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(d.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new k.OscHandler(P=>(this.setTitle(P),this.setIconName(P),!0))),this._parser.registerOscHandler(1,new k.OscHandler(P=>this.setIconName(P))),this._parser.registerOscHandler(2,new k.OscHandler(P=>this.setTitle(P))),this._parser.registerOscHandler(4,new k.OscHandler(P=>this.setOrReportIndexedColor(P))),this._parser.registerOscHandler(8,new k.OscHandler(P=>this.setHyperlink(P))),this._parser.registerOscHandler(10,new k.OscHandler(P=>this.setOrReportFgColor(P))),this._parser.registerOscHandler(11,new k.OscHandler(P=>this.setOrReportBgColor(P))),this._parser.registerOscHandler(12,new k.OscHandler(P=>this.setOrReportCursorColor(P))),this._parser.registerOscHandler(104,new k.OscHandler(P=>this.restoreIndexedColor(P))),this._parser.registerOscHandler(110,new k.OscHandler(P=>this.restoreFgColor(P))),this._parser.registerOscHandler(111,new k.OscHandler(P=>this.restoreBgColor(P))),this._parser.registerOscHandler(112,new k.OscHandler(P=>this.restoreCursorColor(P))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(const P in _.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:P},()=>this.selectCharset("("+P)),this._parser.registerEscHandler({intermediates:")",final:P},()=>this.selectCharset(")"+P)),this._parser.registerEscHandler({intermediates:"*",final:P},()=>this.selectCharset("*"+P)),this._parser.registerEscHandler({intermediates:"+",final:P},()=>this.selectCharset("+"+P)),this._parser.registerEscHandler({intermediates:"-",final:P},()=>this.selectCharset("-"+P)),this._parser.registerEscHandler({intermediates:".",final:P},()=>this.selectCharset("."+P)),this._parser.registerEscHandler({intermediates:"/",final:P},()=>this.selectCharset("/"+P));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(P=>(this._logService.error("Parsing error: ",P),P)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new j.DcsHandler((P,z)=>this.requestStatusString(P,z)))}_preserveStack(N,T,D,O){this._parseStack.paused=!0,this._parseStack.cursorStartX=N,this._parseStack.cursorStartY=T,this._parseStack.decodedLength=D,this._parseStack.position=O}_logSlowResolvingAsync(N){this._logService.logLevel<=w.LogLevelEnum.WARN&&Promise.race([N,new Promise((T,D)=>setTimeout(()=>D("#SLOW_TIMEOUT"),5e3))]).catch(T=>{if(T!=="#SLOW_TIMEOUT")throw T;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(N,T){let D,O=this._activeBuffer.x,$=this._activeBuffer.y,Y=0;const J=this._parseStack.paused;if(J){if(D=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,T))return this._logSlowResolvingAsync(D),D;O=this._parseStack.cursorStartX,$=this._parseStack.cursorStartY,this._parseStack.paused=!1,N.length>R&&(Y=this._parseStack.position+R)}if(this._logService.logLevel<=w.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof N=="string"?` "${N}"`:` "${Array.prototype.map.call(N,re=>String.fromCharCode(re)).join("")}"`),typeof N=="string"?N.split("").map(re=>re.charCodeAt(0)):N),this._parseBuffer.length<N.length&&this._parseBuffer.length<R&&(this._parseBuffer=new Uint32Array(Math.min(N.length,R))),J||this._dirtyRowTracker.clearRange(),N.length>R)for(let re=Y;re<N.length;re+=R){const ye=re+R<N.length?re+R:N.length,P=typeof N=="string"?this._stringDecoder.decode(N.substring(re,ye),this._parseBuffer):this._utf8Decoder.decode(N.subarray(re,ye),this._parseBuffer);if(D=this._parser.parse(this._parseBuffer,P))return this._preserveStack(O,$,P,re),this._logSlowResolvingAsync(D),D}else if(!J){const re=typeof N=="string"?this._stringDecoder.decode(N,this._parseBuffer):this._utf8Decoder.decode(N,this._parseBuffer);if(D=this._parser.parse(this._parseBuffer,re))return this._preserveStack(O,$,re,0),this._logSlowResolvingAsync(D),D}this._activeBuffer.x===O&&this._activeBuffer.y===$||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowTracker.start,this._dirtyRowTracker.end)}print(N,T,D){let O,$;const Y=this._charsetService.charset,J=this._optionsService.rawOptions.screenReaderMode,re=this._bufferService.cols,ye=this._coreService.decPrivateModes.wraparound,P=this._coreService.modes.insertMode,z=this._curAttrData;let G=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&D-T>0&&G.getWidth(this._activeBuffer.x-1)===2&&G.setCellFromCodePoint(this._activeBuffer.x-1,0,1,z.fg,z.bg,z.extended);for(let K=T;K<D;++K){if(O=N[K],$=this._unicodeService.wcwidth(O),O<127&&Y){const Q=Y[String.fromCharCode(O)];Q&&(O=Q.charCodeAt(0))}if(J&&this._onA11yChar.fire((0,y.stringFromCodePoint)(O)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),$||!this._activeBuffer.x){if(this._activeBuffer.x+$-1>=re){if(ye){for(;this._activeBuffer.x<re;)G.setCellFromCodePoint(this._activeBuffer.x++,0,1,z.fg,z.bg,z.extended);this._activeBuffer.x=0,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),G=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=re-1,$===2)continue}if(P&&(G.insertCells(this._activeBuffer.x,$,this._activeBuffer.getNullCell(z),z),G.getWidth(re-1)===2&&G.setCellFromCodePoint(re-1,h.NULL_CELL_CODE,h.NULL_CELL_WIDTH,z.fg,z.bg,z.extended)),G.setCellFromCodePoint(this._activeBuffer.x++,O,$,z.fg,z.bg,z.extended),$>0)for(;--$;)G.setCellFromCodePoint(this._activeBuffer.x++,0,0,z.fg,z.bg,z.extended)}else G.getWidth(this._activeBuffer.x-1)?G.addCodepointToCell(this._activeBuffer.x-1,O):G.addCodepointToCell(this._activeBuffer.x-2,O)}D-T>0&&(G.loadCell(this._activeBuffer.x-1,this._workCell),this._workCell.getWidth()===2||this._workCell.getCode()>65535?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),this._activeBuffer.x<re&&D-T>0&&G.getWidth(this._activeBuffer.x)===0&&!G.hasContent(this._activeBuffer.x)&&G.setCellFromCodePoint(this._activeBuffer.x,0,1,z.fg,z.bg,z.extended),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(N,T){return N.final!=="t"||N.prefix||N.intermediates?this._parser.registerCsiHandler(N,T):this._parser.registerCsiHandler(N,D=>!M(D.params[0],this._optionsService.rawOptions.windowOptions)||T(D))}registerDcsHandler(N,T){return this._parser.registerDcsHandler(N,new j.DcsHandler(T))}registerEscHandler(N,T){return this._parser.registerEscHandler(N,T)}registerOscHandler(N,T){return this._parser.registerOscHandler(N,new k.OscHandler(T))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var N;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&(!((N=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))===null||N===void 0)&&N.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);T.hasWidth(this._activeBuffer.x)&&!T.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const N=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-N),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(N=this._bufferService.cols-1){this._activeBuffer.x=Math.min(N,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(N,T){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=N,this._activeBuffer.y=this._activeBuffer.scrollTop+T):(this._activeBuffer.x=N,this._activeBuffer.y=T),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(N,T){this._restrictCursor(),this._setCursor(this._activeBuffer.x+N,this._activeBuffer.y+T)}cursorUp(N){const T=this._activeBuffer.y-this._activeBuffer.scrollTop;return T>=0?this._moveCursor(0,-Math.min(T,N.params[0]||1)):this._moveCursor(0,-(N.params[0]||1)),!0}cursorDown(N){const T=this._activeBuffer.scrollBottom-this._activeBuffer.y;return T>=0?this._moveCursor(0,Math.min(T,N.params[0]||1)):this._moveCursor(0,N.params[0]||1),!0}cursorForward(N){return this._moveCursor(N.params[0]||1,0),!0}cursorBackward(N){return this._moveCursor(-(N.params[0]||1),0),!0}cursorNextLine(N){return this.cursorDown(N),this._activeBuffer.x=0,!0}cursorPrecedingLine(N){return this.cursorUp(N),this._activeBuffer.x=0,!0}cursorCharAbsolute(N){return this._setCursor((N.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(N){return this._setCursor(N.length>=2?(N.params[1]||1)-1:0,(N.params[0]||1)-1),!0}charPosAbsolute(N){return this._setCursor((N.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(N){return this._moveCursor(N.params[0]||1,0),!0}linePosAbsolute(N){return this._setCursor(this._activeBuffer.x,(N.params[0]||1)-1),!0}vPositionRelative(N){return this._moveCursor(0,N.params[0]||1),!0}hVPosition(N){return this.cursorPosition(N),!0}tabClear(N){const T=N.params[0];return T===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:T===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(N){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let T=N.params[0]||1;for(;T--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(N){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let T=N.params[0]||1;for(;T--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(N){const T=N.params[0];return T===1&&(this._curAttrData.bg|=536870912),T!==2&&T!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(N,T,D,O=!1,$=!1){const Y=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);Y.replaceCells(T,D,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),$),O&&(Y.isWrapped=!1)}_resetBufferLine(N,T=!1){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);D&&(D.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),T),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+N),D.isWrapped=!1)}eraseInDisplay(N,T=!1){let D;switch(this._restrictCursor(this._bufferService.cols),N.params[0]){case 0:for(D=this._activeBuffer.y,this._dirtyRowTracker.markDirty(D),this._eraseInBufferLine(D++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,T);D<this._bufferService.rows;D++)this._resetBufferLine(D,T);this._dirtyRowTracker.markDirty(D);break;case 1:for(D=this._activeBuffer.y,this._dirtyRowTracker.markDirty(D),this._eraseInBufferLine(D,0,this._activeBuffer.x+1,!0,T),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(D+1).isWrapped=!1);D--;)this._resetBufferLine(D,T);this._dirtyRowTracker.markDirty(0);break;case 2:for(D=this._bufferService.rows,this._dirtyRowTracker.markDirty(D-1);D--;)this._resetBufferLine(D,T);this._dirtyRowTracker.markDirty(0);break;case 3:const O=this._activeBuffer.lines.length-this._bufferService.rows;O>0&&(this._activeBuffer.lines.trimStart(O),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-O,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-O,0),this._onScroll.fire(0))}return!0}eraseInLine(N,T=!1){switch(this._restrictCursor(this._bufferService.cols),N.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,T);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,T);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,T)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(N){this._restrictCursor();let T=N.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=this._activeBuffer.ybase+this._activeBuffer.y,O=this._bufferService.rows-1-this._activeBuffer.scrollBottom,$=this._bufferService.rows-1+this._activeBuffer.ybase-O+1;for(;T--;)this._activeBuffer.lines.splice($-1,1),this._activeBuffer.lines.splice(D,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(N){this._restrictCursor();let T=N.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=this._activeBuffer.ybase+this._activeBuffer.y;let O;for(O=this._bufferService.rows-1-this._activeBuffer.scrollBottom,O=this._bufferService.rows-1+this._activeBuffer.ybase-O;T--;)this._activeBuffer.lines.splice(D,1),this._activeBuffer.lines.splice(O,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(N){this._restrictCursor();const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return T&&(T.insertCells(this._activeBuffer.x,N.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(N){this._restrictCursor();const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return T&&(T.deleteCells(this._activeBuffer.x,N.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(N){let T=N.params[0]||1;for(;T--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(N){let T=N.params[0]||1;for(;T--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(f.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=N.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);O.deleteCells(0,T,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=N.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);O.insertCells(0,T,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=N.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);O.insertCells(this._activeBuffer.x,T,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=N.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);O.deleteCells(this._activeBuffer.x,T,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(N){this._restrictCursor();const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return T&&(T.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(N.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(N){if(!this._parser.precedingCodepoint)return!0;const T=N.params[0]||1,D=new Uint32Array(T);for(let O=0;O<T;++O)D[O]=this._parser.precedingCodepoint;return this.print(D,0,D.length),!0}sendDeviceAttributesPrimary(N){return N.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(d.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(d.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(N){return N.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(d.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(d.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(N.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(N){return(this._optionsService.rawOptions.termName+"").indexOf(N)===0}setMode(N){for(let T=0;T<N.length;T++)switch(N.params[T]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(N){for(let T=0;T<N.length;T++)switch(N.params[T]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,_.DEFAULT_CHARSET),this._charsetService.setgCharset(1,_.DEFAULT_CHARSET),this._charsetService.setgCharset(2,_.DEFAULT_CHARSET),this._charsetService.setgCharset(3,_.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(N){for(let T=0;T<N.length;T++)switch(N.params[T]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(N){for(let T=0;T<N.length;T++)switch(N.params[T]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),N.params[T]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(N,T){const D=this._coreService.decPrivateModes,{activeProtocol:O,activeEncoding:$}=this._coreMouseService,Y=this._coreService,{buffers:J,cols:re}=this._bufferService,{active:ye,alt:P}=J,z=this._optionsService.rawOptions,G=de=>de?1:2,K=N.params[0];return Q=K,ee=T?K===2?4:K===4?G(Y.modes.insertMode):K===12?3:K===20?G(z.convertEol):0:K===1?G(D.applicationCursorKeys):K===3?z.windowOptions.setWinLines?re===80?2:re===132?1:0:0:K===6?G(D.origin):K===7?G(D.wraparound):K===8?3:K===9?G(O==="X10"):K===12?G(z.cursorBlink):K===25?G(!Y.isCursorHidden):K===45?G(D.reverseWraparound):K===66?G(D.applicationKeypad):K===67?4:K===1e3?G(O==="VT200"):K===1002?G(O==="DRAG"):K===1003?G(O==="ANY"):K===1004?G(D.sendFocus):K===1005?4:K===1006?G($==="SGR"):K===1015?4:K===1016?G($==="SGR_PIXELS"):K===1048?1:K===47||K===1047||K===1049?G(ye===P):K===2004?G(D.bracketedPasteMode):0,Y.triggerDataEvent(`${d.C0.ESC}[${T?"":"?"}${Q};${ee}$y`),!0;var Q,ee}_updateAttrColor(N,T,D,O,$){return T===2?(N|=50331648,N&=-16777216,N|=b.AttributeData.fromColorRGB([D,O,$])):T===5&&(N&=-50331904,N|=33554432|255&D),N}_extractColor(N,T,D){const O=[0,0,-1,0,0,0];let $=0,Y=0;do{if(O[Y+$]=N.params[T+Y],N.hasSubParams(T+Y)){const J=N.getSubParams(T+Y);let re=0;do O[1]===5&&($=1),O[Y+re+1+$]=J[re];while(++re<J.length&&re+Y+1+$<O.length);break}if(O[1]===5&&Y+$>=2||O[1]===2&&Y+$>=5)break;O[1]&&($=1)}while(++Y+T<N.length&&Y+$<O.length);for(let J=2;J<O.length;++J)O[J]===-1&&(O[J]=0);switch(O[0]){case 38:D.fg=this._updateAttrColor(D.fg,O[1],O[3],O[4],O[5]);break;case 48:D.bg=this._updateAttrColor(D.bg,O[1],O[3],O[4],O[5]);break;case 58:D.extended=D.extended.clone(),D.extended.underlineColor=this._updateAttrColor(D.extended.underlineColor,O[1],O[3],O[4],O[5])}return Y}_processUnderline(N,T){T.extended=T.extended.clone(),(!~N||N>5)&&(N=1),T.extended.underlineStyle=N,T.fg|=268435456,N===0&&(T.fg&=-268435457),T.updateExtended()}_processSGR0(N){N.fg=f.DEFAULT_ATTR_DATA.fg,N.bg=f.DEFAULT_ATTR_DATA.bg,N.extended=N.extended.clone(),N.extended.underlineStyle=0,N.extended.underlineColor&=-67108864,N.updateExtended()}charAttributes(N){if(N.length===1&&N.params[0]===0)return this._processSGR0(this._curAttrData),!0;const T=N.length;let D;const O=this._curAttrData;for(let $=0;$<T;$++)D=N.params[$],D>=30&&D<=37?(O.fg&=-50331904,O.fg|=16777216|D-30):D>=40&&D<=47?(O.bg&=-50331904,O.bg|=16777216|D-40):D>=90&&D<=97?(O.fg&=-50331904,O.fg|=16777224|D-90):D>=100&&D<=107?(O.bg&=-50331904,O.bg|=16777224|D-100):D===0?this._processSGR0(O):D===1?O.fg|=134217728:D===3?O.bg|=67108864:D===4?(O.fg|=268435456,this._processUnderline(N.hasSubParams($)?N.getSubParams($)[0]:1,O)):D===5?O.fg|=536870912:D===7?O.fg|=67108864:D===8?O.fg|=1073741824:D===9?O.fg|=2147483648:D===2?O.bg|=134217728:D===21?this._processUnderline(2,O):D===22?(O.fg&=-134217729,O.bg&=-134217729):D===23?O.bg&=-67108865:D===24?(O.fg&=-268435457,this._processUnderline(0,O)):D===25?O.fg&=-536870913:D===27?O.fg&=-67108865:D===28?O.fg&=-1073741825:D===29?O.fg&=2147483647:D===39?(O.fg&=-67108864,O.fg|=16777215&f.DEFAULT_ATTR_DATA.fg):D===49?(O.bg&=-67108864,O.bg|=16777215&f.DEFAULT_ATTR_DATA.bg):D===38||D===48||D===58?$+=this._extractColor(N,$,O):D===53?O.bg|=1073741824:D===55?O.bg&=-1073741825:D===59?(O.extended=O.extended.clone(),O.extended.underlineColor=-1,O.updateExtended()):D===100?(O.fg&=-67108864,O.fg|=16777215&f.DEFAULT_ATTR_DATA.fg,O.bg&=-67108864,O.bg|=16777215&f.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",D);return!0}deviceStatus(N){switch(N.params[0]){case 5:this._coreService.triggerDataEvent(`${d.C0.ESC}[0n`);break;case 6:const T=this._activeBuffer.y+1,D=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${T};${D}R`)}return!0}deviceStatusPrivate(N){if(N.params[0]===6){const T=this._activeBuffer.y+1,D=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${T};${D}R`)}return!0}softReset(N){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=f.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(N){const T=N.params[0]||1;switch(T){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const D=T%2==1;return this._optionsService.options.cursorBlink=D,!0}setScrollRegion(N){const T=N.params[0]||1;let D;return(N.length<2||(D=N.params[1])>this._bufferService.rows||D===0)&&(D=this._bufferService.rows),D>T&&(this._activeBuffer.scrollTop=T-1,this._activeBuffer.scrollBottom=D-1,this._setCursor(0,0)),!0}windowOptions(N){if(!M(N.params[0],this._optionsService.rawOptions.windowOptions))return!0;const T=N.length>1?N.params[1]:0;switch(N.params[0]){case 14:T!==2&&this._onRequestWindowsOptionsReport.fire(A.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(A.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${d.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:T!==0&&T!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),T!==0&&T!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:T!==0&&T!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),T!==0&&T!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(N){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(N){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(N){return this._windowTitle=N,this._onTitleChange.fire(N),!0}setIconName(N){return this._iconName=N,!0}setOrReportIndexedColor(N){const T=[],D=N.split(";");for(;D.length>1;){const O=D.shift(),$=D.shift();if(/^\d+$/.exec(O)){const Y=parseInt(O);if(W(Y))if($==="?")T.push({type:0,index:Y});else{const J=(0,S.parseColor)($);J&&T.push({type:1,index:Y,color:J})}}}return T.length&&this._onColor.fire(T),!0}setHyperlink(N){const T=N.split(";");return!(T.length<2)&&(T[1]?this._createHyperlink(T[0],T[1]):!T[0]&&this._finishHyperlink())}_createHyperlink(N,T){this._getCurrentLinkId()&&this._finishHyperlink();const D=N.split(":");let O;const $=D.findIndex(Y=>Y.startsWith("id="));return $!==-1&&(O=D[$].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:O,uri:T}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(N,T){const D=N.split(";");for(let O=0;O<D.length&&!(T>=this._specialColors.length);++O,++T)if(D[O]==="?")this._onColor.fire([{type:0,index:this._specialColors[T]}]);else{const $=(0,S.parseColor)(D[O]);$&&this._onColor.fire([{type:1,index:this._specialColors[T],color:$}])}return!0}setOrReportFgColor(N){return this._setOrReportSpecialColor(N,0)}setOrReportBgColor(N){return this._setOrReportSpecialColor(N,1)}setOrReportCursorColor(N){return this._setOrReportSpecialColor(N,2)}restoreIndexedColor(N){if(!N)return this._onColor.fire([{type:2}]),!0;const T=[],D=N.split(";");for(let O=0;O<D.length;++O)if(/^\d+$/.exec(D[O])){const $=parseInt(D[O]);W($)&&T.push({type:2,index:$})}return T.length&&this._onColor.fire(T),!0}restoreFgColor(N){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(N){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(N){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,_.DEFAULT_CHARSET),!0}selectCharset(N){return N.length!==2?(this.selectDefaultCharset(),!0):(N[0]==="/"||this._charsetService.setgCharset(E[N[0]],_.CHARSETS[N[1]]||_.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const N=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,N,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=f.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=f.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(N){return this._charsetService.setgLevel(N),!0}screenAlignmentPattern(){const N=new m.CellData;N.content=4194373,N.fg=this._curAttrData.fg,N.bg=this._curAttrData.bg,this._setCursor(0,0);for(let T=0;T<this._bufferService.rows;++T){const D=this._activeBuffer.ybase+this._activeBuffer.y+T,O=this._activeBuffer.lines.get(D);O&&(O.fill(N),O.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(N,T){const D=this._bufferService.buffer,O=this._optionsService.rawOptions;return($=>(this._coreService.triggerDataEvent(`${d.C0.ESC}${$}${d.C0.ESC}\\`),!0))(N==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:N==='"p'?'P1$r61;1"p':N==="r"?`P1$r${D.scrollTop+1};${D.scrollBottom+1}r`:N==="m"?"P1$r0m":N===" q"?`P1$r${{block:2,underline:4,bar:6}[O.cursorStyle]-(O.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(N,T){this._dirtyRowTracker.markRangeDirty(N,T)}}a.InputHandler=B;let U=class{constructor(q){this._bufferService=q,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(q){q<this.start?this.start=q:q>this.end&&(this.end=q)}markRangeDirty(q,N){q>N&&(L=q,q=N,N=L),q<this.start&&(this.start=q),N>this.end&&(this.end=N)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function W(q){return 0<=q&&q<256}U=u([g(0,w.IBufferService)],U)},844:(l,a)=>{function c(u){for(const g of u)g.dispose();u.length=0}Object.defineProperty(a,"__esModule",{value:!0}),a.getDisposeArrayDisposable=a.disposeArray=a.toDisposable=a.MutableDisposable=a.Disposable=void 0,a.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const u of this._disposables)u.dispose();this._disposables.length=0}register(u){return this._disposables.push(u),u}unregister(u){const g=this._disposables.indexOf(u);g!==-1&&this._disposables.splice(g,1)}},a.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(u){var g;this._isDisposed||u===this._value||((g=this._value)===null||g===void 0||g.dispose(),this._value=u)}clear(){this.value=void 0}dispose(){var u;this._isDisposed=!0,(u=this._value)===null||u===void 0||u.dispose(),this._value=void 0}},a.toDisposable=function(u){return{dispose:u}},a.disposeArray=c,a.getDisposeArrayDisposable=function(u){return{dispose:()=>c(u)}}},1505:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.FourKeyMap=a.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(g,d,_){this._data[g]||(this._data[g]={}),this._data[g][d]=_}get(g,d){return this._data[g]?this._data[g][d]:void 0}clear(){this._data={}}}a.TwoKeyMap=c,a.FourKeyMap=class{constructor(){this._data=new c}set(u,g,d,_,v){this._data.get(u,g)||this._data.set(u,g,new c),this._data.get(u,g).set(d,_,v)}get(u,g,d,_){var v;return(v=this._data.get(u,g))===null||v===void 0?void 0:v.get(d,_)}clear(){this._data.clear()}}},6114:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.isChromeOS=a.isLinux=a.isWindows=a.isIphone=a.isIpad=a.isMac=a.getSafariVersion=a.isSafari=a.isLegacyEdge=a.isFirefox=a.isNode=void 0,a.isNode=typeof navigator>"u";const c=a.isNode?"node":navigator.userAgent,u=a.isNode?"node":navigator.platform;a.isFirefox=c.includes("Firefox"),a.isLegacyEdge=c.includes("Edge"),a.isSafari=/^((?!chrome|android).)*safari/i.test(c),a.getSafariVersion=function(){if(!a.isSafari)return 0;const g=c.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[1])},a.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(u),a.isIpad=u==="iPad",a.isIphone=u==="iPhone",a.isWindows=["Windows","Win16","Win32","WinCE"].includes(u),a.isLinux=u.indexOf("Linux")>=0,a.isChromeOS=/\bCrOS\b/.test(c)},6106:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SortedList=void 0;let c=0;a.SortedList=class{constructor(u){this._getKey=u,this._array=[]}clear(){this._array.length=0}insert(u){this._array.length!==0?(c=this._search(this._getKey(u)),this._array.splice(c,0,u)):this._array.push(u)}delete(u){if(this._array.length===0)return!1;const g=this._getKey(u);if(g===void 0||(c=this._search(g),c===-1)||this._getKey(this._array[c])!==g)return!1;do if(this._array[c]===u)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===g);return!1}*getKeyIterator(u){if(this._array.length!==0&&(c=this._search(u),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===u))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===u)}forEachByKey(u,g){if(this._array.length!==0&&(c=this._search(u),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===u))do g(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===u)}values(){return[...this._array].values()}_search(u){let g=0,d=this._array.length-1;for(;d>=g;){let _=g+d>>1;const v=this._getKey(this._array[_]);if(v>u)d=_-1;else{if(!(v<u)){for(;_>0&&this._getKey(this._array[_-1])===u;)_--;return _}g=_+1}}return g}}},7226:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DebouncedIdleTask=a.IdleTaskQueue=a.PriorityTaskQueue=void 0;const u=c(6114);class g{constructor(){this._tasks=[],this._i=0}enqueue(v){this._tasks.push(v),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(v){this._idleCallback=void 0;let x=0,y=0,f=v.timeRemaining(),p=0;for(;this._i<this._tasks.length;){if(x=Date.now(),this._tasks[this._i]()||this._i++,x=Math.max(1,Date.now()-x),y=Math.max(x,y),p=v.timeRemaining(),1.5*y>p)return f-x<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(f-x))}ms`),void this._start();f=p}this.clear()}}class d extends g{_requestCallback(v){return setTimeout(()=>v(this._createDeadline(16)))}_cancelCallback(v){clearTimeout(v)}_createDeadline(v){const x=Date.now()+v;return{timeRemaining:()=>Math.max(0,x-Date.now())}}}a.PriorityTaskQueue=d,a.IdleTaskQueue=!u.isNode&&"requestIdleCallback"in window?class extends g{_requestCallback(_){return requestIdleCallback(_)}_cancelCallback(_){cancelIdleCallback(_)}}:d,a.DebouncedIdleTask=class{constructor(){this._queue=new a.IdleTaskQueue}set(_){this._queue.clear(),this._queue.enqueue(_)}flush(){this._queue.flush()}}},9282:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.updateWindowsModeWrappedState=void 0;const u=c(643);a.updateWindowsModeWrappedState=function(g){const d=g.buffer.lines.get(g.buffer.ybase+g.buffer.y-1),_=d==null?void 0:d.get(g.cols-1),v=g.buffer.lines.get(g.buffer.ybase+g.buffer.y);v&&_&&(v.isWrapped=_[u.CHAR_DATA_CODE_INDEX]!==u.NULL_CELL_CODE&&_[u.CHAR_DATA_CODE_INDEX]!==u.WHITESPACE_CELL_CODE)}},3734:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ExtendedAttrs=a.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new u}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new c;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}}a.AttributeData=c;class u{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}constructor(d=0,_=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=_}clone(){return new u(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}a.ExtendedAttrs=u},9092:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Buffer=a.MAX_BUFFER_SIZE=void 0;const u=c(6349),g=c(7226),d=c(3734),_=c(8437),v=c(4634),x=c(511),y=c(643),f=c(4863),p=c(7116);a.MAX_BUFFER_SIZE=4294967295,a.Buffer=class{constructor(h,m,b){this._hasScrollback=h,this._optionsService=m,this._bufferService=b,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=_.DEFAULT_ATTR_DATA.clone(),this.savedCharset=p.DEFAULT_CHARSET,this.markers=[],this._nullCell=x.CellData.fromCharData([0,y.NULL_CELL_CHAR,y.NULL_CELL_WIDTH,y.NULL_CELL_CODE]),this._whitespaceCell=x.CellData.fromCharData([0,y.WHITESPACE_CELL_CHAR,y.WHITESPACE_CELL_WIDTH,y.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new g.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(h){return h?(this._nullCell.fg=h.fg,this._nullCell.bg=h.bg,this._nullCell.extended=h.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new d.ExtendedAttrs),this._nullCell}getWhitespaceCell(h){return h?(this._whitespaceCell.fg=h.fg,this._whitespaceCell.bg=h.bg,this._whitespaceCell.extended=h.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new d.ExtendedAttrs),this._whitespaceCell}getBlankLine(h,m){return new _.BufferLine(this._bufferService.cols,this.getNullCell(h),m)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const h=this.ybase+this.y-this.ydisp;return h>=0&&h<this._rows}_getCorrectBufferLength(h){if(!this._hasScrollback)return h;const m=h+this._optionsService.rawOptions.scrollback;return m>a.MAX_BUFFER_SIZE?a.MAX_BUFFER_SIZE:m}fillViewportRows(h){if(this.lines.length===0){h===void 0&&(h=_.DEFAULT_ATTR_DATA);let m=this._rows;for(;m--;)this.lines.push(this.getBlankLine(h))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(h,m){const b=this.getNullCell(_.DEFAULT_ATTR_DATA);let w=0;const k=this._getCorrectBufferLength(m);if(k>this.lines.maxLength&&(this.lines.maxLength=k),this.lines.length>0){if(this._cols<h)for(let S=0;S<this.lines.length;S++)w+=+this.lines.get(S).resize(h,b);let j=0;if(this._rows<m)for(let S=this._rows;S<m;S++)this.lines.length<m+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new _.BufferLine(h,b)):this.ybase>0&&this.lines.length<=this.ybase+this.y+j+1?(this.ybase--,j++,this.ydisp>0&&this.ydisp--):this.lines.push(new _.BufferLine(h,b)));else for(let S=this._rows;S>m;S--)this.lines.length>m+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(k<this.lines.maxLength){const S=this.lines.length-k;S>0&&(this.lines.trimStart(S),this.ybase=Math.max(this.ybase-S,0),this.ydisp=Math.max(this.ydisp-S,0),this.savedY=Math.max(this.savedY-S,0)),this.lines.maxLength=k}this.x=Math.min(this.x,h-1),this.y=Math.min(this.y,m-1),j&&(this.y+=j),this.savedX=Math.min(this.savedX,h-1),this.scrollTop=0}if(this.scrollBottom=m-1,this._isReflowEnabled&&(this._reflow(h,m),this._cols>h))for(let j=0;j<this.lines.length;j++)w+=+this.lines.get(j).resize(h,b);this._cols=h,this._rows=m,this._memoryCleanupQueue.clear(),w>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let h=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,h=!1);let m=0;for(;this._memoryCleanupPosition<this.lines.length;)if(m+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),m>100)return!0;return h}get _isReflowEnabled(){const h=this._optionsService.rawOptions.windowsPty;return h&&h.buildNumber?this._hasScrollback&&h.backend==="conpty"&&h.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(h,m){this._cols!==h&&(h>this._cols?this._reflowLarger(h,m):this._reflowSmaller(h,m))}_reflowLarger(h,m){const b=(0,v.reflowLargerGetLinesToRemove)(this.lines,this._cols,h,this.ybase+this.y,this.getNullCell(_.DEFAULT_ATTR_DATA));if(b.length>0){const w=(0,v.reflowLargerCreateNewLayout)(this.lines,b);(0,v.reflowLargerApplyNewLayout)(this.lines,w.layout),this._reflowLargerAdjustViewport(h,m,w.countRemoved)}}_reflowLargerAdjustViewport(h,m,b){const w=this.getNullCell(_.DEFAULT_ATTR_DATA);let k=b;for(;k-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<m&&this.lines.push(new _.BufferLine(h,w))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-b,0)}_reflowSmaller(h,m){const b=this.getNullCell(_.DEFAULT_ATTR_DATA),w=[];let k=0;for(let j=this.lines.length-1;j>=0;j--){let S=this.lines.get(j);if(!S||!S.isWrapped&&S.getTrimmedLength()<=h)continue;const E=[S];for(;S.isWrapped&&j>0;)S=this.lines.get(--j),E.unshift(S);const R=this.ybase+this.y;if(R>=j&&R<j+E.length)continue;const M=E[E.length-1].getTrimmedLength(),A=(0,v.reflowSmallerGetNewLineLengths)(E,this._cols,h),L=A.length-E.length;let B;B=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+L):Math.max(0,this.lines.length-this.lines.maxLength+L);const U=[];for(let O=0;O<L;O++){const $=this.getBlankLine(_.DEFAULT_ATTR_DATA,!0);U.push($)}U.length>0&&(w.push({start:j+E.length+k,newLines:U}),k+=U.length),E.push(...U);let W=A.length-1,q=A[W];q===0&&(W--,q=A[W]);let N=E.length-L-1,T=M;for(;N>=0;){const O=Math.min(T,q);if(E[W]===void 0)break;if(E[W].copyCellsFrom(E[N],T-O,q-O,O,!0),q-=O,q===0&&(W--,q=A[W]),T-=O,T===0){N--;const $=Math.max(N,0);T=(0,v.getWrappedLineTrimmedLength)(E,$,this._cols)}}for(let O=0;O<E.length;O++)A[O]<h&&E[O].setCell(A[O],b);let D=L-B;for(;D-- >0;)this.ybase===0?this.y<m-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+k)-m&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+L,this.ybase+m-1)}if(w.length>0){const j=[],S=[];for(let W=0;W<this.lines.length;W++)S.push(this.lines.get(W));const E=this.lines.length;let R=E-1,M=0,A=w[M];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+k);let L=0;for(let W=Math.min(this.lines.maxLength-1,E+k-1);W>=0;W--)if(A&&A.start>R+L){for(let q=A.newLines.length-1;q>=0;q--)this.lines.set(W--,A.newLines[q]);W++,j.push({index:R+1,amount:A.newLines.length}),L+=A.newLines.length,A=w[++M]}else this.lines.set(W,S[R--]);let B=0;for(let W=j.length-1;W>=0;W--)j[W].index+=B,this.lines.onInsertEmitter.fire(j[W]),B+=j[W].amount;const U=Math.max(0,E+k-this.lines.maxLength);U>0&&this.lines.onTrimEmitter.fire(U)}}translateBufferLineToString(h,m,b=0,w){const k=this.lines.get(h);return k?k.translateToString(m,b,w):""}getWrappedRangeForLine(h){let m=h,b=h;for(;m>0&&this.lines.get(m).isWrapped;)m--;for(;b+1<this.lines.length&&this.lines.get(b+1).isWrapped;)b++;return{first:m,last:b}}setupTabStops(h){for(h!=null?this.tabs[h]||(h=this.prevStop(h)):(this.tabs={},h=0);h<this._cols;h+=this._optionsService.rawOptions.tabStopWidth)this.tabs[h]=!0}prevStop(h){for(h==null&&(h=this.x);!this.tabs[--h]&&h>0;);return h>=this._cols?this._cols-1:h<0?0:h}nextStop(h){for(h==null&&(h=this.x);!this.tabs[++h]&&h<this._cols;);return h>=this._cols?this._cols-1:h<0?0:h}clearMarkers(h){this._isClearing=!0;for(let m=0;m<this.markers.length;m++)this.markers[m].line===h&&(this.markers[m].dispose(),this.markers.splice(m--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let h=0;h<this.markers.length;h++)this.markers[h].dispose(),this.markers.splice(h--,1);this._isClearing=!1}addMarker(h){const m=new f.Marker(h);return this.markers.push(m),m.register(this.lines.onTrim(b=>{m.line-=b,m.line<0&&m.dispose()})),m.register(this.lines.onInsert(b=>{m.line>=b.index&&(m.line+=b.amount)})),m.register(this.lines.onDelete(b=>{m.line>=b.index&&m.line<b.index+b.amount&&m.dispose(),m.line>b.index&&(m.line-=b.amount)})),m.register(m.onDispose(()=>this._removeMarker(m))),m}_removeMarker(h){this._isClearing||this.markers.splice(this.markers.indexOf(h),1)}}},8437:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLine=a.DEFAULT_ATTR_DATA=void 0;const u=c(3734),g=c(511),d=c(643),_=c(482);a.DEFAULT_ATTR_DATA=Object.freeze(new u.AttributeData);let v=0;class x{constructor(f,p,h=!1){this.isWrapped=h,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*f);const m=p||g.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]);for(let b=0;b<f;++b)this.setCell(b,m);this.length=f}get(f){const p=this._data[3*f+0],h=2097151&p;return[this._data[3*f+1],2097152&p?this._combined[f]:h?(0,_.stringFromCodePoint)(h):"",p>>22,2097152&p?this._combined[f].charCodeAt(this._combined[f].length-1):h]}set(f,p){this._data[3*f+1]=p[d.CHAR_DATA_ATTR_INDEX],p[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[f]=p[1],this._data[3*f+0]=2097152|f|p[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*f+0]=p[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|p[d.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(f){return this._data[3*f+0]>>22}hasWidth(f){return 12582912&this._data[3*f+0]}getFg(f){return this._data[3*f+1]}getBg(f){return this._data[3*f+2]}hasContent(f){return 4194303&this._data[3*f+0]}getCodePoint(f){const p=this._data[3*f+0];return 2097152&p?this._combined[f].charCodeAt(this._combined[f].length-1):2097151&p}isCombined(f){return 2097152&this._data[3*f+0]}getString(f){const p=this._data[3*f+0];return 2097152&p?this._combined[f]:2097151&p?(0,_.stringFromCodePoint)(2097151&p):""}isProtected(f){return 536870912&this._data[3*f+2]}loadCell(f,p){return v=3*f,p.content=this._data[v+0],p.fg=this._data[v+1],p.bg=this._data[v+2],2097152&p.content&&(p.combinedData=this._combined[f]),268435456&p.bg&&(p.extended=this._extendedAttrs[f]),p}setCell(f,p){2097152&p.content&&(this._combined[f]=p.combinedData),268435456&p.bg&&(this._extendedAttrs[f]=p.extended),this._data[3*f+0]=p.content,this._data[3*f+1]=p.fg,this._data[3*f+2]=p.bg}setCellFromCodePoint(f,p,h,m,b,w){268435456&b&&(this._extendedAttrs[f]=w),this._data[3*f+0]=p|h<<22,this._data[3*f+1]=m,this._data[3*f+2]=b}addCodepointToCell(f,p){let h=this._data[3*f+0];2097152&h?this._combined[f]+=(0,_.stringFromCodePoint)(p):(2097151&h?(this._combined[f]=(0,_.stringFromCodePoint)(2097151&h)+(0,_.stringFromCodePoint)(p),h&=-2097152,h|=2097152):h=p|4194304,this._data[3*f+0]=h)}insertCells(f,p,h,m){if((f%=this.length)&&this.getWidth(f-1)===2&&this.setCellFromCodePoint(f-1,0,1,(m==null?void 0:m.fg)||0,(m==null?void 0:m.bg)||0,(m==null?void 0:m.extended)||new u.ExtendedAttrs),p<this.length-f){const b=new g.CellData;for(let w=this.length-f-p-1;w>=0;--w)this.setCell(f+p+w,this.loadCell(f+w,b));for(let w=0;w<p;++w)this.setCell(f+w,h)}else for(let b=f;b<this.length;++b)this.setCell(b,h);this.getWidth(this.length-1)===2&&this.setCellFromCodePoint(this.length-1,0,1,(m==null?void 0:m.fg)||0,(m==null?void 0:m.bg)||0,(m==null?void 0:m.extended)||new u.ExtendedAttrs)}deleteCells(f,p,h,m){if(f%=this.length,p<this.length-f){const b=new g.CellData;for(let w=0;w<this.length-f-p;++w)this.setCell(f+w,this.loadCell(f+p+w,b));for(let w=this.length-p;w<this.length;++w)this.setCell(w,h)}else for(let b=f;b<this.length;++b)this.setCell(b,h);f&&this.getWidth(f-1)===2&&this.setCellFromCodePoint(f-1,0,1,(m==null?void 0:m.fg)||0,(m==null?void 0:m.bg)||0,(m==null?void 0:m.extended)||new u.ExtendedAttrs),this.getWidth(f)!==0||this.hasContent(f)||this.setCellFromCodePoint(f,0,1,(m==null?void 0:m.fg)||0,(m==null?void 0:m.bg)||0,(m==null?void 0:m.extended)||new u.ExtendedAttrs)}replaceCells(f,p,h,m,b=!1){if(b)for(f&&this.getWidth(f-1)===2&&!this.isProtected(f-1)&&this.setCellFromCodePoint(f-1,0,1,(m==null?void 0:m.fg)||0,(m==null?void 0:m.bg)||0,(m==null?void 0:m.extended)||new u.ExtendedAttrs),p<this.length&&this.getWidth(p-1)===2&&!this.isProtected(p)&&this.setCellFromCodePoint(p,0,1,(m==null?void 0:m.fg)||0,(m==null?void 0:m.bg)||0,(m==null?void 0:m.extended)||new u.ExtendedAttrs);f<p&&f<this.length;)this.isProtected(f)||this.setCell(f,h),f++;else for(f&&this.getWidth(f-1)===2&&this.setCellFromCodePoint(f-1,0,1,(m==null?void 0:m.fg)||0,(m==null?void 0:m.bg)||0,(m==null?void 0:m.extended)||new u.ExtendedAttrs),p<this.length&&this.getWidth(p-1)===2&&this.setCellFromCodePoint(p,0,1,(m==null?void 0:m.fg)||0,(m==null?void 0:m.bg)||0,(m==null?void 0:m.extended)||new u.ExtendedAttrs);f<p&&f<this.length;)this.setCell(f++,h)}resize(f,p){if(f===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const h=3*f;if(f>this.length){if(this._data.buffer.byteLength>=4*h)this._data=new Uint32Array(this._data.buffer,0,h);else{const m=new Uint32Array(h);m.set(this._data),this._data=m}for(let m=this.length;m<f;++m)this.setCell(m,p)}else{this._data=this._data.subarray(0,h);const m=Object.keys(this._combined);for(let w=0;w<m.length;w++){const k=parseInt(m[w],10);k>=f&&delete this._combined[k]}const b=Object.keys(this._extendedAttrs);for(let w=0;w<b.length;w++){const k=parseInt(b[w],10);k>=f&&delete this._extendedAttrs[k]}}return this.length=f,4*h*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const f=new Uint32Array(this._data.length);return f.set(this._data),this._data=f,1}return 0}fill(f,p=!1){if(p)for(let h=0;h<this.length;++h)this.isProtected(h)||this.setCell(h,f);else{this._combined={},this._extendedAttrs={};for(let h=0;h<this.length;++h)this.setCell(h,f)}}copyFrom(f){this.length!==f.length?this._data=new Uint32Array(f._data):this._data.set(f._data),this.length=f.length,this._combined={};for(const p in f._combined)this._combined[p]=f._combined[p];this._extendedAttrs={};for(const p in f._extendedAttrs)this._extendedAttrs[p]=f._extendedAttrs[p];this.isWrapped=f.isWrapped}clone(){const f=new x(0);f._data=new Uint32Array(this._data),f.length=this.length;for(const p in this._combined)f._combined[p]=this._combined[p];for(const p in this._extendedAttrs)f._extendedAttrs[p]=this._extendedAttrs[p];return f.isWrapped=this.isWrapped,f}getTrimmedLength(){for(let f=this.length-1;f>=0;--f)if(4194303&this._data[3*f+0])return f+(this._data[3*f+0]>>22);return 0}getNoBgTrimmedLength(){for(let f=this.length-1;f>=0;--f)if(4194303&this._data[3*f+0]||50331648&this._data[3*f+2])return f+(this._data[3*f+0]>>22);return 0}copyCellsFrom(f,p,h,m,b){const w=f._data;if(b)for(let j=m-1;j>=0;j--){for(let S=0;S<3;S++)this._data[3*(h+j)+S]=w[3*(p+j)+S];268435456&w[3*(p+j)+2]&&(this._extendedAttrs[h+j]=f._extendedAttrs[p+j])}else for(let j=0;j<m;j++){for(let S=0;S<3;S++)this._data[3*(h+j)+S]=w[3*(p+j)+S];268435456&w[3*(p+j)+2]&&(this._extendedAttrs[h+j]=f._extendedAttrs[p+j])}const k=Object.keys(f._combined);for(let j=0;j<k.length;j++){const S=parseInt(k[j],10);S>=p&&(this._combined[S-p+h]=f._combined[S])}}translateToString(f=!1,p=0,h=this.length){f&&(h=Math.min(h,this.getTrimmedLength()));let m="";for(;p<h;){const b=this._data[3*p+0],w=2097151&b;m+=2097152&b?this._combined[p]:w?(0,_.stringFromCodePoint)(w):d.WHITESPACE_CELL_CHAR,p+=b>>22||1}return m}}a.BufferLine=x},4841:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.getRangeLength=void 0,a.getRangeLength=function(c,u){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return u*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(l,a)=>{function c(u,g,d){if(g===u.length-1)return u[g].getTrimmedLength();const _=!u[g].hasContent(d-1)&&u[g].getWidth(d-1)===1,v=u[g+1].getWidth(0)===2;return _&&v?d-1:d}Object.defineProperty(a,"__esModule",{value:!0}),a.getWrappedLineTrimmedLength=a.reflowSmallerGetNewLineLengths=a.reflowLargerApplyNewLayout=a.reflowLargerCreateNewLayout=a.reflowLargerGetLinesToRemove=void 0,a.reflowLargerGetLinesToRemove=function(u,g,d,_,v){const x=[];for(let y=0;y<u.length-1;y++){let f=y,p=u.get(++f);if(!p.isWrapped)continue;const h=[u.get(y)];for(;f<u.length&&p.isWrapped;)h.push(p),p=u.get(++f);if(_>=y&&_<f){y+=h.length-1;continue}let m=0,b=c(h,m,g),w=1,k=0;for(;w<h.length;){const S=c(h,w,g),E=S-k,R=d-b,M=Math.min(E,R);h[m].copyCellsFrom(h[w],k,b,M,!1),b+=M,b===d&&(m++,b=0),k+=M,k===S&&(w++,k=0),b===0&&m!==0&&h[m-1].getWidth(d-1)===2&&(h[m].copyCellsFrom(h[m-1],d-1,b++,1,!1),h[m-1].setCell(d-1,v))}h[m].replaceCells(b,d,v);let j=0;for(let S=h.length-1;S>0&&(S>m||h[S].getTrimmedLength()===0);S--)j++;j>0&&(x.push(y+h.length-j),x.push(j)),y+=h.length-1}return x},a.reflowLargerCreateNewLayout=function(u,g){const d=[];let _=0,v=g[_],x=0;for(let y=0;y<u.length;y++)if(v===y){const f=g[++_];u.onDeleteEmitter.fire({index:y-x,amount:f}),y+=f-1,x+=f,v=g[++_]}else d.push(y);return{layout:d,countRemoved:x}},a.reflowLargerApplyNewLayout=function(u,g){const d=[];for(let _=0;_<g.length;_++)d.push(u.get(g[_]));for(let _=0;_<d.length;_++)u.set(_,d[_]);u.length=g.length},a.reflowSmallerGetNewLineLengths=function(u,g,d){const _=[],v=u.map((p,h)=>c(u,h,g)).reduce((p,h)=>p+h);let x=0,y=0,f=0;for(;f<v;){if(v-f<d){_.push(v-f);break}x+=d;const p=c(u,y,g);x>p&&(x-=p,y++);const h=u[y].getWidth(x-1)===2;h&&x--;const m=h?d-1:d;_.push(m),f+=m}return _},a.getWrappedLineTrimmedLength=c},5295:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferSet=void 0;const u=c(8460),g=c(844),d=c(9092);class _ extends g.Disposable{constructor(x,y){super(),this._optionsService=x,this._bufferService=y,this._onBufferActivate=this.register(new u.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new d.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new d.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(x){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(x),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(x,y){this._normal.resize(x,y),this._alt.resize(x,y),this.setupTabStops(x)}setupTabStops(x){this._normal.setupTabStops(x),this._alt.setupTabStops(x)}}a.BufferSet=_},511:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CellData=void 0;const u=c(482),g=c(643),d=c(3734);class _ extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(x){const y=new _;return y.setFromCharData(x),y}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,u.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(x){this.fg=x[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let y=!1;if(x[g.CHAR_DATA_CHAR_INDEX].length>2)y=!0;else if(x[g.CHAR_DATA_CHAR_INDEX].length===2){const f=x[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=f&&f<=56319){const p=x[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=p&&p<=57343?this.content=1024*(f-55296)+p-56320+65536|x[g.CHAR_DATA_WIDTH_INDEX]<<22:y=!0}else y=!0}else this.content=x[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|x[g.CHAR_DATA_WIDTH_INDEX]<<22;y&&(this.combinedData=x[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|x[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.CellData=_},643:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WHITESPACE_CELL_CODE=a.WHITESPACE_CELL_WIDTH=a.WHITESPACE_CELL_CHAR=a.NULL_CELL_CODE=a.NULL_CELL_WIDTH=a.NULL_CELL_CHAR=a.CHAR_DATA_CODE_INDEX=a.CHAR_DATA_WIDTH_INDEX=a.CHAR_DATA_CHAR_INDEX=a.CHAR_DATA_ATTR_INDEX=a.DEFAULT_EXT=a.DEFAULT_ATTR=a.DEFAULT_COLOR=void 0,a.DEFAULT_COLOR=0,a.DEFAULT_ATTR=256|a.DEFAULT_COLOR<<9,a.DEFAULT_EXT=0,a.CHAR_DATA_ATTR_INDEX=0,a.CHAR_DATA_CHAR_INDEX=1,a.CHAR_DATA_WIDTH_INDEX=2,a.CHAR_DATA_CODE_INDEX=3,a.NULL_CELL_CHAR="",a.NULL_CELL_WIDTH=1,a.NULL_CELL_CODE=0,a.WHITESPACE_CELL_CHAR=" ",a.WHITESPACE_CELL_WIDTH=1,a.WHITESPACE_CELL_CODE=32},4863:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Marker=void 0;const u=c(8460),g=c(844);class d{get id(){return this._id}constructor(v){this.line=v,this.isDisposed=!1,this._disposables=[],this._id=d._nextId++,this._onDispose=this.register(new u.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,g.disposeArray)(this._disposables),this._disposables.length=0)}register(v){return this._disposables.push(v),v}}a.Marker=d,d._nextId=1},7116:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DEFAULT_CHARSET=a.CHARSETS=void 0,a.CHARSETS={},a.DEFAULT_CHARSET=a.CHARSETS.B,a.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},a.CHARSETS.A={"#":"£"},a.CHARSETS.B=void 0,a.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},a.CHARSETS.C=a.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},a.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},a.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},a.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},a.CHARSETS.E=a.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},a.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},a.CHARSETS.H=a.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(l,a)=>{var c,u,g;Object.defineProperty(a,"__esModule",{value:!0}),a.C1_ESCAPED=a.C1=a.C0=void 0,function(d){d.NUL="\0",d.SOH="",d.STX="",d.ETX="",d.EOT="",d.ENQ="",d.ACK="",d.BEL="\x07",d.BS="\b",d.HT=" ",d.LF=`
195
+ `,d.VT="\v",d.FF="\f",d.CR="\r",d.SO="",d.SI="",d.DLE="",d.DC1="",d.DC2="",d.DC3="",d.DC4="",d.NAK="",d.SYN="",d.ETB="",d.CAN="",d.EM="",d.SUB="",d.ESC="\x1B",d.FS="",d.GS="",d.RS="",d.US="",d.SP=" ",d.DEL=""}(c||(a.C0=c={})),function(d){d.PAD="€",d.HOP="",d.BPH="‚",d.NBH="ƒ",d.IND="„",d.NEL="…",d.SSA="†",d.ESA="‡",d.HTS="ˆ",d.HTJ="‰",d.VTS="Š",d.PLD="‹",d.PLU="Œ",d.RI="",d.SS2="Ž",d.SS3="",d.DCS="",d.PU1="‘",d.PU2="’",d.STS="“",d.CCH="”",d.MW="•",d.SPA="–",d.EPA="—",d.SOS="˜",d.SGCI="™",d.SCI="š",d.CSI="›",d.ST="œ",d.OSC="",d.PM="ž",d.APC="Ÿ"}(u||(a.C1=u={})),function(d){d.ST=`${c.ESC}\\`}(g||(a.C1_ESCAPED=g={}))},7399:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.evaluateKeyboardEvent=void 0;const u=c(2584),g={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};a.evaluateKeyboardEvent=function(d,_,v,x){const y={type:0,cancel:!1,key:void 0},f=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?y.key=_?u.C0.ESC+"OA":u.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?y.key=_?u.C0.ESC+"OD":u.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?y.key=_?u.C0.ESC+"OC":u.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(y.key=_?u.C0.ESC+"OB":u.C0.ESC+"[B");break;case 8:if(d.altKey){y.key=u.C0.ESC+u.C0.DEL;break}y.key=u.C0.DEL;break;case 9:if(d.shiftKey){y.key=u.C0.ESC+"[Z";break}y.key=u.C0.HT,y.cancel=!0;break;case 13:y.key=d.altKey?u.C0.ESC+u.C0.CR:u.C0.CR,y.cancel=!0;break;case 27:y.key=u.C0.ESC,d.altKey&&(y.key=u.C0.ESC+u.C0.ESC),y.cancel=!0;break;case 37:if(d.metaKey)break;f?(y.key=u.C0.ESC+"[1;"+(f+1)+"D",y.key===u.C0.ESC+"[1;3D"&&(y.key=u.C0.ESC+(v?"b":"[1;5D"))):y.key=_?u.C0.ESC+"OD":u.C0.ESC+"[D";break;case 39:if(d.metaKey)break;f?(y.key=u.C0.ESC+"[1;"+(f+1)+"C",y.key===u.C0.ESC+"[1;3C"&&(y.key=u.C0.ESC+(v?"f":"[1;5C"))):y.key=_?u.C0.ESC+"OC":u.C0.ESC+"[C";break;case 38:if(d.metaKey)break;f?(y.key=u.C0.ESC+"[1;"+(f+1)+"A",v||y.key!==u.C0.ESC+"[1;3A"||(y.key=u.C0.ESC+"[1;5A")):y.key=_?u.C0.ESC+"OA":u.C0.ESC+"[A";break;case 40:if(d.metaKey)break;f?(y.key=u.C0.ESC+"[1;"+(f+1)+"B",v||y.key!==u.C0.ESC+"[1;3B"||(y.key=u.C0.ESC+"[1;5B")):y.key=_?u.C0.ESC+"OB":u.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(y.key=u.C0.ESC+"[2~");break;case 46:y.key=f?u.C0.ESC+"[3;"+(f+1)+"~":u.C0.ESC+"[3~";break;case 36:y.key=f?u.C0.ESC+"[1;"+(f+1)+"H":_?u.C0.ESC+"OH":u.C0.ESC+"[H";break;case 35:y.key=f?u.C0.ESC+"[1;"+(f+1)+"F":_?u.C0.ESC+"OF":u.C0.ESC+"[F";break;case 33:d.shiftKey?y.type=2:d.ctrlKey?y.key=u.C0.ESC+"[5;"+(f+1)+"~":y.key=u.C0.ESC+"[5~";break;case 34:d.shiftKey?y.type=3:d.ctrlKey?y.key=u.C0.ESC+"[6;"+(f+1)+"~":y.key=u.C0.ESC+"[6~";break;case 112:y.key=f?u.C0.ESC+"[1;"+(f+1)+"P":u.C0.ESC+"OP";break;case 113:y.key=f?u.C0.ESC+"[1;"+(f+1)+"Q":u.C0.ESC+"OQ";break;case 114:y.key=f?u.C0.ESC+"[1;"+(f+1)+"R":u.C0.ESC+"OR";break;case 115:y.key=f?u.C0.ESC+"[1;"+(f+1)+"S":u.C0.ESC+"OS";break;case 116:y.key=f?u.C0.ESC+"[15;"+(f+1)+"~":u.C0.ESC+"[15~";break;case 117:y.key=f?u.C0.ESC+"[17;"+(f+1)+"~":u.C0.ESC+"[17~";break;case 118:y.key=f?u.C0.ESC+"[18;"+(f+1)+"~":u.C0.ESC+"[18~";break;case 119:y.key=f?u.C0.ESC+"[19;"+(f+1)+"~":u.C0.ESC+"[19~";break;case 120:y.key=f?u.C0.ESC+"[20;"+(f+1)+"~":u.C0.ESC+"[20~";break;case 121:y.key=f?u.C0.ESC+"[21;"+(f+1)+"~":u.C0.ESC+"[21~";break;case 122:y.key=f?u.C0.ESC+"[23;"+(f+1)+"~":u.C0.ESC+"[23~";break;case 123:y.key=f?u.C0.ESC+"[24;"+(f+1)+"~":u.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(v&&!x||!d.altKey||d.metaKey)!v||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?y.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(y.key=u.C0.US),d.key==="@"&&(y.key=u.C0.NUL)):d.keyCode===65&&(y.type=1);else{const p=g[d.keyCode],h=p==null?void 0:p[d.shiftKey?1:0];if(h)y.key=u.C0.ESC+h;else if(d.keyCode>=65&&d.keyCode<=90){const m=d.ctrlKey?d.keyCode-64:d.keyCode+32;let b=String.fromCharCode(m);d.shiftKey&&(b=b.toUpperCase()),y.key=u.C0.ESC+b}else if(d.keyCode===32)y.key=u.C0.ESC+(d.ctrlKey?u.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let m=d.code.slice(3,4);d.shiftKey||(m=m.toLowerCase()),y.key=u.C0.ESC+m,y.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?y.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?y.key=u.C0.NUL:d.keyCode>=51&&d.keyCode<=55?y.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?y.key=u.C0.DEL:d.keyCode===219?y.key=u.C0.ESC:d.keyCode===220?y.key=u.C0.FS:d.keyCode===221&&(y.key=u.C0.GS)}return y}},482:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Utf8ToUtf32=a.StringToUtf32=a.utf32ToString=a.stringFromCodePoint=void 0,a.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},a.utf32ToString=function(c,u=0,g=c.length){let d="";for(let _=u;_<g;++_){let v=c[_];v>65535?(v-=65536,d+=String.fromCharCode(55296+(v>>10))+String.fromCharCode(v%1024+56320)):d+=String.fromCharCode(v)}return d},a.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,u){const g=c.length;if(!g)return 0;let d=0,_=0;if(this._interim){const v=c.charCodeAt(_++);56320<=v&&v<=57343?u[d++]=1024*(this._interim-55296)+v-56320+65536:(u[d++]=this._interim,u[d++]=v),this._interim=0}for(let v=_;v<g;++v){const x=c.charCodeAt(v);if(55296<=x&&x<=56319){if(++v>=g)return this._interim=x,d;const y=c.charCodeAt(v);56320<=y&&y<=57343?u[d++]=1024*(x-55296)+y-56320+65536:(u[d++]=x,u[d++]=y)}else x!==65279&&(u[d++]=x)}return d}},a.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,u){const g=c.length;if(!g)return 0;let d,_,v,x,y=0,f=0,p=0;if(this.interim[0]){let b=!1,w=this.interim[0];w&=(224&w)==192?31:(240&w)==224?15:7;let k,j=0;for(;(k=63&this.interim[++j])&&j<4;)w<<=6,w|=k;const S=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,E=S-j;for(;p<E;){if(p>=g)return 0;if(k=c[p++],(192&k)!=128){p--,b=!0;break}this.interim[j++]=k,w<<=6,w|=63&k}b||(S===2?w<128?p--:u[y++]=w:S===3?w<2048||w>=55296&&w<=57343||w===65279||(u[y++]=w):w<65536||w>1114111||(u[y++]=w)),this.interim.fill(0)}const h=g-4;let m=p;for(;m<g;){for(;!(!(m<h)||128&(d=c[m])||128&(_=c[m+1])||128&(v=c[m+2])||128&(x=c[m+3]));)u[y++]=d,u[y++]=_,u[y++]=v,u[y++]=x,m+=4;if(d=c[m++],d<128)u[y++]=d;else if((224&d)==192){if(m>=g)return this.interim[0]=d,y;if(_=c[m++],(192&_)!=128){m--;continue}if(f=(31&d)<<6|63&_,f<128){m--;continue}u[y++]=f}else if((240&d)==224){if(m>=g)return this.interim[0]=d,y;if(_=c[m++],(192&_)!=128){m--;continue}if(m>=g)return this.interim[0]=d,this.interim[1]=_,y;if(v=c[m++],(192&v)!=128){m--;continue}if(f=(15&d)<<12|(63&_)<<6|63&v,f<2048||f>=55296&&f<=57343||f===65279)continue;u[y++]=f}else if((248&d)==240){if(m>=g)return this.interim[0]=d,y;if(_=c[m++],(192&_)!=128){m--;continue}if(m>=g)return this.interim[0]=d,this.interim[1]=_,y;if(v=c[m++],(192&v)!=128){m--;continue}if(m>=g)return this.interim[0]=d,this.interim[1]=_,this.interim[2]=v,y;if(x=c[m++],(192&x)!=128){m--;continue}if(f=(7&d)<<18|(63&_)<<12|(63&v)<<6|63&x,f<65536||f>1114111)continue;u[y++]=f}}return y}}},225:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeV6=void 0;const c=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],u=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let g;a.UnicodeV6=class{constructor(){if(this.version="6",!g){g=new Uint8Array(65536),g.fill(1),g[0]=0,g.fill(0,1,32),g.fill(0,127,160),g.fill(2,4352,4448),g[9001]=2,g[9002]=2,g.fill(2,11904,42192),g[12351]=1,g.fill(2,44032,55204),g.fill(2,63744,64256),g.fill(2,65040,65050),g.fill(2,65072,65136),g.fill(2,65280,65377),g.fill(2,65504,65511);for(let d=0;d<c.length;++d)g.fill(0,c[d][0],c[d][1]+1)}}wcwidth(d){return d<32?0:d<127?1:d<65536?g[d]:function(_,v){let x,y=0,f=v.length-1;if(_<v[0][0]||_>v[f][1])return!1;for(;f>=y;)if(x=y+f>>1,_>v[x][1])y=x+1;else{if(!(_<v[x][0]))return!0;f=x-1}return!1}(d,u)?0:d>=131072&&d<=196605||d>=196608&&d<=262141?2:1}}},5981:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WriteBuffer=void 0;const u=c(8460),g=c(844);class d extends g.Disposable{constructor(v){super(),this._action=v,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new u.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(v,x){if(x!==void 0&&this._syncCalls>x)return void(this._syncCalls=0);if(this._pendingData+=v.length,this._writeBuffer.push(v),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let y;for(this._isSyncWriting=!0;y=this._writeBuffer.shift();){this._action(y);const f=this._callbacks.shift();f&&f()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(v,x){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=v.length,this._writeBuffer.push(v),this._callbacks.push(x),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=v.length,this._writeBuffer.push(v),this._callbacks.push(x)}_innerWrite(v=0,x=!0){const y=v||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const f=this._writeBuffer[this._bufferOffset],p=this._action(f,x);if(p){const m=b=>Date.now()-y>=12?setTimeout(()=>this._innerWrite(0,b)):this._innerWrite(y,b);return void p.catch(b=>(queueMicrotask(()=>{throw b}),Promise.resolve(!1))).then(m)}const h=this._callbacks[this._bufferOffset];if(h&&h(),this._bufferOffset++,this._pendingData-=f.length,Date.now()-y>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}a.WriteBuffer=d},5941:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.toRgbString=a.parseColor=void 0;const c=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,u=/^[\da-f]+$/;function g(d,_){const v=d.toString(16),x=v.length<2?"0"+v:v;switch(_){case 4:return v[0];case 8:return x;case 12:return(x+x).slice(0,3);default:return x+x}}a.parseColor=function(d){if(!d)return;let _=d.toLowerCase();if(_.indexOf("rgb:")===0){_=_.slice(4);const v=c.exec(_);if(v){const x=v[1]?15:v[4]?255:v[7]?4095:65535;return[Math.round(parseInt(v[1]||v[4]||v[7]||v[10],16)/x*255),Math.round(parseInt(v[2]||v[5]||v[8]||v[11],16)/x*255),Math.round(parseInt(v[3]||v[6]||v[9]||v[12],16)/x*255)]}}else if(_.indexOf("#")===0&&(_=_.slice(1),u.exec(_)&&[3,6,9,12].includes(_.length))){const v=_.length/3,x=[0,0,0];for(let y=0;y<3;++y){const f=parseInt(_.slice(v*y,v*y+v),16);x[y]=v===1?f<<4:v===2?f:v===3?f>>4:f>>8}return x}},a.toRgbString=function(d,_=16){const[v,x,y]=d;return`rgb:${g(v,_)}/${g(x,_)}/${g(y,_)}`}},5770:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.PAYLOAD_LIMIT=void 0,a.PAYLOAD_LIMIT=1e7},6351:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DcsHandler=a.DcsParser=void 0;const u=c(482),g=c(8742),d=c(5770),_=[];a.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=_,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=_}registerHandler(x,y){this._handlers[x]===void 0&&(this._handlers[x]=[]);const f=this._handlers[x];return f.push(y),{dispose:()=>{const p=f.indexOf(y);p!==-1&&f.splice(p,1)}}}clearHandler(x){this._handlers[x]&&delete this._handlers[x]}setHandlerFallback(x){this._handlerFb=x}reset(){if(this._active.length)for(let x=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;x>=0;--x)this._active[x].unhook(!1);this._stack.paused=!1,this._active=_,this._ident=0}hook(x,y){if(this.reset(),this._ident=x,this._active=this._handlers[x]||_,this._active.length)for(let f=this._active.length-1;f>=0;f--)this._active[f].hook(y);else this._handlerFb(this._ident,"HOOK",y)}put(x,y,f){if(this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].put(x,y,f);else this._handlerFb(this._ident,"PUT",(0,u.utf32ToString)(x,y,f))}unhook(x,y=!0){if(this._active.length){let f=!1,p=this._active.length-1,h=!1;if(this._stack.paused&&(p=this._stack.loopPosition-1,f=y,h=this._stack.fallThrough,this._stack.paused=!1),!h&&f===!1){for(;p>=0&&(f=this._active[p].unhook(x),f!==!0);p--)if(f instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=p,this._stack.fallThrough=!1,f;p--}for(;p>=0;p--)if(f=this._active[p].unhook(!1),f instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=p,this._stack.fallThrough=!0,f}else this._handlerFb(this._ident,"UNHOOK",x);this._active=_,this._ident=0}};const v=new g.Params;v.addParam(0),a.DcsHandler=class{constructor(x){this._handler=x,this._data="",this._params=v,this._hitLimit=!1}hook(x){this._params=x.length>1||x.params[0]?x.clone():v,this._data="",this._hitLimit=!1}put(x,y,f){this._hitLimit||(this._data+=(0,u.utf32ToString)(x,y,f),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(x){let y=!1;if(this._hitLimit)y=!1;else if(x&&(y=this._handler(this._data,this._params),y instanceof Promise))return y.then(f=>(this._params=v,this._data="",this._hitLimit=!1,f));return this._params=v,this._data="",this._hitLimit=!1,y}}},2015:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.EscapeSequenceParser=a.VT500_TRANSITION_TABLE=a.TransitionTable=void 0;const u=c(844),g=c(8742),d=c(6242),_=c(6351);class v{constructor(p){this.table=new Uint8Array(p)}setDefault(p,h){this.table.fill(p<<4|h)}add(p,h,m,b){this.table[h<<8|p]=m<<4|b}addMany(p,h,m,b){for(let w=0;w<p.length;w++)this.table[h<<8|p[w]]=m<<4|b}}a.TransitionTable=v;const x=160;a.VT500_TRANSITION_TABLE=function(){const f=new v(4095),p=Array.apply(null,Array(256)).map((j,S)=>S),h=(j,S)=>p.slice(j,S),m=h(32,127),b=h(0,24);b.push(25),b.push.apply(b,h(28,32));const w=h(0,14);let k;for(k in f.setDefault(1,0),f.addMany(m,0,2,0),w)f.addMany([24,26,153,154],k,3,0),f.addMany(h(128,144),k,3,0),f.addMany(h(144,152),k,3,0),f.add(156,k,0,0),f.add(27,k,11,1),f.add(157,k,4,8),f.addMany([152,158,159],k,0,7),f.add(155,k,11,3),f.add(144,k,11,9);return f.addMany(b,0,3,0),f.addMany(b,1,3,1),f.add(127,1,0,1),f.addMany(b,8,0,8),f.addMany(b,3,3,3),f.add(127,3,0,3),f.addMany(b,4,3,4),f.add(127,4,0,4),f.addMany(b,6,3,6),f.addMany(b,5,3,5),f.add(127,5,0,5),f.addMany(b,2,3,2),f.add(127,2,0,2),f.add(93,1,4,8),f.addMany(m,8,5,8),f.add(127,8,5,8),f.addMany([156,27,24,26,7],8,6,0),f.addMany(h(28,32),8,0,8),f.addMany([88,94,95],1,0,7),f.addMany(m,7,0,7),f.addMany(b,7,0,7),f.add(156,7,0,0),f.add(127,7,0,7),f.add(91,1,11,3),f.addMany(h(64,127),3,7,0),f.addMany(h(48,60),3,8,4),f.addMany([60,61,62,63],3,9,4),f.addMany(h(48,60),4,8,4),f.addMany(h(64,127),4,7,0),f.addMany([60,61,62,63],4,0,6),f.addMany(h(32,64),6,0,6),f.add(127,6,0,6),f.addMany(h(64,127),6,0,0),f.addMany(h(32,48),3,9,5),f.addMany(h(32,48),5,9,5),f.addMany(h(48,64),5,0,6),f.addMany(h(64,127),5,7,0),f.addMany(h(32,48),4,9,5),f.addMany(h(32,48),1,9,2),f.addMany(h(32,48),2,9,2),f.addMany(h(48,127),2,10,0),f.addMany(h(48,80),1,10,0),f.addMany(h(81,88),1,10,0),f.addMany([89,90,92],1,10,0),f.addMany(h(96,127),1,10,0),f.add(80,1,11,9),f.addMany(b,9,0,9),f.add(127,9,0,9),f.addMany(h(28,32),9,0,9),f.addMany(h(32,48),9,9,12),f.addMany(h(48,60),9,8,10),f.addMany([60,61,62,63],9,9,10),f.addMany(b,11,0,11),f.addMany(h(32,128),11,0,11),f.addMany(h(28,32),11,0,11),f.addMany(b,10,0,10),f.add(127,10,0,10),f.addMany(h(28,32),10,0,10),f.addMany(h(48,60),10,8,10),f.addMany([60,61,62,63],10,0,11),f.addMany(h(32,48),10,9,12),f.addMany(b,12,0,12),f.add(127,12,0,12),f.addMany(h(28,32),12,0,12),f.addMany(h(32,48),12,9,12),f.addMany(h(48,64),12,0,11),f.addMany(h(64,127),12,12,13),f.addMany(h(64,127),10,12,13),f.addMany(h(64,127),9,12,13),f.addMany(b,13,13,13),f.addMany(m,13,13,13),f.add(127,13,0,13),f.addMany([27,156,24,26],13,14,0),f.add(x,0,2,0),f.add(x,8,5,8),f.add(x,6,0,6),f.add(x,11,0,11),f.add(x,13,13,13),f}();class y extends u.Disposable{constructor(p=a.VT500_TRANSITION_TABLE){super(),this._transitions=p,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new g.Params,this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._printHandlerFb=(h,m,b)=>{},this._executeHandlerFb=h=>{},this._csiHandlerFb=(h,m)=>{},this._escHandlerFb=h=>{},this._errorHandlerFb=h=>h,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,u.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new d.OscParser),this._dcsParser=this.register(new _.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(p,h=[64,126]){let m=0;if(p.prefix){if(p.prefix.length>1)throw new Error("only one byte as prefix supported");if(m=p.prefix.charCodeAt(0),m&&60>m||m>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(p.intermediates){if(p.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let w=0;w<p.intermediates.length;++w){const k=p.intermediates.charCodeAt(w);if(32>k||k>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");m<<=8,m|=k}}if(p.final.length!==1)throw new Error("final must be a single byte");const b=p.final.charCodeAt(0);if(h[0]>b||b>h[1])throw new Error(`final must be in range ${h[0]} .. ${h[1]}`);return m<<=8,m|=b,m}identToString(p){const h=[];for(;p;)h.push(String.fromCharCode(255&p)),p>>=8;return h.reverse().join("")}setPrintHandler(p){this._printHandler=p}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(p,h){const m=this._identifier(p,[48,126]);this._escHandlers[m]===void 0&&(this._escHandlers[m]=[]);const b=this._escHandlers[m];return b.push(h),{dispose:()=>{const w=b.indexOf(h);w!==-1&&b.splice(w,1)}}}clearEscHandler(p){this._escHandlers[this._identifier(p,[48,126])]&&delete this._escHandlers[this._identifier(p,[48,126])]}setEscHandlerFallback(p){this._escHandlerFb=p}setExecuteHandler(p,h){this._executeHandlers[p.charCodeAt(0)]=h}clearExecuteHandler(p){this._executeHandlers[p.charCodeAt(0)]&&delete this._executeHandlers[p.charCodeAt(0)]}setExecuteHandlerFallback(p){this._executeHandlerFb=p}registerCsiHandler(p,h){const m=this._identifier(p);this._csiHandlers[m]===void 0&&(this._csiHandlers[m]=[]);const b=this._csiHandlers[m];return b.push(h),{dispose:()=>{const w=b.indexOf(h);w!==-1&&b.splice(w,1)}}}clearCsiHandler(p){this._csiHandlers[this._identifier(p)]&&delete this._csiHandlers[this._identifier(p)]}setCsiHandlerFallback(p){this._csiHandlerFb=p}registerDcsHandler(p,h){return this._dcsParser.registerHandler(this._identifier(p),h)}clearDcsHandler(p){this._dcsParser.clearHandler(this._identifier(p))}setDcsHandlerFallback(p){this._dcsParser.setHandlerFallback(p)}registerOscHandler(p,h){return this._oscParser.registerHandler(p,h)}clearOscHandler(p){this._oscParser.clearHandler(p)}setOscHandlerFallback(p){this._oscParser.setHandlerFallback(p)}setErrorHandler(p){this._errorHandler=p}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(p,h,m,b,w){this._parseStack.state=p,this._parseStack.handlers=h,this._parseStack.handlerPos=m,this._parseStack.transition=b,this._parseStack.chunkPos=w}parse(p,h,m){let b,w=0,k=0,j=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,j=this._parseStack.chunkPos+1;else{if(m===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const S=this._parseStack.handlers;let E=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(m===!1&&E>-1){for(;E>=0&&(b=S[E](this._params),b!==!0);E--)if(b instanceof Promise)return this._parseStack.handlerPos=E,b}this._parseStack.handlers=[];break;case 4:if(m===!1&&E>-1){for(;E>=0&&(b=S[E](),b!==!0);E--)if(b instanceof Promise)return this._parseStack.handlerPos=E,b}this._parseStack.handlers=[];break;case 6:if(w=p[this._parseStack.chunkPos],b=this._dcsParser.unhook(w!==24&&w!==26,m),b)return b;w===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(w=p[this._parseStack.chunkPos],b=this._oscParser.end(w!==24&&w!==26,m),b)return b;w===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,j=this._parseStack.chunkPos+1,this.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(let S=j;S<h;++S){switch(w=p[S],k=this._transitions.table[this.currentState<<8|(w<160?w:x)],k>>4){case 2:for(let L=S+1;;++L){if(L>=h||(w=p[L])<32||w>126&&w<x){this._printHandler(p,S,L),S=L-1;break}if(++L>=h||(w=p[L])<32||w>126&&w<x){this._printHandler(p,S,L),S=L-1;break}if(++L>=h||(w=p[L])<32||w>126&&w<x){this._printHandler(p,S,L),S=L-1;break}if(++L>=h||(w=p[L])<32||w>126&&w<x){this._printHandler(p,S,L),S=L-1;break}}break;case 3:this._executeHandlers[w]?this._executeHandlers[w]():this._executeHandlerFb(w),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:S,code:w,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const E=this._csiHandlers[this._collect<<8|w];let R=E?E.length-1:-1;for(;R>=0&&(b=E[R](this._params),b!==!0);R--)if(b instanceof Promise)return this._preserveStack(3,E,R,k,S),b;R<0&&this._csiHandlerFb(this._collect<<8|w,this._params),this.precedingCodepoint=0;break;case 8:do switch(w){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(w-48)}while(++S<h&&(w=p[S])>47&&w<60);S--;break;case 9:this._collect<<=8,this._collect|=w;break;case 10:const M=this._escHandlers[this._collect<<8|w];let A=M?M.length-1:-1;for(;A>=0&&(b=M[A](),b!==!0);A--)if(b instanceof Promise)return this._preserveStack(4,M,A,k,S),b;A<0&&this._escHandlerFb(this._collect<<8|w),this.precedingCodepoint=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|w,this._params);break;case 13:for(let L=S+1;;++L)if(L>=h||(w=p[L])===24||w===26||w===27||w>127&&w<x){this._dcsParser.put(p,S,L),S=L-1;break}break;case 14:if(b=this._dcsParser.unhook(w!==24&&w!==26),b)return this._preserveStack(6,[],0,k,S),b;w===27&&(k|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0;break;case 4:this._oscParser.start();break;case 5:for(let L=S+1;;L++)if(L>=h||(w=p[L])<32||w>127&&w<x){this._oscParser.put(p,S,L),S=L-1;break}break;case 6:if(b=this._oscParser.end(w!==24&&w!==26),b)return this._preserveStack(5,[],0,k,S),b;w===27&&(k|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0}this.currentState=15&k}}}a.EscapeSequenceParser=y},6242:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OscHandler=a.OscParser=void 0;const u=c(5770),g=c(482),d=[];a.OscParser=class{constructor(){this._state=0,this._active=d,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(_,v){this._handlers[_]===void 0&&(this._handlers[_]=[]);const x=this._handlers[_];return x.push(v),{dispose:()=>{const y=x.indexOf(v);y!==-1&&x.splice(y,1)}}}clearHandler(_){this._handlers[_]&&delete this._handlers[_]}setHandlerFallback(_){this._handlerFb=_}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let _=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;_>=0;--_)this._active[_].end(!1);this._stack.paused=!1,this._active=d,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||d,this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].start();else this._handlerFb(this._id,"START")}_put(_,v,x){if(this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].put(_,v,x);else this._handlerFb(this._id,"PUT",(0,g.utf32ToString)(_,v,x))}start(){this.reset(),this._state=1}put(_,v,x){if(this._state!==3){if(this._state===1)for(;v<x;){const y=_[v++];if(y===59){this._state=2,this._start();break}if(y<48||57<y)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+y-48}this._state===2&&x-v>0&&this._put(_,v,x)}}end(_,v=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let x=!1,y=this._active.length-1,f=!1;if(this._stack.paused&&(y=this._stack.loopPosition-1,x=v,f=this._stack.fallThrough,this._stack.paused=!1),!f&&x===!1){for(;y>=0&&(x=this._active[y].end(_),x!==!0);y--)if(x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!1,x;y--}for(;y>=0;y--)if(x=this._active[y].end(!1),x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!0,x}else this._handlerFb(this._id,"END",_);this._active=d,this._id=-1,this._state=0}}},a.OscHandler=class{constructor(_){this._handler=_,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(_,v,x){this._hitLimit||(this._data+=(0,g.utf32ToString)(_,v,x),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(_){let v=!1;if(this._hitLimit)v=!1;else if(_&&(v=this._handler(this._data),v instanceof Promise))return v.then(x=>(this._data="",this._hitLimit=!1,x));return this._data="",this._hitLimit=!1,v}}},8742:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Params=void 0;const c=2147483647;class u{static fromArray(d){const _=new u;if(!d.length)return _;for(let v=Array.isArray(d[0])?1:0;v<d.length;++v){const x=d[v];if(Array.isArray(x))for(let y=0;y<x.length;++y)_.addSubParam(x[y]);else _.addParam(x)}return _}constructor(d=32,_=32){if(this.maxLength=d,this.maxSubParamsLength=_,_>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(_),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const d=new u(this.maxLength,this.maxSubParamsLength);return d.params.set(this.params),d.length=this.length,d._subParams.set(this._subParams),d._subParamsLength=this._subParamsLength,d._subParamsIdx.set(this._subParamsIdx),d._rejectDigits=this._rejectDigits,d._rejectSubDigits=this._rejectSubDigits,d._digitIsSub=this._digitIsSub,d}toArray(){const d=[];for(let _=0;_<this.length;++_){d.push(this.params[_]);const v=this._subParamsIdx[_]>>8,x=255&this._subParamsIdx[_];x-v>0&&d.push(Array.prototype.slice.call(this._subParams,v,x))}return d}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(d){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=d>c?c:d}}addSubParam(d){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=d>c?c:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const _=this._subParamsIdx[d]>>8,v=255&this._subParamsIdx[d];return v-_>0?this._subParams.subarray(_,v):null}getSubParamsAll(){const d={};for(let _=0;_<this.length;++_){const v=this._subParamsIdx[_]>>8,x=255&this._subParamsIdx[_];x-v>0&&(d[_]=this._subParams.slice(v,x))}return d}addDigit(d){let _;if(this._rejectDigits||!(_=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const v=this._digitIsSub?this._subParams:this.params,x=v[_-1];v[_-1]=~x?Math.min(10*x+d,c):d}}a.Params=u},5741:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.AddonManager=void 0,a.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,u){const g={instance:u,dispose:u.dispose,isDisposed:!1};this._addons.push(g),u.dispose=()=>this._wrappedAddonDispose(g),u.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let u=-1;for(let g=0;g<this._addons.length;g++)if(this._addons[g]===c){u=g;break}if(u===-1)throw new Error("Could not dispose an addon that has not been loaded");c.isDisposed=!0,c.dispose.apply(c.instance),this._addons.splice(u,1)}}},8771:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferApiView=void 0;const u=c(3785),g=c(511);a.BufferApiView=class{constructor(d,_){this._buffer=d,this.type=_}init(d){return this._buffer=d,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(d){const _=this._buffer.lines.get(d);if(_)return new u.BufferLineApiView(_)}getNullCell(){return new g.CellData}}},3785:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLineApiView=void 0;const u=c(511);a.BufferLineApiView=class{constructor(g){this._line=g}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(g,d){if(!(g<0||g>=this._line.length))return d?(this._line.loadCell(g,d),d):this._line.loadCell(g,new u.CellData)}translateToString(g,d,_){return this._line.translateToString(g,d,_)}}},8285:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferNamespaceApi=void 0;const u=c(8771),g=c(8460),d=c(844);class _ extends d.Disposable{constructor(x){super(),this._core=x,this._onBufferChange=this.register(new g.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new u.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new u.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}a.BufferNamespaceApi=_},7975:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ParserApi=void 0,a.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,u){return this._core.registerCsiHandler(c,g=>u(g.toArray()))}addCsiHandler(c,u){return this.registerCsiHandler(c,u)}registerDcsHandler(c,u){return this._core.registerDcsHandler(c,(g,d)=>u(g,d.toArray()))}addDcsHandler(c,u){return this.registerDcsHandler(c,u)}registerEscHandler(c,u){return this._core.registerEscHandler(c,u)}addEscHandler(c,u){return this.registerEscHandler(c,u)}registerOscHandler(c,u){return this._core.registerOscHandler(c,u)}addOscHandler(c,u){return this.registerOscHandler(c,u)}}},7090:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeApi=void 0,a.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(l,a,c){var u=this&&this.__decorate||function(f,p,h,m){var b,w=arguments.length,k=w<3?p:m===null?m=Object.getOwnPropertyDescriptor(p,h):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(f,p,h,m);else for(var j=f.length-1;j>=0;j--)(b=f[j])&&(k=(w<3?b(k):w>3?b(p,h,k):b(p,h))||k);return w>3&&k&&Object.defineProperty(p,h,k),k},g=this&&this.__param||function(f,p){return function(h,m){p(h,m,f)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferService=a.MINIMUM_ROWS=a.MINIMUM_COLS=void 0;const d=c(8460),_=c(844),v=c(5295),x=c(2585);a.MINIMUM_COLS=2,a.MINIMUM_ROWS=1;let y=a.BufferService=class extends _.Disposable{get buffer(){return this.buffers.active}constructor(f){super(),this.isUserScrolling=!1,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(f.rawOptions.cols||0,a.MINIMUM_COLS),this.rows=Math.max(f.rawOptions.rows||0,a.MINIMUM_ROWS),this.buffers=this.register(new v.BufferSet(f,this))}resize(f,p){this.cols=f,this.rows=p,this.buffers.resize(f,p),this._onResize.fire({cols:f,rows:p})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(f,p=!1){const h=this.buffer;let m;m=this._cachedBlankLine,m&&m.length===this.cols&&m.getFg(0)===f.fg&&m.getBg(0)===f.bg||(m=h.getBlankLine(f,p),this._cachedBlankLine=m),m.isWrapped=p;const b=h.ybase+h.scrollTop,w=h.ybase+h.scrollBottom;if(h.scrollTop===0){const k=h.lines.isFull;w===h.lines.length-1?k?h.lines.recycle().copyFrom(m):h.lines.push(m.clone()):h.lines.splice(w+1,0,m.clone()),k?this.isUserScrolling&&(h.ydisp=Math.max(h.ydisp-1,0)):(h.ybase++,this.isUserScrolling||h.ydisp++)}else{const k=w-b+1;h.lines.shiftElements(b+1,k-1,-1),h.lines.set(w,m.clone())}this.isUserScrolling||(h.ydisp=h.ybase),this._onScroll.fire(h.ydisp)}scrollLines(f,p,h){const m=this.buffer;if(f<0){if(m.ydisp===0)return;this.isUserScrolling=!0}else f+m.ydisp>=m.ybase&&(this.isUserScrolling=!1);const b=m.ydisp;m.ydisp=Math.max(Math.min(m.ydisp+f,m.ybase),0),b!==m.ydisp&&(p||this._onScroll.fire(m.ydisp))}};a.BufferService=y=u([g(0,x.IOptionsService)],y)},7994:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CharsetService=void 0,a.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,u){this._charsets[c]=u,this.glevel===c&&(this.charset=u)}}},1753:function(l,a,c){var u=this&&this.__decorate||function(m,b,w,k){var j,S=arguments.length,E=S<3?b:k===null?k=Object.getOwnPropertyDescriptor(b,w):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(m,b,w,k);else for(var R=m.length-1;R>=0;R--)(j=m[R])&&(E=(S<3?j(E):S>3?j(b,w,E):j(b,w))||E);return S>3&&E&&Object.defineProperty(b,w,E),E},g=this&&this.__param||function(m,b){return function(w,k){b(w,k,m)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreMouseService=void 0;const d=c(2585),_=c(8460),v=c(844),x={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:m=>m.button!==4&&m.action===1&&(m.ctrl=!1,m.alt=!1,m.shift=!1,!0)},VT200:{events:19,restrict:m=>m.action!==32},DRAG:{events:23,restrict:m=>m.action!==32||m.button!==3},ANY:{events:31,restrict:m=>!0}};function y(m,b){let w=(m.ctrl?16:0)|(m.shift?4:0)|(m.alt?8:0);return m.button===4?(w|=64,w|=m.action):(w|=3&m.button,4&m.button&&(w|=64),8&m.button&&(w|=128),m.action===32?w|=32:m.action!==0||b||(w|=3)),w}const f=String.fromCharCode,p={DEFAULT:m=>{const b=[y(m,!1)+32,m.col+32,m.row+32];return b[0]>255||b[1]>255||b[2]>255?"":`\x1B[M${f(b[0])}${f(b[1])}${f(b[2])}`},SGR:m=>{const b=m.action===0&&m.button!==4?"m":"M";return`\x1B[<${y(m,!0)};${m.col};${m.row}${b}`},SGR_PIXELS:m=>{const b=m.action===0&&m.button!==4?"m":"M";return`\x1B[<${y(m,!0)};${m.x};${m.y}${b}`}};let h=a.CoreMouseService=class extends v.Disposable{constructor(m,b){super(),this._bufferService=m,this._coreService=b,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new _.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const w of Object.keys(x))this.addProtocol(w,x[w]);for(const w of Object.keys(p))this.addEncoding(w,p[w]);this.reset()}addProtocol(m,b){this._protocols[m]=b}addEncoding(m,b){this._encodings[m]=b}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(m){if(!this._protocols[m])throw new Error(`unknown protocol "${m}"`);this._activeProtocol=m,this._onProtocolChange.fire(this._protocols[m].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(m){if(!this._encodings[m])throw new Error(`unknown encoding "${m}"`);this._activeEncoding=m}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(m){if(m.col<0||m.col>=this._bufferService.cols||m.row<0||m.row>=this._bufferService.rows||m.button===4&&m.action===32||m.button===3&&m.action!==32||m.button!==4&&(m.action===2||m.action===3)||(m.col++,m.row++,m.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,m,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(m))return!1;const b=this._encodings[this._activeEncoding](m);return b&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(b):this._coreService.triggerDataEvent(b,!0)),this._lastEvent=m,!0}explainEvents(m){return{down:!!(1&m),up:!!(2&m),drag:!!(4&m),move:!!(8&m),wheel:!!(16&m)}}_equalEvents(m,b,w){if(w){if(m.x!==b.x||m.y!==b.y)return!1}else if(m.col!==b.col||m.row!==b.row)return!1;return m.button===b.button&&m.action===b.action&&m.ctrl===b.ctrl&&m.alt===b.alt&&m.shift===b.shift}};a.CoreMouseService=h=u([g(0,d.IBufferService),g(1,d.ICoreService)],h)},6975:function(l,a,c){var u=this&&this.__decorate||function(h,m,b,w){var k,j=arguments.length,S=j<3?m:w===null?w=Object.getOwnPropertyDescriptor(m,b):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(h,m,b,w);else for(var E=h.length-1;E>=0;E--)(k=h[E])&&(S=(j<3?k(S):j>3?k(m,b,S):k(m,b))||S);return j>3&&S&&Object.defineProperty(m,b,S),S},g=this&&this.__param||function(h,m){return function(b,w){m(b,w,h)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreService=void 0;const d=c(1439),_=c(8460),v=c(844),x=c(2585),y=Object.freeze({insertMode:!1}),f=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let p=a.CoreService=class extends v.Disposable{constructor(h,m,b){super(),this._bufferService=h,this._logService=m,this._optionsService=b,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new _.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new _.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new _.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new _.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,d.clone)(y),this.decPrivateModes=(0,d.clone)(f)}reset(){this.modes=(0,d.clone)(y),this.decPrivateModes=(0,d.clone)(f)}triggerDataEvent(h,m=!1){if(this._optionsService.rawOptions.disableStdin)return;const b=this._bufferService.buffer;m&&this._optionsService.rawOptions.scrollOnUserInput&&b.ybase!==b.ydisp&&this._onRequestScrollToBottom.fire(),m&&this._onUserInput.fire(),this._logService.debug(`sending data "${h}"`,()=>h.split("").map(w=>w.charCodeAt(0))),this._onData.fire(h)}triggerBinaryEvent(h){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${h}"`,()=>h.split("").map(m=>m.charCodeAt(0))),this._onBinary.fire(h))}};a.CoreService=p=u([g(0,x.IBufferService),g(1,x.ILogService),g(2,x.IOptionsService)],p)},9074:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DecorationService=void 0;const u=c(8055),g=c(8460),d=c(844),_=c(6106);let v=0,x=0;class y extends d.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new _.SortedList(h=>h==null?void 0:h.marker.line),this._onDecorationRegistered=this.register(new g.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new g.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,d.toDisposable)(()=>this.reset()))}registerDecoration(h){if(h.marker.isDisposed)return;const m=new f(h);if(m){const b=m.marker.onDispose(()=>m.dispose());m.onDispose(()=>{m&&(this._decorations.delete(m)&&this._onDecorationRemoved.fire(m),b.dispose())}),this._decorations.insert(m),this._onDecorationRegistered.fire(m)}return m}reset(){for(const h of this._decorations.values())h.dispose();this._decorations.clear()}*getDecorationsAtCell(h,m,b){var w,k,j;let S=0,E=0;for(const R of this._decorations.getKeyIterator(m))S=(w=R.options.x)!==null&&w!==void 0?w:0,E=S+((k=R.options.width)!==null&&k!==void 0?k:1),h>=S&&h<E&&(!b||((j=R.options.layer)!==null&&j!==void 0?j:"bottom")===b)&&(yield R)}forEachDecorationAtCell(h,m,b,w){this._decorations.forEachByKey(m,k=>{var j,S,E;v=(j=k.options.x)!==null&&j!==void 0?j:0,x=v+((S=k.options.width)!==null&&S!==void 0?S:1),h>=v&&h<x&&(!b||((E=k.options.layer)!==null&&E!==void 0?E:"bottom")===b)&&w(k)})}}a.DecorationService=y;class f extends d.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=u.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=u.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(h){super(),this.options=h,this.onRenderEmitter=this.register(new g.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new g.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=h.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.InstantiationService=a.ServiceCollection=void 0;const u=c(2585),g=c(8343);class d{constructor(...v){this._entries=new Map;for(const[x,y]of v)this.set(x,y)}set(v,x){const y=this._entries.get(v);return this._entries.set(v,x),y}forEach(v){for(const[x,y]of this._entries.entries())v(x,y)}has(v){return this._entries.has(v)}get(v){return this._entries.get(v)}}a.ServiceCollection=d,a.InstantiationService=class{constructor(){this._services=new d,this._services.set(u.IInstantiationService,this)}setService(_,v){this._services.set(_,v)}getService(_){return this._services.get(_)}createInstance(_,...v){const x=(0,g.getServiceDependencies)(_).sort((p,h)=>p.index-h.index),y=[];for(const p of x){const h=this._services.get(p.id);if(!h)throw new Error(`[createInstance] ${_.name} depends on UNKNOWN service ${p.id}.`);y.push(h)}const f=x.length>0?x[0].index:v.length;if(v.length!==f)throw new Error(`[createInstance] First service dependency of ${_.name} at position ${f+1} conflicts with ${v.length} static arguments`);return new _(...v,...y)}}},7866:function(l,a,c){var u=this&&this.__decorate||function(f,p,h,m){var b,w=arguments.length,k=w<3?p:m===null?m=Object.getOwnPropertyDescriptor(p,h):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(f,p,h,m);else for(var j=f.length-1;j>=0;j--)(b=f[j])&&(k=(w<3?b(k):w>3?b(p,h,k):b(p,h))||k);return w>3&&k&&Object.defineProperty(p,h,k),k},g=this&&this.__param||function(f,p){return function(h,m){p(h,m,f)}};Object.defineProperty(a,"__esModule",{value:!0}),a.traceCall=a.setTraceLogger=a.LogService=void 0;const d=c(844),_=c(2585),v={trace:_.LogLevelEnum.TRACE,debug:_.LogLevelEnum.DEBUG,info:_.LogLevelEnum.INFO,warn:_.LogLevelEnum.WARN,error:_.LogLevelEnum.ERROR,off:_.LogLevelEnum.OFF};let x,y=a.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(f){super(),this._optionsService=f,this._logLevel=_.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),x=this}_updateLogLevel(){this._logLevel=v[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(f){for(let p=0;p<f.length;p++)typeof f[p]=="function"&&(f[p]=f[p]())}_log(f,p,h){this._evalLazyOptionalParams(h),f.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+p,...h)}trace(f,...p){var h,m;this._logLevel<=_.LogLevelEnum.TRACE&&this._log((m=(h=this._optionsService.options.logger)===null||h===void 0?void 0:h.trace.bind(this._optionsService.options.logger))!==null&&m!==void 0?m:console.log,f,p)}debug(f,...p){var h,m;this._logLevel<=_.LogLevelEnum.DEBUG&&this._log((m=(h=this._optionsService.options.logger)===null||h===void 0?void 0:h.debug.bind(this._optionsService.options.logger))!==null&&m!==void 0?m:console.log,f,p)}info(f,...p){var h,m;this._logLevel<=_.LogLevelEnum.INFO&&this._log((m=(h=this._optionsService.options.logger)===null||h===void 0?void 0:h.info.bind(this._optionsService.options.logger))!==null&&m!==void 0?m:console.info,f,p)}warn(f,...p){var h,m;this._logLevel<=_.LogLevelEnum.WARN&&this._log((m=(h=this._optionsService.options.logger)===null||h===void 0?void 0:h.warn.bind(this._optionsService.options.logger))!==null&&m!==void 0?m:console.warn,f,p)}error(f,...p){var h,m;this._logLevel<=_.LogLevelEnum.ERROR&&this._log((m=(h=this._optionsService.options.logger)===null||h===void 0?void 0:h.error.bind(this._optionsService.options.logger))!==null&&m!==void 0?m:console.error,f,p)}};a.LogService=y=u([g(0,_.IOptionsService)],y),a.setTraceLogger=function(f){x=f},a.traceCall=function(f,p,h){if(typeof h.value!="function")throw new Error("not supported");const m=h.value;h.value=function(...b){if(x.logLevel!==_.LogLevelEnum.TRACE)return m.apply(this,b);x.trace(`GlyphRenderer#${m.name}(${b.map(k=>JSON.stringify(k)).join(", ")})`);const w=m.apply(this,b);return x.trace(`GlyphRenderer#${m.name} return`,w),w}}},7302:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OptionsService=a.DEFAULT_OPTIONS=void 0;const u=c(8460),g=c(844),d=c(6114);a.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:d.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const _=["normal","bold","100","200","300","400","500","600","700","800","900"];class v extends g.Disposable{constructor(y){super(),this._onOptionChange=this.register(new u.EventEmitter),this.onOptionChange=this._onOptionChange.event;const f=Object.assign({},a.DEFAULT_OPTIONS);for(const p in y)if(p in f)try{const h=y[p];f[p]=this._sanitizeAndValidateOption(p,h)}catch(h){console.error(h)}this.rawOptions=f,this.options=Object.assign({},f),this._setupOptions()}onSpecificOptionChange(y,f){return this.onOptionChange(p=>{p===y&&f(this.rawOptions[y])})}onMultipleOptionChange(y,f){return this.onOptionChange(p=>{y.indexOf(p)!==-1&&f()})}_setupOptions(){const y=p=>{if(!(p in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${p}"`);return this.rawOptions[p]},f=(p,h)=>{if(!(p in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${p}"`);h=this._sanitizeAndValidateOption(p,h),this.rawOptions[p]!==h&&(this.rawOptions[p]=h,this._onOptionChange.fire(p))};for(const p in this.rawOptions){const h={get:y.bind(this,p),set:f.bind(this,p)};Object.defineProperty(this.options,p,h)}}_sanitizeAndValidateOption(y,f){switch(y){case"cursorStyle":if(f||(f=a.DEFAULT_OPTIONS[y]),!function(p){return p==="block"||p==="underline"||p==="bar"}(f))throw new Error(`"${f}" is not a valid value for ${y}`);break;case"wordSeparator":f||(f=a.DEFAULT_OPTIONS[y]);break;case"fontWeight":case"fontWeightBold":if(typeof f=="number"&&1<=f&&f<=1e3)break;f=_.includes(f)?f:a.DEFAULT_OPTIONS[y];break;case"cursorWidth":f=Math.floor(f);case"lineHeight":case"tabStopWidth":if(f<1)throw new Error(`${y} cannot be less than 1, value: ${f}`);break;case"minimumContrastRatio":f=Math.max(1,Math.min(21,Math.round(10*f)/10));break;case"scrollback":if((f=Math.min(f,4294967295))<0)throw new Error(`${y} cannot be less than 0, value: ${f}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(f<=0)throw new Error(`${y} cannot be less than or equal to 0, value: ${f}`);break;case"rows":case"cols":if(!f&&f!==0)throw new Error(`${y} must be numeric, value: ${f}`);break;case"windowsPty":f=f??{}}return f}}a.OptionsService=v},2660:function(l,a,c){var u=this&&this.__decorate||function(v,x,y,f){var p,h=arguments.length,m=h<3?x:f===null?f=Object.getOwnPropertyDescriptor(x,y):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(v,x,y,f);else for(var b=v.length-1;b>=0;b--)(p=v[b])&&(m=(h<3?p(m):h>3?p(x,y,m):p(x,y))||m);return h>3&&m&&Object.defineProperty(x,y,m),m},g=this&&this.__param||function(v,x){return function(y,f){x(y,f,v)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkService=void 0;const d=c(2585);let _=a.OscLinkService=class{constructor(v){this._bufferService=v,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(v){const x=this._bufferService.buffer;if(v.id===void 0){const b=x.addMarker(x.ybase+x.y),w={data:v,id:this._nextId++,lines:[b]};return b.onDispose(()=>this._removeMarkerFromLink(w,b)),this._dataByLinkId.set(w.id,w),w.id}const y=v,f=this._getEntryIdKey(y),p=this._entriesWithId.get(f);if(p)return this.addLineToLink(p.id,x.ybase+x.y),p.id;const h=x.addMarker(x.ybase+x.y),m={id:this._nextId++,key:this._getEntryIdKey(y),data:y,lines:[h]};return h.onDispose(()=>this._removeMarkerFromLink(m,h)),this._entriesWithId.set(m.key,m),this._dataByLinkId.set(m.id,m),m.id}addLineToLink(v,x){const y=this._dataByLinkId.get(v);if(y&&y.lines.every(f=>f.line!==x)){const f=this._bufferService.buffer.addMarker(x);y.lines.push(f),f.onDispose(()=>this._removeMarkerFromLink(y,f))}}getLinkData(v){var x;return(x=this._dataByLinkId.get(v))===null||x===void 0?void 0:x.data}_getEntryIdKey(v){return`${v.id};;${v.uri}`}_removeMarkerFromLink(v,x){const y=v.lines.indexOf(x);y!==-1&&(v.lines.splice(y,1),v.lines.length===0&&(v.data.id!==void 0&&this._entriesWithId.delete(v.key),this._dataByLinkId.delete(v.id)))}};a.OscLinkService=_=u([g(0,d.IBufferService)],_)},8343:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createDecorator=a.getServiceDependencies=a.serviceRegistry=void 0;const c="di$target",u="di$dependencies";a.serviceRegistry=new Map,a.getServiceDependencies=function(g){return g[u]||[]},a.createDecorator=function(g){if(a.serviceRegistry.has(g))return a.serviceRegistry.get(g);const d=function(_,v,x){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(y,f,p){f[c]===f?f[u].push({id:y,index:p}):(f[u]=[{id:y,index:p}],f[c]=f)})(d,_,x)};return d.toString=()=>g,a.serviceRegistry.set(g,d),d}},2585:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.IDecorationService=a.IUnicodeService=a.IOscLinkService=a.IOptionsService=a.ILogService=a.LogLevelEnum=a.IInstantiationService=a.ICharsetService=a.ICoreService=a.ICoreMouseService=a.IBufferService=void 0;const u=c(8343);var g;a.IBufferService=(0,u.createDecorator)("BufferService"),a.ICoreMouseService=(0,u.createDecorator)("CoreMouseService"),a.ICoreService=(0,u.createDecorator)("CoreService"),a.ICharsetService=(0,u.createDecorator)("CharsetService"),a.IInstantiationService=(0,u.createDecorator)("InstantiationService"),function(d){d[d.TRACE=0]="TRACE",d[d.DEBUG=1]="DEBUG",d[d.INFO=2]="INFO",d[d.WARN=3]="WARN",d[d.ERROR=4]="ERROR",d[d.OFF=5]="OFF"}(g||(a.LogLevelEnum=g={})),a.ILogService=(0,u.createDecorator)("LogService"),a.IOptionsService=(0,u.createDecorator)("OptionsService"),a.IOscLinkService=(0,u.createDecorator)("OscLinkService"),a.IUnicodeService=(0,u.createDecorator)("UnicodeService"),a.IDecorationService=(0,u.createDecorator)("DecorationService")},1480:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeService=void 0;const u=c(8460),g=c(225);a.UnicodeService=class{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new u.EventEmitter,this.onChange=this._onChange.event;const d=new g.UnicodeV6;this.register(d),this._active=d.version,this._activeProvider=d}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(d){if(!this._providers[d])throw new Error(`unknown Unicode version "${d}"`);this._active=d,this._activeProvider=this._providers[d],this._onChange.fire(d)}register(d){this._providers[d.version]=d}wcwidth(d){return this._activeProvider.wcwidth(d)}getStringCellWidth(d){let _=0;const v=d.length;for(let x=0;x<v;++x){let y=d.charCodeAt(x);if(55296<=y&&y<=56319){if(++x>=v)return _+this.wcwidth(y);const f=d.charCodeAt(x);56320<=f&&f<=57343?y=1024*(y-55296)+f-56320+65536:_+=this.wcwidth(f)}_+=this.wcwidth(y)}return _}}}},n={};function s(l){var a=n[l];if(a!==void 0)return a.exports;var c=n[l]={exports:{}};return r[l].call(c.exports,c,c.exports,s),c.exports}var i={};return(()=>{var l=i;Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;const a=s(9042),c=s(3236),u=s(844),g=s(5741),d=s(8285),_=s(7975),v=s(7090),x=["cols","rows"];class y extends u.Disposable{constructor(p){super(),this._core=this.register(new c.Terminal(p)),this._addonManager=this.register(new g.AddonManager),this._publicOptions=Object.assign({},this._core.options);const h=b=>this._core.options[b],m=(b,w)=>{this._checkReadonlyOptions(b),this._core.options[b]=w};for(const b in this._core.options){const w={get:h.bind(this,b),set:m.bind(this,b)};Object.defineProperty(this._publicOptions,b,w)}}_checkReadonlyOptions(p){if(x.includes(p))throw new Error(`Option "${p}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new _.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new v.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new d.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const p=this._core.coreService.decPrivateModes;let h="none";switch(this._core.coreMouseService.activeProtocol){case"X10":h="x10";break;case"VT200":h="vt200";break;case"DRAG":h="drag";break;case"ANY":h="any"}return{applicationCursorKeysMode:p.applicationCursorKeys,applicationKeypadMode:p.applicationKeypad,bracketedPasteMode:p.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:h,originMode:p.origin,reverseWraparoundMode:p.reverseWraparound,sendFocusMode:p.sendFocus,wraparoundMode:p.wraparound}}get options(){return this._publicOptions}set options(p){for(const h in p)this._publicOptions[h]=p[h]}blur(){this._core.blur()}focus(){this._core.focus()}resize(p,h){this._verifyIntegers(p,h),this._core.resize(p,h)}open(p){this._core.open(p)}attachCustomKeyEventHandler(p){this._core.attachCustomKeyEventHandler(p)}registerLinkProvider(p){return this._core.registerLinkProvider(p)}registerCharacterJoiner(p){return this._checkProposedApi(),this._core.registerCharacterJoiner(p)}deregisterCharacterJoiner(p){this._checkProposedApi(),this._core.deregisterCharacterJoiner(p)}registerMarker(p=0){return this._verifyIntegers(p),this._core.registerMarker(p)}registerDecoration(p){var h,m,b;return this._checkProposedApi(),this._verifyPositiveIntegers((h=p.x)!==null&&h!==void 0?h:0,(m=p.width)!==null&&m!==void 0?m:0,(b=p.height)!==null&&b!==void 0?b:0),this._core.registerDecoration(p)}hasSelection(){return this._core.hasSelection()}select(p,h,m){this._verifyIntegers(p,h,m),this._core.select(p,h,m)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(p,h){this._verifyIntegers(p,h),this._core.selectLines(p,h)}dispose(){super.dispose()}scrollLines(p){this._verifyIntegers(p),this._core.scrollLines(p)}scrollPages(p){this._verifyIntegers(p),this._core.scrollPages(p)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(p){this._verifyIntegers(p),this._core.scrollToLine(p)}clear(){this._core.clear()}write(p,h){this._core.write(p,h)}writeln(p,h){this._core.write(p),this._core.write(`\r
196
+ `,h)}paste(p){this._core.paste(p)}refresh(p,h){this._verifyIntegers(p,h),this._core.refresh(p,h)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(p){this._addonManager.loadAddon(this,p)}static get strings(){return a}_verifyIntegers(...p){for(const h of p)if(h===1/0||isNaN(h)||h%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...p){for(const h of p)if(h&&(h===1/0||isNaN(h)||h%1!=0||h<0))throw new Error("This API only accepts positive integers")}}l.Terminal=y})(),i})())})(qw);var hP=qw.exports,Gw={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(self,()=>(()=>{var r={};return(()=>{var n=r;Object.defineProperty(n,"__esModule",{value:!0}),n.FitAddon=void 0,n.FitAddon=class{activate(s){this._terminal=s}dispose(){}fit(){const s=this.proposeDimensions();if(!s||!this._terminal||isNaN(s.cols)||isNaN(s.rows))return;const i=this._terminal._core;this._terminal.rows===s.rows&&this._terminal.cols===s.cols||(i._renderService.clear(),this._terminal.resize(s.cols,s.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const s=this._terminal._core,i=s._renderService.dimensions;if(i.css.cell.width===0||i.css.cell.height===0)return;const l=this._terminal.options.scrollback===0?0:s.viewport.scrollBarWidth,a=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(a.getPropertyValue("height")),u=Math.max(0,parseInt(a.getPropertyValue("width"))),g=window.getComputedStyle(this._terminal.element),d=c-(parseInt(g.getPropertyValue("padding-top"))+parseInt(g.getPropertyValue("padding-bottom"))),_=u-(parseInt(g.getPropertyValue("padding-right"))+parseInt(g.getPropertyValue("padding-left")))-l;return{cols:Math.max(2,Math.floor(_/i.css.cell.width)),rows:Math.max(1,Math.floor(d/i.css.cell.height))}}}})(),r})())})(Gw);var fP=Gw.exports,Qw={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(self,()=>(()=>{var r={6:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.LinkComputer=a.WebLinkProvider=void 0,a.WebLinkProvider=class{constructor(u,g,d,_={}){this._terminal=u,this._regex=g,this._handler=d,this._options=_}provideLinks(u,g){const d=c.computeLink(u,this._regex,this._terminal,this._handler);g(this._addCallbacks(d))}_addCallbacks(u){return u.map(g=>(g.leave=this._options.leave,g.hover=(d,_)=>{if(this._options.hover){const{range:v}=g;this._options.hover(d,_,v)}},g))}};class c{static computeLink(g,d,_,v){const x=new RegExp(d.source,(d.flags||"")+"g"),[y,f]=c._getWindowedLineStrings(g-1,_),p=y.join("");let h;const m=[];for(;h=x.exec(p);){const b=h[0];try{const R=new URL(b),M=decodeURI(R.toString());if(b!==M&&b+"/"!==M)continue}catch{continue}const[w,k]=c._mapStrIdx(_,f,0,h.index),[j,S]=c._mapStrIdx(_,w,k,b.length);if(w===-1||k===-1||j===-1||S===-1)continue;const E={start:{x:k+1,y:w+1},end:{x:S,y:j+1}};m.push({range:E,text:b,activate:v})}return m}static _getWindowedLineStrings(g,d){let _,v=g,x=g,y=0,f="";const p=[];if(_=d.buffer.active.getLine(g)){const h=_.translateToString(!0);if(_.isWrapped&&h[0]!==" "){for(y=0;(_=d.buffer.active.getLine(--v))&&y<2048&&(f=_.translateToString(!0),y+=f.length,p.push(f),_.isWrapped&&f.indexOf(" ")===-1););p.reverse()}for(p.push(h),y=0;(_=d.buffer.active.getLine(++x))&&_.isWrapped&&y<2048&&(f=_.translateToString(!0),y+=f.length,p.push(f),f.indexOf(" ")===-1););}return[p,v]}static _mapStrIdx(g,d,_,v){const x=g.buffer.active,y=x.getNullCell();let f=_;for(;v;){const p=x.getLine(d);if(!p)return[-1,-1];for(let h=f;h<p.length;++h){p.getCell(h,y);const m=y.getChars();if(y.getWidth()&&(v-=m.length||1,h===p.length-1&&m==="")){const b=x.getLine(d+1);b&&b.isWrapped&&(b.getCell(0,y),y.getWidth()===2&&(v+=1))}if(v<0)return[d,h]}d++,f=0}return[d,f]}}a.LinkComputer=c}},n={};function s(l){var a=n[l];if(a!==void 0)return a.exports;var c=n[l]={exports:{}};return r[l](c,c.exports,s),c.exports}var i={};return(()=>{var l=i;Object.defineProperty(l,"__esModule",{value:!0}),l.WebLinksAddon=void 0;const a=s(6),c=/https?:[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function u(g,d){const _=window.open();if(_){try{_.opener=null}catch{}_.location.href=d}else console.warn("Opening link blocked as opener could not be cleared")}l.WebLinksAddon=class{constructor(g=u,d={}){this._handler=g,this._options=d}activate(g){this._terminal=g;const d=this._options,_=d.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new a.WebLinkProvider(this._terminal,_,this._handler,d))}dispose(){var g;(g=this._linkProvider)===null||g===void 0||g.dispose()}}})(),i})())})(Qw);var pP=Qw.exports;const mP=ld("inline-flex items-center rounded-sm border px-1.5 py-0.5 font-mono text-[10px] font-medium uppercase tracking-[0.14em] transition-colors",{variants:{variant:{default:"border-transparent bg-[var(--accent-sky)] text-[var(--bg-sunken)]",secondary:"border-transparent bg-[var(--bg-sunken)] text-[var(--fg-muted)]",destructive:"border-[var(--severity-blocking-border)] bg-[var(--severity-blocking-bg)] text-[var(--severity-blocking-fg)]",warning:"border-[var(--severity-warning-border)] bg-[var(--severity-warning-bg)] text-[var(--severity-warning-fg)]",success:"border-[var(--severity-success-border)] bg-[var(--severity-success-bg)] text-[var(--severity-success-fg)]",outline:"border-[var(--border)] bg-transparent text-[var(--fg)]",pill:"rounded-full border-[var(--wane)] bg-transparent text-[var(--wane)] normal-case tracking-[0.12em] px-1.5"}},defaultVariants:{variant:"default"}});function je({className:e,variant:t,...r}){return o.jsx("span",{className:X(mP({variant:t}),e),...r})}function Yw({agentGated:e=!1}={}){const t=C.useRef(null),[r,n]=C.useState(null),[s,i]=C.useState(!1),[l,a]=C.useState(!1),[c,u]=C.useState(null);C.useEffect(()=>{if(!t.current)return;let d=!1,_=null,v=null,x=null;const y=window.location.protocol==="https:"?"wss":"ws",f=new WebSocket(`${y}://${window.location.host}/api/agent/ws`),p=()=>{if(v||!t.current)return v;const h=new hP.Terminal({fontFamily:'"JetBrains Mono", ui-monospace, Menlo, monospace',fontSize:13,lineHeight:1.3,letterSpacing:0,theme:{background:"#070d18",foreground:"#f2f7fc",cursor:"#dcb866",selectionBackground:"#1f3a66",black:"#0c1628",red:"#a85a5a",green:"#6a9b8f",yellow:"#dcb866",blue:"#7aa7dc",magenta:"#7a6db0",cyan:"#a8c8ea",white:"#a4b0c2",brightBlack:"#33394a",brightRed:"#c87a7a",brightGreen:"#8abbaf",brightYellow:"#ead08e",brightBlue:"#a8c8ea",brightMagenta:"#9a8dd0",brightCyan:"#cbdef3",brightWhite:"#f2f7fc"},convertEol:!0,scrollback:5e3,allowProposedApi:!0}),m=new fP.FitAddon;h.loadAddon(m),h.loadAddon(new pP.WebLinksAddon),h.open(t.current);const b=()=>{if(!(d||!t.current)&&!(t.current.offsetWidth===0||t.current.offsetHeight===0))try{m.fit()}catch{}};return _=window.requestAnimationFrame(b),x=new ResizeObserver(()=>{b()}),x.observe(t.current),h.onData(w=>{f.readyState===WebSocket.OPEN&&f.send(JSON.stringify({kind:"input",data:w}))}),h.onResize(({cols:w,rows:k})=>{f.readyState===WebSocket.OPEN&&f.send(JSON.stringify({kind:"resize",cols:w,rows:k}))}),v=h,h};return f.onopen=()=>{i(!0),p()},f.onclose=()=>i(!1),f.onerror=()=>i(!1),f.onmessage=h=>{try{const m=JSON.parse(h.data);m.kind==="data"&&typeof m.data=="string"?v==null||v.write(m.data):m.kind==="meta"?(n({active:!!m.autoMode,reason:m.reason??""}),typeof m.agentReady=="boolean"&&a(m.agentReady)):m.kind==="auth_url"&&typeof m.url=="string"||(m.kind==="error"?m.recoverable&&m.remediation?u({message:m.message??"agent failed to start",remediation:m.remediation}):v==null||v.write(`\r
197
+ \x1B[31m[error] ${m.message??"unknown error"}\x1B[0m\r
198
+ `):m.kind==="exit"&&(v==null||v.write(`\r
199
+ \x1B[33m[claude session exited]\x1B[0m\r
200
+ `)))}catch{}},()=>{d=!0,_!==null&&window.cancelAnimationFrame(_),f.close(),x==null||x.disconnect(),v==null||v.dispose()}},[]);const g=e&&!l;return o.jsxs("div",{className:"flex h-full w-full flex-col bg-[var(--bg-sunken)]",children:[o.jsxs("div",{className:"flex items-center justify-between border-b border-border bg-[var(--bg-elevated)] px-4 py-2",children:[o.jsx("span",{className:X("font-mono text-[11px] tracking-[0.05em]",s?"text-[var(--vow-green)]":"text-[var(--fg-dim)]"),children:s?"● connected":"○ disconnected"}),r&&o.jsx(je,{variant:r.active?"warning":"secondary",title:r.active?"Claude Code Auto Mode is active":r.reason,children:r.active?"Auto Mode":"Default permissions"})]}),c&&o.jsxs(rt,{variant:"blocking",className:"m-3 flex flex-col gap-2",children:[o.jsx(Dt,{className:"text-[var(--break-red)]",children:"Agent panel unavailable"}),o.jsx(it,{className:"font-mono text-xs text-[var(--fg-muted)]",children:c.message}),c.remediation&&o.jsxs("p",{className:"font-mono text-xs text-[var(--fg-dim)]",children:[o.jsx("span",{className:"text-[var(--fg-muted)]",children:"Fix · "}),c.remediation]})]}),o.jsx("div",{ref:t,className:X("w-full flex-1 bg-[var(--bg-sunken)] p-3","min-h-[400px]",g&&"invisible hidden")}),g&&!c&&o.jsx(gP,{})]})}function gP(){return o.jsx("div",{className:"flex w-full flex-1 items-center justify-center bg-[var(--bg-sunken)] px-6",children:o.jsxs("div",{className:"flex max-w-[34ch] flex-col items-center gap-4 text-center",children:[o.jsx("span",{"aria-hidden":"true",className:"jinn-anim-pulse h-2 w-2 rounded-full bg-[var(--seer-violet)]"}),o.jsx("p",{className:"font-mono text-xs text-[var(--fg-muted)]",children:"The agent will come online once harness setup is complete."})]})})}const vP={pluginBuilderUi:!1,embeddedAgent:!1};function Bm(){const e=typeof window>"u"?void 0:window.__JINN_FEATURES__;return!e||typeof e!="object"?vP:{pluginBuilderUi:e.pluginBuilderUi===!0,embeddedAgent:e.embeddedAgent===!0}}function _P({envelope:e,chainExplorerBase:t}){const r=xP(e),n=yP(e.generatedAt),[s,i]=C.useState("idle"),[l,a]=C.useState(null),c=e.details,g=(typeof(c==null?void 0:c.category)=="string"?c.category:void 0)==="insufficient_funds",d=typeof(c==null?void 0:c.address)=="string"?c.address:null,_=typeof(c==null?void 0:c.requiredWei)=="string"?c.requiredWei:typeof(c==null?void 0:c.needWei)=="string"?c.needWei:null,v=typeof(c==null?void 0:c.haveWei)=="string"?c.haveWei:null,y=(typeof(c==null?void 0:c.txHash)=="string"?c.txHash:null)??r,f=C.useCallback(async()=>{i("retrying"),a(null);try{await ge.retryBootstrap(),i("success")}catch(p){i("error"),a(p instanceof Error?p.message:String(p))}},[]);return o.jsxs(rt,{variant:"blocking",className:"flex flex-col gap-3 px-5 py-4",children:[o.jsxs("div",{className:"flex items-baseline justify-between",children:[o.jsxs(Dt,{className:"text-[var(--break-red)]",children:["Bootstrap halted · ",e.code]}),n&&o.jsx("span",{className:"font-mono text-[10px] text-[var(--fg-dim)]",children:n})]}),o.jsx(it,{className:"break-words font-mono text-xs text-foreground",children:e.message}),g&&d&&o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx(bc,{label:"Send ETH to",children:d}),_&&o.jsx(bc,{label:"Required",children:ih(_)}),v&&o.jsx(bc,{label:"Currently have",children:ih(v)}),_&&v&&o.jsx(bc,{label:"Shortfall",children:ih((BigInt(_)-BigInt(v)).toString())})]}),!g&&e.hint&&o.jsxs("p",{className:"font-mono text-xs text-[var(--fg-muted)]",children:[o.jsx("span",{className:"text-[var(--fg-dim)]",children:"Fix · "}),e.hint]}),y&&o.jsx(ae,{asChild:!0,variant:"link",size:"sm",className:"self-start px-0",children:o.jsxs("a",{href:`${t}/tx/${y}`,target:"_blank",rel:"noopener noreferrer",children:["view failed tx",o.jsx(jo,{})]})}),o.jsxs("div",{className:"mt-1 flex items-center gap-3",children:[o.jsx(ae,{variant:"destructive",size:"sm",type:"button",onClick:()=>{f()},disabled:s==="retrying",children:s==="retrying"?"Retrying…":s==="success"?"Resuming…":"Retry"}),s==="success"&&o.jsx("span",{className:"font-mono text-[11px] text-[var(--fg-muted)]",children:"Daemon resumed — waiting for bootstrap to complete"}),s==="error"&&l&&o.jsx("span",{className:"font-mono text-[11px] text-[var(--break-red)]",children:l})]}),s==="idle"&&o.jsxs("p",{className:"font-mono text-[11px] text-[var(--fg-dim)]",children:["Once you've addressed the cause above, click Retry or"," ",o.jsx("code",{className:"text-[var(--fg-muted)]",children:"jinn run"})," to resume from the persisted state."]})]})}function bc({label:e,children:t}){return o.jsxs("div",{className:"flex items-baseline gap-2",children:[o.jsx("span",{className:"min-w-[100px] shrink-0 font-mono text-[11px] text-[var(--fg-dim)]",children:e}),o.jsx("span",{className:"break-all font-mono text-[11px] text-foreground",children:t})]})}function ih(e){try{const t=BigInt(e),r=Number(t)/1e18;return r===0?"0 ETH":r<1e-6?`${t} wei`:`${r.toFixed(6).replace(/\.?0+$/,"")} ETH`}catch{return e}}function xP(e){var r,n;const t=[(r=e.details)==null?void 0:r.txHash,(n=e.details)==null?void 0:n.cause,e.message];for(const s of t){if(typeof s!="string")continue;const i=/(0x[a-fA-F0-9]{64})/.exec(s);if(i)return i[1]}return null}function yP(e){try{const t=Date.now()-Date.parse(e);if(!Number.isFinite(t)||t<0)return null;const r=Math.round(t/1e3);if(r<60)return`${r}s ago`;const n=Math.round(r/60);return n<60?`${n}m ago`:`${Math.round(n/60)}h ago`}catch{return null}}function bP(e,t=globalThis==null?void 0:globalThis.document){const r=Ht(e);C.useEffect(()=>{const n=s=>{s.key==="Escape"&&r(s)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var wP="DismissableLayer",Hf="dismissableLayer.update",SP="dismissableLayer.pointerDownOutside",CP="dismissableLayer.focusOutside",x_,Zw=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ul=C.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:l,onDismiss:a,...c}=e,u=C.useContext(Zw),[g,d]=C.useState(null),_=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=C.useState({}),x=Be(t,j=>d(j)),y=Array.from(u.layers),[f]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),p=y.indexOf(f),h=g?y.indexOf(g):-1,m=u.layersWithOutsidePointerEventsDisabled.size>0,b=h>=p,w=jP(j=>{const S=j.target,E=[...u.branches].some(R=>R.contains(S));!b||E||(s==null||s(j),l==null||l(j),j.defaultPrevented||a==null||a())},_),k=NP(j=>{const S=j.target;[...u.branches].some(R=>R.contains(S))||(i==null||i(j),l==null||l(j),j.defaultPrevented||a==null||a())},_);return bP(j=>{h===u.layers.size-1&&(n==null||n(j),!j.defaultPrevented&&a&&(j.preventDefault(),a()))},_),C.useEffect(()=>{if(g)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(x_=_.body.style.pointerEvents,_.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(g)),u.layers.add(g),y_(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(_.body.style.pointerEvents=x_)}},[g,_,r,u]),C.useEffect(()=>()=>{g&&(u.layers.delete(g),u.layersWithOutsidePointerEventsDisabled.delete(g),y_())},[g,u]),C.useEffect(()=>{const j=()=>v({});return document.addEventListener(Hf,j),()=>document.removeEventListener(Hf,j)},[]),o.jsx($e.div,{...c,ref:x,style:{pointerEvents:m?b?"auto":"none":void 0,...e.style},onFocusCapture:_e(e.onFocusCapture,k.onFocusCapture),onBlurCapture:_e(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:_e(e.onPointerDownCapture,w.onPointerDownCapture)})});Ul.displayName=wP;var kP="DismissableLayerBranch",EP=C.forwardRef((e,t)=>{const r=C.useContext(Zw),n=C.useRef(null),s=Be(t,n);return C.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),o.jsx($e.div,{...e,ref:s})});EP.displayName=kP;function jP(e,t=globalThis==null?void 0:globalThis.document){const r=Ht(e),n=C.useRef(!1),s=C.useRef(()=>{});return C.useEffect(()=>{const i=a=>{if(a.target&&!n.current){let c=function(){Xw(SP,r,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);n.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",i),t.removeEventListener("click",s.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function NP(e,t=globalThis==null?void 0:globalThis.document){const r=Ht(e),n=C.useRef(!1);return C.useEffect(()=>{const s=i=>{i.target&&!n.current&&Xw(CP,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function y_(){const e=new CustomEvent(Hf);document.dispatchEvent(e)}function Xw(e,t,r,{discrete:n}){const s=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?kw(s,i):s.dispatchEvent(i)}var RP=Wu[" useId ".trim().toString()]||(()=>{}),PP=0;function Us(e){const[t,r]=C.useState(RP());return Jn(()=>{r(n=>n??String(PP++))},[e]),t?`radix-${t}`:""}const TP=["top","right","bottom","left"],Qs=Math.min,vr=Math.max,ku=Math.round,wc=Math.floor,En=e=>({x:e,y:e}),AP={left:"right",right:"left",bottom:"top",top:"bottom"};function zf(e,t,r){return vr(e,Qs(t,r))}function es(e,t){return typeof e=="function"?e(t):e}function ts(e){return e.split("-")[0]}function pa(e){return e.split("-")[1]}function $m(e){return e==="x"?"y":"x"}function Hm(e){return e==="y"?"height":"width"}function Sn(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function zm(e){return $m(Sn(e))}function DP(e,t,r){r===void 0&&(r=!1);const n=pa(e),s=zm(e),i=Hm(s);let l=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=Eu(l)),[l,Eu(l)]}function LP(e){const t=Eu(e);return[Uf(e),t,Uf(t)]}function Uf(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const b_=["left","right"],w_=["right","left"],MP=["top","bottom"],OP=["bottom","top"];function IP(e,t,r){switch(e){case"top":case"bottom":return r?t?w_:b_:t?b_:w_;case"left":case"right":return t?MP:OP;default:return[]}}function FP(e,t,r,n){const s=pa(e);let i=IP(ts(e),r==="start",n);return s&&(i=i.map(l=>l+"-"+s),t&&(i=i.concat(i.map(Uf)))),i}function Eu(e){const t=ts(e);return AP[t]+e.slice(t.length)}function BP(e){return{top:0,right:0,bottom:0,left:0,...e}}function Jw(e){return typeof e!="number"?BP(e):{top:e,right:e,bottom:e,left:e}}function ju(e){const{x:t,y:r,width:n,height:s}=e;return{width:n,height:s,top:r,left:t,right:t+n,bottom:r+s,x:t,y:r}}function S_(e,t,r){let{reference:n,floating:s}=e;const i=Sn(t),l=zm(t),a=Hm(l),c=ts(t),u=i==="y",g=n.x+n.width/2-s.width/2,d=n.y+n.height/2-s.height/2,_=n[a]/2-s[a]/2;let v;switch(c){case"top":v={x:g,y:n.y-s.height};break;case"bottom":v={x:g,y:n.y+n.height};break;case"right":v={x:n.x+n.width,y:d};break;case"left":v={x:n.x-s.width,y:d};break;default:v={x:n.x,y:n.y}}switch(pa(t)){case"start":v[l]-=_*(r&&u?-1:1);break;case"end":v[l]+=_*(r&&u?-1:1);break}return v}async function $P(e,t){var r;t===void 0&&(t={});const{x:n,y:s,platform:i,rects:l,elements:a,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:g="viewport",elementContext:d="floating",altBoundary:_=!1,padding:v=0}=es(t,e),x=Jw(v),f=a[_?d==="floating"?"reference":"floating":d],p=ju(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(f)))==null||r?f:f.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:u,rootBoundary:g,strategy:c})),h=d==="floating"?{x:n,y:s,width:l.floating.width,height:l.floating.height}:l.reference,m=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),b=await(i.isElement==null?void 0:i.isElement(m))?await(i.getScale==null?void 0:i.getScale(m))||{x:1,y:1}:{x:1,y:1},w=ju(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:h,offsetParent:m,strategy:c}):h);return{top:(p.top-w.top+x.top)/b.y,bottom:(w.bottom-p.bottom+x.bottom)/b.y,left:(p.left-w.left+x.left)/b.x,right:(w.right-p.right+x.right)/b.x}}const HP=50,zP=async(e,t,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:i=[],platform:l}=r,a=l.detectOverflow?l:{...l,detectOverflow:$P},c=await(l.isRTL==null?void 0:l.isRTL(t));let u=await l.getElementRects({reference:e,floating:t,strategy:s}),{x:g,y:d}=S_(u,n,c),_=n,v=0;const x={};for(let y=0;y<i.length;y++){const f=i[y];if(!f)continue;const{name:p,fn:h}=f,{x:m,y:b,data:w,reset:k}=await h({x:g,y:d,initialPlacement:n,placement:_,strategy:s,middlewareData:x,rects:u,platform:a,elements:{reference:e,floating:t}});g=m??g,d=b??d,x[p]={...x[p],...w},k&&v<HP&&(v++,typeof k=="object"&&(k.placement&&(_=k.placement),k.rects&&(u=k.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:s}):k.rects),{x:g,y:d}=S_(u,_,c)),y=-1)}return{x:g,y:d,placement:_,strategy:s,middlewareData:x}},UP=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:s,rects:i,platform:l,elements:a,middlewareData:c}=t,{element:u,padding:g=0}=es(e,t)||{};if(u==null)return{};const d=Jw(g),_={x:r,y:n},v=zm(s),x=Hm(v),y=await l.getDimensions(u),f=v==="y",p=f?"top":"left",h=f?"bottom":"right",m=f?"clientHeight":"clientWidth",b=i.reference[x]+i.reference[v]-_[v]-i.floating[x],w=_[v]-i.reference[v],k=await(l.getOffsetParent==null?void 0:l.getOffsetParent(u));let j=k?k[m]:0;(!j||!await(l.isElement==null?void 0:l.isElement(k)))&&(j=a.floating[m]||i.floating[x]);const S=b/2-w/2,E=j/2-y[x]/2-1,R=Qs(d[p],E),M=Qs(d[h],E),A=R,L=j-y[x]-M,B=j/2-y[x]/2+S,U=zf(A,B,L),W=!c.arrow&&pa(s)!=null&&B!==U&&i.reference[x]/2-(B<A?R:M)-y[x]/2<0,q=W?B<A?B-A:B-L:0;return{[v]:_[v]+q,data:{[v]:U,centerOffset:B-U-q,...W&&{alignmentOffset:q}},reset:W}}}),WP=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:s,middlewareData:i,rects:l,initialPlacement:a,platform:c,elements:u}=t,{mainAxis:g=!0,crossAxis:d=!0,fallbackPlacements:_,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:y=!0,...f}=es(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const p=ts(s),h=Sn(a),m=ts(a)===a,b=await(c.isRTL==null?void 0:c.isRTL(u.floating)),w=_||(m||!y?[Eu(a)]:LP(a)),k=x!=="none";!_&&k&&w.push(...FP(a,y,x,b));const j=[a,...w],S=await c.detectOverflow(t,f),E=[];let R=((n=i.flip)==null?void 0:n.overflows)||[];if(g&&E.push(S[p]),d){const B=DP(s,l,b);E.push(S[B[0]],S[B[1]])}if(R=[...R,{placement:s,overflows:E}],!E.every(B=>B<=0)){var M,A;const B=(((M=i.flip)==null?void 0:M.index)||0)+1,U=j[B];if(U&&(!(d==="alignment"?h!==Sn(U):!1)||R.every(N=>Sn(N.placement)===h?N.overflows[0]>0:!0)))return{data:{index:B,overflows:R},reset:{placement:U}};let W=(A=R.filter(q=>q.overflows[0]<=0).sort((q,N)=>q.overflows[1]-N.overflows[1])[0])==null?void 0:A.placement;if(!W)switch(v){case"bestFit":{var L;const q=(L=R.filter(N=>{if(k){const T=Sn(N.placement);return T===h||T==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(T=>T>0).reduce((T,D)=>T+D,0)]).sort((N,T)=>N[1]-T[1])[0])==null?void 0:L[0];q&&(W=q);break}case"initialPlacement":W=a;break}if(s!==W)return{reset:{placement:W}}}return{}}}};function C_(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function k_(e){return TP.some(t=>e[t]>=0)}const VP=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:s="referenceHidden",...i}=es(e,t);switch(s){case"referenceHidden":{const l=await n.detectOverflow(t,{...i,elementContext:"reference"}),a=C_(l,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:k_(a)}}}case"escaped":{const l=await n.detectOverflow(t,{...i,altBoundary:!0}),a=C_(l,r.floating);return{data:{escapedOffsets:a,escaped:k_(a)}}}default:return{}}}}},eS=new Set(["left","top"]);async function qP(e,t){const{placement:r,platform:n,elements:s}=e,i=await(n.isRTL==null?void 0:n.isRTL(s.floating)),l=ts(r),a=pa(r),c=Sn(r)==="y",u=eS.has(l)?-1:1,g=i&&c?-1:1,d=es(t,e);let{mainAxis:_,crossAxis:v,alignmentAxis:x}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof x=="number"&&(v=a==="end"?x*-1:x),c?{x:v*g,y:_*u}:{x:_*u,y:v*g}}const KP=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:s,y:i,placement:l,middlewareData:a}=t,c=await qP(t,e);return l===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:s+c.x,y:i+c.y,data:{...c,placement:l}}}}},GP=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:s,platform:i}=t,{mainAxis:l=!0,crossAxis:a=!1,limiter:c={fn:p=>{let{x:h,y:m}=p;return{x:h,y:m}}},...u}=es(e,t),g={x:r,y:n},d=await i.detectOverflow(t,u),_=Sn(ts(s)),v=$m(_);let x=g[v],y=g[_];if(l){const p=v==="y"?"top":"left",h=v==="y"?"bottom":"right",m=x+d[p],b=x-d[h];x=zf(m,x,b)}if(a){const p=_==="y"?"top":"left",h=_==="y"?"bottom":"right",m=y+d[p],b=y-d[h];y=zf(m,y,b)}const f=c.fn({...t,[v]:x,[_]:y});return{...f,data:{x:f.x-r,y:f.y-n,enabled:{[v]:l,[_]:a}}}}}},QP=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:s,rects:i,middlewareData:l}=t,{offset:a=0,mainAxis:c=!0,crossAxis:u=!0}=es(e,t),g={x:r,y:n},d=Sn(s),_=$m(d);let v=g[_],x=g[d];const y=es(a,t),f=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(c){const m=_==="y"?"height":"width",b=i.reference[_]-i.floating[m]+f.mainAxis,w=i.reference[_]+i.reference[m]-f.mainAxis;v<b?v=b:v>w&&(v=w)}if(u){var p,h;const m=_==="y"?"width":"height",b=eS.has(ts(s)),w=i.reference[d]-i.floating[m]+(b&&((p=l.offset)==null?void 0:p[d])||0)+(b?0:f.crossAxis),k=i.reference[d]+i.reference[m]+(b?0:((h=l.offset)==null?void 0:h[d])||0)-(b?f.crossAxis:0);x<w?x=w:x>k&&(x=k)}return{[_]:v,[d]:x}}}},YP=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:s,rects:i,platform:l,elements:a}=t,{apply:c=()=>{},...u}=es(e,t),g=await l.detectOverflow(t,u),d=ts(s),_=pa(s),v=Sn(s)==="y",{width:x,height:y}=i.floating;let f,p;d==="top"||d==="bottom"?(f=d,p=_===(await(l.isRTL==null?void 0:l.isRTL(a.floating))?"start":"end")?"left":"right"):(p=d,f=_==="end"?"top":"bottom");const h=y-g.top-g.bottom,m=x-g.left-g.right,b=Qs(y-g[f],h),w=Qs(x-g[p],m),k=!t.middlewareData.shift;let j=b,S=w;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(S=m),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(j=h),k&&!_){const R=vr(g.left,0),M=vr(g.right,0),A=vr(g.top,0),L=vr(g.bottom,0);v?S=x-2*(R!==0||M!==0?R+M:vr(g.left,g.right)):j=y-2*(A!==0||L!==0?A+L:vr(g.top,g.bottom))}await c({...t,availableWidth:S,availableHeight:j});const E=await l.getDimensions(a.floating);return x!==E.width||y!==E.height?{reset:{rects:!0}}:{}}}};function dd(){return typeof window<"u"}function ma(e){return tS(e)?(e.nodeName||"").toLowerCase():"#document"}function yr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Tn(e){var t;return(t=(tS(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function tS(e){return dd()?e instanceof Node||e instanceof yr(e).Node:!1}function un(e){return dd()?e instanceof Element||e instanceof yr(e).Element:!1}function is(e){return dd()?e instanceof HTMLElement||e instanceof yr(e).HTMLElement:!1}function E_(e){return!dd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof yr(e).ShadowRoot}function Wl(e){const{overflow:t,overflowX:r,overflowY:n,display:s}=dn(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&s!=="inline"&&s!=="contents"}function ZP(e){return/^(table|td|th)$/.test(ma(e))}function hd(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const XP=/transform|translate|scale|rotate|perspective|filter/,JP=/paint|layout|strict|content/,oi=e=>!!e&&e!=="none";let oh;function Um(e){const t=un(e)?dn(e):e;return oi(t.transform)||oi(t.translate)||oi(t.scale)||oi(t.rotate)||oi(t.perspective)||!Wm()&&(oi(t.backdropFilter)||oi(t.filter))||XP.test(t.willChange||"")||JP.test(t.contain||"")}function eT(e){let t=Ys(e);for(;is(t)&&!ta(t);){if(Um(t))return t;if(hd(t))return null;t=Ys(t)}return null}function Wm(){return oh==null&&(oh=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),oh}function ta(e){return/^(html|body|#document)$/.test(ma(e))}function dn(e){return yr(e).getComputedStyle(e)}function fd(e){return un(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ys(e){if(ma(e)==="html")return e;const t=e.assignedSlot||e.parentNode||E_(e)&&e.host||Tn(e);return E_(t)?t.host:t}function rS(e){const t=Ys(e);return ta(t)?e.ownerDocument?e.ownerDocument.body:e.body:is(t)&&Wl(t)?t:rS(t)}function Cl(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const s=rS(e),i=s===((n=e.ownerDocument)==null?void 0:n.body),l=yr(s);if(i){const a=Wf(l);return t.concat(l,l.visualViewport||[],Wl(s)?s:[],a&&r?Cl(a):[])}else return t.concat(s,Cl(s,[],r))}function Wf(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function nS(e){const t=dn(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const s=is(e),i=s?e.offsetWidth:r,l=s?e.offsetHeight:n,a=ku(r)!==i||ku(n)!==l;return a&&(r=i,n=l),{width:r,height:n,$:a}}function Vm(e){return un(e)?e:e.contextElement}function Ro(e){const t=Vm(e);if(!is(t))return En(1);const r=t.getBoundingClientRect(),{width:n,height:s,$:i}=nS(t);let l=(i?ku(r.width):r.width)/n,a=(i?ku(r.height):r.height)/s;return(!l||!Number.isFinite(l))&&(l=1),(!a||!Number.isFinite(a))&&(a=1),{x:l,y:a}}const tT=En(0);function sS(e){const t=yr(e);return!Wm()||!t.visualViewport?tT:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function rT(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==yr(e)?!1:t}function Mi(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),i=Vm(e);let l=En(1);t&&(n?un(n)&&(l=Ro(n)):l=Ro(e));const a=rT(i,r,n)?sS(i):En(0);let c=(s.left+a.x)/l.x,u=(s.top+a.y)/l.y,g=s.width/l.x,d=s.height/l.y;if(i){const _=yr(i),v=n&&un(n)?yr(n):n;let x=_,y=Wf(x);for(;y&&n&&v!==x;){const f=Ro(y),p=y.getBoundingClientRect(),h=dn(y),m=p.left+(y.clientLeft+parseFloat(h.paddingLeft))*f.x,b=p.top+(y.clientTop+parseFloat(h.paddingTop))*f.y;c*=f.x,u*=f.y,g*=f.x,d*=f.y,c+=m,u+=b,x=yr(y),y=Wf(x)}}return ju({width:g,height:d,x:c,y:u})}function pd(e,t){const r=fd(e).scrollLeft;return t?t.left+r:Mi(Tn(e)).left+r}function iS(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-pd(e,r),s=r.top+t.scrollTop;return{x:n,y:s}}function nT(e){let{elements:t,rect:r,offsetParent:n,strategy:s}=e;const i=s==="fixed",l=Tn(n),a=t?hd(t.floating):!1;if(n===l||a&&i)return r;let c={scrollLeft:0,scrollTop:0},u=En(1);const g=En(0),d=is(n);if((d||!d&&!i)&&((ma(n)!=="body"||Wl(l))&&(c=fd(n)),d)){const v=Mi(n);u=Ro(n),g.x=v.x+n.clientLeft,g.y=v.y+n.clientTop}const _=l&&!d&&!i?iS(l,c):En(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-c.scrollLeft*u.x+g.x+_.x,y:r.y*u.y-c.scrollTop*u.y+g.y+_.y}}function sT(e){return Array.from(e.getClientRects())}function iT(e){const t=Tn(e),r=fd(e),n=e.ownerDocument.body,s=vr(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=vr(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let l=-r.scrollLeft+pd(e);const a=-r.scrollTop;return dn(n).direction==="rtl"&&(l+=vr(t.clientWidth,n.clientWidth)-s),{width:s,height:i,x:l,y:a}}const j_=25;function oT(e,t){const r=yr(e),n=Tn(e),s=r.visualViewport;let i=n.clientWidth,l=n.clientHeight,a=0,c=0;if(s){i=s.width,l=s.height;const g=Wm();(!g||g&&t==="fixed")&&(a=s.offsetLeft,c=s.offsetTop)}const u=pd(n);if(u<=0){const g=n.ownerDocument,d=g.body,_=getComputedStyle(d),v=g.compatMode==="CSS1Compat"&&parseFloat(_.marginLeft)+parseFloat(_.marginRight)||0,x=Math.abs(n.clientWidth-d.clientWidth-v);x<=j_&&(i-=x)}else u<=j_&&(i+=u);return{width:i,height:l,x:a,y:c}}function aT(e,t){const r=Mi(e,!0,t==="fixed"),n=r.top+e.clientTop,s=r.left+e.clientLeft,i=is(e)?Ro(e):En(1),l=e.clientWidth*i.x,a=e.clientHeight*i.y,c=s*i.x,u=n*i.y;return{width:l,height:a,x:c,y:u}}function N_(e,t,r){let n;if(t==="viewport")n=oT(e,r);else if(t==="document")n=iT(Tn(e));else if(un(t))n=aT(t,r);else{const s=sS(e);n={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return ju(n)}function oS(e,t){const r=Ys(e);return r===t||!un(r)||ta(r)?!1:dn(r).position==="fixed"||oS(r,t)}function lT(e,t){const r=t.get(e);if(r)return r;let n=Cl(e,[],!1).filter(a=>un(a)&&ma(a)!=="body"),s=null;const i=dn(e).position==="fixed";let l=i?Ys(e):e;for(;un(l)&&!ta(l);){const a=dn(l),c=Um(l);!c&&a.position==="fixed"&&(s=null),(i?!c&&!s:!c&&a.position==="static"&&!!s&&(s.position==="absolute"||s.position==="fixed")||Wl(l)&&!c&&oS(e,l))?n=n.filter(g=>g!==l):s=a,l=Ys(l)}return t.set(e,n),n}function cT(e){let{element:t,boundary:r,rootBoundary:n,strategy:s}=e;const l=[...r==="clippingAncestors"?hd(t)?[]:lT(t,this._c):[].concat(r),n],a=N_(t,l[0],s);let c=a.top,u=a.right,g=a.bottom,d=a.left;for(let _=1;_<l.length;_++){const v=N_(t,l[_],s);c=vr(v.top,c),u=Qs(v.right,u),g=Qs(v.bottom,g),d=vr(v.left,d)}return{width:u-d,height:g-c,x:d,y:c}}function uT(e){const{width:t,height:r}=nS(e);return{width:t,height:r}}function dT(e,t,r){const n=is(t),s=Tn(t),i=r==="fixed",l=Mi(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const c=En(0);function u(){c.x=pd(s)}if(n||!n&&!i)if((ma(t)!=="body"||Wl(s))&&(a=fd(t)),n){const v=Mi(t,!0,i,t);c.x=v.x+t.clientLeft,c.y=v.y+t.clientTop}else s&&u();i&&!n&&s&&u();const g=s&&!n&&!i?iS(s,a):En(0),d=l.left+a.scrollLeft-c.x-g.x,_=l.top+a.scrollTop-c.y-g.y;return{x:d,y:_,width:l.width,height:l.height}}function ah(e){return dn(e).position==="static"}function R_(e,t){if(!is(e)||dn(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Tn(e)===r&&(r=r.ownerDocument.body),r}function aS(e,t){const r=yr(e);if(hd(e))return r;if(!is(e)){let s=Ys(e);for(;s&&!ta(s);){if(un(s)&&!ah(s))return s;s=Ys(s)}return r}let n=R_(e,t);for(;n&&ZP(n)&&ah(n);)n=R_(n,t);return n&&ta(n)&&ah(n)&&!Um(n)?r:n||eT(e)||r}const hT=async function(e){const t=this.getOffsetParent||aS,r=this.getDimensions,n=await r(e.floating);return{reference:dT(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function fT(e){return dn(e).direction==="rtl"}const pT={convertOffsetParentRelativeRectToViewportRelativeRect:nT,getDocumentElement:Tn,getClippingRect:cT,getOffsetParent:aS,getElementRects:hT,getClientRects:sT,getDimensions:uT,getScale:Ro,isElement:un,isRTL:fT};function lS(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function mT(e,t){let r=null,n;const s=Tn(e);function i(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function l(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),i();const u=e.getBoundingClientRect(),{left:g,top:d,width:_,height:v}=u;if(a||t(),!_||!v)return;const x=wc(d),y=wc(s.clientWidth-(g+_)),f=wc(s.clientHeight-(d+v)),p=wc(g),m={rootMargin:-x+"px "+-y+"px "+-f+"px "+-p+"px",threshold:vr(0,Qs(1,c))||1};let b=!0;function w(k){const j=k[0].intersectionRatio;if(j!==c){if(!b)return l();j?l(!1,j):n=setTimeout(()=>{l(!1,1e-7)},1e3)}j===1&&!lS(u,e.getBoundingClientRect())&&l(),b=!1}try{r=new IntersectionObserver(w,{...m,root:s.ownerDocument})}catch{r=new IntersectionObserver(w,m)}r.observe(e)}return l(!0),i}function gT(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,u=Vm(e),g=s||i?[...u?Cl(u):[],...t?Cl(t):[]]:[];g.forEach(p=>{s&&p.addEventListener("scroll",r,{passive:!0}),i&&p.addEventListener("resize",r)});const d=u&&a?mT(u,r):null;let _=-1,v=null;l&&(v=new ResizeObserver(p=>{let[h]=p;h&&h.target===u&&v&&t&&(v.unobserve(t),cancelAnimationFrame(_),_=requestAnimationFrame(()=>{var m;(m=v)==null||m.observe(t)})),r()}),u&&!c&&v.observe(u),t&&v.observe(t));let x,y=c?Mi(e):null;c&&f();function f(){const p=Mi(e);y&&!lS(y,p)&&r(),y=p,x=requestAnimationFrame(f)}return r(),()=>{var p;g.forEach(h=>{s&&h.removeEventListener("scroll",r),i&&h.removeEventListener("resize",r)}),d==null||d(),(p=v)==null||p.disconnect(),v=null,c&&cancelAnimationFrame(x)}}const vT=KP,_T=GP,xT=WP,yT=YP,bT=VP,P_=UP,wT=QP,ST=(e,t,r)=>{const n=new Map,s={platform:pT,...r},i={...s.platform,_c:n};return zP(e,t,{...s,platform:i})};var CT=typeof document<"u",kT=function(){},Vc=CT?C.useLayoutEffect:kT;function Nu(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!Nu(e[n],t[n]))return!1;return!0}if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,s[n]))return!1;for(n=r;n--!==0;){const i=s[n];if(!(i==="_owner"&&e.$$typeof)&&!Nu(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function cS(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function T_(e,t){const r=cS(e);return Math.round(t*r)/r}function lh(e){const t=C.useRef(e);return Vc(()=>{t.current=e}),t}function ET(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:i,floating:l}={},transform:a=!0,whileElementsMounted:c,open:u}=e,[g,d]=C.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[_,v]=C.useState(n);Nu(_,n)||v(n);const[x,y]=C.useState(null),[f,p]=C.useState(null),h=C.useCallback(N=>{N!==k.current&&(k.current=N,y(N))},[]),m=C.useCallback(N=>{N!==j.current&&(j.current=N,p(N))},[]),b=i||x,w=l||f,k=C.useRef(null),j=C.useRef(null),S=C.useRef(g),E=c!=null,R=lh(c),M=lh(s),A=lh(u),L=C.useCallback(()=>{if(!k.current||!j.current)return;const N={placement:t,strategy:r,middleware:_};M.current&&(N.platform=M.current),ST(k.current,j.current,N).then(T=>{const D={...T,isPositioned:A.current!==!1};B.current&&!Nu(S.current,D)&&(S.current=D,od.flushSync(()=>{d(D)}))})},[_,t,r,M,A]);Vc(()=>{u===!1&&S.current.isPositioned&&(S.current.isPositioned=!1,d(N=>({...N,isPositioned:!1})))},[u]);const B=C.useRef(!1);Vc(()=>(B.current=!0,()=>{B.current=!1}),[]),Vc(()=>{if(b&&(k.current=b),w&&(j.current=w),b&&w){if(R.current)return R.current(b,w,L);L()}},[b,w,L,R,E]);const U=C.useMemo(()=>({reference:k,floating:j,setReference:h,setFloating:m}),[h,m]),W=C.useMemo(()=>({reference:b,floating:w}),[b,w]),q=C.useMemo(()=>{const N={position:r,left:0,top:0};if(!W.floating)return N;const T=T_(W.floating,g.x),D=T_(W.floating,g.y);return a?{...N,transform:"translate("+T+"px, "+D+"px)",...cS(W.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:T,top:D}},[r,a,W.floating,g.x,g.y]);return C.useMemo(()=>({...g,update:L,refs:U,elements:W,floatingStyles:q}),[g,L,U,W,q])}const jT=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:s}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?P_({element:n.current,padding:s}).fn(r):{}:n?P_({element:n,padding:s}).fn(r):{}}}},NT=(e,t)=>{const r=vT(e);return{name:r.name,fn:r.fn,options:[e,t]}},RT=(e,t)=>{const r=_T(e);return{name:r.name,fn:r.fn,options:[e,t]}},PT=(e,t)=>({fn:wT(e).fn,options:[e,t]}),TT=(e,t)=>{const r=xT(e);return{name:r.name,fn:r.fn,options:[e,t]}},AT=(e,t)=>{const r=yT(e);return{name:r.name,fn:r.fn,options:[e,t]}},DT=(e,t)=>{const r=bT(e);return{name:r.name,fn:r.fn,options:[e,t]}},LT=(e,t)=>{const r=jT(e);return{name:r.name,fn:r.fn,options:[e,t]}};var MT="Arrow",uS=C.forwardRef((e,t)=>{const{children:r,width:n=10,height:s=5,...i}=e;return o.jsx($e.svg,{...i,ref:t,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:o.jsx("polygon",{points:"0,0 30,0 15,10"})})});uS.displayName=MT;var OT=uS;function dS(e){const[t,r]=C.useState(void 0);return Jn(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let l,a;if("borderBoxSize"in i){const c=i.borderBoxSize,u=Array.isArray(c)?c[0]:c;l=u.inlineSize,a=u.blockSize}else l=e.offsetWidth,a=e.offsetHeight;r({width:l,height:a})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var qm="Popper",[hS,ga]=fn(qm),[IT,fS]=hS(qm),pS=e=>{const{__scopePopper:t,children:r}=e,[n,s]=C.useState(null);return o.jsx(IT,{scope:t,anchor:n,onAnchorChange:s,children:r})};pS.displayName=qm;var mS="PopperAnchor",gS=C.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...s}=e,i=fS(mS,r),l=C.useRef(null),a=Be(t,l),c=C.useRef(null);return C.useEffect(()=>{const u=c.current;c.current=(n==null?void 0:n.current)||l.current,u!==c.current&&i.onAnchorChange(c.current)}),n?null:o.jsx($e.div,{...s,ref:a})});gS.displayName=mS;var Km="PopperContent",[FT,BT]=hS(Km),vS=C.forwardRef((e,t)=>{var P,z,G,K,Q,ee;const{__scopePopper:r,side:n="bottom",sideOffset:s=0,align:i="center",alignOffset:l=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:g=0,sticky:d="partial",hideWhenDetached:_=!1,updatePositionStrategy:v="optimized",onPlaced:x,...y}=e,f=fS(Km,r),[p,h]=C.useState(null),m=Be(t,de=>h(de)),[b,w]=C.useState(null),k=dS(b),j=(k==null?void 0:k.width)??0,S=(k==null?void 0:k.height)??0,E=n+(i!=="center"?"-"+i:""),R=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},M=Array.isArray(u)?u:[u],A=M.length>0,L={padding:R,boundary:M.filter(HT),altBoundary:A},{refs:B,floatingStyles:U,placement:W,isPositioned:q,middlewareData:N}=ET({strategy:"fixed",placement:E,whileElementsMounted:(...de)=>gT(...de,{animationFrame:v==="always"}),elements:{reference:f.anchor},middleware:[NT({mainAxis:s+S,alignmentAxis:l}),c&&RT({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?PT():void 0,...L}),c&&TT({...L}),AT({...L,apply:({elements:de,rects:De,availableWidth:He,availableHeight:Lt})=>{const{width:Se,height:ur}=De.reference,dr=de.floating.style;dr.setProperty("--radix-popper-available-width",`${He}px`),dr.setProperty("--radix-popper-available-height",`${Lt}px`),dr.setProperty("--radix-popper-anchor-width",`${Se}px`),dr.setProperty("--radix-popper-anchor-height",`${ur}px`)}}),b&&LT({element:b,padding:a}),zT({arrowWidth:j,arrowHeight:S}),_&&DT({strategy:"referenceHidden",...L})]}),[T,D]=yS(W),O=Ht(x);Jn(()=>{q&&(O==null||O())},[q,O]);const $=(P=N.arrow)==null?void 0:P.x,Y=(z=N.arrow)==null?void 0:z.y,J=((G=N.arrow)==null?void 0:G.centerOffset)!==0,[re,ye]=C.useState();return Jn(()=>{p&&ye(window.getComputedStyle(p).zIndex)},[p]),o.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:q?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:re,"--radix-popper-transform-origin":[(K=N.transformOrigin)==null?void 0:K.x,(Q=N.transformOrigin)==null?void 0:Q.y].join(" "),...((ee=N.hide)==null?void 0:ee.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:o.jsx(FT,{scope:r,placedSide:T,onArrowChange:w,arrowX:$,arrowY:Y,shouldHideArrow:J,children:o.jsx($e.div,{"data-side":T,"data-align":D,...y,ref:m,style:{...y.style,animation:q?void 0:"none"}})})})});vS.displayName=Km;var _S="PopperArrow",$T={top:"bottom",right:"left",bottom:"top",left:"right"},xS=C.forwardRef(function(t,r){const{__scopePopper:n,...s}=t,i=BT(_S,n),l=$T[i.placedSide];return o.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:o.jsx(OT,{...s,ref:r,style:{...s.style,display:"block"}})})});xS.displayName=_S;function HT(e){return e!==null}var zT=e=>({name:"transformOrigin",options:e,fn(t){var f,p,h;const{placement:r,rects:n,middlewareData:s}=t,l=((f=s.arrow)==null?void 0:f.centerOffset)!==0,a=l?0:e.arrowWidth,c=l?0:e.arrowHeight,[u,g]=yS(r),d={start:"0%",center:"50%",end:"100%"}[g],_=(((p=s.arrow)==null?void 0:p.x)??0)+a/2,v=(((h=s.arrow)==null?void 0:h.y)??0)+c/2;let x="",y="";return u==="bottom"?(x=l?d:`${_}px`,y=`${-c}px`):u==="top"?(x=l?d:`${_}px`,y=`${n.floating.height+c}px`):u==="right"?(x=`${-c}px`,y=l?d:`${v}px`):u==="left"&&(x=`${n.floating.width+c}px`,y=l?d:`${v}px`),{data:{x,y}}}});function yS(e){const[t,r="center"]=e.split("-");return[t,r]}var Gm=pS,md=gS,Qm=vS,Ym=xS,UT="Portal",Vl=C.forwardRef((e,t)=>{var a;const{container:r,...n}=e,[s,i]=C.useState(!1);Jn(()=>i(!0),[]);const l=r||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return l?Bb.createPortal(o.jsx($e.div,{...n,ref:t}),l):null});Vl.displayName=UT;var WT=Symbol("radix.slottable");function VT(e){const t=({children:r})=>o.jsx(o.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=WT,t}var qT=Wu[" useInsertionEffect ".trim().toString()]||Jn;function va({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[s,i,l]=KT({defaultProp:t,onChange:r}),a=e!==void 0,c=a?e:s;{const g=C.useRef(e!==void 0);C.useEffect(()=>{const d=g.current;d!==a&&console.warn(`${n} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),g.current=a},[a,n])}const u=C.useCallback(g=>{var d;if(a){const _=GT(g)?g(e):g;_!==e&&((d=l.current)==null||d.call(l,_))}else i(g)},[a,e,i,l]);return[c,u]}function KT({defaultProp:e,onChange:t}){const[r,n]=C.useState(e),s=C.useRef(r),i=C.useRef(t);return qT(()=>{i.current=t},[t]),C.useEffect(()=>{var l;s.current!==r&&((l=i.current)==null||l.call(i,r),s.current=r)},[r,s]),[r,n,i]}function GT(e){return typeof e=="function"}var QT=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),YT="VisuallyHidden",bS=C.forwardRef((e,t)=>o.jsx($e.span,{...e,ref:t,style:{...QT,...e.style}}));bS.displayName=YT;var ZT=bS,[gd]=fn("Tooltip",[ga]),vd=ga(),wS="TooltipProvider",XT=700,Vf="tooltip.open",[JT,Zm]=gd(wS),SS=e=>{const{__scopeTooltip:t,delayDuration:r=XT,skipDelayDuration:n=300,disableHoverableContent:s=!1,children:i}=e,l=C.useRef(!0),a=C.useRef(!1),c=C.useRef(0);return C.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),o.jsx(JT,{scope:t,isOpenDelayedRef:l,delayDuration:r,onOpen:C.useCallback(()=>{window.clearTimeout(c.current),l.current=!1},[]),onClose:C.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>l.current=!0,n)},[n]),isPointerInTransitRef:a,onPointerInTransitChange:C.useCallback(u=>{a.current=u},[]),disableHoverableContent:s,children:i})};SS.displayName=wS;var kl="Tooltip",[eA,ql]=gd(kl),CS=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:s,onOpenChange:i,disableHoverableContent:l,delayDuration:a}=e,c=Zm(kl,e.__scopeTooltip),u=vd(t),[g,d]=C.useState(null),_=Us(),v=C.useRef(0),x=l??c.disableHoverableContent,y=a??c.delayDuration,f=C.useRef(!1),[p,h]=va({prop:n,defaultProp:s??!1,onChange:j=>{j?(c.onOpen(),document.dispatchEvent(new CustomEvent(Vf))):c.onClose(),i==null||i(j)},caller:kl}),m=C.useMemo(()=>p?f.current?"delayed-open":"instant-open":"closed",[p]),b=C.useCallback(()=>{window.clearTimeout(v.current),v.current=0,f.current=!1,h(!0)},[h]),w=C.useCallback(()=>{window.clearTimeout(v.current),v.current=0,h(!1)},[h]),k=C.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{f.current=!0,h(!0),v.current=0},y)},[y,h]);return C.useEffect(()=>()=>{v.current&&(window.clearTimeout(v.current),v.current=0)},[]),o.jsx(Gm,{...u,children:o.jsx(eA,{scope:t,contentId:_,open:p,stateAttribute:m,trigger:g,onTriggerChange:d,onTriggerEnter:C.useCallback(()=>{c.isOpenDelayedRef.current?k():b()},[c.isOpenDelayedRef,k,b]),onTriggerLeave:C.useCallback(()=>{x?w():(window.clearTimeout(v.current),v.current=0)},[w,x]),onOpen:b,onClose:w,disableHoverableContent:x,children:r})})};CS.displayName=kl;var qf="TooltipTrigger",kS=C.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=ql(qf,r),i=Zm(qf,r),l=vd(r),a=C.useRef(null),c=Be(t,a,s.onTriggerChange),u=C.useRef(!1),g=C.useRef(!1),d=C.useCallback(()=>u.current=!1,[]);return C.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),o.jsx(md,{asChild:!0,...l,children:o.jsx($e.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...n,ref:c,onPointerMove:_e(e.onPointerMove,_=>{_.pointerType!=="touch"&&!g.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),g.current=!0)}),onPointerLeave:_e(e.onPointerLeave,()=>{s.onTriggerLeave(),g.current=!1}),onPointerDown:_e(e.onPointerDown,()=>{s.open&&s.onClose(),u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:_e(e.onFocus,()=>{u.current||s.onOpen()}),onBlur:_e(e.onBlur,s.onClose),onClick:_e(e.onClick,s.onClose)})})});kS.displayName=qf;var Xm="TooltipPortal",[tA,rA]=gd(Xm,{forceMount:void 0}),ES=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:s}=e,i=ql(Xm,t);return o.jsx(tA,{scope:t,forceMount:r,children:o.jsx(Wt,{present:r||i.open,children:o.jsx(Vl,{asChild:!0,container:s,children:n})})})};ES.displayName=Xm;var ra="TooltipContent",jS=C.forwardRef((e,t)=>{const r=rA(ra,e.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...i}=e,l=ql(ra,e.__scopeTooltip);return o.jsx(Wt,{present:n||l.open,children:l.disableHoverableContent?o.jsx(NS,{side:s,...i,ref:t}):o.jsx(nA,{side:s,...i,ref:t})})}),nA=C.forwardRef((e,t)=>{const r=ql(ra,e.__scopeTooltip),n=Zm(ra,e.__scopeTooltip),s=C.useRef(null),i=Be(t,s),[l,a]=C.useState(null),{trigger:c,onClose:u}=r,g=s.current,{onPointerInTransitChange:d}=n,_=C.useCallback(()=>{a(null),d(!1)},[d]),v=C.useCallback((x,y)=>{const f=x.currentTarget,p={x:x.clientX,y:x.clientY},h=lA(p,f.getBoundingClientRect()),m=cA(p,h),b=uA(y.getBoundingClientRect()),w=hA([...m,...b]);a(w),d(!0)},[d]);return C.useEffect(()=>()=>_(),[_]),C.useEffect(()=>{if(c&&g){const x=f=>v(f,g),y=f=>v(f,c);return c.addEventListener("pointerleave",x),g.addEventListener("pointerleave",y),()=>{c.removeEventListener("pointerleave",x),g.removeEventListener("pointerleave",y)}}},[c,g,v,_]),C.useEffect(()=>{if(l){const x=y=>{const f=y.target,p={x:y.clientX,y:y.clientY},h=(c==null?void 0:c.contains(f))||(g==null?void 0:g.contains(f)),m=!dA(p,l);h?_():m&&(_(),u())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[c,g,l,u,_]),o.jsx(NS,{...e,ref:i})}),[sA,iA]=gd(kl,{isInside:!1}),oA=VT("TooltipContent"),NS=C.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:l,...a}=e,c=ql(ra,r),u=vd(r),{onClose:g}=c;return C.useEffect(()=>(document.addEventListener(Vf,g),()=>document.removeEventListener(Vf,g)),[g]),C.useEffect(()=>{if(c.trigger){const d=_=>{const v=_.target;v!=null&&v.contains(c.trigger)&&g()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[c.trigger,g]),o.jsx(Ul,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:d=>d.preventDefault(),onDismiss:g,children:o.jsxs(Qm,{"data-state":c.stateAttribute,...u,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[o.jsx(oA,{children:n}),o.jsx(sA,{scope:r,isInside:!0,children:o.jsx(ZT,{id:c.contentId,role:"tooltip",children:s||n})})]})})});jS.displayName=ra;var RS="TooltipArrow",aA=C.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=vd(r);return iA(RS,r).isInside?null:o.jsx(Ym,{...s,...n,ref:t})});aA.displayName=RS;function lA(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(r,n,s,i)){case i:return"left";case s:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function cA(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function uA(e){const{top:t,right:r,bottom:n,left:s}=e;return[{x:s,y:t},{x:r,y:t},{x:r,y:n},{x:s,y:n}]}function dA(e,t){const{x:r,y:n}=e;let s=!1;for(let i=0,l=t.length-1;i<t.length;l=i++){const a=t[i],c=t[l],u=a.x,g=a.y,d=c.x,_=c.y;g>n!=_>n&&r<(d-u)*(n-g)/(_-g)+u&&(s=!s)}return s}function hA(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),fA(t)}function fA(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const s=e[n];for(;t.length>=2;){const i=t[t.length-1],l=t[t.length-2];if((i.x-l.x)*(s.y-l.y)>=(i.y-l.y)*(s.x-l.x))t.pop();else break}t.push(s)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const s=e[n];for(;r.length>=2;){const i=r[r.length-1],l=r[r.length-2];if((i.x-l.x)*(s.y-l.y)>=(i.y-l.y)*(s.x-l.x))r.pop();else break}r.push(s)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var pA=SS,mA=CS,gA=kS,vA=ES,PS=jS;const jn=pA,Ir=mA,Fr=gA,br=C.forwardRef(({className:e,sideOffset:t=4,...r},n)=>o.jsx(vA,{children:o.jsx(PS,{ref:n,sideOffset:t,className:X("z-50 overflow-hidden rounded-md border border-border bg-popover px-2.5 py-1.5 font-mono text-[11px] text-popover-foreground shadow-md","data-[state=delayed-open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));br.displayName=PS.displayName;function _A({chain:e}){const t=e==="base";return o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(je,{variant:t?"secondary":"outline",children:"Testnet"}),o.jsx(jn,{delayDuration:120,children:o.jsxs(Ir,{children:[o.jsx(Fr,{asChild:!0,children:o.jsx("span",{children:o.jsx(je,{variant:"secondary",className:"border-dashed border-border opacity-60",children:"Mainnet · soon"})})}),o.jsx(br,{children:"Mainnet support is coming. v1 supports testnet only."})]})})]})}function xA({status:e}){return e==="done"?o.jsxs(je,{variant:"success",className:"gap-1.5",children:[o.jsx(b2,{className:"h-3 w-3"}),"Done"]}):e==="error"?o.jsxs(je,{variant:"destructive",className:"gap-1.5",children:[o.jsx(jm,{className:"h-3 w-3"}),"Failed"]}):e==="active"?o.jsxs(je,{variant:"warning",className:"gap-2",children:[o.jsx("span",{"aria-hidden":"true",className:"jinn-anim-pulse h-1.5 w-1.5 rounded-full bg-[var(--accent-gold)]"}),"Active"]}):o.jsx(je,{variant:"secondary",children:"Queued"})}const yA={1:"Provisioning your wallet",2:"Fund your wallet",3:"Joining Jinn"};function bA({phase:e,status:t,children:r}){const n=t==="active",s=t==="error",i=t==="done",l=n||s,a=s?"text-[var(--break-red)]":n?"text-[var(--accent-gold)]":i?"text-[var(--accent-sky)]":"text-[var(--fg-dim)]",c=s||n?"text-foreground":i?"text-[var(--fg-muted)]":"text-[var(--fg-dim)]",u=l?"font-serif text-[28px] leading-[1.2]":"font-mono text-[14px] leading-[1.2]";return o.jsxs("li",{className:"phase-row border-t border-border","data-status":t,"data-testid":`onboarding-phase-${e}`,children:[o.jsxs("div",{className:"grid grid-cols-[3rem_1fr_auto] items-baseline gap-4 py-4",children:[o.jsx("span",{className:X("font-mono text-xs tabular-nums tracking-[0.05em] transition-colors duration-200",a),children:String(e).padStart(2,"0")}),o.jsx("span",{className:X(u,c,"transition-colors duration-200"),children:yA[e]}),o.jsx(xA,{status:t})]}),l&&r&&o.jsx("div",{className:"jinn-anim-fade-slide ml-12 pb-5 pr-2",children:r})]})}function wA({label:e,step:t,serviceIndex:r,serviceId:n,safeAddress:s,explorer:i,contractRevertReason:l}){const a=!!l;return o.jsxs("div",{className:X("flex flex-col gap-3 rounded-md border bg-[var(--bg-elevated)] px-4 py-3",a?"border-[var(--break-red)]":"border-border"),children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{"aria-hidden":"true",className:X("jinn-anim-pulse h-1.5 w-1.5 rounded-full",a?"bg-[var(--break-red)]":"bg-[var(--accent-sky)]")}),o.jsx("span",{className:"font-mono text-sm text-foreground",children:e}),o.jsx("span",{className:X("ml-auto font-mono text-[10px]",a?"text-[var(--break-red)]":"text-[var(--fg-dim)]"),children:a?"binding failed · will retry":"running · no action needed"})]}),o.jsxs("div",{className:"grid grid-cols-1 gap-x-4 gap-y-1 font-mono text-[11px] text-[var(--fg-muted)] md:grid-cols-[120px_1fr]",children:[o.jsx("span",{className:"text-[var(--fg-dim)]",children:"Current step"}),o.jsx("span",{children:SA(t)}),r!==void 0&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"text-[var(--fg-dim)]",children:"Service"}),o.jsxs("span",{children:["#",r,n!==void 0?` · id ${n}`:""]})]}),s&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"text-[var(--fg-dim)]",children:"Safe"}),o.jsx("a",{href:`${i}/address/${s}`,target:"_blank",rel:"noopener noreferrer",className:"break-all text-[var(--accent-sky)] hover:underline",children:s})]}),l&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"text-[var(--fg-dim)]",children:"Contract revert reason"}),o.jsx("code",{className:"break-words text-xs text-[var(--break-red)]",children:l})]})]})]})}function SA(e){return e.split("_").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}const CA={wallet:{phase:1,subState:null},safe_predicted:{phase:1,subState:null},awaiting_funding:{phase:2,subState:null},safe_deployed:{phase:3,subState:"Deploying"},service_created:{phase:3,subState:"Deploying"},service_activated:{phase:3,subState:"Deploying"},agents_registered:{phase:3,subState:"Deploying"},service_deployed:{phase:3,subState:"Deploying"},service_staked:{phase:3,subState:"Deploying"},staked:{phase:3,subState:"Deploying"},mech_deployed:{phase:3,subState:"Joining the network"},agent_registered:{phase:3,subState:"Joining the network"},safe_binding_pending:{phase:3,subState:"Binding identity"}};function kA(e){return CA[e]??{phase:1,subState:null}}function EA(e,t,r){return e<t?e===2&&r===!1?"active":"done":e===t?"active":"queued"}const jA="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--accent-gold)]";function NA(){var g;const{data:e,isLoading:t}=Me({queryKey:["bootstrap"],queryFn:()=>ge.getBootstrap(),refetchInterval:2e3});if(t||!e)return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:o.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",children:"Connecting…"})});const r=e.chain==="base"?"https://basescan.org":"https://sepolia.basescan.org",n=e.master_address??"",{phase:s,subState:i}=kA(e.currentStep),l=e.error,a=e.services.find(d=>d.step===e.currentStep)??e.services[0],c=(g=e.funding)==null?void 0:g.targetMet,u=Bm().embeddedAgent;return o.jsx("div",{className:"min-h-screen w-full bg-background text-foreground",children:o.jsxs("div",{className:"mx-auto grid max-w-[1280px] grid-cols-12 gap-10 px-10 py-10",children:[o.jsxs("section",{className:X("col-span-12 flex flex-col gap-8",u&&"lg:col-span-7"),children:[o.jsxs("header",{className:"flex items-baseline justify-between",children:[o.jsx("span",{className:jA,children:"Jinn · Onboarding"}),o.jsx(_A,{chain:e.chain})]}),o.jsx("h1",{className:"font-serif text-[76px] leading-[1.05] text-foreground",children:"Welcome to Jinn."}),o.jsxs("div",{className:"flex flex-col gap-1.5","data-testid":"onboarding-progress","aria-label":"Onboarding progress",children:[o.jsx(Fm,{value:Math.min(100,(s-1)/2*100+(s===3?33:0))}),o.jsxs("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",children:["Phase ",s," of 3"]})]}),o.jsx("ol",{className:"flex flex-col",children:[1,2,3].map(d=>{var x;const _=EA(d,s,c),v=l&&d===s;return o.jsxs(bA,{phase:d,status:v?"error":_,children:[v&&o.jsx(_P,{envelope:l,chainExplorerBase:r}),!v&&d===2&&_==="active"&&n&&o.jsx(uP,{address:n,minimumWei:((x=e.funding)==null?void 0:x.targetWei)??"10000000000000000",chainExplorerBase:r,chain:e.chain,onSharedDefaultRpc:e.rpcUrl===e.defaultRpcUrl}),!v&&d===3&&_==="active"&&o.jsx(wA,{label:i??"Working",step:e.currentStep,serviceIndex:a==null?void 0:a.index,serviceId:a==null?void 0:a.service_id,safeAddress:a==null?void 0:a.safe_address,explorer:r,contractRevertReason:(a==null?void 0:a.error_revert_reason)??null})]},d)})})]}),u&&o.jsxs("aside",{className:"col-span-12 flex flex-col gap-3 lg:col-span-5",children:[o.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",children:"Ask Claude"}),o.jsx(we,{className:"h-[calc(100vh-220px)] min-h-[520px] overflow-hidden p-0",children:o.jsx(Yw,{agentGated:!1})})]})]})})}const RA={blocking:"border-l-[var(--severity-blocking-fg)] bg-[var(--severity-blocking-bg)]",warning:"border-l-[var(--severity-warning-fg)] bg-[var(--severity-warning-bg)]",info:"border-l-[var(--severity-info-fg)]"},PA={blocking:"text-[var(--severity-blocking-fg)]",warning:"text-[var(--severity-warning-fg)]",info:"text-[var(--severity-info-fg)]"};function TA({notice:e}){return o.jsxs("li",{"data-kind":e.kind,"data-severity":e.severity,"aria-label":`${e.severity} notice: ${e.message}`,className:X("flex items-baseline gap-3 border-l-2 px-4 py-2 font-mono text-[12px] text-foreground",RA[e.severity]),children:[o.jsx("span",{"aria-hidden":"true",className:X("min-w-[64px] font-mono text-[11px] font-medium uppercase tracking-[0.14em]",PA[e.severity]),children:e.severity}),o.jsx("span",{className:"flex-1",children:e.message}),e.jumpTo?o.jsx(lr,{href:e.jumpTo,className:"font-mono text-[var(--accent-sky)] no-underline hover:text-[var(--accent-sky-hover)]",children:"resolve →"}):null]})}function AA({notices:e}){return e.length===0?null:o.jsx("section",{"aria-label":"Notifications",role:"region",children:o.jsx("ul",{className:"m-0 list-none p-0",children:e.map((t,r)=>o.jsx(TA,{notice:t},`${t.kind}-${r}`))})})}async function DA(e,t){const r=new AbortController,n=setTimeout(()=>r.abort(),t);try{const s=await fetch(e,{credentials:"same-origin",headers:{Accept:"application/json"},cache:"no-store",signal:r.signal});return s.status===502||s.status===503||s.status===504?{ok:!1,error:`daemon unavailable (HTTP ${s.status})`}:{ok:!0,error:null}}catch(s){return{ok:!1,error:s instanceof Error?s.message:String(s)}}finally{clearTimeout(n)}}function LA(e={}){const{pollIntervalMs:t=2e3,failureThreshold:r=2,maxBackoffMs:n=3e4,probeTimeoutMs:s=3500,probeUrl:i="/v1/status"}=e,[l,a]=C.useState({status:"connected",lastConnectedAt:Date.now()}),c=C.useRef(0),u=C.useRef(t),g=C.useRef(!1);return C.useEffect(()=>{g.current=!1;let d=null;const _=x=>{g.current||(d=setTimeout(v,x))},v=async()=>{const x=await DA(i,s);if(g.current)return;if(x.ok){c.current=0,u.current=t,a(f=>f.status==="connected"?f:{status:"connected",lastConnectedAt:Date.now()}),_(t);return}c.current+=1,c.current>=r?(a(f=>f.status==="disconnected"?{...f,attempts:f.attempts+1,lastError:x.error}:{status:"disconnected",since:Date.now(),lastError:x.error,attempts:1}),u.current=Math.min(Math.max(u.current*2,t*2),n),_(u.current)):_(t)};return v(),()=>{g.current=!0,d!==null&&clearTimeout(d)}},[t,r,n,s,i]),l}const TS=C.createContext({restartPending:!1,setRestartPending:()=>{}});function MA(){return C.useContext(TS)}const OA=3,IA=1e3*60*60*24*90;function FA(e){const t=[],r=e.status;return e.bootstrap.mode!=="running"&&t.push({kind:"bootstrap_blocked",severity:"blocking",message:e.bootstrap.blockingReason??"Bootstrap incomplete",jumpTo:"/"}),r.funds.runwayDays<OA&&t.push({kind:"funding_low",severity:"warning",message:`Runway is ${r.funds.runwayDays} day(s). Top up gas to keep claiming work.`,jumpTo:"/overview"}),r.harness.ready||t.push({kind:"harness_not_ready",severity:"blocking",message:`Harness ${r.harness.name} is not ready${r.harness.reason?`: ${r.harness.reason}`:""}.`,jumpTo:"/operator/memberships"}),r.rpc.reachable||t.push({kind:"rpc_unreachable",severity:"blocking",message:"RPC endpoint is unreachable.",jumpTo:"/operator/network"}),Object.keys(r.joinedSolverNets).length===0&&e.bootstrap.mode==="running"&&t.push({kind:"no_solvernets_joined",severity:"info",message:"No SolverNets joined. Browse the registry to start earning.",jumpTo:"/operator/registry"}),r.services.some(n=>n.evicted)&&t.push({kind:"service_evicted",severity:"blocking",message:"A service has been evicted from staking. Re-stake to resume.",jumpTo:"/overview"}),r.services.some(n=>!n.safeBound)&&t.push({kind:"safe_binding_pending",severity:"warning",message:"Safe wallet binding is pending.",jumpTo:"/overview"}),r.restartPending&&t.push({kind:"restart_required",severity:"warning",message:"A configuration change is pending — restart to apply.",jumpTo:"/overview"}),r.latestVersion&&r.latestVersion!==r.daemonVersion&&t.push({kind:"update_available",severity:"info",message:`Daemon ${r.latestVersion} available (running ${r.daemonVersion}).`}),r.passwordRotatedAt&&(e.now??Date.now())-new Date(r.passwordRotatedAt).getTime()>IA&&t.push({kind:"password_rotation_due",severity:"info",message:"Keystore password is over 90 days old.",jumpTo:"/operator/security"}),t}const A_={blocking:0,warning:1,info:2},BA=30*60*1e3,$A=60*1e3,HA=["intent"];function zA(e,t,r){var g,d;const n=e??{},s=t??{},i=String(((g=n.masterGas)==null?void 0:g.balanceWei)??"0");let l="0",a=Number.POSITIVE_INFINITY;try{const _=BigInt(i);l=_.toString(),a=_>0n?Number.POSITIVE_INFINITY:0}catch{}const c=Array.isArray((d=n.fleet)==null?void 0:d.services)?n.fleet.services:[],u=s.joinedSolverNets&&typeof s.joinedSolverNets=="object"?s.joinedSolverNets:{};return{funds:{eth:l,runwayDays:a},harness:{ready:!0,name:"unknown"},rpc:{reachable:!0},restartPending:r,daemonVersion:String(n.version??"0.0.0"),latestVersion:void 0,services:c.map(_=>({evicted:!!(_!=null&&_.evicted),safeBound:(_==null?void 0:_.safeBoundToAgent)!==!1})),joinedSolverNets:u,passwordRotatedAt:void 0}}function UA(){const e=LA(),{restartPending:t}=MA(),r=Me({queryKey:["status"],queryFn:()=>ge.getStatus()}),n=Me({queryKey:["bootstrap"],queryFn:()=>ge.getBootstrap()}),{events:s}=mw(HA),[i,l]=C.useState(()=>Date.now());C.useEffect(()=>{const c=setInterval(()=>l(Date.now()),$A);return()=>clearInterval(c)},[]);const a=C.useMemo(()=>{const c=i-BA,u=new Set,g=s.filter(_=>{if(_.kind!=="intent"||_.errorCode!=="claim_failed")return!1;const v=Date.parse(_.ts);return Number.isNaN(v)||v<c||u.has(_.id)?!1:(u.add(_.id),!0)});if(g.length===0)return null;const d=g.length;return{kind:"claim_failed",severity:"warning",message:`${d} claim attempt${d===1?"":"s"} failed in the last 30 minutes. Check Tasks for details.`,jumpTo:"/overview",details:{count:d,sinceMs:c}}},[s,i]);return C.useMemo(()=>{if(e.status==="disconnected")return[{kind:"rpc_unreachable",severity:"blocking",message:"Daemon offline. What you see may be stale. Reconnecting automatically…"}];if(!r.data||!n.data)return[];const c=FA({bootstrap:n.data,status:zA(r.data,n.data,t)});return(a?[...c,a]:[...c]).sort((g,d)=>A_[g.severity]-A_[d.severity])},[e.status,t,r.data,n.data,a])}function WA({header:e,tabs:t,rail:r,children:n}){const s=r!=null,i=UA(),l=i.length>0?"grid-rows-[auto_auto_auto_minmax(0,1fr)]":"grid-rows-[auto_auto_minmax(0,1fr)]";return o.jsxs("div",{className:X("grid h-screen w-full overflow-hidden bg-background text-foreground",s?"grid-cols-[1fr_320px]":"grid-cols-1",l),children:[o.jsx("div",{className:"col-span-full border-b border-border",children:e}),o.jsx("div",{className:"col-span-full border-b border-border",children:t}),i.length>0&&o.jsx("div",{className:"col-span-full border-b border-border",children:o.jsx(AA,{notices:i})}),o.jsx("main",{className:"min-h-0 overflow-y-auto",children:n}),s&&o.jsx("aside",{className:"h-full min-h-0 overflow-y-auto border-l border-border",children:r})]})}function VA({network:e}){return o.jsxs("header",{className:"flex items-center justify-between px-6 py-3.5",children:[o.jsx(lr,{href:"/overview",className:"font-serif text-[26px] text-foreground no-underline",children:"jinn operator"}),o.jsx(je,{variant:"outline",children:e})]})}const D_=[{path:"/overview",label:"Dashboard"},{path:"/events",label:"Events"},{path:"/operator",label:"Settings"}];function qA(){const[e]=hn(),t=e.split(/[?#]/)[0]||"/",r=t==="/launcher"||t.startsWith("/launcher/"),{data:n}=Me({queryKey:["solvernets","launched","top-tabs"],queryFn:()=>ge.solvernets.listLaunched(),refetchInterval:3e4,enabled:!r}),s=Bm().pluginBuilderUi?[...D_,{path:"/build",label:"Build"}]:D_,l=r||((n==null?void 0:n.records.length)??0)>0?[...s,{path:"/launcher",label:"Launcher"}]:s;return o.jsx("nav",{className:"-mb-px flex px-6",children:l.map(a=>{const c=t===a.path||t.startsWith(`${a.path}/`);return o.jsx(lr,{href:a.path,"data-active":c?"true":"false",className:X("border-b px-4 py-3.5 font-mono text-[11px] font-medium uppercase tracking-[0.14em] no-underline transition-colors",c?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:a.label},a.path)})})}function KA({agentGated:e}){return o.jsxs("div",{className:"agent-rail flex h-full min-w-0 flex-col gap-3 overflow-hidden p-4",children:[o.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground [overflow-wrap:anywhere]",children:"Claude"}),o.jsx(Yw,{agentGated:e})]})}var GA=e=>{switch(e){case"success":return ZA;case"info":return JA;case"warning":return XA;case"error":return eD;default:return null}},QA=Array(12).fill(0),YA=({visible:e,className:t})=>Z.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Z.createElement("div",{className:"sonner-spinner"},QA.map((r,n)=>Z.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),ZA=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Z.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),XA=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Z.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),JA=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Z.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),eD=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Z.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),tD=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Z.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Z.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),rD=()=>{let[e,t]=Z.useState(document.hidden);return Z.useEffect(()=>{let r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e},Kf=1,nD=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:r,...n}=e,s=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Kf++,i=this.toasts.find(a=>a.id===s),l=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),i?this.toasts=this.toasts.map(a=>a.id===s?(this.publish({...a,...e,id:s,title:r}),{...a,...e,id:s,dismissible:l,title:r}):a):this.addToast({title:r,...n,dismissible:l,id:s}),s},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(r=>r({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let n=e instanceof Promise?e:e(),s=r!==void 0,i,l=n.then(async c=>{if(i=["resolve",c],Z.isValidElement(c))s=!1,this.create({id:r,type:"default",message:c});else if(iD(c)&&!c.ok){s=!1;let u=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,g=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:r,type:"error",message:u,description:g})}else if(t.success!==void 0){s=!1;let u=typeof t.success=="function"?await t.success(c):t.success,g=typeof t.description=="function"?await t.description(c):t.description;this.create({id:r,type:"success",message:u,description:g})}}).catch(async c=>{if(i=["reject",c],t.error!==void 0){s=!1;let u=typeof t.error=="function"?await t.error(c):t.error,g=typeof t.description=="function"?await t.description(c):t.description;this.create({id:r,type:"error",message:u,description:g})}}).finally(()=>{var c;s&&(this.dismiss(r),r=void 0),(c=t.finally)==null||c.call(t)}),a=()=>new Promise((c,u)=>l.then(()=>i[0]==="reject"?u(i[1]):c(i[1])).catch(u));return typeof r!="string"&&typeof r!="number"?{unwrap:a}:Object.assign(r,{unwrap:a})},this.custom=(e,t)=>{let r=(t==null?void 0:t.id)||Kf++;return this.create({jsx:e(r),id:r,...t}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},rr=new nD,sD=(e,t)=>{let r=(t==null?void 0:t.id)||Kf++;return rr.addToast({title:e,...t,id:r}),r},iD=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",oD=sD,aD=()=>rr.toasts,lD=()=>rr.getActiveToasts(),Zs=Object.assign(oD,{success:rr.success,info:rr.info,warning:rr.warning,error:rr.error,custom:rr.custom,message:rr.message,promise:rr.promise,dismiss:rr.dismiss,loading:rr.loading},{getHistory:aD,getToasts:lD});function cD(e,{insertAt:t}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}cD(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
201
+ `);function Sc(e){return e.label!==void 0}var uD=3,dD="32px",hD="16px",L_=4e3,fD=356,pD=14,mD=20,gD=200;function Xr(...e){return e.filter(Boolean).join(" ")}function vD(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}var _D=e=>{var t,r,n,s,i,l,a,c,u,g,d;let{invert:_,toast:v,unstyled:x,interacting:y,setHeights:f,visibleToasts:p,heights:h,index:m,toasts:b,expanded:w,removeToast:k,defaultRichColors:j,closeButton:S,style:E,cancelButtonStyle:R,actionButtonStyle:M,className:A="",descriptionClassName:L="",duration:B,position:U,gap:W,loadingIcon:q,expandByDefault:N,classNames:T,icons:D,closeButtonAriaLabel:O="Close toast",pauseWhenPageIsHidden:$}=e,[Y,J]=Z.useState(null),[re,ye]=Z.useState(null),[P,z]=Z.useState(!1),[G,K]=Z.useState(!1),[Q,ee]=Z.useState(!1),[de,De]=Z.useState(!1),[He,Lt]=Z.useState(!1),[Se,ur]=Z.useState(0),[dr,An]=Z.useState(0),qr=Z.useRef(v.duration||B||L_),Dn=Z.useRef(null),pt=Z.useRef(null),mn=m===0,I=m+1<=p,H=v.type,V=v.dismissible!==!1,ne=v.className||"",ie=v.descriptionClassName||"",te=Z.useMemo(()=>h.findIndex(Ee=>Ee.toastId===v.id)||0,[h,v.id]),ce=Z.useMemo(()=>{var Ee;return(Ee=v.closeButton)!=null?Ee:S},[v.closeButton,S]),fe=Z.useMemo(()=>v.duration||B||L_,[v.duration,B]),Ne=Z.useRef(0),Ze=Z.useRef(0),Vt=Z.useRef(0),Ct=Z.useRef(null),[Ln,ya]=U.split("-"),Gi=Z.useMemo(()=>h.reduce((Ee,Ke,nt)=>nt>=te?Ee:Ee+Ke.height,0),[h,te]),Jl=rD(),ec=v.invert||_,ba=H==="loading";Ze.current=Z.useMemo(()=>te*W+Gi,[te,Gi]),Z.useEffect(()=>{qr.current=fe},[fe]),Z.useEffect(()=>{z(!0)},[]),Z.useEffect(()=>{let Ee=pt.current;if(Ee){let Ke=Ee.getBoundingClientRect().height;return An(Ke),f(nt=>[{toastId:v.id,height:Ke,position:v.position},...nt]),()=>f(nt=>nt.filter(Gr=>Gr.toastId!==v.id))}},[f,v.id]),Z.useLayoutEffect(()=>{if(!P)return;let Ee=pt.current,Ke=Ee.style.height;Ee.style.height="auto";let nt=Ee.getBoundingClientRect().height;Ee.style.height=Ke,An(nt),f(Gr=>Gr.find(Qr=>Qr.toastId===v.id)?Gr.map(Qr=>Qr.toastId===v.id?{...Qr,height:nt}:Qr):[{toastId:v.id,height:nt,position:v.position},...Gr])},[P,v.title,v.description,f,v.id]);let Kr=Z.useCallback(()=>{K(!0),ur(Ze.current),f(Ee=>Ee.filter(Ke=>Ke.toastId!==v.id)),setTimeout(()=>{k(v)},gD)},[v,k,f,Ze]);Z.useEffect(()=>{if(v.promise&&H==="loading"||v.duration===1/0||v.type==="loading")return;let Ee;return w||y||$&&Jl?(()=>{if(Vt.current<Ne.current){let Ke=new Date().getTime()-Ne.current;qr.current=qr.current-Ke}Vt.current=new Date().getTime()})():qr.current!==1/0&&(Ne.current=new Date().getTime(),Ee=setTimeout(()=>{var Ke;(Ke=v.onAutoClose)==null||Ke.call(v,v),Kr()},qr.current)),()=>clearTimeout(Ee)},[w,y,v,H,$,Jl,Kr]),Z.useEffect(()=>{v.delete&&Kr()},[Kr,v.delete]);function Nk(){var Ee,Ke,nt;return D!=null&&D.loading?Z.createElement("div",{className:Xr(T==null?void 0:T.loader,(Ee=v==null?void 0:v.classNames)==null?void 0:Ee.loader,"sonner-loader"),"data-visible":H==="loading"},D.loading):q?Z.createElement("div",{className:Xr(T==null?void 0:T.loader,(Ke=v==null?void 0:v.classNames)==null?void 0:Ke.loader,"sonner-loader"),"data-visible":H==="loading"},q):Z.createElement(YA,{className:Xr(T==null?void 0:T.loader,(nt=v==null?void 0:v.classNames)==null?void 0:nt.loader),visible:H==="loading"})}return Z.createElement("li",{tabIndex:0,ref:pt,className:Xr(A,ne,T==null?void 0:T.toast,(t=v==null?void 0:v.classNames)==null?void 0:t.toast,T==null?void 0:T.default,T==null?void 0:T[H],(r=v==null?void 0:v.classNames)==null?void 0:r[H]),"data-sonner-toast":"","data-rich-colors":(n=v.richColors)!=null?n:j,"data-styled":!(v.jsx||v.unstyled||x),"data-mounted":P,"data-promise":!!v.promise,"data-swiped":He,"data-removed":G,"data-visible":I,"data-y-position":Ln,"data-x-position":ya,"data-index":m,"data-front":mn,"data-swiping":Q,"data-dismissible":V,"data-type":H,"data-invert":ec,"data-swipe-out":de,"data-swipe-direction":re,"data-expanded":!!(w||N&&P),style:{"--index":m,"--toasts-before":m,"--z-index":b.length-m,"--offset":`${G?Se:Ze.current}px`,"--initial-height":N?"auto":`${dr}px`,...E,...v.style},onDragEnd:()=>{ee(!1),J(null),Ct.current=null},onPointerDown:Ee=>{ba||!V||(Dn.current=new Date,ur(Ze.current),Ee.target.setPointerCapture(Ee.pointerId),Ee.target.tagName!=="BUTTON"&&(ee(!0),Ct.current={x:Ee.clientX,y:Ee.clientY}))},onPointerUp:()=>{var Ee,Ke,nt,Gr;if(de||!V)return;Ct.current=null;let Qr=Number(((Ee=pt.current)==null?void 0:Ee.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),as=Number(((Ke=pt.current)==null?void 0:Ke.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ii=new Date().getTime()-((nt=Dn.current)==null?void 0:nt.getTime()),Yr=Y==="x"?Qr:as,ls=Math.abs(Yr)/ii;if(Math.abs(Yr)>=mD||ls>.11){ur(Ze.current),(Gr=v.onDismiss)==null||Gr.call(v,v),ye(Y==="x"?Qr>0?"right":"left":as>0?"down":"up"),Kr(),De(!0),Lt(!1);return}ee(!1),J(null)},onPointerMove:Ee=>{var Ke,nt,Gr,Qr;if(!Ct.current||!V||((Ke=window.getSelection())==null?void 0:Ke.toString().length)>0)return;let as=Ee.clientY-Ct.current.y,ii=Ee.clientX-Ct.current.x,Yr=(nt=e.swipeDirections)!=null?nt:vD(U);!Y&&(Math.abs(ii)>1||Math.abs(as)>1)&&J(Math.abs(ii)>Math.abs(as)?"x":"y");let ls={x:0,y:0};Y==="y"?(Yr.includes("top")||Yr.includes("bottom"))&&(Yr.includes("top")&&as<0||Yr.includes("bottom")&&as>0)&&(ls.y=as):Y==="x"&&(Yr.includes("left")||Yr.includes("right"))&&(Yr.includes("left")&&ii<0||Yr.includes("right")&&ii>0)&&(ls.x=ii),(Math.abs(ls.x)>0||Math.abs(ls.y)>0)&&Lt(!0),(Gr=pt.current)==null||Gr.style.setProperty("--swipe-amount-x",`${ls.x}px`),(Qr=pt.current)==null||Qr.style.setProperty("--swipe-amount-y",`${ls.y}px`)}},ce&&!v.jsx?Z.createElement("button",{"aria-label":O,"data-disabled":ba,"data-close-button":!0,onClick:ba||!V?()=>{}:()=>{var Ee;Kr(),(Ee=v.onDismiss)==null||Ee.call(v,v)},className:Xr(T==null?void 0:T.closeButton,(s=v==null?void 0:v.classNames)==null?void 0:s.closeButton)},(i=D==null?void 0:D.close)!=null?i:tD):null,v.jsx||C.isValidElement(v.title)?v.jsx?v.jsx:typeof v.title=="function"?v.title():v.title:Z.createElement(Z.Fragment,null,H||v.icon||v.promise?Z.createElement("div",{"data-icon":"",className:Xr(T==null?void 0:T.icon,(l=v==null?void 0:v.classNames)==null?void 0:l.icon)},v.promise||v.type==="loading"&&!v.icon?v.icon||Nk():null,v.type!=="loading"?v.icon||(D==null?void 0:D[H])||GA(H):null):null,Z.createElement("div",{"data-content":"",className:Xr(T==null?void 0:T.content,(a=v==null?void 0:v.classNames)==null?void 0:a.content)},Z.createElement("div",{"data-title":"",className:Xr(T==null?void 0:T.title,(c=v==null?void 0:v.classNames)==null?void 0:c.title)},typeof v.title=="function"?v.title():v.title),v.description?Z.createElement("div",{"data-description":"",className:Xr(L,ie,T==null?void 0:T.description,(u=v==null?void 0:v.classNames)==null?void 0:u.description)},typeof v.description=="function"?v.description():v.description):null),C.isValidElement(v.cancel)?v.cancel:v.cancel&&Sc(v.cancel)?Z.createElement("button",{"data-button":!0,"data-cancel":!0,style:v.cancelButtonStyle||R,onClick:Ee=>{var Ke,nt;Sc(v.cancel)&&V&&((nt=(Ke=v.cancel).onClick)==null||nt.call(Ke,Ee),Kr())},className:Xr(T==null?void 0:T.cancelButton,(g=v==null?void 0:v.classNames)==null?void 0:g.cancelButton)},v.cancel.label):null,C.isValidElement(v.action)?v.action:v.action&&Sc(v.action)?Z.createElement("button",{"data-button":!0,"data-action":!0,style:v.actionButtonStyle||M,onClick:Ee=>{var Ke,nt;Sc(v.action)&&((nt=(Ke=v.action).onClick)==null||nt.call(Ke,Ee),!Ee.defaultPrevented&&Kr())},className:Xr(T==null?void 0:T.actionButton,(d=v==null?void 0:v.classNames)==null?void 0:d.actionButton)},v.action.label):null))};function M_(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function xD(e,t){let r={};return[e,t].forEach((n,s)=>{let i=s===1,l=i?"--mobile-offset":"--offset",a=i?hD:dD;function c(u){["top","right","bottom","left"].forEach(g=>{r[`${l}-${g}`]=typeof u=="number"?`${u}px`:u})}typeof n=="number"||typeof n=="string"?c(n):typeof n=="object"?["top","right","bottom","left"].forEach(u=>{n[u]===void 0?r[`${l}-${u}`]=a:r[`${l}-${u}`]=typeof n[u]=="number"?`${n[u]}px`:n[u]}):c(a)}),r}var yD=C.forwardRef(function(e,t){let{invert:r,position:n="bottom-right",hotkey:s=["altKey","KeyT"],expand:i,closeButton:l,className:a,offset:c,mobileOffset:u,theme:g="light",richColors:d,duration:_,style:v,visibleToasts:x=uD,toastOptions:y,dir:f=M_(),gap:p=pD,loadingIcon:h,icons:m,containerAriaLabel:b="Notifications",pauseWhenPageIsHidden:w}=e,[k,j]=Z.useState([]),S=Z.useMemo(()=>Array.from(new Set([n].concat(k.filter($=>$.position).map($=>$.position)))),[k,n]),[E,R]=Z.useState([]),[M,A]=Z.useState(!1),[L,B]=Z.useState(!1),[U,W]=Z.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),q=Z.useRef(null),N=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),T=Z.useRef(null),D=Z.useRef(!1),O=Z.useCallback($=>{j(Y=>{var J;return(J=Y.find(re=>re.id===$.id))!=null&&J.delete||rr.dismiss($.id),Y.filter(({id:re})=>re!==$.id)})},[]);return Z.useEffect(()=>rr.subscribe($=>{if($.dismiss){j(Y=>Y.map(J=>J.id===$.id?{...J,delete:!0}:J));return}setTimeout(()=>{Bb.flushSync(()=>{j(Y=>{let J=Y.findIndex(re=>re.id===$.id);return J!==-1?[...Y.slice(0,J),{...Y[J],...$},...Y.slice(J+1)]:[$,...Y]})})})}),[]),Z.useEffect(()=>{if(g!=="system"){W(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?W("dark"):W("light")),typeof window>"u")return;let $=window.matchMedia("(prefers-color-scheme: dark)");try{$.addEventListener("change",({matches:Y})=>{W(Y?"dark":"light")})}catch{$.addListener(({matches:J})=>{try{W(J?"dark":"light")}catch(re){console.error(re)}})}},[g]),Z.useEffect(()=>{k.length<=1&&A(!1)},[k]),Z.useEffect(()=>{let $=Y=>{var J,re;s.every(ye=>Y[ye]||Y.code===ye)&&(A(!0),(J=q.current)==null||J.focus()),Y.code==="Escape"&&(document.activeElement===q.current||(re=q.current)!=null&&re.contains(document.activeElement))&&A(!1)};return document.addEventListener("keydown",$),()=>document.removeEventListener("keydown",$)},[s]),Z.useEffect(()=>{if(q.current)return()=>{T.current&&(T.current.focus({preventScroll:!0}),T.current=null,D.current=!1)}},[q.current]),Z.createElement("section",{ref:t,"aria-label":`${b} ${N}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},S.map(($,Y)=>{var J;let[re,ye]=$.split("-");return k.length?Z.createElement("ol",{key:$,dir:f==="auto"?M_():f,tabIndex:-1,ref:q,className:a,"data-sonner-toaster":!0,"data-theme":U,"data-y-position":re,"data-lifted":M&&k.length>1&&!i,"data-x-position":ye,style:{"--front-toast-height":`${((J=E[0])==null?void 0:J.height)||0}px`,"--width":`${fD}px`,"--gap":`${p}px`,...v,...xD(c,u)},onBlur:P=>{D.current&&!P.currentTarget.contains(P.relatedTarget)&&(D.current=!1,T.current&&(T.current.focus({preventScroll:!0}),T.current=null))},onFocus:P=>{P.target instanceof HTMLElement&&P.target.dataset.dismissible==="false"||D.current||(D.current=!0,T.current=P.relatedTarget)},onMouseEnter:()=>A(!0),onMouseMove:()=>A(!0),onMouseLeave:()=>{L||A(!1)},onDragEnd:()=>A(!1),onPointerDown:P=>{P.target instanceof HTMLElement&&P.target.dataset.dismissible==="false"||B(!0)},onPointerUp:()=>B(!1)},k.filter(P=>!P.position&&Y===0||P.position===$).map((P,z)=>{var G,K;return Z.createElement(_D,{key:P.id,icons:m,index:z,toast:P,defaultRichColors:d,duration:(G=y==null?void 0:y.duration)!=null?G:_,className:y==null?void 0:y.className,descriptionClassName:y==null?void 0:y.descriptionClassName,invert:r,visibleToasts:x,closeButton:(K=y==null?void 0:y.closeButton)!=null?K:l,interacting:L,position:$,style:y==null?void 0:y.style,unstyled:y==null?void 0:y.unstyled,classNames:y==null?void 0:y.classNames,cancelButtonStyle:y==null?void 0:y.cancelButtonStyle,actionButtonStyle:y==null?void 0:y.actionButtonStyle,removeToast:O,toasts:k.filter(Q=>Q.position==P.position),heights:E.filter(Q=>Q.position==P.position),setHeights:R,expandByDefault:i,gap:p,loadingIcon:h,expanded:M,pauseWhenPageIsHidden:w,swipeDirections:e.swipeDirections})})):null}))});const Ge=C.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},s)=>o.jsx("div",{ref:s,role:r?"none":"separator","aria-orientation":t,className:X("shrink-0 bg-border",t==="horizontal"?"h-px w-full":"h-full w-px",e),...n}));Ge.displayName="Separator";const bD="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",hs="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",wD="font-mono text-[24px] font-medium tracking-[-0.01em] text-foreground",SD="font-mono text-[12px] font-medium text-[var(--fg-muted)]",O_="font-mono text-[12px] text-[var(--fg-dim)]";function I_(e){return!e||e.length<10?e??"—":`${e.slice(0,6)}…${e.slice(-4)}`}function CD(e,t,r){switch(e){case"ready":return{value:t,copy:null};case"error":return{value:"unavailable",copy:r??"Sepolia tJINN balance temporarily unavailable."};case"pending":return{value:"pending",copy:"Waiting for Sepolia balance."}}}function kD({totalEth:e,runwayDays:t,tjinnEarned:r,tjinnEarnedLast24h:n,tjinnState:s,tjinnError:i,agentId:l,masterAddress:a,safeAddress:c,services:u=[],bindingError:g,lastPasswordRotationAt:d,onTopUp:_,actionsDisabled:v=!1}){var A;const[,x]=hn(),{value:y,copy:f}=CD(s,r,i),p=u.find(L=>L.agentId!==null&&!L.safeBoundToAgent),h=((A=u.find(L=>L.serviceId!==null))==null?void 0:A.serviceId)??null,[m,b]=C.useState(!1),[w,k]=C.useState(!1),[j,S]=C.useState(null),[E,R]=C.useState(g??null),M=async()=>{if(p){k(!0),S(null),R(null);try{const B=(await ge.retryAgentBinding({serviceIndex:p.index})).attempts[0];(B==null?void 0:B.status)==="success"?(S("success"),b(!1)):(S("reverted"),R((B==null?void 0:B.detail)??"Bind reverted on chain."))}catch(L){S("reverted"),R(L instanceof Error?L.message:String(L))}finally{k(!1)}}};return o.jsx(jn,{delayDuration:150,children:o.jsxs(we,{role:"region","aria-label":"Wallet","data-testid":"wallet-card",className:"flex flex-col gap-6 p-6",children:[o.jsx("span",{className:bD,children:"Wallet"}),o.jsxs("div",{className:"flex flex-col gap-3","data-testid":"wallet-section-rewards",children:[o.jsx("span",{className:hs,children:"Rewards"}),o.jsxs("div",{className:"flex flex-col gap-1","data-testid":"tjinn-earned-24h-region","aria-live":"polite","aria-atomic":"true",children:[o.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"JINN earned last 24hrs"}),o.jsxs("div",{className:"flex items-baseline gap-2",children:[o.jsx("span",{className:"text-2xl font-bold tracking-tight","data-testid":"tjinn-earned-24h-value",style:s==="error"?{color:"var(--break-red)"}:void 0,children:n??(s==="error"?"unavailable":"pending")}),n!==null&&o.jsx("span",{className:"text-xs text-muted-foreground",children:"tJINN"})]})]}),o.jsxs("div",{className:"flex flex-col gap-1","data-testid":"tjinn-earned-region","aria-live":"polite","aria-atomic":"true",children:[o.jsx("p",{className:"text-xs text-muted-foreground","data-testid":"tjinn-earned-state-prefix",children:"Lifetime"}),o.jsxs("div",{className:"flex items-baseline gap-2",children:[o.jsx("span",{className:"text-base font-medium","data-testid":"tjinn-earned-value",style:s==="error"?{color:"var(--break-red)"}:void 0,children:y}),s==="ready"&&o.jsx("span",{className:"text-xs text-muted-foreground",children:"tJINN"})]}),f&&o.jsx("span",{className:"text-xs text-muted-foreground","data-testid":"tjinn-earned-state",children:f})]})]}),o.jsx(Ge,{}),o.jsxs("div",{className:"flex flex-col gap-3","data-testid":"wallet-section-gas",children:[o.jsx("span",{className:hs,children:"Gas"}),o.jsxs("div",{className:"flex flex-wrap items-baseline gap-2",children:[o.jsx("span",{className:wD,children:e}),o.jsx("span",{className:SD,children:"ETH"}),o.jsx("span",{className:O_,children:"·"}),o.jsxs("span",{className:O_,children:[t,"d runway"]})]}),o.jsx(ae,{variant:"outline",size:"sm","aria-label":"Top up from faucet",onClick:_,disabled:v,"data-testid":"wallet-topup",className:"self-start",children:"Top up from faucet (free)"})]}),o.jsx(Ge,{}),o.jsxs("div",{className:"flex flex-col gap-3","data-testid":"wallet-section-identity",children:[o.jsx("span",{className:hs,children:"Identity"}),o.jsxs("div",{className:"flex flex-wrap gap-8",children:[o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("span",{className:hs,children:"Service"}),o.jsx("span",{"data-testid":"wallet-service-id",className:"font-mono text-[14px] text-foreground",children:h!==null?`#${h}`:"—"})]}),o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("span",{className:hs,children:"Agent"}),o.jsxs("span",{className:"flex items-center gap-2 font-mono text-[14px] text-foreground",children:[l!==null?`#${l}`:"—",p&&o.jsx("button",{type:"button",onClick:()=>b(L=>!L),className:"cursor-pointer rounded-full border border-[var(--wane)] bg-transparent px-1.5 py-px font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--wane)]",children:"binding pending"}),j==="success"&&o.jsx(je,{variant:"success",className:"rounded-full normal-case tracking-[0.12em]",children:"bound"})]})]}),o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("span",{className:hs,children:"Master"}),o.jsxs(Ir,{children:[o.jsx(Fr,{asChild:!0,children:o.jsx("span",{"data-testid":"wallet-master-address",tabIndex:0,className:"cursor-help font-mono text-[14px] text-foreground",children:I_(a)})}),o.jsx(br,{children:a??"No master address yet"})]})]}),o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("span",{className:hs,children:"Safe"}),o.jsxs(Ir,{children:[o.jsx(Fr,{asChild:!0,children:o.jsx("span",{tabIndex:0,className:"cursor-help font-mono text-[14px] text-foreground",children:I_(c)})}),o.jsx(br,{children:c??"No safe address yet"})]})]})]}),m&&p&&o.jsxs(rt,{variant:"warning",className:"mt-2 flex flex-col gap-2",children:[o.jsxs(it,{children:["Service #",p.index," Safe is not yet bound to agent #",p.agentId,". The bootstrap left it unbound; retry to attempt the ERC-1271 bind again."]}),E&&o.jsx("span",{className:"font-mono text-[11px] text-[var(--break-red)]",children:E}),o.jsx(ae,{variant:"default",size:"sm",onClick:()=>{M()},disabled:w,className:"self-start",children:w?"Retrying…":"Retry binding"})]})]}),o.jsx(Ge,{}),o.jsxs("div",{className:"flex flex-col gap-3","data-testid":"wallet-section-password",children:[o.jsx("span",{className:hs,children:"Password"}),o.jsxs("span",{className:"font-mono text-[12px] text-[var(--fg-dim)]",children:["last rotated:"," ",d?o.jsx("time",{dateTime:d,className:"text-[var(--fg-muted)]",children:d}):o.jsx("span",{className:"text-[var(--fg-muted)]",children:"never"})]}),o.jsx(ae,{variant:"secondary",size:"sm","aria-label":"Change password",onClick:()=>x("/operator/security"),"data-testid":"wallet-change-password",className:"self-start",children:"Change password"})]})]})})}const ch="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",F_="flex items-center gap-2 font-mono text-[17px] font-medium text-foreground";function B_({tone:e}){const t=e==="good"?"bg-[var(--vow-green)]":e==="bad"?"bg-[var(--break-red)]":"bg-[var(--fg-muted)]";return o.jsx("span",{"aria-hidden":"true",className:X("inline-block h-2 w-2 rounded-full",t)})}function ED({daemonStatus:e,daemonStateMessage:t,rpcStatus:r,onRestart:n}){const[,s]=hn(),[i,l]=C.useState(null),a=e==="running",c=r==="healthy";function u(){i||!n||(l("restart"),Promise.resolve().then(n).catch(g=>console.error("[node-health] restart failed:",g)).finally(()=>l(null)))}return o.jsx(jn,{delayDuration:150,children:o.jsxs(we,{"data-testid":"node-health-card","aria-labelledby":"node-health-heading",className:"flex flex-col gap-4 p-6",children:[o.jsx("h2",{id:"node-health-heading",className:X(ch,"m-0 text-[var(--fg-dim)]"),children:"Node health"}),o.jsxs("div",{"data-testid":"node-health-daemon-row","data-status":e,className:"flex flex-col gap-2",children:[o.jsx("span",{className:ch,children:"Daemon"}),o.jsxs("span",{className:F_,children:[o.jsx(B_,{tone:a?"good":"bad"}),a?"Running":"Stopped"]}),t&&o.jsx("span",{"data-testid":"node-health-daemon-state",className:"font-mono text-[12px] leading-snug text-[var(--fg-muted)]",children:t}),o.jsx("div",{className:"mt-2 flex gap-2",children:o.jsxs(Ir,{children:[o.jsx(Fr,{asChild:!0,children:o.jsx("span",{tabIndex:a?-1:0,children:o.jsx(ae,{variant:"outline",size:"sm",disabled:!a||i!==null,"data-testid":"node-health-restart",onClick:u,children:i==="restart"?"Restarting...":"Restart"})})}),o.jsx(br,{children:a?"Restart the daemon. The dashboard reconnects when it comes back.":"Daemon is stopped — re-run jinn from your terminal to start it."})]})})]}),o.jsxs("div",{"data-testid":"node-health-rpc-row","data-status":r,className:"flex flex-col gap-2",children:[o.jsx("span",{className:ch,children:"RPC"}),o.jsxs("span",{className:F_,children:[o.jsx(B_,{tone:c?"good":"bad"}),c?"Healthy":"Unreachable"]}),o.jsx("div",{className:"mt-2 flex gap-2",children:o.jsx(ae,{variant:"outline",size:"sm","data-testid":"node-health-rpc-settings",onClick:()=>s("/operator/network"),children:"Manage RPC"})})]})]})})}const Hi=C.forwardRef(({className:e,...t},r)=>o.jsx("div",{className:"relative w-full overflow-auto",children:o.jsx("table",{ref:r,className:X("w-full caption-bottom font-mono text-[12px]",e),...t})}));Hi.displayName="Table";const zi=C.forwardRef(({className:e,...t},r)=>o.jsx("thead",{ref:r,className:X("[&_tr]:border-b [&_tr]:border-border",e),...t}));zi.displayName="TableHeader";const Ui=C.forwardRef(({className:e,...t},r)=>o.jsx("tbody",{ref:r,className:X("[&_tr:last-child]:border-0",e),...t}));Ui.displayName="TableBody";const jD=C.forwardRef(({className:e,...t},r)=>o.jsx("tfoot",{ref:r,className:X("border-t border-border bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));jD.displayName="TableFooter";const Cr=C.forwardRef(({className:e,...t},r)=>o.jsx("tr",{ref:r,className:X("border-b border-border transition-colors hover:bg-[var(--bg-sunken)]/50 data-[state=selected]:bg-[var(--bg-sunken)]",e),...t}));Cr.displayName="TableRow";const We=C.forwardRef(({className:e,...t},r)=>o.jsx("th",{ref:r,className:X("h-8 px-2 text-left align-middle font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",e),...t}));We.displayName="TableHead";const Ve=C.forwardRef(({className:e,...t},r)=>o.jsx("td",{ref:r,className:X("px-2 py-2 align-middle",e),...t}));Ve.displayName="TableCell";const ND=C.forwardRef(({className:e,...t},r)=>o.jsx("caption",{ref:r,className:X("mt-4 text-[12px] text-[var(--fg-muted)]",e),...t}));ND.displayName="TableCaption";const RD=new Set(["DISCOVERED","CLAIMED","WAITING","PRE_SNAPSHOT","RUNNING","POST_SNAPSHOT","PACKAGING","DELIVERING"]);function PD(e,t=6,r=4){return e.length<=t+r+1?e:`${e.slice(0,t)}…${e.slice(-r)}`}function TD(e){return e==="restoration"?"solve":e==="evaluation"?"evaluate":"—"}function AD(e){return e==="COMPLETE"?{label:"succeeded",detail:"COMPLETE",tone:"good"}:e==="FAILED"?{label:"failed",detail:"FAILED",tone:"bad"}:RD.has(e)?{label:"active",detail:e.toLowerCase().replace(/_/g," "),tone:"active"}:{label:e.toLowerCase().replace(/_/g," "),detail:e,tone:"neutral"}}function DD(e){return e==="bad"?"destructive":e==="good"?"success":e==="active"?"default":"outline"}function LD(e){if(!e)return"—";const t=Math.floor((Date.now()-e)/1e3);return t<60?`${t}s ago`:t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}function MD(e){return e==="solving"||e==="solver"?"solver":e==="evaluating"||e==="evaluator"?"evaluator":e}const OD="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground m-0";function Gf({children:e,className:t}){return o.jsx("h3",{className:X(OD,t),children:e})}function Cc({label:e,children:t}){return o.jsxs("div",{className:"flex flex-col gap-1.5",children:[o.jsx(Gf,{children:e}),o.jsx("div",{className:"font-mono text-[12px] text-foreground",children:t})]})}function ID({joined:e,tasks:t}){var a,c;const[,r]=hn(),[n,s]=C.useState(((a=e[0])==null?void 0:a.manifestCid)??((c=e[0])==null?void 0:c.name)??null),i=C.useMemo(()=>e.find(u=>(u.manifestCid??u.name)===n)??e[0]??null,[e,n]),l=C.useMemo(()=>i?t.filter(u=>{if(u.state==="FAILED"){if(u.runStartedAt===null)return!1;const g=(u.failureReason??"").toLowerCase();if(g.includes("not ready")||g.includes("not enabled"))return!1}return e.length<=1?!0:u.manifestCid&&i.manifestCid?u.manifestCid===i.manifestCid:!0}):[],[t,i,e.length,n]);return o.jsx(jn,{delayDuration:150,children:o.jsxs(we,{role:"region","aria-label":"Activity","data-testid":"activity-card",children:[o.jsxs(cr,{className:"flex flex-row items-center justify-between gap-3 pb-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(_2,{className:"h-3.5 w-3.5 text-muted-foreground","aria-hidden":"true"}),o.jsx(Rn,{children:"Activity"})]}),o.jsxs(ae,{variant:"secondary",size:"sm","data-testid":"activity-view-event-log",onClick:()=>r("/events"),children:[o.jsx(E2,{className:"h-3 w-3","aria-hidden":"true"}),"View event log"]})]}),o.jsx(Qe,{children:o.jsxs("div",{className:"grid items-start gap-6 [grid-template-columns:minmax(160px,200px)_minmax(0,1fr)_minmax(180px,220px)]",children:[o.jsxs("div",{"data-testid":"activity-joined",className:"flex min-w-0 flex-col gap-3",children:[o.jsx(Gf,{children:"Joined"}),e.length===0?o.jsx("p",{className:"m-0 font-mono text-[12px] text-muted-foreground",children:"No SolverNets joined."}):o.jsx(zl,{className:"max-h-[280px]",children:o.jsx("div",{className:"flex flex-col gap-1 pr-2",children:e.map(u=>{const g=u.manifestCid??u.name,d=g===((i==null?void 0:i.manifestCid)??(i==null?void 0:i.name));return o.jsx(ae,{variant:"ghost",size:"sm","data-testid":`activity-joined-row-${g}`,"data-state":d?"active":void 0,"aria-current":d?"true":void 0,onClick:()=>s(g),className:X("h-auto w-full justify-start gap-0 rounded-sm border-l-2 px-2.5 py-1.5 font-mono text-[12px] normal-case tracking-normal",d?"border-l-primary bg-accent text-foreground":"border-l-transparent text-muted-foreground hover:bg-accent hover:text-foreground"),children:o.jsx("span",{className:"truncate",children:u.name})},g)})})}),o.jsxs(ae,{variant:"outline",size:"sm","data-testid":"activity-join-more",onClick:()=>r("/operator/registry"),className:"self-start",children:[o.jsx(P2,{className:"h-3 w-3","aria-hidden":"true"}),"Join more SolverNets"]})]}),o.jsxs("div",{"data-testid":"activity-tasks",className:"flex min-w-0 flex-col gap-3",children:[i&&o.jsx("h2",{className:"m-0 font-serif text-[20px] font-normal leading-tight text-foreground",children:i.name}),l.length===0?o.jsx("p",{className:"m-0 font-mono text-[12px] text-muted-foreground",children:"No task runs recorded yet."}):o.jsx("div",{"data-testid":"activity-tasks-table",children:o.jsxs(Hi,{children:[o.jsx(zi,{children:o.jsxs(Cr,{className:"hover:bg-transparent",children:[o.jsx(We,{children:"Run"}),o.jsx(We,{children:"Task"}),o.jsx(We,{children:"State"}),o.jsx(We,{children:"Started"})]})}),o.jsx(Ui,{children:l.map(u=>{const g=AD(u.state),d=g.tone==="active";return o.jsxs(Cr,{"data-active":d?"true":void 0,"data-testid":`activity-task-row-${u.requestId}`,className:X("border-l-2",d?"border-l-primary bg-primary/[0.06]":"border-l-transparent"),children:[o.jsx(Ve,{className:"text-muted-foreground",children:TD(u.taskRole)}),o.jsx(Ve,{children:o.jsxs(Ir,{children:[o.jsx(Fr,{asChild:!0,children:o.jsx("button",{type:"button",className:"bg-transparent p-0 font-mono text-[12px] text-[var(--accent-sky)] underline-offset-4 hover:underline",onClick:()=>r(`/events?requestId=${encodeURIComponent(u.requestId)}`),children:PD(u.requestId)})}),o.jsx(br,{children:u.requestId})]})}),o.jsx(Ve,{children:o.jsxs(Ir,{children:[o.jsx(Fr,{asChild:!0,children:o.jsx("button",{type:"button",className:"cursor-help bg-transparent p-0",children:o.jsx(je,{variant:DD(g.tone),children:g.label})})}),o.jsx(br,{children:g.detail})]})}),o.jsx(Ve,{className:"text-muted-foreground",children:LD(u.runStartedAt??u.stateUpdatedAt)})]},u.requestId)})})]})})]}),o.jsxs("div",{"data-testid":"activity-settings",className:"flex min-w-0 flex-col gap-3",children:[o.jsxs("div",{className:"flex items-baseline justify-between",children:[o.jsx(Gf,{children:"Settings"}),o.jsxs(ae,{variant:"link",size:"sm","data-testid":"activity-settings-edit",onClick:()=>r("/operator/memberships"),className:"h-auto gap-1 p-0 text-[11px] uppercase tracking-[0.14em]",children:[o.jsx(R2,{className:"h-3 w-3","aria-hidden":"true"}),"Edit"]})]}),i?o.jsxs("div",{className:"flex flex-col gap-3",children:[o.jsx(Cc,{label:"Roles",children:i.roles.length===0?o.jsx("span",{className:"text-muted-foreground",children:"None"}):o.jsx("div",{className:"flex flex-wrap gap-1.5",children:i.roles.map(u=>o.jsx(je,{variant:"outline",children:MD(u)},u))})}),o.jsx(Ge,{}),o.jsx(Cc,{label:"Harness",children:i.harness??"—"}),o.jsx(Ge,{}),o.jsx(Cc,{label:"Model",children:o.jsx("span",{className:X(!i.model&&"text-muted-foreground"),children:i.model??"—"})}),o.jsx(Ge,{}),o.jsx(Cc,{label:"Plugins",children:!i.plugins||i.plugins.length===0?o.jsx("span",{className:"text-muted-foreground",children:"None"}):o.jsx("ul",{className:"m-0 flex list-none flex-col gap-1.5 p-0",children:i.plugins.map(u=>o.jsxs("li",{"data-testid":`activity-plugin-${u.name}`,className:"flex items-center gap-2 overflow-hidden",children:[o.jsxs(Ir,{children:[o.jsx(Fr,{asChild:!0,children:o.jsx("button",{type:"button",className:"cursor-help truncate bg-transparent p-0 text-left font-mono text-[12px] text-foreground",children:u.displayName})}),o.jsx(br,{children:u.name})]}),u.defaultIncluded&&o.jsx(je,{variant:"secondary",className:"shrink-0",children:"default"})]},u.name))})})]}):o.jsx("p",{className:"m-0 font-mono text-[12px] text-muted-foreground",children:"No SolverNet selected."})]})]})})]})})}const Jm="claude-code",eg="codex",na="hermes-agent",FD={"claude-code-learner":Jm,"codex-code-learner":eg},BD={[Jm]:"Claude Code",[eg]:"Codex",[na]:"Hermes Agent","swe-rebench-v2-evaluator":"SWE-rebench v2 Evaluator"};function Ur(e){return e?FD[e]??e:""}function Ws(e){const t=Ur(e);return BD[t]??t}function AS(e,t){const r=Ws(e);return t?`${r} ${t}`:r}function $D(e,t){return Ur(e)===Ur(t)}const HD=[{name:"network-tools",version:"0.1.0",defaultIncluded:!0},{name:"claude-code-learner",version:"0.1.0",defaultIncluded:!0}],zD=new Set(["swe-rebench-v2-runtime"]),UD={"network-tools":"Network Tools","claude-code-learner":"Learner","swe-rebench-v2-runtime":"SWE-rebench v2 Runtime","jinn-prediction-plugin":"Prediction Runtime"},Qf="bundled:";function Yf(e){return UD[e]??e}function kc(e){return e.startsWith(Qf)?e.slice(Qf.length):e}function WD(e){const t=Ur(e)===na;return HD.filter(r=>!(t&&r.name==="claude-code-learner")).map(r=>({name:r.name,displayName:Yf(r.name),source:"bundled",version:r.version,defaultIncluded:!0}))}function $_({harness:e,explicit:t,disabledDefaults:r,catalogCompatible:n=[]}){const s=new Set(r.map(kc)),i=new Set(t.map(kc));new Map(t.map(c=>[kc(c),c]));const l=[],a=new Set;for(const c of WD(e))a.has(c.name)||(a.add(c.name),!s.has(c.name)&&l.push(c));for(const c of n){if(a.has(c.name))continue;a.add(c.name);const u=zD.has(c.name),g=i.has(c.name);!u&&!g||u&&s.has(c.name)||l.push({name:c.name,displayName:Yf(c.name),source:"catalog",version:c.version,defaultIncluded:u})}for(const c of t){const u=kc(c);a.has(u)||(a.add(u),l.push({name:u,displayName:Yf(u),source:c.startsWith(Qf)?"bundled":"custom",version:"configured",defaultIncluded:!1}))}return l}function ai(e){if(!e||!/^\d+$/.test(e))return"—";try{const t=BigInt(e);return(Number(t)/1e18).toFixed(4)}catch{return"—"}}function VD(e){if(!e||!/^\d+$/.test(e))return null;try{return`${(Number(BigInt(e))/1e18).toFixed(6)} ETH`}catch{return null}}function qD(e){return!e||e.length<12?e??null:`${e.slice(0,6)}…${e.slice(-4)}`}function KD({serviceId:e,onRestake:t}){const[r,n]=C.useState(!1);return o.jsxs(rt,{variant:"blocking","data-testid":"overview-eviction-banner","aria-live":"polite",className:"flex flex-col gap-2",children:[o.jsx(jm,{className:"h-4 w-4 text-[var(--break-red)]"}),o.jsx(Dt,{className:"text-[var(--break-red)]",children:"Service evicted"}),o.jsx(it,{className:"text-base text-foreground",children:"A service has been evicted from staking. Re-stake to resume earning."}),e!=null&&o.jsx(ae,{variant:"destructive",size:"sm",type:"button","data-testid":"overview-eviction-restake",disabled:r,onClick:async()=>{if(!r){n(!0);try{await t(e)}finally{n(!1)}}},className:"mt-2 self-start",children:r?"Working…":"Re-stake now"})]})}function GD(){var M,A,L,B,U,W,q,N,T,D,O,$,Y,J,re,ye;const[e,t]=C.useState(null),r=ni(),{data:n,isError:s}=Me({queryKey:["status"],queryFn:()=>ge.getStatus(),refetchInterval:5e3}),{data:i}=Me({queryKey:["bootstrap"],queryFn:()=>ge.getBootstrap(),refetchInterval:3e4}),{data:l}=Me({queryKey:["solvernets","catalog"],queryFn:()=>ge.getSolverNets(),refetchInterval:5*6e4}),a=(((M=n==null?void 0:n.fleet)==null?void 0:M.services)??[]).map(P=>({index:P.index,serviceId:P.serviceId??null,safeAddress:P.safeAddress??"",agentId:P.agentId??null,safeBoundToAgent:P.safeBoundToAgent??!1})),c=(((A=n==null?void 0:n.fleet)==null?void 0:A.services)??[]).find(P=>P.evicted===!0),u=c!=null,g=(c==null?void 0:c.serviceId)??null,d=((L=n==null?void 0:n.tJinn)==null?void 0:L.state)??"pending",_=((B=n==null?void 0:n.tJinn)==null?void 0:B.state)==="ready"?ai(n.tJinn.safeBalanceWei??"0"):ai(((U=n==null?void 0:n.tJinn)==null?void 0:U.safeBalanceWei)??void 0),v=((W=n==null?void 0:n.tJinn)==null?void 0:W.operatorMintedLast24hWei)!=null?ai(n.tJinn.operatorMintedLast24hWei):null,x=((q=n==null?void 0:n.tJinn)==null?void 0:q.error)??null,y=ai((N=n==null?void 0:n.masterGas)==null?void 0:N.balanceWei),f=((T=n==null?void 0:n.masterGas)==null?void 0:T.runwayDaysExcess)??"—",p=(D=n==null?void 0:n.balances)==null?void 0:D.eth,h=ai(((O=p==null?void 0:p.master)==null?void 0:O.balanceWei)??void 0),m=ai((($=p==null?void 0:p.agent)==null?void 0:$.balanceWei)??void 0),b=ai(((Y=p==null?void 0:p.safe)==null?void 0:Y.balanceWei)??void 0),w=C.useMemo(()=>{const P=[],z=i==null?void 0:i.joinedSolverNets;if(z)for(const[K,Q]of Object.entries(z)){if(!Q)continue;const ee=Q.contract?l==null?void 0:l.nets.find(De=>{var He,Lt;return De.contract.id===((He=Q.contract)==null?void 0:He.id)&&De.contract.version===((Lt=Q.contract)==null?void 0:Lt.version)}):void 0,de=$_({harness:Q.harness,explicit:Array.isArray(Q.plugins)?Q.plugins:[],disabledDefaults:Array.isArray(Q.disabledDefaultPlugins)?Q.disabledDefaultPlugins:[],catalogCompatible:ee==null?void 0:ee.compatiblePlugins});P.push({name:Q.name??Q.manifestCid??K,manifestCid:Q.manifestCid??K,roles:Array.isArray(Q.roles)?Q.roles:[],harness:Q.harness,model:Q.model,plugins:de})}if(P.length>0)return P;const G=i==null?void 0:i.solverNets;if(G)for(const[K,Q]of Object.entries(G)){if(!Q)continue;const ee=Array.isArray(Q.roles)?Q.roles:[];if(Q.enabled!==!0&&ee.length===0)continue;const de=$_({harness:Q.harness,explicit:[],disabledDefaults:[]});P.push({name:Q.name??K,manifestCid:Q.manifestCid??K,roles:ee,harness:Q.harness,plugins:de})}return P},[i,l]),k=C.useMemo(()=>{var G,K,Q;const P=new Map,z=ee=>{if(ee)for(const de of ee)de.requestId&&(P.has(de.requestId)||P.set(de.requestId,{requestId:de.requestId,manifestCid:de.manifestCid??null,taskRole:de.taskRole,state:de.state,implName:de.implName??null,windowStartTs:de.windowStartTs??0,runStartedAt:de.runStartedAt??null,stateUpdatedAt:de.stateUpdatedAt,deliveryTxHash:de.deliveryTxHash??null,failureReason:de.failureReason??null}))};return z((G=n==null?void 0:n.taskRuns)==null?void 0:G.recentTasks),z((K=n==null?void 0:n.taskRuns)==null?void 0:K.inFlight),z((Q=n==null?void 0:n.predictionV1)==null?void 0:Q.recentTasks),Array.from(P.values()).sort((ee,de)=>de.stateUpdatedAt-ee.stateUpdatedAt)},[n]),j=s&&n===void 0?"stopped":"running",S="healthy",E=void 0,R=(P,z,G)=>{t(P),Promise.resolve().then(z).then(K=>{Zs.success(P,{description:K==null?void 0:K.message,duration:G==null?void 0:G.autoClearMs})}).catch(K=>{Zs.error(`${P} failed`,{description:K instanceof Error?K.message:String(K),duration:1/0})}).finally(()=>t(null))};return o.jsxs("div",{"data-testid":"overview-page-grid",className:"grid items-start gap-6 p-6 [grid-template-columns:minmax(0,1fr)_minmax(0,380px)]",children:[o.jsxs("div",{className:"flex min-w-0 flex-col gap-6",children:[u&&o.jsx(KD,{serviceId:g,onRestake:async P=>{const z=await ge.restake(P);if(!z.ok)throw new Error(z.error??"Re-stake failed.");await r.invalidateQueries({queryKey:["status"]})}}),o.jsx(ID,{joined:w,tasks:k})]}),o.jsxs("aside",{className:"flex flex-col gap-6",children:[o.jsx(ED,{daemonStatus:j,daemonStateMessage:E,rpcStatus:S,onStop:async()=>{if(!(await ge.stopDaemon()).ok)throw new Error("Stop request failed.")},onRestart:async()=>{if(!(await ge.restartDaemon({forceRespawn:!0})).ok)throw new Error("Restart request failed.")}}),o.jsx(kD,{totalEth:y,runwayDays:f,actionsDisabled:e!==null,perRole:{master:h,agent:m,safe:b},tjinnEarned:_,tjinnEarnedLast24h:v,tjinnState:d,tjinnError:x,agentId:((J=a[0])==null?void 0:J.agentId)??null,masterAddress:(i==null?void 0:i.master_address)??null,safeAddress:((re=a[0])==null?void 0:re.safeAddress)??null,services:a,lastPasswordRotationAt:((ye=n==null?void 0:n.security)==null?void 0:ye.lastPasswordRotationAt)??null,onTopUp:()=>R("Top up gas",async()=>{var Q;const P=await ge.triggerDrip({singleDrip:!0});if(!P.ok)throw new Error(P.reason??"Gas top-up failed.");const z=P.txHash??((Q=P.txHashes)==null?void 0:Q.at(-1));if(!z)return{message:"Gas top-up checked; the faucet sent no funds."};const G=VD(P.deltaWei),K=qD(z);return{message:G?`Gas topped up: +${G} · tx ${K}`:`Gas top-up sent · tx ${K}`}},{autoClearMs:5e3})})]})]})}const QD=["task_posted","intent_registry_failed","request_claimed","delivery_submitted","evaluation_submitted","reward_claimed","balance_topup","jinn_claim_emitted","jinn_claim_ticket_recorded","jinn_claim_submitted","jinn_claim_canonical_skip","engine_transition","tick_error","race_lost","startup","shutdown"],YD={task_posted:{label:"Task posted",description:"A new task intent was published on-chain.",tone:"info"},intent_registry_failed:{label:"Intent registry failed",description:"Posting a task intent to the registry did not succeed.",tone:"error"},request_claimed:{label:"Request claimed",description:"The solver claimed a task request to work on.",tone:"info"},delivery_submitted:{label:"Delivery submitted",description:"A completed solution was delivered on-chain.",tone:"success"},evaluation_submitted:{label:"Evaluation submitted",description:"An evaluation verdict was submitted for a delivery.",tone:"success"},reward_claimed:{label:"Reward claimed",description:"Staking rewards were claimed to the operator's safe.",tone:"reward"},balance_topup:{label:"Balance top-up",description:"Gas balance was topped up from the faucet.",tone:"info"},jinn_claim_emitted:{label:"JINN claim emitted",description:"A JINN earnings claim was emitted locally.",tone:"info"},jinn_claim_ticket_recorded:{label:"JINN ticket recorded",description:"A JINN claim ticket was recorded for later submission.",tone:"info"},jinn_claim_submitted:{label:"JINN claim submitted",description:"A JINN earnings claim was submitted on-chain.",tone:"success"},jinn_claim_canonical_skip:{label:"JINN claim skipped",description:"A JINN claim was skipped as already canonical.",tone:"neutral"},engine_transition:{label:"Engine transition",description:"A task run moved to a new lifecycle state.",tone:"info"},tick_error:{label:"Tick error",description:"An error occurred during a daemon polling tick.",tone:"error"},race_lost:{label:"Race lost",description:"A claim or evaluation lost the on-chain race (task already filled or evaluation deadline passed); no action needed.",tone:"neutral"},startup:{label:"Daemon started",description:"The jinn daemon process started.",tone:"neutral"},shutdown:{label:"Daemon stopped",description:"The jinn daemon process shut down.",tone:"neutral"}};function ZD(e){const t=e.replace(/_/g," ").trim();return t.length===0?"Event":t.charAt(0).toUpperCase()+t.slice(1)}function Ru(e){const t=YD[e];return t||{label:ZD(e),description:"A daemon lifecycle event.",tone:"neutral"}}function Zf(e,t){if(t==="failed")return"destructive";if(t==="warn")return"warning";const r=Ru(e).tone;return r==="error"?"destructive":r==="warning"?"warning":r==="success"||r==="reward"?"success":r==="neutral"?"secondary":"default"}const XD=50;function JD(e){if(!e)return"-";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString().replace("T"," ").slice(0,19)}function H_(e,t=8,r=4){return e.length<=t+r+1?e:`${e.slice(0,t)}...${e.slice(-r)}`}function eL(e){return e.requestId??e.solverType??"-"}function tL(){const[e]=hn();return C.useMemo(()=>{var i;const t=e.includes("?")?e.split("?")[1]:"",r=typeof window>"u"?"":window.location.search.replace(/^\?/,""),n=t||r;return((i=new URLSearchParams(n).get("requestId"))==null?void 0:i.trim())||void 0},[e])}function rL({pageSize:e=XD}={}){var d,_;const t=tL(),[r,n]=C.useState([]),[s,i]=C.useState("all"),l=BN({queryKey:["activity-events",r,s,t,e],queryFn:({pageParam:v})=>ge.getActivityEvents({kinds:r.length>0?r:void 0,outcome:s==="all"?void 0:s,requestId:t,beforeId:typeof v=="number"?v:void 0,limit:e}),initialPageParam:void 0,getNextPageParam:v=>v.nextCursor??void 0}),a=((d=l.data)==null?void 0:d.pages)??[],c=a.flatMap(v=>v.events),u=((_=a[0])==null?void 0:_.counts)??{};function g(v){n(x=>x.includes(v)?x.filter(y=>y!==v):[...x,v])}return o.jsxs("main",{"data-testid":"events-page",className:"mx-auto flex w-full max-w-6xl flex-col gap-5 p-6",children:[o.jsxs("header",{className:"flex flex-wrap items-end justify-between gap-3",children:[o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("h1",{className:"m-0 font-serif text-[32px] font-normal leading-tight text-foreground",children:"Events"}),o.jsx("p",{className:"m-0 font-mono text-[12px] text-muted-foreground",children:"Persistent lifecycle activity from this operator."})]}),o.jsx(ae,{asChild:!0,variant:"secondary",size:"sm",children:o.jsx(lr,{href:"/overview","data-testid":"events-back",children:"Overview"})})]}),t&&o.jsxs(rt,{variant:"info","data-testid":"events-request-scope",children:[o.jsx(Dt,{children:"Request scoped"}),o.jsxs(it,{className:"flex flex-wrap items-center gap-2",children:[o.jsxs("span",{className:"break-all",children:["Showing events for ",t]}),o.jsx(ae,{asChild:!0,variant:"link",size:"sm",className:"h-auto p-0",children:o.jsxs(lr,{href:"/events","data-testid":"events-clear-request",children:[o.jsx(Sl,{"aria-hidden":"true"}),"Clear"]})})]})]}),o.jsxs(we,{children:[o.jsxs(cr,{children:[o.jsx(Rn,{children:"Filters"}),o.jsx(Gs,{children:"Kind and outcome filters page through the same durable log."})]}),o.jsxs(Qe,{className:"flex flex-col gap-4",children:[o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx("h2",{className:"m-0 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:"Kind"}),o.jsx("div",{className:"flex flex-wrap gap-2",children:QD.map(v=>{const x=r.includes(v),y=Ru(v);return o.jsxs(ae,{type:"button",size:"sm",variant:x?"outline":"secondary","aria-pressed":x?"true":"false","data-testid":`events-kind-filter-${v}`,onClick:()=>g(v),className:"normal-case tracking-normal",children:[y.label,u[v]!==void 0&&o.jsx(je,{variant:"secondary",children:u[v]})]},v)})})]}),o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx("h2",{className:"m-0 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:"Outcome"}),o.jsx("div",{className:"flex flex-wrap gap-2",children:["all","ok","failed","warn"].map(v=>o.jsx(ae,{type:"button",size:"sm",variant:s===v?"outline":"secondary","aria-pressed":s===v?"true":"false","data-testid":`events-outcome-${v}`,onClick:()=>i(v),children:v},v))})]})]})]}),o.jsxs(we,{"data-testid":"events-list-section",children:[o.jsxs(cr,{children:[o.jsx(Rn,{children:"Event Log"}),o.jsxs(Gs,{children:[c.length," loaded"]})]}),o.jsxs(Qe,{className:"flex flex-col gap-4",children:[l.isLoading&&o.jsxs("div",{"data-testid":"events-loading",className:"flex items-center gap-2 font-mono text-[12px] text-muted-foreground",children:[o.jsx(Bf,{className:"animate-spin","aria-hidden":"true"}),"Loading events"]}),l.isError&&o.jsxs(rt,{variant:"blocking","data-testid":"events-error",children:[o.jsx(Dt,{children:"Events unavailable"}),o.jsxs(it,{className:"flex flex-wrap items-center justify-between gap-3",children:[o.jsx("span",{children:l.error instanceof Error?l.error.message:"Failed to load events."}),o.jsx(ae,{type:"button",size:"sm",variant:"secondary",onClick:()=>{l.refetch()},children:"Retry"})]})]}),!l.isLoading&&!l.isError&&c.length===0&&o.jsx("p",{"data-testid":"events-empty",className:"m-0 font-mono text-[12px] text-muted-foreground",children:"No events match the current filters."}),c.length>0&&o.jsx("div",{"data-testid":"events-list",className:"overflow-x-auto",children:o.jsxs(Hi,{children:[o.jsx(zi,{children:o.jsxs(Cr,{className:"hover:bg-transparent",children:[o.jsx(We,{children:"Time"}),o.jsx(We,{children:"Kind"}),o.jsx(We,{children:"Subject"}),o.jsx(We,{children:"Outcome"}),o.jsx(We,{children:"Tx"}),o.jsx(We,{className:"w-8"})]})}),o.jsx(Ui,{children:c.map(v=>{const x=Ru(v.kind);return o.jsxs(Cr,{"data-testid":"events-row",children:[o.jsx(Ve,{className:"whitespace-nowrap text-muted-foreground",children:JD(v.ts)}),o.jsx(Ve,{children:o.jsx(je,{variant:Zf(v.kind,v.outcome),children:x.label})}),o.jsx(Ve,{className:"max-w-[280px] font-mono text-[12px]",children:o.jsxs(Ir,{children:[o.jsx(Fr,{asChild:!0,children:o.jsx("span",{className:X(v.requestId&&"cursor-help"),children:v.requestId?H_(v.requestId):eL(v)})}),v.requestId&&o.jsx(br,{children:v.requestId})]})}),o.jsx(Ve,{children:o.jsx(je,{variant:Zf(v.kind,v.outcome),children:v.outcome??"-"})}),o.jsx(Ve,{className:"font-mono text-[12px] text-muted-foreground",children:v.txHash?H_(v.txHash,6,4):"-"}),o.jsx(Ve,{className:"text-right",children:o.jsx(ae,{asChild:!0,variant:"ghost",size:"icon","aria-label":`Inspect event ${v.id}`,children:o.jsx(lr,{href:`/events/${v.id}`,"data-testid":"events-row-link",children:o.jsx(fw,{"aria-hidden":"true"})})})})]},v.id)})})]})}),l.hasNextPage&&o.jsxs(ae,{type:"button",variant:"secondary",size:"sm","data-testid":"events-load-more",disabled:l.isFetchingNextPage,onClick:()=>{l.fetchNextPage()},className:"self-start",children:[l.isFetchingNextPage&&o.jsx(Bf,{className:"animate-spin","aria-hidden":"true"}),l.isFetchingNextPage?"Loading":"Load more"]})]})]})]})}function nL(e){if(!e)return"-";const t=new Date(e);return Number.isNaN(t.getTime())?e:`${t.toISOString().replace("T"," ").slice(0,19)} UTC`}function sL(e){return e==="base"?"https://basescan.org":"https://sepolia.basescan.org"}function li({label:e,children:t}){return o.jsxs("div",{className:"grid gap-1 py-2 sm:grid-cols-[160px_minmax(0,1fr)] sm:gap-4",children:[o.jsx("dt",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:e}),o.jsx("dd",{className:"m-0 break-all font-mono text-[12px] text-foreground",children:t})]})}function iL(){const t=ad().id??"",{data:r}=Me({queryKey:["bootstrap"],queryFn:()=>ge.getBootstrap()}),{data:n,isLoading:s,isError:i,error:l,refetch:a}=Me({queryKey:["activity-events","detail",t],queryFn:()=>ge.getActivityEvent(t),enabled:t.length>0}),c=n?Ru(n.kind):null,u=sL(r==null?void 0:r.chain);return o.jsxs("main",{"data-testid":"event-detail",className:"mx-auto flex w-full max-w-4xl flex-col gap-5 p-6",children:[o.jsxs("header",{className:"flex flex-wrap items-end justify-between gap-3",children:[o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("h1",{className:"m-0 font-serif text-[32px] font-normal leading-tight text-foreground",children:c?c.label:"Event"}),o.jsxs("p",{className:"m-0 font-mono text-[12px] text-muted-foreground",children:["Event ",t]})]}),o.jsx(ae,{asChild:!0,variant:"secondary",size:"sm",children:o.jsxs(lr,{href:"/events","data-testid":"event-detail-back",children:[o.jsx(x2,{"aria-hidden":"true"}),"Events"]})})]}),s&&o.jsxs("div",{"data-testid":"event-detail-loading",className:"flex items-center gap-2 font-mono text-[12px] text-muted-foreground",children:[o.jsx(Bf,{className:"animate-spin","aria-hidden":"true"}),"Loading event"]}),i&&o.jsxs(rt,{variant:"blocking","data-testid":"event-detail-error",children:[o.jsx(Dt,{children:"Event unavailable"}),o.jsxs(it,{className:"flex flex-wrap items-center justify-between gap-3",children:[o.jsx("span",{children:(l==null?void 0:l.status)===404?"This event could not be found.":l instanceof Error?l.message:"Failed to load this event."}),o.jsx(ae,{type:"button",size:"sm",variant:"secondary",onClick:()=>{a()},children:"Retry"})]})]}),n&&c&&o.jsxs(o.Fragment,{children:[o.jsxs(we,{"data-testid":"event-detail-summary",children:[o.jsxs(cr,{children:[o.jsx(Rn,{children:"Summary"}),o.jsx(Gs,{children:c.description})]}),o.jsxs(Qe,{className:"flex flex-wrap gap-2",children:[o.jsx(je,{variant:Zf(n.kind,n.outcome),children:n.outcome??"-"}),o.jsx(je,{variant:"outline",children:nL(n.ts)})]})]}),o.jsxs(we,{"data-testid":"event-detail-payload",children:[o.jsxs(cr,{children:[o.jsx(Rn,{children:"Details"}),o.jsx(Gs,{children:"Raw event fields from the persistent activity log."})]}),o.jsx(Qe,{children:o.jsxs("dl",{className:"m-0",children:[o.jsx(li,{label:"Event id",children:n.id}),o.jsx(Ge,{}),o.jsx(li,{label:"Kind",children:n.kind}),o.jsx(Ge,{}),o.jsx(li,{label:"Request id",children:n.requestId??"-"}),o.jsx(Ge,{}),o.jsx(li,{label:"Service index",children:n.serviceIndex!==null?n.serviceIndex:"-"}),o.jsx(Ge,{}),o.jsx(li,{label:"Solver type",children:n.solverType??"-"}),o.jsx(Ge,{}),o.jsx(li,{label:"Transaction",children:n.txHash?o.jsx(ae,{asChild:!0,variant:"link",size:"sm",className:"h-auto justify-start p-0 font-mono text-[12px] normal-case tracking-normal",children:o.jsxs("a",{"data-testid":"event-detail-tx-link",href:`${u}/tx/${n.txHash}`,target:"_blank",rel:"noreferrer",children:[n.txHash,o.jsx(jo,{"aria-hidden":"true"})]})}):"-"}),o.jsx(Ge,{}),o.jsx(li,{label:"Detail",children:n.detail??"-"})]})})]})]})]})}function _a(e,t){const r=e??[];return r.includes(t)?r:[...r,t]}function mi(e){if(!e||!/^\d+$/.test(e))return"—";try{const t=BigInt(e);if(t===0n)return"0 ETH";const r=1000000000000000000n,n=100000000000000n,s=1000000000n;return t>=n?`${z_(t,18,t>=r?4:6)} ETH`:t>=s?`${z_(t,9,4)} gwei`:`${t.toLocaleString()} wei`}catch{return"—"}}function z_(e,t,r){const n=10n**BigInt(t),s=e/n,i=e%n;if(i===0n||r===0)return s.toString();const a=i.toString().padStart(t,"0").slice(0,r).replace(/0+$/,"");return a?`${s}.${a}`:s.toString()}function U_(e){const t=e.trim();if(t.length===0)return null;if(!/^\d+$/.test(t))throw new Error("not a non-negative integer");return BigInt(t)}const W_={launching:{variant:"default",label:"Launching"},launched:{variant:"success",label:"Launched"},paused:{variant:"pill",label:"Paused"},retired:{variant:"outline",label:"Retired"},failed:{variant:"destructive",label:"Failed"}};function oL(e){return e.length<=16?e:`${e.slice(0,8)}…${e.slice(-6)}`}function aL(e){try{const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString().replace("T"," ").slice(0,16)+" UTC"}catch{return e}}function lL({status:e}){const t=W_[e]??W_.launching;return o.jsx(je,{variant:t.variant,className:"whitespace-nowrap",children:t.label})}function cL({label:e}){return o.jsx(je,{"data-testid":"launcher-owned-row-role",variant:"outline",className:"normal-case tracking-[0.12em] text-[var(--fg-muted)]",children:e})}function uL({record:e}){const[,t]=hn(),r=`/launcher/launched/${encodeURIComponent(e.solverNetId)}`,n=e.summary,s=(n==null?void 0:n.name)??e.solverNetId,i=n!==void 0?`${n.contractId}.${n.contractVersion}`:null;return o.jsx("a",{href:r,"data-testid":"launcher-owned-row","data-solvernet-id":e.solverNetId,"data-has-summary":n!==void 0?"true":"false",onClick:l=>{l.preventDefault(),t(r)},className:"block text-inherit no-underline",children:o.jsxs(we,{className:X("grid grid-cols-[1fr_auto] items-center gap-4 p-4","transition-colors hover:bg-[var(--bg-sunken)]/40 cursor-pointer"),children:[o.jsxs("div",{className:"flex min-w-0 flex-col gap-1.5",children:[o.jsx("div",{"data-testid":"launcher-owned-row-primary",className:X("truncate text-foreground",n!==void 0?"font-serif text-[18px] font-normal tracking-[-0.01em]":"font-mono text-[14px] font-medium"),children:s}),i!==null&&o.jsx("div",{"data-testid":"launcher-owned-row-contract",className:"font-mono text-[12px] text-[var(--fg-muted)]",children:i}),n!==void 0&&o.jsxs("div",{"data-testid":"launcher-owned-row-prices",className:"flex flex-wrap gap-x-3.5 font-mono text-[12px] text-[var(--fg-muted)]",children:[o.jsxs("span",{children:["solution ",mi(n.solutionPriceWei)]}),o.jsxs("span",{children:["verdict ",mi(n.verdictPriceWei)]})]}),n!==void 0&&n.openRoles.length>0&&o.jsx("div",{"data-testid":"launcher-owned-row-roles",className:"flex flex-wrap gap-1.5",children:n.openRoles.map(l=>o.jsx(cL,{label:l},l))}),o.jsxs("div",{className:"flex flex-wrap gap-x-3.5 font-mono text-[12px] text-[var(--fg-muted)]",children:[o.jsxs("span",{children:["cid ",oL(e.manifestCid)]}),o.jsxs("span",{children:["launched ",aL(e.launchedAt)]})]})]}),o.jsx(lL,{status:e.status})]})})}function dL(){return o.jsxs(we,{"data-testid":"launcher-empty-state",className:"flex flex-col gap-3.5 p-8",children:[o.jsx("h2",{className:"m-0 font-mono text-[18px] font-medium tracking-[-0.01em] text-foreground",children:"No SolverNets created yet."}),o.jsx("p",{className:"m-0 text-[14px] leading-relaxed text-[var(--fg-muted)]",children:"Create a SolverNet to direct operators toward a specific kind of knowledge work."}),o.jsx("div",{children:o.jsx(ae,{asChild:!0,variant:"default",size:"lg",children:o.jsx(lr,{href:"/launcher/create",children:"Create SolverNet"})})})]})}function hL(){const{data:e,isLoading:t,isError:r,error:n,refetch:s}=Me({queryKey:["solvernets","launched","owned"],queryFn:()=>ge.solvernets.listLaunched(),refetchInterval:3e4});return o.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[o.jsxs("div",{className:"flex items-end justify-between",children:[o.jsx("h1",{className:"m-0 font-serif text-[32px] font-normal text-foreground",children:"Your SolverNets"}),((e==null?void 0:e.records.length)??0)>0&&o.jsx(ae,{asChild:!0,variant:"default","data-testid":"launcher-create-cta",children:o.jsx(lr,{href:"/launcher/create",children:"Create SolverNet"})})]}),t&&o.jsx("p",{"data-testid":"launcher-loading",className:"m-0 font-mono text-[13px] text-[var(--fg-muted)]",children:"Loading…"}),r&&o.jsxs(rt,{"data-testid":"launcher-error",variant:"blocking",className:"flex items-center justify-between gap-4 border-l-0 border border-destructive p-4",children:[o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx(Dt,{className:"font-mono text-[13px] font-medium text-destructive",children:"Failed to load your SolverNets."}),o.jsx(it,{className:"text-[12px] text-[var(--fg-muted)]",children:n instanceof Error?n.message:"Unknown error"})]}),o.jsx(ae,{type:"button",variant:"secondary",size:"sm",onClick:()=>{s()},children:"Retry"})]}),!t&&!r&&e&&e.records.length===0&&o.jsx(dL,{}),!t&&!r&&e&&e.records.length>0&&o.jsx("div",{className:"flex flex-col gap-2",children:e.records.map(i=>o.jsx(uL,{record:i},i.solverNetId))})]})}const ft=C.forwardRef(({className:e,type:t,...r},n)=>o.jsx("input",{type:t,ref:n,className:X("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 font-mono text-[13px] text-foreground transition-colors","placeholder:text-[var(--fg-dim)]","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring","disabled:cursor-not-allowed disabled:opacity-50",e),...r}));ft.displayName="Input";var fL=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],pL=fL.reduce((e,t)=>{const r=Nm(`Primitive.${t}`),n=C.forwardRef((s,i)=>{const{asChild:l,...a}=s,c=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...a,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),mL="Label",DS=C.forwardRef((e,t)=>o.jsx(pL.label,{...e,ref:t,onMouseDown:r=>{var s;r.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));DS.displayName=mL;var LS=DS;const wr=C.forwardRef(({className:e,...t},r)=>o.jsx(LS,{ref:r,className:X("font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)] peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...t}));wr.displayName=LS.displayName;function gL({current:e,total:t=5}){return o.jsxs("div",{"data-testid":"launcher-create-progress",className:"flex items-center gap-3 font-mono text-[11px] uppercase tracking-[0.14em] text-fg-muted",children:[o.jsxs("span",{"data-testid":"launcher-create-step-counter",children:["Step ",e," of ",t]}),o.jsx("div",{className:"flex max-w-[320px] flex-1 gap-1",children:Array.from({length:t}).map((r,n)=>{const s=n+1,i=s<=e;return o.jsx("span",{"data-testid":`launcher-create-progress-pip-${s}`,"data-filled":i?"true":"false",className:X("h-[3px] flex-1 rounded-sm",i?"bg-accent-sky":"bg-border")},s)})})]})}function Wi({step:e,total:t=5,title:r,blurb:n,children:s,footer:i,error:l}){return o.jsxs("main",{"data-testid":`launcher-create-step-${e}`,className:"mx-auto flex max-w-[720px] flex-col gap-5 p-6",children:[o.jsx(gL,{current:e,total:t}),o.jsxs("header",{className:"flex flex-col gap-1.5",children:[o.jsx("h1",{className:"m-0 font-serif text-[32px] font-normal leading-tight tracking-[-0.01em] text-foreground",children:r}),n&&o.jsx("p",{className:"m-0 text-[14px] leading-relaxed text-fg-muted",children:n})]}),l&&o.jsx(rt,{variant:"blocking","data-testid":"launcher-create-error",className:"font-mono text-[13px]",children:o.jsx(it,{children:l})}),o.jsx("div",{className:"flex flex-col gap-4",children:s}),o.jsx(Ge,{}),o.jsx("div",{className:"flex items-center justify-between gap-3",children:i})]})}function Vi({onBack:e,onNext:t,nextLabel:r="Next",nextDisabled:n=!1,busy:s=!1,right:i}){return o.jsxs(o.Fragment,{children:[o.jsx("div",{children:e&&o.jsx(ae,{type:"button",variant:"secondary",size:"lg","data-testid":"launcher-create-back",onClick:e,disabled:s,children:"Back"})}),o.jsxs("div",{className:"flex items-center gap-4",children:[i,t&&o.jsx(ae,{type:"button",size:"lg","data-testid":"launcher-create-next",onClick:t,disabled:n||s,children:r})]})]})}function xt({label:e,helperText:t,error:r,children:n,asLabel:s=!0}){const i=o.jsxs(o.Fragment,{children:[o.jsx(wr,{children:e}),n,r?o.jsx("span",{className:"font-mono text-[12px] text-break-red",children:r}):t&&o.jsx("span",{className:"font-mono text-[11px] text-fg-dim",children:t})]});return s?o.jsx("label",{className:"flex flex-col gap-1.5",children:i}):o.jsx("div",{className:"flex flex-col gap-1.5",children:i})}const vL="flex w-full rounded-md border border-input bg-transparent px-3 py-2 font-mono text-[13px] text-foreground placeholder:text-fg-dim focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50";function V_({draft:e,onAdvance:t,busy:r,error:n}){const[s,i]=C.useState(e.name??""),[l,a]=C.useState(e.description??""),[c,u]=C.useState(!1),g=c&&s.trim().length===0?"Name is required.":null,d=c&&l.trim().length===0?"Description is required.":null,_=async v=>{v==null||v.preventDefault(),u(!0),!(s.trim().length===0||l.trim().length===0)&&await t({name:s.trim(),description:l.trim(),completedSteps:_a(e.completedSteps,"define")})};return o.jsx(Wi,{step:1,title:"Name your SolverNet",blurb:"Pick a short, recognisable name and describe what kind of knowledge work this SolverNet directs operators toward.",error:n,footer:o.jsx(Vi,{onNext:()=>{_()},nextDisabled:s.trim().length===0||l.trim().length===0,busy:r}),children:o.jsxs("form",{onSubmit:v=>{_(v)},className:"flex flex-col gap-4",children:[o.jsx(xt,{label:"Name",error:g,helperText:"Shown in the registry catalog and the operator opt-in cards.",children:o.jsx(ft,{"data-testid":"launcher-create-name",type:"text",value:s,onChange:v=>i(v.target.value),placeholder:"e.g. Polymarket forecasts",className:X(g&&"border-break-red"),disabled:r})}),o.jsx(xt,{label:"Description",error:d,helperText:"One or two sentences. Operators read this when deciding whether to opt in.",children:o.jsx("textarea",{"data-testid":"launcher-create-description",value:l,onChange:v=>a(v.target.value),rows:4,placeholder:"Forecast resolved Polymarket outcomes; rewarded by Brier score on verified resolutions.",className:X(vL,"min-h-[96px] resize-y",d&&"border-break-red"),disabled:r})}),o.jsx(ae,{type:"submit",className:"hidden","aria-hidden":!0,tabIndex:-1})]})})}const xa={id:"prediction",version:"v1",name:"Prediction",description:"Forecast resolved outcomes. Solvers submit a probability for a binary market; evaluators score against the on-chain resolution using Brier loss.",schemas:{task:{name:"prediction.v1 Task",description:"A binary Polymarket market with resolution time, condition id, and orderbook snapshot."},solution:{name:"prediction.v1 Solution",description:"A scalar probability in [0, 1] that the market resolves YES."},verdict:{name:"prediction.v1 Verdict",description:"Brier-loss score derived from the solver probability and the resolved outcome."}},evaluationFunction:{id:"prediction.brier-loss.v1",deterministic:!0,inputs:["prediction.v1 Task","prediction.v1 Solution","Polymarket/UMA resolution"],output:"prediction.v1 Verdict"},aggregationFunction:{id:"prediction.trailing-mean-brier-spread.v1",deterministic:!0,inputs:["SCORED prediction.v1 Verdicts"],output:"trailing mean brierSpread",windowDays:84},claimPolicyDefaults:{mode:"parallel",maxClaims:25,maxClaimsPerOperator:1,claimLeaseTtlSeconds:30*60},credentialRequirements:{creator:[{id:"polymarket.public.market-data.read",kind:"public-api",required:!0,description:"Read public Polymarket market metadata and orderbook snapshots for Task creation."}],solver:[],evaluator:[{id:"polymarket.public.resolution.read",kind:"public-api",required:!0,description:"Read public Polymarket/UMA final market state for resolution mapping."}]},generatorDefaults:{cadenceMs:6*60*60*1e3,submissionWindowMs:6*60*60*1e3,maxNewRoundsPerPoll:25,maxNewRoundsPerDay:100,maxOpenRounds:250,minTimeToResolutionHours:24,maxTimeToResolutionHours:168,minLiquidityUsd:"10000",minVolume24hUsd:"2500",maxYesSpread:"0.10",maxOrderbookAgeSeconds:60}},MS={id:"swe-rebench-v2",version:"v1",name:"SWE-rebench v2",description:"Code-issue benchmark sourced from the nebius/SWE-rebench-leaderboard HuggingFace dataset. Solvers submit a patch; evaluators run the upstream eval.py harness inside the per-instance Docker image and emit a 0/1 Verdict against the FAIL_TO_PASS / PASS_TO_PASS tests.",schemas:{task:{name:"swe-rebench-v2.v1 Task",description:"A reference to a HuggingFace dataset row by (hf_dataset, hf_split, instance_id), plus repo + base_commit + language + problem statement."},solution:{name:"swe-rebench-v2.v1 Solution",description:"A unified diff patch (git-format), with optional self-reported cost. The trajectory blob is pinned daemon-side and referenced via the envelope, not the payload."},verdict:{name:"swe-rebench-v2.v1 Verdict",description:"Score 0 or 1 based on whether the patch passes the per-instance Docker test suite, plus passed_match flag and evaluator cost. The test log is pinned daemon-side and surfaced via the verdict-artifact metadata."}},evaluationFunction:{id:"swe-rebench-v2.docker-test-suite.v1",deterministic:!0,inputs:["swe-rebench-v2.v1 Task","swe-rebench-v2.v1 Solution","per-instance Docker image"],output:"swe-rebench-v2.v1 Verdict"},aggregationFunction:{id:"swe-rebench-v2.multi-winrate.v1",deterministic:!0,inputs:["SCORED swe-rebench-v2.v1 Verdicts"],output:"mean / complexityWeighted / byLanguage / frontierResolved / parityTripRate",windowDays:30},claimPolicyDefaults:{mode:"parallel",maxClaims:5,maxClaimsPerOperator:5,claimLeaseTtlSeconds:60*60},credentialRequirements:{creator:[{id:"huggingface.public.datasets-server.read",kind:"public-api",required:!0,description:"Read public HuggingFace dataset rows from the nebius/SWE-rebench-leaderboard splits."}],solver:[],evaluator:[{id:"docker.local.run",kind:"local-runtime",required:!0,description:"Run per-instance Docker images that ship with the upstream eval.py harness."},{id:"huggingface.public.datasets-server.read",kind:"public-api",required:!0,description:"Read the HF dataset row referenced by the Task to recover test_patch + FAIL_TO_PASS / PASS_TO_PASS."}]},generatorDefaults:{N_target_successes:5,N_max_postings_per_task:10,posting_window_ms:24*60*60*1e3,post_batch_size:25,claimLeaseTtlSeconds:60*60}},Xf={"prediction.v1":xa,"swe-rebench-v2.v1":MS},_L="prediction.v1",xL="font-mono text-[11px] uppercase tracking-[0.14em] text-fg-dim";function yL({draft:e,template:t=xa,onAdvance:r,onBack:n,busy:s,error:i}){const l=()=>{r({templateContractId:t.id,templateContractVersion:t.version,completedSteps:_a(e.completedSteps,"reviewContract")})};return o.jsx(Wi,{step:2,title:"Review contract",blurb:"The contract defines the schemas, evaluation, and aggregation that this SolverNet will pin to its manifest.",error:i,footer:o.jsx(Vi,{onBack:n,onNext:l,busy:s}),children:o.jsx(we,{"data-testid":"launcher-create-template","data-template-id":`${t.id}.${t.version}`,children:o.jsxs(Qe,{className:"flex flex-col gap-4 p-6",children:[o.jsxs("header",{className:"flex flex-col gap-1",children:[o.jsxs("span",{className:xL,children:[t.id,".",t.version]}),o.jsx("h2",{className:"m-0 font-serif text-[24px] font-normal text-foreground",children:t.name}),o.jsx("p",{className:"m-0 text-[13px] leading-relaxed text-fg-muted",children:t.description})]}),o.jsxs(Aa,{title:"Schemas",children:[o.jsx(Jt,{label:"Task",value:t.schemas.task.name,hint:t.schemas.task.description}),o.jsx(Jt,{label:"Solution",value:t.schemas.solution.name,hint:t.schemas.solution.description}),o.jsx(Jt,{label:"Verdict",value:t.schemas.verdict.name,hint:t.schemas.verdict.description})]}),o.jsxs(Aa,{title:"Evaluation function",children:[o.jsx(Jt,{label:"Id",value:t.evaluationFunction.id,mono:!0}),o.jsx(Jt,{label:"Deterministic",value:t.evaluationFunction.deterministic?"yes":"no"}),o.jsx(Jt,{label:"Inputs",value:t.evaluationFunction.inputs.join(", ")}),o.jsx(Jt,{label:"Output",value:t.evaluationFunction.output})]}),o.jsxs(Aa,{title:"Aggregation function",children:[o.jsx(Jt,{label:"Id",value:t.aggregationFunction.id,mono:!0}),o.jsx(Jt,{label:"Window",value:t.aggregationFunction.windowDays!==void 0?`${t.aggregationFunction.windowDays} days`:"—"}),o.jsx(Jt,{label:"Output",value:t.aggregationFunction.output})]}),o.jsxs(Aa,{title:"Claim policy defaults",children:[o.jsx(Jt,{label:"Mode",value:t.claimPolicyDefaults.mode}),o.jsx(Jt,{label:"Max claims",value:String(t.claimPolicyDefaults.maxClaims)}),o.jsx(Jt,{label:"Per operator",value:String(t.claimPolicyDefaults.maxClaimsPerOperator)}),o.jsx(Jt,{label:"Lease TTL",value:`${t.claimPolicyDefaults.claimLeaseTtlSeconds}s`})]}),o.jsxs(Aa,{title:"Credential requirements",children:[o.jsx(uh,{role:"creator",creds:t.credentialRequirements.creator}),o.jsx(uh,{role:"solver",creds:t.credentialRequirements.solver}),o.jsx(uh,{role:"evaluator",creds:t.credentialRequirements.evaluator})]})]})})})}function Aa({title:e,children:t}){return o.jsxs("section",{className:"flex flex-col gap-2",children:[o.jsx(Ge,{}),o.jsx("h3",{className:X("m-0 pt-2 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-fg-muted"),children:e}),o.jsx("div",{className:"flex flex-col gap-1.5",children:t})]})}function Jt({label:e,value:t,hint:r,mono:n}){return o.jsxs("div",{className:"grid grid-cols-[140px_1fr] items-baseline gap-3",children:[o.jsx("span",{className:"font-mono text-[11px] tracking-[0.06em] text-fg-dim",children:e}),o.jsxs("span",{className:"flex flex-col gap-0.5",children:[o.jsx("span",{className:X("text-[13px] text-foreground",n?"font-mono":"font-sans"),children:t}),r&&o.jsx("span",{className:"font-mono text-[12px] leading-relaxed text-fg-muted",children:r})]})]})}function uh({role:e,creds:t}){return o.jsxs("div",{"data-testid":`launcher-create-credentials-${e}`,className:"flex flex-col gap-1.5",children:[o.jsx("div",{className:"font-mono text-[11px] capitalize tracking-[0.06em] text-fg-dim",children:e}),t.length===0?o.jsx("div",{className:"text-[12px] text-fg-muted",children:"None."}):t.map(r=>o.jsxs("div",{className:"flex flex-col gap-0.5 font-mono text-[12px] leading-relaxed",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx("span",{className:"text-accent-sky",children:r.id}),o.jsx(je,{variant:"secondary",children:r.kind}),r.required&&o.jsx(je,{variant:"warning",children:"required"})]}),o.jsx("div",{className:"text-fg-muted",children:r.description})]},r.id))]})}const q_="flex w-full rounded-md border border-input bg-transparent px-3 py-2 font-mono text-[13px] text-foreground placeholder:text-fg-dim focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 resize-y";function bL(e){const t=e.template??xa;switch(t.id){case"prediction":return o.jsx(SL,{...e,template:t});case"swe-rebench-v2":return o.jsx(kL,{...e,template:t});default:return o.jsx(Wi,{step:3,title:"Configure generator",blurb:"No generator form is registered for this template.",error:e.error??null,footer:o.jsx(Vi,{onBack:e.onBack,onNext:()=>{},nextDisabled:!0,busy:e.busy}),children:o.jsx("div",{"data-testid":"launcher-create-generator-unsupported"})})}}const K_=6e4;function Tr(e,t){return typeof e=="number"&&Number.isFinite(e)?String(e):typeof e=="string"&&e.trim().length>0?e.trim():String(t)}function G_(e){return Array.isArray(e)?e.filter(t=>typeof t=="string").join(", "):""}function wL(e){const t=xa.generatorDefaults,r=60*60*1e3;return{cadenceMs:Tr(e==null?void 0:e.cadenceMs,t.cadenceMs),windowMs:Tr((e==null?void 0:e.windowMs)??(e==null?void 0:e.submissionWindowMs),t.submissionWindowMs),resolveGapMs:Tr(e==null?void 0:e.resolveGapMs,r),maxNewRoundsPerPoll:Tr(e==null?void 0:e.maxNewRoundsPerPoll,t.maxNewRoundsPerPoll),maxNewRoundsPerDay:Tr(e==null?void 0:e.maxNewRoundsPerDay,t.maxNewRoundsPerDay),maxOpenRounds:Tr(e==null?void 0:e.maxOpenRounds,t.maxOpenRounds),allowlistConditionIds:G_(e==null?void 0:e.allowlistConditionIds),blocklistConditionIds:G_(e==null?void 0:e.blocklistConditionIds)}}function Q_(e){const t={},r=Ar(e.cadenceMs);r===null?t.cadenceMs="Must be a positive integer (ms).":r<K_&&(t.cadenceMs=`Cadence must be at least ${K_/1e3}s.`);const n=Ar(e.windowMs);n===null&&(t.windowMs="Must be a positive integer (ms).");const s=Ar(e.resolveGapMs);s===null&&(t.resolveGapMs="Must be a positive integer (ms).");const i=Ar(e.maxNewRoundsPerPoll);i===null&&(t.maxNewRoundsPerPoll="Must be a positive integer.");const l=Ar(e.maxNewRoundsPerDay);l===null&&(t.maxNewRoundsPerDay="Must be a positive integer.");const a=Ar(e.maxOpenRounds);return a===null&&(t.maxOpenRounds="Must be a positive integer."),Object.keys(t).length>0?{ok:!1,errors:t}:{ok:!0,errors:{},generatorConfig:{cadenceMs:r,windowMs:n,resolveGapMs:s,submissionWindowMs:n,maxNewRoundsPerPoll:i,maxNewRoundsPerDay:l,maxOpenRounds:a,allowlistConditionIds:Y_(e.allowlistConditionIds),blocklistConditionIds:Y_(e.blocklistConditionIds)}}}function Ar(e){const t=e.trim();if(t.length===0||!/^\d+$/.test(t))return null;const r=Number(t);return!Number.isFinite(r)||r<=0?null:r}function Y_(e){return e.split(",").map(t=>t.trim()).filter(t=>t.length>0)}function SL({draft:e,onAdvance:t,onBack:r,busy:n,error:s}){const i=C.useMemo(()=>wL(e.generatorConfig),[e.generatorConfig]),[l,a]=C.useState(i),[c,u]=C.useState(!1),g=c?Q_(l):{ok:!0,errors:{}},d=c?g.errors:{},_=()=>{u(!0);const x=Q_(l);!x.ok||!x.generatorConfig||t({generatorConfig:x.generatorConfig,completedSteps:_a(e.completedSteps,"configureGenerator")})},v=(x,y)=>{a(f=>({...f,[x]:y}))};return o.jsxs(Wi,{step:3,title:"Configure generator",blurb:"The auto-generator polls Polymarket and posts Tasks while the SolverNet is launched. Defaults are tuned for a healthy idle SolverNet — adjust to match your appetite.",error:s,footer:o.jsx(Vi,{onBack:r,onNext:_,busy:n,nextDisabled:c&&!g.ok}),children:[o.jsxs("div",{className:"grid grid-cols-1 gap-3.5 sm:grid-cols-2",children:[o.jsx(xt,{label:"Cadence (ms)",helperText:"How often the generator polls Polymarket. Minimum 60s.",error:d.cadenceMs??null,children:o.jsx(ft,{"data-testid":"launcher-create-cadenceMs",type:"text",inputMode:"numeric",value:l.cadenceMs,onChange:x=>v("cadenceMs",x.target.value),className:X(d.cadenceMs&&"border-break-red"),disabled:n})}),o.jsx(xt,{label:"Submission window (ms)",helperText:"How long Tasks stay open for solving.",error:d.windowMs??null,children:o.jsx(ft,{"data-testid":"launcher-create-windowMs",type:"text",inputMode:"numeric",value:l.windowMs,onChange:x=>v("windowMs",x.target.value),className:X(d.windowMs&&"border-break-red"),disabled:n})}),o.jsx(xt,{label:"Resolve gap (ms)",helperText:"Cushion between window-close and resolution.",error:d.resolveGapMs??null,children:o.jsx(ft,{"data-testid":"launcher-create-resolveGapMs",type:"text",inputMode:"numeric",value:l.resolveGapMs,onChange:x=>v("resolveGapMs",x.target.value),className:X(d.resolveGapMs&&"border-break-red"),disabled:n})}),o.jsx(xt,{label:"Max rounds / poll",helperText:"Cap on new Tasks per generator tick.",error:d.maxNewRoundsPerPoll??null,children:o.jsx(ft,{"data-testid":"launcher-create-maxNewRoundsPerPoll",type:"text",inputMode:"numeric",value:l.maxNewRoundsPerPoll,onChange:x=>v("maxNewRoundsPerPoll",x.target.value),className:X(d.maxNewRoundsPerPoll&&"border-break-red"),disabled:n})}),o.jsx(xt,{label:"Max rounds / day",helperText:"Daily ceiling across all polls.",error:d.maxNewRoundsPerDay??null,children:o.jsx(ft,{"data-testid":"launcher-create-maxNewRoundsPerDay",type:"text",inputMode:"numeric",value:l.maxNewRoundsPerDay,onChange:x=>v("maxNewRoundsPerDay",x.target.value),className:X(d.maxNewRoundsPerDay&&"border-break-red"),disabled:n})}),o.jsx(xt,{label:"Max open rounds",helperText:"Concurrent open Tasks before back-off kicks in.",error:d.maxOpenRounds??null,children:o.jsx(ft,{"data-testid":"launcher-create-maxOpenRounds",type:"text",inputMode:"numeric",value:l.maxOpenRounds,onChange:x=>v("maxOpenRounds",x.target.value),className:X(d.maxOpenRounds&&"border-break-red"),disabled:n})})]}),o.jsx(xt,{label:"Allowlist condition ids",helperText:"Comma-separated. If non-empty, only these markets are considered.",children:o.jsx("textarea",{"data-testid":"launcher-create-allowlistConditionIds",value:l.allowlistConditionIds,onChange:x=>v("allowlistConditionIds",x.target.value),rows:2,placeholder:"0xabc…, 0xdef…",className:q_,disabled:n})}),o.jsx(xt,{label:"Blocklist condition ids",helperText:"Comma-separated. Markets here are skipped, even if they pass the eligibility filters.",children:o.jsx("textarea",{"data-testid":"launcher-create-blocklistConditionIds",value:l.blocklistConditionIds,onChange:x=>v("blocklistConditionIds",x.target.value),rows:2,placeholder:"0xabc…",className:q_,disabled:n})})]})}function CL(e){const t=MS.generatorDefaults,r=typeof(e==null?void 0:e.claimPolicy)=="object"&&e.claimPolicy!==null?e.claimPolicy:{};return{N_target_successes:Tr(e==null?void 0:e.N_target_successes,t.N_target_successes),N_max_postings_per_task:Tr(e==null?void 0:e.N_max_postings_per_task,t.N_max_postings_per_task),posting_window_ms:Tr(e==null?void 0:e.posting_window_ms,t.posting_window_ms),post_batch_size:Tr(e==null?void 0:e.post_batch_size,t.post_batch_size),maxClaimsPerOperator:Tr((e==null?void 0:e.maxClaimsPerOperator)??r.maxClaimsPerOperator,t.maxClaimsPerOperator??t.N_target_successes),claimLeaseTtlSeconds:Tr((e==null?void 0:e.claimLeaseTtlSeconds)??r.claimLeaseTtlSeconds,t.claimLeaseTtlSeconds)}}function Z_(e){const t={},r=Ar(e.N_target_successes);r===null&&(t.N_target_successes="Must be a positive integer.");const n=Ar(e.N_max_postings_per_task);n===null?t.N_max_postings_per_task="Must be a positive integer.":r!==null&&n<r&&(t.N_max_postings_per_task="Max postings must be ≥ target successes — otherwise saturation is unreachable.");const s=Ar(e.posting_window_ms);s===null&&(t.posting_window_ms="Must be a positive integer (ms).");const i=Ar(e.post_batch_size);i===null&&(t.post_batch_size="Must be a positive integer.");const l=Ar(e.maxClaimsPerOperator);l===null&&(t.maxClaimsPerOperator="Must be a positive integer.");const a=Ar(e.claimLeaseTtlSeconds);return a===null&&(t.claimLeaseTtlSeconds="Must be a positive integer (seconds)."),Object.keys(t).length>0?{ok:!1,errors:t}:{ok:!0,errors:{},generatorConfig:{N_target_successes:r,N_max_postings_per_task:n,posting_window_ms:s,post_batch_size:i,maxClaimsPerOperator:l,claimLeaseTtlSeconds:a}}}function kL({draft:e,onAdvance:t,onBack:r,busy:n,error:s}){const i=C.useMemo(()=>CL(e.generatorConfig),[e.generatorConfig]),[l,a]=C.useState(i),[c,u]=C.useState(!1),g=c?Z_(l):{ok:!0,errors:{}},d=c?g.errors:{},_=()=>{u(!0);const x=Z_(l);!x.ok||!x.generatorConfig||t({generatorConfig:x.generatorConfig,completedSteps:_a(e.completedSteps,"configureGenerator")})},v=(x,y)=>{a(f=>({...f,[x]:y}))};return o.jsx(Wi,{step:3,title:"Configure generator",blurb:"The generator pulls SWE-rebench v2 instances from the HuggingFace pool and posts Tasks until enough successful Verdicts accumulate or the posting cap is hit.",error:s,footer:o.jsx(Vi,{onBack:r,onNext:_,busy:n,nextDisabled:c&&!g.ok}),children:o.jsxs("div",{className:"grid grid-cols-1 gap-3.5 sm:grid-cols-2",children:[o.jsx(xt,{label:"Target successful Verdicts per instance",helperText:"How many score=1 Verdicts saturate a SWE instance and stop further Task posting.",error:d.N_target_successes??null,children:o.jsx(ft,{"data-testid":"launcher-create-N_target_successes",type:"text",inputMode:"numeric",value:l.N_target_successes,onChange:x=>v("N_target_successes",x.target.value),className:X(d.N_target_successes&&"border-break-red"),disabled:n})}),o.jsx(xt,{label:"Max Task postings per instance",helperText:"Hard ceiling on Task postings to bound spend on impossible SWE instances.",error:d.N_max_postings_per_task??null,children:o.jsx(ft,{"data-testid":"launcher-create-N_max_postings_per_task",type:"text",inputMode:"numeric",value:l.N_max_postings_per_task,onChange:x=>v("N_max_postings_per_task",x.target.value),className:X(d.N_max_postings_per_task&&"border-break-red"),disabled:n})}),o.jsx(xt,{label:"Posting window (ms)",helperText:"A posting stays live for this long; expired unsaturated instances can be reposted.",error:d.posting_window_ms??null,children:o.jsx(ft,{"data-testid":"launcher-create-posting_window_ms",type:"text",inputMode:"numeric",value:l.posting_window_ms,onChange:x=>v("posting_window_ms",x.target.value),className:X(d.posting_window_ms&&"border-break-red"),disabled:n})}),o.jsx(xt,{label:"Post batch size",helperText:"Maximum number of SWE instances to post in one creator tick.",error:d.post_batch_size??null,children:o.jsx(ft,{"data-testid":"launcher-create-post_batch_size",type:"text",inputMode:"numeric",value:l.post_batch_size,onChange:x=>v("post_batch_size",x.target.value),className:X(d.post_batch_size&&"border-break-red"),disabled:n})}),o.jsx(xt,{label:"Max claims per operator",helperText:"Optional cap; each posting is still limited by remaining target successes.",error:d.maxClaimsPerOperator??null,children:o.jsx(ft,{"data-testid":"launcher-create-maxClaimsPerOperator",type:"text",inputMode:"numeric",value:l.maxClaimsPerOperator,onChange:x=>v("maxClaimsPerOperator",x.target.value),className:X(d.maxClaimsPerOperator&&"border-break-red"),disabled:n})}),o.jsx(xt,{label:"Claim lease (seconds)",helperText:"How long a claimed SWE task slot stays leased.",error:d.claimLeaseTtlSeconds??null,children:o.jsx(ft,{"data-testid":"launcher-create-claimLeaseTtlSeconds",type:"text",inputMode:"numeric",value:l.claimLeaseTtlSeconds,onChange:x=>v("claimLeaseTtlSeconds",x.target.value),className:X(d.claimLeaseTtlSeconds&&"border-break-red"),disabled:n})})]})})}function EL(e,t){const r={};let n,s;try{n=U_(e),n===null?r.solutionPriceWei="Required.":n<0n&&(r.solutionPriceWei="Must be non-negative.")}catch{r.solutionPriceWei="Must be a non-negative integer (wei).",n=null}try{s=U_(t),s===null?r.verdictPriceWei="Required.":s<0n&&(r.verdictPriceWei="Must be non-negative.")}catch{r.verdictPriceWei="Must be a non-negative integer (wei).",s=null}return n!==null&&s!==null&&!r.solutionPriceWei&&!r.verdictPriceWei&&n===0n&&s===0n&&(r.combined="At least one price must be positive."),{ok:Object.keys(r).length===0,errors:r,solutionWei:n??void 0,verdictWei:s??void 0}}function jL(e,t,r,n){if(!e||!/^\d+$/.test(e)||t===void 0||r===void 0)return null;let s;try{s=BigInt(e)}catch{return null}const i=t+r*BigInt(n);return i<=0n?null:{tasks:Number(s/i),perTaskWei:i}}function NL({draft:e,template:t=xa,onAdvance:r,onBack:n,fundingSafeAddress:s,fundingSafeBalanceWei:i,busy:l,error:a}){var m,b;const[c,u]=C.useState(e.solutionPriceWei??""),[g,d]=C.useState(e.verdictPriceWei??""),[_,v]=C.useState(!1),x=C.useMemo(()=>EL(c,g),[c,g]),y=t.claimPolicyDefaults.maxClaimsPerOperator,f=C.useMemo(()=>jL(i??null,x.solutionWei,x.verdictWei,y),[i,x.solutionWei,x.verdictWei,y]),p=()=>{v(!0),x.ok&&r({solutionPriceWei:c,verdictPriceWei:g,completedSteps:_a(e.completedSteps,"configurePricing")})},h=_?x.errors:{};return o.jsxs(Wi,{step:4,title:"Configure pricing",blurb:"Set what each Task pays out. The funding Safe is your launcher's master Safe; pricing applies per claim and per verdict.",error:a,footer:o.jsx(Vi,{onBack:n,onNext:p,busy:l,nextDisabled:_&&!x.ok}),children:[o.jsx(xt,{label:"Funding Safe",helperText:"Tasks are funded from this Safe at launch. Defaults to your launcher master Safe.",asLabel:!1,children:o.jsx("div",{"data-testid":"launcher-create-fundingSafe",className:"rounded-md border border-border bg-surface-sunken px-3 py-2.5 font-mono text-[13px] text-fg-muted break-all",children:s??"— (master Safe will be picked at launch)"})}),o.jsxs("div",{className:"grid grid-cols-1 gap-3.5 sm:grid-cols-2",children:[o.jsx(xt,{label:"Solution price (wei)",helperText:`≈ ${mi((m=x.solutionWei)==null?void 0:m.toString())}`,error:h.solutionPriceWei??null,children:o.jsx(ft,{"data-testid":"launcher-create-solutionPriceWei",type:"text",inputMode:"numeric",value:c,onChange:w=>u(w.target.value),placeholder:"e.g. 100000000000000 (0.0001 ETH)",className:X(h.solutionPriceWei&&"border-break-red"),disabled:l})}),o.jsx(xt,{label:"Verdict price (wei)",helperText:`≈ ${mi((b=x.verdictWei)==null?void 0:b.toString())}`,error:h.verdictPriceWei??null,children:o.jsx(ft,{"data-testid":"launcher-create-verdictPriceWei",type:"text",inputMode:"numeric",value:g,onChange:w=>d(w.target.value),placeholder:"e.g. 50000000000000 (0.00005 ETH)",className:X(h.verdictPriceWei&&"border-break-red"),disabled:l})})]}),h.combined&&o.jsx("div",{"data-testid":"launcher-create-pricing-combined-error",className:"font-mono text-[12px] text-break-red",children:h.combined}),o.jsx(we,{"data-testid":"launcher-create-projection",children:o.jsxs(Qe,{className:"flex flex-col gap-2.5 p-5",children:[o.jsx("h3",{className:"m-0 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-fg-muted",children:"Runway projection"}),o.jsx(Ge,{}),o.jsx(dh,{label:"Safe balance",value:i?`${mi(i)} (${i} wei)`:"—"}),o.jsx(dh,{label:"Per-Task cost",value:f?`${mi(f.perTaskWei.toString())} (${f.perTaskWei} wei)`:"—",hint:`solution + verdict × maxClaimsPerOperator (${y})`}),o.jsx(dh,{label:"Projected Tasks",value:f?`~${f.tasks.toLocaleString("en-US")}`:"—",hint:"Approximate; ignores gas and any in-flight reservations.",testId:"launcher-create-projected-tasks"})]})})]})}function dh({label:e,value:t,hint:r,testId:n}){return o.jsxs("div",{"data-testid":n,className:"grid grid-cols-[160px_1fr] items-baseline gap-3",children:[o.jsx("span",{className:"font-mono text-[11px] tracking-[0.06em] text-fg-dim",children:e}),o.jsxs("span",{className:"flex flex-col gap-0.5",children:[o.jsx("span",{className:"font-mono text-[13px] text-foreground",children:t}),r&&o.jsx("span",{className:"text-[12px] text-fg-muted",children:r})]})]})}const RL=1500,X_=["pinning","recording","broadcasting","confirming","spawning"],PL={pinning:"Pinning manifest",recording:"Recording draft",broadcasting:"Broadcasting tx",confirming:"Confirming on-chain",spawning:"Spawning generator"};function TL({draft:e,template:t=xa,onUpdateDraft:r,onBack:n,onLaunchFailure:s,navigateTo:i,pollIntervalMs:l=RL}){const[,a]=hn(),c=i??a,u=C.useMemo(()=>e.openRoles&&e.openRoles.length>0?e.openRoles:["solver","evaluator"],[e.openRoles]),[g,d]=C.useState(u),[_,v]=C.useState({kind:"idle"}),x=C.useRef(!1);C.useEffect(()=>()=>{x.current=!0},[]);const y=m=>{d(b=>b.includes(m)?b.filter(w=>w!==m):[...b,m])},f=async()=>{var m,b,w;if(g.length!==0){v(k=>k.kind==="failed"?{kind:"idle"}:k),x.current=!1;try{await r({openRoles:g,completedSteps:_a(e.completedSteps,"configurePricing")});const k=await ge.solvernets.launch(e.draftId);if(x.current)return;let j="pinning";for(v({kind:"launching",phase:j,solverNetId:k.solverNetId});;){if(x.current)return;let S;try{S=await ge.solvernets.get(k.solverNetId)}catch{if(x.current)return;await rx(l);continue}if((m=S.launchProgress)!=null&&m.phase&&(j=S.launchProgress.phase),S.status==="launched"){v({kind:"launching",phase:"spawning",solverNetId:k.solverNetId}),c(`/launcher/launched/${encodeURIComponent(k.solverNetId)}`);return}if(S.status==="failed"){const E=((w=(b=S.launchProgress)==null?void 0:b.txError)==null?void 0:w.message)??`Launch failed during ${j}.`;v({kind:"failed",message:E,solverNetId:k.solverNetId}),s==null||s();return}v({kind:"launching",phase:j,solverNetId:k.solverNetId}),await rx(l)}}catch(k){if(x.current)return;v({kind:"failed",message:k instanceof Error?k.message:String(k)}),s==null||s()}}},p=_.kind==="launching",h=g.length===0||p;return o.jsxs(Wi,{step:5,title:"Review & launch",blurb:"One last check. The Launch button signs the manifest, pins it to IPFS, and broadcasts the registry transaction.",footer:o.jsx(Vi,{onBack:n,onNext:()=>{f()},nextLabel:p?"Launching…":"Launch",nextDisabled:h,busy:p,right:p&&o.jsx(AL,{current:_.kind==="launching"?_.phase:"pinning"})}),children:[o.jsx(DL,{draft:e,template:t}),o.jsxs(xt,{label:"Open roles",helperText:"Operators can opt in to any role you open here. Most launchers want both.",asLabel:!1,children:[o.jsxs("div",{"data-testid":"launcher-create-openRoles",className:"flex flex-col gap-2.5",children:[o.jsx(tx,{role:"solver",checked:g.includes("solver"),onChange:()=>y("solver"),disabled:p}),o.jsx(tx,{role:"evaluator",checked:g.includes("evaluator"),onChange:()=>y("evaluator"),disabled:p})]}),g.length===0&&o.jsx("span",{"data-testid":"launcher-create-openRoles-error",className:"font-mono text-[12px] text-break-red",children:"At least one role must be open."})]}),_.kind==="failed"&&o.jsxs(rt,{variant:"blocking","data-testid":"launcher-create-launch-failure",children:[o.jsx(Dt,{className:"font-mono text-[13px] font-medium text-break-red",children:"Launch failed."}),o.jsx(it,{className:"font-mono text-[12px] text-fg-muted",children:_.message}),o.jsxs("div",{className:"mt-2.5 flex gap-2",children:[o.jsx(ae,{type:"button",size:"sm","data-testid":"launcher-create-launch-retry",onClick:()=>{f()},children:"Retry"}),o.jsx(ae,{type:"button",variant:"secondary",size:"sm","data-testid":"launcher-create-launch-abandon",onClick:()=>{c("/launcher")},children:"Abandon"})]})]})]})}function AL({current:e}){const t=X_.indexOf(e);return o.jsxs("div",{"data-testid":"launcher-create-launch-progress","data-phase":e,className:"flex items-center gap-1.5 font-mono text-[11px] tracking-[0.06em] text-fg-muted",children:[o.jsx("span",{"data-testid":"launcher-create-launch-phase",children:PL[e]}),o.jsx("div",{className:"flex gap-[3px]",children:X_.map((r,n)=>o.jsx("span",{"data-testid":`launcher-create-launch-phase-pip-${r}`,"data-active":n<=t?"true":"false",className:X("h-[3px] w-2 rounded-sm",n<=t?"bg-accent-sky":"bg-border")},r))})]})}function DL({draft:e,template:t}){const r=e.generatorConfig??{},n=e.templateContractId??t.id,s=e.templateContractVersion??t.version;return o.jsx(we,{"data-testid":"launcher-create-manifest-summary",children:o.jsxs(Qe,{className:"flex flex-col gap-3 p-6",children:[o.jsxs("header",{className:"flex flex-col gap-1",children:[o.jsxs("span",{className:"font-mono text-[11px] uppercase tracking-[0.14em] text-fg-dim",children:[n,".",s]}),o.jsx("h2",{className:"m-0 font-serif text-[24px] font-normal text-foreground",children:e.name??"— unnamed"}),e.description&&o.jsx("p",{className:"m-0 text-[13px] leading-relaxed text-fg-muted",children:e.description})]}),o.jsx(Ge,{}),o.jsxs(OL,{children:[o.jsx(sn,{label:"Solution price",value:J_(e.solutionPriceWei)}),o.jsx(sn,{label:"Verdict price",value:J_(e.verdictPriceWei)}),t.id==="prediction"?o.jsx(LL,{generator:r}):o.jsx(ML,{generator:r})]})]})})}function LL({generator:e}){const t=gi(e.cadenceMs),r=gi(e.windowMs??e.submissionWindowMs),n=gi(e.maxOpenRounds);return o.jsxs(o.Fragment,{children:[o.jsx(sn,{label:"Cadence",value:t?`${t} ms`:"—"}),o.jsx(sn,{label:"Window",value:r?`${r} ms`:"—"}),o.jsx(sn,{label:"Max open rounds",value:n??"—"}),o.jsx(sn,{label:"Allowlist",value:ex(e.allowlistConditionIds)}),o.jsx(sn,{label:"Blocklist",value:ex(e.blocklistConditionIds)})]})}function ML({generator:e}){const t=gi(e.N_target_successes),r=gi(e.N_max_postings_per_task),n=gi(e.posting_window_ms),s=gi(e.post_batch_size);return o.jsxs(o.Fragment,{children:[o.jsx(sn,{label:"Target successes",value:t??"—"}),o.jsx(sn,{label:"Max postings / Task",value:r??"—"}),o.jsx(sn,{label:"Posting window",value:n?`${n} ms`:"—"}),o.jsx(sn,{label:"Batch size",value:s??"—"})]})}function J_(e){return e?`${e} wei (${mi(e)})`:"—"}function gi(e){return typeof e=="number"&&Number.isFinite(e)?String(e):typeof e=="string"&&/^\d+$/.test(e.trim())?e.trim():null}function ex(e){return Array.isArray(e)&&e.length>0?`${e.length} entries`:"none"}function OL({children:e}){return o.jsx("div",{className:"grid grid-cols-1 gap-x-4 gap-y-2 sm:grid-cols-2",children:e})}function sn({label:e,value:t}){return o.jsxs("div",{className:"flex flex-col gap-0.5",children:[o.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.12em] text-fg-dim",children:e}),o.jsx("span",{className:"font-mono text-[13px] text-foreground",children:t})]})}function tx({role:e,checked:t,onChange:r,disabled:n}){return o.jsxs("label",{className:X("flex items-center gap-2.5",n?"cursor-not-allowed opacity-60":"cursor-pointer"),children:[o.jsx("input",{"data-testid":`launcher-create-openRoles-${e}`,type:"checkbox",checked:t,onChange:r,disabled:n,className:"h-4 w-4 cursor-pointer accent-accent-sky"}),o.jsx("span",{className:"font-mono text-[13px] text-foreground",children:e})]})}function rx(e){return new Promise(t=>setTimeout(t,e))}const Jf="jinn.launcher-create.draftId.v1";function IL(){if(typeof window>"u")return null;try{return window.localStorage.getItem(Jf)}catch{return null}}function nx(e){if(!(typeof window>"u"))try{e===null?window.localStorage.removeItem(Jf):window.localStorage.setItem(Jf,e)}catch{}}function FL(){if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search).get("template");return t&&t.length>0?t:null}function BL({templateKey:e}={}){var k;const t=e??FL()??_L,r=C.useMemo(()=>Xf[t]??null,[t]),[n,s]=C.useState(null),[i,l]=C.useState(null),[a,c]=C.useState(1),[u,g]=C.useState(!1),[d,_]=C.useState(null),v=C.useRef(!1),{data:x}=Me({queryKey:["bootstrap"],queryFn:()=>ge.getBootstrap(),refetchInterval:3e4}),{data:y}=Me({queryKey:["status"],queryFn:()=>ge.getStatus(),refetchInterval:3e4}),f=(x==null?void 0:x.master_address)??(y==null?void 0:y.master_address)??null,p=((k=y==null?void 0:y.masterGas)==null?void 0:k.balanceWei)??null;C.useEffect(()=>{if(v.current)return;v.current=!0;let j=!1;return(async()=>{const E=IL();if(E)try{const R=await ge.solvernets.getDraft(E);if(j)return;s(R);return}catch{nx(null)}try{const R=await ge.solvernets.createDraft();if(j)return;nx(R.draftId),s(R)}catch(R){if(j)return;l(R instanceof Error?R.message:"Failed to create draft.")}})(),()=>{j=!0}},[]);const h=async j=>{if(n){g(!0),_(null);try{const S=await ge.solvernets.updateDraft(n.draftId,j);s(S),c(E=>E<5?E+1:E)}catch(S){_(S instanceof Error?S.message:String(S))}finally{g(!1)}}},m=async j=>{if(n){g(!0),_(null);try{const S=await ge.solvernets.updateDraft(n.draftId,j);s(S)}catch(S){_(S instanceof Error?S.message:String(S))}finally{g(!1)}}},b=()=>{_(null),c(j=>j>1?j-1:j)},w=()=>{_(null)};if(r===null)return o.jsxs("main",{"data-testid":"launcher-create-unknown-template","data-template-key":t,className:"mx-auto flex max-w-[720px] flex-col gap-4 p-6",children:[o.jsx("h1",{className:"m-0 font-serif text-[28px] font-normal text-foreground",children:"Unknown SolverNet template"}),o.jsx(rt,{variant:"blocking",children:o.jsxs(it,{className:"font-mono text-[13px]",children:["No template registered for ",o.jsx("code",{children:t}),". Available keys:"," ",Object.keys(Xf).map(j=>`?template=${j}`).join(", "),"."]})})]});if(i)return o.jsxs("main",{"data-testid":"launcher-create-bootstrap-error",className:"mx-auto flex max-w-[720px] flex-col gap-4 p-6",children:[o.jsx("h1",{className:"m-0 font-serif text-[28px] font-normal text-foreground",children:"Couldn't start a new draft"}),o.jsxs(rt,{variant:"blocking",children:[o.jsx(Dt,{className:"font-mono text-[12px]",children:"Bootstrap error"}),o.jsx(it,{className:"font-mono text-[13px]",children:i})]})]});if(!n)return o.jsx("main",{"data-testid":"launcher-create-loading",className:"p-6 font-mono text-[13px] text-fg-muted",children:"Loading draft…"});switch(a){case 1:return o.jsx(V_,{draft:n,onAdvance:h,busy:u,error:d});case 2:return o.jsx(yL,{draft:n,template:r,onAdvance:h,onBack:b,busy:u,error:d});case 3:return o.jsx(bL,{draft:n,template:r,onAdvance:h,onBack:b,busy:u,error:d});case 4:return o.jsx(NL,{draft:n,template:r,onAdvance:h,onBack:b,fundingSafeAddress:f,fundingSafeBalanceWei:p??null,busy:u,error:d});case 5:return o.jsx(TL,{draft:n,template:r,onUpdateDraft:m,onBack:b,onLaunchFailure:w});default:return o.jsx(V_,{draft:n,onAdvance:h,busy:u,error:d})}}function OS(e){return e?e.length<=16?e:`${e.slice(0,8)}…${e.slice(-6)}`:""}function IS(e){return e?e.length<=12?e:`${e.slice(0,6)}…${e.slice(-4)}`:""}function tg(e){if(!e)return"—";try{const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString().replace("T"," ").slice(0,16)+" UTC"}catch{return e}}const $L={launched:["paused","retired"],paused:["launched","retired"]};function sx(e,t,r){const n=10n**BigInt(t),s=e/n,i=e%n;if(i===0n||r===0)return s.toString();const a=i.toString().padStart(t,"0").slice(0,r).replace(/0+$/,"");return a?`${s}.${a}`:s.toString()}function As(e){if(!e||!/^\d+$/.test(e))return"—";try{const t=BigInt(e);if(t===0n)return"0 ETH";const r=1000000000000000000n,n=100000000000000n,s=1000000000n;return t>=n?`${sx(t,18,t>=r?4:6)} ETH`:t>=s?`${sx(t,9,4)} gwei`:`${t.toLocaleString()} wei`}catch{return"—"}}function HL(e,t,r){if(!e||!/^\d+$/.test(e)||!t||!/^\d+$/.test(t)||!r||!/^\d+$/.test(r))return null;let n;try{n=BigInt(e)}catch{return null}const s=BigInt(t)+BigInt(r);return s<=0n?null:{tasks:Number(n/s),perTaskWei:s}}const ix=6e4;function zL(e){const t=e??{};return{cadenceMs:Dr(t.cadenceMs),windowMs:Dr(t.windowMs??t.submissionWindowMs),resolveGapMs:Dr(t.resolveGapMs),maxNewRoundsPerPoll:Dr(t.maxNewRoundsPerPoll),maxNewRoundsPerDay:Dr(t.maxNewRoundsPerDay),maxOpenRounds:Dr(t.maxOpenRounds),allowlistConditionIds:ox(t.allowlistConditionIds),blocklistConditionIds:ox(t.blocklistConditionIds)}}function UL(e,t){const r=e??{},n=WL(r.claimPolicy),s=(t==null?void 0:t.contract.claimPolicyDefaults)??{maxClaimsPerOperator:5,claimLeaseTtlSeconds:60*60};return{N_target_successes:Dr(r.N_target_successes),N_max_postings_per_task:Dr(r.N_max_postings_per_task),posting_window_ms:Dr(r.posting_window_ms),post_batch_size:Dr(r.post_batch_size),maxClaimsPerOperator:Dr(r.maxClaimsPerOperator??n.maxClaimsPerOperator??s.maxClaimsPerOperator),claimLeaseTtlSeconds:Dr(r.claimLeaseTtlSeconds??n.claimLeaseTtlSeconds??s.claimLeaseTtlSeconds)}}function WL(e){return typeof e=="object"&&e!==null?e:{}}function Dr(e){return typeof e=="number"&&Number.isFinite(e)?String(e):typeof e=="string"&&e.trim().length>0?e.trim():""}function ox(e){return Array.isArray(e)?e.filter(t=>typeof t=="string").join(", "):""}function qc(e){const t=e.trim();if(!t||!/^\d+$/.test(t))return null;const r=Number(t);return!Number.isFinite(r)||r<=0?null:r}function VL(e){return e.split(",").map(t=>t.trim()).filter(t=>t.length>0)}function qL(e,t){const r={},n={};for(const s of["cadenceMs","windowMs","resolveGapMs","maxNewRoundsPerPoll","maxNewRoundsPerDay","maxOpenRounds"]){if(e[s]===t[s]||e[s].trim().length===0)continue;const i=qc(e[s]);if(i===null){r[s]="Must be a positive integer.";continue}if(s==="cadenceMs"&&i<ix){r[s]=`Cadence must be at least ${ix/1e3}s.`;continue}s==="windowMs"?n.submissionWindowMs=i:n[s]=i}for(const s of["allowlistConditionIds","blocklistConditionIds"])e[s]!==t[s]&&(n[s]=VL(e[s]));return{ok:Object.keys(r).length===0,patch:n,errors:r}}function KL(e,t){const r={},n={},s=qc(e.N_target_successes),i=qc(e.N_max_postings_per_task);for(const l of["N_target_successes","N_max_postings_per_task","posting_window_ms","post_batch_size","maxClaimsPerOperator","claimLeaseTtlSeconds"]){if(e[l]===t[l]||e[l].trim().length===0)continue;const a=qc(e[l]);if(a===null){r[l]=l==="posting_window_ms"?"Must be a positive integer (ms).":l==="claimLeaseTtlSeconds"?"Must be a positive integer (seconds).":"Must be a positive integer.";continue}n[l]=a}return s!==null&&i!==null&&i<s&&(r.N_max_postings_per_task="Max postings must be >= target successes."),{ok:Object.keys(r).length===0,patch:n,errors:r}}function GL(e,t){var n;if(t)return t.id==="swe-rebench-v2"&&t.version==="v1";if(((n=e.summary)==null?void 0:n.contractId)==="swe-rebench-v2"&&e.summary.contractVersion==="v1")return!0;const r=e.generatorConfig??{};return Object.prototype.hasOwnProperty.call(r,"N_target_successes")||Object.prototype.hasOwnProperty.call(r,"N_max_postings_per_task")||Object.prototype.hasOwnProperty.call(r,"posting_window_ms")||Object.prototype.hasOwnProperty.call(r,"cooldown_ms")}function QL({record:e,manifest:t,template:r,onSave:n}){return GL(e,r)?o.jsx(ZL,{record:e,manifest:t,onSave:n}):o.jsx(YL,{record:e,onSave:n})}function FS({record:e,configExpanded:t,setConfigExpanded:r,children:n}){var s,i;return o.jsxs(we,{"data-testid":"launcher-launched-generator-panel",role:"region","aria-label":"Generator",className:"flex flex-col gap-4 p-6",children:[o.jsxs("header",{className:"flex flex-wrap items-center justify-between gap-3",children:[o.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[o.jsx("h2",{className:"m-0 font-serif text-[22px] font-normal text-foreground",children:"Generator"}),o.jsx(tM,{record:e})]}),o.jsx(ae,{type:"button",variant:"secondary",size:"sm","data-testid":"launcher-launched-generator-toggle","aria-expanded":t,"aria-controls":"launcher-launched-generator-config",onClick:()=>r(l=>!l),children:t?"Hide config":"Edit config"})]}),o.jsxs("dl",{className:"m-0 grid gap-y-2 gap-x-4 [grid-template-columns:repeat(auto-fit,minmax(180px,1fr))]",children:[o.jsx(Fn,{label:"Last poll",value:tg((s=e.generatorState)==null?void 0:s.lastPollAt),testid:"launcher-launched-generator-last-poll"}),o.jsx(Fn,{label:"Generator enabled",value:e.generatorEnabled?"yes":"no",testid:"launcher-launched-generator-enabled"})]}),o.jsx(XL,{record:e}),((i=e.generatorState)==null?void 0:i.lastError)&&o.jsx(eM,{record:e}),n]})}function YL({record:e,onSave:t}){const r=C.useMemo(()=>zL(e.generatorConfig),[e.generatorConfig]),[n,s]=C.useState(r),[i,l]=C.useState({kind:"idle"}),[a,c]=C.useState(!1);C.useEffect(()=>{s(y=>JSON.stringify(y)!==JSON.stringify(x())?y:r);function x(){return r}},[JSON.stringify(e.generatorConfig)]);const u=(x,y)=>{s(f=>({...f,[x]:y}))},g=C.useMemo(()=>qL(n,r),[n,r]),d=Object.keys(g.patch).length>0,_=i.kind==="saving",v=async()=>{if(!(!g.ok||!d||_)){l({kind:"saving"});try{await t(g.patch),l({kind:"saved",at:new Date})}catch(x){l({kind:"error",message:x instanceof Error?x.message:String(x)})}}};return o.jsx(FS,{record:e,configExpanded:a,setConfigExpanded:c,children:a&&o.jsxs("div",{id:"launcher-launched-generator-config","data-testid":"launcher-launched-generator-config",className:"flex flex-col gap-3.5 pt-3.5",children:[o.jsx(Ge,{}),o.jsx("h3",{className:"m-0 font-mono text-[11px] uppercase tracking-[0.14em] text-[var(--fg-dim)]",children:"Hot-apply config"}),o.jsxs("div",{className:"grid gap-3.5 [grid-template-columns:repeat(auto-fit,minmax(220px,1fr))]",children:[o.jsx(Lr,{label:"Cadence (ms)",testid:"launcher-launched-generator-cadenceMs",value:n.cadenceMs,onChange:x=>u("cadenceMs",x),error:g.errors.cadenceMs,disabled:_}),o.jsx(Lr,{label:"Submission window (ms)",testid:"launcher-launched-generator-windowMs",value:n.windowMs,onChange:x=>u("windowMs",x),error:g.errors.windowMs,disabled:_}),o.jsx(Lr,{label:"Resolve gap (ms)",testid:"launcher-launched-generator-resolveGapMs",value:n.resolveGapMs,onChange:x=>u("resolveGapMs",x),error:g.errors.resolveGapMs,disabled:_}),o.jsx(Lr,{label:"Max rounds / poll",testid:"launcher-launched-generator-maxNewRoundsPerPoll",value:n.maxNewRoundsPerPoll,onChange:x=>u("maxNewRoundsPerPoll",x),error:g.errors.maxNewRoundsPerPoll,disabled:_}),o.jsx(Lr,{label:"Max rounds / day",testid:"launcher-launched-generator-maxNewRoundsPerDay",value:n.maxNewRoundsPerDay,onChange:x=>u("maxNewRoundsPerDay",x),error:g.errors.maxNewRoundsPerDay,disabled:_}),o.jsx(Lr,{label:"Max open rounds",testid:"launcher-launched-generator-maxOpenRounds",value:n.maxOpenRounds,onChange:x=>u("maxOpenRounds",x),error:g.errors.maxOpenRounds,disabled:_})]}),o.jsx(ax,{label:"Allowlist condition ids",testid:"launcher-launched-generator-allowlistConditionIds",value:n.allowlistConditionIds,onChange:x=>u("allowlistConditionIds",x),disabled:_}),o.jsx(ax,{label:"Blocklist condition ids",testid:"launcher-launched-generator-blocklistConditionIds",value:n.blocklistConditionIds,onChange:x=>u("blocklistConditionIds",x),disabled:_}),o.jsx(BS,{dirty:d,saving:_,validationOk:g.ok,saveStatus:i,onSubmit:v})]})})}function ZL({record:e,manifest:t,onSave:r}){const n=C.useMemo(()=>UL(e.generatorConfig,t),[e.generatorConfig,t]),[s,i]=C.useState(n),[l,a]=C.useState({kind:"idle"}),[c,u]=C.useState(!1);C.useEffect(()=>{i(y=>JSON.stringify(y)!==JSON.stringify(n)?y:n)},[JSON.stringify(e.generatorConfig)]);const g=(y,f)=>{i(p=>({...p,[y]:f}))},d=C.useMemo(()=>KL(s,n),[s,n]),_=Object.keys(d.patch).length>0,v=l.kind==="saving",x=async()=>{if(!(!d.ok||!_||v)){a({kind:"saving"});try{await r(d.patch),a({kind:"saved",at:new Date})}catch(y){a({kind:"error",message:y instanceof Error?y.message:String(y)})}}};return o.jsx(FS,{record:e,configExpanded:c,setConfigExpanded:u,children:c&&o.jsxs("div",{id:"launcher-launched-generator-config","data-testid":"launcher-launched-generator-config",className:"flex flex-col gap-3.5 pt-3.5",children:[o.jsx(Ge,{}),o.jsx("h3",{className:"m-0 font-mono text-[11px] uppercase tracking-[0.14em] text-[var(--fg-dim)]",children:"Hot-apply config"}),o.jsxs("div",{className:"grid gap-3.5 [grid-template-columns:repeat(auto-fit,minmax(220px,1fr))]",children:[o.jsx(Lr,{label:"Target successful Verdicts per instance",testid:"launcher-launched-generator-N_target_successes",value:s.N_target_successes,onChange:y=>g("N_target_successes",y),error:d.errors.N_target_successes,disabled:v}),o.jsx(Lr,{label:"Max Task postings per instance",testid:"launcher-launched-generator-N_max_postings_per_task",value:s.N_max_postings_per_task,onChange:y=>g("N_max_postings_per_task",y),error:d.errors.N_max_postings_per_task,disabled:v}),o.jsx(Lr,{label:"Posting window (ms)",testid:"launcher-launched-generator-posting_window_ms",value:s.posting_window_ms,onChange:y=>g("posting_window_ms",y),error:d.errors.posting_window_ms,disabled:v}),o.jsx(Lr,{label:"Post batch size",testid:"launcher-launched-generator-post_batch_size",value:s.post_batch_size,onChange:y=>g("post_batch_size",y),error:d.errors.post_batch_size,disabled:v})]}),o.jsx("h3",{className:"m-0 font-mono text-[11px] uppercase tracking-[0.14em] text-[var(--fg-dim)]",children:"Claim policy"}),o.jsxs("div",{className:"grid gap-3.5 [grid-template-columns:repeat(auto-fit,minmax(180px,1fr))]",children:[o.jsx(Lr,{label:"Max claims per operator",testid:"launcher-launched-generator-maxClaimsPerOperator",value:s.maxClaimsPerOperator,onChange:y=>g("maxClaimsPerOperator",y),error:d.errors.maxClaimsPerOperator,disabled:v}),o.jsx(Lr,{label:"Claim lease (seconds)",testid:"launcher-launched-generator-claimLeaseTtlSeconds",value:s.claimLeaseTtlSeconds,onChange:y=>g("claimLeaseTtlSeconds",y),error:d.errors.claimLeaseTtlSeconds,disabled:v})]}),o.jsx(BS,{dirty:_,saving:v,validationOk:d.ok,saveStatus:l,onSubmit:x})]})})}function BS({dirty:e,saving:t,validationOk:r,saveStatus:n,onSubmit:s}){const i=e&&r&&!t;return o.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[o.jsx(Ge,{}),o.jsxs("div",{className:"flex items-center justify-between gap-3 pt-1",children:[o.jsx(rM,{status:n}),o.jsx(ae,{type:"button",variant:"default","data-testid":"launcher-launched-generator-save",onClick:()=>{s()},disabled:!i,children:t?"Saving…":"Save"})]})]})}function XL({record:e}){var r;const t=(r=e.generatorState)==null?void 0:r.lastPollSummary;return JL(t)?o.jsxs("dl",{"data-testid":"launcher-launched-generator-pool-summary",className:"m-0 grid gap-y-2 gap-x-4 [grid-template-columns:repeat(auto-fit,minmax(120px,1fr))]",children:[o.jsx(Fn,{label:"Pool",value:String(t.poolSize),testid:"launcher-launched-generator-poolSize"}),o.jsx(Fn,{label:"Posted",value:String(t.posted),testid:"launcher-launched-generator-posted"}),o.jsx(Fn,{label:"Unposted",value:String(t.unposted),testid:"launcher-launched-generator-unposted"}),o.jsx(Fn,{label:"Live",value:String(t.live),testid:"launcher-launched-generator-live"}),o.jsx(Fn,{label:"Repostable",value:String(t.repostable),testid:"launcher-launched-generator-repostable"}),o.jsx(Fn,{label:"Saturated",value:String(t.saturated),testid:"launcher-launched-generator-saturated"}),o.jsx(Fn,{label:"Abandoned",value:String(t.abandoned),testid:"launcher-launched-generator-abandoned"})]}):null}function JL(e){if(typeof e!="object"||e===null)return!1;const t=e;return["poolSize","posted","unposted","live","repostable","saturated","abandoned"].every(r=>typeof t[r]=="number")}function eM({record:e}){var t,r,n,s;return o.jsxs("div",{"data-testid":"launcher-launched-generator-error",className:"flex flex-col gap-1 rounded-md border border-destructive bg-card p-3",children:[o.jsxs("span",{className:"font-mono text-[12px] font-medium text-destructive",children:["Last error · ",tg((r=(t=e.generatorState)==null?void 0:t.lastError)==null?void 0:r.at)]}),o.jsx("span",{className:"font-mono text-[12px] text-[var(--fg-muted)]",children:(s=(n=e.generatorState)==null?void 0:n.lastError)==null?void 0:s.message})]})}function tM({record:e}){var s;const t=e.generatorEnabled,n=!!((s=e.generatorState)!=null&&s.lastError)?{variant:"destructive",label:"Errored"}:t?{variant:"success",label:"Enabled"}:{variant:"outline",label:"Disabled"};return o.jsx(je,{"data-testid":"launcher-launched-generator-state-badge",variant:n.variant,children:n.label})}function rM({status:e}){if(e.kind==="saving")return o.jsx("span",{"data-testid":"launcher-launched-generator-save-status",className:"font-mono text-[12px] text-[var(--fg-muted)]",children:"Saving…"});if(e.kind==="saved"){const t=e.at.toISOString().slice(11,16);return o.jsxs("span",{"data-testid":"launcher-launched-generator-save-status",className:"font-mono text-[12px] text-[var(--vow-green)]",children:["Saved at ",t," UTC"]})}return e.kind==="error"?o.jsxs("span",{"data-testid":"launcher-launched-generator-save-status",className:"font-mono text-[12px] text-destructive",children:["Save failed: ",e.message]}):o.jsx("span",{"data-testid":"launcher-launched-generator-save-status",className:"font-mono text-[11px] text-[var(--fg-dim)]",children:"Edits hot-apply without restart."})}function Lr({label:e,testid:t,value:r,onChange:n,error:s,disabled:i}){return o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx(wr,{htmlFor:t,className:"font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--fg-dim)]",children:e}),o.jsx(ft,{id:t,"data-testid":t,type:"text",inputMode:"numeric",value:r,onChange:l=>n(l.target.value),disabled:i,className:X(s&&"border-destructive")}),s&&o.jsx("span",{"data-testid":`${t}-error`,className:"font-mono text-[11px] text-destructive",children:s})]})}function ax({label:e,testid:t,value:r,onChange:n,disabled:s}){return o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx(wr,{htmlFor:t,className:"font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--fg-dim)]",children:e}),o.jsx("textarea",{id:t,"data-testid":t,value:r,onChange:i=>n(i.target.value),disabled:s,rows:2,placeholder:"0xabc…, 0xdef…",className:"flex w-full resize-y rounded-md border border-input bg-transparent px-3 py-2 font-mono text-[13px] text-foreground transition-colors placeholder:text-[var(--fg-dim)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50"})]})}function Fn({label:e,value:t,testid:r}){return o.jsxs("div",{className:"flex flex-col gap-0.5",children:[o.jsx("dt",{className:"font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--fg-dim)]",children:e}),o.jsx("dd",{"data-testid":r,className:"m-0 font-mono text-[13px] text-foreground",children:t})]})}var hh="focusScope.autoFocusOnMount",fh="focusScope.autoFocusOnUnmount",lx={bubbles:!1,cancelable:!0},nM="FocusScope",_d=C.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...l}=e,[a,c]=C.useState(null),u=Ht(s),g=Ht(i),d=C.useRef(null),_=Be(t,y=>c(y)),v=C.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.useEffect(()=>{if(n){let y=function(m){if(v.paused||!a)return;const b=m.target;a.contains(b)?d.current=b:ps(d.current,{select:!0})},f=function(m){if(v.paused||!a)return;const b=m.relatedTarget;b!==null&&(a.contains(b)||ps(d.current,{select:!0}))},p=function(m){if(document.activeElement===document.body)for(const w of m)w.removedNodes.length>0&&ps(a)};document.addEventListener("focusin",y),document.addEventListener("focusout",f);const h=new MutationObserver(p);return a&&h.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",f),h.disconnect()}}},[n,a,v.paused]),C.useEffect(()=>{if(a){ux.add(v);const y=document.activeElement;if(!a.contains(y)){const p=new CustomEvent(hh,lx);a.addEventListener(hh,u),a.dispatchEvent(p),p.defaultPrevented||(sM(cM($S(a)),{select:!0}),document.activeElement===y&&ps(a))}return()=>{a.removeEventListener(hh,u),setTimeout(()=>{const p=new CustomEvent(fh,lx);a.addEventListener(fh,g),a.dispatchEvent(p),p.defaultPrevented||ps(y??document.body,{select:!0}),a.removeEventListener(fh,g),ux.remove(v)},0)}}},[a,u,g,v]);const x=C.useCallback(y=>{if(!r&&!n||v.paused)return;const f=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,p=document.activeElement;if(f&&p){const h=y.currentTarget,[m,b]=iM(h);m&&b?!y.shiftKey&&p===b?(y.preventDefault(),r&&ps(m,{select:!0})):y.shiftKey&&p===m&&(y.preventDefault(),r&&ps(b,{select:!0})):p===h&&y.preventDefault()}},[r,n,v.paused]);return o.jsx($e.div,{tabIndex:-1,...l,ref:_,onKeyDown:x})});_d.displayName=nM;function sM(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(ps(n,{select:t}),document.activeElement!==r)return}function iM(e){const t=$S(e),r=cx(t,e),n=cx(t.reverse(),e);return[r,n]}function $S(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function cx(e,t){for(const r of e)if(!oM(r,{upTo:t}))return r}function oM(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function aM(e){return e instanceof HTMLInputElement&&"select"in e}function ps(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&aM(e)&&t&&e.select()}}var ux=lM();function lM(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=dx(e,t),e.unshift(t)},remove(t){var r;e=dx(e,t),(r=e[0])==null||r.resume()}}}function dx(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function cM(e){return e.filter(t=>t.tagName!=="A")}var ph=0;function rg(){C.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??hx()),document.body.insertAdjacentElement("beforeend",e[1]??hx()),ph++,()=>{ph===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ph--}},[])}function hx(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var wn=function(){return wn=Object.assign||function(t){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},wn.apply(this,arguments)};function HS(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r}function uM(e,t,r){if(r||arguments.length===2)for(var n=0,s=t.length,i;n<s;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}var Kc="right-scroll-bar-position",Gc="width-before-scroll-bar",dM="with-scroll-bars-hidden",hM="--removed-body-scroll-bar-size";function mh(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function fM(e,t){var r=C.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var s=r.value;s!==n&&(r.value=n,r.callback(n,s))}}}})[0];return r.callback=t,r.facade}var pM=typeof window<"u"?C.useLayoutEffect:C.useEffect,fx=new WeakMap;function mM(e,t){var r=fM(null,function(n){return e.forEach(function(s){return mh(s,n)})});return pM(function(){var n=fx.get(r);if(n){var s=new Set(n),i=new Set(e),l=r.current;s.forEach(function(a){i.has(a)||mh(a,null)}),i.forEach(function(a){s.has(a)||mh(a,l)})}fx.set(r,e)},[e]),r}function gM(e){return e}function vM(e,t){t===void 0&&(t=gM);var r=[],n=!1,s={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(i){var l=t(i,n);return r.push(l),function(){r=r.filter(function(a){return a!==l})}},assignSyncMedium:function(i){for(n=!0;r.length;){var l=r;r=[],l.forEach(i)}r={push:function(a){return i(a)},filter:function(){return r}}},assignMedium:function(i){n=!0;var l=[];if(r.length){var a=r;r=[],a.forEach(i),l=r}var c=function(){var g=l;l=[],g.forEach(i)},u=function(){return Promise.resolve().then(c)};u(),r={push:function(g){l.push(g),u()},filter:function(g){return l=l.filter(g),r}}}};return s}function _M(e){e===void 0&&(e={});var t=vM(null);return t.options=wn({async:!0,ssr:!1},e),t}var zS=function(e){var t=e.sideCar,r=HS(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return C.createElement(n,wn({},r))};zS.isSideCarExport=!0;function xM(e,t){return e.useMedium(t),zS}var US=_M(),gh=function(){},xd=C.forwardRef(function(e,t){var r=C.useRef(null),n=C.useState({onScrollCapture:gh,onWheelCapture:gh,onTouchMoveCapture:gh}),s=n[0],i=n[1],l=e.forwardProps,a=e.children,c=e.className,u=e.removeScrollBar,g=e.enabled,d=e.shards,_=e.sideCar,v=e.noRelative,x=e.noIsolation,y=e.inert,f=e.allowPinchZoom,p=e.as,h=p===void 0?"div":p,m=e.gapMode,b=HS(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=_,k=mM([r,t]),j=wn(wn({},b),s);return C.createElement(C.Fragment,null,g&&C.createElement(w,{sideCar:US,removeScrollBar:u,shards:d,noRelative:v,noIsolation:x,inert:y,setCallbacks:i,allowPinchZoom:!!f,lockRef:r,gapMode:m}),l?C.cloneElement(C.Children.only(a),wn(wn({},j),{ref:k})):C.createElement(h,wn({},j,{className:c,ref:k}),a))});xd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};xd.classNames={fullWidth:Gc,zeroRight:Kc};var yM=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function bM(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=yM();return t&&e.setAttribute("nonce",t),e}function wM(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function SM(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var CM=function(){var e=0,t=null;return{add:function(r){e==0&&(t=bM())&&(wM(t,r),SM(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},kM=function(){var e=CM();return function(t,r){C.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},WS=function(){var e=kM(),t=function(r){var n=r.styles,s=r.dynamic;return e(n,s),null};return t},EM={left:0,top:0,right:0,gap:0},vh=function(e){return parseInt(e||"",10)||0},jM=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[vh(r),vh(n),vh(s)]},NM=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return EM;var t=jM(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},RM=WS(),Po="data-scroll-locked",PM=function(e,t,r,n){var s=e.left,i=e.top,l=e.right,a=e.gap;return r===void 0&&(r="margin"),`
202
+ .`.concat(dM,` {
203
+ overflow: hidden `).concat(n,`;
204
+ padding-right: `).concat(a,"px ").concat(n,`;
205
+ }
206
+ body[`).concat(Po,`] {
207
+ overflow: hidden `).concat(n,`;
208
+ overscroll-behavior: contain;
209
+ `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&`
210
+ padding-left: `.concat(s,`px;
211
+ padding-top: `).concat(i,`px;
212
+ padding-right: `).concat(l,`px;
213
+ margin-left:0;
214
+ margin-top:0;
215
+ margin-right: `).concat(a,"px ").concat(n,`;
216
+ `),r==="padding"&&"padding-right: ".concat(a,"px ").concat(n,";")].filter(Boolean).join(""),`
217
+ }
218
+
219
+ .`).concat(Kc,` {
220
+ right: `).concat(a,"px ").concat(n,`;
221
+ }
222
+
223
+ .`).concat(Gc,` {
224
+ margin-right: `).concat(a,"px ").concat(n,`;
225
+ }
226
+
227
+ .`).concat(Kc," .").concat(Kc,` {
228
+ right: 0 `).concat(n,`;
229
+ }
230
+
231
+ .`).concat(Gc," .").concat(Gc,` {
232
+ margin-right: 0 `).concat(n,`;
233
+ }
234
+
235
+ body[`).concat(Po,`] {
236
+ `).concat(hM,": ").concat(a,`px;
237
+ }
238
+ `)},px=function(){var e=parseInt(document.body.getAttribute(Po)||"0",10);return isFinite(e)?e:0},TM=function(){C.useEffect(function(){return document.body.setAttribute(Po,(px()+1).toString()),function(){var e=px()-1;e<=0?document.body.removeAttribute(Po):document.body.setAttribute(Po,e.toString())}},[])},AM=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,s=n===void 0?"margin":n;TM();var i=C.useMemo(function(){return NM(s)},[s]);return C.createElement(RM,{styles:PM(i,!t,s,r?"":"!important")})},ep=!1;if(typeof window<"u")try{var Ec=Object.defineProperty({},"passive",{get:function(){return ep=!0,!0}});window.addEventListener("test",Ec,Ec),window.removeEventListener("test",Ec,Ec)}catch{ep=!1}var Yi=ep?{passive:!1}:!1,DM=function(e){return e.tagName==="TEXTAREA"},VS=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!DM(e)&&r[t]==="visible")},LM=function(e){return VS(e,"overflowY")},MM=function(e){return VS(e,"overflowX")},mx=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var s=qS(e,n);if(s){var i=KS(e,n),l=i[1],a=i[2];if(l>a)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},OM=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},IM=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},qS=function(e,t){return e==="v"?LM(t):MM(t)},KS=function(e,t){return e==="v"?OM(t):IM(t)},FM=function(e,t){return e==="h"&&t==="rtl"?-1:1},BM=function(e,t,r,n,s){var i=FM(e,window.getComputedStyle(t).direction),l=i*n,a=r.target,c=t.contains(a),u=!1,g=l>0,d=0,_=0;do{if(!a)break;var v=KS(e,a),x=v[0],y=v[1],f=v[2],p=y-f-i*x;(x||p)&&qS(e,a)&&(d+=p,_+=x);var h=a.parentNode;a=h&&h.nodeType===Node.DOCUMENT_FRAGMENT_NODE?h.host:h}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(g&&Math.abs(d)<1||!g&&Math.abs(_)<1)&&(u=!0),u},jc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},gx=function(e){return[e.deltaX,e.deltaY]},vx=function(e){return e&&"current"in e?e.current:e},$M=function(e,t){return e[0]===t[0]&&e[1]===t[1]},HM=function(e){return`
239
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
240
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
241
+ `)},zM=0,Zi=[];function UM(e){var t=C.useRef([]),r=C.useRef([0,0]),n=C.useRef(),s=C.useState(zM++)[0],i=C.useState(WS)[0],l=C.useRef(e);C.useEffect(function(){l.current=e},[e]),C.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var y=uM([e.lockRef.current],(e.shards||[]).map(vx),!0).filter(Boolean);return y.forEach(function(f){return f.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),y.forEach(function(f){return f.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var a=C.useCallback(function(y,f){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!l.current.allowPinchZoom;var p=jc(y),h=r.current,m="deltaX"in y?y.deltaX:h[0]-p[0],b="deltaY"in y?y.deltaY:h[1]-p[1],w,k=y.target,j=Math.abs(m)>Math.abs(b)?"h":"v";if("touches"in y&&j==="h"&&k.type==="range")return!1;var S=window.getSelection(),E=S&&S.anchorNode,R=E?E===k||E.contains(k):!1;if(R)return!1;var M=mx(j,k);if(!M)return!0;if(M?w=j:(w=j==="v"?"h":"v",M=mx(j,k)),!M)return!1;if(!n.current&&"changedTouches"in y&&(m||b)&&(n.current=w),!w)return!0;var A=n.current||w;return BM(A,f,y,A==="h"?m:b)},[]),c=C.useCallback(function(y){var f=y;if(!(!Zi.length||Zi[Zi.length-1]!==i)){var p="deltaY"in f?gx(f):jc(f),h=t.current.filter(function(w){return w.name===f.type&&(w.target===f.target||f.target===w.shadowParent)&&$M(w.delta,p)})[0];if(h&&h.should){f.cancelable&&f.preventDefault();return}if(!h){var m=(l.current.shards||[]).map(vx).filter(Boolean).filter(function(w){return w.contains(f.target)}),b=m.length>0?a(f,m[0]):!l.current.noIsolation;b&&f.cancelable&&f.preventDefault()}}},[]),u=C.useCallback(function(y,f,p,h){var m={name:y,delta:f,target:p,should:h,shadowParent:WM(p)};t.current.push(m),setTimeout(function(){t.current=t.current.filter(function(b){return b!==m})},1)},[]),g=C.useCallback(function(y){r.current=jc(y),n.current=void 0},[]),d=C.useCallback(function(y){u(y.type,gx(y),y.target,a(y,e.lockRef.current))},[]),_=C.useCallback(function(y){u(y.type,jc(y),y.target,a(y,e.lockRef.current))},[]);C.useEffect(function(){return Zi.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:_}),document.addEventListener("wheel",c,Yi),document.addEventListener("touchmove",c,Yi),document.addEventListener("touchstart",g,Yi),function(){Zi=Zi.filter(function(y){return y!==i}),document.removeEventListener("wheel",c,Yi),document.removeEventListener("touchmove",c,Yi),document.removeEventListener("touchstart",g,Yi)}},[]);var v=e.removeScrollBar,x=e.inert;return C.createElement(C.Fragment,null,x?C.createElement(i,{styles:HM(s)}):null,v?C.createElement(AM,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function WM(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const VM=xM(US,UM);var yd=C.forwardRef(function(e,t){return C.createElement(xd,wn({},e,{ref:t,sideCar:VM}))});yd.classNames=xd.classNames;var qM=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Xi=new WeakMap,Nc=new WeakMap,Rc={},_h=0,GS=function(e){return e&&(e.host||GS(e.parentNode))},KM=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=GS(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},GM=function(e,t,r,n){var s=KM(t,Array.isArray(e)?e:[e]);Rc[r]||(Rc[r]=new WeakMap);var i=Rc[r],l=[],a=new Set,c=new Set(s),u=function(d){!d||a.has(d)||(a.add(d),u(d.parentNode))};s.forEach(u);var g=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(_){if(a.has(_))g(_);else try{var v=_.getAttribute(n),x=v!==null&&v!=="false",y=(Xi.get(_)||0)+1,f=(i.get(_)||0)+1;Xi.set(_,y),i.set(_,f),l.push(_),y===1&&x&&Nc.set(_,!0),f===1&&_.setAttribute(r,"true"),x||_.setAttribute(n,"true")}catch(p){console.error("aria-hidden: cannot operate on ",_,p)}})};return g(t),a.clear(),_h++,function(){l.forEach(function(d){var _=Xi.get(d)-1,v=i.get(d)-1;Xi.set(d,_),i.set(d,v),_||(Nc.has(d)||d.removeAttribute(n),Nc.delete(d)),v||d.removeAttribute(r)}),_h--,_h||(Xi=new WeakMap,Xi=new WeakMap,Nc=new WeakMap,Rc={})}},ng=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),s=qM(e);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live], script"))),GM(n,s,r,"aria-hidden")):function(){return null}};function QM(e){const t=YM(e),r=C.forwardRef((n,s)=>{const{children:i,...l}=n,a=C.Children.toArray(i),c=a.find(XM);if(c){const u=c.props.children,g=a.map(d=>d===c?C.Children.count(u)>1?C.Children.only(null):C.isValidElement(u)?u.props.children:null:d);return o.jsx(t,{...l,ref:s,children:C.isValidElement(u)?C.cloneElement(u,void 0,g):null})}return o.jsx(t,{...l,ref:s,children:i})});return r.displayName=`${e}.Slot`,r}function YM(e){const t=C.forwardRef((r,n)=>{const{children:s,...i}=r;if(C.isValidElement(s)){const l=eO(s),a=JM(i,s.props);return s.type!==C.Fragment&&(a.ref=n?ss(n,l):l),C.cloneElement(s,a)}return C.Children.count(s)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ZM=Symbol("radix.slottable");function XM(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ZM}function JM(e,t){const r={...t};for(const n in t){const s=e[n],i=t[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...a)=>{const c=i(...a);return s(...a),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...e,...r}}function eO(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var bd="Dialog",[QS,YS]=fn(bd),[tO,pn]=QS(bd),ZS=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:s,onOpenChange:i,modal:l=!0}=e,a=C.useRef(null),c=C.useRef(null),[u,g]=va({prop:n,defaultProp:s??!1,onChange:i,caller:bd});return o.jsx(tO,{scope:t,triggerRef:a,contentRef:c,contentId:Us(),titleId:Us(),descriptionId:Us(),open:u,onOpenChange:g,onOpenToggle:C.useCallback(()=>g(d=>!d),[g]),modal:l,children:r})};ZS.displayName=bd;var XS="DialogTrigger",JS=C.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=pn(XS,r),i=Be(t,s.triggerRef);return o.jsx($e.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":og(s.open),...n,ref:i,onClick:_e(e.onClick,s.onOpenToggle)})});JS.displayName=XS;var sg="DialogPortal",[rO,e1]=QS(sg,{forceMount:void 0}),t1=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:s}=e,i=pn(sg,t);return o.jsx(rO,{scope:t,forceMount:r,children:C.Children.map(n,l=>o.jsx(Wt,{present:r||i.open,children:o.jsx(Vl,{asChild:!0,container:s,children:l})}))})};t1.displayName=sg;var Pu="DialogOverlay",r1=C.forwardRef((e,t)=>{const r=e1(Pu,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,i=pn(Pu,e.__scopeDialog);return i.modal?o.jsx(Wt,{present:n||i.open,children:o.jsx(sO,{...s,ref:t})}):null});r1.displayName=Pu;var nO=QM("DialogOverlay.RemoveScroll"),sO=C.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=pn(Pu,r);return o.jsx(yd,{as:nO,allowPinchZoom:!0,shards:[s.contentRef],children:o.jsx($e.div,{"data-state":og(s.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),Oi="DialogContent",n1=C.forwardRef((e,t)=>{const r=e1(Oi,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,i=pn(Oi,e.__scopeDialog);return o.jsx(Wt,{present:n||i.open,children:i.modal?o.jsx(iO,{...s,ref:t}):o.jsx(oO,{...s,ref:t})})});n1.displayName=Oi;var iO=C.forwardRef((e,t)=>{const r=pn(Oi,e.__scopeDialog),n=C.useRef(null),s=Be(t,r.contentRef,n);return C.useEffect(()=>{const i=n.current;if(i)return ng(i)},[]),o.jsx(s1,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:_e(e.onCloseAutoFocus,i=>{var l;i.preventDefault(),(l=r.triggerRef.current)==null||l.focus()}),onPointerDownOutside:_e(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,a=l.button===0&&l.ctrlKey===!0;(l.button===2||a)&&i.preventDefault()}),onFocusOutside:_e(e.onFocusOutside,i=>i.preventDefault())})}),oO=C.forwardRef((e,t)=>{const r=pn(Oi,e.__scopeDialog),n=C.useRef(!1),s=C.useRef(!1);return o.jsx(s1,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var l,a;(l=e.onCloseAutoFocus)==null||l.call(e,i),i.defaultPrevented||(n.current||(a=r.triggerRef.current)==null||a.focus(),i.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:i=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=i.target;((u=r.triggerRef.current)==null?void 0:u.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),s1=C.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:i,...l}=e,a=pn(Oi,r),c=C.useRef(null),u=Be(t,c);return rg(),o.jsxs(o.Fragment,{children:[o.jsx(_d,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:i,children:o.jsx(Ul,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":og(a.open),...l,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),o.jsxs(o.Fragment,{children:[o.jsx(lO,{titleId:a.titleId}),o.jsx(uO,{contentRef:c,descriptionId:a.descriptionId})]})]})}),ig="DialogTitle",i1=C.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=pn(ig,r);return o.jsx($e.h2,{id:s.titleId,...n,ref:t})});i1.displayName=ig;var o1="DialogDescription",a1=C.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=pn(o1,r);return o.jsx($e.p,{id:s.descriptionId,...n,ref:t})});a1.displayName=o1;var l1="DialogClose",c1=C.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=pn(l1,r);return o.jsx($e.button,{type:"button",...n,ref:t,onClick:_e(e.onClick,()=>s.onOpenChange(!1))})});c1.displayName=l1;function og(e){return e?"open":"closed"}var u1="DialogTitleWarning",[aO,d1]=PR(u1,{contentName:Oi,titleName:ig,docsSlug:"dialog"}),lO=({titleId:e})=>{const t=d1(u1),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
242
+
243
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
244
+
245
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return C.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},cO="DialogDescriptionWarning",uO=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${d1(cO).contentName}}.`;return C.useEffect(()=>{var i;const s=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},h1=ZS,dO=JS,f1=t1,ag=r1,lg=n1,cg=i1,ug=a1,dg=c1,hO=Symbol("radix.slottable");function fO(e){const t=({children:r})=>o.jsx(o.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=hO,t}var p1="AlertDialog",[pO]=fn(p1,[YS]),os=YS(),m1=e=>{const{__scopeAlertDialog:t,...r}=e,n=os(t);return o.jsx(h1,{...n,...r,modal:!0})};m1.displayName=p1;var mO="AlertDialogTrigger",gO=C.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=os(r);return o.jsx(dO,{...s,...n,ref:t})});gO.displayName=mO;var vO="AlertDialogPortal",g1=e=>{const{__scopeAlertDialog:t,...r}=e,n=os(t);return o.jsx(f1,{...n,...r})};g1.displayName=vO;var _O="AlertDialogOverlay",v1=C.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=os(r);return o.jsx(ag,{...s,...n,ref:t})});v1.displayName=_O;var To="AlertDialogContent",[xO,yO]=pO(To),bO=fO("AlertDialogContent"),_1=C.forwardRef((e,t)=>{const{__scopeAlertDialog:r,children:n,...s}=e,i=os(r),l=C.useRef(null),a=Be(t,l),c=C.useRef(null);return o.jsx(aO,{contentName:To,titleName:x1,docsSlug:"alert-dialog",children:o.jsx(xO,{scope:r,cancelRef:c,children:o.jsxs(lg,{role:"alertdialog",...i,...s,ref:a,onOpenAutoFocus:_e(s.onOpenAutoFocus,u=>{var g;u.preventDefault(),(g=c.current)==null||g.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[o.jsx(bO,{children:n}),o.jsx(SO,{contentRef:l})]})})})});_1.displayName=To;var x1="AlertDialogTitle",y1=C.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=os(r);return o.jsx(cg,{...s,...n,ref:t})});y1.displayName=x1;var b1="AlertDialogDescription",w1=C.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=os(r);return o.jsx(ug,{...s,...n,ref:t})});w1.displayName=b1;var wO="AlertDialogAction",S1=C.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=os(r);return o.jsx(dg,{...s,...n,ref:t})});S1.displayName=wO;var C1="AlertDialogCancel",k1=C.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,{cancelRef:s}=yO(C1,r),i=os(r),l=Be(t,s);return o.jsx(dg,{...i,...n,ref:l})});k1.displayName=C1;var SO=({contentRef:e})=>{const t=`\`${To}\` requires a description for the component to be accessible for screen reader users.
246
+
247
+ You can add a description to the \`${To}\` by passing a \`${b1}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
248
+
249
+ Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${To}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
250
+
251
+ For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return C.useEffect(()=>{var n;document.getElementById((n=e.current)==null?void 0:n.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},CO=m1,kO=g1,E1=v1,j1=_1,N1=S1,R1=k1,P1=y1,T1=w1;const A1=CO,EO=kO,D1=C.forwardRef(({className:e,...t},r)=>o.jsx(E1,{className:X("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));D1.displayName=E1.displayName;const hg=C.forwardRef(({className:e,...t},r)=>o.jsxs(EO,{children:[o.jsx(D1,{}),o.jsx(j1,{ref:r,className:X("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-border bg-card p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));hg.displayName=j1.displayName;const fg=({className:e,...t})=>o.jsx("div",{className:X("flex flex-col gap-2 text-left",e),...t});fg.displayName="AlertDialogHeader";const pg=({className:e,...t})=>o.jsx("div",{className:X("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t});pg.displayName="AlertDialogFooter";const mg=C.forwardRef(({className:e,...t},r)=>o.jsx(P1,{ref:r,className:X("font-serif text-[20px] leading-tight text-foreground",e),...t}));mg.displayName=P1.displayName;const gg=C.forwardRef(({className:e,...t},r)=>o.jsx(T1,{ref:r,className:X("font-mono text-[12px] text-[var(--fg-muted)]",e),...t}));gg.displayName=T1.displayName;const vg=C.forwardRef(({className:e,...t},r)=>o.jsx(N1,{ref:r,className:X(Pm(),e),...t}));vg.displayName=N1.displayName;const _g=C.forwardRef(({className:e,...t},r)=>o.jsx(R1,{ref:r,className:X(Pm({variant:"secondary"}),"mt-2 sm:mt-0",e),...t}));_g.displayName=R1.displayName;const jO={paused:{title:"Pause SolverNet",body:"The generator will stop posting new Tasks. Existing Tasks continue through their normal lifecycle. You can resume any time.",confirmLabel:"Pause"},launched:{title:"Resume SolverNet",body:"The generator will resume polling and posting new Tasks at the configured cadence.",confirmLabel:"Resume"},retired:{title:"Retire SolverNet",body:"Retirement is permanent. The SolverNet stops accepting new work and disappears from the operator catalog. Historical Tasks, solutions, and verdicts remain discoverable. Type the SolverNet name to confirm.",confirmLabel:"Retire permanently",danger:!0}};function NO({open:e,target:t,solverNetName:r,onConfirm:n,onCancel:s,pending:i=!1,errorMessage:l}){const[a,c]=C.useState("");C.useEffect(()=>{e||c("")},[e,t]);const u=jO[t],g=t==="retired",d=!g||a.trim().toLowerCase()===r.trim().toLowerCase(),_=i||!d;return o.jsx(A1,{open:e,onOpenChange:v=>{!v&&!i&&s()},children:o.jsxs(hg,{"data-testid":"launcher-launched-dialog","data-target":t,className:X("gap-4",u.danger&&"border-destructive"),children:[o.jsxs(fg,{children:[o.jsx(mg,{className:X(u.danger&&"text-destructive"),children:u.title}),o.jsx(gg,{children:u.body})]}),g&&o.jsxs("div",{className:"flex flex-col gap-1.5",children:[o.jsxs(wr,{htmlFor:"launcher-launched-dialog-typed",className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",children:["Type"," ",o.jsx("span",{className:"text-foreground",children:r})," to confirm"]}),o.jsx(ft,{id:"launcher-launched-dialog-typed","data-testid":"launcher-launched-dialog-typed",type:"text",autoFocus:!0,value:a,onChange:v=>c(v.target.value),disabled:i,className:X(d&&"border-[var(--vow-green)]")})]}),l&&o.jsx("span",{"data-testid":"launcher-launched-dialog-error",className:"font-mono text-[12px] text-destructive",children:l}),o.jsxs(pg,{children:[o.jsx(_g,{"data-testid":"launcher-launched-dialog-cancel",onClick:v=>{v.preventDefault(),s()},disabled:i,children:"Cancel"}),o.jsx(vg,{"data-testid":"launcher-launched-dialog-confirm",onClick:v=>{if(_){v.preventDefault();return}v.preventDefault(),n()},disabled:_,className:X(u.danger&&"border border-destructive bg-transparent text-destructive hover:bg-[var(--severity-blocking-bg)]"),children:i?`${u.confirmLabel}…`:u.confirmLabel})]})]})})}function RO({record:e,manifest:t,fetchLauncherStatus:r}){var x,y;const n=r??(()=>ge.fetchLauncherStatus()),{data:s,isLoading:i,isError:l}=Me({queryKey:["launcher-status",e.solverNetId],queryFn:()=>n(),refetchInterval:3e4}),a=t?`${t.contract.id}.${t.contract.version}`:e.summary?`${e.summary.contractId}.${e.summary.contractVersion}`:void 0,c=a?s==null?void 0:s.nets.find(f=>{var p;return f.solverType===a||f.name===((t==null?void 0:t.name)??((p=e.summary)==null?void 0:p.name))}):void 0,u=c==null?void 0:c.budget.safeBalanceWei,g=(c==null?void 0:c.budget.safeAddress)??e.launcherSafeAddress,d=(t==null?void 0:t.solutionPriceWei)??((x=e.summary)==null?void 0:x.solutionPriceWei),_=(t==null?void 0:t.verdictPriceWei)??((y=e.summary)==null?void 0:y.verdictPriceWei),v=HL(u,d,_);return o.jsx(jn,{delayDuration:150,children:o.jsxs(we,{"data-testid":"launcher-launched-spend-panel",role:"region","aria-label":"Spend and runway",className:"flex flex-col gap-3 p-6",children:[o.jsx("header",{className:"flex items-center justify-between gap-3",children:o.jsx("h2",{className:"m-0 font-serif text-[22px] font-normal text-foreground",children:"Spend & runway"})}),o.jsxs("dl",{className:"m-0 grid gap-y-2 gap-x-4 [grid-template-columns:repeat(auto-fit,minmax(220px,1fr))]",children:[o.jsx(Ji,{label:"Safe address",value:IS(g),tooltip:g,testid:"launcher-launched-spend-safe-address"}),o.jsx(Ji,{label:"Safe balance",value:i?"—":u?As(u):"unavailable",tooltip:u?`${u} wei`:void 0,testid:"launcher-launched-spend-safe-balance"}),o.jsx(Ji,{label:"Solution price",value:d?As(d):"—",tooltip:d?`${d} wei`:void 0,testid:"launcher-launched-spend-solution-price"}),o.jsx(Ji,{label:"Verdict price",value:_?As(_):"—",tooltip:_?`${_} wei`:void 0,testid:"launcher-launched-spend-verdict-price"}),o.jsx(Ji,{label:"Per-Task cost",value:v?As(v.perTaskWei.toString()):"—",tooltip:v?`${v.perTaskWei.toString()} wei`:void 0,testid:"launcher-launched-spend-per-task"}),o.jsx(Ji,{label:"Projected runway",value:v?`${v.tasks.toLocaleString()} Tasks at current prices`:"manifest or balance unavailable",testid:"launcher-launched-spend-runway"})]}),l&&o.jsx("span",{"data-testid":"launcher-launched-spend-error",className:"font-mono text-[12px] text-destructive",children:"Failed to load Safe balance."}),o.jsx("p",{className:"m-0 font-mono text-[11px] leading-relaxed text-[var(--fg-dim)]",children:"Runway projects how many Tasks the Safe can fund at the current manifest prices, before any operator participation cost adjustments."})]})})}function Ji({label:e,value:t,testid:r,tooltip:n}){const s=o.jsx("dd",{"data-testid":r,className:"m-0 truncate font-mono text-[13px] text-foreground",tabIndex:n?0:void 0,children:t});return o.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[o.jsx("dt",{className:"font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--fg-dim)]",children:e}),n?o.jsxs(Ir,{children:[o.jsx(Fr,{asChild:!0,children:s}),o.jsx(br,{children:n})]}):s]})}const PO={paused:"Pause",launched:"Resume",retired:"Retire"},_x={launching:{variant:"default",label:"Launching"},launched:{variant:"success",label:"Launched"},paused:{variant:"pill",label:"Paused"},retired:{variant:"outline",label:"Retired"},failed:{variant:"destructive",label:"Failed"}};function TO({record:e,manifest:t,operatorCount:r,onAction:n,pending:s}){var c;const i=_x[e.status]??_x.launching,l=$L[e.status]??[],a=(t==null?void 0:t.name)??((c=e.summary)==null?void 0:c.name)??e.solverNetId;return o.jsx(jn,{delayDuration:150,children:o.jsxs(we,{"data-testid":"launcher-launched-status-header","data-status":e.status,role:"region","aria-label":"SolverNet status header",className:"flex flex-col gap-4 p-6",children:[o.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[o.jsxs("div",{className:"flex min-w-0 flex-col gap-1.5",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[o.jsx("h1",{"data-testid":"launcher-launched-name",className:"m-0 font-serif text-[32px] font-normal tracking-[-0.01em] text-foreground",children:a}),o.jsx(je,{"data-testid":"launcher-launched-status-badge",variant:i.variant,className:"whitespace-nowrap",children:i.label})]}),(t==null?void 0:t.description)&&o.jsx("p",{className:"m-0 max-w-[720px] text-[13px] leading-relaxed text-[var(--fg-muted)]",children:t.description})]}),o.jsx(AO,{allowed:l,onAction:n,pending:s??null,terminal:e.status==="retired",launching:e.status==="launching"})]}),o.jsx(Ge,{}),o.jsxs("dl",{className:"m-0 grid gap-y-2 gap-x-4 [grid-template-columns:repeat(auto-fit,minmax(220px,1fr))]",children:[o.jsx(Da,{label:"SolverNet id",value:e.solverNetId,testid:"launcher-launched-solvernet-id"}),o.jsx(Da,{label:"Manifest cid",value:OS(e.manifestCid),testid:"launcher-launched-manifest-cid",additionalTestIds:["manifest-cid"],tooltip:e.manifestCid}),o.jsx(Da,{label:"Launcher Safe",value:IS(e.launcherSafeAddress),testid:"launcher-launched-safe",tooltip:e.launcherSafeAddress}),o.jsx(Da,{label:"Launcher agent",value:e.launcherAgentId,testid:"launcher-launched-agent"}),r!==void 0&&o.jsx(Da,{label:"Operators",value:String(r),testid:"launcher-launched-operator-count",additionalTestIds:["operator-count"],tooltip:"Distinct operators that have ever claimed a task on this SolverNet, including on finalized or refunded tasks"})]})]})})}function Da({label:e,value:t,testid:r,additionalTestIds:n,tooltip:s}){const i=o.jsxs("dd",{"data-testid":r,className:"m-0 truncate font-mono text-[13px] text-foreground",tabIndex:s?0:void 0,children:[t,n==null?void 0:n.map(l=>o.jsx("span",{"data-testid":l,className:"hidden","aria-hidden":"true",children:t},l))]});return o.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[o.jsx("dt",{className:"font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--fg-dim)]",children:e}),s?o.jsxs(Ir,{children:[o.jsx(Fr,{asChild:!0,children:i}),o.jsx(br,{children:s})]}):i]})}function AO({allowed:e,onAction:t,pending:r,terminal:n,launching:s}){return n?o.jsx(je,{"data-testid":"launcher-launched-terminal-pill",variant:"outline",className:"self-start whitespace-nowrap",children:"Retired — no further actions"}):s?o.jsx(je,{"data-testid":"launcher-launched-launching-pill",variant:"outline",className:"self-start whitespace-nowrap border-primary text-primary",children:"Launching…"}):e.length===0?null:o.jsx("div",{"data-testid":"launcher-launched-actions",className:"flex flex-wrap gap-2 self-start",children:e.map(i=>{const l=PO[i],a=r===i,c=i==="retired";return o.jsx(ae,{type:"button",variant:c?"destructive":"default","data-testid":`launcher-launched-action-${i}`,onClick:()=>t(i),disabled:r!==null,className:r!==null&&!a?"opacity-60":void 0,children:a?`${l}…`:l},i)})})}const xx=5,DO={open:{variant:"default",label:"Open"},"claims-in-flight":{variant:"default",label:"In flight"},"fully-claimed":{variant:"success",label:"Claimed"},settled:{variant:"success",label:"Settled"},failed:{variant:"destructive",label:"Failed"}};function LO({record:e,fetchTasks:t}){var v;const[r,n]=C.useState([void 0]),s=r[r.length-1],i=t??(x=>ge.fetchLauncherTasks(x)),{data:l,isLoading:a,isError:c,error:u,refetch:g}=Me({queryKey:["launcher-tasks",e.solverNetId,s??null],queryFn:()=>i({cursor:s,limit:xx}),refetchInterval:15e3}),d=()=>{var x;(x=l==null?void 0:l.cursor)!=null&&x.before&&n(y=>[...y,l.cursor.before])},_=()=>{n(x=>x.length>1?x.slice(0,-1):x)};return o.jsx(jn,{delayDuration:150,children:o.jsxs(we,{"data-testid":"launcher-launched-tasks-panel",role:"region","aria-label":"Recent posted Tasks",className:"flex flex-col gap-3 p-6",children:[o.jsxs("header",{className:"flex items-center justify-between gap-3",children:[o.jsx("h2",{className:"m-0 font-serif text-[22px] font-normal text-foreground",children:"Recent posted Tasks"}),o.jsx(ae,{type:"button",variant:"secondary",size:"sm","data-testid":"launcher-launched-tasks-refresh",onClick:()=>{g()},children:"Refresh"})]}),a&&o.jsx("p",{"data-testid":"launcher-launched-tasks-loading",className:"m-0 font-mono text-[12px] text-[var(--fg-muted)]",children:"Loading…"}),c&&o.jsxs("div",{"data-testid":"launcher-launched-tasks-error",className:"font-mono text-[12px] text-destructive",children:["Failed to load tasks: ",u instanceof Error?u.message:"unknown error"]}),!a&&!c&&l&&l.tasks.length===0&&o.jsx(OO,{}),!a&&!c&&l&&l.tasks.length>0&&o.jsxs(o.Fragment,{children:[o.jsx("div",{"data-testid":"launcher-launched-tasks-list",className:"overflow-hidden rounded-md border border-border",children:o.jsxs(Hi,{className:"table-fixed",children:[o.jsx(zi,{children:o.jsxs(Cr,{className:"bg-[var(--bg)] hover:bg-[var(--bg)]",children:[o.jsx(We,{className:"w-[34%]",children:"Task"}),o.jsx(We,{className:"w-[16%]",children:"SolverType"}),o.jsx(We,{className:"w-[22%]",children:"Posted"}),o.jsx(We,{className:"w-[14%]",children:"State"}),o.jsx(We,{className:"w-[14%] text-right",children:"Claims"})]})}),o.jsx(Ui,{children:l.tasks.map(x=>o.jsx(MO,{task:x},x.taskId))})]})}),o.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o.jsx(ae,{type:"button",variant:"secondary",size:"sm","data-testid":"launcher-launched-tasks-prev",onClick:_,disabled:r.length<=1,children:"← Newer"}),o.jsxs("span",{className:"m-0 font-mono text-[12px] text-[var(--fg-muted)]",children:["Page ",r.length,l.tasks.length<xx&&l.cursor===void 0?" · end":""]}),o.jsx(ae,{type:"button",variant:"secondary",size:"sm","data-testid":"launcher-launched-tasks-next",onClick:d,disabled:!((v=l.cursor)!=null&&v.before),children:"Older →"})]})]})]})})}function MO({task:e}){var s;const t=DO[e.state]??{variant:"secondary",label:e.state},r=((s=e.summary)==null?void 0:s.title)??OS(e.taskCid),n=e.solverType??e.solverNet;return o.jsxs(Cr,{"data-testid":"launcher-launched-task-row","data-task-id":e.taskId,children:[o.jsx(Ve,{className:"font-mono text-[13px] text-foreground",children:o.jsxs(Ir,{children:[o.jsx(Fr,{asChild:!0,children:o.jsx("span",{className:"block truncate",tabIndex:0,children:r})}),o.jsx(br,{children:e.taskCid})]})}),o.jsx(Ve,{className:"font-mono text-[12px] text-[var(--fg-muted)]",children:o.jsxs(Ir,{children:[o.jsx(Fr,{asChild:!0,children:o.jsx("span",{className:"block truncate",tabIndex:0,children:n})}),o.jsx(br,{children:n})]})}),o.jsx(Ve,{className:"font-mono text-[12px] text-[var(--fg-muted)]",children:tg(e.postedAt)}),o.jsx(Ve,{children:o.jsx(je,{variant:t.variant,className:"normal-case tracking-[0.1em]",children:t.label})}),o.jsxs(Ve,{className:"text-right font-mono text-[12px] text-[var(--fg-muted)]",children:[e.claims.current," / ",e.claims.max]})]})}function OO(){return o.jsx("div",{"data-testid":"launcher-launched-tasks-empty",className:"rounded-md border border-dashed border-border p-6 text-center font-mono text-[13px] text-[var(--fg-muted)]",children:"Tasks will appear here after the first generator poll posts a Task."})}const IO=2500,FO=3e4,Pc="mx-auto flex max-w-[960px] flex-col gap-4 p-6";function BO({pollIntervalMs:e=IO,navigateTo:t,solverNetId:r}={}){var k,j,S,E;const n=ad(),[,s]=hn(),i=t??s,l=ni(),a=r??n.solverNetId,c=Me({queryKey:["solvernets","launched",a],queryFn:()=>ge.solvernets.get(a),refetchInterval:e,enabled:!!a}),u=(k=c.data)==null?void 0:k.manifestCid,g=Me({queryKey:["solvernets","manifest",u],queryFn:()=>ge.solvernets.getManifest(u),enabled:!!u,staleTime:1/0}),d=Me({queryKey:["solvernets","operator-count",u],queryFn:async()=>(await ge.discovery.getSolverNetOperatorCount(u)).operatorCount,enabled:!!u,refetchInterval:FO}),[_,v]=C.useState(null),[x,y]=C.useState(null),f=Kn({mutationFn:({target:R})=>ge.solvernets.transitionLifecycle(a,R),onSuccess:async R=>{await l.cancelQueries({queryKey:["solvernets","launched",a]}),l.setQueryData(["solvernets","launched",a],R),v(null),y(null)},onError:R=>{y(R instanceof Error?R.message:String(R))}}),p=Kn({mutationFn:R=>ge.solvernets.updateGeneratorConfig(a,R),onSuccess:()=>{l.invalidateQueries({queryKey:["solvernets","launched",a]})}});if(!a)return o.jsx("main",{"data-testid":"launcher-launched-missing-id",className:Pc,children:o.jsx(yx,{message:"No solverNetId supplied.",onBack:()=>i("/launcher")})});if(c.isLoading)return o.jsx("main",{"data-testid":"launcher-launched-loading",className:Pc,children:o.jsx("p",{className:"m-0 font-mono text-[13px] text-[var(--fg-muted)]",children:"Loading…"})});if(c.isError||!c.data){const R=c.error instanceof Error?c.error.message:"Unknown error";return o.jsx("main",{"data-testid":"launcher-launched-error",className:Pc,children:o.jsx(yx,{message:`Failed to load SolverNet: ${R}`,onBack:()=>i("/launcher"),onRetry:()=>{c.refetch()}})})}const h=c.data,m=(j=g.data)==null?void 0:j.manifest,b=HO(h,m),w=(m==null?void 0:m.name)??((S=h.summary)==null?void 0:S.name)??h.solverNetId;return o.jsxs("main",{"data-testid":"launcher-launched","data-solvernet-id":a,className:Pc,children:[o.jsx(TO,{record:h,manifest:m,operatorCount:d.data,onAction:R=>{y(null),v(R)},pending:f.isPending?((E=f.variables)==null?void 0:E.target)??null:null}),o.jsx(QL,{record:h,manifest:m,template:b,onSave:async R=>{await p.mutateAsync(R)}}),o.jsx(RO,{record:h,manifest:m}),o.jsx(LO,{record:h}),g.isError&&o.jsxs("p",{"data-testid":"launcher-launched-manifest-error",className:"m-0 font-mono text-[12px] text-destructive",children:["Failed to load manifest:"," ",$O(g.error)]}),o.jsx(NO,{open:_!==null,target:_??"paused",solverNetName:w,pending:f.isPending,errorMessage:x??void 0,onCancel:()=>{f.isPending||(v(null),y(null))},onConfirm:()=>{_&&f.mutate({target:_})}})]})}function $O(e){const t=e instanceof Error?e.message:String(e??"unknown error");return/404|manifest_not_found|registry_unavailable/i.test(t)?`Manifest unavailable from local cache or registry (${t})`:t}function HO(e,t){const r=(t==null?void 0:t.contract)??(e.summary?{id:e.summary.contractId,version:e.summary.contractVersion}:void 0);if(r)return Xf[`${r.id}.${r.version}`]}function yx({message:e,onBack:t,onRetry:r}){return o.jsxs(rt,{variant:"blocking",className:"flex items-center justify-between gap-4 border-l-0 border border-destructive p-4",children:[o.jsx(it,{className:"font-mono text-[13px] text-destructive",children:e}),o.jsxs("div",{className:"flex gap-2",children:[r&&o.jsx(ae,{type:"button",variant:"secondary",size:"sm","data-testid":"launcher-launched-error-retry",onClick:r,children:"Retry"}),o.jsx(ae,{type:"button",variant:"secondary",size:"sm","data-testid":"launcher-launched-error-back",onClick:t,children:"Back to launcher"})]})]})}const bx="curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash",xh="m-0 overflow-x-auto whitespace-pre-wrap break-all rounded-sm border border-border bg-[var(--bg-sunken)] p-2.5 font-mono text-[12px] text-foreground";function zO({onSuccess:e,onCancel:t}){const[r,n]=C.useState("checking"),[s,i]=C.useState(""),[l,a]=C.useState(""),c=()=>{n("checking"),ge.hermesDoctor().then(g=>{if(!g.installed){n("not-installed");return}if(g.exitCode!==0){n("config-issue"),i(g.stderr);return}n("ok"),e()}).catch(g=>{a(g instanceof Error?g.message:String(g)),n("network-error")})},u=()=>{typeof navigator<"u"&&navigator.clipboard&&navigator.clipboard.writeText(bx).catch(()=>{})};return C.useEffect(()=>{c()},[]),r==="checking"?o.jsxs(we,{"data-testid":"hermes-precheck-checking",className:"flex flex-col gap-3 p-4",children:[o.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",children:"Hermes install check"}),o.jsx("p",{className:"m-0 font-mono text-[12px] text-[var(--fg-muted)]",children:"Checking hermes install…"})]}):r==="not-installed"?o.jsxs(we,{"data-testid":"hermes-precheck-not-installed",className:"flex flex-col gap-3 p-4",children:[o.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",children:"Hermes Agent not installed"}),o.jsx("p",{className:"m-0 font-mono text-[13px] text-foreground",children:"Hermes Agent is not installed on this machine. Run this command in your terminal, then click Retry:"}),o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx("pre",{className:`${xh} flex-1`,children:bx}),o.jsx(ae,{type:"button",variant:"secondary",size:"sm","data-testid":"hermes-precheck-copy-install","aria-label":"Copy install command",onClick:u,children:"Copy"})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(ae,{type:"button",variant:"outline","data-testid":"hermes-precheck-retry",onClick:c,children:"I've installed Hermes — retry precheck"}),o.jsx(ae,{type:"button",variant:"secondary","data-testid":"hermes-precheck-cancel",onClick:t,children:"Cancel"})]})]}):r==="network-error"?o.jsxs(rt,{"data-testid":"hermes-precheck-network-error",variant:"blocking",className:"flex flex-col gap-3 border-l-0 border border-destructive p-4",children:[o.jsx(Dt,{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",children:"Hermes precheck failed"}),o.jsxs(it,{className:"font-mono text-[13px] text-foreground",children:["Could not reach the daemon API to run ",o.jsx("code",{children:"hermes doctor"}),". Check that the daemon is running and the UI token is valid."]}),l?o.jsx("pre",{className:xh,children:l}):null,o.jsxs("div",{className:"flex gap-2",children:[o.jsx(ae,{type:"button",variant:"outline","data-testid":"hermes-precheck-retry",onClick:c,children:"Retry precheck"}),o.jsx(ae,{type:"button",variant:"secondary","data-testid":"hermes-precheck-cancel",onClick:t,children:"Cancel"})]})]}):r==="config-issue"?o.jsxs(rt,{"data-testid":"hermes-precheck-config-issue",variant:"warning",className:"flex flex-col gap-3 border-l-0 border border-[var(--severity-warning-fg)] p-4",children:[o.jsx(Dt,{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",children:"Hermes Agent configuration issue"}),o.jsx(it,{className:"font-mono text-[13px] text-foreground",children:"Hermes is installed but reports configuration issues:"}),o.jsx("pre",{className:xh,children:s||"(no diagnostic output)"}),o.jsxs("p",{className:"m-0 font-mono text-[12px] text-[var(--fg-muted)]",children:["Run ",o.jsx("code",{children:"hermes model"})," or ",o.jsx("code",{children:"hermes setup"})," to configure a provider, then retry."]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(ae,{type:"button",variant:"outline","data-testid":"hermes-precheck-retry",onClick:c,children:"Retry precheck"}),o.jsx(ae,{type:"button",variant:"secondary","data-testid":"hermes-precheck-cancel",onClick:t,children:"Cancel"})]})]}):o.jsx(o.Fragment,{})}const L1=[{label:"Haiku",id:"claude-haiku-4-5-20251001"},{label:"Sonnet",id:"claude-sonnet-4-6"},{label:"Opus",id:"claude-opus-4-7"}],M1=[{label:"GPT-5.4 Mini",id:"gpt-5.4-mini"},{label:"GPT-5.5",id:"gpt-5.5"},{label:"GPT-5.4",id:"gpt-5.4"},{label:"GPT-5.3 Codex",id:"gpt-5.3-codex"},{label:"GPT-5.3 Codex Spark",id:"gpt-5.3-codex-spark"}],O1=[{label:"Claude Opus 4.7 (OpenRouter)",id:"anthropic/claude-opus-4.7"},{label:"Claude Sonnet 4.6 (OpenRouter)",id:"anthropic/claude-sonnet-4.6"},{label:"Hy3 Preview",id:"tencent/hy3-preview"},{label:"DeepSeek V4 Pro",id:"deepseek/deepseek-v4-pro"},{label:"DeepSeek V4 Flash",id:"deepseek/deepseek-v4-flash"},{label:"Gemini 3.1 Flash Lite",id:"google/gemini-3.1-flash-lite"},{label:"Kimi K2.6",id:"moonshotai/kimi-k2.6"},{label:"Owl Alpha",id:"openrouter/owl-alpha"},{label:"MiniMax M2.7",id:"minimax/minimax-m2.7"}];function UO(e){return Ur(e)===eg}function WO(e){return Ur(e)===na}function wd(e){return WO(e)?O1:UO(e)?M1:L1}function Ao(e){return wd(e)[0].id}function xg(e,t){const n=wd(t).find(s=>s.id===e)??null??L1.find(s=>s.id===e)??M1.find(s=>s.id===e)??O1.find(s=>s.id===e)??null;return n?{canonical:n,label:n.label,isCustom:!1}:{canonical:null,label:`Custom (${e})`,isCustom:!0}}function VO(e){const t=qO(e),r=C.forwardRef((n,s)=>{const{children:i,...l}=n,a=C.Children.toArray(i),c=a.find(GO);if(c){const u=c.props.children,g=a.map(d=>d===c?C.Children.count(u)>1?C.Children.only(null):C.isValidElement(u)?u.props.children:null:d);return o.jsx(t,{...l,ref:s,children:C.isValidElement(u)?C.cloneElement(u,void 0,g):null})}return o.jsx(t,{...l,ref:s,children:i})});return r.displayName=`${e}.Slot`,r}function qO(e){const t=C.forwardRef((r,n)=>{const{children:s,...i}=r;if(C.isValidElement(s)){const l=YO(s),a=QO(i,s.props);return s.type!==C.Fragment&&(a.ref=n?ss(n,l):l),C.cloneElement(s,a)}return C.Children.count(s)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var KO=Symbol("radix.slottable");function GO(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===KO}function QO(e,t){const r={...t};for(const n in t){const s=e[n],i=t[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...a)=>{const c=i(...a);return s(...a),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...e,...r}}function YO(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Sd="Popover",[I1]=fn(Sd,[ga]),Kl=ga(),[ZO,si]=I1(Sd),F1=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:s,onOpenChange:i,modal:l=!1}=e,a=Kl(t),c=C.useRef(null),[u,g]=C.useState(!1),[d,_]=va({prop:n,defaultProp:s??!1,onChange:i,caller:Sd});return o.jsx(Gm,{...a,children:o.jsx(ZO,{scope:t,contentId:Us(),triggerRef:c,open:d,onOpenChange:_,onOpenToggle:C.useCallback(()=>_(v=>!v),[_]),hasCustomAnchor:u,onCustomAnchorAdd:C.useCallback(()=>g(!0),[]),onCustomAnchorRemove:C.useCallback(()=>g(!1),[]),modal:l,children:r})})};F1.displayName=Sd;var B1="PopoverAnchor",XO=C.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=si(B1,r),i=Kl(r),{onCustomAnchorAdd:l,onCustomAnchorRemove:a}=s;return C.useEffect(()=>(l(),()=>a()),[l,a]),o.jsx(md,{...i,...n,ref:t})});XO.displayName=B1;var $1="PopoverTrigger",H1=C.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=si($1,r),i=Kl(r),l=Be(t,s.triggerRef),a=o.jsx($e.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":q1(s.open),...n,ref:l,onClick:_e(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?a:o.jsx(md,{asChild:!0,...i,children:a})});H1.displayName=$1;var yg="PopoverPortal",[JO,eI]=I1(yg,{forceMount:void 0}),z1=e=>{const{__scopePopover:t,forceMount:r,children:n,container:s}=e,i=si(yg,t);return o.jsx(JO,{scope:t,forceMount:r,children:o.jsx(Wt,{present:r||i.open,children:o.jsx(Vl,{asChild:!0,container:s,children:n})})})};z1.displayName=yg;var sa="PopoverContent",U1=C.forwardRef((e,t)=>{const r=eI(sa,e.__scopePopover),{forceMount:n=r.forceMount,...s}=e,i=si(sa,e.__scopePopover);return o.jsx(Wt,{present:n||i.open,children:i.modal?o.jsx(rI,{...s,ref:t}):o.jsx(nI,{...s,ref:t})})});U1.displayName=sa;var tI=VO("PopoverContent.RemoveScroll"),rI=C.forwardRef((e,t)=>{const r=si(sa,e.__scopePopover),n=C.useRef(null),s=Be(t,n),i=C.useRef(!1);return C.useEffect(()=>{const l=n.current;if(l)return ng(l)},[]),o.jsx(yd,{as:tI,allowPinchZoom:!0,children:o.jsx(W1,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:_e(e.onCloseAutoFocus,l=>{var a;l.preventDefault(),i.current||(a=r.triggerRef.current)==null||a.focus()}),onPointerDownOutside:_e(e.onPointerDownOutside,l=>{const a=l.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0,u=a.button===2||c;i.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:_e(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})}),nI=C.forwardRef((e,t)=>{const r=si(sa,e.__scopePopover),n=C.useRef(!1),s=C.useRef(!1);return o.jsx(W1,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var l,a;(l=e.onCloseAutoFocus)==null||l.call(e,i),i.defaultPrevented||(n.current||(a=r.triggerRef.current)==null||a.focus(),i.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:i=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=i.target;((u=r.triggerRef.current)==null?void 0:u.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),W1=C.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:l,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:g,...d}=e,_=si(sa,r),v=Kl(r);return rg(),o.jsx(_d,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:i,children:o.jsx(Ul,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:g,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>_.onOpenChange(!1),children:o.jsx(Qm,{"data-state":q1(_.open),role:"dialog",id:_.contentId,...v,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),V1="PopoverClose",sI=C.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=si(V1,r);return o.jsx($e.button,{type:"button",...n,ref:t,onClick:_e(e.onClick,()=>s.onOpenChange(!1))})});sI.displayName=V1;var iI="PopoverArrow",oI=C.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=Kl(r);return o.jsx(Ym,{...s,...n,ref:t})});oI.displayName=iI;function q1(e){return e?"open":"closed"}var aI=F1,lI=H1,cI=z1,K1=U1;const G1=aI,Q1=lI,bg=C.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},s)=>o.jsx(cI,{children:o.jsx(K1,{ref:s,align:t,sideOffset:r,className:X("z-50 w-72 rounded-md border border-border bg-popover p-4 text-popover-foreground shadow-md outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",e),...n})}));bg.displayName=K1.displayName;const wx=[{name:"network-tools",version:"0.1.0",source:"bundled",defaultIncluded:!0,description:"Jinn runtime tools"},{name:"claude-code-learner",version:"0.1.0",source:"bundled",defaultIncluded:!0,description:"Learner loop"}];function uI(e){return Ur(e)===na?wx.filter(t=>t.name!=="claude-code-learner"):wx}const dI=new Set(["swe-rebench-v2-runtime"]),hI={"network-tools":"Network Tools","claude-code-learner":"Learner","swe-rebench-v2-runtime":"SWE-rebench v2 Runtime","jinn-prediction-plugin":"Prediction Runtime"},Tu="bundled:";function La(e){return hI[e]??e}function yo(e){return e.startsWith(Tu)?e.slice(Tu.length):e}function fI(e){return e.source==="bundled"?`${Tu}${e.name}`:e.name}function Sx(e){const t=new Set,r=[];for(const n of e){const s=yo(n);t.has(s)||(t.add(s),r.push(n))}return r}function pI(e,t,r){const n=new Set,s=[];for(const i of uI(r))n.add(i.name),s.push(i);for(const i of e){if(n.has(i.name))continue;n.add(i.name);const l=dI.has(i.name);s.push({...i,...l?{defaultIncluded:!0}:{recommended:!0},description:i.name==="swe-rebench-v2-runtime"?"SWE-rebench v2 runtime":"Recommended for this SolverNet"})}for(const i of t){const l=yo(i);n.has(l)||(n.add(l),s.push({name:l,version:"configured",source:i.startsWith(Tu)?"bundled":"custom",description:"Already configured"}))}return s}function mI(e){const t=[e.source,e.version];return e.description&&t.push(e.description),t.join(" · ")}function tp({available:e,selected:t,disabledDefaultPlugins:r=[],onChange:n,rowTestId:s,searchTestId:i,harness:l}){const[a,c]=C.useState(""),[u,g]=C.useState(!1),[d,_]=C.useState(null),v=C.useMemo(()=>pI(e,t,l),[e,t,l]),x=new Set(t.map(yo)),y=new Set(r.map(yo)),f=new Set(x);for(const R of v)R.defaultIncluded&&!y.has(R.name)&&f.add(R.name);const p=v.filter(R=>f.has(R.name)),h=p.filter(R=>R.defaultIncluded).length,m=p.length-h,b=v.filter(R=>!f.has(R.name)),w=a.trim().toLowerCase(),k=w?b.filter(R=>`${R.name} ${La(R.name)} ${R.source} ${R.description??""}`.toLowerCase().includes(w)):b,j=R=>{const M=R.defaultIncluded?r.filter(L=>yo(L)!==R.name):r,A=R.defaultIncluded?t:Sx([...t,fI(R)]);n(A,M),g(!1),c("")},S=R=>{if(R.defaultIncluded){_(R),g(!1),c("");return}n(t.filter(M=>yo(M)!==R.name),r)},E=()=>{d&&(n(t,Sx([...r,d.name])),_(null))};return o.jsxs("div",{className:"relative flex flex-col gap-2",children:[o.jsx("div",{className:"flex flex-wrap gap-1.5",children:p.map(R=>o.jsxs("span",{"data-testid":`${s}-chip`,"data-plugin":R.name,className:X("inline-flex items-center gap-1.5 rounded-full border border-border px-2 py-[5px] pl-2.5 font-mono text-[11px] text-foreground",R.defaultIncluded?"bg-sunken":"bg-transparent"),children:[o.jsxs("span",{children:[La(R.name),o.jsx("span",{className:"text-dim",children:R.defaultIncluded?" · default":" · selected"})]}),o.jsx(ae,{type:"button",variant:"ghost",size:"icon","aria-label":`Remove ${La(R.name)}`,"data-testid":`${s}-remove`,"data-plugin":R.name,onClick:()=>S(R),className:"h-5 w-5 rounded-full p-0 text-muted-foreground hover:bg-transparent hover:text-foreground",children:o.jsx(Sl,{"aria-hidden":"true",className:"!size-3"})})]},R.name))}),d&&o.jsxs("div",{role:"alertdialog","data-testid":`${s}-default-warning`,className:"grid grid-cols-[minmax(0,1fr)_auto] items-center gap-3 rounded-md border border-wane bg-card px-3 py-2.5 font-mono",children:[o.jsxs("span",{className:"text-[12px] text-foreground",children:[La(d.name)," is part of the default operator baseline. Removing it may break standard SolverNet workflows."]}),o.jsxs("span",{className:"flex gap-2",children:[o.jsx(ae,{type:"button",variant:"secondary",size:"sm","data-testid":`${s}-default-warning-cancel`,onClick:()=>_(null),children:"Keep"}),o.jsx(ae,{type:"button",variant:"destructive",size:"sm","data-testid":`${s}-default-warning-confirm`,onClick:E,children:"Remove"})]})]}),o.jsxs(G1,{open:u,onOpenChange:R=>{g(R),R||c("")},children:[o.jsx(Q1,{asChild:!0,children:o.jsxs(ae,{type:"button",variant:"outline","data-testid":`${s}-trigger`,"aria-haspopup":"listbox",className:"grid h-auto grid-cols-[minmax(0,1fr)_auto] items-center gap-3 border-border bg-background px-3 py-2.5 text-left font-mono text-[12px] normal-case tracking-normal text-foreground hover:bg-sunken hover:text-foreground",children:[o.jsxs("span",{className:"min-w-0",children:["Add plugin",o.jsxs("span",{className:"text-dim",children:[" ","· ",h," default",m>0?` · ${m} selected`:""]})]}),u?o.jsx(pw,{"aria-hidden":"true",className:"!size-3.5 text-muted-foreground"}):o.jsx(Em,{"aria-hidden":"true",className:"!size-3.5 text-muted-foreground"})]})}),o.jsxs(bg,{align:"start",sideOffset:6,className:"w-[min(28rem,90vw)] overflow-hidden p-0",children:[o.jsx(ft,{type:"search",autoFocus:!0,"aria-label":"Search plugins","data-testid":i,value:a,onChange:R=>c(R.target.value),onKeyDown:R=>{R.key==="Escape"&&(g(!1),c(""))},placeholder:"Search plugins",className:"h-auto rounded-none border-0 border-b border-border bg-background px-3 py-2.5 text-[12px] focus-visible:ring-0"}),o.jsx(zl,{className:"max-h-60",children:o.jsx("div",{role:"listbox","aria-label":"Plugins",className:"flex flex-col",children:k.length===0?o.jsx("span",{className:"px-3.5 py-3 font-mono text-[12px] text-dim",children:b.length===0?"No plugins available to add.":"No matching plugins."}):k.map((R,M)=>{const A=f.has(R.name),L=R.defaultIncluded?"text-dim":R.recommended?"text-primary":"text-muted-foreground";return o.jsxs(ae,{type:"button",variant:"ghost",role:"option","aria-selected":A,"data-testid":s,"data-plugin":R.name,"data-plugin-active":A?"true":"false","data-plugin-default":R.defaultIncluded?"true":"false",onClick:()=>j(R),className:X("grid h-auto w-full grid-cols-[minmax(0,1fr)_auto] gap-3 rounded-none px-3 py-2.5 text-left font-mono normal-case tracking-normal transition-colors",M===0?"":"border-t border-border",A?"bg-sunken text-foreground":"bg-transparent text-foreground","hover:bg-sunken focus-visible:bg-sunken"),children:[o.jsxs("span",{className:"flex min-w-0 flex-col gap-1",children:[o.jsx("span",{className:"text-[13px] text-foreground",children:La(R.name)}),o.jsx("span",{className:"text-[11px] text-dim",children:mI(R)})]}),o.jsx("span",{className:X("self-center text-[11px] uppercase",L),children:R.defaultIncluded?"Default":R.recommended?"Recommended":"Add"})]},R.name)})})})]})]})]})}const Y1="claude-code",Z1="codex",gI="hermes-agent",vI={"claude-code-learner":Y1,"codex-code-learner":Z1};function _I(e){return vI[e]??e}const xI={"claude-opus-4-7":{provider:"anthropic",inputPer1kTokens:.015,outputPer1kTokens:.075,typicalInputTokens:5e4,typicalOutputTokens:2e4},"claude-sonnet-4-6":{provider:"anthropic",inputPer1kTokens:.003,outputPer1kTokens:.015,typicalInputTokens:5e4,typicalOutputTokens:2e4},"claude-haiku-4-5-20251001":{provider:"anthropic",inputPer1kTokens:.001,outputPer1kTokens:.005,typicalInputTokens:5e4,typicalOutputTokens:2e4},"anthropic/claude-opus-4.7":{provider:"openrouter",inputPer1kTokens:.015,outputPer1kTokens:.075,typicalInputTokens:5e4,typicalOutputTokens:2e4},"anthropic/claude-sonnet-4.6":{provider:"openrouter",inputPer1kTokens:.003,outputPer1kTokens:.015,typicalInputTokens:5e4,typicalOutputTokens:2e4},"gpt-5.4":{provider:"openai",inputPer1kTokens:.00125,outputPer1kTokens:.01,typicalInputTokens:5e4,typicalOutputTokens:2e4},"gpt-5.4-mini":{provider:"openai",inputPer1kTokens:25e-5,outputPer1kTokens:.002,typicalInputTokens:5e4,typicalOutputTokens:2e4},"gpt-5.5":{provider:"openai",inputPer1kTokens:.015,outputPer1kTokens:.06,typicalInputTokens:5e4,typicalOutputTokens:2e4},"gpt-5.3-codex":{provider:"openai",inputPer1kTokens:.00125,outputPer1kTokens:.01,typicalInputTokens:5e4,typicalOutputTokens:2e4},"gpt-5.3-codex-spark":{provider:"openai",inputPer1kTokens:.00125,outputPer1kTokens:.01,typicalInputTokens:5e4,typicalOutputTokens:2e4},"tencent/hy3-preview":{provider:"openrouter",inputPer1kTokens:.003,outputPer1kTokens:.015,typicalInputTokens:5e4,typicalOutputTokens:2e4},"deepseek/deepseek-v4-pro":{provider:"openrouter",inputPer1kTokens:.0014,outputPer1kTokens:.0028,typicalInputTokens:5e4,typicalOutputTokens:2e4},"deepseek/deepseek-v4-flash":{provider:"openrouter",inputPer1kTokens:1e-4,outputPer1kTokens:4e-4,typicalInputTokens:5e4,typicalOutputTokens:2e4},"google/gemini-3.1-flash-lite":{provider:"openrouter",inputPer1kTokens:1e-4,outputPer1kTokens:4e-4,typicalInputTokens:5e4,typicalOutputTokens:2e4},"moonshotai/kimi-k2.6":{provider:"openrouter",inputPer1kTokens:6e-4,outputPer1kTokens:.0025,typicalInputTokens:5e4,typicalOutputTokens:2e4},"openrouter/owl-alpha":{provider:"openrouter",inputPer1kTokens:.002,outputPer1kTokens:.008,typicalInputTokens:5e4,typicalOutputTokens:2e4},"minimax/minimax-m2.7":{provider:"openrouter",inputPer1kTokens:8e-4,outputPer1kTokens:.0032,typicalInputTokens:5e4,typicalOutputTokens:2e4},"nousresearch/hermes-4-405b":{provider:"nous",inputPer1kTokens:9e-4,outputPer1kTokens:9e-4,typicalInputTokens:5e4,typicalOutputTokens:2e4}},yI={[Y1]:{subscriptionPath:!0},[Z1]:{subscriptionPath:!0},[gI]:{subscriptionPath:!1}},wg=1;function bI(e){const t=xI[e];if(!t)return null;const r=t.typicalInputTokens/1e3*t.inputPer1kTokens,n=t.typicalOutputTokens/1e3*t.outputPer1kTokens;return{usd:r+n,inputUsd:r,outputUsd:n,typicalInputTokens:t.typicalInputTokens,typicalOutputTokens:t.typicalOutputTokens,entry:t}}function wI(e){if(!e)return!1;const t=_I(e),r=yI[t];return r?!r.subscriptionPath:!0}function X1(e,t,r=wg){if(!wI(e))return{showEstimate:!1,estimate:null,requiresConfirmation:!1,suppressedReason:"Included in subscription, no per-task API cost."};const n=t?bI(t):null;return(n==null?void 0:n.entry.subscriptionPath)===!0?{showEstimate:!1,estimate:null,requiresConfirmation:!1,suppressedReason:"Included in subscription, no per-task API cost."}:{showEstimate:!0,estimate:n,requiresConfirmation:n!==null&&n.usd>r,suppressedReason:null}}function SI(e){return Number.isFinite(e)?e===0?"$0":e<.01?"<$0.01":e<1?`$${e.toFixed(2)}`:e<10?`$${e.toFixed(2)}`:`$${e.toFixed(2)}`:"—"}function J1(e,t,r=wg){return X1(e,t,r)}function eC({harness:e,modelId:t,thresholdUsd:r=wg,variant:n="card",testIdPrefix:s="cost-estimate"}){const i=X1(e,t,r);if(!i.showEstimate)return o.jsxs("div",{"data-testid":`${s}-subscription`,"data-cost-mode":"subscription",className:X("flex items-center gap-2.5 font-mono",n==="card"?"rounded-md border border-border bg-card px-3.5 py-2.5":"py-1.5"),children:[o.jsx(S2,{"aria-hidden":"true",className:"size-3 shrink-0 text-primary"}),o.jsx("span",{className:"text-[12px] text-muted-foreground",children:i.suppressedReason??"Included in subscription, no per-task API cost."})]});const l=i.estimate,a=(l==null?void 0:l.usd)??null,c=i.requiresConfirmation;return o.jsxs("div",{"data-testid":`${s}-panel`,"data-cost-mode":"paid-api","data-cost-usd":a!==null?a.toFixed(4):"unknown","data-cost-high-cost":c?"true":"false",className:X("flex flex-col gap-2 rounded-md border bg-card",c?"border-destructive":"border-border",n==="card"?"px-4 py-3.5":"gap-1 px-2.5 py-2"),children:[o.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[o.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:"Estimated cost per task"}),o.jsx("span",{"data-testid":`${s}-amount`,className:X("font-mono font-medium",n==="card"?"text-[18px]":"text-[14px]",c?"text-destructive":"text-foreground"),children:a!==null?`~${SI(a)}`:"unavailable"})]}),l&&o.jsx("span",{"data-testid":`${s}-heuristic`,className:"font-mono text-[11px] text-muted-foreground",children:"Rough estimate — actual cost varies."}),a===null&&o.jsx("span",{"data-testid":`${s}-unknown`,className:"font-mono text-[11px] text-muted-foreground",children:"No pricing entry for this model id — confirm rates with your provider before joining."}),c&&o.jsxs("span",{"data-testid":`${s}-warning`,className:"font-mono text-[11px] text-destructive",children:["This model is above $",r.toFixed(2),"/task. You will be asked to confirm before joining."]})]})}function eo({label:e,children:t,docHref:r,docLabel:n="Read more"}){const[s,i]=C.useState(!1);return o.jsxs(G1,{open:s,onOpenChange:i,children:[o.jsx(Q1,{type:"button","data-testid":"inline-help-trigger","aria-label":e,className:"inline-flex h-4 w-4 cursor-pointer items-center justify-center rounded-md border border-muted-foreground bg-card p-0 text-muted-foreground transition-colors hover:border-foreground hover:text-foreground",children:o.jsx(C2,{className:"h-2.5 w-2.5","aria-hidden":"true"})}),o.jsxs(bg,{"data-testid":"inline-help-panel",role:"note",align:"start",className:"max-w-[420px] whitespace-pre-line font-mono text-[11px] font-normal leading-relaxed normal-case tracking-normal text-muted-foreground",children:[t,r&&o.jsxs(o.Fragment,{children:[" ",o.jsx("a",{"data-testid":"inline-help-doc-link",href:r,target:"_blank",rel:"noreferrer",className:"text-primary hover:underline",children:n})]})]})]})}const CI="Self-improving agent by Nous Research. Built-in learning loop.",to="https://github.com/Jinn-Network/mono/blob/next/client/docs/operator/join-form-context.md",kI=Jm,Ma="mx-auto flex max-w-[880px] flex-col gap-4 p-6",so="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",yh=so,ro="flex items-start gap-2",Cx="rounded-md border border-input bg-transparent px-3 py-2 font-mono text-[14px] text-foreground transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50";function EI(e,t){return e==null?void 0:e.nets.find(r=>r.contract.id===t.id&&r.contract.version===t.version)}function jI(e){return e?e.length<=13?e:`${e.slice(0,6)}…${e.slice(-4)}`:""}function NI(e){const t=e==null?void 0:e.contract.evaluationFunction.implementation;if(t){if(t.includes("swe-rebench-v2-evaluator"))return"swe-rebench-v2-evaluator";if(t.includes("prediction-v1-evaluator"))return"prediction-v1-evaluator"}}function RI(e){const t=[...new Set(e)].sort();return{readiness:Me({queryKey:["harness-readiness",t.join(",")],enabled:t.length>0,refetchInterval:5e3,queryFn:async()=>{const n=await Promise.all(t.map(async s=>{try{return[s,await ge.harnessReadiness(s)]}catch(i){if(i.code==="harness_not_found")return[s,void 0];throw i}}));return new Map(n)}}).data??new Map}}function PI({manifestCid:e,navigateTo:t}={}){var z,G,K;const r=ad(),[,n]=hn(),s=t??n,i=ni(),l=e??r.cid,a=Me({queryKey:["solvernets","manifest",l],queryFn:()=>ge.solvernets.getManifest(l),enabled:!!l,retry:!1}),c=Me({queryKey:["solvernets","catalog"],queryFn:()=>ge.getSolverNets()}),u=(z=a.data)==null?void 0:z.manifest,g=u?EI(c.data,u.contract):void 0,d=((g==null?void 0:g.compatibleHarnesses)??[]).filter(Q=>Q.supportsRoles.includes("solving")).map(Q=>({...Q,name:Ur(Q.name)})).filter((Q,ee,de)=>de.findIndex(De=>De.name===Q.name)===ee),_=((G=d[0])==null?void 0:G.name)??kI,v=Ao(_),[x,y]=C.useState({roles:[],harness:_,plugins:[],disabledDefaultPlugins:[],model:v}),[f,p]=C.useState(null),[h,m]=C.useState(null),[b,w]=C.useState(!1),k=C.useRef(!1),[j,S]=C.useState(!1),E=(K=d[0])==null?void 0:K.name;C.useEffect(()=>{k.current||E&&E!==x.harness&&y(Q=>({...Q,harness:E,model:Ao(E)}))},[E]);const R=wd(x.harness),M=NI(u),A=[...d.map(Q=>Q.name),...x.roles.includes("evaluator")&&M?[M]:[]],{readiness:L}=RI(A),B=L.get(x.harness),U=M?L.get(M):void 0,W=Kn({mutationFn:()=>ge.operator.join(l,{...(u==null?void 0:u.name)!==void 0?{name:u.name}:{},...(u==null?void 0:u.contract)!==void 0?{contract:{id:u.contract.id,version:u.contract.version}}:{},roles:x.roles,...x.roles.includes("solver")?{harness:x.harness,plugins:x.plugins,disabledDefaultPlugins:x.disabledDefaultPlugins,model:x.model}:{}}),onSuccess:Q=>{i.invalidateQueries({queryKey:["operator","joined"]}),i.invalidateQueries({queryKey:["bootstrap"]}),m({manifestCid:Q.manifestCid,name:Q.config.name??(u==null?void 0:u.name)??Q.manifestCid,roles:Q.config.roles,restartRequired:Q.restartRequired})},onError:Q=>{p(Q instanceof Error?Q.message:String(Q))}});if(!l)return o.jsx("main",{"data-testid":"join-flow-missing-cid",className:Ma,children:o.jsx(kx,{message:"No manifest cid supplied.",onBack:()=>s("/operator#solvernets")})});if(a.isLoading)return o.jsx("main",{"data-testid":"join-flow-loading",className:Ma,children:o.jsx("p",{className:"m-0 font-mono text-[13px] text-[var(--fg-muted)]",children:"Loading manifest…"})});if(a.isError||!u){const Q=a.error instanceof Error?a.error.message:"Unknown error";return o.jsx("main",{"data-testid":"join-flow-error",className:Ma,children:o.jsx(kx,{message:`Failed to load manifest: ${Q}`,onBack:()=>s("/operator#solvernets"),onRetry:()=>{a.refetch()}})})}if(h)return o.jsx("main",{"data-testid":"join-flow-success",className:Ma,children:o.jsx(TI,{success:h,navigate:s})});const{openRoles:q}=u,N=Q=>{q.includes(Q)&&y(ee=>{const De=ee.roles.includes(Q)?ee.roles.filter(He=>He!==Q):q.filter(He=>He===Q||ee.roles.includes(He));return{...ee,roles:De}})},T=x.roles.includes("solver"),D=x.roles.includes("evaluator"),O=J1(T?x.harness:void 0,T?x.model:void 0),$=T&&O.requiresConfirmation,Y=$&&!j,J=T&&(B==null?void 0:B.ready)===!1,re=D&&(U==null?void 0:U.ready)===!1,ye=x.roles.length>0&&!W.isPending&&!Y&&!J&&!re,P=re&&M?o.jsxs("div",{"data-testid":"join-evaluator-not-ready","data-harness":M,role:"status",className:"flex flex-col gap-1 rounded-md border border-destructive bg-[var(--bg)] p-2.5 font-mono text-[11px] text-foreground",children:[o.jsxs("span",{className:"text-destructive",children:[Ws(M)," is not ready",U!=null&&U.reason?`: ${U.reason}`:""]}),(U==null?void 0:U.nextStep)&&o.jsxs("span",{"data-testid":"join-evaluator-not-ready-next-step",className:"text-[var(--fg-muted)]",children:[U.nextStep.description,U.nextStep.cli?` (${U.nextStep.cli})`:""]})]}):null;return o.jsxs("main",{"data-testid":"join-flow","data-manifest-cid":l,className:Ma,children:[o.jsxs("header",{className:"flex flex-col gap-1.5",children:[o.jsxs("span",{"data-testid":"join-flow-title",className:"font-mono text-[20px] font-medium text-foreground",children:["Join ",u.name]}),o.jsx("span",{className:"font-mono text-[12px] text-[var(--fg-muted)]",children:u.description})]}),o.jsxs(we,{"data-testid":"join-flow-summary",className:"flex flex-col gap-3 p-4",children:[o.jsx("span",{className:so,children:"Manifest"}),o.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1.5 font-mono text-[12px] text-[var(--fg-muted)]",children:[o.jsx("span",{children:"Contract"}),o.jsxs("span",{className:"text-foreground",children:[u.contract.id," · ",u.contract.version]}),o.jsx("span",{children:"Solution price"}),o.jsx("span",{className:"text-foreground",children:As(u.solutionPriceWei)}),o.jsx("span",{children:"Verdict price"}),o.jsx("span",{className:"text-foreground",children:As(u.verdictPriceWei)}),o.jsx("span",{children:"Open roles"}),o.jsx("span",{"data-testid":"join-flow-open-roles",className:"text-foreground",children:q.join(", ")||"none"}),o.jsx("span",{children:"Launcher"}),o.jsxs("span",{className:"text-foreground",children:[jI(u.launcher.safeAddress)," · agentId"," ",u.launcher.agentId]}),o.jsx("span",{children:"Manifest CID"}),o.jsx("span",{"data-testid":"join-flow-manifest-cid",className:"truncate text-[var(--fg-dim)]",children:l})]})]}),o.jsxs(we,{className:"flex flex-col gap-3 p-4",children:[o.jsxs("span",{className:ro,children:[o.jsx("span",{className:so,children:"Roles"}),o.jsxs(eo,{label:"Roles help",docHref:`${to}#solver-vs-evaluator`,children:["Solver attempts tasks and submits solutions. It is the spending role: you pay for model inference and gas. It also has the most upside per task.",`
252
+
253
+ `,"Evaluator checks other operators' solutions. Lower spend, steadier returns, less variance.",`
254
+
255
+ `,"You can take either role, or both. New here? Start as a solver on one SolverNet, using a model you already pay for."]})]}),o.jsx("div",{className:"flex overflow-hidden rounded-md border border-border",children:q.map((Q,ee)=>{const de=x.roles.includes(Q),De=`join-role-${Q}`;return o.jsxs("label",{htmlFor:De,"data-testid":"join-role-option","data-role":Q,"data-role-active":de?"true":"false",className:X("flex flex-1 cursor-pointer flex-col gap-1.5 p-3 font-mono",de?"bg-[var(--bg)] text-foreground":"bg-transparent text-[var(--fg-muted)]",ee<q.length-1&&"border-r border-border"),children:[o.jsxs("span",{className:"flex items-center gap-2",children:[o.jsx("input",{id:De,type:"checkbox",checked:de,onChange:()=>N(Q),"aria-label":Q==="solver"?"Solver":"Evaluator",className:"size-3.5 accent-primary"}),o.jsx("span",{className:"text-[14px] font-medium",children:Q==="solver"?"Solver":"Evaluator"})]}),o.jsx("span",{className:X("pl-[22px] text-[11px]",de?"text-[var(--fg-muted)]":"text-[var(--fg-dim)]"),children:Q==="solver"?"attempt tasks; submit solutions":"verify solutions submitted by other operators"})]},Q)})})]}),T&&o.jsxs(we,{"data-testid":"join-flow-solver-fields",className:"flex flex-col gap-3 p-4",children:[o.jsx("span",{className:so,children:"Solver configuration"}),o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:"flex flex-col gap-1.5",children:[o.jsxs("span",{className:ro,children:[o.jsx(wr,{htmlFor:"join-harness-select",className:yh,children:"Harness"}),o.jsxs(eo,{label:"Harness help",docHref:`${to}#harness-and-model`,children:["The harness is the runtime that runs a task.",`
256
+
257
+ `,"You only need credentials for one harness — the harness, not the harness and the model separately.",`
258
+
259
+ `,"Claude Code uses whatever the `claude` CLI is signed in with: a Claude subscription or an Anthropic API key. Hermes Agent is a separate package; the join form checks it is installed.",`
260
+
261
+ `,"The default is the SolverNet's first compatible harness. Pick one. You do not need to pay for two."]})]}),o.jsxs("select",{id:"join-harness-select","aria-label":"Harness","data-testid":"join-harness-select",value:x.harness,onChange:Q=>{const ee=Q.target.value;k.current=!0,y({...x,harness:ee,model:Ao(ee)}),S(!1)},className:Cx,children:[d.map(Q=>{const ee=L.get(Q.name),de=(ee==null?void 0:ee.ready)===!1;return o.jsxs("option",{value:Q.name,disabled:de,"data-testid":"join-harness-option","data-harness":Q.name,"data-harness-ready":ee===void 0?"unknown":ee.ready?"true":"false",children:[AS(Q.name,Q.version),de?" — setup required":""]},Q.name)}),(!g||d.length===0)&&o.jsx("option",{value:x.harness,children:Ws(x.harness)})]}),x.harness===na&&o.jsx("span",{"data-testid":"join-harness-hermes-description",className:"font-mono text-[11px] text-[var(--fg-muted)]",children:CI}),(B==null?void 0:B.ready)===!1&&o.jsxs("div",{"data-testid":"join-harness-not-ready","data-harness":x.harness,role:"status",className:"flex flex-col gap-1 rounded-md border border-destructive bg-[var(--bg)] p-2.5 font-mono text-[11px] text-foreground",children:[o.jsxs("span",{className:"text-destructive",children:[Ws(x.harness)," is not ready",B.reason?`: ${B.reason}`:""]}),B.nextStep&&o.jsxs("span",{"data-testid":"join-harness-not-ready-next-step",className:"text-[var(--fg-muted)]",children:[B.nextStep.description,B.nextStep.cli?` (${B.nextStep.cli})`:""]})]})]}),o.jsxs("div",{className:"flex flex-col gap-1.5",children:[o.jsxs("span",{className:ro,children:[o.jsx(wr,{htmlFor:"join-model-select",className:yh,children:"Model"}),o.jsxs(eo,{label:"Model help",docHref:`${to}#harness-and-model`,children:["The model is the LLM the harness runs.",`
262
+
263
+ `,"This list only shows models the selected harness supports. Change the harness and the model resets to that harness's default.",`
264
+
265
+ `,"You pay for the model through the harness's credentials. There is no extra model subscription on top.",`
266
+
267
+ `,"Check the cost estimate below before you join."]})]}),o.jsxs("select",{id:"join-model-select","aria-label":"Model","data-testid":"join-model-select",value:x.model,onChange:Q=>{y({...x,model:Q.target.value}),S(!1)},className:Cx,children:[R.map(Q=>o.jsx("option",{value:Q.id,children:Q.label},Q.id)),(()=>{const Q=xg(x.model,x.harness);return Q.isCustom?o.jsx("option",{value:x.model,children:Q.label},x.model):null})()]})]})]}),o.jsx(eC,{harness:x.harness,modelId:x.model,testIdPrefix:"join-flow-cost"}),$&&o.jsxs("label",{"data-testid":"join-flow-cost-confirmation","data-cost-confirmation-checked":j?"true":"false",className:"flex cursor-pointer items-start gap-2.5 rounded-md border border-destructive bg-[var(--bg)] p-3 font-mono text-[12px] text-foreground",children:[o.jsx("input",{type:"checkbox","data-testid":"join-flow-cost-confirmation-checkbox",checked:j,onChange:Q=>S(Q.target.checked),className:"mt-0.5 size-3.5 accent-destructive","aria-label":"I understand the per-task cost and have a budget for this"}),o.jsx("span",{children:"I understand — I have a budget for this. The selected model is estimated at more than $1 per task; I am responsible for the API spend on my own provider key."})]}),o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsxs("span",{className:ro,children:[o.jsx("span",{className:yh,children:"Plugins"}),o.jsxs(eo,{label:"Plugins help",docHref:`${to}#plug-ins`,children:["Plug-ins are optional. On your first run you do not need to touch this section.",`
268
+
269
+ `,"A plug-in is reusable AI tooling — MCP servers, skills, extensions — that the harness can load while it solves.",`
270
+
271
+ `,"This SolverNet already enables the plug-ins its tasks need. Add your own only if you have built one.",`
272
+
273
+ `,"You can re-join later with more plug-ins."]})]}),o.jsx(tp,{available:(g==null?void 0:g.compatiblePlugins)??[],selected:x.plugins,disabledDefaultPlugins:x.disabledDefaultPlugins,onChange:(Q,ee)=>y({...x,plugins:Q,disabledDefaultPlugins:ee}),rowTestId:"join-plugin-option",searchTestId:"join-plugin-search",harness:x.harness})]})]}),D&&!T&&o.jsxs(we,{"data-testid":"join-flow-evaluator-info",className:"flex flex-col gap-3 p-4",children:[o.jsxs("span",{className:ro,children:[o.jsx("span",{className:so,children:"Evaluator configuration"}),o.jsxs(eo,{label:"Evaluator configuration help",docHref:`${to}#why-the-evaluator-role-has-no-model-selector`,children:["The evaluator role has no harness or model picker. That is by design.",`
274
+
275
+ `,"Every evaluator on a SolverNet must run the same evaluation function, so verdicts can be compared. The SolverNet's manifest sets it for you.",`
276
+
277
+ `,"For many SolverNets that function is deterministic and uses no model at all."]})]}),o.jsxs("p",{className:"m-0 font-mono text-[12px] text-[var(--fg-muted)]",children:["The evaluator harness is bound to"," ",o.jsx("code",{className:"text-foreground",children:u.contract.evaluationFunction.implementation})," ","by the manifest's contract; no operator selection required."]}),P]}),D&&T&&o.jsxs(we,{"data-testid":"join-flow-evaluator-info",className:"flex flex-col gap-3 p-4",children:[o.jsxs("span",{className:ro,children:[o.jsx("span",{className:so,children:"Evaluator binding"}),o.jsxs(eo,{label:"Evaluator binding help",docHref:`${to}#why-the-evaluator-role-has-no-model-selector`,children:["The SolverNet's manifest sets the evaluator harness for you.",`
278
+
279
+ `,"Every evaluator runs the same evaluation function, so verdicts can be compared and trusted.",`
280
+
281
+ `,"The harness and model fields above apply only to the solver role."]})]}),o.jsxs("p",{className:"m-0 font-mono text-[12px] text-[var(--fg-muted)]",children:["Evaluator harness is bound to"," ",o.jsx("code",{className:"text-foreground",children:u.contract.evaluationFunction.implementation})," ","by the manifest. The fields above only configure the solver role."]}),P]}),b&&o.jsx(zO,{onSuccess:()=>{w(!1),W.mutate()},onCancel:()=>{w(!1)}}),f&&o.jsx("p",{"data-testid":"join-flow-submit-error",role:"alert",className:"m-0 font-mono text-[13px] text-destructive",children:f}),o.jsxs("footer",{className:"flex items-center justify-end gap-3",children:[o.jsx(ae,{type:"button",variant:"secondary","data-testid":"join-flow-cancel",onClick:()=>s("/operator#solvernets"),children:"Cancel"}),o.jsx(ae,{type:"button",variant:"default","data-testid":"join-flow-submit",disabled:!ye,onClick:()=>{if(p(null),x.roles.includes("solver")&&x.harness===na){w(!0);return}W.mutate()},children:W.isPending?"Joining…":"Join SolverNet"})]})]})}function kx({message:e,onBack:t,onRetry:r}){return o.jsxs(rt,{variant:"blocking",className:"flex items-center justify-between gap-4 border-l-0 border border-destructive p-4",children:[o.jsx(it,{className:"font-mono text-[13px] text-destructive",children:e}),o.jsxs("div",{className:"flex gap-2",children:[r&&o.jsx(ae,{type:"button",variant:"secondary",size:"sm","data-testid":"join-flow-retry",onClick:r,children:"Retry"}),o.jsx(ae,{type:"button",variant:"secondary",size:"sm","data-testid":"join-flow-back",onClick:t,children:"Back"})]})]})}function TI({success:e,navigate:t}){const r=e.roles.map(c=>c==="solver"?"Solver":"Evaluator").join(" + "),[n,s]=C.useState(!1),[i,l]=C.useState(null),a=async()=>{s(!0),l(null);try{if(!(await ge.restartDaemon()).ok)throw new Error("Restart request failed.");t("/overview")}catch(c){l(c instanceof Error?c.message:"Restart request failed."),s(!1)}};return o.jsxs(o.Fragment,{children:[o.jsxs(we,{"data-testid":"join-flow-success-card",role:"status",className:"flex flex-col gap-2.5 border-[var(--vow-green)] p-5",children:[o.jsx(je,{variant:"success",className:"self-start",children:"Joined"}),o.jsxs("span",{"data-testid":"join-flow-success-name",className:"font-mono text-[18px] font-medium text-foreground",children:["You joined ",e.name]}),o.jsxs("span",{className:"font-mono text-[12px] leading-relaxed text-[var(--fg-muted)]",children:["You're in as ",r||"an operator",". This SolverNet now shows in your joined list."]}),e.restartRequired&&o.jsx("span",{"data-testid":"join-flow-success-restart",className:"font-mono text-[12px] leading-relaxed text-[var(--accent-gold)]",children:"Restart the node to start participating — the daemon picks up SolverNet config on restart."})]}),i&&o.jsx(Dt,{role:"alert","data-testid":"join-flow-success-restart-error",className:"font-mono text-[12px] leading-relaxed text-destructive",children:i}),o.jsxs("footer",{className:"flex items-center justify-end gap-3",children:[o.jsx(ae,{type:"button",variant:"secondary","data-testid":"join-flow-success-browse",onClick:()=>t("/operator#solvernets"),children:"Browse SolverNets"}),o.jsx(ae,{type:"button",variant:"secondary","data-testid":"join-flow-success-view",onClick:()=>t(`/operator#solvernets/${e.manifestCid}`),children:"View joined SolverNet"}),o.jsx(ae,{type:"button",variant:"default","data-testid":"join-flow-success-restart-button",onClick:()=>{a()},disabled:n,children:n?"Restarting…":"Restart node now"})]})]})}function AI({capture:e}){var t;return o.jsxs("section",{className:"flex flex-col gap-2",children:[o.jsx("h2",{className:"m-0 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:"Executor"}),o.jsxs("dl",{className:"m-0 grid gap-x-3 gap-y-1.5 [grid-template-columns:120px_minmax(0,1fr)]",children:[o.jsx("dt",{className:"font-mono text-[12px] text-muted-foreground",children:"Tool"}),o.jsx("dd",{className:"m-0 font-mono text-[12px] text-foreground",children:e.originatingTool.name}),o.jsx("dt",{className:"font-mono text-[12px] text-muted-foreground",children:"Version"}),o.jsx("dd",{className:"m-0 font-mono text-[12px] text-foreground",children:e.originatingTool.version??"unknown"}),o.jsx("dt",{className:"font-mono text-[12px] text-muted-foreground",children:"Repo"}),o.jsx("dd",{className:"m-0 break-words font-mono text-[12px] text-foreground",children:e.repoRemoteUrl??"none"}),o.jsx("dt",{className:"font-mono text-[12px] text-muted-foreground",children:"Commit"}),o.jsx("dd",{className:"m-0 font-mono text-[12px] text-foreground",children:((t=e.repoCommitHash)==null?void 0:t.slice(0,12))??"none"})]})]})}function DI({spans:e}){const t=e.flatMap(r=>r.redactedKeys.map(n=>({span:r.name,key:n})));return o.jsxs("section",{className:"flex flex-col gap-2",children:[o.jsx("h2",{className:"m-0 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:"Redactions"}),t.length===0?o.jsx("div",{className:"font-mono text-[12px] text-muted-foreground",children:"No redacted attributes."}):o.jsx("div",{className:"flex flex-col gap-1.5",children:t.map((r,n)=>o.jsxs("div",{className:"grid gap-3 font-mono text-[12px] text-foreground [grid-template-columns:minmax(120px,180px)_minmax(0,1fr)]",children:[o.jsx("span",{className:"text-muted-foreground",children:r.span}),o.jsx("span",{className:"break-words",children:r.key})]},`${r.span}-${r.key}-${n}`))})]})}function LI({detail:e,approving:t=!1,skipping:r=!1,onApprove:n,onSkip:s,onTrustRepo:i}){const{capture:l,spans:a}=e;return o.jsxs("div",{className:"flex flex-col gap-5",children:[o.jsxs("header",{className:"flex items-start justify-between gap-4",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsx("h1",{className:"m-0 break-all font-serif text-[22px] font-normal leading-tight text-foreground",children:l.sessionId}),o.jsxs("div",{className:"mt-1.5 font-mono text-[12px] text-muted-foreground",children:[new Date(l.capturedAt).toLocaleString()," · ",a.length," spans"]})]}),o.jsxs("div",{className:"flex shrink-0 items-start gap-2",children:[l.repoRemoteUrl?o.jsx(ae,{variant:"secondary",size:"sm",onClick:()=>i(!0),children:"Trust repo"}):null,o.jsx(ae,{variant:"secondary",size:"sm",disabled:r,onClick:s,children:r?"Skipping":"Skip"}),o.jsx(ae,{variant:"default",size:"sm",disabled:t,onClick:n,children:t?"Approving":"Approve"})]})]}),o.jsx(AI,{capture:l}),o.jsx(DI,{spans:a}),o.jsxs("section",{className:"flex flex-col gap-2",children:[o.jsx("h2",{className:"m-0 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:"Trajectory"}),a.length===0?o.jsx("div",{className:"font-mono text-[12px] text-muted-foreground",children:"No spans recorded."}):o.jsx(we,{children:o.jsx(Qe,{className:"flex flex-col p-0",children:a.map((c,u)=>o.jsxs("div",{children:[u>0&&o.jsx(Ge,{}),o.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-2.5",children:[o.jsx("strong",{className:"min-w-0 truncate font-mono text-[12px] font-medium text-foreground",children:c.name}),o.jsx("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground",children:c.spanId})]})]},c.spanId))})})]})]})}function MI(e){const t=C.useRef({value:e,previous:e});return C.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Cd="Switch",[OI]=fn(Cd),[II,FI]=OI(Cd),tC=C.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:s,defaultChecked:i,required:l,disabled:a,value:c="on",onCheckedChange:u,form:g,...d}=e,[_,v]=C.useState(null),x=Be(t,m=>v(m)),y=C.useRef(!1),f=_?g||!!_.closest("form"):!0,[p,h]=va({prop:s,defaultProp:i??!1,onChange:u,caller:Cd});return o.jsxs(II,{scope:r,checked:p,disabled:a,children:[o.jsx($e.button,{type:"button",role:"switch","aria-checked":p,"aria-required":l,"data-state":iC(p),"data-disabled":a?"":void 0,disabled:a,value:c,...d,ref:x,onClick:_e(e.onClick,m=>{h(b=>!b),f&&(y.current=m.isPropagationStopped(),y.current||m.stopPropagation())})}),f&&o.jsx(sC,{control:_,bubbles:!y.current,name:n,value:c,checked:p,required:l,disabled:a,form:g,style:{transform:"translateX(-100%)"}})]})});tC.displayName=Cd;var rC="SwitchThumb",nC=C.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,s=FI(rC,r);return o.jsx($e.span,{"data-state":iC(s.checked),"data-disabled":s.disabled?"":void 0,...n,ref:t})});nC.displayName=rC;var BI="SwitchBubbleInput",sC=C.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...s},i)=>{const l=C.useRef(null),a=Be(l,i),c=MI(r),u=dS(t);return C.useEffect(()=>{const g=l.current;if(!g)return;const d=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(d,"checked").set;if(c!==r&&v){const x=new Event("click",{bubbles:n});v.call(g,r),g.dispatchEvent(x)}},[c,r,n]),o.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:a,style:{...s.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});sC.displayName=BI;function iC(e){return e?"checked":"unchecked"}var oC=tC,$I=nC;const aC=C.forwardRef(({className:e,...t},r)=>o.jsx(oC,{className:X("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-[var(--vow-green)] data-[state=unchecked]:bg-border",e),...t,ref:r,children:o.jsx($I,{className:X("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0.5")})}));aC.displayName=oC.displayName;const Br=C.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:X("animate-pulse rounded-md bg-muted",e),...t}));Br.displayName="Skeleton";function rp(e){return Object.fromEntries(Object.entries(e).sort(([t],[r])=>t.localeCompare(r)))}function HI(e,t){return e.publicEndpoint===t.publicEndpoint&&e.defaultPriceUsdc===t.defaultPriceUsdc&&JSON.stringify(rp(e.perArtifactTypePrice))===JSON.stringify(rp(t.perArtifactTypePrice))&&e.donation.enabled===t.donation.enabled}function Ex({label:e,value:t,meta:r}){return o.jsxs("div",{"data-testid":"operator-donation-fact",className:"flex min-w-0 flex-col gap-1.5 rounded-lg border border-border px-3.5 py-3",children:[o.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",children:e}),o.jsx("strong",{className:"font-mono text-[18px] font-medium text-foreground",children:t}),o.jsx("span",{className:"truncate font-mono text-[12px] text-[var(--fg-dim)]",children:r})]})}function zI({pricing:e,eligibleRuns:t,peerDatasetsUsed:r,saving:n,onSave:s,registerRevert:i}){const[l,a]=C.useState(e.donation.enabled),[c,u]=C.useState(!1),g=C.useMemo(()=>({publicEndpoint:e.publicEndpoint,defaultPriceUsdc:e.defaultPriceUsdc,perArtifactTypePrice:e.perArtifactTypePrice,donation:{enabled:l}}),[e.defaultPriceUsdc,e.perArtifactTypePrice,e.publicEndpoint,l]),d=!HI(e,g),_=x=>{if(x&&!l&&!e.donation.enabled){u(!0);return}a(x)},v=()=>{const x={...g,donation:{enabled:!0}};a(!0),u(!1),i(()=>a(!1)),s(x)};return o.jsxs("div",{"data-testid":"operator-donation-status",className:"flex flex-col gap-4",children:[o.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[o.jsxs("div",{className:"flex min-w-[260px] flex-[1_1_360px] flex-col gap-2",children:[o.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",children:"Donate execution data"}),o.jsx("strong",{"data-testid":"operator-donation-mode",className:l?"font-mono text-[18px] font-medium text-[var(--vow-green)]":"font-mono text-[18px] font-medium text-foreground",children:l?"Donation is on":"Donation is off"}),o.jsx("p",{className:"m-0 max-w-[64ch] font-mono text-[12px] leading-relaxed text-[var(--fg-dim)]",children:"Share scrubbed and anonymized solver/evaluator data from future runs with other operators. This lets the network learn from real executions and improve itself. Public testnet donations are free and published to IPFS."})]}),o.jsxs("label",{"data-testid":"operator-donation-toggle",className:"inline-flex cursor-pointer items-center gap-3 rounded-full border border-border bg-[var(--bg-sunken)] px-3 py-2",children:[o.jsx("span",{className:l?"font-mono text-[11px] uppercase tracking-[0.12em] text-[var(--vow-green)]":"font-mono text-[11px] uppercase tracking-[0.12em] text-muted-foreground",children:l?"On":"Off"}),o.jsx(aC,{"aria-label":"Donate produced data",checked:l,onCheckedChange:_})]})]}),o.jsxs("div",{"data-testid":"operator-donation-facts",className:"grid gap-2.5 [grid-template-columns:repeat(auto-fit,minmax(150px,1fr))]",children:[o.jsx(Ex,{label:"Eligible runs",value:String(t),meta:"local history"}),o.jsx(Ex,{label:"Peer datasets used",value:String(r),meta:"from other operators"})]}),o.jsx(rt,{variant:"info","data-testid":"operator-donation-caveat",children:o.jsx(it,{children:"Turning donation off stops future publishing. Data already published to IPFS may remain available."})}),o.jsx(Ge,{}),o.jsx("div",{className:"flex flex-wrap items-center justify-end gap-3",children:o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{"data-testid":"operator-donation-settings-state",className:d?"font-mono text-[12px] text-primary":"font-mono text-[12px] text-[var(--fg-dim)]",children:d?"Donation changed":"Current"}),o.jsx(ae,{variant:"default",size:"sm",type:"button",disabled:!d||n,onClick:()=>{const x=e.donation.enabled;l!==x&&i(()=>a(x)),s(g)},children:n?"Saving…":"Save"})]})}),o.jsx(A1,{open:c,onOpenChange:u,children:o.jsxs(hg,{"data-testid":"operator-donation-confirm",children:[o.jsxs(fg,{children:[o.jsx(mg,{children:"Share future execution data"}),o.jsx(gg,{children:"Future solver/evaluator runs will be scrubbed, anonymized, and published to IPFS so other operators can use them. This helps the network learn from real executions and improve itself. Turning donation off later stops future publishing, but data already published to IPFS may remain available."})]}),o.jsxs(pg,{children:[o.jsx(_g,{children:"Cancel"}),o.jsx(vg,{onClick:v,children:"Enable donation"})]})]})})]})}function UI({onRestartPending:e=()=>{}}){const t=ni(),{data:r,isLoading:n,isError:s,error:i,refetch:l}=Me({queryKey:["operator-artifacts","served"],queryFn:()=>ge.operator.listArtifacts({source:"served",limit:100}),refetchInterval:1e4}),a=C.useRef(null),c=_=>{a.current=_},u=Kn({mutationFn:_=>ge.operator.updatePricing(_),onSuccess:async()=>{a.current=null,Zs.success("Donation setting saved",{description:"Restart pending — applies on next daemon start."}),e(),await t.invalidateQueries({queryKey:["operator-artifacts"]})},onError:_=>{const v=a.current;a.current=null,v==null||v(),Zs.error("Failed to save donation setting",{description:_ instanceof Error?_.message:String(_)})}}),g=r==null?void 0:r.summary,d=g?`${g.served.totalCount} eligible runs · donation ${r!=null&&r.pricing.donation.enabled?"on":"off"} · ${g.network.totalCount} peer datasets used`:"Donate scrubbed and anonymized run data to IPFS so other operators can use it.";return o.jsxs(we,{children:[o.jsxs(cr,{className:"flex flex-row items-start justify-between gap-3",children:[o.jsxs("div",{className:"flex flex-col gap-1.5",children:[o.jsxs(Rn,{className:"flex items-center gap-2",children:[o.jsx(A2,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Data donation"]}),o.jsx(Gs,{children:d})]}),o.jsx(je,{variant:r!=null&&r.pricing.donation.enabled?"success":"outline",children:r!=null&&r.pricing.donation.enabled?"IPFS donation on":"Donation off"})]}),o.jsxs(Qe,{children:[n&&o.jsxs("div",{"data-testid":"operator-data-market-loading",className:"flex flex-col gap-3","aria-label":"Loading execution data",children:[o.jsx(Br,{className:"h-6 w-40"}),o.jsx(Br,{className:"h-4 w-72"}),o.jsx(Br,{className:"h-20 w-full"})]}),s&&o.jsxs(rt,{variant:"blocking",role:"alert","data-testid":"operator-data-market-error",className:"flex items-center justify-between gap-3",children:[o.jsx(Dt,{className:"text-[var(--break-red)]",children:i instanceof Error?i.message:"Failed to load execution data."}),o.jsxs(ae,{variant:"outline",size:"sm",type:"button",onClick:()=>{l()},children:[o.jsx(T2,{className:"h-3 w-3","aria-hidden":"true"}),"Retry"]})]}),r&&o.jsx(zI,{pricing:r.pricing,eligibleRuns:r.summary.served.totalCount,peerDatasetsUsed:r.summary.network.totalCount,saving:u.isPending,onSave:_=>u.mutate(_),registerRevert:c},`${r.pricing.publicEndpoint}|${r.pricing.defaultPriceUsdc}|${r.pricing.donation.enabled}|${JSON.stringify(rp(r.pricing.perArtifactTypePrice))}`)]})]})}const WI=h1,VI=f1,lC=C.forwardRef(({className:e,...t},r)=>o.jsx(ag,{className:X("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));lC.displayName=ag.displayName;const qI=ld("fixed z-50 gap-4 bg-card p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b border-border data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t border-border data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r border-border data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l border-border data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),cC=C.forwardRef(({side:e="right",className:t,children:r,...n},s)=>o.jsxs(VI,{children:[o.jsx(lC,{}),o.jsxs(lg,{ref:s,className:X(qI({side:e}),t),...n,children:[r,o.jsxs(dg,{className:"absolute right-4 top-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none",children:[o.jsx(Sl,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));cC.displayName=lg.displayName;const uC=({className:e,...t})=>o.jsx("div",{className:X("flex flex-col gap-2 text-left",e),...t});uC.displayName="SheetHeader";const dC=C.forwardRef(({className:e,...t},r)=>o.jsx(cg,{ref:r,className:X("font-serif text-[20px] text-foreground",e),...t}));dC.displayName=cg.displayName;const hC=C.forwardRef(({className:e,...t},r)=>o.jsx(ug,{ref:r,className:X("font-mono text-[12px] text-[var(--fg-muted)]",e),...t}));hC.displayName=ug.displayName;function Sg(e){if(!Number.isFinite(e)||e<=0)return"0 B";const t=["B","KB","MB","GB"];let r=e,n=0;for(;r>=1024&&n<t.length-1;)r/=1024,n+=1;return`${r>=10||n===0?Math.round(r):r.toFixed(1)} ${t[n]}`}function np(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString().replace("T"," ").slice(0,19)+" UTC"}function KI(e){return e.length>14?`${e.slice(0,10)}…${e.slice(-6)}`:e}function Au(e){return e.source==="served"?e.createdAt:e.fetchedAt}function Du(e){return e.source==="served"?"shared":e.paidAmountUsdc==="0"?"peer donated":"peer used"}function jx(e,t){return!e||e.kind!==t.kind?!1:e.kind==="capture"&&t.kind==="capture"?e.id===t.id:e.kind==="artifact"&&t.kind==="artifact"?e.source===t.source&&e.sha256===t.sha256:!1}function sp(e){return e?e instanceof Error?e.message:String(e):"Unknown error"}function bh(e){return/\b(401|403)\b|unauthorized|forbidden/i.test(sp(e))}function Nx({kind:e,message:t}){const r=e==="permission"?"Permission required to view execution data. Open the dashboard from the daemon handshake URL or refresh an authenticated session.":`Execution data could not be loaded${t?`: ${t}`:"."}`;return o.jsx(rt,{variant:e==="permission"?"warning":"blocking","data-testid":e==="permission"?"execution-data-permission":"execution-data-error",children:o.jsx(it,{children:r})})}function GI(e){return{id:`capture:${e.sessionId}`,selection:{kind:"capture",id:e.sessionId},title:"execution-capture.v1",state:e.status,meta:`${e.originatingTool.name} · ${e.spanCount} spans · ${e.redactedSpanCount} redacted`,at:e.capturedAt}}function QI(e){const t=Du(e);return{id:`artifact:${e.source}:${e.sha256}`,selection:{kind:"artifact",source:e.source,sha256:e.sha256},title:e.artifactType,state:t,meta:`${e.source==="served"?"produced":"peer"} · ${Sg(e.contentSize)} · ${KI(e.sha256)}`,at:Au(e)}}function YI({artifact:e}){const t=Au(e);return o.jsxs("div",{className:"flex flex-col gap-5",children:[o.jsx("header",{className:"flex items-start justify-between gap-4",children:o.jsxs("div",{className:"min-w-0",children:[o.jsx("h1",{className:"m-0 break-all font-serif text-[22px] font-normal leading-tight text-foreground",children:e.artifactType}),o.jsxs("div",{className:"mt-1.5 font-mono text-[12px] text-muted-foreground",children:[Du(e)," · ",Sg(e.contentSize)," · ",np(t)]})]})}),o.jsx(we,{children:o.jsx(Qe,{className:"p-4",children:o.jsxs("dl",{className:"m-0 grid gap-x-3.5 gap-y-2.5 [grid-template-columns:140px_minmax(0,1fr)]",children:[o.jsx("dt",{className:"font-mono text-[12px] text-muted-foreground",children:"type"}),o.jsx("dd",{className:"m-0 font-mono text-[12px] text-foreground",children:e.artifactType}),o.jsx("dt",{className:"font-mono text-[12px] text-muted-foreground",children:"state"}),o.jsx("dd",{className:"m-0 font-mono text-[12px] text-foreground",children:Du(e)}),o.jsx("dt",{className:"font-mono text-[12px] text-muted-foreground",children:"sha256"}),o.jsx("dd",{className:"m-0 break-all font-mono text-[12px] text-foreground",children:e.sha256}),o.jsx("dt",{className:"font-mono text-[12px] text-muted-foreground",children:"envelope"}),o.jsx("dd",{className:"m-0 break-all font-mono text-[12px] text-foreground",children:e.envelopeCid??"—"}),o.jsx("dt",{className:"font-mono text-[12px] text-muted-foreground",children:"recorded"}),o.jsx("dd",{className:"m-0 font-mono text-[12px] text-foreground",children:np(t)}),e.source==="served"?o.jsxs(o.Fragment,{children:[o.jsx("dt",{className:"font-mono text-[12px] text-muted-foreground",children:"request"}),o.jsx("dd",{className:"m-0 break-all font-mono text-[12px] text-foreground",children:e.requestId??"—"}),o.jsx("dt",{className:"font-mono text-[12px] text-muted-foreground",children:"accesses"}),o.jsxs("dd",{className:"m-0 font-mono text-[12px] text-foreground",children:[e.access.accessCount," total · ",e.access.failedPaymentCount," failed"]})]}):o.jsxs(o.Fragment,{children:[o.jsx("dt",{className:"font-mono text-[12px] text-muted-foreground",children:"operator"}),o.jsx("dd",{className:"m-0 break-all font-mono text-[12px] text-foreground",children:e.sourceOperator??"—"}),o.jsx("dt",{className:"font-mono text-[12px] text-muted-foreground",children:"source"}),o.jsx("dd",{className:"m-0 break-all font-mono text-[12px] text-foreground",children:e.sourceEndpoint??"—"})]})]})})})]})}function ZI(){var S,E,R,M;const e=ni(),[t,r]=C.useState(),[n,s]=C.useState(!1),i=Me({queryKey:["captures","pending"],queryFn:()=>ge.captures.listPending(),refetchInterval:2500}),l=Me({queryKey:["operator-artifacts","served","execution-data"],queryFn:()=>ge.operator.listArtifacts({source:"served",limit:100}),refetchInterval:1e4}),a=Me({queryKey:["operator-artifacts","network","execution-data"],queryFn:()=>ge.operator.listArtifacts({source:"network",limit:100}),refetchInterval:1e4}),c=((S=i.data)==null?void 0:S.captures)??[],u=[...((E=l.data)==null?void 0:E.artifacts)??[],...((R=a.data)==null?void 0:R.artifacts)??[]].sort((A,L)=>Au(L).localeCompare(Au(A))),g=[...c.map(GI),...u.map(QI)].sort((A,L)=>L.at.localeCompare(A.at)),d=(t==null?void 0:t.kind)==="capture"?t.id:void 0,_=(t==null?void 0:t.kind)==="artifact"?u.find(A=>A.source===t.source&&A.sha256===t.sha256):void 0,v=i.isLoading||l.isLoading||a.isLoading,x=[i.isError?i.error:i.failureReason,l.isError?l.error:l.failureReason,a.isError?a.error:a.failureReason].filter(Boolean),y=x.find(bh),f=y??x[0];C.useEffect(()=>{if(g.length===0){t&&r(void 0),n&&s(!1);return}(!t||!g.some(A=>jx(t,A.selection)))&&r(g[0].selection)},[g,t,n]);const p=Me({queryKey:["captures",d],queryFn:()=>ge.captures.get(d),enabled:!!d}),h=Kn({mutationFn:A=>ge.captures.approve(A),onSuccess:async()=>{await Promise.all([e.invalidateQueries({queryKey:["captures"]}),e.invalidateQueries({queryKey:["operator-artifacts"]})])}}),m=Kn({mutationFn:A=>ge.captures.skip(A),onSuccess:async()=>{await e.invalidateQueries({queryKey:["captures"]})}}),b=Kn({mutationFn:A=>ge.captures.trustRepo(A,!0)}),w=A=>{r(A),s(!0)},k=(t==null?void 0:t.kind)==="capture"?((M=p.data)==null?void 0:M.capture.sessionId)??"Capture":(_==null?void 0:_.artifactType)??"Artifact",j=(t==null?void 0:t.kind)==="capture"&&p.data?`${new Date(p.data.capture.capturedAt).toLocaleString()} · ${p.data.spans.length} spans`:(t==null?void 0:t.kind)==="artifact"&&_?`${Du(_)} · ${Sg(_.contentSize)}`:"Execution data detail.";return o.jsxs("div",{className:"flex flex-col gap-6 p-6",children:[o.jsx(UI,{defaultExpanded:!0}),o.jsxs(we,{children:[o.jsx(cr,{children:o.jsx(Rn,{children:"Execution data"})}),o.jsxs(Qe,{children:[f?o.jsx("div",{className:"mb-3",children:o.jsx(Nx,{kind:y?"permission":"error",message:y?void 0:sp(f)})}):null,v&&g.length===0?o.jsx("div",{className:"p-6 font-mono text-[12px] text-muted-foreground",children:"Loading execution data."}):g.length===0?o.jsx("div",{className:"p-6 font-mono text-[12px] text-muted-foreground",children:"No execution data yet."}):o.jsx(zl,{className:"max-h-[560px]",children:o.jsx("div",{className:"flex flex-col gap-2 pr-2",children:g.map(A=>{const L=jx(t,A.selection);return o.jsxs(ae,{variant:"ghost","data-testid":"execution-data-row","data-state":L?"active":void 0,"aria-current":L?"true":void 0,onClick:()=>w(A.selection),className:X("flex h-auto w-full flex-col items-stretch gap-1.5 rounded-md border border-border bg-card px-4 py-3 text-left font-mono text-[12px] normal-case tracking-normal hover:bg-accent",L&&"border-primary bg-primary/[0.06]"),children:[o.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o.jsx("strong",{className:"min-w-0 truncate font-medium text-foreground",children:A.title}),o.jsx(je,{variant:"outline",className:"shrink-0",children:A.state})]}),o.jsxs("div",{className:"text-[11px] text-muted-foreground",children:[A.meta," · ",np(A.at)]})]},A.id)})})})]})]}),o.jsx(WI,{open:n,onOpenChange:s,children:o.jsxs(cC,{side:"right",className:"w-full overflow-y-auto sm:max-w-xl","data-testid":"execution-data-sheet",children:[o.jsxs(uC,{children:[o.jsx(dC,{className:"break-all",children:k}),o.jsx(hC,{children:j})]}),o.jsx("div",{className:"mt-4",children:p.error?o.jsx(Nx,{kind:bh(p.error)?"permission":"error",message:bh(p.error)?void 0:sp(p.error)}):(t==null?void 0:t.kind)==="capture"&&p.data?o.jsx(LI,{detail:p.data,approving:h.isPending,skipping:m.isPending,onApprove:()=>d&&h.mutate(d),onSkip:()=>d&&m.mutate(d),onTrustRepo:()=>{const A=p.data.capture.repoRemoteUrl;A&&b.mutate(A)}}):(t==null?void 0:t.kind)==="artifact"&&_?o.jsx(YI,{artifact:_}):o.jsx("div",{className:"p-6 font-mono text-[12px] text-muted-foreground",children:v?"Loading execution data.":"Select execution data."})})]})})]})}function Rx(e){const t=XI(e),r=C.forwardRef((n,s)=>{const{children:i,...l}=n,a=C.Children.toArray(i),c=a.find(e3);if(c){const u=c.props.children,g=a.map(d=>d===c?C.Children.count(u)>1?C.Children.only(null):C.isValidElement(u)?u.props.children:null:d);return o.jsx(t,{...l,ref:s,children:C.isValidElement(u)?C.cloneElement(u,void 0,g):null})}return o.jsx(t,{...l,ref:s,children:i})});return r.displayName=`${e}.Slot`,r}function XI(e){const t=C.forwardRef((r,n)=>{const{children:s,...i}=r;if(C.isValidElement(s)){const l=r3(s),a=t3(i,s.props);return s.type!==C.Fragment&&(a.ref=n?ss(n,l):l),C.cloneElement(s,a)}return C.Children.count(s)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var JI=Symbol("radix.slottable");function e3(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===JI}function t3(e,t){const r={...t};for(const n in t){const s=e[n],i=t[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...a)=>{const c=i(...a);return s(...a),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...e,...r}}function r3(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function fC(e){const t=e+"CollectionProvider",[r,n]=fn(t),[s,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),l=y=>{const{scope:f,children:p}=y,h=Z.useRef(null),m=Z.useRef(new Map).current;return o.jsx(s,{scope:f,itemMap:m,collectionRef:h,children:p})};l.displayName=t;const a=e+"CollectionSlot",c=Rx(a),u=Z.forwardRef((y,f)=>{const{scope:p,children:h}=y,m=i(a,p),b=Be(f,m.collectionRef);return o.jsx(c,{ref:b,children:h})});u.displayName=a;const g=e+"CollectionItemSlot",d="data-radix-collection-item",_=Rx(g),v=Z.forwardRef((y,f)=>{const{scope:p,children:h,...m}=y,b=Z.useRef(null),w=Be(f,b),k=i(g,p);return Z.useEffect(()=>(k.itemMap.set(b,{ref:b,...m}),()=>void k.itemMap.delete(b))),o.jsx(_,{[d]:"",ref:w,children:h})});v.displayName=g;function x(y){const f=i(e+"CollectionConsumer",y);return Z.useCallback(()=>{const h=f.collectionRef.current;if(!h)return[];const m=Array.from(h.querySelectorAll(`[${d}]`));return Array.from(f.itemMap.values()).sort((k,j)=>m.indexOf(k.ref.current)-m.indexOf(j.ref.current))},[f.collectionRef,f.itemMap])}return[{Provider:l,Slot:u,ItemSlot:v},x,n]}var wh="rovingFocusGroup.onEntryFocus",n3={bubbles:!1,cancelable:!0},Gl="RovingFocusGroup",[ip,pC,s3]=fC(Gl),[i3,mC]=fn(Gl,[s3]),[o3,a3]=i3(Gl),gC=C.forwardRef((e,t)=>o.jsx(ip.Provider,{scope:e.__scopeRovingFocusGroup,children:o.jsx(ip.Slot,{scope:e.__scopeRovingFocusGroup,children:o.jsx(l3,{...e,ref:t})})}));gC.displayName=Gl;var l3=C.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:s=!1,dir:i,currentTabStopId:l,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:g=!1,...d}=e,_=C.useRef(null),v=Be(t,_),x=Tm(i),[y,f]=va({prop:l,defaultProp:a??null,onChange:c,caller:Gl}),[p,h]=C.useState(!1),m=Ht(u),b=pC(r),w=C.useRef(!1),[k,j]=C.useState(0);return C.useEffect(()=>{const S=_.current;if(S)return S.addEventListener(wh,m),()=>S.removeEventListener(wh,m)},[m]),o.jsx(o3,{scope:r,orientation:n,dir:x,loop:s,currentTabStopId:y,onItemFocus:C.useCallback(S=>f(S),[f]),onItemShiftTab:C.useCallback(()=>h(!0),[]),onFocusableItemAdd:C.useCallback(()=>j(S=>S+1),[]),onFocusableItemRemove:C.useCallback(()=>j(S=>S-1),[]),children:o.jsx($e.div,{tabIndex:p||k===0?-1:0,"data-orientation":n,...d,ref:v,style:{outline:"none",...e.style},onMouseDown:_e(e.onMouseDown,()=>{w.current=!0}),onFocus:_e(e.onFocus,S=>{const E=!w.current;if(S.target===S.currentTarget&&E&&!p){const R=new CustomEvent(wh,n3);if(S.currentTarget.dispatchEvent(R),!R.defaultPrevented){const M=b().filter(W=>W.focusable),A=M.find(W=>W.active),L=M.find(W=>W.id===y),U=[A,L,...M].filter(Boolean).map(W=>W.ref.current);xC(U,g)}}w.current=!1}),onBlur:_e(e.onBlur,()=>h(!1))})})}),vC="RovingFocusGroupItem",_C=C.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:s=!1,tabStopId:i,children:l,...a}=e,c=Us(),u=i||c,g=a3(vC,r),d=g.currentTabStopId===u,_=pC(r),{onFocusableItemAdd:v,onFocusableItemRemove:x,currentTabStopId:y}=g;return C.useEffect(()=>{if(n)return v(),()=>x()},[n,v,x]),o.jsx(ip.ItemSlot,{scope:r,id:u,focusable:n,active:s,children:o.jsx($e.span,{tabIndex:d?0:-1,"data-orientation":g.orientation,...a,ref:t,onMouseDown:_e(e.onMouseDown,f=>{n?g.onItemFocus(u):f.preventDefault()}),onFocus:_e(e.onFocus,()=>g.onItemFocus(u)),onKeyDown:_e(e.onKeyDown,f=>{if(f.key==="Tab"&&f.shiftKey){g.onItemShiftTab();return}if(f.target!==f.currentTarget)return;const p=d3(f,g.orientation,g.dir);if(p!==void 0){if(f.metaKey||f.ctrlKey||f.altKey||f.shiftKey)return;f.preventDefault();let m=_().filter(b=>b.focusable).map(b=>b.ref.current);if(p==="last")m.reverse();else if(p==="prev"||p==="next"){p==="prev"&&m.reverse();const b=m.indexOf(f.currentTarget);m=g.loop?h3(m,b+1):m.slice(b+1)}setTimeout(()=>xC(m))}}),children:typeof l=="function"?l({isCurrentTabStop:d,hasTabStop:y!=null}):l})})});_C.displayName=vC;var c3={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function u3(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function d3(e,t,r){const n=u3(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return c3[n]}function xC(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function h3(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var f3=gC,p3=_C;function m3(e){const t=g3(e),r=C.forwardRef((n,s)=>{const{children:i,...l}=n,a=C.Children.toArray(i),c=a.find(_3);if(c){const u=c.props.children,g=a.map(d=>d===c?C.Children.count(u)>1?C.Children.only(null):C.isValidElement(u)?u.props.children:null:d);return o.jsx(t,{...l,ref:s,children:C.isValidElement(u)?C.cloneElement(u,void 0,g):null})}return o.jsx(t,{...l,ref:s,children:i})});return r.displayName=`${e}.Slot`,r}function g3(e){const t=C.forwardRef((r,n)=>{const{children:s,...i}=r;if(C.isValidElement(s)){const l=y3(s),a=x3(i,s.props);return s.type!==C.Fragment&&(a.ref=n?ss(n,l):l),C.cloneElement(s,a)}return C.Children.count(s)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var v3=Symbol("radix.slottable");function _3(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===v3}function x3(e,t){const r={...t};for(const n in t){const s=e[n],i=t[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...a)=>{const c=i(...a);return s(...a),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...e,...r}}function y3(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var op=["Enter"," "],b3=["ArrowDown","PageUp","Home"],yC=["ArrowUp","PageDown","End"],w3=[...b3,...yC],S3={ltr:[...op,"ArrowRight"],rtl:[...op,"ArrowLeft"]},C3={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ql="Menu",[El,k3,E3]=fC(Ql),[qi,bC]=fn(Ql,[E3,ga,mC]),kd=ga(),wC=mC(),[j3,Ki]=qi(Ql),[N3,Yl]=qi(Ql),SC=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:s,onOpenChange:i,modal:l=!0}=e,a=kd(t),[c,u]=C.useState(null),g=C.useRef(!1),d=Ht(i),_=Tm(s);return C.useEffect(()=>{const v=()=>{g.current=!0,document.addEventListener("pointerdown",x,{capture:!0,once:!0}),document.addEventListener("pointermove",x,{capture:!0,once:!0})},x=()=>g.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",x,{capture:!0}),document.removeEventListener("pointermove",x,{capture:!0})}},[]),o.jsx(Gm,{...a,children:o.jsx(j3,{scope:t,open:r,onOpenChange:d,content:c,onContentChange:u,children:o.jsx(N3,{scope:t,onClose:C.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:g,dir:_,modal:l,children:n})})})};SC.displayName=Ql;var R3="MenuAnchor",Cg=C.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,s=kd(r);return o.jsx(md,{...s,...n,ref:t})});Cg.displayName=R3;var kg="MenuPortal",[P3,CC]=qi(kg,{forceMount:void 0}),kC=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:s}=e,i=Ki(kg,t);return o.jsx(P3,{scope:t,forceMount:r,children:o.jsx(Wt,{present:r||i.open,children:o.jsx(Vl,{asChild:!0,container:s,children:n})})})};kC.displayName=kg;var $r="MenuContent",[T3,Eg]=qi($r),EC=C.forwardRef((e,t)=>{const r=CC($r,e.__scopeMenu),{forceMount:n=r.forceMount,...s}=e,i=Ki($r,e.__scopeMenu),l=Yl($r,e.__scopeMenu);return o.jsx(El.Provider,{scope:e.__scopeMenu,children:o.jsx(Wt,{present:n||i.open,children:o.jsx(El.Slot,{scope:e.__scopeMenu,children:l.modal?o.jsx(A3,{...s,ref:t}):o.jsx(D3,{...s,ref:t})})})})}),A3=C.forwardRef((e,t)=>{const r=Ki($r,e.__scopeMenu),n=C.useRef(null),s=Be(t,n);return C.useEffect(()=>{const i=n.current;if(i)return ng(i)},[]),o.jsx(jg,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:_e(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),D3=C.forwardRef((e,t)=>{const r=Ki($r,e.__scopeMenu);return o.jsx(jg,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),L3=m3("MenuContent.ScrollLock"),jg=C.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:l,disableOutsidePointerEvents:a,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:g,onFocusOutside:d,onInteractOutside:_,onDismiss:v,disableOutsideScroll:x,...y}=e,f=Ki($r,r),p=Yl($r,r),h=kd(r),m=wC(r),b=k3(r),[w,k]=C.useState(null),j=C.useRef(null),S=Be(t,j,f.onContentChange),E=C.useRef(0),R=C.useRef(""),M=C.useRef(0),A=C.useRef(null),L=C.useRef("right"),B=C.useRef(0),U=x?yd:C.Fragment,W=x?{as:L3,allowPinchZoom:!0}:void 0,q=T=>{var P,z;const D=R.current+T,O=b().filter(G=>!G.disabled),$=document.activeElement,Y=(P=O.find(G=>G.ref.current===$))==null?void 0:P.textValue,J=O.map(G=>G.textValue),re=q3(J,D,Y),ye=(z=O.find(G=>G.textValue===re))==null?void 0:z.ref.current;(function G(K){R.current=K,window.clearTimeout(E.current),K!==""&&(E.current=window.setTimeout(()=>G(""),1e3))})(D),ye&&setTimeout(()=>ye.focus())};C.useEffect(()=>()=>window.clearTimeout(E.current),[]),rg();const N=C.useCallback(T=>{var O,$;return L.current===((O=A.current)==null?void 0:O.side)&&G3(T,($=A.current)==null?void 0:$.area)},[]);return o.jsx(T3,{scope:r,searchRef:R,onItemEnter:C.useCallback(T=>{N(T)&&T.preventDefault()},[N]),onItemLeave:C.useCallback(T=>{var D;N(T)||((D=j.current)==null||D.focus(),k(null))},[N]),onTriggerLeave:C.useCallback(T=>{N(T)&&T.preventDefault()},[N]),pointerGraceTimerRef:M,onPointerGraceIntentChange:C.useCallback(T=>{A.current=T},[]),children:o.jsx(U,{...W,children:o.jsx(_d,{asChild:!0,trapped:s,onMountAutoFocus:_e(i,T=>{var D;T.preventDefault(),(D=j.current)==null||D.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:o.jsx(Ul,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:g,onFocusOutside:d,onInteractOutside:_,onDismiss:v,children:o.jsx(f3,{asChild:!0,...m,dir:p.dir,orientation:"vertical",loop:n,currentTabStopId:w,onCurrentTabStopIdChange:k,onEntryFocus:_e(c,T=>{p.isUsingKeyboardRef.current||T.preventDefault()}),preventScrollOnEntryFocus:!0,children:o.jsx(Qm,{role:"menu","aria-orientation":"vertical","data-state":zC(f.open),"data-radix-menu-content":"",dir:p.dir,...h,...y,ref:S,style:{outline:"none",...y.style},onKeyDown:_e(y.onKeyDown,T=>{const O=T.target.closest("[data-radix-menu-content]")===T.currentTarget,$=T.ctrlKey||T.altKey||T.metaKey,Y=T.key.length===1;O&&(T.key==="Tab"&&T.preventDefault(),!$&&Y&&q(T.key));const J=j.current;if(T.target!==J||!w3.includes(T.key))return;T.preventDefault();const ye=b().filter(P=>!P.disabled).map(P=>P.ref.current);yC.includes(T.key)&&ye.reverse(),W3(ye)}),onBlur:_e(e.onBlur,T=>{T.currentTarget.contains(T.target)||(window.clearTimeout(E.current),R.current="")}),onPointerMove:_e(e.onPointerMove,jl(T=>{const D=T.target,O=B.current!==T.clientX;if(T.currentTarget.contains(D)&&O){const $=T.clientX>B.current?"right":"left";L.current=$,B.current=T.clientX}}))})})})})})})});EC.displayName=$r;var M3="MenuGroup",Ng=C.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return o.jsx($e.div,{role:"group",...n,ref:t})});Ng.displayName=M3;var O3="MenuLabel",jC=C.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return o.jsx($e.div,{...n,ref:t})});jC.displayName=O3;var Lu="MenuItem",Px="menu.itemSelect",Ed=C.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...s}=e,i=C.useRef(null),l=Yl(Lu,e.__scopeMenu),a=Eg(Lu,e.__scopeMenu),c=Be(t,i),u=C.useRef(!1),g=()=>{const d=i.current;if(!r&&d){const _=new CustomEvent(Px,{bubbles:!0,cancelable:!0});d.addEventListener(Px,v=>n==null?void 0:n(v),{once:!0}),kw(d,_),_.defaultPrevented?u.current=!1:l.onClose()}};return o.jsx(NC,{...s,ref:c,disabled:r,onClick:_e(e.onClick,g),onPointerDown:d=>{var _;(_=e.onPointerDown)==null||_.call(e,d),u.current=!0},onPointerUp:_e(e.onPointerUp,d=>{var _;u.current||(_=d.currentTarget)==null||_.click()}),onKeyDown:_e(e.onKeyDown,d=>{const _=a.searchRef.current!=="";r||_&&d.key===" "||op.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Ed.displayName=Lu;var NC=C.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:s,...i}=e,l=Eg(Lu,r),a=wC(r),c=C.useRef(null),u=Be(t,c),[g,d]=C.useState(!1),[_,v]=C.useState("");return C.useEffect(()=>{const x=c.current;x&&v((x.textContent??"").trim())},[i.children]),o.jsx(El.ItemSlot,{scope:r,disabled:n,textValue:s??_,children:o.jsx(p3,{asChild:!0,...a,focusable:!n,children:o.jsx($e.div,{role:"menuitem","data-highlighted":g?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...i,ref:u,onPointerMove:_e(e.onPointerMove,jl(x=>{n?l.onItemLeave(x):(l.onItemEnter(x),x.defaultPrevented||x.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:_e(e.onPointerLeave,jl(x=>l.onItemLeave(x))),onFocus:_e(e.onFocus,()=>d(!0)),onBlur:_e(e.onBlur,()=>d(!1))})})})}),I3="MenuCheckboxItem",RC=C.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:n,...s}=e;return o.jsx(LC,{scope:e.__scopeMenu,checked:r,children:o.jsx(Ed,{role:"menuitemcheckbox","aria-checked":Mu(r)?"mixed":r,...s,ref:t,"data-state":Pg(r),onSelect:_e(s.onSelect,()=>n==null?void 0:n(Mu(r)?!0:!r),{checkForDefaultPrevented:!1})})})});RC.displayName=I3;var PC="MenuRadioGroup",[F3,B3]=qi(PC,{value:void 0,onValueChange:()=>{}}),TC=C.forwardRef((e,t)=>{const{value:r,onValueChange:n,...s}=e,i=Ht(n);return o.jsx(F3,{scope:e.__scopeMenu,value:r,onValueChange:i,children:o.jsx(Ng,{...s,ref:t})})});TC.displayName=PC;var AC="MenuRadioItem",DC=C.forwardRef((e,t)=>{const{value:r,...n}=e,s=B3(AC,e.__scopeMenu),i=r===s.value;return o.jsx(LC,{scope:e.__scopeMenu,checked:i,children:o.jsx(Ed,{role:"menuitemradio","aria-checked":i,...n,ref:t,"data-state":Pg(i),onSelect:_e(n.onSelect,()=>{var l;return(l=s.onValueChange)==null?void 0:l.call(s,r)},{checkForDefaultPrevented:!1})})})});DC.displayName=AC;var Rg="MenuItemIndicator",[LC,$3]=qi(Rg,{checked:!1}),MC=C.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:n,...s}=e,i=$3(Rg,r);return o.jsx(Wt,{present:n||Mu(i.checked)||i.checked===!0,children:o.jsx($e.span,{...s,ref:t,"data-state":Pg(i.checked)})})});MC.displayName=Rg;var H3="MenuSeparator",OC=C.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return o.jsx($e.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});OC.displayName=H3;var z3="MenuArrow",IC=C.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,s=kd(r);return o.jsx(Ym,{...s,...n,ref:t})});IC.displayName=z3;var U3="MenuSub",[SF,FC]=qi(U3),Va="MenuSubTrigger",BC=C.forwardRef((e,t)=>{const r=Ki(Va,e.__scopeMenu),n=Yl(Va,e.__scopeMenu),s=FC(Va,e.__scopeMenu),i=Eg(Va,e.__scopeMenu),l=C.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:c}=i,u={__scopeMenu:e.__scopeMenu},g=C.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return C.useEffect(()=>g,[g]),C.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),c(null)}},[a,c]),o.jsx(Cg,{asChild:!0,...u,children:o.jsx(NC,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":s.contentId,"data-state":zC(r.open),...e,ref:ss(t,s.onTriggerChange),onClick:d=>{var _;(_=e.onClick)==null||_.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:_e(e.onPointerMove,jl(d=>{i.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!r.open&&!l.current&&(i.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{r.onOpenChange(!0),g()},100))})),onPointerLeave:_e(e.onPointerLeave,jl(d=>{var v,x;g();const _=(v=r.content)==null?void 0:v.getBoundingClientRect();if(_){const y=(x=r.content)==null?void 0:x.dataset.side,f=y==="right",p=f?-5:5,h=_[f?"left":"right"],m=_[f?"right":"left"];i.onPointerGraceIntentChange({area:[{x:d.clientX+p,y:d.clientY},{x:h,y:_.top},{x:m,y:_.top},{x:m,y:_.bottom},{x:h,y:_.bottom}],side:y}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(d),d.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:_e(e.onKeyDown,d=>{var v;const _=i.searchRef.current!=="";e.disabled||_&&d.key===" "||S3[n.dir].includes(d.key)&&(r.onOpenChange(!0),(v=r.content)==null||v.focus(),d.preventDefault())})})})});BC.displayName=Va;var $C="MenuSubContent",HC=C.forwardRef((e,t)=>{const r=CC($r,e.__scopeMenu),{forceMount:n=r.forceMount,...s}=e,i=Ki($r,e.__scopeMenu),l=Yl($r,e.__scopeMenu),a=FC($C,e.__scopeMenu),c=C.useRef(null),u=Be(t,c);return o.jsx(El.Provider,{scope:e.__scopeMenu,children:o.jsx(Wt,{present:n||i.open,children:o.jsx(El.Slot,{scope:e.__scopeMenu,children:o.jsx(jg,{id:a.contentId,"aria-labelledby":a.triggerId,...s,ref:u,align:"start",side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:g=>{var d;l.isUsingKeyboardRef.current&&((d=c.current)==null||d.focus()),g.preventDefault()},onCloseAutoFocus:g=>g.preventDefault(),onFocusOutside:_e(e.onFocusOutside,g=>{g.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:_e(e.onEscapeKeyDown,g=>{l.onClose(),g.preventDefault()}),onKeyDown:_e(e.onKeyDown,g=>{var v;const d=g.currentTarget.contains(g.target),_=C3[l.dir].includes(g.key);d&&_&&(i.onOpenChange(!1),(v=a.trigger)==null||v.focus(),g.preventDefault())})})})})})});HC.displayName=$C;function zC(e){return e?"open":"closed"}function Mu(e){return e==="indeterminate"}function Pg(e){return Mu(e)?"indeterminate":e?"checked":"unchecked"}function W3(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function V3(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function q3(e,t,r){const s=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let l=V3(e,Math.max(i,0));s.length===1&&(l=l.filter(u=>u!==r));const c=l.find(u=>u.toLowerCase().startsWith(s.toLowerCase()));return c!==r?c:void 0}function K3(e,t){const{x:r,y:n}=e;let s=!1;for(let i=0,l=t.length-1;i<t.length;l=i++){const a=t[i],c=t[l],u=a.x,g=a.y,d=c.x,_=c.y;g>n!=_>n&&r<(d-u)*(n-g)/(_-g)+u&&(s=!s)}return s}function G3(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return K3(r,t)}function jl(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Q3=SC,Y3=Cg,Z3=kC,X3=EC,J3=Ng,e5=jC,t5=Ed,r5=RC,n5=TC,s5=DC,i5=MC,o5=OC,a5=IC,l5=BC,c5=HC,jd="DropdownMenu",[u5]=fn(jd,[bC]),Xt=bC(),[d5,UC]=u5(jd),WC=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:s,defaultOpen:i,onOpenChange:l,modal:a=!0}=e,c=Xt(t),u=C.useRef(null),[g,d]=va({prop:s,defaultProp:i??!1,onChange:l,caller:jd});return o.jsx(d5,{scope:t,triggerId:Us(),triggerRef:u,contentId:Us(),open:g,onOpenChange:d,onOpenToggle:C.useCallback(()=>d(_=>!_),[d]),modal:a,children:o.jsx(Q3,{...c,open:g,onOpenChange:d,dir:n,modal:a,children:r})})};WC.displayName=jd;var VC="DropdownMenuTrigger",qC=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...s}=e,i=UC(VC,r),l=Xt(r);return o.jsx(Y3,{asChild:!0,...l,children:o.jsx($e.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...s,ref:ss(t,i.triggerRef),onPointerDown:_e(e.onPointerDown,a=>{!n&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:_e(e.onKeyDown,a=>{n||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});qC.displayName=VC;var h5="DropdownMenuPortal",KC=e=>{const{__scopeDropdownMenu:t,...r}=e,n=Xt(t);return o.jsx(Z3,{...n,...r})};KC.displayName=h5;var GC="DropdownMenuContent",QC=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=UC(GC,r),i=Xt(r),l=C.useRef(!1);return o.jsx(X3,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...n,ref:t,onCloseAutoFocus:_e(e.onCloseAutoFocus,a=>{var c;l.current||(c=s.triggerRef.current)==null||c.focus(),l.current=!1,a.preventDefault()}),onInteractOutside:_e(e.onInteractOutside,a=>{const c=a.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,g=c.button===2||u;(!s.modal||g)&&(l.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});QC.displayName=GC;var f5="DropdownMenuGroup",p5=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Xt(r);return o.jsx(J3,{...s,...n,ref:t})});p5.displayName=f5;var m5="DropdownMenuLabel",YC=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Xt(r);return o.jsx(e5,{...s,...n,ref:t})});YC.displayName=m5;var g5="DropdownMenuItem",ZC=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Xt(r);return o.jsx(t5,{...s,...n,ref:t})});ZC.displayName=g5;var v5="DropdownMenuCheckboxItem",XC=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Xt(r);return o.jsx(r5,{...s,...n,ref:t})});XC.displayName=v5;var _5="DropdownMenuRadioGroup",x5=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Xt(r);return o.jsx(n5,{...s,...n,ref:t})});x5.displayName=_5;var y5="DropdownMenuRadioItem",b5=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Xt(r);return o.jsx(s5,{...s,...n,ref:t})});b5.displayName=y5;var w5="DropdownMenuItemIndicator",JC=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Xt(r);return o.jsx(i5,{...s,...n,ref:t})});JC.displayName=w5;var S5="DropdownMenuSeparator",ek=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Xt(r);return o.jsx(o5,{...s,...n,ref:t})});ek.displayName=S5;var C5="DropdownMenuArrow",k5=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Xt(r);return o.jsx(a5,{...s,...n,ref:t})});k5.displayName=C5;var E5="DropdownMenuSubTrigger",j5=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Xt(r);return o.jsx(l5,{...s,...n,ref:t})});j5.displayName=E5;var N5="DropdownMenuSubContent",R5=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Xt(r);return o.jsx(c5,{...s,...n,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});R5.displayName=N5;var P5=WC,T5=qC,A5=KC,tk=QC,rk=YC,nk=ZC,sk=XC,D5=JC,ik=ek;const L5=P5,M5=T5,ok=C.forwardRef(({className:e,sideOffset:t=4,...r},n)=>o.jsx(A5,{children:o.jsx(tk,{ref:n,sideOffset:t,className:X("z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",e),...r})}));ok.displayName=tk.displayName;const ak=C.forwardRef(({className:e,inset:t,...r},n)=>o.jsx(nk,{ref:n,className:X("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 font-mono text-[12px] outline-none transition-colors focus:bg-[var(--bg-sunken)] focus:text-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...r}));ak.displayName=nk.displayName;const O5=C.forwardRef(({className:e,children:t,checked:r,...n},s)=>o.jsxs(sk,{ref:s,className:X("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 font-mono text-[12px] outline-none focus:bg-[var(--bg-sunken)] data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...n,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(D5,{children:o.jsx(y2,{className:"h-3 w-3"})})}),t]}));O5.displayName=sk.displayName;const I5=C.forwardRef(({className:e,inset:t,...r},n)=>o.jsx(rk,{ref:n,className:X("px-2 py-1.5 font-mono text-[10px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",t&&"pl-8",e),...r}));I5.displayName=rk.displayName;const F5=C.forwardRef(({className:e,...t},r)=>o.jsx(ik,{ref:r,className:X("-mx-1 my-1 h-px bg-border",e),...t}));F5.displayName=ik.displayName;const Tx=[{to:"/operator/memberships",label:"Memberships"},{to:"/operator/registry",label:"Registry"},{to:"/operator/execution-data",label:"Execution data"},{to:"/operator/network",label:"Network"},{to:"/operator/security",label:"Security"}];function B5({to:e,label:t}){const[r]=u2(e);return o.jsx("li",{children:o.jsx(lr,{href:e,"aria-current":r?"page":void 0,className:X("block rounded-sm px-3 py-2 font-mono text-[12px] tracking-[0.08em] no-underline transition-colors",r?"bg-[var(--bg-elevated)] font-medium text-foreground":"bg-transparent font-normal text-[var(--fg-muted)] hover:text-foreground"),children:t})})}function $5(){const[,e]=hn();return o.jsxs("nav",{"aria-label":"Operator sections","data-testid":"operator-sub-nav",className:"flex min-w-[160px] flex-col pt-1",children:[o.jsx("div",{className:"mb-2 sm:hidden",children:o.jsxs(L5,{children:[o.jsx(M5,{asChild:!0,children:o.jsxs(ae,{variant:"outline",size:"sm","data-testid":"operator-sub-nav-trigger",children:[o.jsx(j2,{className:"h-3.5 w-3.5"})," Sections"]})}),o.jsx(ok,{align:"start",children:Tx.map(t=>o.jsx(ak,{onSelect:()=>e(t.to),children:t.label},t.to))})]})}),o.jsx("ul",{className:"m-0 flex list-none flex-col gap-0.5 p-0",children:Tx.map(t=>o.jsx(B5,{to:t.to,label:t.label},t.to))})]})}function Oa({children:e}){return o.jsxs("div",{"data-testid":"operator-shell",className:"flex items-start gap-6 p-6",children:[o.jsx($5,{}),o.jsx("div",{className:"min-w-0 flex-1",children:e})]})}function Sh(e){const t=Ur(e.harness);return{harness:t,plugins:e.plugins??[],disabledDefaultPlugins:e.disabledDefaultPlugins??[],model:e.model??Ao(t)}}function Ax(e,t){const r=Ur(t.harness);if(e.harness!==r||e.model!==(t.model??Ao(r)))return!0;const n=[...e.plugins].sort(),s=[...t.plugins??[]].sort();if(n.length!==s.length)return!0;for(let a=0;a<n.length;a+=1)if(n[a]!==s[a])return!0;const i=[...e.disabledDefaultPlugins].sort(),l=[...t.disabledDefaultPlugins??[]].sort();if(i.length!==l.length)return!0;for(let a=0;a<i.length;a+=1)if(i[a]!==l[a])return!0;return!1}const Dx="flex h-9 w-full rounded-sm border border-border bg-sunken px-2.5 py-1 font-mono text-[13px] text-foreground transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50";function H5({joined:e,catalogEntry:t,defaultExpanded:r=!1,focusOn:n,onRestartPending:s}){const[i,l]=C.useState(r),[a,c]=C.useState(()=>Sh(e)),u=C.useRef(null),g=C.useRef(null),d=ni(),_=t!==void 0,v=Me({queryKey:["solvernets","manifest",e.manifestCid],queryFn:()=>ge.solvernets.getManifest(e.manifestCid),enabled:!_&&!!e.manifestCid,staleTime:1/0,retry:!1}),x=Me({queryKey:["solvernets","catalog"],queryFn:()=>ge.getSolverNets(),enabled:!_}),f=(()=>{var Y;if(_)return t;const $=(Y=v.data)==null?void 0:Y.manifest;if(!(!$||!x.data))return x.data.nets.find(J=>J.contract.id===$.contract.id&&J.contract.version===$.contract.version)})(),p=e.contract??(f==null?void 0:f.contract),h=!_&&(v.isLoading||x.isLoading),m=!_&&v.isError&&!v.isLoading;C.useEffect(()=>{Ax(a,e)||c(Sh(e))},[e.harness,e.model,JSON.stringify(e.plugins??[]),JSON.stringify(e.disabledDefaultPlugins??[])]),C.useEffect(()=>{r&&(l(!0),n==="harness"&&setTimeout(()=>{var $,Y;($=u.current)==null||$.scrollIntoView({block:"center",behavior:"smooth"}),(Y=g.current)==null||Y.focus()},50))},[r,n]);const b=((f==null?void 0:f.compatibleHarnesses)??[]).filter($=>$.supportsRoles.includes("solving")).map($=>({...$,name:Ur($.name)})).filter(($,Y,J)=>J.findIndex(re=>re.name===$.name)===Y),w=new Set(b.map($=>$.name)),k=a.harness!==""&&b.length>0&&![...w].some($=>$D($,a.harness)),j=f?`${f.contract.id}@${f.contract.version}`:"",S=wd(a.harness),E=Kn({mutationFn:()=>ge.operator.join(e.manifestCid,{...e.name!==void 0?{name:e.name}:{},...p!==void 0?{contract:{id:p.id,version:p.version}}:{},roles:e.roles,...a.harness?{harness:a.harness}:{},plugins:a.plugins,disabledDefaultPlugins:a.disabledDefaultPlugins,...a.model?{model:a.model}:{}}),onSuccess:$=>{d.invalidateQueries({queryKey:["operator","joined"]}),$.restartRequired&&(s==null||s())}}),[R,M]=C.useState(!1),A=e.roles.includes("solver"),L=J1(A?a.harness:void 0,A?a.model:void 0),B=A&&L.requiresConfirmation,U=B&&!R,[W,q]=C.useState(!1),N=Kn({mutationFn:()=>ge.operator.leave(e.manifestCid),onSuccess:$=>{d.invalidateQueries({queryKey:["operator","joined"]}),$.restartRequired&&(s==null||s()),q(!1)}}),T=Ax(a,e),D=e.name??e.manifestCid,O=`${e.manifestCid.slice(0,8)}…${e.manifestCid.slice(-4)}`;return o.jsxs("article",{"data-testid":"joined-net-card","data-manifest-cid":e.manifestCid,"data-expanded":i?"true":"false",className:"flex flex-col gap-2.5 rounded-md border border-border bg-background px-4 py-3.5",children:[o.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_auto] items-start gap-3",children:[o.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[o.jsx("span",{"data-testid":"joined-net-card-name",className:"truncate font-serif text-[20px] leading-tight text-foreground tracking-[-0.01em]",children:D}),o.jsxs("div",{className:"flex flex-wrap gap-2 font-mono text-[11px] text-muted-foreground",children:[e.roles.map($=>o.jsx(z5,{label:$},$)),o.jsxs("span",{className:"text-dim",children:["cid ",O]})]})]}),m?o.jsx("div",{className:"flex flex-col items-end gap-1.5",children:W?o.jsxs("div",{className:"flex gap-1.5",children:[o.jsx(ae,{type:"button",variant:"secondary",size:"sm","data-testid":"joined-net-card-leave-cancel",disabled:N.isPending,onClick:()=>q(!1),children:"Cancel"}),o.jsx(ae,{type:"button",variant:"destructive",size:"sm","data-testid":"joined-net-card-leave-confirm",disabled:N.isPending,onClick:()=>N.mutate(),children:N.isPending?"Leaving…":"Confirm leave"})]}):o.jsxs(ae,{type:"button",variant:"destructive",size:"sm","data-testid":"joined-net-card-leave",onClick:()=>q(!0),children:[o.jsx(Sl,{"aria-hidden":"true",className:"!size-3"}),"Leave"]})}):o.jsx(ae,{type:"button",variant:"secondary",size:"sm","data-testid":"joined-net-card-toggle",onClick:()=>l($=>!$),children:i?o.jsxs(o.Fragment,{children:[o.jsx(Em,{"aria-hidden":"true",className:"!size-3.5"}),"Close"]}):o.jsxs(o.Fragment,{children:[o.jsx(fw,{"aria-hidden":"true",className:"!size-3.5"}),"Edit"]})})]}),m&&o.jsxs("div",{"data-testid":"joined-net-card-orphaned",className:"rounded-sm border border-wane bg-transparent px-3.5 py-2.5 font-mono text-[12px] leading-relaxed text-muted-foreground",children:[o.jsx(je,{variant:"pill",className:"mr-2 align-baseline",children:"Retired"}),"Manifest no longer in the registry. This SolverNet is not claiming on-chain anymore — leaving it removes the entry from your config. Restart the daemon afterwards so it stops looking for this manifest at startup.",N.isError&&o.jsx("div",{role:"alert",className:"mt-1.5 text-[11px] text-destructive",children:N.error instanceof Error?N.error.message:"Leave failed."})]}),!i&&!m&&o.jsx(Lx,{harness:e.harness,plugins:e.plugins,model:e.model,harnessWarning:k?`does not support ${j}`:null,warningTestId:"joined-net-card-warn-collapsed"}),m&&o.jsx(Lx,{harness:e.harness,plugins:e.plugins,model:e.model,harnessWarning:null}),i&&!m&&o.jsxs("div",{"data-testid":"joined-net-card-form",className:"flex flex-col gap-3.5 border-t border-border pt-3",children:[o.jsxs("div",{ref:u,className:"flex flex-col gap-1.5",children:[o.jsx(wr,{htmlFor:"joined-net-card-harness-select",children:"Harness"}),o.jsxs("select",{ref:g,id:"joined-net-card-harness-select","aria-label":"Harness implementation","data-testid":"joined-net-card-harness-select",value:a.harness,onChange:$=>{const Y=$.target.value;c(J=>({...J,harness:Y,model:Ao(Y)})),M(!1)},className:X(Dx,k&&"border-destructive"),children:[a.harness===""&&o.jsx("option",{value:"",children:"—"}),b.map($=>o.jsx("option",{value:$.name,children:AS($.name,$.version)},$.name)),a.harness&&b.length>0&&!w.has(a.harness)&&o.jsxs("option",{value:a.harness,children:[Ws(a.harness)," (incompatible)"]}),a.harness&&b.length===0&&o.jsx("option",{value:a.harness,children:Ws(a.harness)})]}),k&&o.jsxs("span",{"data-testid":"joined-net-card-warn-expanded",className:"font-mono text-[11px] leading-relaxed text-destructive",children:["⚠ This harness does not support ",o.jsx("span",{className:"text-foreground",children:j}),".",b.length>0&&o.jsxs(o.Fragment,{children:[" Compatible: ",b.map(($,Y)=>o.jsxs("span",{className:"text-primary",children:[Ws($.name),Y<b.length-1?" · ":""]},$.name))]})]})]}),o.jsxs("div",{className:"flex flex-col gap-1.5",children:[o.jsx(wr,{children:"Plugins"}),h?o.jsx("span",{"data-testid":"joined-net-card-catalog-loading",className:"font-mono text-[12px] text-dim",children:"Loading registry catalog…"}):f?(f.compatiblePlugins??[]).length===0?o.jsx(tp,{available:[],selected:a.plugins,disabledDefaultPlugins:a.disabledDefaultPlugins,onChange:($,Y)=>c(J=>({...J,plugins:$,disabledDefaultPlugins:Y})),rowTestId:"joined-net-card-plugin-row",searchTestId:"joined-net-card-plugin-search",harness:a.harness}):o.jsx(tp,{available:(f==null?void 0:f.compatiblePlugins)??[],selected:a.plugins,disabledDefaultPlugins:a.disabledDefaultPlugins,onChange:($,Y)=>c(J=>({...J,plugins:$,disabledDefaultPlugins:Y})),rowTestId:"joined-net-card-plugin-row",searchTestId:"joined-net-card-plugin-search",harness:a.harness}):o.jsx("span",{"data-testid":"joined-net-card-catalog-missing",className:"font-mono text-[12px] italic text-dim",children:"Registry catalog has no template for this SolverNet's contract — plugins can't be verified."})]}),o.jsxs("div",{className:"flex flex-col gap-1.5",children:[o.jsx(wr,{htmlFor:"joined-net-card-model-select",children:"Model"}),o.jsxs("select",{id:"joined-net-card-model-select","aria-label":"Model","data-testid":"joined-net-card-model-select",value:a.model,onChange:$=>{c({...a,model:$.target.value}),M(!1)},className:Dx,children:[S.map($=>o.jsx("option",{value:$.id,children:$.label},$.id)),(()=>{const $=xg(a.model,a.harness);return $.isCustom?o.jsx("option",{value:a.model,children:$.label},a.model):null})()]})]}),A&&o.jsx(eC,{harness:a.harness,modelId:a.model,variant:"inline",testIdPrefix:"joined-net-card-cost"}),B&&o.jsxs("label",{"data-testid":"joined-net-card-cost-confirmation","data-cost-confirmation-checked":R?"true":"false",className:"flex cursor-pointer items-start gap-2 rounded-md border border-destructive bg-background px-3 py-2.5 font-mono text-[12px] text-foreground",children:[o.jsx("input",{type:"checkbox","data-testid":"joined-net-card-cost-confirmation-checkbox",checked:R,onChange:$=>M($.target.checked),className:"mt-0.5 size-3.5 accent-destructive","aria-label":"I understand the per-task cost and have a budget for this"}),o.jsx("span",{children:"I understand — I have a budget for this. The selected model is estimated above $1/task on my own provider key."})]}),E.isError&&o.jsx("span",{role:"alert","data-testid":"joined-net-card-error",className:"font-mono text-[12px] text-destructive",children:E.error instanceof Error?E.error.message:"Save failed."}),o.jsx(Ge,{}),o.jsxs("div",{className:"flex items-center justify-between font-mono text-[11px] text-dim",children:[o.jsx("span",{children:T?"Restart required to apply.":"No unsaved changes."}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(ae,{type:"button",variant:"secondary",size:"sm","data-testid":"joined-net-card-cancel",disabled:!T||E.isPending,onClick:()=>c(Sh(e)),children:"Cancel"}),o.jsx(ae,{type:"button",size:"sm","data-testid":"joined-net-card-save",disabled:!T||E.isPending||U,onClick:()=>E.mutate(),children:E.isPending?"Saving…":"Save"})]})]}),o.jsxs("div",{"data-testid":"joined-net-card-leave-zone",className:"mt-1 flex flex-wrap items-start justify-between gap-3 border-t border-dashed border-border pt-3",children:[o.jsx("span",{"data-testid":"joined-net-card-leave-explainer",className:"max-w-[440px] font-mono text-[11px] leading-relaxed text-dim",children:"Leave removes this SolverNet from your config right away. The running daemon keeps its loaded copy in memory, so it will go on claiming and finishing tasks for this SolverNet until you restart it — restart to actually stop new claims. Tasks already in flight run to completion either way. You can re-join from the Discover catalog later."}),W?o.jsxs("div",{className:"flex gap-1.5",children:[o.jsx(ae,{type:"button",variant:"secondary",size:"sm","data-testid":"joined-net-card-leave-cancel",disabled:N.isPending,onClick:()=>q(!1),children:"Cancel"}),o.jsx(ae,{type:"button",variant:"destructive",size:"sm","data-testid":"joined-net-card-leave-confirm",disabled:N.isPending,onClick:()=>N.mutate(),children:N.isPending?"Leaving…":"Confirm leave"})]}):o.jsxs(ae,{type:"button",variant:"destructive",size:"sm","data-testid":"joined-net-card-leave",onClick:()=>q(!0),children:[o.jsx(Sl,{"aria-hidden":"true",className:"!size-3"}),"Leave SolverNet"]})]})]})]})}function Lx({harness:e,plugins:t,model:r,harnessWarning:n,warningTestId:s}){return o.jsxs("div",{className:"grid grid-cols-[90px_1fr] gap-x-3 gap-y-1.5 font-mono text-[12px] text-muted-foreground",children:[o.jsx("span",{children:"harness"}),o.jsxs("span",{className:"text-foreground",children:[e?Ws(e):o.jsx("span",{className:"text-dim",children:"—"}),n&&s&&o.jsxs("span",{"data-testid":s,className:"ml-2.5 text-destructive",children:["⚠ ",n]})]}),o.jsx("span",{children:"plugins"}),o.jsx("span",{className:"text-foreground",children:(t??[]).length===0?o.jsx("span",{className:"text-dim",children:"—"}):`${t.length} active`}),o.jsx("span",{children:"model"}),o.jsx("span",{className:"text-foreground",children:r?xg(r,Ur(e)).label:o.jsx("span",{className:"text-dim",children:"—"})})]})}function z5({label:e}){return o.jsx(je,{variant:"outline","data-testid":"joined-net-card-role",className:"px-1.5 py-px text-[10px]",children:e})}function U5({onRestartPending:e}={}){const t=Me({queryKey:["operator","joined"],queryFn:()=>ge.operator.listJoined(),refetchInterval:3e4}),r=C.useMemo(()=>{var s;const n=((s=t.data)==null?void 0:s.joinedSolverNets)??{};return Object.values(n)},[t.data]);return o.jsxs("div",{"data-testid":"memberships-tab",className:"flex flex-col gap-3",children:[o.jsxs("div",{className:"flex items-baseline justify-between",children:[o.jsxs("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:["Joined · ",r.length]}),t.isError&&o.jsx("span",{role:"alert",className:"font-mono text-[11px] text-[var(--break-red)]",children:"Failed to load joined SolverNets."})]}),t.isLoading&&o.jsxs("div",{"data-testid":"memberships-tab-loading",className:"flex flex-col gap-3","aria-label":"Loading",children:[o.jsx(Br,{className:"h-20 w-full"}),o.jsx(Br,{className:"h-20 w-full"})]}),!t.isLoading&&r.length===0&&o.jsxs("p",{"data-testid":"memberships-tab-empty",className:"m-0 font-mono text-[12px] leading-relaxed text-muted-foreground",children:["You haven't joined any SolverNets yet. Browse the"," ",o.jsx(lr,{href:"/operator/registry",className:"text-primary no-underline hover:underline",children:"Registry"})," ","to participate."]}),r.map(n=>o.jsx(H5,{joined:n,onRestartPending:e},n.manifestCid))]})}const Mx={launched:{variant:"success",label:"Launched"},paused:{variant:"pill",label:"Paused"},retired:{variant:"outline",label:"Retired"}};function W5(e){return e?e.length<=13?e:`${e.slice(0,6)}…${e.slice(-4)}`:""}function V5(e){if(!e)return null;try{const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString().replace("T"," ").slice(0,16)+" UTC"}catch{return e}}function q5(e){if(e instanceof Error){const t=e.code;if(typeof t=="string")return t;if(e.message.includes("subsystem_not_ready"))return"subsystem_not_ready";if(e.message.includes("registry_unavailable"))return"registry_unavailable";if(e.message.includes("rpc_rate_limited"))return"rpc_rate_limited"}return null}const K5={title:"Your RPC endpoint is rate-limited.",detail:"Open the Network section and add your own free key.",actionHref:"/operator#network",actionLabel:"Open Network settings →"};function G5(e){switch(q5(e)){case"subsystem_not_ready":return{title:"SolverNet subsystem is still starting.",detail:"Wait a few seconds, then retry. If this persists, restart the daemon and check its startup logs."};case"registry_unavailable":return{title:"Registry cache is unavailable.",detail:"The daemon could not read the SolverNet registry cache. Retry after startup finishes; check daemon logs if it keeps failing."};case"rpc_rate_limited":return K5;default:return{title:"Failed to load registry catalog.",detail:e instanceof Error?e.message:"Unknown error"}}}function Q5({code:e,message:t}){return e==="rpc_rate_limited"?o.jsxs("span",{"data-testid":"registry-catalog-warn","data-error-code":"rpc_rate_limited",className:"inline-flex gap-2 normal-case tracking-normal text-[var(--wane)]",children:[o.jsx("span",{children:"RPC rate-limited — add your own key"}),o.jsx(lr,{href:"/operator#network","data-testid":"registry-catalog-warn-action",className:"text-primary no-underline hover:underline",children:"Network settings →"})]}):o.jsxs("span",{"data-testid":"registry-catalog-warn",className:"normal-case tracking-normal text-[var(--wane)]",children:["stale (",t,")"]})}function Y5({status:e}){const t=Mx[e]??Mx.launched;return o.jsx(je,{"data-testid":"registry-status-badge","data-status":e,variant:t.variant,className:"whitespace-nowrap",children:t.label})}function Z5({openRoles:e}){return e.length===0?o.jsx("span",{className:"text-[12px] text-[var(--fg-dim)]",children:"no open roles"}):o.jsx("span",{className:"flex flex-wrap gap-1.5",children:e.map(t=>o.jsx(je,{"data-testid":"registry-open-role","data-role":t,variant:"outline",className:"rounded-full text-foreground",children:t},t))})}function X5({summary:e,joinedRoles:t}){const r=`/operator/join/${encodeURIComponent(e.manifestCid)}`,n=(t??[]).length>0,s=e.status==="launched";return o.jsx(we,{"data-testid":"registry-card","data-manifest-cid":e.manifestCid,className:"flex flex-col gap-3 p-4",children:o.jsxs("article",{className:"flex flex-col gap-3",children:[o.jsxs("header",{className:"flex items-start justify-between gap-4",children:[o.jsxs("div",{className:"flex min-w-0 flex-col gap-1.5",children:[o.jsx("span",{className:"truncate font-mono text-[15px] font-medium text-foreground",children:e.name}),o.jsxs("span",{className:"font-mono text-[12px] text-[var(--fg-muted)]",children:["Launcher: ",W5(e.launcherSafeAddress)," · agentId"," ",e.launcherAgentId]})]}),o.jsx(Y5,{status:e.status})]}),o.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1.5 font-mono text-[12px] text-[var(--fg-muted)]",children:[o.jsx("span",{children:"Open roles"}),o.jsx(Z5,{openRoles:e.openRoles}),o.jsx("span",{children:"Solution price"}),o.jsx("span",{className:"text-foreground",children:As(e.solutionPriceWei)}),o.jsx("span",{children:"Verdict price"}),o.jsx("span",{className:"text-foreground",children:As(e.verdictPriceWei)})]}),o.jsxs("footer",{className:"flex items-center justify-end gap-3",children:[n&&o.jsxs(je,{"data-testid":"registry-card-joined","data-manifest-cid":e.manifestCid,variant:"success",className:"rounded-full px-2.5 py-1",children:["JOINED · ",(t??[]).join(", ")]}),s?o.jsx(ae,{asChild:!0,variant:n?"secondary":"default","data-testid":"registry-join-cta","data-manifest-cid":e.manifestCid,children:o.jsx(lr,{href:r,children:n?"Edit":"Join"})}):o.jsx(ae,{type:"button",variant:"secondary","data-testid":"registry-join-cta","data-manifest-cid":e.manifestCid,disabled:!0,"aria-disabled":!0,className:"pointer-events-none",children:n?"Edit":"Join"})]})]})})}function J5({refetchIntervalMs:e=3e4}={}){var _;const{data:t,isLoading:r,isError:n,error:s,refetch:i}=Me({queryKey:["solvernets","registry"],queryFn:()=>ge.solvernets.listRegistry(),refetchInterval:e}),l=Me({queryKey:["operator","joined"],queryFn:()=>ge.operator.listJoined(),refetchInterval:e}),a=((_=l.data)==null?void 0:_.joinedSolverNets)??{};if(r||l.isLoading)return o.jsx("p",{"data-testid":"registry-catalog-loading",className:"m-0 font-mono text-[13px] text-[var(--fg-muted)]",children:"Loading catalog…"});if(n||l.isError){const v=n?s:l.error,x=G5(v);return o.jsxs(rt,{"data-testid":"registry-catalog-error",variant:"blocking",className:"flex items-center justify-between gap-4 border-l-0 border border-destructive p-4",children:[o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx(Dt,{className:"font-mono text-[13px] font-medium text-destructive",children:x.title}),o.jsx(it,{className:"text-[12px] text-[var(--fg-muted)]",children:x.detail}),x.actionHref&&x.actionLabel&&o.jsx(lr,{href:x.actionHref,"data-testid":"registry-catalog-error-action",className:"mt-0.5 font-mono text-[12px] text-primary no-underline hover:underline",children:x.actionLabel})]}),o.jsx(ae,{type:"button",variant:"secondary",size:"sm","data-testid":"registry-catalog-retry",onClick:()=>{i()},children:"Retry"})]})}const c=(t==null?void 0:t.summaries)??[],u=c.filter(v=>a[v.manifestCid]===void 0),g=V5((t==null?void 0:t.lastRefreshedAt)??null),d=(t==null?void 0:t.lastError)??null;return o.jsxs("div",{"data-testid":"registry-catalog",className:"flex flex-col gap-3",children:[o.jsxs("div",{className:"flex items-center justify-between font-mono text-[11px] uppercase tracking-[0.14em] text-[var(--fg-muted)]",children:[o.jsxs("span",{"data-testid":"registry-catalog-meta",children:[u.length," discoverable · last refreshed"," ",g??"never"]}),d&&o.jsx(Q5,{code:d.code,message:d.message})]}),u.length===0?o.jsx(we,{"data-testid":"registry-catalog-empty",className:"p-6 font-mono text-[13px] text-[var(--fg-muted)]",children:c.length===0?"No launched SolverNets available.":"No unjoined SolverNets available."}):o.jsx("div",{className:"flex flex-col gap-2.5",children:u.map(v=>{var x;return o.jsx(X5,{summary:v,joinedRoles:(x=a[v.manifestCid])==null?void 0:x.roles},v.manifestCid)})})]})}function e4(){return o.jsxs("div",{"data-testid":"registry-tab",className:"flex flex-col gap-3",children:[o.jsxs("span",{className:"flex items-center gap-2 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:[o.jsx(w2,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Discover"]}),o.jsx(J5,{})]})}function t4({onRestartPending:e=()=>{}}={}){const{data:t}=Me({queryKey:["bootstrap"],queryFn:()=>ge.getBootstrap(),refetchInterval:1500}),r=(t==null?void 0:t.chain)??"base-sepolia",n=(t==null?void 0:t.rpcUrl)??"",s=(t==null?void 0:t.defaultRpcUrl)??(r==="base"?"https://mainnet.base.org":"https://base-sepolia-rpc.publicnode.com");return o.jsx("div",{"data-testid":"network-tab",children:o.jsx(r4,{chain:r,rpcUrl:n,defaultRpcUrl:s,rpcHealthy:!0,onRestartPending:e})})}function r4({chain:e,rpcUrl:t,defaultRpcUrl:r,rpcHealthy:n,onRestartPending:s}){const[i,l]=C.useState(t),[a,c]=C.useState(!1),u=i!==t,g=t===r,d=e==="base"?"Base mainnet (chain id 8453)":"Base Sepolia (chain id 84532)",_=d.split(" (")[0],v=async()=>{c(!0);try{const x=i.length===0?null:i,y=await ge.updateNetwork({rpcUrl:x});Zs.success("RPC URL saved",{description:y.restartRequired?"Restart pending — applies on next daemon start.":"Applied to the running daemon."}),y.restartRequired&&s()}catch(x){Zs.error("Failed to save RPC URL",{description:x instanceof Error?x.message:String(x)})}finally{c(!1)}};return o.jsxs(we,{children:[o.jsxs(cr,{className:"flex flex-row items-start justify-between gap-3",children:[o.jsxs("div",{className:"flex flex-col gap-1.5",children:[o.jsxs(Rn,{className:"flex items-center gap-2",children:[o.jsx(N2,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Network"]}),o.jsxs(Gs,{children:[_," · ",t]})]}),o.jsx(je,{variant:n?"success":"destructive",children:n?"Healthy":"Unreachable"})]}),o.jsxs(Qe,{children:[o.jsxs("div",{className:"grid gap-6 sm:grid-cols-2",children:[o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx(wr,{children:"Chain"}),o.jsx("div",{className:"rounded-md border border-border bg-[var(--bg-sunken)] px-3 py-2 font-mono text-[13px] text-muted-foreground",children:d}),o.jsx(je,{variant:"outline",className:"self-start",children:"locked"}),o.jsx("p",{className:"font-mono text-[11px] text-[var(--fg-dim)]",children:"Switching chains resets fleet state — that's a separate flow."})]}),o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(wr,{htmlFor:"rpc-url",children:"RPC URL"}),u&&o.jsx(je,{variant:"warning",children:"Restart"})]}),o.jsx(ft,{id:"rpc-url",type:"text",value:i,onChange:x=>l(x.target.value),placeholder:r,className:u?"border-primary":void 0}),o.jsx(ae,{variant:"link",size:"sm",type:"button",onClick:()=>l(""),className:"h-auto self-start p-0 text-[11px]",children:"Use default"}),g&&o.jsxs(rt,{variant:"warning",className:"mt-3","data-testid":"network-shared-rpc-warning",children:[o.jsx(jm,{className:"h-4 w-4 text-[var(--wane)]"}),o.jsx(Dt,{className:"text-[var(--wane)]",children:"Shared RPC"}),o.jsxs(it,{children:["You're on the default RPC — a free public gateway shared with every operator on the default config. Fine for setup; not reliable under load. Get your own free key from"," ",o.jsxs("a",{href:"https://dashboard.tenderly.co/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-0.5 text-primary hover:underline",children:["Tenderly ",o.jsx(jo,{className:"h-2.5 w-2.5"})]}),","," ",o.jsxs("a",{href:"https://www.alchemy.com/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-0.5 text-primary hover:underline",children:["Alchemy ",o.jsx(jo,{className:"h-2.5 w-2.5"})]}),", or"," ",o.jsxs("a",{href:"https://www.quicknode.com/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-0.5 text-primary hover:underline",children:["QuickNode ",o.jsx(jo,{className:"h-2.5 w-2.5"})]})," ","and paste it above."]})]}),o.jsxs("p",{className:"font-mono text-[11px] text-[var(--fg-dim)]",children:["Default: ",r]})]})]}),u&&o.jsxs("div",{className:"mt-6 flex items-center justify-end gap-2 border-t border-border pt-4",children:[o.jsx(ae,{variant:"secondary",size:"sm",type:"button",onClick:()=>l(t),children:"Cancel"}),o.jsx(ae,{variant:"default",size:"sm",type:"button",disabled:a,onClick:()=>{v()},children:a?"Saving…":"Save"})]})]})]})}var Zl=e=>e.type==="checkbox",vi=e=>e instanceof Date,Pt=e=>e==null;const lk=e=>typeof e=="object";var at=e=>!Pt(e)&&!Array.isArray(e)&&lk(e)&&!vi(e),ck=e=>at(e)&&e.target?Zl(e.target)?e.target.checked:e.target.value:e,ap=(e,t)=>{const r=t.split("."),n=[];let s=r[0];for(let i=1;i<r.length;s+="."+r[i++])!isNaN(+r[i])&&e.has(s)&&n.push(s);return n},n4=e=>{const t=e.constructor&&e.constructor.prototype;return at(t)&&t.hasOwnProperty("isPrototypeOf")},Tg=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function mt(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(Tg&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!r&&!(at(e)&&n4(e)))return e;const n=r?[]:Object.create(Object.getPrototypeOf(e));for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=mt(e[s]));return n}var Xl=e=>/^\w*$/.test(e),et=e=>e===void 0,Ag=e=>Array.isArray(e)?e.filter(Boolean):[],Nd=e=>Ag(e.replace(/["|']|\]/g,"").split(/\.|\[/)),le=(e,t,r)=>{if(!t||!at(e))return r;const s=(Xl(t)?[t]:Nd(t)).reduce((i,l)=>Pt(i)?void 0:i[l],e);return et(s)||s===e?et(e[t])?r:e[t]:s},mr=e=>typeof e=="boolean",$t=e=>typeof e=="function",Ue=(e,t,r)=>{let n=-1;const s=Xl(t)?[t]:Nd(t),i=s.length,l=i-1;for(;++n<i;){const a=s[n];let c=r;if(n!==l){const u=e[a];c=at(u)||Array.isArray(u)?u:isNaN(+s[n+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;e[a]=c,e=e[a]}};const vs={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},on={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Jr={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Ch="form",uk="root",Dg=Z.createContext(null);Dg.displayName="HookFormControlContext";const Lg=()=>Z.useContext(Dg);var dk=(e,t,r,n=!0)=>{const s={};for(const i in e)Object.defineProperty(s,i,{get:()=>{const l=i;return t._proxyFormState[l]!==on.all&&(t._proxyFormState[l]=!n||on.all),r&&(r[l]=!0),e[l]}});return s};const Mg=typeof window<"u"?Z.useLayoutEffect:Z.useEffect;function s4(e){const t=Lg(),{control:r=t,disabled:n,name:s,exact:i}=e||{},[l,a]=Z.useState(()=>({...r._formState,defaultValues:r._defaultValues})),c=Z.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Mg(()=>r._subscribe({name:s,formState:c.current,exact:i,callback:u=>{!n&&a({...r._formState,...u,defaultValues:r._defaultValues})}}),[s,n,i]),Z.useEffect(()=>{c.current.isValid&&r._setValid(!0)},[r]),Z.useMemo(()=>dk(l,r,c.current,!1),[l,r])}var zt=e=>typeof e=="string",lp=(e,t,r,n,s)=>zt(e)?(n&&t.watch.add(e),le(r,e,s)):Array.isArray(e)?e.map(i=>(n&&t.watch.add(i),le(r,i))):(n&&(t.watchAll=!0),r),cp=e=>Pt(e)||!lk(e);function gr(e,t,r=new WeakSet){if(e===t)return!0;if(cp(e)||cp(t))return Object.is(e,t);if(vi(e)&&vi(t))return Object.is(e.getTime(),t.getTime());const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const i of n){const l=e[i];if(!(i in t))return!1;if(i!=="ref"){const a=t[i];if(vi(l)&&vi(a)||(at(l)||Array.isArray(l))&&(at(a)||Array.isArray(a))?!gr(l,a,r):!Object.is(l,a))return!1}}return!0}function i4(e){const t=Lg(),{control:r=t,name:n,defaultValue:s,disabled:i,exact:l,compute:a}=e||{},c=Z.useRef(s),u=Z.useRef(a),g=Z.useRef(void 0),d=Z.useRef(r),_=Z.useRef(n);u.current=a;const[v,x]=Z.useState(()=>{const b=r._getWatch(n,c.current);return u.current?u.current(b):b}),y=Z.useCallback(b=>{const w=lp(n,r._names,b||r._formValues,!1,c.current);return u.current?u.current(w):w},[r._formValues,r._names,n]),f=Z.useCallback(b=>{if(!i){const w=lp(n,r._names,b||r._formValues,!1,c.current);if(u.current){const k=u.current(w);gr(k,g.current)||(x(k),g.current=k)}else x(w)}},[r._formValues,r._names,i,n]);Mg(()=>((d.current!==r||!gr(_.current,n))&&(d.current=r,_.current=n,f()),r._subscribe({name:n,formState:{values:!0},exact:l,callback:b=>{f(b.values)}})),[r,l,n,f]),Z.useEffect(()=>r._removeUnmounted());const p=d.current!==r,h=_.current,m=Z.useMemo(()=>{if(i)return null;const b=!p&&!gr(h,n);return p||b?y():null},[i,p,n,h,y]);return m!==null?m:v}function o4(e){const t=Lg(),{name:r,disabled:n,control:s=t,shouldUnregister:i,defaultValue:l,exact:a=!0}=e,c=!!ap(s._names.array,r).length,u=Z.useMemo(()=>le(s._formValues,r,le(s._defaultValues,r,l)),[s,r,l]),g=i4({control:s,name:r,defaultValue:u,exact:a}),d=s4({control:s,name:r,exact:a}),_=Z.useRef(e),v=Z.useRef(s.register(r,{...e.rules,value:g,...mr(e.disabled)?{disabled:e.disabled}:{}}));_.current=e;const x=Z.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!le(d.errors,r)},isDirty:{enumerable:!0,get:()=>!!le(d.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!le(d.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!le(d.validatingFields,r)},error:{enumerable:!0,get:()=>le(d.errors,r)}}),[d,r]),y=Z.useCallback(m=>v.current.onChange({target:{value:ck(m),name:r},type:vs.CHANGE}),[r]),f=Z.useCallback(()=>v.current.onBlur({target:{value:le(s._formValues,r),name:r},type:vs.BLUR}),[r,s._formValues]),p=Z.useCallback(m=>{const b=le(s._fields,r);b&&b._f&&m&&(b._f.ref={focus:()=>$t(m.focus)&&m.focus(),select:()=>$t(m.select)&&m.select(),setCustomValidity:w=>$t(m.setCustomValidity)&&m.setCustomValidity(w),reportValidity:()=>$t(m.reportValidity)&&m.reportValidity()})},[s._fields,r]),h=Z.useMemo(()=>({name:r,value:g,...mr(n)||d.disabled?{disabled:d.disabled||n}:{},onChange:y,onBlur:f,ref:p}),[r,n,d.disabled,y,f,p,g]);return Z.useEffect(()=>{const m=s._options.shouldUnregister||i;s.register(r,{..._.current.rules,...mr(_.current.disabled)?{disabled:_.current.disabled}:{}});const b=(w,k)=>{const j=le(s._fields,w);j&&j._f&&(j._f.mount=k)};if(b(r,!0),m){const w=mt(le(s._defaultValues,r,le(s._options.defaultValues,r,_.current.defaultValue)));Ue(s._defaultValues,r,w),et(le(s._formValues,r))&&Ue(s._formValues,r,w)}return!c&&s.register(r),()=>{(c?m&&!s._state.action:m)?s.unregister(r):b(r,!1)}},[r,s,c,i]),Z.useEffect(()=>{s._setDisabledField({disabled:n,name:r})},[n,r,s]),Z.useMemo(()=>({field:h,formState:d,fieldState:x}),[h,d,x])}const a4=e=>e.render(o4(e)),Og=Z.createContext(null);Og.displayName="HookFormContext";const l4=()=>Z.useContext(Og),c4=e=>{const{children:t,watch:r,getValues:n,getFieldState:s,setError:i,clearErrors:l,setValue:a,setValues:c,trigger:u,formState:g,resetField:d,reset:_,handleSubmit:v,unregister:x,control:y,register:f,setFocus:p,subscribe:h}=e,m=Z.useMemo(()=>({watch:r,getValues:n,getFieldState:s,setError:i,clearErrors:l,setValue:a,setValues:c,trigger:u,formState:g,resetField:d,reset:_,handleSubmit:v,unregister:x,control:y,register:f,setFocus:p,subscribe:h}),[l,y,g,s,n,v,f,_,d,i,p,a,c,h,u,x,r]);return Z.createElement(Og.Provider,{value:m},Z.createElement(Dg.Provider,{value:m.control},t))};var hk=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{},rl=e=>Array.isArray(e)?e:[e],Ox=()=>{let e=[];return{get observers(){return e},next:s=>{for(const i of e)i.next&&i.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(i=>i!==s)}}),unsubscribe:()=>{e=[]}}};function fk(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const s=e[n],i=t[n];if(s&&at(s)&&i){const l=fk(s,i);at(l)&&(r[n]=l)}else e[n]&&(r[n]=i)}return r}var Ft=e=>at(e)&&!Object.keys(e).length,Ig=e=>e.type==="file",Ou=e=>{if(!Tg)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},pk=e=>e.type==="select-multiple",Fg=e=>e.type==="radio",u4=e=>Fg(e)||Zl(e),kh=e=>Ou(e)&&e.isConnected;function d4(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;){if(Pt(e)){e=void 0;break}e=e[t[n]],n++}return e}function h4(e){for(const t in e)if(e.hasOwnProperty(t)&&!et(e[t]))return!1;return!0}function vt(e,t){if(zt(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;const r=Array.isArray(t)?t:Xl(t)?[t]:Nd(t),n=r.length===1?e:d4(e,r),s=r.length-1,i=r[s];return n&&delete n[i],s!==0&&(at(n)&&Ft(n)||Array.isArray(n)&&h4(n))&&vt(e,r.slice(0,-1)),e}var f4=e=>{for(const t in e)if($t(e[t]))return!0;return!1};function mk(e){return Array.isArray(e)||at(e)&&!f4(e)}function up(e,t={}){for(const r in e){const n=e[r];mk(n)?(t[r]=Array.isArray(n)?[]:{},up(n,t[r])):et(n)||(t[r]=!0)}return t}function dp(e){if(e!==!1){if(e===!0)return!0;if(Array.isArray(e)){const t=e.map(r=>dp(r));return t.some(r=>r!==void 0)?t:void 0}if(at(e)){const t={};for(const r in e){const n=dp(e[r]);et(n)||(t[r]=n)}return Object.keys(t).length?t:void 0}}}function io(e,t,r){r||(r=up(t));for(const n in e){const s=e[n];if(mk(s))et(t)||cp(r[n])?r[n]=up(s,Array.isArray(s)?[]:{}):io(s,Pt(t)?{}:t[n],r[n]);else{const i=t[n];r[n]=!gr(s,i)}}return dp(r)||{}}const Ix={value:!1,isValid:!1},Fx={value:!0,isValid:!0};var gk=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!et(e[0].attributes.value)?et(e[0].value)||e[0].value===""?Fx:{value:e[0].value,isValid:!0}:Fx:Ix}return Ix},vk=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>et(e)?e:t?e===""?NaN:e&&+e:r&&zt(e)?new Date(e):n?n(e):e;const Bx={isValid:!1,value:null};var _k=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,Bx):Bx;function $x(e){const t=e.ref;return Ig(t)?t.files:Fg(t)?_k(e.refs).value:pk(t)?[...t.selectedOptions].map(({value:r})=>r):Zl(t)?gk(e.refs).value:vk(et(t.value)?e.ref.value:t.value,e)}var p4=(e,t,r,n)=>{const s={};for(const i of e){const l=le(t,i);l&&Ue(s,i,l._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}},Iu=e=>e instanceof RegExp,Ia=e=>et(e)?e:Iu(e)?e.source:at(e)?Iu(e.value)?e.value.source:e.value:e,Hx=e=>({isOnSubmit:!e||e===on.onSubmit,isOnBlur:e===on.onBlur,isOnChange:e===on.onChange,isOnAll:e===on.all,isOnTouch:e===on.onTouched});const zx="AsyncFunction";var m4=e=>!!e&&!!e.validate&&!!($t(e.validate)&&e.validate.constructor.name===zx||at(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===zx)),g4=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Ux=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const nl=(e,t,r,n)=>{for(const s of r||Object.keys(e)){const i=le(e,s);if(i){const{_f:l,...a}=i;if(l){if(l.refs&&l.refs[0]&&t(l.refs[0],s)&&!n)return!0;if(l.ref&&t(l.ref,l.name)&&!n)return!0;if(nl(a,t))break}else if(at(a)&&nl(a,t))break}}};function Wx(e,t,r){const n=le(e,r);if(n||Xl(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const i=s.join("."),l=le(t,i),a=le(e,i);if(l&&!Array.isArray(l)&&r!==i)return{name:r};if(a&&a.type)return{name:i,error:a};if(a&&a.root&&a.root.type)return{name:`${i}.root`,error:a.root};s.pop()}return{name:r}}var v4=(e,t,r,n)=>{r(e);const{name:s,...i}=e;return Ft(i)||n&&Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(l=>t[l]===(!n||on.all))},_4=(e,t,r)=>!e||!t||e===t||rl(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),x4=(e,t,r,n,s)=>s.isOnAll?!1:!r&&s.isOnTouch?!(t||e):(r?n.isOnBlur:s.isOnBlur)?!e:(r?n.isOnChange:s.isOnChange)?e:!0,y4=(e,t)=>!Ag(le(e,t)).length&&vt(e,t),Vx=(e,t,r)=>{const n=rl(le(e,r));return Ue(n,uk,t[r]),Ue(e,r,n),e};function qx(e,t,r="validate"){if(zt(e)||Array.isArray(e)&&e.every(zt)||mr(e)&&!e)return{type:r,message:zt(e)?e:"",ref:t}}var no=e=>at(e)&&!Iu(e)?e:{value:e,message:""},Kx=async(e,t,r,n,s,i)=>{const{ref:l,refs:a,required:c,maxLength:u,minLength:g,min:d,max:_,pattern:v,validate:x,name:y,valueAsNumber:f,mount:p}=e._f,h=le(r,y);if(!p||t.has(y))return{};const m=a?a[0]:l,b=A=>{s&&m.reportValidity&&(m.setCustomValidity(mr(A)?"":A||""),m.reportValidity())},w={},k=Fg(l),j=Zl(l),S=k||j,E=(f||Ig(l))&&et(l.value)&&et(h)||Ou(l)&&l.value===""||h===""||Array.isArray(h)&&!h.length||f&&typeof h=="number"&&isNaN(h),R=hk.bind(null,y,n,w),M=(A,L,B,U=Jr.maxLength,W=Jr.minLength)=>{const q=A?L:B;w[y]={type:A?U:W,message:q,ref:l,...R(A?U:W,q)}};if(i?!Array.isArray(h)||!h.length:c&&(!S&&(E||Pt(h))||mr(h)&&!h||j&&!gk(a).isValid||k&&!_k(a).isValid)){const{value:A,message:L}=zt(c)?{value:!!c,message:c}:no(c);if(A&&(w[y]={type:Jr.required,message:L,ref:m,...R(Jr.required,L)},!n))return b(L),w}if(!E&&(!Pt(d)||!Pt(_))){let A,L;const B=no(_),U=no(d);if(!Pt(h)&&!isNaN(h)){const W=l.valueAsNumber||h&&+h;Pt(B.value)||(A=W>B.value),Pt(U.value)||(L=W<U.value)}else{const W=l.valueAsDate||new Date(h),q=D=>new Date(new Date().toDateString()+" "+D),N=l.type=="time",T=l.type=="week";zt(B.value)&&h&&(A=N?q(h)>q(B.value):T?h>B.value:W>new Date(B.value)),zt(U.value)&&h&&(L=N?q(h)<q(U.value):T?h<U.value:W<new Date(U.value))}if((A||L)&&(M(!!A,B.message,U.message,Jr.max,Jr.min),!n))return b(w[y].message),w}if((u||g)&&!E&&(zt(h)||i&&Array.isArray(h))){const A=no(u),L=no(g),B=!Pt(A.value)&&h.length>+A.value,U=!Pt(L.value)&&h.length<+L.value;if((B||U)&&(M(B,A.message,L.message),!n))return b(w[y].message),w}if(v&&!E&&zt(h)){const{value:A,message:L}=no(v);if(Iu(A)&&!h.match(A)&&(w[y]={type:Jr.pattern,message:L,ref:l,...R(Jr.pattern,L)},!n))return b(L),w}if(x){if($t(x)){const A=await x(h,r),L=qx(A,m);if(L&&(w[y]={...L,...R(Jr.validate,L.message)},!n))return b(L.message),w}else if(at(x)){let A={};for(const L in x){if(!Ft(A)&&!n)break;const B=qx(await x[L](h,r),m,L);B&&(A={...B,...R(L,B.message)},b(B.message),n&&(w[y]=A))}if(!Ft(A)&&(w[y]={ref:m,...A},!n))return w}}return b(!0),w};const b4={mode:on.onSubmit,reValidateMode:on.onChange,shouldFocusError:!0},xk={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function w4(e={}){let t={...b4,...e},r={...mt(xk),isLoading:$t(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1},n={},s=at(t.defaultValues)||at(t.values)?mt(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:mt(s),l={action:!1,mount:!1,watch:!1,keepIsValid:!1},a={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},c,u=0;const g={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={...g};let _={...d};const v={array:Ox(),state:Ox()},x=t.criteriaMode===on.all,y=I=>H=>{clearTimeout(u),u=setTimeout(I,H)},f=async I=>{if(!l.keepIsValid&&!t.disabled&&(d.isValid||_.isValid||I)){let H;t.resolver?(H=Ft((await R()).errors),p()):H=await L({fields:n,onlyCheckValid:!0,eventType:vs.VALID}),H!==r.isValid&&v.state.next({isValid:H})}},p=(I,H)=>{!t.disabled&&(d.isValidating||d.validatingFields||_.isValidating||_.validatingFields)&&((I||Array.from(a.mount)).forEach(V=>{V&&(H?Ue(r.validatingFields,V,H):vt(r.validatingFields,V))}),v.state.next({validatingFields:r.validatingFields,isValidating:!Ft(r.validatingFields)}))},h=()=>{r.dirtyFields=io(s,i)},m=(I,H=[],V,ne,ie=!0,te=!0)=>{if(ne&&V&&!t.disabled){if(l.action=!0,te&&Array.isArray(le(n,I))){const ce=V(le(n,I),ne.argA,ne.argB);ie&&Ue(n,I,ce)}if(te&&Array.isArray(le(r.errors,I))){const ce=V(le(r.errors,I),ne.argA,ne.argB);ie&&Ue(r.errors,I,ce),y4(r.errors,I)}if((d.touchedFields||_.touchedFields)&&te&&Array.isArray(le(r.touchedFields,I))){const ce=V(le(r.touchedFields,I),ne.argA,ne.argB);ie&&Ue(r.touchedFields,I,ce)}(d.dirtyFields||_.dirtyFields)&&h(),v.state.next({name:I,isDirty:U(I,H),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else Ue(i,I,H)},b=(I,H)=>{Ue(r.errors,I,H),v.state.next({errors:r.errors})},w=I=>{r.errors=I,v.state.next({errors:r.errors,isValid:!1})},k=I=>{const H=Xl(I)?[I]:Nd(I);let V=i,ne=s;for(let ie=0;ie<H.length-1;ie++){const te=H[ie];if(V=Pt(V)?V:V[te],ne=Pt(ne)?ne:ne[te],V===null&&ne!==null)return!0}return!1},j=(I,H,V,ne)=>{const ie=le(n,I);if(ie){if(k(I))return;const te=et(le(i,I)),ce=le(i,I,et(V)?le(s,I):V);et(ce)||ne&&ne.defaultChecked||H?Ue(i,I,H?ce:$x(ie._f)):N(I,ce),l.mount&&!l.action&&(f(),te&&r.isDirty&&(d.isDirty||_.isDirty)&&(U()||(r.isDirty=!1,v.state.next({...r}))))}},S=(I,H,V,ne,ie)=>{let te=!1,ce=!1;const fe={name:I};if(!t.disabled){if(!V||ne){(d.isDirty||_.isDirty)&&(ce=r.isDirty,r.isDirty=fe.isDirty=U(),te=ce!==fe.isDirty);const Ne=gr(le(s,I),H);ce=!!le(r.dirtyFields,I),Ne!==r.isDirty?r.dirtyFields=io(s,i):Ne?vt(r.dirtyFields,I):Ue(r.dirtyFields,I,!0),fe.dirtyFields=r.dirtyFields,te=te||(d.dirtyFields||_.dirtyFields)&&ce!==!Ne}if(V){const Ne=le(r.touchedFields,I);Ne||(Ue(r.touchedFields,I,V),fe.touchedFields=r.touchedFields,te=te||(d.touchedFields||_.touchedFields)&&Ne!==V)}te&&ie&&v.state.next(fe)}return te?fe:{}},E=(I,H,V,ne)=>{const ie=le(r.errors,I),te=(d.isValid||_.isValid)&&mr(H)&&r.isValid!==H;if(t.delayError&&V?(c=y(()=>b(I,V)),c(t.delayError)):(clearTimeout(u),c=null,V?Ue(r.errors,I,V):vt(r.errors,I)),(V?!gr(ie,V):ie)||!Ft(ne)||te){const ce={...ne,...te&&mr(H)?{isValid:H}:{},errors:r.errors,name:I};r={...r,...ce},v.state.next(ce)}},R=async I=>(p(I,!0),await t.resolver(i,t.context,p4(I||a.mount,n,t.criteriaMode,t.shouldUseNativeValidation))),M=async I=>{const{errors:H}=await R(I);if(p(I),I)for(const V of I){const ne=le(H,V);ne?a.array.has(V)&&at(ne)?Vx(r.errors,{[V]:ne},V):Ue(r.errors,V,ne):vt(r.errors,V)}else r.errors=H;return H},A=async({name:I,eventType:H})=>{if(e.validate){const V=await e.validate({formValues:i,formState:r,name:I,eventType:H});if(at(V))for(const ne in V){const ie=V[ne];ie&&z(`${Ch}.${ne}`,{message:zt(ie.message)?ie.message:"",type:ie.type||Jr.validate})}else zt(V)||!V?z(Ch,{message:V||"",type:Jr.validate}):P(Ch);return V}return!0},L=async({fields:I,onlyCheckValid:H,name:V,eventType:ne,context:ie={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(ie.runRootValidation=!0,!await A({name:V,eventType:ne})&&(ie.valid=!1,H)))return ie.valid;for(const te in I){const ce=I[te];if(ce){const{_f:fe,...Ne}=ce;if(fe){const Ze=a.array.has(fe.name),Vt=ce._f&&m4(ce._f),Ct=d.validatingFields||d.isValidating||_.validatingFields||_.isValidating;Vt&&Ct&&p([fe.name],!0);const Ln=await Kx(ce,a.disabled,i,x,t.shouldUseNativeValidation&&!H,Ze);if(Vt&&Ct&&p([fe.name]),Ln[fe.name]&&(ie.valid=!1,H)||(!H&&(le(Ln,fe.name)?Ze?Vx(r.errors,Ln,fe.name):Ue(r.errors,fe.name,Ln[fe.name]):vt(r.errors,fe.name)),e.shouldUseNativeValidation&&Ln[fe.name]))break}!Ft(Ne)&&await L({context:ie,onlyCheckValid:H,fields:Ne,name:te,eventType:ne})}}return ie.valid},B=()=>{for(const I of a.unMount){const H=le(n,I);H&&(H._f.refs?H._f.refs.every(V=>!kh(V)):!kh(H._f.ref))&&ee(I)}a.unMount=new Set},U=(I,H)=>!t.disabled&&(I&&H&&Ue(i,I,H),!gr(re(),s)),W=(I,H,V)=>lp(I,a,{...l.mount?i:et(H)?s:zt(I)?{[I]:H}:H},V,H),q=I=>Ag(le(l.mount?i:s,I,t.shouldUnregister?le(s,I,[]):[])),N=(I,H,V={})=>{const ne=le(n,I);let ie=H;if(ne){const te=ne._f;te&&(!te.disabled&&Ue(i,I,vk(H,te)),ie=Ou(te.ref)&&Pt(H)?"":H,pk(te.ref)?[...te.ref.options].forEach(ce=>ce.selected=ie.includes(ce.value)):te.refs?Zl(te.ref)?te.refs.forEach(ce=>{(!ce.defaultChecked||!ce.disabled)&&(Array.isArray(ie)?ce.checked=!!ie.find(fe=>fe===ce.value):ce.checked=ie===ce.value||!!ie)}):te.refs.forEach(ce=>ce.checked=ce.value===ie):Ig(te.ref)?te.ref.value="":(te.ref.value=ie,te.ref.type||v.state.next({name:I,values:mt(i)})))}(V.shouldDirty||V.shouldTouch)&&S(I,ie,V.shouldTouch,V.shouldDirty,!0),V.shouldValidate&&J(I)},T=(I,H,V)=>{for(const ne in H){if(!H.hasOwnProperty(ne))return;const ie=H[ne],te=I+"."+ne,ce=le(n,te);(a.array.has(I)||at(ie)||ce&&!ce._f)&&!vi(ie)?T(te,ie,V):N(te,ie,V)}},D=(I,H,V={})=>{const ne=le(n,I),ie=a.array.has(I),te=mt(H),ce=le(i,I),fe=gr(ce,te);if(fe||Ue(i,I,te),ie)v.array.next({name:I,values:mt(i)}),(d.isDirty||d.dirtyFields||_.isDirty||_.dirtyFields)&&V.shouldDirty&&(h(),v.state.next({name:I,dirtyFields:r.dirtyFields,isDirty:U(I,te)}));else{const Ne=Array.isArray(te)&&!te.length||Ft(te);!ne||ne._f||Pt(te)||Ne?N(I,te,V):T(I,te,V)}if(!fe){const Ne=Ux(I,a),Ze=mt(i);if(!ie)for(const Vt of ap(a.array,I))v.array.next({name:Vt,values:Ze});v.state.next({...Ne&&r,name:l.mount||Ne?I:void 0,values:Ze})}},O=I=>{const H=$t(I)?I(i):I;if(!gr(i,H)){i={...i,...H};for(const V of a.mount)D(V,le(H,V));v.state.next({...r,values:i})}},$=async I=>{l.mount=!0;const H=I.target;let V=H.name,ne=!0;const ie=le(n,V),te=Ne=>{ne=Number.isNaN(Ne)||vi(Ne)&&isNaN(Ne.getTime())||gr(Ne,le(i,V,Ne))},ce=Hx(t.mode),fe=Hx(t.reValidateMode);if(ie){let Ne,Ze;const Vt=H.type?$x(ie._f):ck(I),Ct=I.type===vs.BLUR||I.type===vs.FOCUS_OUT,Ln=!g4(ie._f)&&!e.validate&&!t.resolver&&!le(r.errors,V)&&!ie._f.deps||x4(Ct,le(r.touchedFields,V),r.isSubmitted,fe,ce),ya=Ux(V,a,Ct);Ue(i,V,Vt),Ct?(!H||!H.readOnly)&&(ie._f.onBlur&&ie._f.onBlur(I),c&&c(0)):ie._f.onChange&&ie._f.onChange(I);const Gi=S(V,Vt,Ct),Jl=!Ft(Gi)||ya;if(!Ct&&v.state.next({name:V,type:I.type,values:mt(i)}),Ln)return(d.isValid||_.isValid)&&(t.mode==="onBlur"?Ct&&f():Ct||f()),Jl&&v.state.next({name:V,...ya?{}:Gi});if(!t.resolver&&e.validate&&await A({name:V,eventType:I.type}),!Ct&&ya&&v.state.next({...r}),t.resolver){const{errors:ec}=await R([V]);if(p([V]),te(Vt),ne){const ba=Wx(r.errors,n,V),Kr=Wx(ec,n,ba.name||V);Ne=Kr.error,V=Kr.name,Ze=Ft(ec)}}else p([V],!0),Ne=(await Kx(ie,a.disabled,i,x,t.shouldUseNativeValidation))[V],p([V]),te(Vt),ne&&(Ne?Ze=!1:(d.isValid||_.isValid)&&(Ze=await L({fields:n,onlyCheckValid:!0,name:V,eventType:I.type})));ne&&(ie._f.deps&&(!Array.isArray(ie._f.deps)||ie._f.deps.length>0)&&J(ie._f.deps),E(V,Ze,Ne,Gi))}},Y=(I,H)=>{if(le(r.errors,H)&&I.focus)return I.focus(),1},J=async(I,H={})=>{let V,ne;const ie=rl(I);if(t.resolver){const te=await M(et(I)?I:ie);V=Ft(te),ne=I?!ie.some(ce=>le(te,ce)):V}else I?(ne=(await Promise.all(ie.map(async te=>{const ce=le(n,te);return await L({fields:ce&&ce._f?{[te]:ce}:ce,eventType:vs.TRIGGER})}))).every(Boolean),!(!ne&&!r.isValid)&&f()):ne=V=await L({fields:n,name:I,eventType:vs.TRIGGER});return v.state.next({...!zt(I)||(d.isValid||_.isValid)&&V!==r.isValid?{}:{name:I},...t.resolver||!I?{isValid:V}:{},errors:r.errors}),H.shouldFocus&&!ne&&nl(n,Y,I?ie:a.mount),ne},re=(I,H)=>{let V={...l.mount?i:s};return H&&(V=fk(H.dirtyFields?r.dirtyFields:r.touchedFields,V)),et(I)?V:zt(I)?le(V,I):I.map(ne=>le(V,ne))},ye=(I,H)=>({invalid:!!le((H||r).errors,I),isDirty:!!le((H||r).dirtyFields,I),error:le((H||r).errors,I),isValidating:!!le(r.validatingFields,I),isTouched:!!le((H||r).touchedFields,I)}),P=I=>{const H=I?rl(I):void 0;H==null||H.forEach(V=>vt(r.errors,V)),H?H.forEach(V=>{v.state.next({name:V,errors:r.errors})}):v.state.next({errors:{}})},z=(I,H,V)=>{const ne=(le(n,I,{_f:{}})._f||{}).ref,ie=le(r.errors,I)||{},{ref:te,message:ce,type:fe,...Ne}=ie;Ue(r.errors,I,{...Ne,...H,ref:ne}),v.state.next({name:I,errors:r.errors,isValid:!1}),V&&V.shouldFocus&&ne&&ne.focus&&ne.focus()},G=(I,H)=>$t(I)?v.state.subscribe({next:V=>"values"in V&&I(V.values||W(void 0,H),V)}):W(I,H,!0),K=I=>v.state.subscribe({next:H=>{if(_4(I.name,H.name,I.exact)&&v4(H,I.formState||d,Dn,I.reRenderRoot)){const V={...i};I.callback({values:V,...r,...H,defaultValues:s})}}}).unsubscribe,Q=I=>(l.mount=!0,_={..._,...I.formState},K({...I,formState:{...g,...I.formState}})),ee=(I,H={})=>{for(const V of I?rl(I):a.mount)a.mount.delete(V),a.array.delete(V),H.keepValue||(vt(n,V),vt(i,V)),!H.keepError&&vt(r.errors,V),!H.keepDirty&&vt(r.dirtyFields,V),!H.keepTouched&&vt(r.touchedFields,V),!H.keepIsValidating&&vt(r.validatingFields,V),!t.shouldUnregister&&!H.keepDefaultValue&&vt(s,V);v.state.next({values:mt(i)}),v.state.next({...r,...H.keepDirty?{isDirty:U()}:{}}),!H.keepIsValid&&f()},de=({disabled:I,name:H})=>{if(mr(I)&&l.mount||I||a.disabled.has(H)){const ie=a.disabled.has(H)!==!!I;I?a.disabled.add(H):a.disabled.delete(H),ie&&l.mount&&!l.action&&f()}},De=(I,H={})=>{let V=le(n,I);const ne=mr(H.disabled)||mr(t.disabled),ie=!a.registerName.has(I)&&V&&V._f&&!V._f.mount;return Ue(n,I,{...V||{},_f:{...V&&V._f?V._f:{ref:{name:I}},name:I,mount:!0,...H}}),a.mount.add(I),V&&!ie?de({disabled:mr(H.disabled)?H.disabled:t.disabled,name:I}):j(I,!0,H.value),{...ne?{disabled:H.disabled||t.disabled}:{},...t.progressive?{required:!!H.required,min:Ia(H.min),max:Ia(H.max),minLength:Ia(H.minLength),maxLength:Ia(H.maxLength),pattern:Ia(H.pattern)}:{},name:I,onChange:$,onBlur:$,ref:te=>{if(te){a.registerName.add(I),De(I,H),a.registerName.delete(I),V=le(n,I);const ce=et(te.value)&&te.querySelectorAll&&te.querySelectorAll("input,select,textarea")[0]||te,fe=u4(ce),Ne=V._f.refs||[];if(fe?Ne.find(Ze=>Ze===ce):ce===V._f.ref)return;Ue(n,I,{_f:{...V._f,...fe?{refs:[...Ne.filter(kh),ce,...Array.isArray(le(s,I))?[{}]:[]],ref:{type:ce.type,name:I}}:{ref:ce}}}),j(I,!1,void 0,ce)}else V=le(n,I,{}),V._f&&(V._f.mount=!1),(t.shouldUnregister||H.shouldUnregister)&&!(ap(a.array,I).length&&l.action)&&a.unMount.add(I)}}},He=()=>t.shouldFocusError&&!t.shouldUseNativeValidation&&nl(n,Y,a.mount),Lt=I=>{mr(I)&&(v.state.next({disabled:I}),nl(n,(H,V)=>{const ne=le(n,V);ne&&(H.disabled=ne._f.disabled||I,Array.isArray(ne._f.refs)&&ne._f.refs.forEach(ie=>{ie.disabled=ne._f.disabled||I}))},0,!1))},Se=(I,H)=>async V=>{let ne;V&&(V.preventDefault&&V.preventDefault(),V.persist&&V.persist());let ie=mt(i);if(v.state.next({isSubmitting:!0}),t.resolver){const{errors:te,values:ce}=await R();p(),r.errors=te,ie=mt(ce)}else await L({fields:n,eventType:vs.SUBMIT});if(a.disabled.size)for(const te of a.disabled)vt(ie,te);if(vt(r.errors,uk),Ft(r.errors)){v.state.next({errors:{}});try{await I(ie,V)}catch(te){ne=te}}else H&&await H({...r.errors},V),He(),setTimeout(He);if(v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Ft(r.errors)&&!ne,submitCount:r.submitCount+1,errors:r.errors}),ne)throw ne},ur=(I,H={})=>{le(n,I)&&(et(H.defaultValue)?D(I,mt(le(s,I))):(D(I,H.defaultValue),Ue(s,I,mt(H.defaultValue))),H.keepTouched||vt(r.touchedFields,I),H.keepDirty||(vt(r.dirtyFields,I),r.isDirty=H.defaultValue?U(I,mt(le(s,I))):U()),H.keepError||(vt(r.errors,I),d.isValid&&f()),v.state.next({...r}))},dr=(I,H={})=>{const V=I?mt(I):s,ne=mt(V),ie=Ft(I),te=ie?s:ne;if(H.keepDefaultValues||(s=V),!H.keepValues){if(H.keepDirtyValues){const ce=new Set([...a.mount,...Object.keys(io(s,i))]);for(const fe of Array.from(ce)){const Ne=le(r.dirtyFields,fe),Ze=le(i,fe),Vt=le(te,fe);Ne&&!et(Ze)?Ue(te,fe,Ze):!Ne&&!et(Vt)&&D(fe,Vt)}}else{if(Tg&&et(I))for(const ce of a.mount){const fe=le(n,ce);if(fe&&fe._f){const Ne=Array.isArray(fe._f.refs)?fe._f.refs[0]:fe._f.ref;if(Ou(Ne)){const Ze=Ne.closest("form");if(Ze){Ze.reset();break}}}}if(H.keepFieldsRef)for(const ce of a.mount)D(ce,le(te,ce));else n={}}i=t.shouldUnregister?H.keepDefaultValues?mt(s):{}:mt(te),v.array.next({values:{...te}}),v.state.next({values:{...te}})}a={mount:H.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},l.mount=!d.isValid||!!H.keepIsValid||!!H.keepDirtyValues||!t.shouldUnregister&&!Ft(te),l.watch=!!t.shouldUnregister,l.keepIsValid=!!H.keepIsValid,l.action=!1,H.keepErrors||(r.errors={}),v.state.next({submitCount:H.keepSubmitCount?r.submitCount:0,isDirty:ie?!1:H.keepDirty?r.isDirty:!!(H.keepDefaultValues&&!gr(I,s)),isSubmitted:H.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:ie?{}:H.keepDirtyValues?H.keepDefaultValues&&i?io(s,i):r.dirtyFields:H.keepDefaultValues&&I?io(s,I):H.keepDirty?r.dirtyFields:{},touchedFields:H.keepTouched?r.touchedFields:{},errors:H.keepErrors?r.errors:{},isSubmitSuccessful:H.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},An=(I,H)=>dr($t(I)?I(i):I,{...t.resetOptions,...H}),qr=(I,H={})=>{const V=le(n,I),ne=V&&V._f;if(ne){const ie=ne.refs?ne.refs[0]:ne.ref;ie.focus&&setTimeout(()=>{ie.focus(),H.shouldSelect&&$t(ie.select)&&ie.select()})}},Dn=I=>{r={...r,...I}},mn={control:{register:De,unregister:ee,getFieldState:ye,handleSubmit:Se,setError:z,_subscribe:K,_runSchema:R,_updateIsValidating:p,_focusError:He,_getWatch:W,_getDirty:U,_setValid:f,_setFieldArray:m,_setDisabledField:de,_setErrors:w,_getFieldArray:q,_reset:dr,_resetDefaultValues:()=>$t(t.defaultValues)&&t.defaultValues().then(I=>{An(I,t.resetOptions),v.state.next({isLoading:!1})}),_removeUnmounted:B,_disableForm:Lt,_subjects:v,_proxyFormState:d,get _fields(){return n},get _formValues(){return i},get _state(){return l},set _state(I){l=I},get _defaultValues(){return s},get _names(){return a},set _names(I){a=I},get _formState(){return r},get _options(){return t},set _options(I){t={...t,...I}}},subscribe:Q,trigger:J,register:De,handleSubmit:Se,watch:G,setValue:D,setValues:O,getValues:re,reset:An,resetField:ur,clearErrors:P,unregister:ee,setError:z,setFocus:qr,getFieldState:ye};return{...mn,formControl:mn}}function S4(e={}){const t=Z.useRef(void 0),r=Z.useRef(void 0),[n,s]=Z.useState(()=>({...mt(xk),isLoading:$t(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:$t(e.defaultValues)?void 0:e.defaultValues}));if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!$t(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:l,...a}=w4(e);t.current={...a,formState:n}}const i=t.current.control;return i._options=e,Mg(()=>{const l=i._subscribe({formState:i._proxyFormState,callback:()=>s({...i._formState,defaultValues:i._defaultValues}),reRenderRoot:!0});return s(a=>({...a,isReady:!0})),i._formState.isReady=!0,l},[i]),Z.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),Z.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),Z.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),Z.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),Z.useEffect(()=>{if(i._proxyFormState.isDirty){const l=i._getDirty();l!==n.isDirty&&i._subjects.state.next({isDirty:l})}},[i,n.isDirty]),Z.useEffect(()=>{var l;e.values&&!gr(e.values,r.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),!((l=i._options.resetOptions)===null||l===void 0)&&l.keepIsValid||i._setValid(),r.current=e.values,s(a=>({...a}))):i._resetDefaultValues()},[i,e.values]),Z.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=Z.useMemo(()=>dk(n,i),[i,n]),t.current}const Gx=(e,t,r)=>{if(e&&"reportValidity"in e){const n=le(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},yk=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?Gx(n.ref,r,e):n.refs&&n.refs.forEach(s=>Gx(s,r,e))}},C4=(e,t)=>{t.shouldUseNativeValidation&&yk(e,t);const r={};for(const n in e){const s=le(t.fields,n),i=Object.assign(e[n]||{},{ref:s&&s.ref});if(k4(t.names||Object.keys(e),n)){const l=Object.assign({},le(r,n));Ue(l,"root",i),Ue(r,n,l)}else Ue(r,n,i)}return r},k4=(e,t)=>e.some(r=>r.startsWith(t+"."));var E4=function(e,t){for(var r={};e.length;){var n=e[0],s=n.code,i=n.message,l=n.path.join(".");if(!r[l])if("unionErrors"in n){var a=n.unionErrors[0].errors[0];r[l]={message:a.message,type:a.code}}else r[l]={message:i,type:s};if("unionErrors"in n&&n.unionErrors.forEach(function(g){return g.errors.forEach(function(d){return e.push(d)})}),t){var c=r[l].types,u=c&&c[n.code];r[l]=hk(l,t,r,s,u?[].concat(u,n.message):n.message)}e.shift()}return r},j4=function(e,t,r){return r===void 0&&(r={}),function(n,s,i){try{return Promise.resolve(function(l,a){try{var c=Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(u){return i.shouldUseNativeValidation&&yk({},i),{errors:{},values:r.raw?n:u}})}catch(u){return a(u)}return c&&c.then?c.then(void 0,a):c}(0,function(l){if(function(a){return Array.isArray(a==null?void 0:a.errors)}(l))return{values:{},errors:C4(E4(l.errors,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw l}))}catch(l){return Promise.reject(l)}}},Fe;(function(e){e.assertEqual=s=>{};function t(s){}e.assertIs=t;function r(s){throw new Error}e.assertNever=r,e.arrayToEnum=s=>{const i={};for(const l of s)i[l]=l;return i},e.getValidEnumValues=s=>{const i=e.objectKeys(s).filter(a=>typeof s[s[a]]!="number"),l={};for(const a of i)l[a]=s[a];return e.objectValues(l)},e.objectValues=s=>e.objectKeys(s).map(function(i){return s[i]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const i=[];for(const l in s)Object.prototype.hasOwnProperty.call(s,l)&&i.push(l);return i},e.find=(s,i)=>{for(const l of s)if(i(l))return l},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,i=" | "){return s.map(l=>typeof l=="string"?`'${l}'`:l).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(Fe||(Fe={}));var Qx;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Qx||(Qx={}));const me=Fe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),_s=e=>{switch(typeof e){case"undefined":return me.undefined;case"string":return me.string;case"number":return Number.isNaN(e)?me.nan:me.number;case"boolean":return me.boolean;case"function":return me.function;case"bigint":return me.bigint;case"symbol":return me.symbol;case"object":return Array.isArray(e)?me.array:e===null?me.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?me.promise:typeof Map<"u"&&e instanceof Map?me.map:typeof Set<"u"&&e instanceof Set?me.set:typeof Date<"u"&&e instanceof Date?me.date:me.object;default:return me.unknown}},oe=Fe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class rs extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){const r=t||function(i){return i.message},n={_errors:[]},s=i=>{for(const l of i.issues)if(l.code==="invalid_union")l.unionErrors.map(s);else if(l.code==="invalid_return_type")s(l.returnTypeError);else if(l.code==="invalid_arguments")s(l.argumentsError);else if(l.path.length===0)n._errors.push(r(l));else{let a=n,c=0;for(;c<l.path.length;){const u=l.path[c];c===l.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(l))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return s(this),n}static assert(t){if(!(t instanceof rs))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Fe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){const r={},n=[];for(const s of this.issues)if(s.path.length>0){const i=s.path[0];r[i]=r[i]||[],r[i].push(t(s))}else n.push(t(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}rs.create=e=>new rs(e);const hp=(e,t)=>{let r;switch(e.code){case oe.invalid_type:e.received===me.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case oe.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Fe.jsonStringifyReplacer)}`;break;case oe.unrecognized_keys:r=`Unrecognized key(s) in object: ${Fe.joinValues(e.keys,", ")}`;break;case oe.invalid_union:r="Invalid input";break;case oe.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Fe.joinValues(e.options)}`;break;case oe.invalid_enum_value:r=`Invalid enum value. Expected ${Fe.joinValues(e.options)}, received '${e.received}'`;break;case oe.invalid_arguments:r="Invalid function arguments";break;case oe.invalid_return_type:r="Invalid function return type";break;case oe.invalid_date:r="Invalid date";break;case oe.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:Fe.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case oe.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case oe.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case oe.custom:r="Invalid input";break;case oe.invalid_intersection_types:r="Intersection results could not be merged";break;case oe.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case oe.not_finite:r="Number must be finite";break;default:r=t.defaultError,Fe.assertNever(e)}return{message:r}};let N4=hp;function R4(){return N4}const P4=e=>{const{data:t,path:r,errorMaps:n,issueData:s}=e,i=[...r,...s.path||[]],l={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let a="";const c=n.filter(u=>!!u).slice().reverse();for(const u of c)a=u(l,{data:t,defaultError:a}).message;return{...s,path:i,message:a}};function he(e,t){const r=R4(),n=P4({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===hp?void 0:hp].filter(s=>!!s)});e.common.issues.push(n)}class kr{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const n=[];for(const s of r){if(s.status==="aborted")return Ce;s.status==="dirty"&&t.dirty(),n.push(s.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const s of r){const i=await s.key,l=await s.value;n.push({key:i,value:l})}return kr.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const s of r){const{key:i,value:l}=s;if(i.status==="aborted"||l.status==="aborted")return Ce;i.status==="dirty"&&t.dirty(),l.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof l.value<"u"||s.alwaysSet)&&(n[i.value]=l.value)}return{status:t.value,value:n}}}const Ce=Object.freeze({status:"aborted"}),qa=e=>({status:"dirty",value:e}),Vr=e=>({status:"valid",value:e}),Yx=e=>e.status==="aborted",Zx=e=>e.status==="dirty",ia=e=>e.status==="valid",Fu=e=>typeof Promise<"u"&&e instanceof Promise;var ve;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(ve||(ve={}));class Xs{constructor(t,r,n,s){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Xx=(e,t)=>{if(ia(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new rs(e.common.issues);return this._error=r,this._error}}};function Te(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:s}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(l,a)=>{const{message:c}=e;return l.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??n??a.defaultError}:l.code!=="invalid_type"?{message:a.defaultError}:{message:c??r??a.defaultError}},description:s}}class Ie{get description(){return this._def.description}_getType(t){return _s(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:_s(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new kr,ctx:{common:t.parent.common,data:t.data,parsedType:_s(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(Fu(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){const n={common:{issues:[],async:(r==null?void 0:r.async)??!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:_s(t)},s=this._parseSync({data:t,path:n.path,parent:n});return Xx(n,s)}"~validate"(t){var n,s;const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:_s(t)};if(!this["~standard"].async)try{const i=this._parseSync({data:t,path:[],parent:r});return ia(i)?{value:i.value}:{issues:r.common.issues}}catch(i){(s=(n=i==null?void 0:i.message)==null?void 0:n.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(i=>ia(i)?{value:i.value}:{issues:r.common.issues})}async parseAsync(t,r){const n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:_s(t)},s=this._parse({data:t,path:n.path,parent:n}),i=await(Fu(s)?s:Promise.resolve(s));return Xx(n,i)}refine(t,r){const n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,i)=>{const l=t(s),a=()=>i.addIssue({code:oe.custom,...n(s)});return typeof Promise<"u"&&l instanceof Promise?l.then(c=>c?!0:(a(),!1)):l?!0:(a(),!1)})}refinement(t,r){return this._refinement((n,s)=>t(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(t){return new aa({schema:this,typeName:ke.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Vs.create(this,this._def)}nullable(){return la.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Nn.create(this)}promise(){return zu.create(this,this._def)}or(t){return $u.create([this,t],this._def)}and(t){return Hu.create(this,t,this._def)}transform(t){return new aa({...Te(this._def),schema:this,typeName:ke.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new pp({...Te(this._def),innerType:this,defaultValue:r,typeName:ke.ZodDefault})}brand(){return new J4({typeName:ke.ZodBranded,type:this,...Te(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new mp({...Te(this._def),innerType:this,catchValue:r,typeName:ke.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Bg.create(this,t)}readonly(){return gp.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const T4=/^c[^\s-]{8,}$/i,A4=/^[0-9a-z]+$/,D4=/^[0-9A-HJKMNP-TV-Z]{26}$/i,L4=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,M4=/^[a-z0-9_-]{21}$/i,O4=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,I4=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,F4=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,B4="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Eh;const $4=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,H4=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,z4=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,U4=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,W4=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,V4=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,bk="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",q4=new RegExp(`^${bk}$`);function wk(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function K4(e){return new RegExp(`^${wk(e)}$`)}function G4(e){let t=`${bk}T${wk(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function Q4(e,t){return!!((t==="v4"||!t)&&$4.test(e)||(t==="v6"||!t)&&z4.test(e))}function Y4(e,t){if(!O4.test(e))return!1;try{const[r]=e.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||t&&s.alg!==t)}catch{return!1}}function Z4(e,t){return!!((t==="v4"||!t)&&H4.test(e)||(t==="v6"||!t)&&U4.test(e))}class Ds extends Ie{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==me.string){const i=this._getOrReturnCtx(t);return he(i,{code:oe.invalid_type,expected:me.string,received:i.parsedType}),Ce}const n=new kr;let s;for(const i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(s=this._getOrReturnCtx(t,s),he(s,{code:oe.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")t.data.length>i.value&&(s=this._getOrReturnCtx(t,s),he(s,{code:oe.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){const l=t.data.length>i.value,a=t.data.length<i.value;(l||a)&&(s=this._getOrReturnCtx(t,s),l?he(s,{code:oe.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&he(s,{code:oe.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")F4.test(t.data)||(s=this._getOrReturnCtx(t,s),he(s,{validation:"email",code:oe.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Eh||(Eh=new RegExp(B4,"u")),Eh.test(t.data)||(s=this._getOrReturnCtx(t,s),he(s,{validation:"emoji",code:oe.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")L4.test(t.data)||(s=this._getOrReturnCtx(t,s),he(s,{validation:"uuid",code:oe.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")M4.test(t.data)||(s=this._getOrReturnCtx(t,s),he(s,{validation:"nanoid",code:oe.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")T4.test(t.data)||(s=this._getOrReturnCtx(t,s),he(s,{validation:"cuid",code:oe.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")A4.test(t.data)||(s=this._getOrReturnCtx(t,s),he(s,{validation:"cuid2",code:oe.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")D4.test(t.data)||(s=this._getOrReturnCtx(t,s),he(s,{validation:"ulid",code:oe.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),he(s,{validation:"url",code:oe.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),he(s,{validation:"regex",code:oe.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(t,s),he(s,{code:oe.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(s=this._getOrReturnCtx(t,s),he(s,{code:oe.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(s=this._getOrReturnCtx(t,s),he(s,{code:oe.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?G4(i).test(t.data)||(s=this._getOrReturnCtx(t,s),he(s,{code:oe.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?q4.test(t.data)||(s=this._getOrReturnCtx(t,s),he(s,{code:oe.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?K4(i).test(t.data)||(s=this._getOrReturnCtx(t,s),he(s,{code:oe.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?I4.test(t.data)||(s=this._getOrReturnCtx(t,s),he(s,{validation:"duration",code:oe.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?Q4(t.data,i.version)||(s=this._getOrReturnCtx(t,s),he(s,{validation:"ip",code:oe.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?Y4(t.data,i.alg)||(s=this._getOrReturnCtx(t,s),he(s,{validation:"jwt",code:oe.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?Z4(t.data,i.version)||(s=this._getOrReturnCtx(t,s),he(s,{validation:"cidr",code:oe.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?W4.test(t.data)||(s=this._getOrReturnCtx(t,s),he(s,{validation:"base64",code:oe.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?V4.test(t.data)||(s=this._getOrReturnCtx(t,s),he(s,{validation:"base64url",code:oe.invalid_string,message:i.message}),n.dirty()):Fe.assertNever(i);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(s=>t.test(s),{validation:r,code:oe.invalid_string,...ve.errToObj(n)})}_addCheck(t){return new Ds({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...ve.errToObj(t)})}url(t){return this._addCheck({kind:"url",...ve.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...ve.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...ve.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...ve.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...ve.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...ve.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...ve.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...ve.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...ve.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...ve.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...ve.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...ve.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...ve.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...ve.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...ve.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...ve.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...ve.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...ve.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...ve.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...ve.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...ve.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...ve.errToObj(r)})}nonempty(t){return this.min(1,ve.errToObj(t))}trim(){return new Ds({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ds({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ds({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}Ds.create=e=>new Ds({checks:[],typeName:ke.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...Te(e)});function X4(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,s=r>n?r:n,i=Number.parseInt(e.toFixed(s).replace(".","")),l=Number.parseInt(t.toFixed(s).replace(".",""));return i%l/10**s}class Nl extends Ie{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==me.number){const i=this._getOrReturnCtx(t);return he(i,{code:oe.invalid_type,expected:me.number,received:i.parsedType}),Ce}let n;const s=new kr;for(const i of this._def.checks)i.kind==="int"?Fe.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),he(n,{code:oe.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),he(n,{code:oe.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),he(n,{code:oe.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?X4(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),he(n,{code:oe.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),he(n,{code:oe.not_finite,message:i.message}),s.dirty()):Fe.assertNever(i);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,ve.toString(r))}gt(t,r){return this.setLimit("min",t,!1,ve.toString(r))}lte(t,r){return this.setLimit("max",t,!0,ve.toString(r))}lt(t,r){return this.setLimit("max",t,!1,ve.toString(r))}setLimit(t,r,n,s){return new Nl({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:ve.toString(s)}]})}_addCheck(t){return new Nl({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:ve.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ve.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ve.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ve.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ve.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:ve.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:ve.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ve.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ve.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Fe.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}}Nl.create=e=>new Nl({checks:[],typeName:ke.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Te(e)});class Rl extends Ie{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==me.bigint)return this._getInvalidInput(t);let n;const s=new kr;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),he(n,{code:oe.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),he(n,{code:oe.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),he(n,{code:oe.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):Fe.assertNever(i);return{status:s.value,value:t.data}}_getInvalidInput(t){const r=this._getOrReturnCtx(t);return he(r,{code:oe.invalid_type,expected:me.bigint,received:r.parsedType}),Ce}gte(t,r){return this.setLimit("min",t,!0,ve.toString(r))}gt(t,r){return this.setLimit("min",t,!1,ve.toString(r))}lte(t,r){return this.setLimit("max",t,!0,ve.toString(r))}lt(t,r){return this.setLimit("max",t,!1,ve.toString(r))}setLimit(t,r,n,s){return new Rl({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:ve.toString(s)}]})}_addCheck(t){return new Rl({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ve.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ve.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ve.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ve.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:ve.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}Rl.create=e=>new Rl({checks:[],typeName:ke.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...Te(e)});class Jx extends Ie{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==me.boolean){const n=this._getOrReturnCtx(t);return he(n,{code:oe.invalid_type,expected:me.boolean,received:n.parsedType}),Ce}return Vr(t.data)}}Jx.create=e=>new Jx({typeName:ke.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Te(e)});class Bu extends Ie{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==me.date){const i=this._getOrReturnCtx(t);return he(i,{code:oe.invalid_type,expected:me.date,received:i.parsedType}),Ce}if(Number.isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return he(i,{code:oe.invalid_date}),Ce}const n=new kr;let s;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(s=this._getOrReturnCtx(t,s),he(s,{code:oe.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(s=this._getOrReturnCtx(t,s),he(s,{code:oe.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):Fe.assertNever(i);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Bu({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:ve.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:ve.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}}Bu.create=e=>new Bu({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:ke.ZodDate,...Te(e)});class ey extends Ie{_parse(t){if(this._getType(t)!==me.symbol){const n=this._getOrReturnCtx(t);return he(n,{code:oe.invalid_type,expected:me.symbol,received:n.parsedType}),Ce}return Vr(t.data)}}ey.create=e=>new ey({typeName:ke.ZodSymbol,...Te(e)});class ty extends Ie{_parse(t){if(this._getType(t)!==me.undefined){const n=this._getOrReturnCtx(t);return he(n,{code:oe.invalid_type,expected:me.undefined,received:n.parsedType}),Ce}return Vr(t.data)}}ty.create=e=>new ty({typeName:ke.ZodUndefined,...Te(e)});class ry extends Ie{_parse(t){if(this._getType(t)!==me.null){const n=this._getOrReturnCtx(t);return he(n,{code:oe.invalid_type,expected:me.null,received:n.parsedType}),Ce}return Vr(t.data)}}ry.create=e=>new ry({typeName:ke.ZodNull,...Te(e)});class ny extends Ie{constructor(){super(...arguments),this._any=!0}_parse(t){return Vr(t.data)}}ny.create=e=>new ny({typeName:ke.ZodAny,...Te(e)});class sy extends Ie{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Vr(t.data)}}sy.create=e=>new sy({typeName:ke.ZodUnknown,...Te(e)});class Js extends Ie{_parse(t){const r=this._getOrReturnCtx(t);return he(r,{code:oe.invalid_type,expected:me.never,received:r.parsedType}),Ce}}Js.create=e=>new Js({typeName:ke.ZodNever,...Te(e)});class iy extends Ie{_parse(t){if(this._getType(t)!==me.undefined){const n=this._getOrReturnCtx(t);return he(n,{code:oe.invalid_type,expected:me.void,received:n.parsedType}),Ce}return Vr(t.data)}}iy.create=e=>new iy({typeName:ke.ZodVoid,...Te(e)});class Nn extends Ie{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),s=this._def;if(r.parsedType!==me.array)return he(r,{code:oe.invalid_type,expected:me.array,received:r.parsedType}),Ce;if(s.exactLength!==null){const l=r.data.length>s.exactLength.value,a=r.data.length<s.exactLength.value;(l||a)&&(he(r,{code:l?oe.too_big:oe.too_small,minimum:a?s.exactLength.value:void 0,maximum:l?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&(he(r,{code:oe.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&(he(r,{code:oe.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((l,a)=>s.type._parseAsync(new Xs(r,l,r.path,a)))).then(l=>kr.mergeArray(n,l));const i=[...r.data].map((l,a)=>s.type._parseSync(new Xs(r,l,r.path,a)));return kr.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new Nn({...this._def,minLength:{value:t,message:ve.toString(r)}})}max(t,r){return new Nn({...this._def,maxLength:{value:t,message:ve.toString(r)}})}length(t,r){return new Nn({...this._def,exactLength:{value:t,message:ve.toString(r)}})}nonempty(t){return this.min(1,t)}}Nn.create=(e,t)=>new Nn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ke.ZodArray,...Te(t)});function oo(e){if(e instanceof _t){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=Vs.create(oo(n))}return new _t({...e._def,shape:()=>t})}else return e instanceof Nn?new Nn({...e._def,type:oo(e.element)}):e instanceof Vs?Vs.create(oo(e.unwrap())):e instanceof la?la.create(oo(e.unwrap())):e instanceof Ii?Ii.create(e.items.map(t=>oo(t))):e}class _t extends Ie{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),r=Fe.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==me.object){const u=this._getOrReturnCtx(t);return he(u,{code:oe.invalid_type,expected:me.object,received:u.parsedType}),Ce}const{status:n,ctx:s}=this._processInputParams(t),{shape:i,keys:l}=this._getCached(),a=[];if(!(this._def.catchall instanceof Js&&this._def.unknownKeys==="strip"))for(const u in s.data)l.includes(u)||a.push(u);const c=[];for(const u of l){const g=i[u],d=s.data[u];c.push({key:{status:"valid",value:u},value:g._parse(new Xs(s,d,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof Js){const u=this._def.unknownKeys;if(u==="passthrough")for(const g of a)c.push({key:{status:"valid",value:g},value:{status:"valid",value:s.data[g]}});else if(u==="strict")a.length>0&&(he(s,{code:oe.unrecognized_keys,keys:a}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const g of a){const d=s.data[g];c.push({key:{status:"valid",value:g},value:u._parse(new Xs(s,d,s.path,g)),alwaysSet:g in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const u=[];for(const g of c){const d=await g.key,_=await g.value;u.push({key:d,value:_,alwaysSet:g.alwaysSet})}return u}).then(u=>kr.mergeObjectSync(n,u)):kr.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return ve.errToObj,new _t({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var i,l;const s=((l=(i=this._def).errorMap)==null?void 0:l.call(i,r,n).message)??n.defaultError;return r.code==="unrecognized_keys"?{message:ve.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new _t({...this._def,unknownKeys:"strip"})}passthrough(){return new _t({...this._def,unknownKeys:"passthrough"})}extend(t){return new _t({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new _t({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:ke.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new _t({...this._def,catchall:t})}pick(t){const r={};for(const n of Fe.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new _t({...this._def,shape:()=>r})}omit(t){const r={};for(const n of Fe.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new _t({...this._def,shape:()=>r})}deepPartial(){return oo(this)}partial(t){const r={};for(const n of Fe.objectKeys(this.shape)){const s=this.shape[n];t&&!t[n]?r[n]=s:r[n]=s.optional()}return new _t({...this._def,shape:()=>r})}required(t){const r={};for(const n of Fe.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof Vs;)i=i._def.innerType;r[n]=i}return new _t({...this._def,shape:()=>r})}keyof(){return Sk(Fe.objectKeys(this.shape))}}_t.create=(e,t)=>new _t({shape:()=>e,unknownKeys:"strip",catchall:Js.create(),typeName:ke.ZodObject,...Te(t)});_t.strictCreate=(e,t)=>new _t({shape:()=>e,unknownKeys:"strict",catchall:Js.create(),typeName:ke.ZodObject,...Te(t)});_t.lazycreate=(e,t)=>new _t({shape:e,unknownKeys:"strip",catchall:Js.create(),typeName:ke.ZodObject,...Te(t)});class $u extends Ie{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function s(i){for(const a of i)if(a.result.status==="valid")return a.result;for(const a of i)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;const l=i.map(a=>new rs(a.ctx.common.issues));return he(r,{code:oe.invalid_union,unionErrors:l}),Ce}if(r.common.async)return Promise.all(n.map(async i=>{const l={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:l}),ctx:l}})).then(s);{let i;const l=[];for(const c of n){const u={...r,common:{...r.common,issues:[]},parent:null},g=c._parseSync({data:r.data,path:r.path,parent:u});if(g.status==="valid")return g;g.status==="dirty"&&!i&&(i={result:g,ctx:u}),u.common.issues.length&&l.push(u.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;const a=l.map(c=>new rs(c));return he(r,{code:oe.invalid_union,unionErrors:a}),Ce}}get options(){return this._def.options}}$u.create=(e,t)=>new $u({options:e,typeName:ke.ZodUnion,...Te(t)});function fp(e,t){const r=_s(e),n=_s(t);if(e===t)return{valid:!0,data:e};if(r===me.object&&n===me.object){const s=Fe.objectKeys(t),i=Fe.objectKeys(e).filter(a=>s.indexOf(a)!==-1),l={...e,...t};for(const a of i){const c=fp(e[a],t[a]);if(!c.valid)return{valid:!1};l[a]=c.data}return{valid:!0,data:l}}else if(r===me.array&&n===me.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let i=0;i<e.length;i++){const l=e[i],a=t[i],c=fp(l,a);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return r===me.date&&n===me.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Hu extends Ie{_parse(t){const{status:r,ctx:n}=this._processInputParams(t),s=(i,l)=>{if(Yx(i)||Yx(l))return Ce;const a=fp(i.value,l.value);return a.valid?((Zx(i)||Zx(l))&&r.dirty(),{status:r.value,value:a.data}):(he(n,{code:oe.invalid_intersection_types}),Ce)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,l])=>s(i,l)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Hu.create=(e,t,r)=>new Hu({left:e,right:t,typeName:ke.ZodIntersection,...Te(r)});class Ii extends Ie{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==me.array)return he(n,{code:oe.invalid_type,expected:me.array,received:n.parsedType}),Ce;if(n.data.length<this._def.items.length)return he(n,{code:oe.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ce;!this._def.rest&&n.data.length>this._def.items.length&&(he(n,{code:oe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const i=[...n.data].map((l,a)=>{const c=this._def.items[a]||this._def.rest;return c?c._parse(new Xs(n,l,n.path,a)):null}).filter(l=>!!l);return n.common.async?Promise.all(i).then(l=>kr.mergeArray(r,l)):kr.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new Ii({...this._def,rest:t})}}Ii.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ii({items:e,typeName:ke.ZodTuple,rest:null,...Te(t)})};class oy extends Ie{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==me.map)return he(n,{code:oe.invalid_type,expected:me.map,received:n.parsedType}),Ce;const s=this._def.keyType,i=this._def.valueType,l=[...n.data.entries()].map(([a,c],u)=>({key:s._parse(new Xs(n,a,n.path,[u,"key"])),value:i._parse(new Xs(n,c,n.path,[u,"value"]))}));if(n.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const c of l){const u=await c.key,g=await c.value;if(u.status==="aborted"||g.status==="aborted")return Ce;(u.status==="dirty"||g.status==="dirty")&&r.dirty(),a.set(u.value,g.value)}return{status:r.value,value:a}})}else{const a=new Map;for(const c of l){const u=c.key,g=c.value;if(u.status==="aborted"||g.status==="aborted")return Ce;(u.status==="dirty"||g.status==="dirty")&&r.dirty(),a.set(u.value,g.value)}return{status:r.value,value:a}}}}oy.create=(e,t,r)=>new oy({valueType:t,keyType:e,typeName:ke.ZodMap,...Te(r)});class Pl extends Ie{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==me.set)return he(n,{code:oe.invalid_type,expected:me.set,received:n.parsedType}),Ce;const s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(he(n,{code:oe.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(he(n,{code:oe.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());const i=this._def.valueType;function l(c){const u=new Set;for(const g of c){if(g.status==="aborted")return Ce;g.status==="dirty"&&r.dirty(),u.add(g.value)}return{status:r.value,value:u}}const a=[...n.data.values()].map((c,u)=>i._parse(new Xs(n,c,n.path,u)));return n.common.async?Promise.all(a).then(c=>l(c)):l(a)}min(t,r){return new Pl({...this._def,minSize:{value:t,message:ve.toString(r)}})}max(t,r){return new Pl({...this._def,maxSize:{value:t,message:ve.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}Pl.create=(e,t)=>new Pl({valueType:e,minSize:null,maxSize:null,typeName:ke.ZodSet,...Te(t)});class ay extends Ie{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}ay.create=(e,t)=>new ay({getter:e,typeName:ke.ZodLazy,...Te(t)});class ly extends Ie{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return he(r,{received:r.data,code:oe.invalid_literal,expected:this._def.value}),Ce}return{status:"valid",value:t.data}}get value(){return this._def.value}}ly.create=(e,t)=>new ly({value:e,typeName:ke.ZodLiteral,...Te(t)});function Sk(e,t){return new oa({values:e,typeName:ke.ZodEnum,...Te(t)})}class oa extends Ie{_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return he(r,{expected:Fe.joinValues(n),received:r.parsedType,code:oe.invalid_type}),Ce}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return he(r,{received:r.data,code:oe.invalid_enum_value,options:n}),Ce}return Vr(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return oa.create(t,{...this._def,...r})}exclude(t,r=this._def){return oa.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}oa.create=Sk;class cy extends Ie{_parse(t){const r=Fe.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==me.string&&n.parsedType!==me.number){const s=Fe.objectValues(r);return he(n,{expected:Fe.joinValues(s),received:n.parsedType,code:oe.invalid_type}),Ce}if(this._cache||(this._cache=new Set(Fe.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const s=Fe.objectValues(r);return he(n,{received:n.data,code:oe.invalid_enum_value,options:s}),Ce}return Vr(t.data)}get enum(){return this._def.values}}cy.create=(e,t)=>new cy({values:e,typeName:ke.ZodNativeEnum,...Te(t)});class zu extends Ie{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==me.promise&&r.common.async===!1)return he(r,{code:oe.invalid_type,expected:me.promise,received:r.parsedType}),Ce;const n=r.parsedType===me.promise?r.data:Promise.resolve(r.data);return Vr(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}}zu.create=(e,t)=>new zu({type:e,typeName:ke.ZodPromise,...Te(t)});class aa extends Ie{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ke.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),s=this._def.effect||null,i={addIssue:l=>{he(n,l),l.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){const l=s.transform(n.data,i);if(n.common.async)return Promise.resolve(l).then(async a=>{if(r.value==="aborted")return Ce;const c=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return c.status==="aborted"?Ce:c.status==="dirty"||r.value==="dirty"?qa(c.value):c});{if(r.value==="aborted")return Ce;const a=this._def.schema._parseSync({data:l,path:n.path,parent:n});return a.status==="aborted"?Ce:a.status==="dirty"||r.value==="dirty"?qa(a.value):a}}if(s.type==="refinement"){const l=a=>{const c=s.refinement(a,i);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Ce:(a.status==="dirty"&&r.dirty(),l(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?Ce:(a.status==="dirty"&&r.dirty(),l(a.value).then(()=>({status:r.value,value:a.value}))))}if(s.type==="transform")if(n.common.async===!1){const l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!ia(l))return Ce;const a=s.transform(l.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>ia(l)?Promise.resolve(s.transform(l.value,i)).then(a=>({status:r.value,value:a})):Ce);Fe.assertNever(s)}}aa.create=(e,t,r)=>new aa({schema:e,typeName:ke.ZodEffects,effect:t,...Te(r)});aa.createWithPreprocess=(e,t,r)=>new aa({schema:t,effect:{type:"preprocess",transform:e},typeName:ke.ZodEffects,...Te(r)});class Vs extends Ie{_parse(t){return this._getType(t)===me.undefined?Vr(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Vs.create=(e,t)=>new Vs({innerType:e,typeName:ke.ZodOptional,...Te(t)});class la extends Ie{_parse(t){return this._getType(t)===me.null?Vr(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}la.create=(e,t)=>new la({innerType:e,typeName:ke.ZodNullable,...Te(t)});class pp extends Ie{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===me.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}pp.create=(e,t)=>new pp({innerType:e,typeName:ke.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Te(t)});class mp extends Ie{_parse(t){const{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Fu(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new rs(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new rs(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}mp.create=(e,t)=>new mp({innerType:e,typeName:ke.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Te(t)});class uy extends Ie{_parse(t){if(this._getType(t)!==me.nan){const n=this._getOrReturnCtx(t);return he(n,{code:oe.invalid_type,expected:me.nan,received:n.parsedType}),Ce}return{status:"valid",value:t.data}}}uy.create=e=>new uy({typeName:ke.ZodNaN,...Te(e)});class J4 extends Ie{_parse(t){const{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class Bg extends Ie{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?Ce:i.status==="dirty"?(r.dirty(),qa(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{const s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?Ce:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(t,r){return new Bg({in:t,out:r,typeName:ke.ZodPipeline})}}class gp extends Ie{_parse(t){const r=this._def.innerType._parse(t),n=s=>(ia(s)&&(s.value=Object.freeze(s.value)),s);return Fu(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}}gp.create=(e,t)=>new gp({innerType:e,typeName:ke.ZodReadonly,...Te(t)});var ke;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(ke||(ke={}));const dy=Ds.create;Js.create;Nn.create;const eF=_t.create;$u.create;Hu.create;Ii.create;oa.create;zu.create;Vs.create;la.create;const tF=c4,Ck=C.createContext({}),hy=e=>o.jsx(Ck.Provider,{value:{name:e.name},children:o.jsx(a4,{...e})}),kk=C.createContext({}),Rd=()=>{const e=C.useContext(Ck),t=C.useContext(kk),{getFieldState:r,formState:n}=l4(),s=r(e.name,n);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=t;return{id:i,name:e.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...s}},vp=C.forwardRef(({className:e,...t},r)=>{const n=C.useId();return o.jsx(kk.Provider,{value:{id:n},children:o.jsx("div",{ref:r,className:X("flex flex-col gap-1.5",e),...t})})});vp.displayName="FormItem";const _p=C.forwardRef(({className:e,...t},r)=>{const{error:n,formItemId:s}=Rd();return o.jsx(wr,{ref:r,className:X(n&&"text-[var(--break-red)]",e),htmlFor:s,...t})});_p.displayName="FormLabel";const xp=C.forwardRef(({...e},t)=>{const{error:r,formItemId:n,formDescriptionId:s,formMessageId:i}=Rd();return o.jsx(vw,{ref:t,id:n,"aria-describedby":r?`${s} ${i}`:s,"aria-invalid":!!r,...e})});xp.displayName="FormControl";const Ek=C.forwardRef(({className:e,...t},r)=>{const{formDescriptionId:n}=Rd();return o.jsx("p",{ref:r,id:n,className:X("font-mono text-[11px] text-[var(--fg-dim)]",e),...t})});Ek.displayName="FormDescription";const yp=C.forwardRef(({className:e,children:t,...r},n)=>{const{error:s,formMessageId:i}=Rd(),l=s?String((s==null?void 0:s.message)??""):t;return l?o.jsx("p",{ref:n,id:i,className:X("font-mono text-[11px] text-[var(--break-red)]",e),...r,children:l}):null});yp.displayName="FormMessage";const rF=eF({current:dy().min(1,"Current password is required."),next:dy().min(8,"New password must be at least 8 characters.")});function nF(){const[e,t]=C.useState("idle"),r=S4({resolver:j4(rF),defaultValues:{current:"",next:""}}),n=async s=>{t("rotating");try{await ge.changeKeystorePassword(s.current,s.next),r.reset({current:"",next:""}),Zs.success("Password rotated",{description:"Re-run `jinn run` with the new password."})}catch(i){Zs.error("Rotation failed",{description:i instanceof Error?i.message:String(i)})}finally{t("idle")}};return o.jsx("div",{"data-testid":"security-tab",children:o.jsxs(we,{className:"border-[var(--severity-blocking-border)]",children:[o.jsxs(cr,{className:"flex flex-row items-start justify-between gap-3",children:[o.jsxs("div",{className:"flex flex-col gap-1.5",children:[o.jsxs(Rn,{className:"flex items-center gap-2 text-[var(--break-red)]",children:[o.jsx(D2,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Security"]}),o.jsx(Gs,{children:"Rotate keystore password · last rotated never"})]}),o.jsx(je,{variant:"destructive",children:"Danger zone"})]}),o.jsx(Qe,{children:o.jsx(tF,{...r,children:o.jsxs("form",{onSubmit:r.handleSubmit(n),className:"flex flex-col gap-4","data-testid":"security-password-form",children:[o.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[o.jsx(hy,{control:r.control,name:"current",render:({field:s})=>o.jsxs(vp,{children:[o.jsx(_p,{children:"Current password"}),o.jsx(xp,{children:o.jsx(ft,{type:"password",autoComplete:"current-password",...s})}),o.jsx(yp,{})]})}),o.jsx(hy,{control:r.control,name:"next",render:({field:s})=>o.jsxs(vp,{children:[o.jsx(_p,{children:"New password"}),o.jsx(xp,{children:o.jsx(ft,{type:"password",autoComplete:"new-password",...s})}),o.jsx(Ek,{children:"At least 8 characters."}),o.jsx(yp,{})]})})]}),o.jsxs(ae,{type:"submit",variant:"destructive",disabled:e==="rotating"||!r.formState.isValid,className:"self-start",children:[o.jsx(k2,{className:"h-3 w-3","aria-hidden":"true"}),e==="rotating"?"Rotating…":"Rotate password"]})]})})})]})})}function sF(e){const t=[],r=e.split(`
282
+ `);let n=0;for(;n<r.length;){const s=r[n]??"";if(/^```/.test(s)){const a=s.slice(3).trim(),c=[];for(n++;n<r.length&&!/^```/.test(r[n]??"");)c.push(r[n]??""),n++;n++,t.push({kind:"code",lang:a,text:c.join(`
283
+ `)});continue}const i=/^(#{1,3})\s+(.*)$/.exec(s);if(i){t.push({kind:"heading",level:i[1].length,text:i[2]}),n++;continue}if(/^-\s+/.test(s)){const a=[];for(;n<r.length&&/^-\s+/.test(r[n]??"");)a.push((r[n]??"").replace(/^-\s+/,"")),n++;t.push({kind:"list",items:a});continue}if(s.trim()===""){n++;continue}const l=[s];for(n++;n<r.length&&(r[n]??"").trim()!==""&&!/^(#{1,3}\s|```|-\s)/.test(r[n]??"");)l.push(r[n]??""),n++;t.push({kind:"paragraph",text:l.join(" ")})}return t}function fy(e){const t=[],r=/`([^`]+)`/g;let n=0,s,i=0;for(;(s=r.exec(e))!==null;)s.index>n&&t.push(e.slice(n,s.index)),t.push(C.createElement("code",{key:`c-${i++}`},s[1])),n=s.index+s[0].length;return n<e.length&&t.push(e.slice(n)),t}function iF(e){const t=sF(e);return C.createElement(C.Fragment,null,...t.map((r,n)=>r.kind==="heading"?r.level===1?C.createElement("h1",{key:n},r.text):r.level===2?C.createElement("h2",{key:n},r.text):C.createElement("h3",{key:n},r.text):r.kind==="code"?C.createElement("pre",{key:n},C.createElement("code",null,r.text??"")):r.kind==="list"?C.createElement("ul",{key:n},...(r.items??[]).map((s,i)=>C.createElement("li",{key:i},...fy(s)))):C.createElement("p",{key:n},...fy(r.text??""))))}const oF=`# Build a plug-in
284
+
285
+ Ship a Jinn SolverPlugin in 60 seconds. Targets the SWE-rebench v2 SolverNet running against the Hermes harness on testnet.
286
+
287
+ ## 1. Scaffold
288
+
289
+ \`\`\`bash
290
+ jinn create plugin @you/my-swe-skill --pattern solver-type-plugin --solver-type swe-rebench-v2.v1
291
+ cd @you/my-swe-skill
292
+ yarn install
293
+ yarn test
294
+ \`\`\`
295
+
296
+ The scaffolder emits a working package modeled on \`swe-rebench-v2-runtime\`:
297
+
298
+ \`\`\`
299
+ @you/my-swe-skill/
300
+ ├── jinn.plugin.json # the canonical manifest
301
+ ├── skills/example/SKILL.md
302
+ ├── test/plugin.test.ts # passes immediately
303
+ ├── package.json
304
+ ├── tsconfig.json
305
+ └── README.md
306
+ \`\`\`
307
+
308
+ ## 2. Edit your skill
309
+
310
+ Open \`skills/example/SKILL.md\` and replace it with the skill your plug-in offers. A SolverType plug-in can ship one or more skills; a runtime plug-in usually ships an MCP server in \`.mcp.json\` instead. See \`shape-reference.md\`.
311
+
312
+ ## 3. Publish to npm + chain
313
+
314
+ \`\`\`bash
315
+ npm publish --access public
316
+ jinn solver-plugins publish npm:@you/my-swe-skill
317
+ \`\`\`
318
+
319
+ \`jinn solver-plugins publish\` lazily completes your identity bootstrap (Stage 1) the first time you call it. If you have not yet funded your agent EOA with ETH on testnet, the verb pauses and tells you what to send where. Re-run when the wallet is funded.
320
+
321
+ The verb packs the plug-in, uploads the tarball to IPFS, and writes a \`plugin:<cid>\` record on the on-chain IdentityRegistry under your builder agentId.
322
+
323
+ ## 4. Confirm it published
324
+
325
+ Open the operator app's \`/build\` route. Under "Published plug-ins for SWE-rebench v2" you should see your plug-in. Under "Your published plug-ins" you should see the same record.
326
+
327
+ ## 5. Run it
328
+
329
+ An operator who has joined the SWE-rebench v2 SolverNet can install your plug-in:
330
+
331
+ \`\`\`bash
332
+ jinn solver-plugins show npm:@you/my-swe-skill
333
+ jinn solver-nets add-plugin swe-rebench-v2 npm:@you/my-swe-skill
334
+ \`\`\`
335
+
336
+ The next task they claim runs against your plug-in. The signed envelope's \`executor.plugins[]\` carries your CID; the network explorer attributes the score to your builder agentId.
337
+
338
+ ## Next
339
+
340
+ - \`shape-reference.md\` — the full \`jinn.plugin.json\` shape, the two modes, skills + MCP conventions.
341
+ - \`examples.md\` — annotated reference plug-ins.
342
+ - \`publishing-flow.md\` — what \`jinn solver-plugins publish\` does, step by step.
343
+ - \`identity.md\` — staged identity bootstrap; why publishing does not require operator-grade funding.
344
+ - \`compatibility.md\` — \`jinn.supports\` semantics, harness compatibility.
345
+ `,aF="https://github.com/Jinn-Network/mono/blob/next/client/docs/build/quickstart.md",py="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]";function lF(){return o.jsxs(we,{className:"p-6",children:[o.jsx(cr,{className:"mb-2 p-0",children:o.jsx("span",{className:py,children:"Quickstart · 60 seconds"})}),o.jsxs(Qe,{className:"p-0",children:[o.jsx("div",{className:"hfmf-intro-markdown",children:iF(oF)}),o.jsx(Ge,{className:"my-5"}),o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[o.jsx("span",{className:py,children:"Next"}),o.jsx("a",{href:aF,target:"_blank",rel:"noreferrer",className:"border-b border-border pb-px font-mono text-[12px] text-primary no-underline hover:text-[var(--accent-sky-hover)]",children:"Read the full quickstart on GitHub →"})]})]})]})}const cF=[{name:"name",type:"string",required:!0,description:"npm package name. Used as the canonical identifier across the registry."},{name:"version",type:"string",required:!0,description:"Semantic version. New versions publish under a new IPFS CID."},{name:"description",type:"string",required:!1,description:"Short prose description of what the plug-in offers."},{name:"jinn.supports",type:"string[]",required:!0,description:'Either ["jinn.runtime"] (runtime plug-in) OR one or more SolverType identifiers (solver-type plug-in). Mixing is rejected.'},{name:"jinn.capabilities",type:"object",required:!1,description:"Optional capabilities map. Reserved for future use; not consumed by Hermes today."},{name:"jinn.mcpServers",type:"object",required:!1,description:"Optional inline MCP server map. The Hermes harness reads .mcp.json instead; declare MCP there for harness-agnostic portability."},{name:"jinn.skills",type:"string[]",required:!1,description:"Relative paths to SKILL.md files. Each declared skill becomes available to the harness as an external skill directory."}],uF=[{id:"runtime",label:"Runtime plug-in",requires:'singleton — supports must be exactly ["jinn.runtime"]',example:'{ "jinn": { "supports": ["jinn.runtime"] } }'},{id:"solver-type",label:"SolverType plug-in",requires:'one or more SolverType ids; cannot include "jinn.runtime"',example:'{ "jinn": { "supports": ["swe-rebench-v2.v1"] } }'}],jh="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]";function dF(){return o.jsxs(we,{className:"p-6",children:[o.jsxs(cr,{className:"mb-5 flex flex-col gap-1 p-0",children:[o.jsx("span",{className:jh,children:"Reference"}),o.jsx("h2",{className:"m-0 font-serif text-[28px] leading-[1.2] text-foreground",children:"Plug-in shape"})]}),o.jsxs(Qe,{className:"p-0",children:[o.jsxs(Hi,{children:[o.jsx(zi,{children:o.jsxs(Cr,{children:[o.jsx(We,{children:"Field"}),o.jsx(We,{children:"Type"}),o.jsx(We,{children:"Required"}),o.jsx(We,{children:"Description"})]})}),o.jsx(Ui,{children:cF.map(e=>o.jsxs(Cr,{"data-field-required":e.required?"true":"false",children:[o.jsx(Ve,{className:"font-mono text-[13px] text-primary",children:e.name}),o.jsx(Ve,{className:"font-mono text-[13px] text-muted-foreground",children:e.type}),o.jsx(Ve,{children:o.jsx(je,{variant:e.required?"default":"outline",children:e.required?"yes":"no"})}),o.jsx(Ve,{className:"font-mono text-[13px] text-muted-foreground",children:e.description})]},e.name))})]}),o.jsx(Ge,{className:"my-8"}),o.jsxs("div",{className:"mb-4 flex flex-col gap-1",children:[o.jsx("span",{className:jh,children:"Modes"}),o.jsx("h3",{className:"m-0 font-serif text-[22px] leading-[1.25] text-foreground",children:"Two modes"}),o.jsx("p",{className:"m-0 mt-1 max-w-[72ch] font-mono text-[13px] leading-[1.7] text-muted-foreground",children:"The validator enforces exactly two exclusive modes. Mixing is rejected."})]}),o.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:uF.map((e,t)=>o.jsxs(we,{className:"flex flex-col gap-2.5 bg-[var(--bg-sunken)] p-4",children:[o.jsx("span",{className:jh,children:t===0?"Mode · 01":"Mode · 02"}),o.jsx("h4",{className:"m-0 font-mono text-[15px] font-medium tracking-[-0.01em] text-foreground",children:e.label}),o.jsx("p",{className:"m-0 font-mono text-[12px] leading-[1.6] text-muted-foreground",children:e.requires}),o.jsx("pre",{className:"m-0 overflow-x-auto rounded-sm border border-border bg-background px-3 py-2.5 font-mono text-[12px] leading-[1.5] text-primary",children:o.jsx("code",{children:e.example})})]},e.id))})]})]})}const jk="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]";function hF(e){return e.length>14?`${e.slice(0,8)}…${e.slice(-4)}`:e}function Tc({solverType:e}){return o.jsxs(cr,{className:"mb-5 flex flex-col gap-1 p-0",children:[o.jsx("span",{className:jk,children:"Registry"}),o.jsxs("h3",{className:"m-0 font-serif text-[22px] leading-[1.25] text-foreground",children:["Published plug-ins for ",e]})]})}function fF({solverType:e}){const{data:t,isLoading:r,error:n}=Me({queryKey:["discovery","plugin-publications",e],queryFn:()=>ge.discovery.listPluginPublications({solverType:e}),refetchInterval:3e4});if(r)return o.jsxs(we,{className:"p-6",children:[o.jsx(Tc,{solverType:e}),o.jsxs(Qe,{className:"flex flex-col gap-2 p-0",children:[o.jsx(Br,{className:"h-4 w-full"}),o.jsx(Br,{className:"h-4 w-5/6"}),o.jsx(Br,{className:"h-4 w-4/6"})]})]});if(n)return o.jsxs(we,{className:"p-6",children:[o.jsx(Tc,{solverType:e}),o.jsx(Qe,{className:"p-0",children:o.jsx(rt,{variant:"blocking",children:o.jsxs(it,{children:["Discovery unavailable. ",n.message]})})})]});const s=(t==null?void 0:t.publications)??[];return s.length===0?o.jsxs(we,{className:"p-6",children:[o.jsx(Tc,{solverType:e}),o.jsx(Qe,{className:"p-0",children:o.jsxs("div",{className:"flex flex-col gap-2 rounded-md border border-dashed border-border bg-[var(--bg-sunken)] p-6",children:[o.jsx("span",{className:jk,children:"Empty registry"}),o.jsx("p",{className:"m-0 max-w-[64ch] font-mono text-[13px] leading-[1.7] text-foreground",children:"No plug-ins published yet. Be the first."}),o.jsxs("p",{className:"m-0 max-w-[64ch] font-mono text-[13px] leading-[1.7] text-muted-foreground",children:["Run"," ",o.jsx("code",{className:"rounded-sm border border-border bg-background px-1.5 py-px font-mono text-[12px] text-primary",children:"jinn solver-plugins publish"})," ","and your plug-in appears here under your builder agentId."]})]})})]}):o.jsxs(we,{className:"p-6",children:[o.jsx(Tc,{solverType:e}),o.jsx(Qe,{className:"p-0",children:o.jsxs(Hi,{children:[o.jsx(zi,{children:o.jsxs(Cr,{children:[o.jsx(We,{children:"Plug-in"}),o.jsx(We,{children:"Version"}),o.jsx(We,{children:"Builder agentId"}),o.jsx(We,{children:"CID"}),o.jsx(We,{children:"Status"})]})}),o.jsx(Ui,{children:s.map(i=>o.jsxs(Cr,{children:[o.jsx(Ve,{className:"font-mono text-[12px] text-foreground",children:i.name}),o.jsx(Ve,{className:"font-mono text-[12px] text-muted-foreground",children:i.version}),o.jsx(Ve,{className:"font-mono text-[12px] text-muted-foreground",children:i.builderAgentId}),o.jsx(Ve,{className:"font-mono text-[12px] text-muted-foreground",children:hF(i.cid)}),o.jsx(Ve,{children:i.revoked?o.jsxs(je,{variant:"outline",className:"rounded-full border-[var(--wane)] text-[var(--wane)]",children:["Revoked",i.revokedReason?` · ${i.revokedReason}`:""]}):o.jsx(je,{variant:"success",className:"rounded-full",children:"Active"})})]},`${i.builderAgentId}:${i.cid}`))})]})})]})}const bp="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",Nh="rounded-sm border border-border bg-background px-1.5 py-px font-mono text-[12px] text-primary";function Fa(){return o.jsxs(cr,{className:"mb-5 flex flex-col gap-1 p-0",children:[o.jsx("span",{className:bp,children:"Builder"}),o.jsx("h3",{className:"m-0 font-serif text-[22px] leading-[1.25] text-foreground",children:"Your published plug-ins"})]})}function pF({fleetAgentId:e}){const t=!!e,{data:r,isLoading:n,error:s}=Me({queryKey:["discovery","builder-artifacts",e],queryFn:()=>ge.discovery.listBuilderArtifacts(e),enabled:t,refetchInterval:3e4});if(!t)return o.jsxs(we,{className:"bg-[var(--bg-sunken)] p-6",children:[o.jsx(Fa,{}),o.jsx(Qe,{className:"p-0",children:o.jsxs("div",{className:"flex flex-col gap-2 rounded-md border border-dashed border-border p-6",children:[o.jsx("span",{className:bp,children:"Identity pending"}),o.jsxs("p",{className:"m-0 max-w-[64ch] font-mono text-[13px] leading-[1.7] text-muted-foreground",children:["Complete identity bootstrap to see your published plug-ins. Run"," ",o.jsx("code",{className:Nh,children:"jinn solver-plugins publish"})," on a plug-in and the lazy stage-ensure will provision your builder identity (Stage 1)."]})]})})]});if(n)return o.jsxs(we,{className:"p-6",children:[o.jsx(Fa,{}),o.jsxs(Qe,{className:"flex flex-col gap-2 p-0",children:[o.jsx(Br,{className:"h-4 w-full"}),o.jsx(Br,{className:"h-4 w-5/6"}),o.jsx(Br,{className:"h-4 w-4/6"})]})]});if(s)return o.jsxs(we,{className:"p-6",children:[o.jsx(Fa,{}),o.jsx(Qe,{className:"p-0",children:o.jsx(rt,{variant:"blocking",children:o.jsx(it,{children:"Discovery unavailable."})})})]});const i=((r==null?void 0:r.artifacts)??[]).filter(l=>l.artifactType==="plugin");return i.length===0?o.jsxs(we,{className:"p-6",children:[o.jsx(Fa,{}),o.jsx(Qe,{className:"p-0",children:o.jsxs("div",{className:"flex flex-col gap-2 rounded-md border border-dashed border-border bg-[var(--bg-sunken)] p-6",children:[o.jsx("span",{className:bp,children:"Nothing yet"}),o.jsxs("p",{className:"m-0 max-w-[64ch] font-mono text-[13px] leading-[1.7] text-muted-foreground",children:["You have not published any plug-ins yet. Scaffold one with"," ",o.jsx("code",{className:Nh,children:"jinn create plugin"}),", then publish with ",o.jsx("code",{className:Nh,children:"jinn solver-plugins publish"}),". It will appear here under your builder agentId."]})]})})]}):o.jsxs(we,{className:"p-6",children:[o.jsx(Fa,{}),o.jsx(Qe,{className:"p-0",children:o.jsxs(Hi,{children:[o.jsx(zi,{children:o.jsxs(Cr,{children:[o.jsx(We,{children:"Plug-in"}),o.jsx(We,{children:"Version"}),o.jsx(We,{children:"Supports"}),o.jsx(We,{children:"Status"})]})}),o.jsx(Ui,{children:i.map(l=>o.jsxs(Cr,{children:[o.jsx(Ve,{className:"font-mono text-[12px] text-foreground",children:l.name}),o.jsx(Ve,{className:"font-mono text-[12px] text-muted-foreground",children:l.version}),o.jsx(Ve,{className:"font-mono text-[12px] text-muted-foreground",children:l.supports.join(", ")}),o.jsx(Ve,{children:l.revoked?o.jsx(je,{variant:"outline",className:"rounded-full border-[var(--wane)] text-[var(--wane)]",children:"Revoked"}):o.jsx(je,{variant:"success",className:"rounded-full",children:"Active"})})]},`${l.builderAgentId}:${l.cid}`))})]})})]})}function mF({value:e,onChange:t}){const r=e==="plugin";return o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ae,{type:"button",variant:r?"outline":"ghost",size:"sm","aria-pressed":r?"true":"false",className:"rounded-full",onClick:()=>{r||t("plugin")},children:"Plug-ins"}),o.jsxs(ae,{type:"button",variant:"ghost",size:"sm",disabled:!0,"aria-pressed":"false",className:"rounded-full opacity-60",children:["Harnesses",o.jsx("span",{className:"ml-1 border-l border-border pl-2 text-[9px] tracking-[0.14em] text-[var(--fg-dim)]",children:"Coming soon"})]})]})}const gF="swe-rebench-v2.v1";function vF(){const{data:e}=Me({queryKey:["bootstrap"],queryFn:()=>ge.getBootstrap(),refetchInterval:5e3}),[t,r]=C.useState("plugin");return o.jsxs("div",{className:"mx-auto flex max-w-[1100px] flex-col gap-6 px-6 pb-12 pt-8",children:[o.jsxs("header",{className:"flex flex-col gap-2 pb-2",children:[o.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--accent-gold)]",children:"Build · Plug-ins"}),o.jsx("p",{className:"m-0 max-w-[64ch] font-mono text-[14px] leading-[1.7] text-muted-foreground",children:"Scaffold a SolverPlugin, publish it to npm and IPFS, watch it appear in the registry under your builder identity. Anchored on the SWE-rebench v2 SolverNet for v0."})]}),o.jsx(lF,{}),o.jsx(dF,{}),o.jsx(Ge,{}),o.jsxs("div",{className:"flex items-center justify-between gap-4 pt-2",children:[o.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",children:"Registry"}),o.jsx(mF,{value:t,onChange:r})]}),t==="plugin"?o.jsxs(o.Fragment,{children:[o.jsx(fF,{solverType:gF}),o.jsx(pF,{fleetAgentId:e==null?void 0:e.fleet_agent_id})]}):null]})}const Rh=({...e})=>o.jsx(yD,{theme:"dark",className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-card group-[.toaster]:text-card-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg font-mono text-[12px]",description:"group-[.toast]:text-[var(--fg-muted)]",actionButton:"group-[.toast]:bg-[var(--accent-sky)] group-[.toast]:text-[var(--bg-sunken)] font-mono text-[10px] uppercase tracking-[0.14em]",cancelButton:"group-[.toast]:bg-transparent group-[.toast]:text-[var(--fg-muted)] font-mono text-[10px] uppercase tracking-[0.14em]"}},...e});function _F(){const{data:e,isLoading:t}=Me({queryKey:["bootstrap"],queryFn:()=>ge.getBootstrap(),refetchInterval:1500}),[r,n]=C.useState(!1),s={restartPending:r,setRestartPending:n};if(t||!e||e.mode==="uninitialized"){const c=e?e.mode==="uninitialized"?"Setting up your wallet":"Loading":"Starting jinn";return o.jsxs(jn,{delayDuration:150,children:[o.jsx(QR,{headline:c}),o.jsx(Rh,{})]})}if(e.mode!=="running")return o.jsxs(jn,{delayDuration:150,children:[o.jsx(NA,{}),o.jsx(Rh,{})]});const i=e.chain==="base"?"mainnet":"testnet",{pluginBuilderUi:l,embeddedAgent:a}=Bm();return o.jsx(jn,{delayDuration:150,children:o.jsxs(TS.Provider,{value:s,children:[o.jsx(uw,{children:o.jsx(WA,{header:o.jsx(VA,{network:i}),tabs:o.jsx(qA,{}),rail:a?o.jsx(KA,{}):void 0,children:o.jsxs(h2,{children:[o.jsx(Nt,{path:"/events/:id",children:o.jsx(iL,{})}),o.jsx(Nt,{path:"/events",children:o.jsx(rL,{})}),o.jsx(Nt,{path:"/overview",component:GD}),o.jsx(Nt,{path:"/operator/join/:cid",children:o.jsx(PI,{})}),o.jsx(Nt,{path:"/operator/execution-data",children:o.jsx(Oa,{children:o.jsx(ZI,{})})}),o.jsx(Nt,{path:"/operator/memberships",children:o.jsx(Oa,{children:o.jsx(U5,{onRestartPending:()=>n(!0)})})}),o.jsx(Nt,{path:"/operator/registry",children:o.jsx(Oa,{children:o.jsx(e4,{})})}),o.jsx(Nt,{path:"/operator/network",children:o.jsx(Oa,{children:o.jsx(t4,{onRestartPending:()=>n(!0)})})}),o.jsx(Nt,{path:"/operator/security",children:o.jsx(Oa,{children:o.jsx(nF,{})})}),o.jsx(Nt,{path:"/operator",children:o.jsx(Wa,{to:"/operator/memberships"})}),o.jsx(Nt,{path:"/captures",children:o.jsx(Wa,{to:"/operator/execution-data"})}),o.jsx(Nt,{path:"/configuration",children:o.jsx(xF,{})}),o.jsx(Nt,{path:"/launcher/create",children:o.jsx(BL,{})}),o.jsx(Nt,{path:"/launcher/launched/:solverNetId",children:o.jsx(BO,{})}),o.jsx(Nt,{path:"/launcher",children:o.jsx(hL,{})}),o.jsx(Nt,{path:"/build",children:l?o.jsx(vF,{}):o.jsx(Wa,{to:"/overview"})}),o.jsx(Nt,{children:o.jsx(Wa,{to:"/overview"})})]})})}),o.jsx(Rh,{})]})})}function xF(){const e=typeof window>"u"?"":window.location.hash;return o.jsx(Wa,{to:`/operator${e}`})}const yF=new jN({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:1e3}}});p2().finally(()=>{Ph.createRoot(document.getElementById("root")).render(o.jsx(Z.StrictMode,{children:o.jsx(NN,{client:yF,children:o.jsx(_F,{})})}))});