@jinn-network/client 0.1.3-canary.8e61ba74 → 0.1.3-canary.941614bc

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 (183) hide show
  1. package/README.md +2 -8
  2. package/deployments/deployment-task-coordinator-router-v3-baseSepolia-fast.json +38 -0
  3. package/dist/agent/agent-ws.d.ts +2 -1
  4. package/dist/agent/agent-ws.js +2 -1
  5. package/dist/agent/agent-ws.js.map +1 -1
  6. package/dist/api/agent-binding-endpoint.d.ts +26 -0
  7. package/dist/api/agent-binding-endpoint.js +28 -0
  8. package/dist/api/agent-binding-endpoint.js.map +1 -0
  9. package/dist/api/bootstrap-endpoint.d.ts +8 -0
  10. package/dist/api/bootstrap-endpoint.js +27 -2
  11. package/dist/api/bootstrap-endpoint.js.map +1 -1
  12. package/dist/api/gather-status.d.ts +4 -0
  13. package/dist/api/gather-status.js +99 -0
  14. package/dist/api/gather-status.js.map +1 -1
  15. package/dist/api/prediction-v1-build.d.ts +47 -0
  16. package/dist/api/prediction-v1-build.js +73 -0
  17. package/dist/api/prediction-v1-build.js.map +1 -0
  18. package/dist/api/server.d.ts +16 -7
  19. package/dist/api/server.js +59 -12
  20. package/dist/api/server.js.map +1 -1
  21. package/dist/api/setup-endpoints.d.ts +8 -0
  22. package/dist/api/setup-endpoints.js +193 -3
  23. package/dist/api/setup-endpoints.js.map +1 -1
  24. package/dist/api/solvernets-catalog-build.d.ts +37 -0
  25. package/dist/api/solvernets-catalog-build.js +19 -0
  26. package/dist/api/solvernets-catalog-build.js.map +1 -0
  27. package/dist/api/solvernets-endpoint.d.ts +15 -0
  28. package/dist/api/solvernets-endpoint.js +5 -0
  29. package/dist/api/solvernets-endpoint.js.map +1 -0
  30. package/dist/api/status-build.d.ts +5 -0
  31. package/dist/api/status-build.js +1 -0
  32. package/dist/api/status-build.js.map +1 -1
  33. package/dist/build-info.json +4 -4
  34. package/dist/build-meta.json +1 -1
  35. package/dist/cli/commands/doctor.d.ts +15 -0
  36. package/dist/cli/commands/doctor.js +21 -0
  37. package/dist/cli/commands/doctor.js.map +1 -1
  38. package/dist/cli/commands/prediction-scoreboard.d.ts +10 -0
  39. package/dist/cli/commands/prediction-scoreboard.js +136 -0
  40. package/dist/cli/commands/prediction-scoreboard.js.map +1 -0
  41. package/dist/cli/commands/run.js +10 -0
  42. package/dist/cli/commands/run.js.map +1 -1
  43. package/dist/cli/commands/solver-nets.js +27 -5
  44. package/dist/cli/commands/solver-nets.js.map +1 -1
  45. package/dist/cli/commands/status.d.ts +3 -0
  46. package/dist/cli/commands/status.js +11 -3
  47. package/dist/cli/commands/status.js.map +1 -1
  48. package/dist/cli/commands/update.d.ts +8 -1
  49. package/dist/cli/commands/update.js +232 -7
  50. package/dist/cli/commands/update.js.map +1 -1
  51. package/dist/cli/index.js +2 -0
  52. package/dist/cli/index.js.map +1 -1
  53. package/dist/cli/task-native-readiness.d.ts +27 -0
  54. package/dist/cli/task-native-readiness.js +170 -0
  55. package/dist/cli/task-native-readiness.js.map +1 -0
  56. package/dist/config.d.ts +92 -48
  57. package/dist/config.js +91 -124
  58. package/dist/config.js.map +1 -1
  59. package/dist/corpus/envelope-projection.d.ts +12 -0
  60. package/dist/corpus/envelope-projection.js +110 -0
  61. package/dist/corpus/envelope-projection.js.map +1 -0
  62. package/dist/corpus/index.d.ts +3 -0
  63. package/dist/corpus/index.js +3 -0
  64. package/dist/corpus/index.js.map +1 -1
  65. package/dist/corpus/prediction-brier-scoreboard-report.d.ts +17 -0
  66. package/dist/corpus/prediction-brier-scoreboard-report.js +148 -0
  67. package/dist/corpus/prediction-brier-scoreboard-report.js.map +1 -0
  68. package/dist/corpus/prediction-brier-scoreboard.d.ts +56 -0
  69. package/dist/corpus/prediction-brier-scoreboard.js +269 -0
  70. package/dist/corpus/prediction-brier-scoreboard.js.map +1 -0
  71. package/dist/corpus/prediction-scoreable-verdicts.d.ts +4 -0
  72. package/dist/corpus/prediction-scoreable-verdicts.js +23 -0
  73. package/dist/corpus/prediction-scoreable-verdicts.js.map +1 -0
  74. package/dist/corpus/types.d.ts +43 -1
  75. package/dist/corpus/types.js.map +1 -1
  76. package/dist/daemon/daemon.js +1 -1
  77. package/dist/daemon/daemon.js.map +1 -1
  78. package/dist/dashboard/assets/index-5ArwpmyK.js +76 -0
  79. package/dist/dashboard/assets/{index-DQ3u_vP5.css → index-Bx5KH3YV.css} +1 -1
  80. package/dist/dashboard/index.html +2 -2
  81. package/dist/earning/bootstrap.d.ts +24 -0
  82. package/dist/earning/bootstrap.js +84 -23
  83. package/dist/earning/bootstrap.js.map +1 -1
  84. package/dist/earning/contracts.d.ts +1 -0
  85. package/dist/earning/contracts.js +16 -0
  86. package/dist/earning/contracts.js.map +1 -1
  87. package/dist/earning/faucet.d.ts +31 -0
  88. package/dist/earning/faucet.js +37 -0
  89. package/dist/earning/faucet.js.map +1 -1
  90. package/dist/earning/safe-adapter.js +45 -3
  91. package/dist/earning/safe-adapter.js.map +1 -1
  92. package/dist/earning/store.d.ts +8 -0
  93. package/dist/earning/store.js +41 -0
  94. package/dist/earning/store.js.map +1 -1
  95. package/dist/earning/types.d.ts +4 -0
  96. package/dist/events/types.d.ts +2 -2
  97. package/dist/harnesses/engine/engine.d.ts +5 -3
  98. package/dist/harnesses/engine/engine.js +33 -11
  99. package/dist/harnesses/engine/engine.js.map +1 -1
  100. package/dist/harnesses/engine/registry.d.ts +2 -0
  101. package/dist/harnesses/engine/registry.js +3 -0
  102. package/dist/harnesses/engine/registry.js.map +1 -1
  103. package/dist/harnesses/impls/claude-code-learner/adapters/claude-code.d.ts +19 -0
  104. package/dist/harnesses/impls/claude-code-learner/adapters/claude-code.js +37 -2
  105. package/dist/harnesses/impls/claude-code-learner/adapters/claude-code.js.map +1 -1
  106. package/dist/harnesses/impls/claude-code-learner/harness.js +2 -0
  107. package/dist/harnesses/impls/claude-code-learner/harness.js.map +1 -1
  108. package/dist/harnesses/impls/claude-code-learner/harvest.js +132 -2
  109. package/dist/harnesses/impls/claude-code-learner/harvest.js.map +1 -1
  110. package/dist/harnesses/impls/claude-code-learner/test-utils/fake-plugin-outputs.d.ts +20 -0
  111. package/dist/harnesses/impls/claude-code-learner/test-utils/fake-plugin-outputs.js +65 -0
  112. package/dist/harnesses/impls/claude-code-learner/test-utils/fake-plugin-outputs.js.map +1 -1
  113. package/dist/harnesses/impls/claude-code-learner/types.d.ts +5 -0
  114. package/dist/harnesses/impls/claude-mcp-hyperliquid/index.js +4 -3
  115. package/dist/harnesses/impls/claude-mcp-hyperliquid/index.js.map +1 -1
  116. package/dist/harnesses/impls/claude-mcp-prediction/index.js +6 -5
  117. package/dist/harnesses/impls/claude-mcp-prediction/index.js.map +1 -1
  118. package/dist/harnesses/impls/claude-mcp-prediction-apy/index.js +6 -5
  119. package/dist/harnesses/impls/claude-mcp-prediction-apy/index.js.map +1 -1
  120. package/dist/harnesses/impls/index.d.ts +2 -2
  121. package/dist/harnesses/impls/index.js +8 -9
  122. package/dist/harnesses/impls/index.js.map +1 -1
  123. package/dist/harnesses/impls/legacy-claude/index.d.ts +2 -2
  124. package/dist/harnesses/impls/prediction-v1-evaluator/index.js +33 -12
  125. package/dist/harnesses/impls/prediction-v1-evaluator/index.js.map +1 -1
  126. package/dist/harnesses/types.d.ts +6 -1
  127. package/dist/harnesses/types.js.map +1 -1
  128. package/dist/main.d.ts +13 -1
  129. package/dist/main.js +178 -18
  130. package/dist/main.js.map +1 -1
  131. package/dist/mcp/search-records.d.ts +92 -0
  132. package/dist/mcp/search-records.js +393 -0
  133. package/dist/mcp/search-records.js.map +1 -0
  134. package/dist/mcp/server.js +56 -15
  135. package/dist/mcp/server.js.map +1 -1
  136. package/dist/operator-errors.d.ts +14 -0
  137. package/dist/operator-errors.js +35 -5
  138. package/dist/operator-errors.js.map +1 -1
  139. package/dist/plugins/resolvers.js +45 -7
  140. package/dist/plugins/resolvers.js.map +1 -1
  141. package/dist/plugins/validator.js +8 -0
  142. package/dist/plugins/validator.js.map +1 -1
  143. package/dist/runner/runner.d.ts +6 -6
  144. package/dist/solver-nets/prediction-operator-ux.d.ts +105 -0
  145. package/dist/solver-nets/prediction-operator-ux.js +438 -0
  146. package/dist/solver-nets/prediction-operator-ux.js.map +1 -0
  147. package/dist/solver-nets/registry.d.ts +13 -6
  148. package/dist/solver-nets/registry.js +50 -16
  149. package/dist/solver-nets/registry.js.map +1 -1
  150. package/dist/solver-types/index.d.ts +11 -0
  151. package/dist/solver-types/index.js +8 -1
  152. package/dist/solver-types/index.js.map +1 -1
  153. package/dist/solver-types/prediction-v0.d.ts +1 -1
  154. package/dist/solver-types/prediction-v0.js +1 -1
  155. package/dist/solver-types/prediction-v0.js.map +1 -1
  156. package/dist/solver-types/prediction-v1-auto.d.ts +2 -0
  157. package/dist/solver-types/prediction-v1-auto.js +56 -7
  158. package/dist/solver-types/prediction-v1-auto.js.map +1 -1
  159. package/dist/solver-types/prediction-v1.js +25 -1
  160. package/dist/solver-types/prediction-v1.js.map +1 -1
  161. package/dist/solver-types/solver-type.d.ts +18 -5
  162. package/dist/store/store.d.ts +44 -2
  163. package/dist/store/store.js +387 -8
  164. package/dist/store/store.js.map +1 -1
  165. package/dist/tx-retry.js +11 -0
  166. package/dist/tx-retry.js.map +1 -1
  167. package/dist/vendor/@jinn-network/sdk/dist/contracts.d.ts +1 -1
  168. package/dist/vendor/@jinn-network/sdk/dist/contracts.js +1 -1
  169. package/package.json +1 -1
  170. package/plugins/jinn-prediction-plugin/.claude-plugin/plugin.json +4 -1
  171. package/plugins/jinn-prediction-plugin/GEMINI.md +5 -1
  172. package/plugins/jinn-prediction-plugin/jinn.plugin.json +5 -2
  173. package/plugins/jinn-prediction-plugin/mcp/polymarket-server.mjs +321 -1
  174. package/plugins/jinn-prediction-plugin/skills/common-biases/SKILL.md +3 -0
  175. package/plugins/jinn-prediction-plugin/skills/polymarket-task-handling/SKILL.md +5 -0
  176. package/plugins/jinn-prediction-plugin/skills/prediction-corpus-retrieval/SKILL.md +35 -0
  177. package/plugins/network-tools/.claude-plugin/plugin.json +12 -0
  178. package/plugins/network-tools/jinn.plugin.json +29 -0
  179. package/plugins/network-tools/mcp/jinn-client-server.mjs +110 -0
  180. package/dist/dashboard/assets/index-CaUOdCs6.js +0 -68
  181. package/dist/mcp/search-artifacts.d.ts +0 -31
  182. package/dist/mcp/search-artifacts.js +0 -40
  183. package/dist/mcp/search-artifacts.js.map +0 -1
@@ -0,0 +1,76 @@
1
+ var nc=e=>{throw TypeError(e)};var yo=(e,t,r)=>t.has(e)||nc("Cannot "+r);var I=(e,t,r)=>(yo(e,t,"read from private field"),r?r.call(e):t.get(e)),Z=(e,t,r)=>t.has(e)?nc("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Q=(e,t,r,i)=>(yo(e,t,"write to private field"),i?i.call(e,r):t.set(e,r),r),ie=(e,t,r)=>(yo(e,t,"access private method"),r);var $s=(e,t,r,i)=>({set _(s){Q(e,t,s,r)},get _(){return I(e,t,i)}});function Mf(e,t){for(var r=0;r<t.length;r++){const i=t[r];if(typeof i!="string"&&!Array.isArray(i)){for(const s in i)if(s!=="default"&&!(s in e)){const h=Object.getOwnPropertyDescriptor(i,s);h&&Object.defineProperty(e,s,h.get?h:{enumerable:!0,get:()=>i[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"]'))i(s);new MutationObserver(s=>{for(const h of s)if(h.type==="childList")for(const v of h.addedNodes)v.tagName==="LINK"&&v.rel==="modulepreload"&&i(v)}).observe(document,{childList:!0,subtree:!0});function r(s){const h={};return s.integrity&&(h.integrity=s.integrity),s.referrerPolicy&&(h.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?h.credentials="include":s.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function i(s){if(s.ep)return;s.ep=!0;const h=r(s);fetch(s.href,h)}})();function Of(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Wu={exports:{}},Jn={},$u={exports:{}},re={};/**
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 Is=Symbol.for("react.element"),Bf=Symbol.for("react.portal"),If=Symbol.for("react.fragment"),jf=Symbol.for("react.strict_mode"),Ff=Symbol.for("react.profiler"),Hf=Symbol.for("react.provider"),Nf=Symbol.for("react.context"),zf=Symbol.for("react.forward_ref"),Uf=Symbol.for("react.suspense"),Wf=Symbol.for("react.memo"),$f=Symbol.for("react.lazy"),oc=Symbol.iterator;function Kf(e){return e===null||typeof e!="object"?null:(e=oc&&e[oc]||e["@@iterator"],typeof e=="function"?e:null)}var Ku={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Vu=Object.assign,qu={};function Oi(e,t,r){this.props=e,this.context=t,this.refs=qu,this.updater=r||Ku}Oi.prototype.isReactComponent={};Oi.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")};Oi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Qu(){}Qu.prototype=Oi.prototype;function il(e,t,r){this.props=e,this.context=t,this.refs=qu,this.updater=r||Ku}var sl=il.prototype=new Qu;sl.constructor=il;Vu(sl,Oi.prototype);sl.isPureReactComponent=!0;var ac=Array.isArray,Gu=Object.prototype.hasOwnProperty,nl={current:null},Ju={key:!0,ref:!0,__self:!0,__source:!0};function Xu(e,t,r){var i,s={},h=null,v=null;if(t!=null)for(i in t.ref!==void 0&&(v=t.ref),t.key!==void 0&&(h=""+t.key),t)Gu.call(t,i)&&!Ju.hasOwnProperty(i)&&(s[i]=t[i]);var n=arguments.length-2;if(n===1)s.children=r;else if(1<n){for(var u=Array(n),d=0;d<n;d++)u[d]=arguments[d+2];s.children=u}if(e&&e.defaultProps)for(i in n=e.defaultProps,n)s[i]===void 0&&(s[i]=n[i]);return{$$typeof:Is,type:e,key:h,ref:v,props:s,_owner:nl.current}}function Vf(e,t){return{$$typeof:Is,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function ol(e){return typeof e=="object"&&e!==null&&e.$$typeof===Is}function qf(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var lc=/\/+/g;function So(e,t){return typeof e=="object"&&e!==null&&e.key!=null?qf(""+e.key):t.toString(36)}function dn(e,t,r,i,s){var h=typeof e;(h==="undefined"||h==="boolean")&&(e=null);var v=!1;if(e===null)v=!0;else switch(h){case"string":case"number":v=!0;break;case"object":switch(e.$$typeof){case Is:case Bf:v=!0}}if(v)return v=e,s=s(v),e=i===""?"."+So(v,0):i,ac(s)?(r="",e!=null&&(r=e.replace(lc,"$&/")+"/"),dn(s,t,r,"",function(d){return d})):s!=null&&(ol(s)&&(s=Vf(s,r+(!s.key||v&&v.key===s.key?"":(""+s.key).replace(lc,"$&/")+"/")+e)),t.push(s)),1;if(v=0,i=i===""?".":i+":",ac(e))for(var n=0;n<e.length;n++){h=e[n];var u=i+So(h,n);v+=dn(h,t,r,u,s)}else if(u=Kf(e),typeof u=="function")for(e=u.call(e),n=0;!(h=e.next()).done;)h=h.value,u=i+So(h,n++),v+=dn(h,t,r,u,s);else if(h==="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 v}function Ks(e,t,r){if(e==null)return e;var i=[],s=0;return dn(e,i,"","",function(h){return t.call(r,h,s++)}),i}function Qf(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 ze={current:null},fn={transition:null},Gf={ReactCurrentDispatcher:ze,ReactCurrentBatchConfig:fn,ReactCurrentOwner:nl};function Yu(){throw Error("act(...) is not supported in production builds of React.")}re.Children={map:Ks,forEach:function(e,t,r){Ks(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return Ks(e,function(){t++}),t},toArray:function(e){return Ks(e,function(t){return t})||[]},only:function(e){if(!ol(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};re.Component=Oi;re.Fragment=If;re.Profiler=Ff;re.PureComponent=il;re.StrictMode=jf;re.Suspense=Uf;re.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Gf;re.act=Yu;re.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var i=Vu({},e.props),s=e.key,h=e.ref,v=e._owner;if(t!=null){if(t.ref!==void 0&&(h=t.ref,v=nl.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var n=e.type.defaultProps;for(u in t)Gu.call(t,u)&&!Ju.hasOwnProperty(u)&&(i[u]=t[u]===void 0&&n!==void 0?n[u]:t[u])}var u=arguments.length-2;if(u===1)i.children=r;else if(1<u){n=Array(u);for(var d=0;d<u;d++)n[d]=arguments[d+2];i.children=n}return{$$typeof:Is,type:e.type,key:s,ref:h,props:i,_owner:v}};re.createContext=function(e){return e={$$typeof:Nf,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Hf,_context:e},e.Consumer=e};re.createElement=Xu;re.createFactory=function(e){var t=Xu.bind(null,e);return t.type=e,t};re.createRef=function(){return{current:null}};re.forwardRef=function(e){return{$$typeof:zf,render:e}};re.isValidElement=ol;re.lazy=function(e){return{$$typeof:$f,_payload:{_status:-1,_result:e},_init:Qf}};re.memo=function(e,t){return{$$typeof:Wf,type:e,compare:t===void 0?null:t}};re.startTransition=function(e){var t=fn.transition;fn.transition={};try{e()}finally{fn.transition=t}};re.unstable_act=Yu;re.useCallback=function(e,t){return ze.current.useCallback(e,t)};re.useContext=function(e){return ze.current.useContext(e)};re.useDebugValue=function(){};re.useDeferredValue=function(e){return ze.current.useDeferredValue(e)};re.useEffect=function(e,t){return ze.current.useEffect(e,t)};re.useId=function(){return ze.current.useId()};re.useImperativeHandle=function(e,t,r){return ze.current.useImperativeHandle(e,t,r)};re.useInsertionEffect=function(e,t){return ze.current.useInsertionEffect(e,t)};re.useLayoutEffect=function(e,t){return ze.current.useLayoutEffect(e,t)};re.useMemo=function(e,t){return ze.current.useMemo(e,t)};re.useReducer=function(e,t,r){return ze.current.useReducer(e,t,r)};re.useRef=function(e){return ze.current.useRef(e)};re.useState=function(e){return ze.current.useState(e)};re.useSyncExternalStore=function(e,t,r){return ze.current.useSyncExternalStore(e,t,r)};re.useTransition=function(){return ze.current.useTransition()};re.version="18.3.1";$u.exports=re;var q=$u.exports;const Zu=Of(q),Jf=Mf({__proto__:null,default:Zu},[q]);/**
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 Xf=q,Yf=Symbol.for("react.element"),Zf=Symbol.for("react.fragment"),ep=Object.prototype.hasOwnProperty,tp=Xf.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,rp={key:!0,ref:!0,__self:!0,__source:!0};function eh(e,t,r){var i,s={},h=null,v=null;r!==void 0&&(h=""+r),t.key!==void 0&&(h=""+t.key),t.ref!==void 0&&(v=t.ref);for(i in t)ep.call(t,i)&&!rp.hasOwnProperty(i)&&(s[i]=t[i]);if(e&&e.defaultProps)for(i in t=e.defaultProps,t)s[i]===void 0&&(s[i]=t[i]);return{$$typeof:Yf,type:e,key:h,ref:v,props:s,_owner:tp.current}}Jn.Fragment=Zf;Jn.jsx=eh;Jn.jsxs=eh;Wu.exports=Jn;var L=Wu.exports,Go={},th={exports:{}},st={},rh={exports:{}},ih={};/**
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(E,T){var P=E.length;E.push(T);e:for(;0<P;){var B=P-1>>>1,z=E[B];if(0<s(z,T))E[B]=T,E[P]=z,P=B;else break e}}function r(E){return E.length===0?null:E[0]}function i(E){if(E.length===0)return null;var T=E[0],P=E.pop();if(P!==T){E[0]=P;e:for(var B=0,z=E.length,V=z>>>1;B<V;){var Y=2*(B+1)-1,X=E[Y],oe=Y+1,R=E[oe];if(0>s(X,P))oe<z&&0>s(R,X)?(E[B]=R,E[oe]=P,B=oe):(E[B]=X,E[Y]=P,B=Y);else if(oe<z&&0>s(R,P))E[B]=R,E[oe]=P,B=oe;else break e}}return T}function s(E,T){var P=E.sortIndex-T.sortIndex;return P!==0?P:E.id-T.id}if(typeof performance=="object"&&typeof performance.now=="function"){var h=performance;e.unstable_now=function(){return h.now()}}else{var v=Date,n=v.now();e.unstable_now=function(){return v.now()-n}}var u=[],d=[],g=1,f=null,_=3,C=!1,w=!1,S=!1,l=typeof setTimeout=="function"?setTimeout:null,a=typeof clearTimeout=="function"?clearTimeout:null,o=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function c(E){for(var T=r(d);T!==null;){if(T.callback===null)i(d);else if(T.startTime<=E)i(d),T.sortIndex=T.expirationTime,t(u,T);else break;T=r(d)}}function p(E){if(S=!1,c(E),!w)if(r(u)!==null)w=!0,U(y);else{var T=r(d);T!==null&&$(p,T.startTime-E)}}function y(E,T){w=!1,S&&(S=!1,a(m),m=-1),C=!0;var P=_;try{for(c(T),f=r(u);f!==null&&(!(f.expirationTime>T)||E&&!M());){var B=f.callback;if(typeof B=="function"){f.callback=null,_=f.priorityLevel;var z=B(f.expirationTime<=T);T=e.unstable_now(),typeof z=="function"?f.callback=z:f===r(u)&&i(u),c(T)}else i(u);f=r(u)}if(f!==null)var V=!0;else{var Y=r(d);Y!==null&&$(p,Y.startTime-T),V=!1}return V}finally{f=null,_=P,C=!1}}var x=!1,k=null,m=-1,b=5,D=-1;function M(){return!(e.unstable_now()-D<b)}function A(){if(k!==null){var E=e.unstable_now();D=E;var T=!0;try{T=k(!0,E)}finally{T?O():(x=!1,k=null)}}else x=!1}var O;if(typeof o=="function")O=function(){o(A)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,H=F.port2;F.port1.onmessage=A,O=function(){H.postMessage(null)}}else O=function(){l(A,0)};function U(E){k=E,x||(x=!0,O())}function $(E,T){m=l(function(){E(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(E){E.callback=null},e.unstable_continueExecution=function(){w||C||(w=!0,U(y))},e.unstable_forceFrameRate=function(E){0>E||125<E?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):b=0<E?Math.floor(1e3/E):5},e.unstable_getCurrentPriorityLevel=function(){return _},e.unstable_getFirstCallbackNode=function(){return r(u)},e.unstable_next=function(E){switch(_){case 1:case 2:case 3:var T=3;break;default:T=_}var P=_;_=T;try{return E()}finally{_=P}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(E,T){switch(E){case 1:case 2:case 3:case 4:case 5:break;default:E=3}var P=_;_=E;try{return T()}finally{_=P}},e.unstable_scheduleCallback=function(E,T,P){var B=e.unstable_now();switch(typeof P=="object"&&P!==null?(P=P.delay,P=typeof P=="number"&&0<P?B+P:B):P=B,E){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=P+z,E={id:g++,callback:T,priorityLevel:E,startTime:P,expirationTime:z,sortIndex:-1},P>B?(E.sortIndex=P,t(d,E),r(u)===null&&E===r(d)&&(S?(a(m),m=-1):S=!0,$(p,P-B))):(E.sortIndex=z,t(u,E),w||C||(w=!0,U(y))),E},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(E){var T=_;return function(){var P=_;_=T;try{return E.apply(this,arguments)}finally{_=P}}}})(ih);rh.exports=ih;var ip=rh.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 sp=q,it=ip;function K(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 sh=new Set,hs={};function $r(e,t){ki(e,t),ki(e+"Capture",t)}function ki(e,t){for(hs[e]=t,e=0;e<t.length;e++)sh.add(t[e])}var Ht=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Jo=Object.prototype.hasOwnProperty,np=/^[: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]*$/,cc={},uc={};function op(e){return Jo.call(uc,e)?!0:Jo.call(cc,e)?!1:np.test(e)?uc[e]=!0:(cc[e]=!0,!1)}function ap(e,t,r,i){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return i?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function lp(e,t,r,i){if(t===null||typeof t>"u"||ap(e,t,r,i))return!0;if(i)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 Ue(e,t,r,i,s,h,v){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=i,this.attributeNamespace=s,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=h,this.removeEmptyString=v}var Pe={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Pe[e]=new Ue(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Pe[t]=new Ue(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Pe[e]=new Ue(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Pe[e]=new Ue(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){Pe[e]=new Ue(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Pe[e]=new Ue(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Pe[e]=new Ue(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Pe[e]=new Ue(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Pe[e]=new Ue(e,5,!1,e.toLowerCase(),null,!1,!1)});var al=/[\-:]([a-z])/g;function ll(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(al,ll);Pe[t]=new Ue(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(al,ll);Pe[t]=new Ue(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(al,ll);Pe[t]=new Ue(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Pe[e]=new Ue(e,1,!1,e.toLowerCase(),null,!1,!1)});Pe.xlinkHref=new Ue("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Pe[e]=new Ue(e,1,!1,e.toLowerCase(),null,!0,!0)});function cl(e,t,r,i){var s=Pe.hasOwnProperty(t)?Pe[t]:null;(s!==null?s.type!==0:i||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(lp(t,r,s,i)&&(r=null),i||s===null?op(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,i=s.attributeNamespace,r===null?e.removeAttribute(t):(s=s.type,r=s===3||s===4&&r===!0?"":""+r,i?e.setAttributeNS(i,t,r):e.setAttribute(t,r))))}var Wt=sp.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Vs=Symbol.for("react.element"),Qr=Symbol.for("react.portal"),Gr=Symbol.for("react.fragment"),ul=Symbol.for("react.strict_mode"),Xo=Symbol.for("react.profiler"),nh=Symbol.for("react.provider"),oh=Symbol.for("react.context"),hl=Symbol.for("react.forward_ref"),Yo=Symbol.for("react.suspense"),Zo=Symbol.for("react.suspense_list"),dl=Symbol.for("react.memo"),Qt=Symbol.for("react.lazy"),ah=Symbol.for("react.offscreen"),hc=Symbol.iterator;function Ui(e){return e===null||typeof e!="object"?null:(e=hc&&e[hc]||e["@@iterator"],typeof e=="function"?e:null)}var ge=Object.assign,Co;function Xi(e){if(Co===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);Co=t&&t[1]||""}return`
34
+ `+Co+e}var wo=!1;function xo(e,t){if(!e||wo)return"";wo=!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(d){var i=d}Reflect.construct(e,[],t)}else{try{t.call()}catch(d){i=d}e.call(t.prototype)}else{try{throw Error()}catch(d){i=d}e()}}catch(d){if(d&&i&&typeof d.stack=="string"){for(var s=d.stack.split(`
35
+ `),h=i.stack.split(`
36
+ `),v=s.length-1,n=h.length-1;1<=v&&0<=n&&s[v]!==h[n];)n--;for(;1<=v&&0<=n;v--,n--)if(s[v]!==h[n]){if(v!==1||n!==1)do if(v--,n--,0>n||s[v]!==h[n]){var u=`
37
+ `+s[v].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=v&&0<=n);break}}}finally{wo=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Xi(e):""}function cp(e){switch(e.tag){case 5:return Xi(e.type);case 16:return Xi("Lazy");case 13:return Xi("Suspense");case 19:return Xi("SuspenseList");case 0:case 2:case 15:return e=xo(e.type,!1),e;case 11:return e=xo(e.type.render,!1),e;case 1:return e=xo(e.type,!0),e;default:return""}}function ea(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 Gr:return"Fragment";case Qr:return"Portal";case Xo:return"Profiler";case ul:return"StrictMode";case Yo:return"Suspense";case Zo:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case oh:return(e.displayName||"Context")+".Consumer";case nh:return(e._context.displayName||"Context")+".Provider";case hl:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case dl:return t=e.displayName||null,t!==null?t:ea(e.type)||"Memo";case Qt:t=e._payload,e=e._init;try{return ea(e(t))}catch{}}return null}function up(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 ea(t);case 8:return t===ul?"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 gr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function lh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function hp(e){var t=lh(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var s=r.get,h=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(v){i=""+v,h.call(this,v)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return i},setValue:function(v){i=""+v},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function qs(e){e._valueTracker||(e._valueTracker=hp(e))}function ch(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),i="";return e&&(i=lh(e)?e.checked?"true":"false":e.value),e=i,e!==r?(t.setValue(e),!0):!1}function bn(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 ta(e,t){var r=t.checked;return ge({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function dc(e,t){var r=t.defaultValue==null?"":t.defaultValue,i=t.checked!=null?t.checked:t.defaultChecked;r=gr(t.value!=null?t.value:r),e._wrapperState={initialChecked:i,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function uh(e,t){t=t.checked,t!=null&&cl(e,"checked",t,!1)}function ra(e,t){uh(e,t);var r=gr(t.value),i=t.type;if(r!=null)i==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(i==="submit"||i==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ia(e,t.type,r):t.hasOwnProperty("defaultValue")&&ia(e,t.type,gr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function fc(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var i=t.type;if(!(i!=="submit"&&i!=="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 ia(e,t,r){(t!=="number"||bn(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Yi=Array.isArray;function oi(e,t,r,i){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&&i&&(e[r].defaultSelected=!0)}else{for(r=""+gr(r),t=null,s=0;s<e.length;s++){if(e[s].value===r){e[s].selected=!0,i&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function sa(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(K(91));return ge({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function pc(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(K(92));if(Yi(r)){if(1<r.length)throw Error(K(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:gr(r)}}function hh(e,t){var r=gr(t.value),i=gr(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),i!=null&&(e.defaultValue=""+i)}function _c(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function dh(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 na(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?dh(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Qs,fh=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,i,s){MSApp.execUnsafeLocalFunction(function(){return e(t,r,i,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Qs=Qs||document.createElement("div"),Qs.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Qs.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ds(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var rs={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},dp=["Webkit","ms","Moz","O"];Object.keys(rs).forEach(function(e){dp.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),rs[t]=rs[e]})});function ph(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||rs.hasOwnProperty(e)&&rs[e]?(""+t).trim():t+"px"}function _h(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var i=r.indexOf("--")===0,s=ph(r,t[r],i);r==="float"&&(r="cssFloat"),i?e.setProperty(r,s):e[r]=s}}var fp=ge({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 oa(e,t){if(t){if(fp[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(K(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(K(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(K(61))}if(t.style!=null&&typeof t.style!="object")throw Error(K(62))}}function aa(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 la=null;function fl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ca=null,ai=null,li=null;function vc(e){if(e=Hs(e)){if(typeof ca!="function")throw Error(K(280));var t=e.stateNode;t&&(t=to(t),ca(e.stateNode,e.type,t))}}function vh(e){ai?li?li.push(e):li=[e]:ai=e}function gh(){if(ai){var e=ai,t=li;if(li=ai=null,vc(e),t)for(e=0;e<t.length;e++)vc(t[e])}}function mh(e,t){return e(t)}function yh(){}var bo=!1;function Sh(e,t,r){if(bo)return e(t,r);bo=!0;try{return mh(e,t,r)}finally{bo=!1,(ai!==null||li!==null)&&(yh(),gh())}}function fs(e,t){var r=e.stateNode;if(r===null)return null;var i=to(r);if(i===null)return null;r=i[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":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(K(231,t,typeof r));return r}var ua=!1;if(Ht)try{var Wi={};Object.defineProperty(Wi,"passive",{get:function(){ua=!0}}),window.addEventListener("test",Wi,Wi),window.removeEventListener("test",Wi,Wi)}catch{ua=!1}function pp(e,t,r,i,s,h,v,n,u){var d=Array.prototype.slice.call(arguments,3);try{t.apply(r,d)}catch(g){this.onError(g)}}var is=!1,kn=null,En=!1,ha=null,_p={onError:function(e){is=!0,kn=e}};function vp(e,t,r,i,s,h,v,n,u){is=!1,kn=null,pp.apply(_p,arguments)}function gp(e,t,r,i,s,h,v,n,u){if(vp.apply(this,arguments),is){if(is){var d=kn;is=!1,kn=null}else throw Error(K(198));En||(En=!0,ha=d)}}function Kr(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 Ch(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 gc(e){if(Kr(e)!==e)throw Error(K(188))}function mp(e){var t=e.alternate;if(!t){if(t=Kr(e),t===null)throw Error(K(188));return t!==e?null:e}for(var r=e,i=t;;){var s=r.return;if(s===null)break;var h=s.alternate;if(h===null){if(i=s.return,i!==null){r=i;continue}break}if(s.child===h.child){for(h=s.child;h;){if(h===r)return gc(s),e;if(h===i)return gc(s),t;h=h.sibling}throw Error(K(188))}if(r.return!==i.return)r=s,i=h;else{for(var v=!1,n=s.child;n;){if(n===r){v=!0,r=s,i=h;break}if(n===i){v=!0,i=s,r=h;break}n=n.sibling}if(!v){for(n=h.child;n;){if(n===r){v=!0,r=h,i=s;break}if(n===i){v=!0,i=h,r=s;break}n=n.sibling}if(!v)throw Error(K(189))}}if(r.alternate!==i)throw Error(K(190))}if(r.tag!==3)throw Error(K(188));return r.stateNode.current===r?e:t}function wh(e){return e=mp(e),e!==null?xh(e):null}function xh(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=xh(e);if(t!==null)return t;e=e.sibling}return null}var bh=it.unstable_scheduleCallback,mc=it.unstable_cancelCallback,yp=it.unstable_shouldYield,Sp=it.unstable_requestPaint,Se=it.unstable_now,Cp=it.unstable_getCurrentPriorityLevel,pl=it.unstable_ImmediatePriority,kh=it.unstable_UserBlockingPriority,Rn=it.unstable_NormalPriority,wp=it.unstable_LowPriority,Eh=it.unstable_IdlePriority,Xn=null,Dt=null;function xp(e){if(Dt&&typeof Dt.onCommitFiberRoot=="function")try{Dt.onCommitFiberRoot(Xn,e,void 0,(e.current.flags&128)===128)}catch{}}var yt=Math.clz32?Math.clz32:Ep,bp=Math.log,kp=Math.LN2;function Ep(e){return e>>>=0,e===0?32:31-(bp(e)/kp|0)|0}var Gs=64,Js=4194304;function Zi(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 Ln(e,t){var r=e.pendingLanes;if(r===0)return 0;var i=0,s=e.suspendedLanes,h=e.pingedLanes,v=r&268435455;if(v!==0){var n=v&~s;n!==0?i=Zi(n):(h&=v,h!==0&&(i=Zi(h)))}else v=r&~s,v!==0?i=Zi(v):h!==0&&(i=Zi(h));if(i===0)return 0;if(t!==0&&t!==i&&!(t&s)&&(s=i&-i,h=t&-t,s>=h||s===16&&(h&4194240)!==0))return t;if(i&4&&(i|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=i;0<t;)r=31-yt(t),s=1<<r,i|=e[r],t&=~s;return i}function Rp(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 Lp(e,t){for(var r=e.suspendedLanes,i=e.pingedLanes,s=e.expirationTimes,h=e.pendingLanes;0<h;){var v=31-yt(h),n=1<<v,u=s[v];u===-1?(!(n&r)||n&i)&&(s[v]=Rp(n,t)):u<=t&&(e.expiredLanes|=n),h&=~n}}function da(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Rh(){var e=Gs;return Gs<<=1,!(Gs&4194240)&&(Gs=64),e}function ko(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function js(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-yt(t),e[t]=r}function Dp(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 i=e.eventTimes;for(e=e.expirationTimes;0<r;){var s=31-yt(r),h=1<<s;t[s]=0,i[s]=-1,e[s]=-1,r&=~h}}function _l(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var i=31-yt(r),s=1<<i;s&t|e[i]&t&&(e[i]|=t),r&=~s}}var ce=0;function Lh(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Dh,vl,Th,Ph,Ah,fa=!1,Xs=[],lr=null,cr=null,ur=null,ps=new Map,_s=new Map,Jt=[],Tp="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 yc(e,t){switch(e){case"focusin":case"focusout":lr=null;break;case"dragenter":case"dragleave":cr=null;break;case"mouseover":case"mouseout":ur=null;break;case"pointerover":case"pointerout":ps.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":_s.delete(t.pointerId)}}function $i(e,t,r,i,s,h){return e===null||e.nativeEvent!==h?(e={blockedOn:t,domEventName:r,eventSystemFlags:i,nativeEvent:h,targetContainers:[s]},t!==null&&(t=Hs(t),t!==null&&vl(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function Pp(e,t,r,i,s){switch(t){case"focusin":return lr=$i(lr,e,t,r,i,s),!0;case"dragenter":return cr=$i(cr,e,t,r,i,s),!0;case"mouseover":return ur=$i(ur,e,t,r,i,s),!0;case"pointerover":var h=s.pointerId;return ps.set(h,$i(ps.get(h)||null,e,t,r,i,s)),!0;case"gotpointercapture":return h=s.pointerId,_s.set(h,$i(_s.get(h)||null,e,t,r,i,s)),!0}return!1}function Mh(e){var t=br(e.target);if(t!==null){var r=Kr(t);if(r!==null){if(t=r.tag,t===13){if(t=Ch(r),t!==null){e.blockedOn=t,Ah(e.priority,function(){Th(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 pn(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=pa(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var i=new r.constructor(r.type,r);la=i,r.target.dispatchEvent(i),la=null}else return t=Hs(r),t!==null&&vl(t),e.blockedOn=r,!1;t.shift()}return!0}function Sc(e,t,r){pn(e)&&r.delete(t)}function Ap(){fa=!1,lr!==null&&pn(lr)&&(lr=null),cr!==null&&pn(cr)&&(cr=null),ur!==null&&pn(ur)&&(ur=null),ps.forEach(Sc),_s.forEach(Sc)}function Ki(e,t){e.blockedOn===t&&(e.blockedOn=null,fa||(fa=!0,it.unstable_scheduleCallback(it.unstable_NormalPriority,Ap)))}function vs(e){function t(s){return Ki(s,e)}if(0<Xs.length){Ki(Xs[0],e);for(var r=1;r<Xs.length;r++){var i=Xs[r];i.blockedOn===e&&(i.blockedOn=null)}}for(lr!==null&&Ki(lr,e),cr!==null&&Ki(cr,e),ur!==null&&Ki(ur,e),ps.forEach(t),_s.forEach(t),r=0;r<Jt.length;r++)i=Jt[r],i.blockedOn===e&&(i.blockedOn=null);for(;0<Jt.length&&(r=Jt[0],r.blockedOn===null);)Mh(r),r.blockedOn===null&&Jt.shift()}var ci=Wt.ReactCurrentBatchConfig,Dn=!0;function Mp(e,t,r,i){var s=ce,h=ci.transition;ci.transition=null;try{ce=1,gl(e,t,r,i)}finally{ce=s,ci.transition=h}}function Op(e,t,r,i){var s=ce,h=ci.transition;ci.transition=null;try{ce=4,gl(e,t,r,i)}finally{ce=s,ci.transition=h}}function gl(e,t,r,i){if(Dn){var s=pa(e,t,r,i);if(s===null)Bo(e,t,i,Tn,r),yc(e,i);else if(Pp(s,e,t,r,i))i.stopPropagation();else if(yc(e,i),t&4&&-1<Tp.indexOf(e)){for(;s!==null;){var h=Hs(s);if(h!==null&&Dh(h),h=pa(e,t,r,i),h===null&&Bo(e,t,i,Tn,r),h===s)break;s=h}s!==null&&i.stopPropagation()}else Bo(e,t,i,null,r)}}var Tn=null;function pa(e,t,r,i){if(Tn=null,e=fl(i),e=br(e),e!==null)if(t=Kr(e),t===null)e=null;else if(r=t.tag,r===13){if(e=Ch(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 Tn=e,null}function Oh(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(Cp()){case pl:return 1;case kh:return 4;case Rn:case wp:return 16;case Eh:return 536870912;default:return 16}default:return 16}}var or=null,ml=null,_n=null;function Bh(){if(_n)return _n;var e,t=ml,r=t.length,i,s="value"in or?or.value:or.textContent,h=s.length;for(e=0;e<r&&t[e]===s[e];e++);var v=r-e;for(i=1;i<=v&&t[r-i]===s[h-i];i++);return _n=s.slice(e,1<i?1-i:void 0)}function vn(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 Ys(){return!0}function Cc(){return!1}function nt(e){function t(r,i,s,h,v){this._reactName=r,this._targetInst=s,this.type=i,this.nativeEvent=h,this.target=v,this.currentTarget=null;for(var n in e)e.hasOwnProperty(n)&&(r=e[n],this[n]=r?r(h):h[n]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?Ys:Cc,this.isPropagationStopped=Cc,this}return ge(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=Ys)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Ys)},persist:function(){},isPersistent:Ys}),t}var Bi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},yl=nt(Bi),Fs=ge({},Bi,{view:0,detail:0}),Bp=nt(Fs),Eo,Ro,Vi,Yn=ge({},Fs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Sl,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!==Vi&&(Vi&&e.type==="mousemove"?(Eo=e.screenX-Vi.screenX,Ro=e.screenY-Vi.screenY):Ro=Eo=0,Vi=e),Eo)},movementY:function(e){return"movementY"in e?e.movementY:Ro}}),wc=nt(Yn),Ip=ge({},Yn,{dataTransfer:0}),jp=nt(Ip),Fp=ge({},Fs,{relatedTarget:0}),Lo=nt(Fp),Hp=ge({},Bi,{animationName:0,elapsedTime:0,pseudoElement:0}),Np=nt(Hp),zp=ge({},Bi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Up=nt(zp),Wp=ge({},Bi,{data:0}),xc=nt(Wp),$p={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Kp={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"},Vp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function qp(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Vp[e])?!!t[e]:!1}function Sl(){return qp}var Qp=ge({},Fs,{key:function(e){if(e.key){var t=$p[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=vn(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Kp[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Sl,charCode:function(e){return e.type==="keypress"?vn(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?vn(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Gp=nt(Qp),Jp=ge({},Yn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),bc=nt(Jp),Xp=ge({},Fs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Sl}),Yp=nt(Xp),Zp=ge({},Bi,{propertyName:0,elapsedTime:0,pseudoElement:0}),e_=nt(Zp),t_=ge({},Yn,{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}),r_=nt(t_),i_=[9,13,27,32],Cl=Ht&&"CompositionEvent"in window,ss=null;Ht&&"documentMode"in document&&(ss=document.documentMode);var s_=Ht&&"TextEvent"in window&&!ss,Ih=Ht&&(!Cl||ss&&8<ss&&11>=ss),kc=" ",Ec=!1;function jh(e,t){switch(e){case"keyup":return i_.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Fh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Jr=!1;function n_(e,t){switch(e){case"compositionend":return Fh(t);case"keypress":return t.which!==32?null:(Ec=!0,kc);case"textInput":return e=t.data,e===kc&&Ec?null:e;default:return null}}function o_(e,t){if(Jr)return e==="compositionend"||!Cl&&jh(e,t)?(e=Bh(),_n=ml=or=null,Jr=!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 Ih&&t.locale!=="ko"?null:t.data;default:return null}}var a_={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 Rc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!a_[e.type]:t==="textarea"}function Hh(e,t,r,i){vh(i),t=Pn(t,"onChange"),0<t.length&&(r=new yl("onChange","change",null,r,i),e.push({event:r,listeners:t}))}var ns=null,gs=null;function l_(e){Jh(e,0)}function Zn(e){var t=Zr(e);if(ch(t))return e}function c_(e,t){if(e==="change")return t}var Nh=!1;if(Ht){var Do;if(Ht){var To="oninput"in document;if(!To){var Lc=document.createElement("div");Lc.setAttribute("oninput","return;"),To=typeof Lc.oninput=="function"}Do=To}else Do=!1;Nh=Do&&(!document.documentMode||9<document.documentMode)}function Dc(){ns&&(ns.detachEvent("onpropertychange",zh),gs=ns=null)}function zh(e){if(e.propertyName==="value"&&Zn(gs)){var t=[];Hh(t,gs,e,fl(e)),Sh(l_,t)}}function u_(e,t,r){e==="focusin"?(Dc(),ns=t,gs=r,ns.attachEvent("onpropertychange",zh)):e==="focusout"&&Dc()}function h_(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Zn(gs)}function d_(e,t){if(e==="click")return Zn(t)}function f_(e,t){if(e==="input"||e==="change")return Zn(t)}function p_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ct=typeof Object.is=="function"?Object.is:p_;function ms(e,t){if(Ct(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(i=0;i<r.length;i++){var s=r[i];if(!Jo.call(t,s)||!Ct(e[s],t[s]))return!1}return!0}function Tc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Pc(e,t){var r=Tc(e);e=0;for(var i;r;){if(r.nodeType===3){if(i=e+r.textContent.length,e<=t&&i>=t)return{node:r,offset:t-e};e=i}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Tc(r)}}function Uh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Uh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Wh(){for(var e=window,t=bn();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=bn(e.document)}return t}function wl(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 __(e){var t=Wh(),r=e.focusedElem,i=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&Uh(r.ownerDocument.documentElement,r)){if(i!==null&&wl(r)){if(t=i.start,e=i.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,h=Math.min(i.start,s);i=i.end===void 0?h:Math.min(i.end,s),!e.extend&&h>i&&(s=i,i=h,h=s),s=Pc(r,h);var v=Pc(r,i);s&&v&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==v.node||e.focusOffset!==v.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),h>i?(e.addRange(t),e.extend(v.node,v.offset)):(t.setEnd(v.node,v.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 v_=Ht&&"documentMode"in document&&11>=document.documentMode,Xr=null,_a=null,os=null,va=!1;function Ac(e,t,r){var i=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;va||Xr==null||Xr!==bn(i)||(i=Xr,"selectionStart"in i&&wl(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),os&&ms(os,i)||(os=i,i=Pn(_a,"onSelect"),0<i.length&&(t=new yl("onSelect","select",null,t,r),e.push({event:t,listeners:i}),t.target=Xr)))}function Zs(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Yr={animationend:Zs("Animation","AnimationEnd"),animationiteration:Zs("Animation","AnimationIteration"),animationstart:Zs("Animation","AnimationStart"),transitionend:Zs("Transition","TransitionEnd")},Po={},$h={};Ht&&($h=document.createElement("div").style,"AnimationEvent"in window||(delete Yr.animationend.animation,delete Yr.animationiteration.animation,delete Yr.animationstart.animation),"TransitionEvent"in window||delete Yr.transitionend.transition);function eo(e){if(Po[e])return Po[e];if(!Yr[e])return e;var t=Yr[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in $h)return Po[e]=t[r];return e}var Kh=eo("animationend"),Vh=eo("animationiteration"),qh=eo("animationstart"),Qh=eo("transitionend"),Gh=new Map,Mc="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 yr(e,t){Gh.set(e,t),$r(t,[e])}for(var Ao=0;Ao<Mc.length;Ao++){var Mo=Mc[Ao],g_=Mo.toLowerCase(),m_=Mo[0].toUpperCase()+Mo.slice(1);yr(g_,"on"+m_)}yr(Kh,"onAnimationEnd");yr(Vh,"onAnimationIteration");yr(qh,"onAnimationStart");yr("dblclick","onDoubleClick");yr("focusin","onFocus");yr("focusout","onBlur");yr(Qh,"onTransitionEnd");ki("onMouseEnter",["mouseout","mouseover"]);ki("onMouseLeave",["mouseout","mouseover"]);ki("onPointerEnter",["pointerout","pointerover"]);ki("onPointerLeave",["pointerout","pointerover"]);$r("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));$r("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));$r("onBeforeInput",["compositionend","keypress","textInput","paste"]);$r("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));$r("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));$r("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var es="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(" "),y_=new Set("cancel close invalid load scroll toggle".split(" ").concat(es));function Oc(e,t,r){var i=e.type||"unknown-event";e.currentTarget=r,gp(i,t,void 0,e),e.currentTarget=null}function Jh(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var i=e[r],s=i.event;i=i.listeners;e:{var h=void 0;if(t)for(var v=i.length-1;0<=v;v--){var n=i[v],u=n.instance,d=n.currentTarget;if(n=n.listener,u!==h&&s.isPropagationStopped())break e;Oc(s,n,d),h=u}else for(v=0;v<i.length;v++){if(n=i[v],u=n.instance,d=n.currentTarget,n=n.listener,u!==h&&s.isPropagationStopped())break e;Oc(s,n,d),h=u}}}if(En)throw e=ha,En=!1,ha=null,e}function he(e,t){var r=t[Ca];r===void 0&&(r=t[Ca]=new Set);var i=e+"__bubble";r.has(i)||(Xh(t,e,2,!1),r.add(i))}function Oo(e,t,r){var i=0;t&&(i|=4),Xh(r,e,i,t)}var en="_reactListening"+Math.random().toString(36).slice(2);function ys(e){if(!e[en]){e[en]=!0,sh.forEach(function(r){r!=="selectionchange"&&(y_.has(r)||Oo(r,!1,e),Oo(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[en]||(t[en]=!0,Oo("selectionchange",!1,t))}}function Xh(e,t,r,i){switch(Oh(t)){case 1:var s=Mp;break;case 4:s=Op;break;default:s=gl}r=s.bind(null,t,r,e),s=void 0,!ua||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),i?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 Bo(e,t,r,i,s){var h=i;if(!(t&1)&&!(t&2)&&i!==null)e:for(;;){if(i===null)return;var v=i.tag;if(v===3||v===4){var n=i.stateNode.containerInfo;if(n===s||n.nodeType===8&&n.parentNode===s)break;if(v===4)for(v=i.return;v!==null;){var u=v.tag;if((u===3||u===4)&&(u=v.stateNode.containerInfo,u===s||u.nodeType===8&&u.parentNode===s))return;v=v.return}for(;n!==null;){if(v=br(n),v===null)return;if(u=v.tag,u===5||u===6){i=h=v;continue e}n=n.parentNode}}i=i.return}Sh(function(){var d=h,g=fl(r),f=[];e:{var _=Gh.get(e);if(_!==void 0){var C=yl,w=e;switch(e){case"keypress":if(vn(r)===0)break e;case"keydown":case"keyup":C=Gp;break;case"focusin":w="focus",C=Lo;break;case"focusout":w="blur",C=Lo;break;case"beforeblur":case"afterblur":C=Lo;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":C=wc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":C=jp;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":C=Yp;break;case Kh:case Vh:case qh:C=Np;break;case Qh:C=e_;break;case"scroll":C=Bp;break;case"wheel":C=r_;break;case"copy":case"cut":case"paste":C=Up;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":C=bc}var S=(t&4)!==0,l=!S&&e==="scroll",a=S?_!==null?_+"Capture":null:_;S=[];for(var o=d,c;o!==null;){c=o;var p=c.stateNode;if(c.tag===5&&p!==null&&(c=p,a!==null&&(p=fs(o,a),p!=null&&S.push(Ss(o,p,c)))),l)break;o=o.return}0<S.length&&(_=new C(_,w,null,r,g),f.push({event:_,listeners:S}))}}if(!(t&7)){e:{if(_=e==="mouseover"||e==="pointerover",C=e==="mouseout"||e==="pointerout",_&&r!==la&&(w=r.relatedTarget||r.fromElement)&&(br(w)||w[Nt]))break e;if((C||_)&&(_=g.window===g?g:(_=g.ownerDocument)?_.defaultView||_.parentWindow:window,C?(w=r.relatedTarget||r.toElement,C=d,w=w?br(w):null,w!==null&&(l=Kr(w),w!==l||w.tag!==5&&w.tag!==6)&&(w=null)):(C=null,w=d),C!==w)){if(S=wc,p="onMouseLeave",a="onMouseEnter",o="mouse",(e==="pointerout"||e==="pointerover")&&(S=bc,p="onPointerLeave",a="onPointerEnter",o="pointer"),l=C==null?_:Zr(C),c=w==null?_:Zr(w),_=new S(p,o+"leave",C,r,g),_.target=l,_.relatedTarget=c,p=null,br(g)===d&&(S=new S(a,o+"enter",w,r,g),S.target=c,S.relatedTarget=l,p=S),l=p,C&&w)t:{for(S=C,a=w,o=0,c=S;c;c=qr(c))o++;for(c=0,p=a;p;p=qr(p))c++;for(;0<o-c;)S=qr(S),o--;for(;0<c-o;)a=qr(a),c--;for(;o--;){if(S===a||a!==null&&S===a.alternate)break t;S=qr(S),a=qr(a)}S=null}else S=null;C!==null&&Bc(f,_,C,S,!1),w!==null&&l!==null&&Bc(f,l,w,S,!0)}}e:{if(_=d?Zr(d):window,C=_.nodeName&&_.nodeName.toLowerCase(),C==="select"||C==="input"&&_.type==="file")var y=c_;else if(Rc(_))if(Nh)y=f_;else{y=h_;var x=u_}else(C=_.nodeName)&&C.toLowerCase()==="input"&&(_.type==="checkbox"||_.type==="radio")&&(y=d_);if(y&&(y=y(e,d))){Hh(f,y,r,g);break e}x&&x(e,_,d),e==="focusout"&&(x=_._wrapperState)&&x.controlled&&_.type==="number"&&ia(_,"number",_.value)}switch(x=d?Zr(d):window,e){case"focusin":(Rc(x)||x.contentEditable==="true")&&(Xr=x,_a=d,os=null);break;case"focusout":os=_a=Xr=null;break;case"mousedown":va=!0;break;case"contextmenu":case"mouseup":case"dragend":va=!1,Ac(f,r,g);break;case"selectionchange":if(v_)break;case"keydown":case"keyup":Ac(f,r,g)}var k;if(Cl)e:{switch(e){case"compositionstart":var m="onCompositionStart";break e;case"compositionend":m="onCompositionEnd";break e;case"compositionupdate":m="onCompositionUpdate";break e}m=void 0}else Jr?jh(e,r)&&(m="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(m="onCompositionStart");m&&(Ih&&r.locale!=="ko"&&(Jr||m!=="onCompositionStart"?m==="onCompositionEnd"&&Jr&&(k=Bh()):(or=g,ml="value"in or?or.value:or.textContent,Jr=!0)),x=Pn(d,m),0<x.length&&(m=new xc(m,e,null,r,g),f.push({event:m,listeners:x}),k?m.data=k:(k=Fh(r),k!==null&&(m.data=k)))),(k=s_?n_(e,r):o_(e,r))&&(d=Pn(d,"onBeforeInput"),0<d.length&&(g=new xc("onBeforeInput","beforeinput",null,r,g),f.push({event:g,listeners:d}),g.data=k))}Jh(f,t)})}function Ss(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Pn(e,t){for(var r=t+"Capture",i=[];e!==null;){var s=e,h=s.stateNode;s.tag===5&&h!==null&&(s=h,h=fs(e,r),h!=null&&i.unshift(Ss(e,h,s)),h=fs(e,t),h!=null&&i.push(Ss(e,h,s))),e=e.return}return i}function qr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Bc(e,t,r,i,s){for(var h=t._reactName,v=[];r!==null&&r!==i;){var n=r,u=n.alternate,d=n.stateNode;if(u!==null&&u===i)break;n.tag===5&&d!==null&&(n=d,s?(u=fs(r,h),u!=null&&v.unshift(Ss(r,u,n))):s||(u=fs(r,h),u!=null&&v.push(Ss(r,u,n)))),r=r.return}v.length!==0&&e.push({event:t,listeners:v})}var S_=/\r\n?/g,C_=/\u0000|\uFFFD/g;function Ic(e){return(typeof e=="string"?e:""+e).replace(S_,`
38
+ `).replace(C_,"")}function tn(e,t,r){if(t=Ic(t),Ic(e)!==t&&r)throw Error(K(425))}function An(){}var ga=null,ma=null;function ya(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 Sa=typeof setTimeout=="function"?setTimeout:void 0,w_=typeof clearTimeout=="function"?clearTimeout:void 0,jc=typeof Promise=="function"?Promise:void 0,x_=typeof queueMicrotask=="function"?queueMicrotask:typeof jc<"u"?function(e){return jc.resolve(null).then(e).catch(b_)}:Sa;function b_(e){setTimeout(function(){throw e})}function Io(e,t){var r=t,i=0;do{var s=r.nextSibling;if(e.removeChild(r),s&&s.nodeType===8)if(r=s.data,r==="/$"){if(i===0){e.removeChild(s),vs(t);return}i--}else r!=="$"&&r!=="$?"&&r!=="$!"||i++;r=s}while(r);vs(t)}function hr(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 Fc(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 Ii=Math.random().toString(36).slice(2),Lt="__reactFiber$"+Ii,Cs="__reactProps$"+Ii,Nt="__reactContainer$"+Ii,Ca="__reactEvents$"+Ii,k_="__reactListeners$"+Ii,E_="__reactHandles$"+Ii;function br(e){var t=e[Lt];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Nt]||r[Lt]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=Fc(e);e!==null;){if(r=e[Lt])return r;e=Fc(e)}return t}e=r,r=e.parentNode}return null}function Hs(e){return e=e[Lt]||e[Nt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Zr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(K(33))}function to(e){return e[Cs]||null}var wa=[],ei=-1;function Sr(e){return{current:e}}function de(e){0>ei||(e.current=wa[ei],wa[ei]=null,ei--)}function ue(e,t){ei++,wa[ei]=e.current,e.current=t}var mr={},je=Sr(mr),Ge=Sr(!1),Hr=mr;function Ei(e,t){var r=e.type.contextTypes;if(!r)return mr;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var s={},h;for(h in r)s[h]=t[h];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Je(e){return e=e.childContextTypes,e!=null}function Mn(){de(Ge),de(je)}function Hc(e,t,r){if(je.current!==mr)throw Error(K(168));ue(je,t),ue(Ge,r)}function Yh(e,t,r){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!="function")return r;i=i.getChildContext();for(var s in i)if(!(s in t))throw Error(K(108,up(e)||"Unknown",s));return ge({},r,i)}function On(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||mr,Hr=je.current,ue(je,e),ue(Ge,Ge.current),!0}function Nc(e,t,r){var i=e.stateNode;if(!i)throw Error(K(169));r?(e=Yh(e,t,Hr),i.__reactInternalMemoizedMergedChildContext=e,de(Ge),de(je),ue(je,e)):de(Ge),ue(Ge,r)}var Mt=null,ro=!1,jo=!1;function Zh(e){Mt===null?Mt=[e]:Mt.push(e)}function R_(e){ro=!0,Zh(e)}function Cr(){if(!jo&&Mt!==null){jo=!0;var e=0,t=ce;try{var r=Mt;for(ce=1;e<r.length;e++){var i=r[e];do i=i(!0);while(i!==null)}Mt=null,ro=!1}catch(s){throw Mt!==null&&(Mt=Mt.slice(e+1)),bh(pl,Cr),s}finally{ce=t,jo=!1}}return null}var ti=[],ri=0,Bn=null,In=0,lt=[],ct=0,Nr=null,It=1,jt="";function wr(e,t){ti[ri++]=In,ti[ri++]=Bn,Bn=e,In=t}function ed(e,t,r){lt[ct++]=It,lt[ct++]=jt,lt[ct++]=Nr,Nr=e;var i=It;e=jt;var s=32-yt(i)-1;i&=~(1<<s),r+=1;var h=32-yt(t)+s;if(30<h){var v=s-s%5;h=(i&(1<<v)-1).toString(32),i>>=v,s-=v,It=1<<32-yt(t)+s|r<<s|i,jt=h+e}else It=1<<h|r<<s|i,jt=e}function xl(e){e.return!==null&&(wr(e,1),ed(e,1,0))}function bl(e){for(;e===Bn;)Bn=ti[--ri],ti[ri]=null,In=ti[--ri],ti[ri]=null;for(;e===Nr;)Nr=lt[--ct],lt[ct]=null,jt=lt[--ct],lt[ct]=null,It=lt[--ct],lt[ct]=null}var rt=null,tt=null,fe=!1,mt=null;function td(e,t){var r=ut(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 zc(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,rt=e,tt=hr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,rt=e,tt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Nr!==null?{id:It,overflow:jt}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=ut(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,rt=e,tt=null,!0):!1;default:return!1}}function xa(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ba(e){if(fe){var t=tt;if(t){var r=t;if(!zc(e,t)){if(xa(e))throw Error(K(418));t=hr(r.nextSibling);var i=rt;t&&zc(e,t)?td(i,r):(e.flags=e.flags&-4097|2,fe=!1,rt=e)}}else{if(xa(e))throw Error(K(418));e.flags=e.flags&-4097|2,fe=!1,rt=e}}}function Uc(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;rt=e}function rn(e){if(e!==rt)return!1;if(!fe)return Uc(e),fe=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!ya(e.type,e.memoizedProps)),t&&(t=tt)){if(xa(e))throw rd(),Error(K(418));for(;t;)td(e,t),t=hr(t.nextSibling)}if(Uc(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(K(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){tt=hr(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}tt=null}}else tt=rt?hr(e.stateNode.nextSibling):null;return!0}function rd(){for(var e=tt;e;)e=hr(e.nextSibling)}function Ri(){tt=rt=null,fe=!1}function kl(e){mt===null?mt=[e]:mt.push(e)}var L_=Wt.ReactCurrentBatchConfig;function qi(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(K(309));var i=r.stateNode}if(!i)throw Error(K(147,e));var s=i,h=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===h?t.ref:(t=function(v){var n=s.refs;v===null?delete n[h]:n[h]=v},t._stringRef=h,t)}if(typeof e!="string")throw Error(K(284));if(!r._owner)throw Error(K(290,e))}return e}function sn(e,t){throw e=Object.prototype.toString.call(t),Error(K(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Wc(e){var t=e._init;return t(e._payload)}function id(e){function t(a,o){if(e){var c=a.deletions;c===null?(a.deletions=[o],a.flags|=16):c.push(o)}}function r(a,o){if(!e)return null;for(;o!==null;)t(a,o),o=o.sibling;return null}function i(a,o){for(a=new Map;o!==null;)o.key!==null?a.set(o.key,o):a.set(o.index,o),o=o.sibling;return a}function s(a,o){return a=_r(a,o),a.index=0,a.sibling=null,a}function h(a,o,c){return a.index=c,e?(c=a.alternate,c!==null?(c=c.index,c<o?(a.flags|=2,o):c):(a.flags|=2,o)):(a.flags|=1048576,o)}function v(a){return e&&a.alternate===null&&(a.flags|=2),a}function n(a,o,c,p){return o===null||o.tag!==6?(o=$o(c,a.mode,p),o.return=a,o):(o=s(o,c),o.return=a,o)}function u(a,o,c,p){var y=c.type;return y===Gr?g(a,o,c.props.children,p,c.key):o!==null&&(o.elementType===y||typeof y=="object"&&y!==null&&y.$$typeof===Qt&&Wc(y)===o.type)?(p=s(o,c.props),p.ref=qi(a,o,c),p.return=a,p):(p=xn(c.type,c.key,c.props,null,a.mode,p),p.ref=qi(a,o,c),p.return=a,p)}function d(a,o,c,p){return o===null||o.tag!==4||o.stateNode.containerInfo!==c.containerInfo||o.stateNode.implementation!==c.implementation?(o=Ko(c,a.mode,p),o.return=a,o):(o=s(o,c.children||[]),o.return=a,o)}function g(a,o,c,p,y){return o===null||o.tag!==7?(o=Fr(c,a.mode,p,y),o.return=a,o):(o=s(o,c),o.return=a,o)}function f(a,o,c){if(typeof o=="string"&&o!==""||typeof o=="number")return o=$o(""+o,a.mode,c),o.return=a,o;if(typeof o=="object"&&o!==null){switch(o.$$typeof){case Vs:return c=xn(o.type,o.key,o.props,null,a.mode,c),c.ref=qi(a,null,o),c.return=a,c;case Qr:return o=Ko(o,a.mode,c),o.return=a,o;case Qt:var p=o._init;return f(a,p(o._payload),c)}if(Yi(o)||Ui(o))return o=Fr(o,a.mode,c,null),o.return=a,o;sn(a,o)}return null}function _(a,o,c,p){var y=o!==null?o.key:null;if(typeof c=="string"&&c!==""||typeof c=="number")return y!==null?null:n(a,o,""+c,p);if(typeof c=="object"&&c!==null){switch(c.$$typeof){case Vs:return c.key===y?u(a,o,c,p):null;case Qr:return c.key===y?d(a,o,c,p):null;case Qt:return y=c._init,_(a,o,y(c._payload),p)}if(Yi(c)||Ui(c))return y!==null?null:g(a,o,c,p,null);sn(a,c)}return null}function C(a,o,c,p,y){if(typeof p=="string"&&p!==""||typeof p=="number")return a=a.get(c)||null,n(o,a,""+p,y);if(typeof p=="object"&&p!==null){switch(p.$$typeof){case Vs:return a=a.get(p.key===null?c:p.key)||null,u(o,a,p,y);case Qr:return a=a.get(p.key===null?c:p.key)||null,d(o,a,p,y);case Qt:var x=p._init;return C(a,o,c,x(p._payload),y)}if(Yi(p)||Ui(p))return a=a.get(c)||null,g(o,a,p,y,null);sn(o,p)}return null}function w(a,o,c,p){for(var y=null,x=null,k=o,m=o=0,b=null;k!==null&&m<c.length;m++){k.index>m?(b=k,k=null):b=k.sibling;var D=_(a,k,c[m],p);if(D===null){k===null&&(k=b);break}e&&k&&D.alternate===null&&t(a,k),o=h(D,o,m),x===null?y=D:x.sibling=D,x=D,k=b}if(m===c.length)return r(a,k),fe&&wr(a,m),y;if(k===null){for(;m<c.length;m++)k=f(a,c[m],p),k!==null&&(o=h(k,o,m),x===null?y=k:x.sibling=k,x=k);return fe&&wr(a,m),y}for(k=i(a,k);m<c.length;m++)b=C(k,a,m,c[m],p),b!==null&&(e&&b.alternate!==null&&k.delete(b.key===null?m:b.key),o=h(b,o,m),x===null?y=b:x.sibling=b,x=b);return e&&k.forEach(function(M){return t(a,M)}),fe&&wr(a,m),y}function S(a,o,c,p){var y=Ui(c);if(typeof y!="function")throw Error(K(150));if(c=y.call(c),c==null)throw Error(K(151));for(var x=y=null,k=o,m=o=0,b=null,D=c.next();k!==null&&!D.done;m++,D=c.next()){k.index>m?(b=k,k=null):b=k.sibling;var M=_(a,k,D.value,p);if(M===null){k===null&&(k=b);break}e&&k&&M.alternate===null&&t(a,k),o=h(M,o,m),x===null?y=M:x.sibling=M,x=M,k=b}if(D.done)return r(a,k),fe&&wr(a,m),y;if(k===null){for(;!D.done;m++,D=c.next())D=f(a,D.value,p),D!==null&&(o=h(D,o,m),x===null?y=D:x.sibling=D,x=D);return fe&&wr(a,m),y}for(k=i(a,k);!D.done;m++,D=c.next())D=C(k,a,m,D.value,p),D!==null&&(e&&D.alternate!==null&&k.delete(D.key===null?m:D.key),o=h(D,o,m),x===null?y=D:x.sibling=D,x=D);return e&&k.forEach(function(A){return t(a,A)}),fe&&wr(a,m),y}function l(a,o,c,p){if(typeof c=="object"&&c!==null&&c.type===Gr&&c.key===null&&(c=c.props.children),typeof c=="object"&&c!==null){switch(c.$$typeof){case Vs:e:{for(var y=c.key,x=o;x!==null;){if(x.key===y){if(y=c.type,y===Gr){if(x.tag===7){r(a,x.sibling),o=s(x,c.props.children),o.return=a,a=o;break e}}else if(x.elementType===y||typeof y=="object"&&y!==null&&y.$$typeof===Qt&&Wc(y)===x.type){r(a,x.sibling),o=s(x,c.props),o.ref=qi(a,x,c),o.return=a,a=o;break e}r(a,x);break}else t(a,x);x=x.sibling}c.type===Gr?(o=Fr(c.props.children,a.mode,p,c.key),o.return=a,a=o):(p=xn(c.type,c.key,c.props,null,a.mode,p),p.ref=qi(a,o,c),p.return=a,a=p)}return v(a);case Qr:e:{for(x=c.key;o!==null;){if(o.key===x)if(o.tag===4&&o.stateNode.containerInfo===c.containerInfo&&o.stateNode.implementation===c.implementation){r(a,o.sibling),o=s(o,c.children||[]),o.return=a,a=o;break e}else{r(a,o);break}else t(a,o);o=o.sibling}o=Ko(c,a.mode,p),o.return=a,a=o}return v(a);case Qt:return x=c._init,l(a,o,x(c._payload),p)}if(Yi(c))return w(a,o,c,p);if(Ui(c))return S(a,o,c,p);sn(a,c)}return typeof c=="string"&&c!==""||typeof c=="number"?(c=""+c,o!==null&&o.tag===6?(r(a,o.sibling),o=s(o,c),o.return=a,a=o):(r(a,o),o=$o(c,a.mode,p),o.return=a,a=o),v(a)):r(a,o)}return l}var Li=id(!0),sd=id(!1),jn=Sr(null),Fn=null,ii=null,El=null;function Rl(){El=ii=Fn=null}function Ll(e){var t=jn.current;de(jn),e._currentValue=t}function ka(e,t,r){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===r)break;e=e.return}}function ui(e,t){Fn=e,El=ii=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Qe=!0),e.firstContext=null)}function dt(e){var t=e._currentValue;if(El!==e)if(e={context:e,memoizedValue:t,next:null},ii===null){if(Fn===null)throw Error(K(308));ii=e,Fn.dependencies={lanes:0,firstContext:e}}else ii=ii.next=e;return t}var kr=null;function Dl(e){kr===null?kr=[e]:kr.push(e)}function nd(e,t,r,i){var s=t.interleaved;return s===null?(r.next=r,Dl(t)):(r.next=s.next,s.next=r),t.interleaved=r,zt(e,i)}function zt(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 Gt=!1;function Tl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function od(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 Ft(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function dr(e,t,r){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,ne&2){var s=i.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),i.pending=t,zt(e,r)}return s=i.interleaved,s===null?(t.next=t,Dl(i)):(t.next=s.next,s.next=t),i.interleaved=t,zt(e,r)}function gn(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,_l(e,r)}}function $c(e,t){var r=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,r===i)){var s=null,h=null;if(r=r.firstBaseUpdate,r!==null){do{var v={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};h===null?s=h=v:h=h.next=v,r=r.next}while(r!==null);h===null?s=h=t:h=h.next=t}else s=h=t;r={baseState:i.baseState,firstBaseUpdate:s,lastBaseUpdate:h,shared:i.shared,effects:i.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Hn(e,t,r,i){var s=e.updateQueue;Gt=!1;var h=s.firstBaseUpdate,v=s.lastBaseUpdate,n=s.shared.pending;if(n!==null){s.shared.pending=null;var u=n,d=u.next;u.next=null,v===null?h=d:v.next=d,v=u;var g=e.alternate;g!==null&&(g=g.updateQueue,n=g.lastBaseUpdate,n!==v&&(n===null?g.firstBaseUpdate=d:n.next=d,g.lastBaseUpdate=u))}if(h!==null){var f=s.baseState;v=0,g=d=u=null,n=h;do{var _=n.lane,C=n.eventTime;if((i&_)===_){g!==null&&(g=g.next={eventTime:C,lane:0,tag:n.tag,payload:n.payload,callback:n.callback,next:null});e:{var w=e,S=n;switch(_=t,C=r,S.tag){case 1:if(w=S.payload,typeof w=="function"){f=w.call(C,f,_);break e}f=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=S.payload,_=typeof w=="function"?w.call(C,f,_):w,_==null)break e;f=ge({},f,_);break e;case 2:Gt=!0}}n.callback!==null&&n.lane!==0&&(e.flags|=64,_=s.effects,_===null?s.effects=[n]:_.push(n))}else C={eventTime:C,lane:_,tag:n.tag,payload:n.payload,callback:n.callback,next:null},g===null?(d=g=C,u=f):g=g.next=C,v|=_;if(n=n.next,n===null){if(n=s.shared.pending,n===null)break;_=n,n=_.next,_.next=null,s.lastBaseUpdate=_,s.shared.pending=null}}while(!0);if(g===null&&(u=f),s.baseState=u,s.firstBaseUpdate=d,s.lastBaseUpdate=g,t=s.shared.interleaved,t!==null){s=t;do v|=s.lane,s=s.next;while(s!==t)}else h===null&&(s.shared.lanes=0);Ur|=v,e.lanes=v,e.memoizedState=f}}function Kc(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],s=i.callback;if(s!==null){if(i.callback=null,i=r,typeof s!="function")throw Error(K(191,s));s.call(i)}}}var Ns={},Tt=Sr(Ns),ws=Sr(Ns),xs=Sr(Ns);function Er(e){if(e===Ns)throw Error(K(174));return e}function Pl(e,t){switch(ue(xs,t),ue(ws,e),ue(Tt,Ns),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:na(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=na(t,e)}de(Tt),ue(Tt,t)}function Di(){de(Tt),de(ws),de(xs)}function ad(e){Er(xs.current);var t=Er(Tt.current),r=na(t,e.type);t!==r&&(ue(ws,e),ue(Tt,r))}function Al(e){ws.current===e&&(de(Tt),de(ws))}var _e=Sr(0);function Nn(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 Fo=[];function Ml(){for(var e=0;e<Fo.length;e++)Fo[e]._workInProgressVersionPrimary=null;Fo.length=0}var mn=Wt.ReactCurrentDispatcher,Ho=Wt.ReactCurrentBatchConfig,zr=0,ve=null,we=null,ke=null,zn=!1,as=!1,bs=0,D_=0;function Ae(){throw Error(K(321))}function Ol(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Ct(e[r],t[r]))return!1;return!0}function Bl(e,t,r,i,s,h){if(zr=h,ve=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,mn.current=e===null||e.memoizedState===null?M_:O_,e=r(i,s),as){h=0;do{if(as=!1,bs=0,25<=h)throw Error(K(301));h+=1,ke=we=null,t.updateQueue=null,mn.current=B_,e=r(i,s)}while(as)}if(mn.current=Un,t=we!==null&&we.next!==null,zr=0,ke=we=ve=null,zn=!1,t)throw Error(K(300));return e}function Il(){var e=bs!==0;return bs=0,e}function bt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ke===null?ve.memoizedState=ke=e:ke=ke.next=e,ke}function ft(){if(we===null){var e=ve.alternate;e=e!==null?e.memoizedState:null}else e=we.next;var t=ke===null?ve.memoizedState:ke.next;if(t!==null)ke=t,we=e;else{if(e===null)throw Error(K(310));we=e,e={memoizedState:we.memoizedState,baseState:we.baseState,baseQueue:we.baseQueue,queue:we.queue,next:null},ke===null?ve.memoizedState=ke=e:ke=ke.next=e}return ke}function ks(e,t){return typeof t=="function"?t(e):t}function No(e){var t=ft(),r=t.queue;if(r===null)throw Error(K(311));r.lastRenderedReducer=e;var i=we,s=i.baseQueue,h=r.pending;if(h!==null){if(s!==null){var v=s.next;s.next=h.next,h.next=v}i.baseQueue=s=h,r.pending=null}if(s!==null){h=s.next,i=i.baseState;var n=v=null,u=null,d=h;do{var g=d.lane;if((zr&g)===g)u!==null&&(u=u.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),i=d.hasEagerState?d.eagerState:e(i,d.action);else{var f={lane:g,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};u===null?(n=u=f,v=i):u=u.next=f,ve.lanes|=g,Ur|=g}d=d.next}while(d!==null&&d!==h);u===null?v=i:u.next=n,Ct(i,t.memoizedState)||(Qe=!0),t.memoizedState=i,t.baseState=v,t.baseQueue=u,r.lastRenderedState=i}if(e=r.interleaved,e!==null){s=e;do h=s.lane,ve.lanes|=h,Ur|=h,s=s.next;while(s!==e)}else s===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function zo(e){var t=ft(),r=t.queue;if(r===null)throw Error(K(311));r.lastRenderedReducer=e;var i=r.dispatch,s=r.pending,h=t.memoizedState;if(s!==null){r.pending=null;var v=s=s.next;do h=e(h,v.action),v=v.next;while(v!==s);Ct(h,t.memoizedState)||(Qe=!0),t.memoizedState=h,t.baseQueue===null&&(t.baseState=h),r.lastRenderedState=h}return[h,i]}function ld(){}function cd(e,t){var r=ve,i=ft(),s=t(),h=!Ct(i.memoizedState,s);if(h&&(i.memoizedState=s,Qe=!0),i=i.queue,jl(dd.bind(null,r,i,e),[e]),i.getSnapshot!==t||h||ke!==null&&ke.memoizedState.tag&1){if(r.flags|=2048,Es(9,hd.bind(null,r,i,s,t),void 0,null),Ee===null)throw Error(K(349));zr&30||ud(r,t,s)}return s}function ud(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=ve.updateQueue,t===null?(t={lastEffect:null,stores:null},ve.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function hd(e,t,r,i){t.value=r,t.getSnapshot=i,fd(t)&&pd(e)}function dd(e,t,r){return r(function(){fd(t)&&pd(e)})}function fd(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Ct(e,r)}catch{return!0}}function pd(e){var t=zt(e,1);t!==null&&St(t,e,1,-1)}function Vc(e){var t=bt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ks,lastRenderedState:e},t.queue=e,e=e.dispatch=A_.bind(null,ve,e),[t.memoizedState,e]}function Es(e,t,r,i){return e={tag:e,create:t,destroy:r,deps:i,next:null},t=ve.updateQueue,t===null?(t={lastEffect:null,stores:null},ve.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(i=r.next,r.next=e,e.next=i,t.lastEffect=e)),e}function _d(){return ft().memoizedState}function yn(e,t,r,i){var s=bt();ve.flags|=e,s.memoizedState=Es(1|t,r,void 0,i===void 0?null:i)}function io(e,t,r,i){var s=ft();i=i===void 0?null:i;var h=void 0;if(we!==null){var v=we.memoizedState;if(h=v.destroy,i!==null&&Ol(i,v.deps)){s.memoizedState=Es(t,r,h,i);return}}ve.flags|=e,s.memoizedState=Es(1|t,r,h,i)}function qc(e,t){return yn(8390656,8,e,t)}function jl(e,t){return io(2048,8,e,t)}function vd(e,t){return io(4,2,e,t)}function gd(e,t){return io(4,4,e,t)}function md(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 yd(e,t,r){return r=r!=null?r.concat([e]):null,io(4,4,md.bind(null,t,e),r)}function Fl(){}function Sd(e,t){var r=ft();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&Ol(t,i[1])?i[0]:(r.memoizedState=[e,t],e)}function Cd(e,t){var r=ft();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&Ol(t,i[1])?i[0]:(e=e(),r.memoizedState=[e,t],e)}function wd(e,t,r){return zr&21?(Ct(r,t)||(r=Rh(),ve.lanes|=r,Ur|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Qe=!0),e.memoizedState=r)}function T_(e,t){var r=ce;ce=r!==0&&4>r?r:4,e(!0);var i=Ho.transition;Ho.transition={};try{e(!1),t()}finally{ce=r,Ho.transition=i}}function xd(){return ft().memoizedState}function P_(e,t,r){var i=pr(e);if(r={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null},bd(e))kd(t,r);else if(r=nd(e,t,r,i),r!==null){var s=Ne();St(r,e,i,s),Ed(r,t,i)}}function A_(e,t,r){var i=pr(e),s={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null};if(bd(e))kd(t,s);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=t.lastRenderedReducer,h!==null))try{var v=t.lastRenderedState,n=h(v,r);if(s.hasEagerState=!0,s.eagerState=n,Ct(n,v)){var u=t.interleaved;u===null?(s.next=s,Dl(t)):(s.next=u.next,u.next=s),t.interleaved=s;return}}catch{}finally{}r=nd(e,t,s,i),r!==null&&(s=Ne(),St(r,e,i,s),Ed(r,t,i))}}function bd(e){var t=e.alternate;return e===ve||t!==null&&t===ve}function kd(e,t){as=zn=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Ed(e,t,r){if(r&4194240){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,_l(e,r)}}var Un={readContext:dt,useCallback:Ae,useContext:Ae,useEffect:Ae,useImperativeHandle:Ae,useInsertionEffect:Ae,useLayoutEffect:Ae,useMemo:Ae,useReducer:Ae,useRef:Ae,useState:Ae,useDebugValue:Ae,useDeferredValue:Ae,useTransition:Ae,useMutableSource:Ae,useSyncExternalStore:Ae,useId:Ae,unstable_isNewReconciler:!1},M_={readContext:dt,useCallback:function(e,t){return bt().memoizedState=[e,t===void 0?null:t],e},useContext:dt,useEffect:qc,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,yn(4194308,4,md.bind(null,t,e),r)},useLayoutEffect:function(e,t){return yn(4194308,4,e,t)},useInsertionEffect:function(e,t){return yn(4,2,e,t)},useMemo:function(e,t){var r=bt();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var i=bt();return t=r!==void 0?r(t):t,i.memoizedState=i.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},i.queue=e,e=e.dispatch=P_.bind(null,ve,e),[i.memoizedState,e]},useRef:function(e){var t=bt();return e={current:e},t.memoizedState=e},useState:Vc,useDebugValue:Fl,useDeferredValue:function(e){return bt().memoizedState=e},useTransition:function(){var e=Vc(!1),t=e[0];return e=T_.bind(null,e[1]),bt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var i=ve,s=bt();if(fe){if(r===void 0)throw Error(K(407));r=r()}else{if(r=t(),Ee===null)throw Error(K(349));zr&30||ud(i,t,r)}s.memoizedState=r;var h={value:r,getSnapshot:t};return s.queue=h,qc(dd.bind(null,i,h,e),[e]),i.flags|=2048,Es(9,hd.bind(null,i,h,r,t),void 0,null),r},useId:function(){var e=bt(),t=Ee.identifierPrefix;if(fe){var r=jt,i=It;r=(i&~(1<<32-yt(i)-1)).toString(32)+r,t=":"+t+"R"+r,r=bs++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=D_++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},O_={readContext:dt,useCallback:Sd,useContext:dt,useEffect:jl,useImperativeHandle:yd,useInsertionEffect:vd,useLayoutEffect:gd,useMemo:Cd,useReducer:No,useRef:_d,useState:function(){return No(ks)},useDebugValue:Fl,useDeferredValue:function(e){var t=ft();return wd(t,we.memoizedState,e)},useTransition:function(){var e=No(ks)[0],t=ft().memoizedState;return[e,t]},useMutableSource:ld,useSyncExternalStore:cd,useId:xd,unstable_isNewReconciler:!1},B_={readContext:dt,useCallback:Sd,useContext:dt,useEffect:jl,useImperativeHandle:yd,useInsertionEffect:vd,useLayoutEffect:gd,useMemo:Cd,useReducer:zo,useRef:_d,useState:function(){return zo(ks)},useDebugValue:Fl,useDeferredValue:function(e){var t=ft();return we===null?t.memoizedState=e:wd(t,we.memoizedState,e)},useTransition:function(){var e=zo(ks)[0],t=ft().memoizedState;return[e,t]},useMutableSource:ld,useSyncExternalStore:cd,useId:xd,unstable_isNewReconciler:!1};function _t(e,t){if(e&&e.defaultProps){t=ge({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function Ea(e,t,r,i){t=e.memoizedState,r=r(i,t),r=r==null?t:ge({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var so={isMounted:function(e){return(e=e._reactInternals)?Kr(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var i=Ne(),s=pr(e),h=Ft(i,s);h.payload=t,r!=null&&(h.callback=r),t=dr(e,h,s),t!==null&&(St(t,e,s,i),gn(t,e,s))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var i=Ne(),s=pr(e),h=Ft(i,s);h.tag=1,h.payload=t,r!=null&&(h.callback=r),t=dr(e,h,s),t!==null&&(St(t,e,s,i),gn(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Ne(),i=pr(e),s=Ft(r,i);s.tag=2,t!=null&&(s.callback=t),t=dr(e,s,i),t!==null&&(St(t,e,i,r),gn(t,e,i))}};function Qc(e,t,r,i,s,h,v){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,h,v):t.prototype&&t.prototype.isPureReactComponent?!ms(r,i)||!ms(s,h):!0}function Rd(e,t,r){var i=!1,s=mr,h=t.contextType;return typeof h=="object"&&h!==null?h=dt(h):(s=Je(t)?Hr:je.current,i=t.contextTypes,h=(i=i!=null)?Ei(e,s):mr),t=new t(r,h),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=so,e.stateNode=t,t._reactInternals=e,i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=h),t}function Gc(e,t,r,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,i),t.state!==e&&so.enqueueReplaceState(t,t.state,null)}function Ra(e,t,r,i){var s=e.stateNode;s.props=r,s.state=e.memoizedState,s.refs={},Tl(e);var h=t.contextType;typeof h=="object"&&h!==null?s.context=dt(h):(h=Je(t)?Hr:je.current,s.context=Ei(e,h)),s.state=e.memoizedState,h=t.getDerivedStateFromProps,typeof h=="function"&&(Ea(e,t,h,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&&so.enqueueReplaceState(s,s.state,null),Hn(e,r,s,i),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function Ti(e,t){try{var r="",i=t;do r+=cp(i),i=i.return;while(i);var s=r}catch(h){s=`
39
+ Error generating stack: `+h.message+`
40
+ `+h.stack}return{value:e,source:t,stack:s,digest:null}}function Uo(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function La(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var I_=typeof WeakMap=="function"?WeakMap:Map;function Ld(e,t,r){r=Ft(-1,r),r.tag=3,r.payload={element:null};var i=t.value;return r.callback=function(){$n||($n=!0,Fa=i),La(e,t)},r}function Dd(e,t,r){r=Ft(-1,r),r.tag=3;var i=e.type.getDerivedStateFromError;if(typeof i=="function"){var s=t.value;r.payload=function(){return i(s)},r.callback=function(){La(e,t)}}var h=e.stateNode;return h!==null&&typeof h.componentDidCatch=="function"&&(r.callback=function(){La(e,t),typeof i!="function"&&(fr===null?fr=new Set([this]):fr.add(this));var v=t.stack;this.componentDidCatch(t.value,{componentStack:v!==null?v:""})}),r}function Jc(e,t,r){var i=e.pingCache;if(i===null){i=e.pingCache=new I_;var s=new Set;i.set(t,s)}else s=i.get(t),s===void 0&&(s=new Set,i.set(t,s));s.has(r)||(s.add(r),e=J_.bind(null,e,t,r),t.then(e,e))}function Xc(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 Yc(e,t,r,i,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=Ft(-1,1),t.tag=2,dr(r,t,1))),r.lanes|=1),e)}var j_=Wt.ReactCurrentOwner,Qe=!1;function He(e,t,r,i){t.child=e===null?sd(t,null,r,i):Li(t,e.child,r,i)}function Zc(e,t,r,i,s){r=r.render;var h=t.ref;return ui(t,s),i=Bl(e,t,r,i,h,s),r=Il(),e!==null&&!Qe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Ut(e,t,s)):(fe&&r&&xl(t),t.flags|=1,He(e,t,i,s),t.child)}function eu(e,t,r,i,s){if(e===null){var h=r.type;return typeof h=="function"&&!Vl(h)&&h.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=h,Td(e,t,h,i,s)):(e=xn(r.type,null,i,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(h=e.child,!(e.lanes&s)){var v=h.memoizedProps;if(r=r.compare,r=r!==null?r:ms,r(v,i)&&e.ref===t.ref)return Ut(e,t,s)}return t.flags|=1,e=_r(h,i),e.ref=t.ref,e.return=t,t.child=e}function Td(e,t,r,i,s){if(e!==null){var h=e.memoizedProps;if(ms(h,i)&&e.ref===t.ref)if(Qe=!1,t.pendingProps=i=h,(e.lanes&s)!==0)e.flags&131072&&(Qe=!0);else return t.lanes=e.lanes,Ut(e,t,s)}return Da(e,t,r,i,s)}function Pd(e,t,r){var i=t.pendingProps,s=i.children,h=e!==null?e.memoizedState:null;if(i.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ue(ni,Ye),Ye|=r;else{if(!(r&1073741824))return e=h!==null?h.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ue(ni,Ye),Ye|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=h!==null?h.baseLanes:r,ue(ni,Ye),Ye|=i}else h!==null?(i=h.baseLanes|r,t.memoizedState=null):i=r,ue(ni,Ye),Ye|=i;return He(e,t,s,r),t.child}function Ad(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Da(e,t,r,i,s){var h=Je(r)?Hr:je.current;return h=Ei(t,h),ui(t,s),r=Bl(e,t,r,i,h,s),i=Il(),e!==null&&!Qe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Ut(e,t,s)):(fe&&i&&xl(t),t.flags|=1,He(e,t,r,s),t.child)}function tu(e,t,r,i,s){if(Je(r)){var h=!0;On(t)}else h=!1;if(ui(t,s),t.stateNode===null)Sn(e,t),Rd(t,r,i),Ra(t,r,i,s),i=!0;else if(e===null){var v=t.stateNode,n=t.memoizedProps;v.props=n;var u=v.context,d=r.contextType;typeof d=="object"&&d!==null?d=dt(d):(d=Je(r)?Hr:je.current,d=Ei(t,d));var g=r.getDerivedStateFromProps,f=typeof g=="function"||typeof v.getSnapshotBeforeUpdate=="function";f||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(n!==i||u!==d)&&Gc(t,v,i,d),Gt=!1;var _=t.memoizedState;v.state=_,Hn(t,i,v,s),u=t.memoizedState,n!==i||_!==u||Ge.current||Gt?(typeof g=="function"&&(Ea(t,r,g,i),u=t.memoizedState),(n=Gt||Qc(t,r,n,i,_,u,d))?(f||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(t.flags|=4194308)):(typeof v.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=u),v.props=i,v.state=u,v.context=d,i=n):(typeof v.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{v=t.stateNode,od(e,t),n=t.memoizedProps,d=t.type===t.elementType?n:_t(t.type,n),v.props=d,f=t.pendingProps,_=v.context,u=r.contextType,typeof u=="object"&&u!==null?u=dt(u):(u=Je(r)?Hr:je.current,u=Ei(t,u));var C=r.getDerivedStateFromProps;(g=typeof C=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(n!==f||_!==u)&&Gc(t,v,i,u),Gt=!1,_=t.memoizedState,v.state=_,Hn(t,i,v,s);var w=t.memoizedState;n!==f||_!==w||Ge.current||Gt?(typeof C=="function"&&(Ea(t,r,C,i),w=t.memoizedState),(d=Gt||Qc(t,r,d,i,_,w,u)||!1)?(g||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(i,w,u),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(i,w,u)),typeof v.componentDidUpdate=="function"&&(t.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof v.componentDidUpdate!="function"||n===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||n===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=w),v.props=i,v.state=w,v.context=u,i=d):(typeof v.componentDidUpdate!="function"||n===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||n===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),i=!1)}return Ta(e,t,r,i,h,s)}function Ta(e,t,r,i,s,h){Ad(e,t);var v=(t.flags&128)!==0;if(!i&&!v)return s&&Nc(t,r,!1),Ut(e,t,h);i=t.stateNode,j_.current=t;var n=v&&typeof r.getDerivedStateFromError!="function"?null:i.render();return t.flags|=1,e!==null&&v?(t.child=Li(t,e.child,null,h),t.child=Li(t,null,n,h)):He(e,t,n,h),t.memoizedState=i.state,s&&Nc(t,r,!0),t.child}function Md(e){var t=e.stateNode;t.pendingContext?Hc(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Hc(e,t.context,!1),Pl(e,t.containerInfo)}function ru(e,t,r,i,s){return Ri(),kl(s),t.flags|=256,He(e,t,r,i),t.child}var Pa={dehydrated:null,treeContext:null,retryLane:0};function Aa(e){return{baseLanes:e,cachePool:null,transitions:null}}function Od(e,t,r){var i=t.pendingProps,s=_e.current,h=!1,v=(t.flags&128)!==0,n;if((n=v)||(n=e!==null&&e.memoizedState===null?!1:(s&2)!==0),n?(h=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),ue(_e,s&1),e===null)return ba(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):(v=i.children,e=i.fallback,h?(i=t.mode,h=t.child,v={mode:"hidden",children:v},!(i&1)&&h!==null?(h.childLanes=0,h.pendingProps=v):h=ao(v,i,0,null),e=Fr(e,i,r,null),h.return=t,e.return=t,h.sibling=e,t.child=h,t.child.memoizedState=Aa(r),t.memoizedState=Pa,e):Hl(t,v));if(s=e.memoizedState,s!==null&&(n=s.dehydrated,n!==null))return F_(e,t,v,i,n,s,r);if(h){h=i.fallback,v=t.mode,s=e.child,n=s.sibling;var u={mode:"hidden",children:i.children};return!(v&1)&&t.child!==s?(i=t.child,i.childLanes=0,i.pendingProps=u,t.deletions=null):(i=_r(s,u),i.subtreeFlags=s.subtreeFlags&14680064),n!==null?h=_r(n,h):(h=Fr(h,v,r,null),h.flags|=2),h.return=t,i.return=t,i.sibling=h,t.child=i,i=h,h=t.child,v=e.child.memoizedState,v=v===null?Aa(r):{baseLanes:v.baseLanes|r,cachePool:null,transitions:v.transitions},h.memoizedState=v,h.childLanes=e.childLanes&~r,t.memoizedState=Pa,i}return h=e.child,e=h.sibling,i=_r(h,{mode:"visible",children:i.children}),!(t.mode&1)&&(i.lanes=r),i.return=t,i.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=i,t.memoizedState=null,i}function Hl(e,t){return t=ao({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function nn(e,t,r,i){return i!==null&&kl(i),Li(t,e.child,null,r),e=Hl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function F_(e,t,r,i,s,h,v){if(r)return t.flags&256?(t.flags&=-257,i=Uo(Error(K(422))),nn(e,t,v,i)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(h=i.fallback,s=t.mode,i=ao({mode:"visible",children:i.children},s,0,null),h=Fr(h,s,v,null),h.flags|=2,i.return=t,h.return=t,i.sibling=h,t.child=i,t.mode&1&&Li(t,e.child,null,v),t.child.memoizedState=Aa(v),t.memoizedState=Pa,h);if(!(t.mode&1))return nn(e,t,v,null);if(s.data==="$!"){if(i=s.nextSibling&&s.nextSibling.dataset,i)var n=i.dgst;return i=n,h=Error(K(419)),i=Uo(h,i,void 0),nn(e,t,v,i)}if(n=(v&e.childLanes)!==0,Qe||n){if(i=Ee,i!==null){switch(v&-v){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&(i.suspendedLanes|v)?0:s,s!==0&&s!==h.retryLane&&(h.retryLane=s,zt(e,s),St(i,e,s,-1))}return Kl(),i=Uo(Error(K(421))),nn(e,t,v,i)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=X_.bind(null,e),s._reactRetry=t,null):(e=h.treeContext,tt=hr(s.nextSibling),rt=t,fe=!0,mt=null,e!==null&&(lt[ct++]=It,lt[ct++]=jt,lt[ct++]=Nr,It=e.id,jt=e.overflow,Nr=t),t=Hl(t,i.children),t.flags|=4096,t)}function iu(e,t,r){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),ka(e.return,t,r)}function Wo(e,t,r,i,s){var h=e.memoizedState;h===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:r,tailMode:s}:(h.isBackwards=t,h.rendering=null,h.renderingStartTime=0,h.last=i,h.tail=r,h.tailMode=s)}function Bd(e,t,r){var i=t.pendingProps,s=i.revealOrder,h=i.tail;if(He(e,t,i.children,r),i=_e.current,i&2)i=i&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&&iu(e,r,t);else if(e.tag===19)iu(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}i&=1}if(ue(_e,i),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(r=t.child,s=null;r!==null;)e=r.alternate,e!==null&&Nn(e)===null&&(s=r),r=r.sibling;r=s,r===null?(s=t.child,t.child=null):(s=r.sibling,r.sibling=null),Wo(t,!1,s,r,h);break;case"backwards":for(r=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Nn(e)===null){t.child=s;break}e=s.sibling,s.sibling=r,r=s,s=e}Wo(t,!0,r,null,h);break;case"together":Wo(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Sn(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ut(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Ur|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(K(153));if(t.child!==null){for(e=t.child,r=_r(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=_r(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function H_(e,t,r){switch(t.tag){case 3:Md(t),Ri();break;case 5:ad(t);break;case 1:Je(t.type)&&On(t);break;case 4:Pl(t,t.stateNode.containerInfo);break;case 10:var i=t.type._context,s=t.memoizedProps.value;ue(jn,i._currentValue),i._currentValue=s;break;case 13:if(i=t.memoizedState,i!==null)return i.dehydrated!==null?(ue(_e,_e.current&1),t.flags|=128,null):r&t.child.childLanes?Od(e,t,r):(ue(_e,_e.current&1),e=Ut(e,t,r),e!==null?e.sibling:null);ue(_e,_e.current&1);break;case 19:if(i=(r&t.childLanes)!==0,e.flags&128){if(i)return Bd(e,t,r);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),ue(_e,_e.current),i)break;return null;case 22:case 23:return t.lanes=0,Pd(e,t,r)}return Ut(e,t,r)}var Id,Ma,jd,Fd;Id=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}};Ma=function(){};jd=function(e,t,r,i){var s=e.memoizedProps;if(s!==i){e=t.stateNode,Er(Tt.current);var h=null;switch(r){case"input":s=ta(e,s),i=ta(e,i),h=[];break;case"select":s=ge({},s,{value:void 0}),i=ge({},i,{value:void 0}),h=[];break;case"textarea":s=sa(e,s),i=sa(e,i),h=[];break;default:typeof s.onClick!="function"&&typeof i.onClick=="function"&&(e.onclick=An)}oa(r,i);var v;r=null;for(d in s)if(!i.hasOwnProperty(d)&&s.hasOwnProperty(d)&&s[d]!=null)if(d==="style"){var n=s[d];for(v in n)n.hasOwnProperty(v)&&(r||(r={}),r[v]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(hs.hasOwnProperty(d)?h||(h=[]):(h=h||[]).push(d,null));for(d in i){var u=i[d];if(n=s!=null?s[d]:void 0,i.hasOwnProperty(d)&&u!==n&&(u!=null||n!=null))if(d==="style")if(n){for(v in n)!n.hasOwnProperty(v)||u&&u.hasOwnProperty(v)||(r||(r={}),r[v]="");for(v in u)u.hasOwnProperty(v)&&n[v]!==u[v]&&(r||(r={}),r[v]=u[v])}else r||(h||(h=[]),h.push(d,r)),r=u;else d==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,n=n?n.__html:void 0,u!=null&&n!==u&&(h=h||[]).push(d,u)):d==="children"?typeof u!="string"&&typeof u!="number"||(h=h||[]).push(d,""+u):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(hs.hasOwnProperty(d)?(u!=null&&d==="onScroll"&&he("scroll",e),h||n===u||(h=[])):(h=h||[]).push(d,u))}r&&(h=h||[]).push("style",r);var d=h;(t.updateQueue=d)&&(t.flags|=4)}};Fd=function(e,t,r,i){r!==i&&(t.flags|=4)};function Qi(e,t){if(!fe)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 i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function Me(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,i=0;if(t)for(var s=e.child;s!==null;)r|=s.lanes|s.childLanes,i|=s.subtreeFlags&14680064,i|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)r|=s.lanes|s.childLanes,i|=s.subtreeFlags,i|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=i,e.childLanes=r,t}function N_(e,t,r){var i=t.pendingProps;switch(bl(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Me(t),null;case 1:return Je(t.type)&&Mn(),Me(t),null;case 3:return i=t.stateNode,Di(),de(Ge),de(je),Ml(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(rn(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,mt!==null&&(za(mt),mt=null))),Ma(e,t),Me(t),null;case 5:Al(t);var s=Er(xs.current);if(r=t.type,e!==null&&t.stateNode!=null)jd(e,t,r,i,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(K(166));return Me(t),null}if(e=Er(Tt.current),rn(t)){i=t.stateNode,r=t.type;var h=t.memoizedProps;switch(i[Lt]=t,i[Cs]=h,e=(t.mode&1)!==0,r){case"dialog":he("cancel",i),he("close",i);break;case"iframe":case"object":case"embed":he("load",i);break;case"video":case"audio":for(s=0;s<es.length;s++)he(es[s],i);break;case"source":he("error",i);break;case"img":case"image":case"link":he("error",i),he("load",i);break;case"details":he("toggle",i);break;case"input":dc(i,h),he("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!h.multiple},he("invalid",i);break;case"textarea":pc(i,h),he("invalid",i)}oa(r,h),s=null;for(var v in h)if(h.hasOwnProperty(v)){var n=h[v];v==="children"?typeof n=="string"?i.textContent!==n&&(h.suppressHydrationWarning!==!0&&tn(i.textContent,n,e),s=["children",n]):typeof n=="number"&&i.textContent!==""+n&&(h.suppressHydrationWarning!==!0&&tn(i.textContent,n,e),s=["children",""+n]):hs.hasOwnProperty(v)&&n!=null&&v==="onScroll"&&he("scroll",i)}switch(r){case"input":qs(i),fc(i,h,!0);break;case"textarea":qs(i),_c(i);break;case"select":case"option":break;default:typeof h.onClick=="function"&&(i.onclick=An)}i=s,t.updateQueue=i,i!==null&&(t.flags|=4)}else{v=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=dh(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=v.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=v.createElement(r,{is:i.is}):(e=v.createElement(r),r==="select"&&(v=e,i.multiple?v.multiple=!0:i.size&&(v.size=i.size))):e=v.createElementNS(e,r),e[Lt]=t,e[Cs]=i,Id(e,t,!1,!1),t.stateNode=e;e:{switch(v=aa(r,i),r){case"dialog":he("cancel",e),he("close",e),s=i;break;case"iframe":case"object":case"embed":he("load",e),s=i;break;case"video":case"audio":for(s=0;s<es.length;s++)he(es[s],e);s=i;break;case"source":he("error",e),s=i;break;case"img":case"image":case"link":he("error",e),he("load",e),s=i;break;case"details":he("toggle",e),s=i;break;case"input":dc(e,i),s=ta(e,i),he("invalid",e);break;case"option":s=i;break;case"select":e._wrapperState={wasMultiple:!!i.multiple},s=ge({},i,{value:void 0}),he("invalid",e);break;case"textarea":pc(e,i),s=sa(e,i),he("invalid",e);break;default:s=i}oa(r,s),n=s;for(h in n)if(n.hasOwnProperty(h)){var u=n[h];h==="style"?_h(e,u):h==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&fh(e,u)):h==="children"?typeof u=="string"?(r!=="textarea"||u!=="")&&ds(e,u):typeof u=="number"&&ds(e,""+u):h!=="suppressContentEditableWarning"&&h!=="suppressHydrationWarning"&&h!=="autoFocus"&&(hs.hasOwnProperty(h)?u!=null&&h==="onScroll"&&he("scroll",e):u!=null&&cl(e,h,u,v))}switch(r){case"input":qs(e),fc(e,i,!1);break;case"textarea":qs(e),_c(e);break;case"option":i.value!=null&&e.setAttribute("value",""+gr(i.value));break;case"select":e.multiple=!!i.multiple,h=i.value,h!=null?oi(e,!!i.multiple,h,!1):i.defaultValue!=null&&oi(e,!!i.multiple,i.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=An)}switch(r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Me(t),null;case 6:if(e&&t.stateNode!=null)Fd(e,t,e.memoizedProps,i);else{if(typeof i!="string"&&t.stateNode===null)throw Error(K(166));if(r=Er(xs.current),Er(Tt.current),rn(t)){if(i=t.stateNode,r=t.memoizedProps,i[Lt]=t,(h=i.nodeValue!==r)&&(e=rt,e!==null))switch(e.tag){case 3:tn(i.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&tn(i.nodeValue,r,(e.mode&1)!==0)}h&&(t.flags|=4)}else i=(r.nodeType===9?r:r.ownerDocument).createTextNode(i),i[Lt]=t,t.stateNode=i}return Me(t),null;case 13:if(de(_e),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(fe&&tt!==null&&t.mode&1&&!(t.flags&128))rd(),Ri(),t.flags|=98560,h=!1;else if(h=rn(t),i!==null&&i.dehydrated!==null){if(e===null){if(!h)throw Error(K(318));if(h=t.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(K(317));h[Lt]=t}else Ri(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Me(t),h=!1}else mt!==null&&(za(mt),mt=null),h=!0;if(!h)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,t.mode&1&&(e===null||_e.current&1?xe===0&&(xe=3):Kl())),t.updateQueue!==null&&(t.flags|=4),Me(t),null);case 4:return Di(),Ma(e,t),e===null&&ys(t.stateNode.containerInfo),Me(t),null;case 10:return Ll(t.type._context),Me(t),null;case 17:return Je(t.type)&&Mn(),Me(t),null;case 19:if(de(_e),h=t.memoizedState,h===null)return Me(t),null;if(i=(t.flags&128)!==0,v=h.rendering,v===null)if(i)Qi(h,!1);else{if(xe!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(v=Nn(e),v!==null){for(t.flags|=128,Qi(h,!1),i=v.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=r,r=t.child;r!==null;)h=r,e=i,h.flags&=14680066,v=h.alternate,v===null?(h.childLanes=0,h.lanes=e,h.child=null,h.subtreeFlags=0,h.memoizedProps=null,h.memoizedState=null,h.updateQueue=null,h.dependencies=null,h.stateNode=null):(h.childLanes=v.childLanes,h.lanes=v.lanes,h.child=v.child,h.subtreeFlags=0,h.deletions=null,h.memoizedProps=v.memoizedProps,h.memoizedState=v.memoizedState,h.updateQueue=v.updateQueue,h.type=v.type,e=v.dependencies,h.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return ue(_e,_e.current&1|2),t.child}e=e.sibling}h.tail!==null&&Se()>Pi&&(t.flags|=128,i=!0,Qi(h,!1),t.lanes=4194304)}else{if(!i)if(e=Nn(v),e!==null){if(t.flags|=128,i=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Qi(h,!0),h.tail===null&&h.tailMode==="hidden"&&!v.alternate&&!fe)return Me(t),null}else 2*Se()-h.renderingStartTime>Pi&&r!==1073741824&&(t.flags|=128,i=!0,Qi(h,!1),t.lanes=4194304);h.isBackwards?(v.sibling=t.child,t.child=v):(r=h.last,r!==null?r.sibling=v:t.child=v,h.last=v)}return h.tail!==null?(t=h.tail,h.rendering=t,h.tail=t.sibling,h.renderingStartTime=Se(),t.sibling=null,r=_e.current,ue(_e,i?r&1|2:r&1),t):(Me(t),null);case 22:case 23:return $l(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?Ye&1073741824&&(Me(t),t.subtreeFlags&6&&(t.flags|=8192)):Me(t),null;case 24:return null;case 25:return null}throw Error(K(156,t.tag))}function z_(e,t){switch(bl(t),t.tag){case 1:return Je(t.type)&&Mn(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Di(),de(Ge),de(je),Ml(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Al(t),null;case 13:if(de(_e),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(K(340));Ri()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return de(_e),null;case 4:return Di(),null;case 10:return Ll(t.type._context),null;case 22:case 23:return $l(),null;case 24:return null;default:return null}}var on=!1,Be=!1,U_=typeof WeakSet=="function"?WeakSet:Set,J=null;function si(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(i){ye(e,t,i)}else r.current=null}function Oa(e,t,r){try{r()}catch(i){ye(e,t,i)}}var su=!1;function W_(e,t){if(ga=Dn,e=Wh(),wl(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var s=i.anchorOffset,h=i.focusNode;i=i.focusOffset;try{r.nodeType,h.nodeType}catch{r=null;break e}var v=0,n=-1,u=-1,d=0,g=0,f=e,_=null;t:for(;;){for(var C;f!==r||s!==0&&f.nodeType!==3||(n=v+s),f!==h||i!==0&&f.nodeType!==3||(u=v+i),f.nodeType===3&&(v+=f.nodeValue.length),(C=f.firstChild)!==null;)_=f,f=C;for(;;){if(f===e)break t;if(_===r&&++d===s&&(n=v),_===h&&++g===i&&(u=v),(C=f.nextSibling)!==null)break;f=_,_=f.parentNode}f=C}r=n===-1||u===-1?null:{start:n,end:u}}else r=null}r=r||{start:0,end:0}}else r=null;for(ma={focusedElem:e,selectionRange:r},Dn=!1,J=t;J!==null;)if(t=J,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,J=e;else for(;J!==null;){t=J;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var S=w.memoizedProps,l=w.memoizedState,a=t.stateNode,o=a.getSnapshotBeforeUpdate(t.elementType===t.type?S:_t(t.type,S),l);a.__reactInternalSnapshotBeforeUpdate=o}break;case 3:var c=t.stateNode.containerInfo;c.nodeType===1?c.textContent="":c.nodeType===9&&c.documentElement&&c.removeChild(c.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(K(163))}}catch(p){ye(t,t.return,p)}if(e=t.sibling,e!==null){e.return=t.return,J=e;break}J=t.return}return w=su,su=!1,w}function ls(e,t,r){var i=t.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var s=i=i.next;do{if((s.tag&e)===e){var h=s.destroy;s.destroy=void 0,h!==void 0&&Oa(t,r,h)}s=s.next}while(s!==i)}}function no(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 i=r.create;r.destroy=i()}r=r.next}while(r!==t)}}function Ba(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 Hd(e){var t=e.alternate;t!==null&&(e.alternate=null,Hd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Lt],delete t[Cs],delete t[Ca],delete t[k_],delete t[E_])),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 Nd(e){return e.tag===5||e.tag===3||e.tag===4}function nu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Nd(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 Ia(e,t,r){var i=e.tag;if(i===5||i===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=An));else if(i!==4&&(e=e.child,e!==null))for(Ia(e,t,r),e=e.sibling;e!==null;)Ia(e,t,r),e=e.sibling}function ja(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(i!==4&&(e=e.child,e!==null))for(ja(e,t,r),e=e.sibling;e!==null;)ja(e,t,r),e=e.sibling}var Le=null,gt=!1;function Vt(e,t,r){for(r=r.child;r!==null;)zd(e,t,r),r=r.sibling}function zd(e,t,r){if(Dt&&typeof Dt.onCommitFiberUnmount=="function")try{Dt.onCommitFiberUnmount(Xn,r)}catch{}switch(r.tag){case 5:Be||si(r,t);case 6:var i=Le,s=gt;Le=null,Vt(e,t,r),Le=i,gt=s,Le!==null&&(gt?(e=Le,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Le.removeChild(r.stateNode));break;case 18:Le!==null&&(gt?(e=Le,r=r.stateNode,e.nodeType===8?Io(e.parentNode,r):e.nodeType===1&&Io(e,r),vs(e)):Io(Le,r.stateNode));break;case 4:i=Le,s=gt,Le=r.stateNode.containerInfo,gt=!0,Vt(e,t,r),Le=i,gt=s;break;case 0:case 11:case 14:case 15:if(!Be&&(i=r.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){s=i=i.next;do{var h=s,v=h.destroy;h=h.tag,v!==void 0&&(h&2||h&4)&&Oa(r,t,v),s=s.next}while(s!==i)}Vt(e,t,r);break;case 1:if(!Be&&(si(r,t),i=r.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=r.memoizedProps,i.state=r.memoizedState,i.componentWillUnmount()}catch(n){ye(r,t,n)}Vt(e,t,r);break;case 21:Vt(e,t,r);break;case 22:r.mode&1?(Be=(i=Be)||r.memoizedState!==null,Vt(e,t,r),Be=i):Vt(e,t,r);break;default:Vt(e,t,r)}}function ou(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new U_),t.forEach(function(i){var s=Y_.bind(null,e,i);r.has(i)||(r.add(i),i.then(s,s))})}}function pt(e,t){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var s=r[i];try{var h=e,v=t,n=v;e:for(;n!==null;){switch(n.tag){case 5:Le=n.stateNode,gt=!1;break e;case 3:Le=n.stateNode.containerInfo,gt=!0;break e;case 4:Le=n.stateNode.containerInfo,gt=!0;break e}n=n.return}if(Le===null)throw Error(K(160));zd(h,v,s),Le=null,gt=!1;var u=s.alternate;u!==null&&(u.return=null),s.return=null}catch(d){ye(s,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Ud(t,e),t=t.sibling}function Ud(e,t){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(pt(t,e),xt(e),i&4){try{ls(3,e,e.return),no(3,e)}catch(S){ye(e,e.return,S)}try{ls(5,e,e.return)}catch(S){ye(e,e.return,S)}}break;case 1:pt(t,e),xt(e),i&512&&r!==null&&si(r,r.return);break;case 5:if(pt(t,e),xt(e),i&512&&r!==null&&si(r,r.return),e.flags&32){var s=e.stateNode;try{ds(s,"")}catch(S){ye(e,e.return,S)}}if(i&4&&(s=e.stateNode,s!=null)){var h=e.memoizedProps,v=r!==null?r.memoizedProps:h,n=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{n==="input"&&h.type==="radio"&&h.name!=null&&uh(s,h),aa(n,v);var d=aa(n,h);for(v=0;v<u.length;v+=2){var g=u[v],f=u[v+1];g==="style"?_h(s,f):g==="dangerouslySetInnerHTML"?fh(s,f):g==="children"?ds(s,f):cl(s,g,f,d)}switch(n){case"input":ra(s,h);break;case"textarea":hh(s,h);break;case"select":var _=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!h.multiple;var C=h.value;C!=null?oi(s,!!h.multiple,C,!1):_!==!!h.multiple&&(h.defaultValue!=null?oi(s,!!h.multiple,h.defaultValue,!0):oi(s,!!h.multiple,h.multiple?[]:"",!1))}s[Cs]=h}catch(S){ye(e,e.return,S)}}break;case 6:if(pt(t,e),xt(e),i&4){if(e.stateNode===null)throw Error(K(162));s=e.stateNode,h=e.memoizedProps;try{s.nodeValue=h}catch(S){ye(e,e.return,S)}}break;case 3:if(pt(t,e),xt(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{vs(t.containerInfo)}catch(S){ye(e,e.return,S)}break;case 4:pt(t,e),xt(e);break;case 13:pt(t,e),xt(e),s=e.child,s.flags&8192&&(h=s.memoizedState!==null,s.stateNode.isHidden=h,!h||s.alternate!==null&&s.alternate.memoizedState!==null||(Ul=Se())),i&4&&ou(e);break;case 22:if(g=r!==null&&r.memoizedState!==null,e.mode&1?(Be=(d=Be)||g,pt(t,e),Be=d):pt(t,e),xt(e),i&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!g&&e.mode&1)for(J=e,g=e.child;g!==null;){for(f=J=g;J!==null;){switch(_=J,C=_.child,_.tag){case 0:case 11:case 14:case 15:ls(4,_,_.return);break;case 1:si(_,_.return);var w=_.stateNode;if(typeof w.componentWillUnmount=="function"){i=_,r=_.return;try{t=i,w.props=t.memoizedProps,w.state=t.memoizedState,w.componentWillUnmount()}catch(S){ye(i,r,S)}}break;case 5:si(_,_.return);break;case 22:if(_.memoizedState!==null){lu(f);continue}}C!==null?(C.return=_,J=C):lu(f)}g=g.sibling}e:for(g=null,f=e;;){if(f.tag===5){if(g===null){g=f;try{s=f.stateNode,d?(h=s.style,typeof h.setProperty=="function"?h.setProperty("display","none","important"):h.display="none"):(n=f.stateNode,u=f.memoizedProps.style,v=u!=null&&u.hasOwnProperty("display")?u.display:null,n.style.display=ph("display",v))}catch(S){ye(e,e.return,S)}}}else if(f.tag===6){if(g===null)try{f.stateNode.nodeValue=d?"":f.memoizedProps}catch(S){ye(e,e.return,S)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;g===f&&(g=null),f=f.return}g===f&&(g=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:pt(t,e),xt(e),i&4&&ou(e);break;case 21:break;default:pt(t,e),xt(e)}}function xt(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(Nd(r)){var i=r;break e}r=r.return}throw Error(K(160))}switch(i.tag){case 5:var s=i.stateNode;i.flags&32&&(ds(s,""),i.flags&=-33);var h=nu(e);ja(e,h,s);break;case 3:case 4:var v=i.stateNode.containerInfo,n=nu(e);Ia(e,n,v);break;default:throw Error(K(161))}}catch(u){ye(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function $_(e,t,r){J=e,Wd(e)}function Wd(e,t,r){for(var i=(e.mode&1)!==0;J!==null;){var s=J,h=s.child;if(s.tag===22&&i){var v=s.memoizedState!==null||on;if(!v){var n=s.alternate,u=n!==null&&n.memoizedState!==null||Be;n=on;var d=Be;if(on=v,(Be=u)&&!d)for(J=s;J!==null;)v=J,u=v.child,v.tag===22&&v.memoizedState!==null?cu(s):u!==null?(u.return=v,J=u):cu(s);for(;h!==null;)J=h,Wd(h),h=h.sibling;J=s,on=n,Be=d}au(e)}else s.subtreeFlags&8772&&h!==null?(h.return=s,J=h):au(e)}}function au(e){for(;J!==null;){var t=J;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Be||no(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!Be)if(r===null)i.componentDidMount();else{var s=t.elementType===t.type?r.memoizedProps:_t(t.type,r.memoizedProps);i.componentDidUpdate(s,r.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var h=t.updateQueue;h!==null&&Kc(t,h,i);break;case 3:var v=t.updateQueue;if(v!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}Kc(t,v,r)}break;case 5:var n=t.stateNode;if(r===null&&t.flags&4){r=n;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&r.focus();break;case"img":u.src&&(r.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var d=t.alternate;if(d!==null){var g=d.memoizedState;if(g!==null){var f=g.dehydrated;f!==null&&vs(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(K(163))}Be||t.flags&512&&Ba(t)}catch(_){ye(t,t.return,_)}}if(t===e){J=null;break}if(r=t.sibling,r!==null){r.return=t.return,J=r;break}J=t.return}}function lu(e){for(;J!==null;){var t=J;if(t===e){J=null;break}var r=t.sibling;if(r!==null){r.return=t.return,J=r;break}J=t.return}}function cu(e){for(;J!==null;){var t=J;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{no(4,t)}catch(u){ye(t,r,u)}break;case 1:var i=t.stateNode;if(typeof i.componentDidMount=="function"){var s=t.return;try{i.componentDidMount()}catch(u){ye(t,s,u)}}var h=t.return;try{Ba(t)}catch(u){ye(t,h,u)}break;case 5:var v=t.return;try{Ba(t)}catch(u){ye(t,v,u)}}}catch(u){ye(t,t.return,u)}if(t===e){J=null;break}var n=t.sibling;if(n!==null){n.return=t.return,J=n;break}J=t.return}}var K_=Math.ceil,Wn=Wt.ReactCurrentDispatcher,Nl=Wt.ReactCurrentOwner,ht=Wt.ReactCurrentBatchConfig,ne=0,Ee=null,Ce=null,Te=0,Ye=0,ni=Sr(0),xe=0,Rs=null,Ur=0,oo=0,zl=0,cs=null,qe=null,Ul=0,Pi=1/0,At=null,$n=!1,Fa=null,fr=null,an=!1,ar=null,Kn=0,us=0,Ha=null,Cn=-1,wn=0;function Ne(){return ne&6?Se():Cn!==-1?Cn:Cn=Se()}function pr(e){return e.mode&1?ne&2&&Te!==0?Te&-Te:L_.transition!==null?(wn===0&&(wn=Rh()),wn):(e=ce,e!==0||(e=window.event,e=e===void 0?16:Oh(e.type)),e):1}function St(e,t,r,i){if(50<us)throw us=0,Ha=null,Error(K(185));js(e,r,i),(!(ne&2)||e!==Ee)&&(e===Ee&&(!(ne&2)&&(oo|=r),xe===4&&Xt(e,Te)),Xe(e,i),r===1&&ne===0&&!(t.mode&1)&&(Pi=Se()+500,ro&&Cr()))}function Xe(e,t){var r=e.callbackNode;Lp(e,t);var i=Ln(e,e===Ee?Te:0);if(i===0)r!==null&&mc(r),e.callbackNode=null,e.callbackPriority=0;else if(t=i&-i,e.callbackPriority!==t){if(r!=null&&mc(r),t===1)e.tag===0?R_(uu.bind(null,e)):Zh(uu.bind(null,e)),x_(function(){!(ne&6)&&Cr()}),r=null;else{switch(Lh(i)){case 1:r=pl;break;case 4:r=kh;break;case 16:r=Rn;break;case 536870912:r=Eh;break;default:r=Rn}r=Xd(r,$d.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function $d(e,t){if(Cn=-1,wn=0,ne&6)throw Error(K(327));var r=e.callbackNode;if(hi()&&e.callbackNode!==r)return null;var i=Ln(e,e===Ee?Te:0);if(i===0)return null;if(i&30||i&e.expiredLanes||t)t=Vn(e,i);else{t=i;var s=ne;ne|=2;var h=Vd();(Ee!==e||Te!==t)&&(At=null,Pi=Se()+500,jr(e,t));do try{Q_();break}catch(n){Kd(e,n)}while(!0);Rl(),Wn.current=h,ne=s,Ce!==null?t=0:(Ee=null,Te=0,t=xe)}if(t!==0){if(t===2&&(s=da(e),s!==0&&(i=s,t=Na(e,s))),t===1)throw r=Rs,jr(e,0),Xt(e,i),Xe(e,Se()),r;if(t===6)Xt(e,i);else{if(s=e.current.alternate,!(i&30)&&!V_(s)&&(t=Vn(e,i),t===2&&(h=da(e),h!==0&&(i=h,t=Na(e,h))),t===1))throw r=Rs,jr(e,0),Xt(e,i),Xe(e,Se()),r;switch(e.finishedWork=s,e.finishedLanes=i,t){case 0:case 1:throw Error(K(345));case 2:xr(e,qe,At);break;case 3:if(Xt(e,i),(i&130023424)===i&&(t=Ul+500-Se(),10<t)){if(Ln(e,0)!==0)break;if(s=e.suspendedLanes,(s&i)!==i){Ne(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Sa(xr.bind(null,e,qe,At),t);break}xr(e,qe,At);break;case 4:if(Xt(e,i),(i&4194240)===i)break;for(t=e.eventTimes,s=-1;0<i;){var v=31-yt(i);h=1<<v,v=t[v],v>s&&(s=v),i&=~h}if(i=s,i=Se()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*K_(i/1960))-i,10<i){e.timeoutHandle=Sa(xr.bind(null,e,qe,At),i);break}xr(e,qe,At);break;case 5:xr(e,qe,At);break;default:throw Error(K(329))}}}return Xe(e,Se()),e.callbackNode===r?$d.bind(null,e):null}function Na(e,t){var r=cs;return e.current.memoizedState.isDehydrated&&(jr(e,t).flags|=256),e=Vn(e,t),e!==2&&(t=qe,qe=r,t!==null&&za(t)),e}function za(e){qe===null?qe=e:qe.push.apply(qe,e)}function V_(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var i=0;i<r.length;i++){var s=r[i],h=s.getSnapshot;s=s.value;try{if(!Ct(h(),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 Xt(e,t){for(t&=~zl,t&=~oo,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-yt(t),i=1<<r;e[r]=-1,t&=~i}}function uu(e){if(ne&6)throw Error(K(327));hi();var t=Ln(e,0);if(!(t&1))return Xe(e,Se()),null;var r=Vn(e,t);if(e.tag!==0&&r===2){var i=da(e);i!==0&&(t=i,r=Na(e,i))}if(r===1)throw r=Rs,jr(e,0),Xt(e,t),Xe(e,Se()),r;if(r===6)throw Error(K(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,xr(e,qe,At),Xe(e,Se()),null}function Wl(e,t){var r=ne;ne|=1;try{return e(t)}finally{ne=r,ne===0&&(Pi=Se()+500,ro&&Cr())}}function Wr(e){ar!==null&&ar.tag===0&&!(ne&6)&&hi();var t=ne;ne|=1;var r=ht.transition,i=ce;try{if(ht.transition=null,ce=1,e)return e()}finally{ce=i,ht.transition=r,ne=t,!(ne&6)&&Cr()}}function $l(){Ye=ni.current,de(ni)}function jr(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,w_(r)),Ce!==null)for(r=Ce.return;r!==null;){var i=r;switch(bl(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&Mn();break;case 3:Di(),de(Ge),de(je),Ml();break;case 5:Al(i);break;case 4:Di();break;case 13:de(_e);break;case 19:de(_e);break;case 10:Ll(i.type._context);break;case 22:case 23:$l()}r=r.return}if(Ee=e,Ce=e=_r(e.current,null),Te=Ye=t,xe=0,Rs=null,zl=oo=Ur=0,qe=cs=null,kr!==null){for(t=0;t<kr.length;t++)if(r=kr[t],i=r.interleaved,i!==null){r.interleaved=null;var s=i.next,h=r.pending;if(h!==null){var v=h.next;h.next=s,i.next=v}r.pending=i}kr=null}return e}function Kd(e,t){do{var r=Ce;try{if(Rl(),mn.current=Un,zn){for(var i=ve.memoizedState;i!==null;){var s=i.queue;s!==null&&(s.pending=null),i=i.next}zn=!1}if(zr=0,ke=we=ve=null,as=!1,bs=0,Nl.current=null,r===null||r.return===null){xe=1,Rs=t,Ce=null;break}e:{var h=e,v=r.return,n=r,u=t;if(t=Te,n.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var d=u,g=n,f=g.tag;if(!(g.mode&1)&&(f===0||f===11||f===15)){var _=g.alternate;_?(g.updateQueue=_.updateQueue,g.memoizedState=_.memoizedState,g.lanes=_.lanes):(g.updateQueue=null,g.memoizedState=null)}var C=Xc(v);if(C!==null){C.flags&=-257,Yc(C,v,n,h,t),C.mode&1&&Jc(h,d,t),t=C,u=d;var w=t.updateQueue;if(w===null){var S=new Set;S.add(u),t.updateQueue=S}else w.add(u);break e}else{if(!(t&1)){Jc(h,d,t),Kl();break e}u=Error(K(426))}}else if(fe&&n.mode&1){var l=Xc(v);if(l!==null){!(l.flags&65536)&&(l.flags|=256),Yc(l,v,n,h,t),kl(Ti(u,n));break e}}h=u=Ti(u,n),xe!==4&&(xe=2),cs===null?cs=[h]:cs.push(h),h=v;do{switch(h.tag){case 3:h.flags|=65536,t&=-t,h.lanes|=t;var a=Ld(h,u,t);$c(h,a);break e;case 1:n=u;var o=h.type,c=h.stateNode;if(!(h.flags&128)&&(typeof o.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(fr===null||!fr.has(c)))){h.flags|=65536,t&=-t,h.lanes|=t;var p=Dd(h,n,t);$c(h,p);break e}}h=h.return}while(h!==null)}Qd(r)}catch(y){t=y,Ce===r&&r!==null&&(Ce=r=r.return);continue}break}while(!0)}function Vd(){var e=Wn.current;return Wn.current=Un,e===null?Un:e}function Kl(){(xe===0||xe===3||xe===2)&&(xe=4),Ee===null||!(Ur&268435455)&&!(oo&268435455)||Xt(Ee,Te)}function Vn(e,t){var r=ne;ne|=2;var i=Vd();(Ee!==e||Te!==t)&&(At=null,jr(e,t));do try{q_();break}catch(s){Kd(e,s)}while(!0);if(Rl(),ne=r,Wn.current=i,Ce!==null)throw Error(K(261));return Ee=null,Te=0,xe}function q_(){for(;Ce!==null;)qd(Ce)}function Q_(){for(;Ce!==null&&!yp();)qd(Ce)}function qd(e){var t=Jd(e.alternate,e,Ye);e.memoizedProps=e.pendingProps,t===null?Qd(e):Ce=t,Nl.current=null}function Qd(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=z_(r,t),r!==null){r.flags&=32767,Ce=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{xe=6,Ce=null;return}}else if(r=N_(r,t,Ye),r!==null){Ce=r;return}if(t=t.sibling,t!==null){Ce=t;return}Ce=t=e}while(t!==null);xe===0&&(xe=5)}function xr(e,t,r){var i=ce,s=ht.transition;try{ht.transition=null,ce=1,G_(e,t,r,i)}finally{ht.transition=s,ce=i}return null}function G_(e,t,r,i){do hi();while(ar!==null);if(ne&6)throw Error(K(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(K(177));e.callbackNode=null,e.callbackPriority=0;var h=r.lanes|r.childLanes;if(Dp(e,h),e===Ee&&(Ce=Ee=null,Te=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||an||(an=!0,Xd(Rn,function(){return hi(),null})),h=(r.flags&15990)!==0,r.subtreeFlags&15990||h){h=ht.transition,ht.transition=null;var v=ce;ce=1;var n=ne;ne|=4,Nl.current=null,W_(e,r),Ud(r,e),__(ma),Dn=!!ga,ma=ga=null,e.current=r,$_(r),Sp(),ne=n,ce=v,ht.transition=h}else e.current=r;if(an&&(an=!1,ar=e,Kn=s),h=e.pendingLanes,h===0&&(fr=null),xp(r.stateNode),Xe(e,Se()),t!==null)for(i=e.onRecoverableError,r=0;r<t.length;r++)s=t[r],i(s.value,{componentStack:s.stack,digest:s.digest});if($n)throw $n=!1,e=Fa,Fa=null,e;return Kn&1&&e.tag!==0&&hi(),h=e.pendingLanes,h&1?e===Ha?us++:(us=0,Ha=e):us=0,Cr(),null}function hi(){if(ar!==null){var e=Lh(Kn),t=ht.transition,r=ce;try{if(ht.transition=null,ce=16>e?16:e,ar===null)var i=!1;else{if(e=ar,ar=null,Kn=0,ne&6)throw Error(K(331));var s=ne;for(ne|=4,J=e.current;J!==null;){var h=J,v=h.child;if(J.flags&16){var n=h.deletions;if(n!==null){for(var u=0;u<n.length;u++){var d=n[u];for(J=d;J!==null;){var g=J;switch(g.tag){case 0:case 11:case 15:ls(8,g,h)}var f=g.child;if(f!==null)f.return=g,J=f;else for(;J!==null;){g=J;var _=g.sibling,C=g.return;if(Hd(g),g===d){J=null;break}if(_!==null){_.return=C,J=_;break}J=C}}}var w=h.alternate;if(w!==null){var S=w.child;if(S!==null){w.child=null;do{var l=S.sibling;S.sibling=null,S=l}while(S!==null)}}J=h}}if(h.subtreeFlags&2064&&v!==null)v.return=h,J=v;else e:for(;J!==null;){if(h=J,h.flags&2048)switch(h.tag){case 0:case 11:case 15:ls(9,h,h.return)}var a=h.sibling;if(a!==null){a.return=h.return,J=a;break e}J=h.return}}var o=e.current;for(J=o;J!==null;){v=J;var c=v.child;if(v.subtreeFlags&2064&&c!==null)c.return=v,J=c;else e:for(v=o;J!==null;){if(n=J,n.flags&2048)try{switch(n.tag){case 0:case 11:case 15:no(9,n)}}catch(y){ye(n,n.return,y)}if(n===v){J=null;break e}var p=n.sibling;if(p!==null){p.return=n.return,J=p;break e}J=n.return}}if(ne=s,Cr(),Dt&&typeof Dt.onPostCommitFiberRoot=="function")try{Dt.onPostCommitFiberRoot(Xn,e)}catch{}i=!0}return i}finally{ce=r,ht.transition=t}}return!1}function hu(e,t,r){t=Ti(r,t),t=Ld(e,t,1),e=dr(e,t,1),t=Ne(),e!==null&&(js(e,1,t),Xe(e,t))}function ye(e,t,r){if(e.tag===3)hu(e,e,r);else for(;t!==null;){if(t.tag===3){hu(t,e,r);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(fr===null||!fr.has(i))){e=Ti(r,e),e=Dd(t,e,1),t=dr(t,e,1),e=Ne(),t!==null&&(js(t,1,e),Xe(t,e));break}}t=t.return}}function J_(e,t,r){var i=e.pingCache;i!==null&&i.delete(t),t=Ne(),e.pingedLanes|=e.suspendedLanes&r,Ee===e&&(Te&r)===r&&(xe===4||xe===3&&(Te&130023424)===Te&&500>Se()-Ul?jr(e,0):zl|=r),Xe(e,t)}function Gd(e,t){t===0&&(e.mode&1?(t=Js,Js<<=1,!(Js&130023424)&&(Js=4194304)):t=1);var r=Ne();e=zt(e,t),e!==null&&(js(e,t,r),Xe(e,r))}function X_(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Gd(e,r)}function Y_(e,t){var r=0;switch(e.tag){case 13:var i=e.stateNode,s=e.memoizedState;s!==null&&(r=s.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(K(314))}i!==null&&i.delete(t),Gd(e,r)}var Jd;Jd=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ge.current)Qe=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Qe=!1,H_(e,t,r);Qe=!!(e.flags&131072)}else Qe=!1,fe&&t.flags&1048576&&ed(t,In,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;Sn(e,t),e=t.pendingProps;var s=Ei(t,je.current);ui(t,r),s=Bl(null,t,i,e,s,r);var h=Il();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,Je(i)?(h=!0,On(t)):h=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Tl(t),s.updater=so,t.stateNode=s,s._reactInternals=t,Ra(t,i,e,r),t=Ta(null,t,i,!0,h,r)):(t.tag=0,fe&&h&&xl(t),He(null,t,s,r),t=t.child),t;case 16:i=t.elementType;e:{switch(Sn(e,t),e=t.pendingProps,s=i._init,i=s(i._payload),t.type=i,s=t.tag=ev(i),e=_t(i,e),s){case 0:t=Da(null,t,i,e,r);break e;case 1:t=tu(null,t,i,e,r);break e;case 11:t=Zc(null,t,i,e,r);break e;case 14:t=eu(null,t,i,_t(i.type,e),r);break e}throw Error(K(306,i,""))}return t;case 0:return i=t.type,s=t.pendingProps,s=t.elementType===i?s:_t(i,s),Da(e,t,i,s,r);case 1:return i=t.type,s=t.pendingProps,s=t.elementType===i?s:_t(i,s),tu(e,t,i,s,r);case 3:e:{if(Md(t),e===null)throw Error(K(387));i=t.pendingProps,h=t.memoizedState,s=h.element,od(e,t),Hn(t,i,null,r);var v=t.memoizedState;if(i=v.element,h.isDehydrated)if(h={element:i,isDehydrated:!1,cache:v.cache,pendingSuspenseBoundaries:v.pendingSuspenseBoundaries,transitions:v.transitions},t.updateQueue.baseState=h,t.memoizedState=h,t.flags&256){s=Ti(Error(K(423)),t),t=ru(e,t,i,r,s);break e}else if(i!==s){s=Ti(Error(K(424)),t),t=ru(e,t,i,r,s);break e}else for(tt=hr(t.stateNode.containerInfo.firstChild),rt=t,fe=!0,mt=null,r=sd(t,null,i,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Ri(),i===s){t=Ut(e,t,r);break e}He(e,t,i,r)}t=t.child}return t;case 5:return ad(t),e===null&&ba(t),i=t.type,s=t.pendingProps,h=e!==null?e.memoizedProps:null,v=s.children,ya(i,s)?v=null:h!==null&&ya(i,h)&&(t.flags|=32),Ad(e,t),He(e,t,v,r),t.child;case 6:return e===null&&ba(t),null;case 13:return Od(e,t,r);case 4:return Pl(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Li(t,null,i,r):He(e,t,i,r),t.child;case 11:return i=t.type,s=t.pendingProps,s=t.elementType===i?s:_t(i,s),Zc(e,t,i,s,r);case 7:return He(e,t,t.pendingProps,r),t.child;case 8:return He(e,t,t.pendingProps.children,r),t.child;case 12:return He(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(i=t.type._context,s=t.pendingProps,h=t.memoizedProps,v=s.value,ue(jn,i._currentValue),i._currentValue=v,h!==null)if(Ct(h.value,v)){if(h.children===s.children&&!Ge.current){t=Ut(e,t,r);break e}}else for(h=t.child,h!==null&&(h.return=t);h!==null;){var n=h.dependencies;if(n!==null){v=h.child;for(var u=n.firstContext;u!==null;){if(u.context===i){if(h.tag===1){u=Ft(-1,r&-r),u.tag=2;var d=h.updateQueue;if(d!==null){d=d.shared;var g=d.pending;g===null?u.next=u:(u.next=g.next,g.next=u),d.pending=u}}h.lanes|=r,u=h.alternate,u!==null&&(u.lanes|=r),ka(h.return,r,t),n.lanes|=r;break}u=u.next}}else if(h.tag===10)v=h.type===t.type?null:h.child;else if(h.tag===18){if(v=h.return,v===null)throw Error(K(341));v.lanes|=r,n=v.alternate,n!==null&&(n.lanes|=r),ka(v,r,t),v=h.sibling}else v=h.child;if(v!==null)v.return=h;else for(v=h;v!==null;){if(v===t){v=null;break}if(h=v.sibling,h!==null){h.return=v.return,v=h;break}v=v.return}h=v}He(e,t,s.children,r),t=t.child}return t;case 9:return s=t.type,i=t.pendingProps.children,ui(t,r),s=dt(s),i=i(s),t.flags|=1,He(e,t,i,r),t.child;case 14:return i=t.type,s=_t(i,t.pendingProps),s=_t(i.type,s),eu(e,t,i,s,r);case 15:return Td(e,t,t.type,t.pendingProps,r);case 17:return i=t.type,s=t.pendingProps,s=t.elementType===i?s:_t(i,s),Sn(e,t),t.tag=1,Je(i)?(e=!0,On(t)):e=!1,ui(t,r),Rd(t,i,s),Ra(t,i,s,r),Ta(null,t,i,!0,e,r);case 19:return Bd(e,t,r);case 22:return Pd(e,t,r)}throw Error(K(156,t.tag))};function Xd(e,t){return bh(e,t)}function Z_(e,t,r,i){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=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ut(e,t,r,i){return new Z_(e,t,r,i)}function Vl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ev(e){if(typeof e=="function")return Vl(e)?1:0;if(e!=null){if(e=e.$$typeof,e===hl)return 11;if(e===dl)return 14}return 2}function _r(e,t){var r=e.alternate;return r===null?(r=ut(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 xn(e,t,r,i,s,h){var v=2;if(i=e,typeof e=="function")Vl(e)&&(v=1);else if(typeof e=="string")v=5;else e:switch(e){case Gr:return Fr(r.children,s,h,t);case ul:v=8,s|=8;break;case Xo:return e=ut(12,r,t,s|2),e.elementType=Xo,e.lanes=h,e;case Yo:return e=ut(13,r,t,s),e.elementType=Yo,e.lanes=h,e;case Zo:return e=ut(19,r,t,s),e.elementType=Zo,e.lanes=h,e;case ah:return ao(r,s,h,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case nh:v=10;break e;case oh:v=9;break e;case hl:v=11;break e;case dl:v=14;break e;case Qt:v=16,i=null;break e}throw Error(K(130,e==null?e:typeof e,""))}return t=ut(v,r,t,s),t.elementType=e,t.type=i,t.lanes=h,t}function Fr(e,t,r,i){return e=ut(7,e,i,t),e.lanes=r,e}function ao(e,t,r,i){return e=ut(22,e,i,t),e.elementType=ah,e.lanes=r,e.stateNode={isHidden:!1},e}function $o(e,t,r){return e=ut(6,e,null,t),e.lanes=r,e}function Ko(e,t,r){return t=ut(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function tv(e,t,r,i,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=ko(0),this.expirationTimes=ko(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ko(0),this.identifierPrefix=i,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function ql(e,t,r,i,s,h,v,n,u){return e=new tv(e,t,r,n,u),t===1?(t=1,h===!0&&(t|=8)):t=0,h=ut(3,null,null,t),e.current=h,h.stateNode=e,h.memoizedState={element:i,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Tl(h),e}function rv(e,t,r){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Qr,key:i==null?null:""+i,children:e,containerInfo:t,implementation:r}}function Yd(e){if(!e)return mr;e=e._reactInternals;e:{if(Kr(e)!==e||e.tag!==1)throw Error(K(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Je(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(K(171))}if(e.tag===1){var r=e.type;if(Je(r))return Yh(e,r,t)}return t}function Zd(e,t,r,i,s,h,v,n,u){return e=ql(r,i,!0,e,s,h,v,n,u),e.context=Yd(null),r=e.current,i=Ne(),s=pr(r),h=Ft(i,s),h.callback=t??null,dr(r,h,s),e.current.lanes=s,js(e,s,i),Xe(e,i),e}function lo(e,t,r,i){var s=t.current,h=Ne(),v=pr(s);return r=Yd(r),t.context===null?t.context=r:t.pendingContext=r,t=Ft(h,v),t.payload={element:e},i=i===void 0?null:i,i!==null&&(t.callback=i),e=dr(s,t,v),e!==null&&(St(e,s,v,h),gn(e,s,v)),v}function qn(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 du(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function Ql(e,t){du(e,t),(e=e.alternate)&&du(e,t)}function iv(){return null}var ef=typeof reportError=="function"?reportError:function(e){console.error(e)};function Gl(e){this._internalRoot=e}co.prototype.render=Gl.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(K(409));lo(e,t,null,null)};co.prototype.unmount=Gl.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Wr(function(){lo(null,e,null,null)}),t[Nt]=null}};function co(e){this._internalRoot=e}co.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ph();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Jt.length&&t!==0&&t<Jt[r].priority;r++);Jt.splice(r,0,e),r===0&&Mh(e)}};function Jl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function uo(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function fu(){}function sv(e,t,r,i,s){if(s){if(typeof i=="function"){var h=i;i=function(){var d=qn(v);h.call(d)}}var v=Zd(t,i,e,0,null,!1,!1,"",fu);return e._reactRootContainer=v,e[Nt]=v.current,ys(e.nodeType===8?e.parentNode:e),Wr(),v}for(;s=e.lastChild;)e.removeChild(s);if(typeof i=="function"){var n=i;i=function(){var d=qn(u);n.call(d)}}var u=ql(e,0,!1,null,null,!1,!1,"",fu);return e._reactRootContainer=u,e[Nt]=u.current,ys(e.nodeType===8?e.parentNode:e),Wr(function(){lo(t,u,r,i)}),u}function ho(e,t,r,i,s){var h=r._reactRootContainer;if(h){var v=h;if(typeof s=="function"){var n=s;s=function(){var u=qn(v);n.call(u)}}lo(t,v,e,s)}else v=sv(r,t,e,s,i);return qn(v)}Dh=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Zi(t.pendingLanes);r!==0&&(_l(t,r|1),Xe(t,Se()),!(ne&6)&&(Pi=Se()+500,Cr()))}break;case 13:Wr(function(){var i=zt(e,1);if(i!==null){var s=Ne();St(i,e,1,s)}}),Ql(e,1)}};vl=function(e){if(e.tag===13){var t=zt(e,134217728);if(t!==null){var r=Ne();St(t,e,134217728,r)}Ql(e,134217728)}};Th=function(e){if(e.tag===13){var t=pr(e),r=zt(e,t);if(r!==null){var i=Ne();St(r,e,t,i)}Ql(e,t)}};Ph=function(){return ce};Ah=function(e,t){var r=ce;try{return ce=e,t()}finally{ce=r}};ca=function(e,t,r){switch(t){case"input":if(ra(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 i=r[t];if(i!==e&&i.form===e.form){var s=to(i);if(!s)throw Error(K(90));ch(i),ra(i,s)}}}break;case"textarea":hh(e,r);break;case"select":t=r.value,t!=null&&oi(e,!!r.multiple,t,!1)}};mh=Wl;yh=Wr;var nv={usingClientEntryPoint:!1,Events:[Hs,Zr,to,vh,gh,Wl]},Gi={findFiberByHostInstance:br,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ov={bundleType:Gi.bundleType,version:Gi.version,rendererPackageName:Gi.rendererPackageName,rendererConfig:Gi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Wt.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=wh(e),e===null?null:e.stateNode},findFiberByHostInstance:Gi.findFiberByHostInstance||iv,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 ln=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ln.isDisabled&&ln.supportsFiber)try{Xn=ln.inject(ov),Dt=ln}catch{}}st.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=nv;st.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Jl(t))throw Error(K(200));return rv(e,t,null,r)};st.createRoot=function(e,t){if(!Jl(e))throw Error(K(299));var r=!1,i="",s=ef;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=ql(e,1,!1,null,null,r,!1,i,s),e[Nt]=t.current,ys(e.nodeType===8?e.parentNode:e),new Gl(t)};st.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(K(188)):(e=Object.keys(e).join(","),Error(K(268,e)));return e=wh(t),e=e===null?null:e.stateNode,e};st.flushSync=function(e){return Wr(e)};st.hydrate=function(e,t,r){if(!uo(t))throw Error(K(200));return ho(null,e,t,!0,r)};st.hydrateRoot=function(e,t,r){if(!Jl(e))throw Error(K(405));var i=r!=null&&r.hydratedSources||null,s=!1,h="",v=ef;if(r!=null&&(r.unstable_strictMode===!0&&(s=!0),r.identifierPrefix!==void 0&&(h=r.identifierPrefix),r.onRecoverableError!==void 0&&(v=r.onRecoverableError)),t=Zd(t,null,e,1,r??null,s,!1,h,v),e[Nt]=t.current,ys(e),i)for(e=0;e<i.length;e++)r=i[e],s=r._getVersion,s=s(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,s]:t.mutableSourceEagerHydrationData.push(r,s);return new co(t)};st.render=function(e,t,r){if(!uo(t))throw Error(K(200));return ho(null,e,t,!1,r)};st.unmountComponentAtNode=function(e){if(!uo(e))throw Error(K(40));return e._reactRootContainer?(Wr(function(){ho(null,null,e,!1,function(){e._reactRootContainer=null,e[Nt]=null})}),!0):!1};st.unstable_batchedUpdates=Wl;st.unstable_renderSubtreeIntoContainer=function(e,t,r,i){if(!uo(r))throw Error(K(200));if(e==null||e._reactInternals===void 0)throw Error(K(38));return ho(e,t,r,!1,i)};st.version="18.3.1-next-f1338f8080-20240426";function tf(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(tf)}catch(e){console.error(e)}}tf(),th.exports=st;var av=th.exports,pu=av;Go.createRoot=pu.createRoot,Go.hydrateRoot=pu.hydrateRoot;var zs=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(){}},Lr,Yt,di,Mu,lv=(Mu=class extends zs{constructor(){super();Z(this,Lr);Z(this,Yt);Z(this,di);Q(this,di,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){I(this,Yt)||this.setEventListener(I(this,di))}onUnsubscribe(){var t;this.hasListeners()||((t=I(this,Yt))==null||t.call(this),Q(this,Yt,void 0))}setEventListener(t){var r;Q(this,di,t),(r=I(this,Yt))==null||r.call(this),Q(this,Yt,t(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()}))}setFocused(t){I(this,Lr)!==t&&(Q(this,Lr,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof I(this,Lr)=="boolean"?I(this,Lr):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Lr=new WeakMap,Yt=new WeakMap,di=new WeakMap,Mu),Xl=new lv,cv={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Zt,rl,Ou,uv=(Ou=class{constructor(){Z(this,Zt,cv);Z(this,rl,!1)}setTimeoutProvider(e){Q(this,Zt,e)}setTimeout(e,t){return I(this,Zt).setTimeout(e,t)}clearTimeout(e){I(this,Zt).clearTimeout(e)}setInterval(e,t){return I(this,Zt).setInterval(e,t)}clearInterval(e){I(this,Zt).clearInterval(e)}},Zt=new WeakMap,rl=new WeakMap,Ou),Rr=new uv;function hv(e){setTimeout(e,0)}var dv=typeof window>"u"||"Deno"in globalThis;function Ve(){}function fv(e,t){return typeof e=="function"?e(t):e}function Ua(e){return typeof e=="number"&&e>=0&&e!==1/0}function rf(e,t){return Math.max(e+(t||0)-Date.now(),0)}function vr(e,t){return typeof e=="function"?e(t):e}function et(e,t){return typeof e=="function"?e(t):e}function _u(e,t){const{type:r="all",exact:i,fetchStatus:s,predicate:h,queryKey:v,stale:n}=e;if(v){if(i){if(t.queryHash!==Yl(v,t.options))return!1}else if(!Ds(t.queryKey,v))return!1}if(r!=="all"){const u=t.isActive();if(r==="active"&&!u||r==="inactive"&&u)return!1}return!(typeof n=="boolean"&&t.isStale()!==n||s&&s!==t.state.fetchStatus||h&&!h(t))}function vu(e,t){const{exact:r,status:i,predicate:s,mutationKey:h}=e;if(h){if(!t.options.mutationKey)return!1;if(r){if(Ls(t.options.mutationKey)!==Ls(h))return!1}else if(!Ds(t.options.mutationKey,h))return!1}return!(i&&t.state.status!==i||s&&!s(t))}function Yl(e,t){return((t==null?void 0:t.queryKeyHashFn)||Ls)(e)}function Ls(e){return JSON.stringify(e,(t,r)=>$a(r)?Object.keys(r).sort().reduce((i,s)=>(i[s]=r[s],i),{}):r)}function Ds(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Ds(e[r],t[r])):!1}var pv=Object.prototype.hasOwnProperty;function sf(e,t,r=0){if(e===t)return e;if(r>500)return t;const i=gu(e)&&gu(t);if(!i&&!($a(e)&&$a(t)))return t;const h=(i?e:Object.keys(e)).length,v=i?t:Object.keys(t),n=v.length,u=i?new Array(n):{};let d=0;for(let g=0;g<n;g++){const f=i?g:v[g],_=e[f],C=t[f];if(_===C){u[f]=_,(i?g<h:pv.call(e,f))&&d++;continue}if(_===null||C===null||typeof _!="object"||typeof C!="object"){u[f]=C;continue}const w=sf(_,C,r+1);u[f]=w,w===_&&d++}return h===n&&d===h?e:u}function Wa(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 gu(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function $a(e){if(!mu(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!mu(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function mu(e){return Object.prototype.toString.call(e)==="[object Object]"}function _v(e){return new Promise(t=>{Rr.setTimeout(t,e)})}function Ka(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?sf(e,t):t}function vv(e,t,r=0){const i=[...e,t];return r&&i.length>r?i.slice(1):i}function gv(e,t,r=0){const i=[t,...e];return r&&i.length>r?i.slice(0,-1):i}var Zl=Symbol();function nf(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Zl?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function of(e,t){return typeof e=="function"?e(...t):!!e}function mv(e,t,r){let i=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=t()),i||(i=!0,s.aborted?r():s.addEventListener("abort",r,{once:!0})),s)}),e}var Ts=(()=>{let e=()=>dv;return{isServer(){return e()},setIsServer(t){e=t}}})();function Va(){let e,t;const r=new Promise((s,h)=>{e=s,t=h});r.status="pending",r.catch(()=>{});function i(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{i({status:"fulfilled",value:s}),e(s)},r.reject=s=>{i({status:"rejected",reason:s}),t(s)},r}var yv=hv;function Sv(){let e=[],t=0,r=n=>{n()},i=n=>{n()},s=yv;const h=n=>{t?e.push(n):s(()=>{r(n)})},v=()=>{const n=e;e=[],n.length&&s(()=>{i(()=>{n.forEach(u=>{r(u)})})})};return{batch:n=>{let u;t++;try{u=n()}finally{t--,t||v()}return u},batchCalls:n=>(...u)=>{h(()=>{n(...u)})},schedule:h,setNotifyFunction:n=>{r=n},setBatchNotifyFunction:n=>{i=n},setScheduler:n=>{s=n}}}var De=Sv(),fi,er,pi,Bu,Cv=(Bu=class extends zs{constructor(){super();Z(this,fi,!0);Z(this,er);Z(this,pi);Q(this,pi,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t(!0),i=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",i)}}})}onSubscribe(){I(this,er)||this.setEventListener(I(this,pi))}onUnsubscribe(){var t;this.hasListeners()||((t=I(this,er))==null||t.call(this),Q(this,er,void 0))}setEventListener(t){var r;Q(this,pi,t),(r=I(this,er))==null||r.call(this),Q(this,er,t(this.setOnline.bind(this)))}setOnline(t){I(this,fi)!==t&&(Q(this,fi,t),this.listeners.forEach(i=>{i(t)}))}isOnline(){return I(this,fi)}},fi=new WeakMap,er=new WeakMap,pi=new WeakMap,Bu),Qn=new Cv;function wv(e){return Math.min(1e3*2**e,3e4)}function af(e){return(e??"online")==="online"?Qn.isOnline():!0}var qa=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function lf(e){let t=!1,r=0,i;const s=Va(),h=()=>s.status!=="pending",v=S=>{var l;if(!h()){const a=new qa(S);_(a),(l=e.onCancel)==null||l.call(e,a)}},n=()=>{t=!0},u=()=>{t=!1},d=()=>Xl.isFocused()&&(e.networkMode==="always"||Qn.isOnline())&&e.canRun(),g=()=>af(e.networkMode)&&e.canRun(),f=S=>{h()||(i==null||i(),s.resolve(S))},_=S=>{h()||(i==null||i(),s.reject(S))},C=()=>new Promise(S=>{var l;i=a=>{(h()||d())&&S(a)},(l=e.onPause)==null||l.call(e)}).then(()=>{var S;i=void 0,h()||(S=e.onContinue)==null||S.call(e)}),w=()=>{if(h())return;let S;const l=r===0?e.initialPromise:void 0;try{S=l??e.fn()}catch(a){S=Promise.reject(a)}Promise.resolve(S).then(f).catch(a=>{var x;if(h())return;const o=e.retry??(Ts.isServer()?0:3),c=e.retryDelay??wv,p=typeof c=="function"?c(r,a):c,y=o===!0||typeof o=="number"&&r<o||typeof o=="function"&&o(r,a);if(t||!y){_(a);return}r++,(x=e.onFail)==null||x.call(e,r,a),_v(p).then(()=>d()?void 0:C()).then(()=>{t?_(a):w()})})};return{promise:s,status:()=>s.status,cancel:v,continue:()=>(i==null||i(),s),cancelRetry:n,continueRetry:u,canStart:g,start:()=>(g()?w():C().then(w),s)}}var Dr,Iu,cf=(Iu=class{constructor(){Z(this,Dr)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ua(this.gcTime)&&Q(this,Dr,Rr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ts.isServer()?1/0:5*60*1e3))}clearGcTimeout(){I(this,Dr)!==void 0&&(Rr.clearTimeout(I(this,Dr)),Q(this,Dr,void 0))}},Dr=new WeakMap,Iu);function xv(e){return{onFetch:(t,r)=>{var g,f,_,C,w;const i=t.options,s=(_=(f=(g=t.fetchOptions)==null?void 0:g.meta)==null?void 0:f.fetchMore)==null?void 0:_.direction,h=((C=t.state.data)==null?void 0:C.pages)||[],v=((w=t.state.data)==null?void 0:w.pageParams)||[];let n={pages:[],pageParams:[]},u=0;const d=async()=>{let S=!1;const l=c=>{mv(c,()=>t.signal,()=>S=!0)},a=nf(t.options,t.fetchOptions),o=async(c,p,y)=>{if(S)return Promise.reject(t.signal.reason);if(p==null&&c.pages.length)return Promise.resolve(c);const k=(()=>{const M={client:t.client,queryKey:t.queryKey,pageParam:p,direction:y?"backward":"forward",meta:t.options.meta};return l(M),M})(),m=await a(k),{maxPages:b}=t.options,D=y?gv:vv;return{pages:D(c.pages,m,b),pageParams:D(c.pageParams,p,b)}};if(s&&h.length){const c=s==="backward",p=c?bv:yu,y={pages:h,pageParams:v},x=p(i,y);n=await o(y,x,c)}else{const c=e??h.length;do{const p=u===0?v[0]??i.initialPageParam:yu(i,n);if(u>0&&p==null)break;n=await o(n,p),u++}while(u<c)}return n};t.options.persister?t.fetchFn=()=>{var S,l;return(l=(S=t.options).persister)==null?void 0:l.call(S,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=d}}}function yu(e,{pages:t,pageParams:r}){const i=t.length-1;return t.length>0?e.getNextPageParam(t[i],t,r[i],r):void 0}function bv(e,{pages:t,pageParams:r}){var i;return t.length>0?(i=e.getPreviousPageParam)==null?void 0:i.call(e,t[0],t,r[0],r):void 0}var _i,Tr,vi,at,Pr,be,Ps,Ar,Ze,uf,Pt,ju,kv=(ju=class extends cf{constructor(t){super();Z(this,Ze);Z(this,_i);Z(this,Tr);Z(this,vi);Z(this,at);Z(this,Pr);Z(this,be);Z(this,Ps);Z(this,Ar);Q(this,Ar,!1),Q(this,Ps,t.defaultOptions),this.setOptions(t.options),this.observers=[],Q(this,Pr,t.client),Q(this,at,I(this,Pr).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Q(this,Tr,Cu(this.options)),this.state=t.state??I(this,Tr),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return I(this,_i)}get promise(){var t;return(t=I(this,be))==null?void 0:t.promise}setOptions(t){if(this.options={...I(this,Ps),...t},t!=null&&t._type&&Q(this,_i,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=Cu(this.options);r.data!==void 0&&(this.setState(Su(r.data,r.dataUpdatedAt)),Q(this,Tr,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&I(this,at).remove(this)}setData(t,r){const i=Ka(this.state.data,t,this.options);return ie(this,Ze,Pt).call(this,{data:i,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),i}setState(t){ie(this,Ze,Pt).call(this,{type:"setState",state:t})}cancel(t){var i,s;const r=(i=I(this,be))==null?void 0:i.promise;return(s=I(this,be))==null||s.cancel(t),r?r.then(Ve).catch(Ve):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return I(this,Tr)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>et(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Zl||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>vr(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:!rf(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(i=>i.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=I(this,be))==null||r.continue()}onOnline(){var r;const t=this.observers.find(i=>i.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=I(this,be))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),I(this,at).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(I(this,be)&&(I(this,Ar)||ie(this,Ze,uf).call(this)?I(this,be).cancel({revert:!0}):I(this,be).cancelRetry()),this.scheduleGc()),I(this,at).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ie(this,Ze,Pt).call(this,{type:"invalidate"})}async fetch(t,r){var d,g,f,_,C,w,S,l,a,o,c;if(this.state.fetchStatus!=="idle"&&((d=I(this,be))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(I(this,be))return I(this,be).continueRetry(),I(this,be).promise}if(t&&this.setOptions(t),!this.options.queryFn){const p=this.observers.find(y=>y.options.queryFn);p&&this.setOptions(p.options)}const i=new AbortController,s=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(Q(this,Ar,!0),i.signal)})},h=()=>{const p=nf(this.options,r),x=(()=>{const k={client:I(this,Pr),queryKey:this.queryKey,meta:this.meta};return s(k),k})();return Q(this,Ar,!1),this.options.persister?this.options.persister(p,x,this):p(x)},n=(()=>{const p={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:I(this,Pr),state:this.state,fetchFn:h};return s(p),p})(),u=I(this,_i)==="infinite"?xv(this.options.pages):this.options.behavior;u==null||u.onFetch(n,this),Q(this,vi,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((g=n.fetchOptions)==null?void 0:g.meta))&&ie(this,Ze,Pt).call(this,{type:"fetch",meta:(f=n.fetchOptions)==null?void 0:f.meta}),Q(this,be,lf({initialPromise:r==null?void 0:r.initialPromise,fn:n.fetchFn,onCancel:p=>{p instanceof qa&&p.revert&&this.setState({...I(this,vi),fetchStatus:"idle"}),i.abort()},onFail:(p,y)=>{ie(this,Ze,Pt).call(this,{type:"failed",failureCount:p,error:y})},onPause:()=>{ie(this,Ze,Pt).call(this,{type:"pause"})},onContinue:()=>{ie(this,Ze,Pt).call(this,{type:"continue"})},retry:n.options.retry,retryDelay:n.options.retryDelay,networkMode:n.options.networkMode,canRun:()=>!0}));try{const p=await I(this,be).start();if(p===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(p),(C=(_=I(this,at).config).onSuccess)==null||C.call(_,p,this),(S=(w=I(this,at).config).onSettled)==null||S.call(w,p,this.state.error,this),p}catch(p){if(p instanceof qa){if(p.silent)return I(this,be).promise;if(p.revert){if(this.state.data===void 0)throw p;return this.state.data}}throw ie(this,Ze,Pt).call(this,{type:"error",error:p}),(a=(l=I(this,at).config).onError)==null||a.call(l,p,this),(c=(o=I(this,at).config).onSettled)==null||c.call(o,this.state.data,p,this),p}finally{this.scheduleGc()}}},_i=new WeakMap,Tr=new WeakMap,vi=new WeakMap,at=new WeakMap,Pr=new WeakMap,be=new WeakMap,Ps=new WeakMap,Ar=new WeakMap,Ze=new WeakSet,uf=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Pt=function(t){const r=i=>{switch(t.type){case"failed":return{...i,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...hf(i.data,this.options),fetchMeta:t.meta??null};case"success":const s={...i,...Su(t.data,t.dataUpdatedAt),dataUpdateCount:i.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Q(this,vi,t.manual?s:void 0),s;case"error":const h=t.error;return{...i,error:h,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:h,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...t.state}}};this.state=r(this.state),De.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),I(this,at).notify({query:this,type:"updated",action:t})})},ju);function hf(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:af(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Su(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Cu(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,i=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Ke,se,As,Fe,Mr,gi,Ot,tr,Ms,mi,yi,Or,Br,rr,Si,ae,ts,Qa,Ga,Ja,Xa,Ya,Za,el,df,Fu,Ev=(Fu=class extends zs{constructor(t,r){super();Z(this,ae);Z(this,Ke);Z(this,se);Z(this,As);Z(this,Fe);Z(this,Mr);Z(this,gi);Z(this,Ot);Z(this,tr);Z(this,Ms);Z(this,mi);Z(this,yi);Z(this,Or);Z(this,Br);Z(this,rr);Z(this,Si,new Set);this.options=r,Q(this,Ke,t),Q(this,tr,null),Q(this,Ot,Va()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(I(this,se).addObserver(this),wu(I(this,se),this.options)?ie(this,ae,ts).call(this):this.updateResult(),ie(this,ae,Xa).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return tl(I(this,se),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return tl(I(this,se),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ie(this,ae,Ya).call(this),ie(this,ae,Za).call(this),I(this,se).removeObserver(this)}setOptions(t){const r=this.options,i=I(this,se);if(this.options=I(this,Ke).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof et(this.options.enabled,I(this,se))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ie(this,ae,el).call(this),I(this,se).setOptions(this.options),r._defaulted&&!Wa(this.options,r)&&I(this,Ke).getQueryCache().notify({type:"observerOptionsUpdated",query:I(this,se),observer:this});const s=this.hasListeners();s&&xu(I(this,se),i,this.options,r)&&ie(this,ae,ts).call(this),this.updateResult(),s&&(I(this,se)!==i||et(this.options.enabled,I(this,se))!==et(r.enabled,I(this,se))||vr(this.options.staleTime,I(this,se))!==vr(r.staleTime,I(this,se)))&&ie(this,ae,Qa).call(this);const h=ie(this,ae,Ga).call(this);s&&(I(this,se)!==i||et(this.options.enabled,I(this,se))!==et(r.enabled,I(this,se))||h!==I(this,rr))&&ie(this,ae,Ja).call(this,h)}getOptimisticResult(t){const r=I(this,Ke).getQueryCache().build(I(this,Ke),t),i=this.createResult(r,t);return Lv(this,i)&&(Q(this,Fe,i),Q(this,gi,this.options),Q(this,Mr,I(this,se).state)),i}getCurrentResult(){return I(this,Fe)}trackResult(t,r){return new Proxy(t,{get:(i,s)=>(this.trackProp(s),r==null||r(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&I(this,Ot).status==="pending"&&I(this,Ot).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(i,s))})}trackProp(t){I(this,Si).add(t)}getCurrentQuery(){return I(this,se)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=I(this,Ke).defaultQueryOptions(t),i=I(this,Ke).getQueryCache().build(I(this,Ke),r);return i.fetch().then(()=>this.createResult(i,r))}fetch(t){return ie(this,ae,ts).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),I(this,Fe)))}createResult(t,r){var b;const i=I(this,se),s=this.options,h=I(this,Fe),v=I(this,Mr),n=I(this,gi),d=t!==i?t.state:I(this,As),{state:g}=t;let f={...g},_=!1,C;if(r._optimisticResults){const D=this.hasListeners(),M=!D&&wu(t,r),A=D&&xu(t,i,r,s);(M||A)&&(f={...f,...hf(g.data,t.options)}),r._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:w,errorUpdatedAt:S,status:l}=f;C=f.data;let a=!1;if(r.placeholderData!==void 0&&C===void 0&&l==="pending"){let D;h!=null&&h.isPlaceholderData&&r.placeholderData===(n==null?void 0:n.placeholderData)?(D=h.data,a=!0):D=typeof r.placeholderData=="function"?r.placeholderData((b=I(this,yi))==null?void 0:b.state.data,I(this,yi)):r.placeholderData,D!==void 0&&(l="success",C=Ka(h==null?void 0:h.data,D,r),_=!0)}if(r.select&&C!==void 0&&!a)if(h&&C===(v==null?void 0:v.data)&&r.select===I(this,Ms))C=I(this,mi);else try{Q(this,Ms,r.select),C=r.select(C),C=Ka(h==null?void 0:h.data,C,r),Q(this,mi,C),Q(this,tr,null)}catch(D){Q(this,tr,D)}I(this,tr)&&(w=I(this,tr),C=I(this,mi),S=Date.now(),l="error");const o=f.fetchStatus==="fetching",c=l==="pending",p=l==="error",y=c&&o,x=C!==void 0,m={status:l,fetchStatus:f.fetchStatus,isPending:c,isSuccess:l==="success",isError:p,isInitialLoading:y,isLoading:y,data:C,dataUpdatedAt:f.dataUpdatedAt,error:w,errorUpdatedAt:S,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:f.dataUpdateCount>d.dataUpdateCount||f.errorUpdateCount>d.errorUpdateCount,isFetching:o,isRefetching:o&&!c,isLoadingError:p&&!x,isPaused:f.fetchStatus==="paused",isPlaceholderData:_,isRefetchError:p&&x,isStale:ec(t,r),refetch:this.refetch,promise:I(this,Ot),isEnabled:et(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const D=m.data!==void 0,M=m.status==="error"&&!D,A=H=>{M?H.reject(m.error):D&&H.resolve(m.data)},O=()=>{const H=Q(this,Ot,m.promise=Va());A(H)},F=I(this,Ot);switch(F.status){case"pending":t.queryHash===i.queryHash&&A(F);break;case"fulfilled":(M||m.data!==F.value)&&O();break;case"rejected":(!M||m.error!==F.reason)&&O();break}}return m}updateResult(){const t=I(this,Fe),r=this.createResult(I(this,se),this.options);if(Q(this,Mr,I(this,se).state),Q(this,gi,this.options),I(this,Mr).data!==void 0&&Q(this,yi,I(this,se)),Wa(r,t))return;Q(this,Fe,r);const i=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,h=typeof s=="function"?s():s;if(h==="all"||!h&&!I(this,Si).size)return!0;const v=new Set(h??I(this,Si));return this.options.throwOnError&&v.add("error"),Object.keys(I(this,Fe)).some(n=>{const u=n;return I(this,Fe)[u]!==t[u]&&v.has(u)})};ie(this,ae,df).call(this,{listeners:i()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ie(this,ae,Xa).call(this)}},Ke=new WeakMap,se=new WeakMap,As=new WeakMap,Fe=new WeakMap,Mr=new WeakMap,gi=new WeakMap,Ot=new WeakMap,tr=new WeakMap,Ms=new WeakMap,mi=new WeakMap,yi=new WeakMap,Or=new WeakMap,Br=new WeakMap,rr=new WeakMap,Si=new WeakMap,ae=new WeakSet,ts=function(t){ie(this,ae,el).call(this);let r=I(this,se).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Ve)),r},Qa=function(){ie(this,ae,Ya).call(this);const t=vr(this.options.staleTime,I(this,se));if(Ts.isServer()||I(this,Fe).isStale||!Ua(t))return;const i=rf(I(this,Fe).dataUpdatedAt,t)+1;Q(this,Or,Rr.setTimeout(()=>{I(this,Fe).isStale||this.updateResult()},i))},Ga=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(I(this,se)):this.options.refetchInterval)??!1},Ja=function(t){ie(this,ae,Za).call(this),Q(this,rr,t),!(Ts.isServer()||et(this.options.enabled,I(this,se))===!1||!Ua(I(this,rr))||I(this,rr)===0)&&Q(this,Br,Rr.setInterval(()=>{(this.options.refetchIntervalInBackground||Xl.isFocused())&&ie(this,ae,ts).call(this)},I(this,rr)))},Xa=function(){ie(this,ae,Qa).call(this),ie(this,ae,Ja).call(this,ie(this,ae,Ga).call(this))},Ya=function(){I(this,Or)!==void 0&&(Rr.clearTimeout(I(this,Or)),Q(this,Or,void 0))},Za=function(){I(this,Br)!==void 0&&(Rr.clearInterval(I(this,Br)),Q(this,Br,void 0))},el=function(){const t=I(this,Ke).getQueryCache().build(I(this,Ke),this.options);if(t===I(this,se))return;const r=I(this,se);Q(this,se,t),Q(this,As,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},df=function(t){De.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(I(this,Fe))}),I(this,Ke).getQueryCache().notify({query:I(this,se),type:"observerResultsUpdated"})})},Fu);function Rv(e,t){return et(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&et(t.retryOnMount,e)===!1)}function wu(e,t){return Rv(e,t)||e.state.data!==void 0&&tl(e,t,t.refetchOnMount)}function tl(e,t,r){if(et(t.enabled,e)!==!1&&vr(t.staleTime,e)!=="static"){const i=typeof r=="function"?r(e):r;return i==="always"||i!==!1&&ec(e,t)}return!1}function xu(e,t,r,i){return(e!==t||et(i.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&ec(e,r)}function ec(e,t){return et(t.enabled,e)!==!1&&e.isStaleByTime(vr(t.staleTime,e))}function Lv(e,t){return!Wa(e.getCurrentResult(),t)}var Os,kt,Oe,Ir,Et,qt,Hu,Dv=(Hu=class extends cf{constructor(t){super();Z(this,Et);Z(this,Os);Z(this,kt);Z(this,Oe);Z(this,Ir);Q(this,Os,t.client),this.mutationId=t.mutationId,Q(this,Oe,t.mutationCache),Q(this,kt,[]),this.state=t.state||Tv(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){I(this,kt).includes(t)||(I(this,kt).push(t),this.clearGcTimeout(),I(this,Oe).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Q(this,kt,I(this,kt).filter(r=>r!==t)),this.scheduleGc(),I(this,Oe).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){I(this,kt).length||(this.state.status==="pending"?this.scheduleGc():I(this,Oe).remove(this))}continue(){var t;return((t=I(this,Ir))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var v,n,u,d,g,f,_,C,w,S,l,a,o,c,p,y,x,k;const r=()=>{ie(this,Et,qt).call(this,{type:"continue"})},i={client:I(this,Os),meta:this.options.meta,mutationKey:this.options.mutationKey};Q(this,Ir,lf({fn:()=>this.options.mutationFn?this.options.mutationFn(t,i):Promise.reject(new Error("No mutationFn found")),onFail:(m,b)=>{ie(this,Et,qt).call(this,{type:"failed",failureCount:m,error:b})},onPause:()=>{ie(this,Et,qt).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>I(this,Oe).canRun(this)}));const s=this.state.status==="pending",h=!I(this,Ir).canStart();try{if(s)r();else{ie(this,Et,qt).call(this,{type:"pending",variables:t,isPaused:h}),I(this,Oe).config.onMutate&&await I(this,Oe).config.onMutate(t,this,i);const b=await((n=(v=this.options).onMutate)==null?void 0:n.call(v,t,i));b!==this.state.context&&ie(this,Et,qt).call(this,{type:"pending",context:b,variables:t,isPaused:h})}const m=await I(this,Ir).start();return await((d=(u=I(this,Oe).config).onSuccess)==null?void 0:d.call(u,m,t,this.state.context,this,i)),await((f=(g=this.options).onSuccess)==null?void 0:f.call(g,m,t,this.state.context,i)),await((C=(_=I(this,Oe).config).onSettled)==null?void 0:C.call(_,m,null,this.state.variables,this.state.context,this,i)),await((S=(w=this.options).onSettled)==null?void 0:S.call(w,m,null,t,this.state.context,i)),ie(this,Et,qt).call(this,{type:"success",data:m}),m}catch(m){try{await((a=(l=I(this,Oe).config).onError)==null?void 0:a.call(l,m,t,this.state.context,this,i))}catch(b){Promise.reject(b)}try{await((c=(o=this.options).onError)==null?void 0:c.call(o,m,t,this.state.context,i))}catch(b){Promise.reject(b)}try{await((y=(p=I(this,Oe).config).onSettled)==null?void 0:y.call(p,void 0,m,this.state.variables,this.state.context,this,i))}catch(b){Promise.reject(b)}try{await((k=(x=this.options).onSettled)==null?void 0:k.call(x,void 0,m,t,this.state.context,i))}catch(b){Promise.reject(b)}throw ie(this,Et,qt).call(this,{type:"error",error:m}),m}finally{I(this,Oe).runNext(this)}}},Os=new WeakMap,kt=new WeakMap,Oe=new WeakMap,Ir=new WeakMap,Et=new WeakSet,qt=function(t){const r=i=>{switch(t.type){case"failed":return{...i,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,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{...i,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:t.error,failureCount:i.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),De.batch(()=>{I(this,kt).forEach(i=>{i.onMutationUpdate(t)}),I(this,Oe).notify({mutation:this,type:"updated",action:t})})},Hu);function Tv(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Bt,vt,Bs,Nu,Pv=(Nu=class extends zs{constructor(t={}){super();Z(this,Bt);Z(this,vt);Z(this,Bs);this.config=t,Q(this,Bt,new Set),Q(this,vt,new Map),Q(this,Bs,0)}build(t,r,i){const s=new Dv({client:t,mutationCache:this,mutationId:++$s(this,Bs)._,options:t.defaultMutationOptions(r),state:i});return this.add(s),s}add(t){I(this,Bt).add(t);const r=cn(t);if(typeof r=="string"){const i=I(this,vt).get(r);i?i.push(t):I(this,vt).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(I(this,Bt).delete(t)){const r=cn(t);if(typeof r=="string"){const i=I(this,vt).get(r);if(i)if(i.length>1){const s=i.indexOf(t);s!==-1&&i.splice(s,1)}else i[0]===t&&I(this,vt).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=cn(t);if(typeof r=="string"){const i=I(this,vt).get(r),s=i==null?void 0:i.find(h=>h.state.status==="pending");return!s||s===t}else return!0}runNext(t){var i;const r=cn(t);if(typeof r=="string"){const s=(i=I(this,vt).get(r))==null?void 0:i.find(h=>h!==t&&h.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){De.batch(()=>{I(this,Bt).forEach(t=>{this.notify({type:"removed",mutation:t})}),I(this,Bt).clear(),I(this,vt).clear()})}getAll(){return Array.from(I(this,Bt))}find(t){const r={exact:!0,...t};return this.getAll().find(i=>vu(r,i))}findAll(t={}){return this.getAll().filter(r=>vu(t,r))}notify(t){De.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return De.batch(()=>Promise.all(t.map(r=>r.continue().catch(Ve))))}},Bt=new WeakMap,vt=new WeakMap,Bs=new WeakMap,Nu);function cn(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Rt,zu,Av=(zu=class extends zs{constructor(t={}){super();Z(this,Rt);this.config=t,Q(this,Rt,new Map)}build(t,r,i){const s=r.queryKey,h=r.queryHash??Yl(s,r);let v=this.get(h);return v||(v=new kv({client:t,queryKey:s,queryHash:h,options:t.defaultQueryOptions(r),state:i,defaultOptions:t.getQueryDefaults(s)}),this.add(v)),v}add(t){I(this,Rt).has(t.queryHash)||(I(this,Rt).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=I(this,Rt).get(t.queryHash);r&&(t.destroy(),r===t&&I(this,Rt).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){De.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return I(this,Rt).get(t)}getAll(){return[...I(this,Rt).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(i=>_u(r,i))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(i=>_u(t,i)):r}notify(t){De.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){De.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){De.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Rt=new WeakMap,zu),me,ir,sr,Ci,wi,nr,xi,bi,Uu,Mv=(Uu=class{constructor(e={}){Z(this,me);Z(this,ir);Z(this,sr);Z(this,Ci);Z(this,wi);Z(this,nr);Z(this,xi);Z(this,bi);Q(this,me,e.queryCache||new Av),Q(this,ir,e.mutationCache||new Pv),Q(this,sr,e.defaultOptions||{}),Q(this,Ci,new Map),Q(this,wi,new Map),Q(this,nr,0)}mount(){$s(this,nr)._++,I(this,nr)===1&&(Q(this,xi,Xl.subscribe(async e=>{e&&(await this.resumePausedMutations(),I(this,me).onFocus())})),Q(this,bi,Qn.subscribe(async e=>{e&&(await this.resumePausedMutations(),I(this,me).onOnline())})))}unmount(){var e,t;$s(this,nr)._--,I(this,nr)===0&&((e=I(this,xi))==null||e.call(this),Q(this,xi,void 0),(t=I(this,bi))==null||t.call(this),Q(this,bi,void 0))}isFetching(e){return I(this,me).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return I(this,ir).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=I(this,me).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=I(this,me).build(this,t),i=r.state.data;return i===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(vr(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(i))}getQueriesData(e){return I(this,me).findAll(e).map(({queryKey:t,state:r})=>{const i=r.data;return[t,i]})}setQueryData(e,t,r){const i=this.defaultQueryOptions({queryKey:e}),s=I(this,me).get(i.queryHash),h=s==null?void 0:s.state.data,v=fv(t,h);if(v!==void 0)return I(this,me).build(this,i).setData(v,{...r,manual:!0})}setQueriesData(e,t,r){return De.batch(()=>I(this,me).findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=I(this,me).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=I(this,me);De.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=I(this,me);return De.batch(()=>(r.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},i=De.batch(()=>I(this,me).findAll(e).map(s=>s.cancel(r)));return Promise.all(i).then(Ve).catch(Ve)}invalidateQueries(e,t={}){return De.batch(()=>(I(this,me).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},i=De.batch(()=>I(this,me).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let h=s.fetch(void 0,r);return r.throwOnError||(h=h.catch(Ve)),s.state.fetchStatus==="paused"?Promise.resolve():h}));return Promise.all(i).then(Ve)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=I(this,me).build(this,t);return r.isStaleByTime(vr(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ve).catch(Ve)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ve).catch(Ve)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Qn.isOnline()?I(this,ir).resumePausedMutations():Promise.resolve()}getQueryCache(){return I(this,me)}getMutationCache(){return I(this,ir)}getDefaultOptions(){return I(this,sr)}setDefaultOptions(e){Q(this,sr,e)}setQueryDefaults(e,t){I(this,Ci).set(Ls(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...I(this,Ci).values()],r={};return t.forEach(i=>{Ds(e,i.queryKey)&&Object.assign(r,i.defaultOptions)}),r}setMutationDefaults(e,t){I(this,wi).set(Ls(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...I(this,wi).values()],r={};return t.forEach(i=>{Ds(e,i.mutationKey)&&Object.assign(r,i.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...I(this,sr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Yl(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===Zl&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...I(this,sr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){I(this,me).clear(),I(this,ir).clear()}},me=new WeakMap,ir=new WeakMap,sr=new WeakMap,Ci=new WeakMap,wi=new WeakMap,nr=new WeakMap,xi=new WeakMap,bi=new WeakMap,Uu),ff=q.createContext(void 0),Ov=e=>{const t=q.useContext(ff);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Bv=({client:e,children:t})=>(q.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),L.jsx(ff.Provider,{value:e,children:t})),pf=q.createContext(!1),Iv=()=>q.useContext(pf);pf.Provider;function jv(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Fv=q.createContext(jv()),Hv=()=>q.useContext(Fv),Nv=(e,t,r)=>{const i=r!=null&&r.state.error&&typeof e.throwOnError=="function"?of(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||i)&&(t.isReset()||(e.retryOnMount=!1))},zv=e=>{q.useEffect(()=>{e.clearReset()},[e])},Uv=({result:e,errorResetBoundary:t,throwOnError:r,query:i,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&i&&(s&&e.data===void 0||of(r,[e.error,i])),Wv=e=>{if(e.suspense){const r=s=>s==="static"?s:Math.max(s??1e3,1e3),i=e.staleTime;e.staleTime=typeof i=="function"?(...s)=>r(i(...s)):r(i),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},$v=(e,t)=>e.isLoading&&e.isFetching&&!t,Kv=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,bu=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function Vv(e,t,r){var _,C,w,S;const i=Iv(),s=Hv(),h=Ov(),v=h.defaultQueryOptions(e);(C=(_=h.getDefaultOptions().queries)==null?void 0:_._experimental_beforeQuery)==null||C.call(_,v);const n=h.getQueryCache().get(v.queryHash);v._optimisticResults=i?"isRestoring":"optimistic",Wv(v),Nv(v,s,n),zv(s);const u=!h.getQueryCache().get(v.queryHash),[d]=q.useState(()=>new t(h,v)),g=d.getOptimisticResult(v),f=!i&&e.subscribed!==!1;if(q.useSyncExternalStore(q.useCallback(l=>{const a=f?d.subscribe(De.batchCalls(l)):Ve;return d.updateResult(),a},[d,f]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),q.useEffect(()=>{d.setOptions(v)},[v,d]),Kv(v,g))throw bu(v,d,s);if(Uv({result:g,errorResetBoundary:s,throwOnError:v.throwOnError,query:n,suspense:v.suspense}))throw g.error;if((S=(w=h.getDefaultOptions().queries)==null?void 0:w._experimental_afterQuery)==null||S.call(w,v,g),v.experimental_prefetchInRender&&!Ts.isServer()&&$v(g,i)){const l=u?bu(v,d,s):n==null?void 0:n.promise;l==null||l.catch(Ve).finally(()=>{d.updateResult()})}return v.notifyOnChangeProps?g:d.trackResult(g)}function Ai(e,t){return Vv(e,Ev)}function qv(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var r,i,s,h,v=[],n="",u=e.split("/");for(u[0]||u.shift();s=u.shift();)r=s[0],r==="*"?(v.push(r),n+=s[1]==="?"?"(?:/(.*))?":"/(.*)"):r===":"?(i=s.indexOf("?",1),h=s.indexOf(".",1),v.push(s.substring(1,~i?i:~h?h:s.length)),n+=~i&&!~h?"(?:/([^/]+?))?":"/([^/]+?)",~h&&(n+=(~i?"?":"")+"\\"+s.substring(h))):n+="/"+s;return{keys:v,pattern:new RegExp("^"+n+(t?"(?=$|/)":"/?$"),"i")}}var _f={exports:{}},vf={};/**
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 Mi=q;function Qv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Gv=typeof Object.is=="function"?Object.is:Qv,Jv=Mi.useState,Xv=Mi.useEffect,Yv=Mi.useLayoutEffect,Zv=Mi.useDebugValue;function eg(e,t){var r=t(),i=Jv({inst:{value:r,getSnapshot:t}}),s=i[0].inst,h=i[1];return Yv(function(){s.value=r,s.getSnapshot=t,Vo(s)&&h({inst:s})},[e,r,t]),Xv(function(){return Vo(s)&&h({inst:s}),e(function(){Vo(s)&&h({inst:s})})},[e]),Zv(r),r}function Vo(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Gv(e,r)}catch{return!0}}function tg(e,t){return t()}var rg=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?tg:eg;vf.useSyncExternalStore=Mi.useSyncExternalStore!==void 0?Mi.useSyncExternalStore:rg;_f.exports=vf;var ig=_f.exports;const sg=Jf.useInsertionEffect,ng=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",gf=ng?q.useLayoutEffect:q.useEffect,og=sg||gf,tc=e=>{const t=q.useRef([e,(...r)=>t[0](...r)]).current;return og(()=>{t[0]=e}),t[1]},ag="popstate",rc="pushState",ic="replaceState",lg="hashchange",ku=[ag,rc,ic,lg],cg=e=>{for(const t of ku)addEventListener(t,e);return()=>{for(const t of ku)removeEventListener(t,e)}},mf=(e,t)=>ig.useSyncExternalStore(cg,e,t),Eu=()=>location.search,ug=({ssrSearch:e}={})=>mf(Eu,e!=null?()=>e:Eu),Ru=()=>location.pathname,hg=({ssrPath:e}={})=>mf(Ru,e!=null?()=>e:Ru),dg=(e,{replace:t=!1,state:r=null}={})=>history[t?ic:rc](r,"",e),fg=(e={})=>[hg(e),dg],Lu=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[Lu]>"u"){for(const e of[rc,ic]){const t=history[e];history[e]=function(){const r=t.apply(this,arguments),i=new Event(e);return i.arguments=arguments,dispatchEvent(i),r}}Object.defineProperty(window,Lu,{value:!0})}const pg=(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())?"~"+t:t.slice(e.length)||"/",yf=(e="")=>e==="/"?"":e,_g=(e,t)=>e[0]==="~"?e.slice(1):yf(t)+e,vg=(e="",t)=>pg(Du(yf(e)),Du(t)),Du=e=>{try{return decodeURI(e)}catch{return e}},Sf={hook:fg,searchHook:ug,parser:qv,base:"",ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:e=>e,aroundNav:(e,t,r)=>e(t,r)},Cf=q.createContext(Sf),ji=()=>q.useContext(Cf),wf={},xf=q.createContext(wf),gg=()=>q.useContext(xf),Us=e=>{const[t,r]=e.hook(e);return[vg(e.base,t),tc((i,s)=>e.aroundNav(r,_g(i,e.base),s))]},mg=()=>Us(ji()),bf=(e,t,r,i)=>{const{pattern:s,keys:h}=t instanceof RegExp?{keys:!1,pattern:t}:e(t||"*",i),v=s.exec(r)||[],[n,...u]=v;return n!==void 0?[!0,(()=>{const d=h!==!1?Object.fromEntries(h.map((f,_)=>[f,u[_]])):v.groups;let g={...u};return d&&Object.assign(g,d),g})(),...i?[n]:[]]:[!1,null]},kf=({children:e,...t})=>{var g,f,_;const r=ji(),i=t.hook?Sf:r;let s=i;const[h,v=t.ssrSearch??""]=((g=t.ssrPath)==null?void 0:g.split("?"))??[];h&&(t.ssrSearch=v,t.ssrPath=h),t.hrefs=t.hrefs??((f=t.hook)==null?void 0:f.hrefs),t.searchHook=t.searchHook??((_=t.hook)==null?void 0:_.searchHook);let n=q.useRef({}),u=n.current,d=u;for(let C in i){const w=C==="base"?i[C]+(t[C]??""):t[C]??i[C];u===d&&w!==d[C]&&(n.current=d={...d}),d[C]=w,(w!==i[C]||w!==s[C])&&(s=d)}return q.createElement(Cf.Provider,{value:s,children:e})},Tu=({children:e,component:t},r)=>t?q.createElement(t,{params:r}):typeof e=="function"?e(r):e,yg=e=>{let t=q.useRef(wf);const r=t.current;return t.current=Object.keys(e).length!==Object.keys(r).length||Object.entries(e).some(([i,s])=>s!==r[i])?e:r},qo=({path:e,nest:t,match:r,...i})=>{const s=ji(),[h]=Us(s),[v,n,u]=r??bf(s.parser,e,h,t),d=yg({...gg(),...n});if(!v)return null;const g=u?q.createElement(kf,{base:u},Tu(i,d)):Tu(i,d);return q.createElement(xf.Provider,{value:d,children:g})},fo=q.forwardRef((e,t)=>{const r=ji(),[i,s]=Us(r),{to:h="",href:v=h,onClick:n,asChild:u,children:d,className:g,replace:f,state:_,transition:C,...w}=e,S=tc(a=>{a.ctrlKey||a.metaKey||a.altKey||a.shiftKey||a.button!==0||(n==null||n(a),a.defaultPrevented||(a.preventDefault(),s(v,e)))}),l=r.hrefs(v[0]==="~"?v.slice(1):r.base+v,r);return u&&q.isValidElement(d)?q.cloneElement(d,{onClick:S,href:l}):q.createElement("a",{...w,onClick:S,href:l,className:g!=null&&g.call?g(i===v):g,children:d,ref:t})}),Ef=e=>Array.isArray(e)?e.flatMap(t=>Ef(t&&t.type===q.Fragment?t.props.children:t)):[e],Sg=({children:e,location:t})=>{const r=ji(),[i]=Us(r);for(const s of Ef(e)){let h=0;if(q.isValidElement(s)&&(h=bf(r.parser,s.props.path,t||i,s.props.nest))[0])return q.cloneElement(s,{match:h})}return null},Cg=e=>{const{to:t,href:r=t}=e,i=ji(),[,s]=Us(i),h=tc(()=>s(t||r,e)),{ssrContext:v}=i;return gf(()=>{h()},[]),v&&(v.redirectTo=t),null};async function $e(e,t){const r=await fetch(e,{credentials:"same-origin",headers:{Accept:"application/json",...(t==null?void 0:t.headers)??{}},...t});if(!r.ok)throw new Error(`${r.status} ${r.statusText} on ${e}`);return r.json()}const Ie={getStatus:()=>$e("/v1/status"),getBootstrap:()=>$e("/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)),$e(`/v1/events/recent?${r.toString()}`)},getClaudeAuth:()=>$e("/v1/auth/claude"),installClaudeCode:()=>$e("/v1/setup/claude/install",{method:"POST"}),signInClaude:()=>$e("/v1/auth/claude/spawn",{method:"POST"}),triggerDrip:()=>$e("/v1/setup/drip",{method:"POST"}),changeKeystorePassword:(e,t)=>$e("/v1/setup/change-password",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({current:e,next:t})}),claimRewards:()=>$e("/api/admin/claim-rewards",{method:"POST"}),restartDaemon:()=>$e("/api/admin/restart",{method:"POST"}),getSolverNets:()=>$e("/v1/solvernets"),updateSolverNet:(e,t)=>$e(`/v1/setup/solvernets/${encodeURIComponent(e)}`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),updateNetwork:e=>$e("/v1/setup/network",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)}),retryAgentBinding:e=>$e("/v1/setup/agent-binding/retry",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e??{})})};async function wg(){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())}}function xg(e){const[t,r]=q.useState([]),[i,s]=q.useState(!1);return q.useEffect(()=>{const h="",v=new EventSource(`/v1/events${h}`,{withCredentials:!0});return v.onopen=()=>s(!0),v.onerror=()=>s(!1),v.onmessage=n=>{try{const u=JSON.parse(n.data);r(d=>[...d.slice(-499),u])}catch{}},()=>{v.close()}},[e==null?void 0:e.join(",")]),{events:t,connected:i}}function bg({headline:e}){const[t,r]=q.useState(!1),{events:i}=xg(),s=i.length>0?i[i.length-1]:null;return L.jsx("div",{className:"min-h-screen flex items-center justify-center px-10 py-16",style:{background:"var(--bg)",color:"var(--fg)"},children:L.jsxs("div",{className:"max-w-xl w-full flex flex-col gap-6",children:[L.jsx("span",{className:"j-label",style:{color:"var(--accent-gold)"},children:"Jinn · starting up"}),L.jsxs("h1",{className:"j-display",style:{fontSize:"64px",lineHeight:1.05},children:[e,"."]}),L.jsx("p",{className:"j-mono text-sm",style:{color:"var(--fg-muted)",minHeight:"1.5em"},children:s?kg(s):"The daemon is booting. This usually takes a second."}),L.jsx("button",{type:"button",onClick:()=>r(h=>!h),className:"j-label hover:opacity-80 self-start",style:{color:"var(--fg-dim)"},children:t?"Hide details":"Show details"}),t&&L.jsxs("div",{className:"j-mono text-xs max-h-64 overflow-y-auto px-3 py-2",style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)"},children:[i.length===0&&L.jsx("div",{style:{color:"var(--fg-dim)"},children:"no events yet"}),i.slice().reverse().map(h=>L.jsxs("div",{className:"grid grid-cols-[68px_84px_1fr] gap-3 py-0.5",children:[L.jsx("span",{style:{color:"var(--fg-dim)"},children:h.ts.slice(11,19)}),L.jsx("span",{style:{color:h.kind==="error"?"var(--break-red)":h.kind==="system"?"var(--accent-sky)":"var(--fg-dim)"},children:h.kind}),L.jsx("span",{style:{color:"var(--fg)"},children:h.message})]},h.id))]})]})})}function kg(e){return e.kind==="error"?`Error: ${e.message}`:e.message}function Eg({address:e,minimumWei:t,chainExplorerBase:r}){var c;const[i,s]=q.useState(!1),[h,v]=q.useState(null),[n,u]=q.useState(0),[d,g]=q.useState({state:"idle"});q.useEffect(()=>{if(h===null)return;u(Math.max(0,Math.floor((Date.now()-h)/1e3)));const p=window.setInterval(()=>{u(Math.max(0,Math.floor((Date.now()-h)/1e3)))},1e3);return()=>window.clearInterval(p)},[h]);const f=async()=>{await navigator.clipboard.writeText(e),s(!0),setTimeout(()=>s(!1),1500)},_=async()=>{var p;v(Date.now()),u(0),g({state:"requesting"});try{const y=await Ie.triggerDrip();v(null),y.ok?g({state:"sent",txHash:y.txHash??((p=y.txHashes)==null?void 0:p.at(-1)),txHashes:y.txHashes,attempts:y.attempts,balanceWei:y.balanceWei,targetWei:y.targetWei}):y.rateLimited||y.reason&&/rate|claimed|429/i.test(y.reason)?g({state:"rate_limited",reason:y.reason??"faucet rate-limited"}):g({state:"failed",reason:y.reason??"faucet funding failed"})}catch(y){v(null),g({state:"failed",reason:y instanceof Error?y.message:"drip failed"})}},C=p=>{if(!p)return"unknown";try{const y=Number(BigInt(p))/1e18;return`${y.toFixed(y<.001?4:3)} ETH`}catch{return`${p} wei`}},w=C(t),S=q.useMemo(()=>d.state!=="requesting"?0:Math.min(92,Math.max(8,Math.round(n/60*92))),[d.state,n]),l=d.state==="sent"?((c=d.txHashes)==null?void 0:c.length)??d.attempts??(d.txHash?1:0):0,a=d.state==="sent"&&d.balanceWei!==void 0&&d.targetWei!==void 0&&(()=>{try{return BigInt(d.balanceWei)>=BigInt(d.targetWei)}catch{return!1}})(),o=d.state==="sent"&&!a;return L.jsxs("div",{className:"px-6 py-5 flex flex-col gap-4",style:{border:"1px solid var(--accent-gold)",background:"rgba(220, 184, 102, 0.04)",borderRadius:"var(--radius-2)"},children:[L.jsxs("div",{className:"flex items-baseline justify-between",children:[L.jsx("span",{className:"j-label",style:{color:"var(--accent-gold)"},children:"Action needed · fund the master EOA"}),L.jsx("span",{className:"j-mono text-[10px]",style:{color:"var(--fg-dim)"},children:"auto-detected on chain"})]}),L.jsxs("div",{className:"flex flex-col gap-1",children:[L.jsx("span",{className:"j-mono text-xs break-all",style:{color:"var(--fg)"},children:e}),L.jsxs("span",{className:"j-mono text-xs",style:{color:"var(--fg-muted)"},children:["send at least ",w," so the daemon can pay gas for setup, or use the testnet faucet."]})]}),L.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[L.jsx("button",{onClick:_,type:"button",disabled:d.state==="requesting"||a,className:"px-3 py-1.5 j-label hover:opacity-90 disabled:opacity-50",style:{background:"var(--accent-gold)",color:"var(--bg)",borderRadius:"var(--radius-1)"},children:d.state==="requesting"?"Funding...":a?"Faucet funded":o?"Fund more":"Fund from faucet"}),L.jsx("button",{onClick:f,type:"button",className:"px-3 py-1.5 j-label hover:opacity-90",style:{border:"1px solid var(--border-strong)",color:"var(--fg)",borderRadius:"var(--radius-1)",background:"transparent"},children:i?"Copied":"Copy address"}),L.jsx("a",{href:`${r}/address/${e}`,target:"_blank",rel:"noopener noreferrer",className:"px-3 py-1.5 j-label hover:opacity-90",style:{border:"1px solid var(--border)",color:"var(--fg-muted)",borderRadius:"var(--radius-1)"},children:"View on explorer"})]}),d.state==="sent"&&L.jsxs("p",{className:"j-mono text-[11px]",style:{color:a?"var(--vow-green)":"var(--accent-gold)"},children:[a?"Faucet funding complete":"Faucet funding partial",l>0?` (${l} drip${l===1?"":"s"})`:"",".",d.balanceWei&&d.targetWei?` Balance ${C(d.balanceWei)} / target ${C(d.targetWei)}.`:"",o?' Click "Fund more" to top up.':"",d.txHash&&L.jsxs(L.Fragment,{children:[" ",L.jsx("a",{href:`${r}/tx/${d.txHash}`,target:"_blank",rel:"noopener noreferrer",className:"hover:underline",style:{color:"var(--accent-sky)"},children:"view latest tx"})]})]}),d.state==="requesting"&&L.jsxs("div",{className:"flex flex-col gap-2",children:[L.jsx("div",{className:"h-1.5 overflow-hidden",style:{background:"var(--bg-sunken)",borderRadius:"999px"},children:L.jsx("div",{className:"h-full transition-all",style:{width:`${S}%`,background:"var(--accent-gold)",borderRadius:"999px"}})}),L.jsxs("p",{className:"j-mono text-[11px]",style:{color:"var(--fg-muted)"},children:["Requesting faucet drips for ",Rg(e),". Elapsed ",n,"s; this can take about a minute on a fresh wallet."]})]}),d.state==="rate_limited"&&L.jsx("p",{className:"j-mono text-[11px]",style:{color:"var(--wane)"},children:"Faucet rate-limited. Send manually or wait before trying again."}),d.state==="failed"&&L.jsx("p",{className:"j-mono text-[11px]",style:{color:"var(--break-red)"},children:d.reason})]})}const Rg=e=>`${e.slice(0,6)}…${e.slice(-4)}`;var Rf={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={4567:function(v,n,u){var d=this&&this.__decorate||function(c,p,y,x){var k,m=arguments.length,b=m<3?p:x===null?x=Object.getOwnPropertyDescriptor(p,y):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(c,p,y,x);else for(var D=c.length-1;D>=0;D--)(k=c[D])&&(b=(m<3?k(b):m>3?k(p,y,b):k(p,y))||b);return m>3&&b&&Object.defineProperty(p,y,b),b},g=this&&this.__param||function(c,p){return function(y,x){p(y,x,c)}};Object.defineProperty(n,"__esModule",{value:!0}),n.AccessibilityManager=void 0;const f=u(9042),_=u(6114),C=u(9924),w=u(844),S=u(5596),l=u(4725),a=u(3656);let o=n.AccessibilityManager=class extends w.Disposable{constructor(c,p){super(),this._terminal=c,this._renderService=p,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 y=0;y<this._terminal.rows;y++)this._rowElements[y]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[y]);if(this._topBoundaryFocusListener=y=>this._handleBoundaryFocus(y,0),this._bottomBoundaryFocusListener=y=>this._handleBoundaryFocus(y,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 C.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(y=>this._handleResize(y.rows))),this.register(this._terminal.onRender(y=>this._refreshRows(y.start,y.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(y=>this._handleChar(y))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
49
+ `))),this.register(this._terminal.onA11yTab(y=>this._handleTab(y))),this.register(this._terminal.onKey(y=>this._handleKey(y.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._screenDprMonitor=new S.ScreenDprMonitor(window),this.register(this._screenDprMonitor),this._screenDprMonitor.setListener(()=>this._refreshRowsDimensions()),this.register((0,a.addDisposableDomListener)(window,"resize",()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,w.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(c){for(let p=0;p<c;p++)this._handleChar(" ")}_handleChar(c){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==c&&(this._charsToAnnounce+=c):this._charsToAnnounce+=c,c===`
50
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=f.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(c){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(c)||this._charsToConsume.push(c)}_refreshRows(c,p){this._liveRegionDebouncer.refresh(c,p,this._terminal.rows)}_renderRows(c,p){const y=this._terminal.buffer,x=y.lines.length.toString();for(let k=c;k<=p;k++){const m=y.translateBufferLineToString(y.ydisp+k,!0),b=(y.ydisp+k+1).toString(),D=this._rowElements[k];D&&(m.length===0?D.innerText=" ":D.textContent=m,D.setAttribute("aria-posinset",b),D.setAttribute("aria-setsize",x))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(c,p){const y=c.target,x=this._rowElements[p===0?1:this._rowElements.length-2];if(y.getAttribute("aria-posinset")===(p===0?"1":`${this._terminal.buffer.lines.length}`)||c.relatedTarget!==x)return;let k,m;if(p===0?(k=y,m=this._rowElements.pop(),this._rowContainer.removeChild(m)):(k=this._rowElements.shift(),m=y,this._rowContainer.removeChild(k)),k.removeEventListener("focus",this._topBoundaryFocusListener),m.removeEventListener("focus",this._bottomBoundaryFocusListener),p===0){const b=this._createAccessibilityTreeNode();this._rowElements.unshift(b),this._rowContainer.insertAdjacentElement("afterbegin",b)}else{const b=this._createAccessibilityTreeNode();this._rowElements.push(b),this._rowContainer.appendChild(b)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(p===0?-1:1),this._rowElements[p===0?1:this._rowElements.length-2].focus(),c.preventDefault(),c.stopImmediatePropagation()}_handleResize(c){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let p=this._rowContainer.children.length;p<this._terminal.rows;p++)this._rowElements[p]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[p]);for(;this._rowElements.length>c;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const c=document.createElement("div");return c.setAttribute("role","listitem"),c.tabIndex=-1,this._refreshRowDimensions(c),c}_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 c=0;c<this._terminal.rows;c++)this._refreshRowDimensions(this._rowElements[c])}}_refreshRowDimensions(c){c.style.height=`${this._renderService.dimensions.css.cell.height}px`}};n.AccessibilityManager=o=d([g(1,l.IRenderService)],o)},3614:(v,n)=>{function u(_){return _.replace(/\r?\n/g,"\r")}function d(_,C){return C?"\x1B[200~"+_+"\x1B[201~":_}function g(_,C,w,S){_=d(_=u(_),w.decPrivateModes.bracketedPasteMode&&S.rawOptions.ignoreBracketedPasteMode!==!0),w.triggerDataEvent(_,!0),C.value=""}function f(_,C,w){const S=w.getBoundingClientRect(),l=_.clientX-S.left-10,a=_.clientY-S.top-10;C.style.width="20px",C.style.height="20px",C.style.left=`${l}px`,C.style.top=`${a}px`,C.style.zIndex="1000",C.focus()}Object.defineProperty(n,"__esModule",{value:!0}),n.rightClickHandler=n.moveTextAreaUnderMouseCursor=n.paste=n.handlePasteEvent=n.copyHandler=n.bracketTextForPaste=n.prepareTextForTerminal=void 0,n.prepareTextForTerminal=u,n.bracketTextForPaste=d,n.copyHandler=function(_,C){_.clipboardData&&_.clipboardData.setData("text/plain",C.selectionText),_.preventDefault()},n.handlePasteEvent=function(_,C,w,S){_.stopPropagation(),_.clipboardData&&g(_.clipboardData.getData("text/plain"),C,w,S)},n.paste=g,n.moveTextAreaUnderMouseCursor=f,n.rightClickHandler=function(_,C,w,S,l){f(_,C,w),l&&S.rightClickSelect(_),C.value=S.selectionText,C.select()}},7239:(v,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ColorContrastCache=void 0;const d=u(1505);n.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(g,f,_){this._css.set(g,f,_)}getCss(g,f){return this._css.get(g,f)}setColor(g,f,_){this._color.set(g,f,_)}getColor(g,f){return this._color.get(g,f)}clear(){this._color.clear(),this._css.clear()}}},3656:(v,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.addDisposableDomListener=void 0,n.addDisposableDomListener=function(u,d,g,f){u.addEventListener(d,g,f);let _=!1;return{dispose:()=>{_||(_=!0,u.removeEventListener(d,g,f))}}}},6465:function(v,n,u){var d=this&&this.__decorate||function(l,a,o,c){var p,y=arguments.length,x=y<3?a:c===null?c=Object.getOwnPropertyDescriptor(a,o):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(l,a,o,c);else for(var k=l.length-1;k>=0;k--)(p=l[k])&&(x=(y<3?p(x):y>3?p(a,o,x):p(a,o))||x);return y>3&&x&&Object.defineProperty(a,o,x),x},g=this&&this.__param||function(l,a){return function(o,c){a(o,c,l)}};Object.defineProperty(n,"__esModule",{value:!0}),n.Linkifier2=void 0;const f=u(3656),_=u(8460),C=u(844),w=u(2585);let S=n.Linkifier2=class extends C.Disposable{get currentLink(){return this._currentLink}constructor(l){super(),this._bufferService=l,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,C.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,C.toDisposable)(()=>{this._lastMouseEvent=void 0})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0}))}registerLinkProvider(l){return this._linkProviders.push(l),{dispose:()=>{const a=this._linkProviders.indexOf(l);a!==-1&&this._linkProviders.splice(a,1)}}}attachToDom(l,a,o){this._element=l,this._mouseService=a,this._renderService=o,this.register((0,f.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,f.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(l){if(this._lastMouseEvent=l,!this._element||!this._mouseService)return;const a=this._positionFromMouseEvent(l,this._element,this._mouseService);if(!a)return;this._isMouseOut=!1;const o=l.composedPath();for(let c=0;c<o.length;c++){const p=o[c];if(p.classList.contains("xterm"))break;if(p.classList.contains("xterm-hover"))return}this._lastBufferCell&&a.x===this._lastBufferCell.x&&a.y===this._lastBufferCell.y||(this._handleHover(a),this._lastBufferCell=a)}_handleHover(l){if(this._activeLine!==l.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(l,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,l)||(this._clearCurrentLink(),this._askForLink(l,!0))}_askForLink(l,a){var o,c;this._activeProviderReplies&&a||((o=this._activeProviderReplies)===null||o===void 0||o.forEach(y=>{y==null||y.forEach(x=>{x.link.dispose&&x.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=l.y);let p=!1;for(const[y,x]of this._linkProviders.entries())a?!((c=this._activeProviderReplies)===null||c===void 0)&&c.get(y)&&(p=this._checkLinkProviderResult(y,l,p)):x.provideLinks(l.y,k=>{var m,b;if(this._isMouseOut)return;const D=k==null?void 0:k.map(M=>({link:M}));(m=this._activeProviderReplies)===null||m===void 0||m.set(y,D),p=this._checkLinkProviderResult(y,l,p),((b=this._activeProviderReplies)===null||b===void 0?void 0:b.size)===this._linkProviders.length&&this._removeIntersectingLinks(l.y,this._activeProviderReplies)})}_removeIntersectingLinks(l,a){const o=new Set;for(let c=0;c<a.size;c++){const p=a.get(c);if(p)for(let y=0;y<p.length;y++){const x=p[y],k=x.link.range.start.y<l?0:x.link.range.start.x,m=x.link.range.end.y>l?this._bufferService.cols:x.link.range.end.x;for(let b=k;b<=m;b++){if(o.has(b)){p.splice(y--,1);break}o.add(b)}}}}_checkLinkProviderResult(l,a,o){var c;if(!this._activeProviderReplies)return o;const p=this._activeProviderReplies.get(l);let y=!1;for(let x=0;x<l;x++)this._activeProviderReplies.has(x)&&!this._activeProviderReplies.get(x)||(y=!0);if(!y&&p){const x=p.find(k=>this._linkAtPosition(k.link,a));x&&(o=!0,this._handleNewLink(x))}if(this._activeProviderReplies.size===this._linkProviders.length&&!o)for(let x=0;x<this._activeProviderReplies.size;x++){const k=(c=this._activeProviderReplies.get(x))===null||c===void 0?void 0:c.find(m=>this._linkAtPosition(m.link,a));if(k){o=!0,this._handleNewLink(k);break}}return o}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(l){if(!this._element||!this._mouseService||!this._currentLink)return;const a=this._positionFromMouseEvent(l,this._element,this._mouseService);a&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,a)&&this._currentLink.link.activate(l,this._currentLink.link.text)}_clearCurrentLink(l,a){this._element&&this._currentLink&&this._lastMouseEvent&&(!l||!a||this._currentLink.link.range.start.y>=l&&this._currentLink.link.range.end.y<=a)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,C.disposeArray)(this._linkCacheDisposables))}_handleNewLink(l){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;const a=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);a&&this._linkAtPosition(l.link,a)&&(this._currentLink=l,this._currentLink.state={decorations:{underline:l.link.decorations===void 0||l.link.decorations.underline,pointerCursor:l.link.decorations===void 0||l.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,l.link,this._lastMouseEvent),l.link.decorations={},Object.defineProperties(l.link.decorations,{pointerCursor:{get:()=>{var o,c;return(c=(o=this._currentLink)===null||o===void 0?void 0:o.state)===null||c===void 0?void 0:c.decorations.pointerCursor},set:o=>{var c,p;!((c=this._currentLink)===null||c===void 0)&&c.state&&this._currentLink.state.decorations.pointerCursor!==o&&(this._currentLink.state.decorations.pointerCursor=o,this._currentLink.state.isHovered&&((p=this._element)===null||p===void 0||p.classList.toggle("xterm-cursor-pointer",o)))}},underline:{get:()=>{var o,c;return(c=(o=this._currentLink)===null||o===void 0?void 0:o.state)===null||c===void 0?void 0:c.decorations.underline},set:o=>{var c,p,y;!((c=this._currentLink)===null||c===void 0)&&c.state&&((y=(p=this._currentLink)===null||p===void 0?void 0:p.state)===null||y===void 0?void 0:y.decorations.underline)!==o&&(this._currentLink.state.decorations.underline=o,this._currentLink.state.isHovered&&this._fireUnderlineEvent(l.link,o))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(o=>{if(!this._currentLink)return;const c=o.start===0?0:o.start+1+this._bufferService.buffer.ydisp,p=this._bufferService.buffer.ydisp+1+o.end;if(this._currentLink.link.range.start.y>=c&&this._currentLink.link.range.end.y<=p&&(this._clearCurrentLink(c,p),this._lastMouseEvent&&this._element)){const y=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);y&&this._askForLink(y,!1)}})))}_linkHover(l,a,o){var c;!((c=this._currentLink)===null||c===void 0)&&c.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(a,!0),this._currentLink.state.decorations.pointerCursor&&l.classList.add("xterm-cursor-pointer")),a.hover&&a.hover(o,a.text)}_fireUnderlineEvent(l,a){const o=l.range,c=this._bufferService.buffer.ydisp,p=this._createLinkUnderlineEvent(o.start.x-1,o.start.y-c-1,o.end.x,o.end.y-c-1,void 0);(a?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(p)}_linkLeave(l,a,o){var c;!((c=this._currentLink)===null||c===void 0)&&c.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(a,!1),this._currentLink.state.decorations.pointerCursor&&l.classList.remove("xterm-cursor-pointer")),a.leave&&a.leave(o,a.text)}_linkAtPosition(l,a){const o=l.range.start.y*this._bufferService.cols+l.range.start.x,c=l.range.end.y*this._bufferService.cols+l.range.end.x,p=a.y*this._bufferService.cols+a.x;return o<=p&&p<=c}_positionFromMouseEvent(l,a,o){const c=o.getCoords(l,a,this._bufferService.cols,this._bufferService.rows);if(c)return{x:c[0],y:c[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(l,a,o,c,p){return{x1:l,y1:a,x2:o,y2:c,cols:this._bufferService.cols,fg:p}}};n.Linkifier2=S=d([g(0,w.IBufferService)],S)},9042:(v,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.tooMuchOutput=n.promptLabel=void 0,n.promptLabel="Terminal input",n.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(v,n,u){var d=this&&this.__decorate||function(S,l,a,o){var c,p=arguments.length,y=p<3?l:o===null?o=Object.getOwnPropertyDescriptor(l,a):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(S,l,a,o);else for(var x=S.length-1;x>=0;x--)(c=S[x])&&(y=(p<3?c(y):p>3?c(l,a,y):c(l,a))||y);return p>3&&y&&Object.defineProperty(l,a,y),y},g=this&&this.__param||function(S,l){return function(a,o){l(a,o,S)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OscLinkProvider=void 0;const f=u(511),_=u(2585);let C=n.OscLinkProvider=class{constructor(S,l,a){this._bufferService=S,this._optionsService=l,this._oscLinkService=a}provideLinks(S,l){var a;const o=this._bufferService.buffer.lines.get(S-1);if(!o)return void l(void 0);const c=[],p=this._optionsService.rawOptions.linkHandler,y=new f.CellData,x=o.getTrimmedLength();let k=-1,m=-1,b=!1;for(let D=0;D<x;D++)if(m!==-1||o.hasContent(D)){if(o.loadCell(D,y),y.hasExtendedAttrs()&&y.extended.urlId){if(m===-1){m=D,k=y.extended.urlId;continue}b=y.extended.urlId!==k}else m!==-1&&(b=!0);if(b||m!==-1&&D===x-1){const M=(a=this._oscLinkService.getLinkData(k))===null||a===void 0?void 0:a.uri;if(M){const A={start:{x:m+1,y:S},end:{x:D+(b||D!==x-1?0:1),y:S}};let O=!1;if(!(p!=null&&p.allowNonHttpProtocols))try{const F=new URL(M);["http:","https:"].includes(F.protocol)||(O=!0)}catch{O=!0}O||c.push({text:M,range:A,activate:(F,H)=>p?p.activate(F,H,A):w(0,H),hover:(F,H)=>{var U;return(U=p==null?void 0:p.hover)===null||U===void 0?void 0:U.call(p,F,H,A)},leave:(F,H)=>{var U;return(U=p==null?void 0:p.leave)===null||U===void 0?void 0:U.call(p,F,H,A)}})}b=!1,y.hasExtendedAttrs()&&y.extended.urlId?(m=D,k=y.extended.urlId):(m=-1,k=-1)}}l(c)}};function w(S,l){if(confirm(`Do you want to navigate to ${l}?
51
+
52
+ WARNING: This link could potentially be dangerous`)){const a=window.open();if(a){try{a.opener=null}catch{}a.location.href=l}else console.warn("Opening link blocked as opener could not be cleared")}}n.OscLinkProvider=C=d([g(0,_.IBufferService),g(1,_.IOptionsService),g(2,_.IOscLinkService)],C)},6193:(v,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.RenderDebouncer=void 0,n.RenderDebouncer=class{constructor(u,d){this._parentWindow=u,this._renderCallback=d,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._parentWindow.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(u){return this._refreshCallbacks.push(u),this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(u,d,g){this._rowCount=g,u=u!==void 0?u:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d,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 u=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const u of this._refreshCallbacks)u(0);this._refreshCallbacks=[]}}},5596:(v,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ScreenDprMonitor=void 0;const d=u(844);class g extends d.Disposable{constructor(_){super(),this._parentWindow=_,this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this.register((0,d.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)}}n.ScreenDprMonitor=g},3236:(v,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Terminal=void 0;const d=u(3614),g=u(3656),f=u(6465),_=u(9042),C=u(3730),w=u(1680),S=u(3107),l=u(5744),a=u(2950),o=u(1296),c=u(428),p=u(4269),y=u(5114),x=u(8934),k=u(3230),m=u(9312),b=u(4725),D=u(6731),M=u(8055),A=u(8969),O=u(8460),F=u(844),H=u(6114),U=u(8437),$=u(2584),E=u(7399),T=u(5941),P=u(9074),B=u(2585),z=u(5435),V=u(4567),Y=typeof window<"u"?window.document:null;class X 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(R={}){super(R),this.browser=H,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new F.MutableDisposable),this._onCursorMove=this.register(new O.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new O.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new O.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new O.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new O.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new O.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new O.EventEmitter),this._onBlur=this.register(new O.EventEmitter),this._onA11yCharEmitter=this.register(new O.EventEmitter),this._onA11yTabEmitter=this.register(new O.EventEmitter),this._onWillOpen=this.register(new O.EventEmitter),this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(f.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(C.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(P.DecorationService),this._instantiationService.setService(B.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((j,W)=>this.refresh(j,W))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(j=>this._reportWindowsOptions(j))),this.register(this._inputHandler.onColor(j=>this._handleColorEvent(j))),this.register((0,O.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,O.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,O.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,O.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(j=>this._afterResize(j.cols,j.rows))),this.register((0,F.toDisposable)(()=>{var j,W;this._customKeyEventHandler=void 0,(W=(j=this.element)===null||j===void 0?void 0:j.parentNode)===null||W===void 0||W.removeChild(this.element)}))}_handleColorEvent(R){if(this._themeService)for(const j of R){let W,N="";switch(j.index){case 256:W="foreground",N="10";break;case 257:W="background",N="11";break;case 258:W="cursor",N="12";break;default:W="ansi",N="4;"+j.index}switch(j.type){case 0:const ee=M.color.toColorRGB(W==="ansi"?this._themeService.colors.ansi[j.index]:this._themeService.colors[W]);this.coreService.triggerDataEvent(`${$.C0.ESC}]${N};${(0,T.toRgbString)(ee)}${$.C1_ESCAPED.ST}`);break;case 1:if(W==="ansi")this._themeService.modifyColors(G=>G.ansi[j.index]=M.rgba.toColor(...j.color));else{const G=W;this._themeService.modifyColors(le=>le[G]=M.rgba.toColor(...j.color))}break;case 2:this._themeService.restoreColor(j.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(R){R?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(V.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(R){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent($.C0.ESC+"[I"),this.updateCursorStyle(R),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var R;return(R=this.textarea)===null||R===void 0?void 0:R.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent($.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 R=this.buffer.ybase+this.buffer.y,j=this.buffer.lines.get(R);if(!j)return;const W=Math.min(this.buffer.x,this.cols-1),N=this._renderService.dimensions.css.cell.height,ee=j.getWidth(W),G=this._renderService.dimensions.css.cell.width*ee,le=this.buffer.y*this._renderService.dimensions.css.cell.height,Re=W*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Re+"px",this.textarea.style.top=le+"px",this.textarea.style.width=G+"px",this.textarea.style.height=N+"px",this.textarea.style.lineHeight=N+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,g.addDisposableDomListener)(this.element,"copy",j=>{this.hasSelection()&&(0,d.copyHandler)(j,this._selectionService)}));const R=j=>(0,d.handlePasteEvent)(j,this.textarea,this.coreService,this.optionsService);this.register((0,g.addDisposableDomListener)(this.textarea,"paste",R)),this.register((0,g.addDisposableDomListener)(this.element,"paste",R)),H.isFirefox?this.register((0,g.addDisposableDomListener)(this.element,"mousedown",j=>{j.button===2&&(0,d.rightClickHandler)(j,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,g.addDisposableDomListener)(this.element,"contextmenu",j=>{(0,d.rightClickHandler)(j,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),H.isLinux&&this.register((0,g.addDisposableDomListener)(this.element,"auxclick",j=>{j.button===1&&(0,d.moveTextAreaUnderMouseCursor)(j,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,g.addDisposableDomListener)(this.textarea,"keyup",R=>this._keyUp(R),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keydown",R=>this._keyDown(R),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keypress",R=>this._keyPress(R),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionupdate",R=>this._compositionHelper.compositionupdate(R))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,g.addDisposableDomListener)(this.textarea,"input",R=>this._inputEvent(R),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(R){var j;if(!R)throw new Error("Terminal requires a parent element.");R.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=R.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),R.appendChild(this.element);const W=Y.createDocumentFragment();this._viewportElement=Y.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),W.appendChild(this._viewportElement),this._viewportScrollArea=Y.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=Y.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=Y.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),W.appendChild(this.screenElement),this.textarea=Y.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",_.promptLabel),H.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(y.CoreBrowserService,this.textarea,(j=this._document.defaultView)!==null&&j!==void 0?j:window),this._instantiationService.setService(b.ICoreBrowserService,this._coreBrowserService),this.register((0,g.addDisposableDomListener)(this.textarea,"focus",N=>this._handleTextAreaFocus(N))),this.register((0,g.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(c.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(b.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(D.ThemeService),this._instantiationService.setService(b.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(p.CharacterJoinerService),this._instantiationService.setService(b.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(k.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(b.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(N=>this._onRender.fire(N))),this.onResize(N=>this._renderService.resize(N.cols,N.rows)),this._compositionView=Y.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(a.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(W);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._mouseService=this._instantiationService.createInstance(x.MouseService),this._instantiationService.setService(b.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(w.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(N=>this.scrollLines(N.amount,N.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(m.SelectionService,this.element,this.screenElement,this.linkifier2)),this._instantiationService.setService(b.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(N=>this.scrollLines(N.amount,N.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(N=>this._renderService.handleSelectionChanged(N.start,N.end,N.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(N=>{this.textarea.value=N,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(N=>{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(S.BufferDecorationRenderer,this.screenElement)),this.register((0,g.addDisposableDomListener)(this.element,"mousedown",N=>this._selectionService.handleMouseDown(N))),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(V.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",N=>this._handleScreenReaderModeOptionChange(N))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(l.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",N=>{!this._overviewRulerRenderer&&N&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(l.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(o.DomRenderer,this.element,this.screenElement,this._viewportElement,this.linkifier2)}bindMouse(){const R=this,j=this.element;function W(G){const le=R._mouseService.getMouseReportCoords(G,R.screenElement);if(!le)return!1;let Re,We;switch(G.overrideType||G.type){case"mousemove":We=32,G.buttons===void 0?(Re=3,G.button!==void 0&&(Re=G.button<3?G.button:3)):Re=1&G.buttons?0:4&G.buttons?1:2&G.buttons?2:3;break;case"mouseup":We=0,Re=G.button<3?G.button:3;break;case"mousedown":We=1,Re=G.button<3?G.button:3;break;case"wheel":if(R.viewport.getLinesScrolled(G)===0)return!1;We=G.deltaY<0?0:1,Re=4;break;default:return!1}return!(We===void 0||Re===void 0||Re>4)&&R.coreMouseService.triggerMouseEvent({col:le.col,row:le.row,x:le.x,y:le.y,button:Re,action:We,ctrl:G.ctrlKey,alt:G.altKey,shift:G.shiftKey})}const N={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ee={mouseup:G=>(W(G),G.buttons||(this._document.removeEventListener("mouseup",N.mouseup),N.mousedrag&&this._document.removeEventListener("mousemove",N.mousedrag)),this.cancel(G)),wheel:G=>(W(G),this.cancel(G,!0)),mousedrag:G=>{G.buttons&&W(G)},mousemove:G=>{G.buttons||W(G)}};this.register(this.coreMouseService.onProtocolChange(G=>{G?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(G)),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&G?N.mousemove||(j.addEventListener("mousemove",ee.mousemove),N.mousemove=ee.mousemove):(j.removeEventListener("mousemove",N.mousemove),N.mousemove=null),16&G?N.wheel||(j.addEventListener("wheel",ee.wheel,{passive:!1}),N.wheel=ee.wheel):(j.removeEventListener("wheel",N.wheel),N.wheel=null),2&G?N.mouseup||(j.addEventListener("mouseup",ee.mouseup),N.mouseup=ee.mouseup):(this._document.removeEventListener("mouseup",N.mouseup),j.removeEventListener("mouseup",N.mouseup),N.mouseup=null),4&G?N.mousedrag||(N.mousedrag=ee.mousedrag):(this._document.removeEventListener("mousemove",N.mousedrag),N.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,g.addDisposableDomListener)(j,"mousedown",G=>{if(G.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(G))return W(G),N.mouseup&&this._document.addEventListener("mouseup",N.mouseup),N.mousedrag&&this._document.addEventListener("mousemove",N.mousedrag),this.cancel(G)})),this.register((0,g.addDisposableDomListener)(j,"wheel",G=>{if(!N.wheel){if(!this.buffer.hasScrollback){const le=this.viewport.getLinesScrolled(G);if(le===0)return;const Re=$.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(G.deltaY<0?"A":"B");let We="";for(let Vr=0;Vr<Math.abs(le);Vr++)We+=Re;return this.coreService.triggerDataEvent(We,!0),this.cancel(G,!0)}return this.viewport.handleWheel(G)?this.cancel(G):void 0}},{passive:!1})),this.register((0,g.addDisposableDomListener)(j,"touchstart",G=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(G),this.cancel(G)},{passive:!0})),this.register((0,g.addDisposableDomListener)(j,"touchmove",G=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(G)?void 0:this.cancel(G)},{passive:!1}))}refresh(R,j){var W;(W=this._renderService)===null||W===void 0||W.refreshRows(R,j)}updateCursorStyle(R){var j;!((j=this._selectionService)===null||j===void 0)&&j.shouldColumnSelect(R)?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(R,j,W=0){var N;W===1?(super.scrollLines(R,j,W),this.refresh(0,this.rows-1)):(N=this.viewport)===null||N===void 0||N.scrollLines(R)}paste(R){(0,d.paste)(R,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(R){this._customKeyEventHandler=R}registerLinkProvider(R){return this.linkifier2.registerLinkProvider(R)}registerCharacterJoiner(R){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const j=this._characterJoinerService.register(R);return this.refresh(0,this.rows-1),j}deregisterCharacterJoiner(R){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(R)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(R){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+R)}registerDecoration(R){return this._decorationService.registerDecoration(R)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(R,j,W){this._selectionService.setSelection(R,j,W)}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 R;(R=this._selectionService)===null||R===void 0||R.clearSelection()}selectAll(){var R;(R=this._selectionService)===null||R===void 0||R.selectAll()}selectLines(R,j){var W;(W=this._selectionService)===null||W===void 0||W.selectLines(R,j)}_keyDown(R){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(R)===!1)return!1;const j=this.browser.isMac&&this.options.macOptionIsMeta&&R.altKey;if(!j&&!this._compositionHelper.keydown(R))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;j||R.key!=="Dead"&&R.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const W=(0,E.evaluateKeyboardEvent)(R,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(R),W.type===3||W.type===2){const N=this.rows-1;return this.scrollLines(W.type===2?-N:N),this.cancel(R,!0)}return W.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,R)||(W.cancel&&this.cancel(R,!0),!W.key||!!(R.key&&!R.ctrlKey&&!R.altKey&&!R.metaKey&&R.key.length===1&&R.key.charCodeAt(0)>=65&&R.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(W.key!==$.C0.ETX&&W.key!==$.C0.CR||(this.textarea.value=""),this._onKey.fire({key:W.key,domEvent:R}),this._showCursor(),this.coreService.triggerDataEvent(W.key,!0),!this.optionsService.rawOptions.screenReaderMode||R.altKey||R.ctrlKey?this.cancel(R,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(R,j){const W=R.isMac&&!this.options.macOptionIsMeta&&j.altKey&&!j.ctrlKey&&!j.metaKey||R.isWindows&&j.altKey&&j.ctrlKey&&!j.metaKey||R.isWindows&&j.getModifierState("AltGraph");return j.type==="keypress"?W:W&&(!j.keyCode||j.keyCode>47)}_keyUp(R){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(R)===!1||(function(j){return j.keyCode===16||j.keyCode===17||j.keyCode===18}(R)||this.focus(),this.updateCursorStyle(R),this._keyPressHandled=!1)}_keyPress(R){let j;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(R)===!1)return!1;if(this.cancel(R),R.charCode)j=R.charCode;else if(R.which===null||R.which===void 0)j=R.keyCode;else{if(R.which===0||R.charCode===0)return!1;j=R.which}return!(!j||(R.altKey||R.ctrlKey||R.metaKey)&&!this._isThirdLevelShift(this.browser,R)||(j=String.fromCharCode(j),this._onKey.fire({key:j,domEvent:R}),this._showCursor(),this.coreService.triggerDataEvent(j,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(R){if(R.data&&R.inputType==="insertText"&&(!R.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const j=R.data;return this.coreService.triggerDataEvent(j,!0),this.cancel(R),!0}return!1}resize(R,j){R!==this.cols||j!==this.rows?super.resize(R,j):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(R,j){var W,N;(W=this._charSizeService)===null||W===void 0||W.measure(),(N=this.viewport)===null||N===void 0||N.syncScrollArea(!0)}clear(){var R;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 j=1;j<this.rows;j++)this.buffer.lines.push(this.buffer.getBlankLine(U.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(R=this.viewport)===null||R===void 0||R.reset(),this.refresh(0,this.rows-1)}}reset(){var R,j;this.options.rows=this.rows,this.options.cols=this.cols;const W=this._customKeyEventHandler;this._setup(),super.reset(),(R=this._selectionService)===null||R===void 0||R.reset(),this._decorationService.reset(),(j=this.viewport)===null||j===void 0||j.reset(),this._customKeyEventHandler=W,this.refresh(0,this.rows-1)}clearTextureAtlas(){var R;(R=this._renderService)===null||R===void 0||R.clearTextureAtlas()}_reportFocus(){var R;!((R=this.element)===null||R===void 0)&&R.classList.contains("focus")?this.coreService.triggerDataEvent($.C0.ESC+"[I"):this.coreService.triggerDataEvent($.C0.ESC+"[O")}_reportWindowsOptions(R){if(this._renderService)switch(R){case z.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const j=this._renderService.dimensions.css.canvas.width.toFixed(0),W=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${$.C0.ESC}[4;${W};${j}t`);break;case z.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const N=this._renderService.dimensions.css.cell.width.toFixed(0),ee=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${$.C0.ESC}[6;${ee};${N}t`)}}cancel(R,j){if(this.options.cancelEvents||j)return R.preventDefault(),R.stopPropagation(),!1}}n.Terminal=X},9924:(v,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TimeBasedDebouncer=void 0,n.TimeBasedDebouncer=class{constructor(u,d=1e3){this._renderCallback=u,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(u,d,g){this._rowCount=g,u=u!==void 0?u:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d;const f=Date.now();if(f-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=f,this._innerRefresh();else if(!this._additionalRefreshRequested){const _=f-this._lastRefreshMs,C=this._debounceThresholdMS-_;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},C)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const u=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,d)}}},1680:function(v,n,u){var d=this&&this.__decorate||function(a,o,c,p){var y,x=arguments.length,k=x<3?o:p===null?p=Object.getOwnPropertyDescriptor(o,c):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(a,o,c,p);else for(var m=a.length-1;m>=0;m--)(y=a[m])&&(k=(x<3?y(k):x>3?y(o,c,k):y(o,c))||k);return x>3&&k&&Object.defineProperty(o,c,k),k},g=this&&this.__param||function(a,o){return function(c,p){o(c,p,a)}};Object.defineProperty(n,"__esModule",{value:!0}),n.Viewport=void 0;const f=u(3656),_=u(4725),C=u(8460),w=u(844),S=u(2585);let l=n.Viewport=class extends w.Disposable{constructor(a,o,c,p,y,x,k,m){super(),this._viewportElement=a,this._scrollArea=o,this._bufferService=c,this._optionsService=p,this._charSizeService=y,this._renderService=x,this._coreBrowserService=k,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 C.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,f.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(b=>this._activeBuffer=b.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(b=>this._renderDimensions=b)),this._handleThemeChange(m.colors),this.register(m.onChangeColors(b=>this._handleThemeChange(b))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(a){this._viewportElement.style.backgroundColor=a.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(a){if(a)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 o=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.css.canvas.height);this._lastRecordedBufferHeight!==o&&(this._lastRecordedBufferHeight=o,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const a=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==a&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=a),this._refreshAnimationFrame=null}syncScrollArea(a=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(a);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(a)}_handleScroll(a){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 o=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:o,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const a=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(a*(this._smoothScrollState.target-this._smoothScrollState.origin)),a<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(a,o){const c=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(o<0&&this._viewportElement.scrollTop!==0||o>0&&c<this._lastRecordedBufferHeight)||(a.cancelable&&a.preventDefault(),!1)}handleWheel(a){const o=this._getPixelsScrolled(a);return o!==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+o:this._smoothScrollState.target+=o,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=o,this._bubbleScroll(a,o))}scrollLines(a){if(a!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const o=a*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+o,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:a,suppressScrollEvent:!1})}_getPixelsScrolled(a){if(a.deltaY===0||a.shiftKey)return 0;let o=this._applyScrollModifier(a.deltaY,a);return a.deltaMode===WheelEvent.DOM_DELTA_LINE?o*=this._currentRowHeight:a.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(o*=this._currentRowHeight*this._bufferService.rows),o}getBufferElements(a,o){var c;let p,y="";const x=[],k=o??this._bufferService.buffer.lines.length,m=this._bufferService.buffer.lines;for(let b=a;b<k;b++){const D=m.get(b);if(!D)continue;const M=(c=m.get(b+1))===null||c===void 0?void 0:c.isWrapped;if(y+=D.translateToString(!M),!M||b===m.length-1){const A=document.createElement("div");A.textContent=y,x.push(A),y.length>0&&(p=A),y=""}}return{bufferElements:x,cursorElement:p}}getLinesScrolled(a){if(a.deltaY===0||a.shiftKey)return 0;let o=this._applyScrollModifier(a.deltaY,a);return a.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(o/=this._currentRowHeight+0,this._wheelPartialScroll+=o,o=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):a.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(o*=this._bufferService.rows),o}_applyScrollModifier(a,o){const c=this._optionsService.rawOptions.fastScrollModifier;return c==="alt"&&o.altKey||c==="ctrl"&&o.ctrlKey||c==="shift"&&o.shiftKey?a*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:a*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(a){this._lastTouchY=a.touches[0].pageY}handleTouchMove(a){const o=this._lastTouchY-a.touches[0].pageY;return this._lastTouchY=a.touches[0].pageY,o!==0&&(this._viewportElement.scrollTop+=o,this._bubbleScroll(a,o))}};n.Viewport=l=d([g(2,S.IBufferService),g(3,S.IOptionsService),g(4,_.ICharSizeService),g(5,_.IRenderService),g(6,_.ICoreBrowserService),g(7,_.IThemeService)],l)},3107:function(v,n,u){var d=this&&this.__decorate||function(l,a,o,c){var p,y=arguments.length,x=y<3?a:c===null?c=Object.getOwnPropertyDescriptor(a,o):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(l,a,o,c);else for(var k=l.length-1;k>=0;k--)(p=l[k])&&(x=(y<3?p(x):y>3?p(a,o,x):p(a,o))||x);return y>3&&x&&Object.defineProperty(a,o,x),x},g=this&&this.__param||function(l,a){return function(o,c){a(o,c,l)}};Object.defineProperty(n,"__esModule",{value:!0}),n.BufferDecorationRenderer=void 0;const f=u(3656),_=u(4725),C=u(844),w=u(2585);let S=n.BufferDecorationRenderer=class extends C.Disposable{constructor(l,a,o,c){super(),this._screenElement=l,this._bufferService=a,this._decorationService=o,this._renderService=c,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,f.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(p=>this._removeDecoration(p))),this.register((0,C.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 l of this._decorationService.decorations)this._renderDecoration(l);this._dimensionsChanged=!1}_renderDecoration(l){this._refreshStyle(l),this._dimensionsChanged&&this._refreshXPosition(l)}_createElement(l){var a,o;const c=document.createElement("div");c.classList.add("xterm-decoration"),c.classList.toggle("xterm-decoration-top-layer",((a=l==null?void 0:l.options)===null||a===void 0?void 0:a.layer)==="top"),c.style.width=`${Math.round((l.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,c.style.height=(l.options.height||1)*this._renderService.dimensions.css.cell.height+"px",c.style.top=(l.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",c.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const p=(o=l.options.x)!==null&&o!==void 0?o:0;return p&&p>this._bufferService.cols&&(c.style.display="none"),this._refreshXPosition(l,c),c}_refreshStyle(l){const a=l.marker.line-this._bufferService.buffers.active.ydisp;if(a<0||a>=this._bufferService.rows)l.element&&(l.element.style.display="none",l.onRenderEmitter.fire(l.element));else{let o=this._decorationElements.get(l);o||(o=this._createElement(l),l.element=o,this._decorationElements.set(l,o),this._container.appendChild(o),l.onDispose(()=>{this._decorationElements.delete(l),o.remove()})),o.style.top=a*this._renderService.dimensions.css.cell.height+"px",o.style.display=this._altBufferIsActive?"none":"block",l.onRenderEmitter.fire(o)}}_refreshXPosition(l,a=l.element){var o;if(!a)return;const c=(o=l.options.x)!==null&&o!==void 0?o:0;(l.options.anchor||"left")==="right"?a.style.right=c?c*this._renderService.dimensions.css.cell.width+"px":"":a.style.left=c?c*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(l){var a;(a=this._decorationElements.get(l))===null||a===void 0||a.remove(),this._decorationElements.delete(l),l.dispose()}};n.BufferDecorationRenderer=S=d([g(1,w.IBufferService),g(2,w.IDecorationService),g(3,_.IRenderService)],S)},5871:(v,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ColorZoneStore=void 0,n.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(u){if(u.options.overviewRulerOptions){for(const d of this._zones)if(d.color===u.options.overviewRulerOptions.color&&d.position===u.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,u.marker.line))return;if(this._lineAdjacentToZone(d,u.marker.line,u.options.overviewRulerOptions.position))return void this._addLineToZone(d,u.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=u.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=u.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=u.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=u.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:u.options.overviewRulerOptions.color,position:u.options.overviewRulerOptions.position,startBufferLine:u.marker.line,endBufferLine:u.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(u){this._linePadding=u}_lineIntersectsZone(u,d){return d>=u.startBufferLine&&d<=u.endBufferLine}_lineAdjacentToZone(u,d,g){return d>=u.startBufferLine-this._linePadding[g||"full"]&&d<=u.endBufferLine+this._linePadding[g||"full"]}_addLineToZone(u,d){u.startBufferLine=Math.min(u.startBufferLine,d),u.endBufferLine=Math.max(u.endBufferLine,d)}}},5744:function(v,n,u){var d=this&&this.__decorate||function(p,y,x,k){var m,b=arguments.length,D=b<3?y:k===null?k=Object.getOwnPropertyDescriptor(y,x):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(p,y,x,k);else for(var M=p.length-1;M>=0;M--)(m=p[M])&&(D=(b<3?m(D):b>3?m(y,x,D):m(y,x))||D);return b>3&&D&&Object.defineProperty(y,x,D),D},g=this&&this.__param||function(p,y){return function(x,k){y(x,k,p)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OverviewRulerRenderer=void 0;const f=u(5871),_=u(3656),C=u(4725),w=u(844),S=u(2585),l={full:0,left:0,center:0,right:0},a={full:0,left:0,center:0,right:0},o={full:0,left:0,center:0,right:0};let c=n.OverviewRulerRenderer=class extends w.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(p,y,x,k,m,b,D){var M;super(),this._viewportElement=p,this._screenElement=y,this._bufferService=x,this._decorationService=k,this._renderService=m,this._optionsService=b,this._coreBrowseService=D,this._colorZoneStore=new f.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,w.toDisposable)(()=>{var O;(O=this._canvas)===null||O===void 0||O.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 p=Math.floor(this._canvas.width/3),y=Math.ceil(this._canvas.width/3);a.full=this._canvas.width,a.left=p,a.center=y,a.right=p,this._refreshDrawHeightConstants(),o.full=0,o.left=0,o.center=a.left,o.right=a.left+a.center}_refreshDrawHeightConstants(){l.full=Math.round(2*this._coreBrowseService.dpr);const p=this._canvas.height/this._bufferService.buffer.lines.length,y=Math.round(Math.max(Math.min(p,12),6)*this._coreBrowseService.dpr);l.left=y,l.center=y,l.right=y}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*l.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*l.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*l.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*l.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 y of this._decorationService.decorations)this._colorZoneStore.addDecoration(y);this._ctx.lineWidth=1;const p=this._colorZoneStore.zones;for(const y of p)y.position!=="full"&&this._renderColorZone(y);for(const y of p)y.position==="full"&&this._renderColorZone(y);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(p){this._ctx.fillStyle=p.color,this._ctx.fillRect(o[p.position||"full"],Math.round((this._canvas.height-1)*(p.startBufferLine/this._bufferService.buffers.active.lines.length)-l[p.position||"full"]/2),a[p.position||"full"],Math.round((this._canvas.height-1)*((p.endBufferLine-p.startBufferLine)/this._bufferService.buffers.active.lines.length)+l[p.position||"full"]))}_queueRefresh(p,y){this._shouldUpdateDimensions=p||this._shouldUpdateDimensions,this._shouldUpdateAnchor=y||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowseService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};n.OverviewRulerRenderer=c=d([g(2,S.IBufferService),g(3,S.IDecorationService),g(4,C.IRenderService),g(5,S.IOptionsService),g(6,C.ICoreBrowserService)],c)},2950:function(v,n,u){var d=this&&this.__decorate||function(S,l,a,o){var c,p=arguments.length,y=p<3?l:o===null?o=Object.getOwnPropertyDescriptor(l,a):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(S,l,a,o);else for(var x=S.length-1;x>=0;x--)(c=S[x])&&(y=(p<3?c(y):p>3?c(l,a,y):c(l,a))||y);return p>3&&y&&Object.defineProperty(l,a,y),y},g=this&&this.__param||function(S,l){return function(a,o){l(a,o,S)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CompositionHelper=void 0;const f=u(4725),_=u(2585),C=u(2584);let w=n.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(S,l,a,o,c,p){this._textarea=S,this._compositionView=l,this._bufferService=a,this._optionsService=o,this._coreService=c,this._renderService=p,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(S){this._compositionView.textContent=S.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(S){if(this._isComposing||this._isSendingComposition){if(S.keyCode===229||S.keyCode===16||S.keyCode===17||S.keyCode===18)return!1;this._finalizeComposition(!1)}return S.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(S){if(this._compositionView.classList.remove("active"),this._isComposing=!1,S){const l={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let a;this._isSendingComposition=!1,l.start+=this._dataAlreadySent.length,a=this._isComposing?this._textarea.value.substring(l.start,l.end):this._textarea.value.substring(l.start),a.length>0&&this._coreService.triggerDataEvent(a,!0)}},0)}else{this._isSendingComposition=!1;const l=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(l,!0)}}_handleAnyTextareaChanges(){const S=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const l=this._textarea.value,a=l.replace(S,"");this._dataAlreadySent=a,l.length>S.length?this._coreService.triggerDataEvent(a,!0):l.length<S.length?this._coreService.triggerDataEvent(`${C.C0.DEL}`,!0):l.length===S.length&&l!==S&&this._coreService.triggerDataEvent(l,!0)}},0)}updateCompositionElements(S){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const l=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),a=this._renderService.dimensions.css.cell.height,o=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,c=l*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=c+"px",this._compositionView.style.top=o+"px",this._compositionView.style.height=a+"px",this._compositionView.style.lineHeight=a+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const p=this._compositionView.getBoundingClientRect();this._textarea.style.left=c+"px",this._textarea.style.top=o+"px",this._textarea.style.width=Math.max(p.width,1)+"px",this._textarea.style.height=Math.max(p.height,1)+"px",this._textarea.style.lineHeight=p.height+"px"}S||setTimeout(()=>this.updateCompositionElements(!0),0)}}};n.CompositionHelper=w=d([g(2,_.IBufferService),g(3,_.IOptionsService),g(4,_.ICoreService),g(5,f.IRenderService)],w)},9806:(v,n)=>{function u(d,g,f){const _=f.getBoundingClientRect(),C=d.getComputedStyle(f),w=parseInt(C.getPropertyValue("padding-left")),S=parseInt(C.getPropertyValue("padding-top"));return[g.clientX-_.left-w,g.clientY-_.top-S]}Object.defineProperty(n,"__esModule",{value:!0}),n.getCoords=n.getCoordsRelativeToElement=void 0,n.getCoordsRelativeToElement=u,n.getCoords=function(d,g,f,_,C,w,S,l,a){if(!w)return;const o=u(d,g,f);return o?(o[0]=Math.ceil((o[0]+(a?S/2:0))/S),o[1]=Math.ceil(o[1]/l),o[0]=Math.min(Math.max(o[0],1),_+(a?1:0)),o[1]=Math.min(Math.max(o[1],1),C),o):void 0}},9504:(v,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.moveToCellSequence=void 0;const d=u(2584);function g(l,a,o,c){const p=l-f(l,o),y=a-f(a,o),x=Math.abs(p-y)-function(k,m,b){let D=0;const M=k-f(k,b),A=m-f(m,b);for(let O=0;O<Math.abs(M-A);O++){const F=_(k,m)==="A"?-1:1,H=b.buffer.lines.get(M+F*O);H!=null&&H.isWrapped&&D++}return D}(l,a,o);return S(x,w(_(l,a),c))}function f(l,a){let o=0,c=a.buffer.lines.get(l),p=c==null?void 0:c.isWrapped;for(;p&&l>=0&&l<a.rows;)o++,c=a.buffer.lines.get(--l),p=c==null?void 0:c.isWrapped;return o}function _(l,a){return l>a?"A":"B"}function C(l,a,o,c,p,y){let x=l,k=a,m="";for(;x!==o||k!==c;)x+=p?1:-1,p&&x>y.cols-1?(m+=y.buffer.translateBufferLineToString(k,!1,l,x),x=0,l=0,k++):!p&&x<0&&(m+=y.buffer.translateBufferLineToString(k,!1,0,l+1),x=y.cols-1,l=x,k--);return m+y.buffer.translateBufferLineToString(k,!1,l,x)}function w(l,a){const o=a?"O":"[";return d.C0.ESC+o+l}function S(l,a){l=Math.floor(l);let o="";for(let c=0;c<l;c++)o+=a;return o}n.moveToCellSequence=function(l,a,o,c){const p=o.buffer.x,y=o.buffer.y;if(!o.buffer.hasScrollback)return function(m,b,D,M,A,O){return g(b,M,A,O).length===0?"":S(C(m,b,m,b-f(b,A),!1,A).length,w("D",O))}(p,y,0,a,o,c)+g(y,a,o,c)+function(m,b,D,M,A,O){let F;F=g(b,M,A,O).length>0?M-f(M,A):b;const H=M,U=function($,E,T,P,B,z){let V;return V=g(T,P,B,z).length>0?P-f(P,B):E,$<T&&V<=P||$>=T&&V<P?"C":"D"}(m,b,D,M,A,O);return S(C(m,F,D,H,U==="C",A).length,w(U,O))}(p,y,l,a,o,c);let x;if(y===a)return x=p>l?"D":"C",S(Math.abs(p-l),w(x,c));x=y>a?"D":"C";const k=Math.abs(y-a);return S(function(m,b){return b.cols-m}(y>a?l:p,o)+(k-1)*o.cols+1+((y>a?p:l)-1),w(x,c))}},1296:function(v,n,u){var d=this&&this.__decorate||function(A,O,F,H){var U,$=arguments.length,E=$<3?O:H===null?H=Object.getOwnPropertyDescriptor(O,F):H;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(A,O,F,H);else for(var T=A.length-1;T>=0;T--)(U=A[T])&&(E=($<3?U(E):$>3?U(O,F,E):U(O,F))||E);return $>3&&E&&Object.defineProperty(O,F,E),E},g=this&&this.__param||function(A,O){return function(F,H){O(F,H,A)}};Object.defineProperty(n,"__esModule",{value:!0}),n.DomRenderer=void 0;const f=u(3787),_=u(2550),C=u(2223),w=u(6171),S=u(4725),l=u(8055),a=u(8460),o=u(844),c=u(2585),p="xterm-dom-renderer-owner-",y="xterm-rows",x="xterm-fg-",k="xterm-bg-",m="xterm-focus",b="xterm-selection";let D=1,M=n.DomRenderer=class extends o.Disposable{constructor(A,O,F,H,U,$,E,T,P,B){super(),this._element=A,this._screenElement=O,this._viewportElement=F,this._linkifier2=H,this._charSizeService=$,this._optionsService=E,this._bufferService=T,this._coreBrowserService=P,this._themeService=B,this._terminalClass=D++,this._rowElements=[],this.onRequestRedraw=this.register(new a.EventEmitter).event,this._rowContainer=document.createElement("div"),this._rowContainer.classList.add(y),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(b),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,w.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(z=>this._injectCss(z))),this._injectCss(this._themeService.colors),this._rowFactory=U.createInstance(f.DomRendererRowFactory,document),this._element.classList.add(p+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(z=>this._handleLinkHover(z))),this.register(this._linkifier2.onHideLinkUnderline(z=>this._handleLinkLeave(z))),this.register((0,o.toDisposable)(()=>{this._element.classList.remove(p+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 F of this._rowElements)F.style.width=`${this.dimensions.css.canvas.width}px`,F.style.height=`${this.dimensions.css.cell.height}px`,F.style.lineHeight=`${this.dimensions.css.cell.height}px`,F.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const O=`${this._terminalSelector} .${y} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=O,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 O=`${this._terminalSelector} .${y} { color: ${A.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;O+=`${this._terminalSelector} .${y} .xterm-dim { color: ${l.color.multiplyOpacity(A.foreground,.5).css};}`,O+=`${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;}`,O+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { border-bottom-style: hidden; }}",O+="@keyframes blink_block_"+this._terminalClass+` { 0% { background-color: ${A.cursor.css}; color: ${A.cursorAccent.css}; } 50% { background-color: inherit; color: ${A.cursor.css}; }}`,O+=`${this._terminalSelector} .${y}.${m} .xterm-cursor.xterm-cursor-blink:not(.xterm-cursor-block) { animation: blink_box_shadow_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${y}.${m} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: blink_block_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-block { background-color: ${A.cursor.css}; color: ${A.cursorAccent.css};}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${A.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${A.cursor.css} inset;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${A.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,O+=`${this._terminalSelector} .${b} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${b} div { position: absolute; background-color: ${A.selectionBackgroundOpaque.css};}${this._terminalSelector} .${b} div { position: absolute; background-color: ${A.selectionInactiveBackgroundOpaque.css};}`;for(const[F,H]of A.ansi.entries())O+=`${this._terminalSelector} .${x}${F} { color: ${H.css}; }${this._terminalSelector} .${x}${F}.xterm-dim { color: ${l.color.multiplyOpacity(H,.5).css}; }${this._terminalSelector} .${k}${F} { background-color: ${H.css}; }`;O+=`${this._terminalSelector} .${x}${C.INVERTED_DEFAULT_COLOR} { color: ${l.color.opaque(A.background).css}; }${this._terminalSelector} .${x}${C.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${l.color.multiplyOpacity(l.color.opaque(A.background),.5).css}; }${this._terminalSelector} .${k}${C.INVERTED_DEFAULT_COLOR} { background-color: ${A.foreground.css}; }`,this._themeStyleElement.textContent=O}_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,O){for(let F=this._rowElements.length;F<=O;F++){const H=document.createElement("div");this._rowContainer.appendChild(H),this._rowElements.push(H)}for(;this._rowElements.length>O;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(A,O){this._refreshRowElements(A,O),this._updateDimensions()}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(m)}handleFocus(){this._rowContainer.classList.add(m),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(A,O,F){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(A,O,F),this.renderRows(0,this._bufferService.rows-1),!A||!O)return;const H=A[1]-this._bufferService.buffer.ydisp,U=O[1]-this._bufferService.buffer.ydisp,$=Math.max(H,0),E=Math.min(U,this._bufferService.rows-1);if($>=this._bufferService.rows||E<0)return;const T=document.createDocumentFragment();if(F){const P=A[0]>O[0];T.appendChild(this._createSelectionElement($,P?O[0]:A[0],P?A[0]:O[0],E-$+1))}else{const P=H===$?A[0]:0,B=$===U?O[0]:this._bufferService.cols;T.appendChild(this._createSelectionElement($,P,B));const z=E-$-1;if(T.appendChild(this._createSelectionElement($+1,0,this._bufferService.cols,z)),$!==E){const V=U===E?O[0]:this._bufferService.cols;T.appendChild(this._createSelectionElement(E,0,V))}}this._selectionContainer.appendChild(T)}_createSelectionElement(A,O,F,H=1){const U=document.createElement("div");return U.style.height=H*this.dimensions.css.cell.height+"px",U.style.top=A*this.dimensions.css.cell.height+"px",U.style.left=O*this.dimensions.css.cell.width+"px",U.style.width=this.dimensions.css.cell.width*(F-O)+"px",U}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,O){const F=this._bufferService.buffer,H=F.ybase+F.y,U=Math.min(F.x,this._bufferService.cols-1),$=this._optionsService.rawOptions.cursorBlink,E=this._optionsService.rawOptions.cursorStyle,T=this._optionsService.rawOptions.cursorInactiveStyle;for(let P=A;P<=O;P++){const B=P+F.ydisp,z=this._rowElements[P],V=F.lines.get(B);if(!z||!V)break;z.replaceChildren(...this._rowFactory.createRow(V,B,B===H,E,T,U,$,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${p}${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,O,F,H,U,$){F<0&&(A=0),H<0&&(O=0);const E=this._bufferService.rows-1;F=Math.max(Math.min(F,E),0),H=Math.max(Math.min(H,E),0),U=Math.min(U,this._bufferService.cols);const T=this._bufferService.buffer,P=T.ybase+T.y,B=Math.min(T.x,U-1),z=this._optionsService.rawOptions.cursorBlink,V=this._optionsService.rawOptions.cursorStyle,Y=this._optionsService.rawOptions.cursorInactiveStyle;for(let X=F;X<=H;++X){const oe=X+T.ydisp,R=this._rowElements[X],j=T.lines.get(oe);if(!R||!j)break;R.replaceChildren(...this._rowFactory.createRow(j,oe,oe===P,V,Y,B,z,this.dimensions.css.cell.width,this._widthCache,$?X===F?A:0:-1,$?(X===H?O:U)-1:-1))}}};n.DomRenderer=M=d([g(4,c.IInstantiationService),g(5,S.ICharSizeService),g(6,c.IOptionsService),g(7,c.IBufferService),g(8,S.ICoreBrowserService),g(9,S.IThemeService)],M)},3787:function(v,n,u){var d=this&&this.__decorate||function(x,k,m,b){var D,M=arguments.length,A=M<3?k:b===null?b=Object.getOwnPropertyDescriptor(k,m):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(x,k,m,b);else for(var O=x.length-1;O>=0;O--)(D=x[O])&&(A=(M<3?D(A):M>3?D(k,m,A):D(k,m))||A);return M>3&&A&&Object.defineProperty(k,m,A),A},g=this&&this.__param||function(x,k){return function(m,b){k(m,b,x)}};Object.defineProperty(n,"__esModule",{value:!0}),n.DomRendererRowFactory=void 0;const f=u(2223),_=u(643),C=u(511),w=u(2585),S=u(8055),l=u(4725),a=u(4269),o=u(6171),c=u(3734);let p=n.DomRendererRowFactory=class{constructor(x,k,m,b,D,M,A){this._document=x,this._characterJoinerService=k,this._optionsService=m,this._coreBrowserService=b,this._coreService=D,this._decorationService=M,this._themeService=A,this._workCell=new C.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(x,k,m){this._selectionStart=x,this._selectionEnd=k,this._columnSelectMode=m}createRow(x,k,m,b,D,M,A,O,F,H,U){const $=[],E=this._characterJoinerService.getJoinedCharacters(k),T=this._themeService.colors;let P,B=x.getNoBgTrimmedLength();m&&B<M+1&&(B=M+1);let z=0,V="",Y=0,X=0,oe=0,R=!1,j=0,W=!1,N=0;const ee=[],G=H!==-1&&U!==-1;for(let le=0;le<B;le++){x.loadCell(le,this._workCell);let Re=this._workCell.getWidth();if(Re===0)continue;let We=!1,Vr=le,te=this._workCell;if(E.length>0&&le===E[0][0]){We=!0;const pe=E.shift();te=new a.JoinedCellData(this._workCell,x.translateToString(!0,pe[0],pe[1]),pe[1]-pe[0]),Vr=pe[1]-1,Re=te.getWidth()}const Fi=this._isCellInSelection(le,k),po=m&&le===M,_o=G&&le>=H&&le<=U;let vo=!1;this._decorationService.forEachDecorationAtCell(le,k,void 0,pe=>{vo=!0});let Ws=te.getChars()||_.WHITESPACE_CELL_CHAR;if(Ws===" "&&(te.isUnderline()||te.isOverline())&&(Ws=" "),N=Re*O-F.get(Ws,te.isBold(),te.isItalic()),P){if(z&&(Fi&&W||!Fi&&!W&&te.bg===Y)&&(Fi&&W&&T.selectionForeground||te.fg===X)&&te.extended.ext===oe&&_o===R&&N===j&&!po&&!We&&!vo){V+=Ws,z++;continue}z&&(P.textContent=V),P=this._document.createElement("span"),z=0,V=""}else P=this._document.createElement("span");if(Y=te.bg,X=te.fg,oe=te.extended.ext,R=_o,j=N,W=Fi,We&&M>=le&&M<=Vr&&(M=le),!this._coreService.isCursorHidden&&po){if(ee.push("xterm-cursor"),this._coreBrowserService.isFocused)A&&ee.push("xterm-cursor-blink"),ee.push(b==="bar"?"xterm-cursor-bar":b==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(D)switch(D){case"outline":ee.push("xterm-cursor-outline");break;case"block":ee.push("xterm-cursor-block");break;case"bar":ee.push("xterm-cursor-bar");break;case"underline":ee.push("xterm-cursor-underline")}}if(te.isBold()&&ee.push("xterm-bold"),te.isItalic()&&ee.push("xterm-italic"),te.isDim()&&ee.push("xterm-dim"),V=te.isInvisible()?_.WHITESPACE_CELL_CHAR:te.getChars()||_.WHITESPACE_CELL_CHAR,te.isUnderline()&&(ee.push(`xterm-underline-${te.extended.underlineStyle}`),V===" "&&(V=" "),!te.isUnderlineColorDefault()))if(te.isUnderlineColorRGB())P.style.textDecorationColor=`rgb(${c.AttributeData.toColorRGB(te.getUnderlineColor()).join(",")})`;else{let pe=te.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&te.isBold()&&pe<8&&(pe+=8),P.style.textDecorationColor=T.ansi[pe].css}te.isOverline()&&(ee.push("xterm-overline"),V===" "&&(V=" ")),te.isStrikethrough()&&ee.push("xterm-strikethrough"),_o&&(P.style.textDecoration="underline");let ot=te.getFgColor(),Hi=te.getFgColorMode(),wt=te.getBgColor(),Ni=te.getBgColorMode();const go=!!te.isInverse();if(go){const pe=ot;ot=wt,wt=pe;const Af=Hi;Hi=Ni,Ni=Af}let $t,mo,Kt,zi=!1;switch(this._decorationService.forEachDecorationAtCell(le,k,void 0,pe=>{pe.options.layer!=="top"&&zi||(pe.backgroundColorRGB&&(Ni=50331648,wt=pe.backgroundColorRGB.rgba>>8&16777215,$t=pe.backgroundColorRGB),pe.foregroundColorRGB&&(Hi=50331648,ot=pe.foregroundColorRGB.rgba>>8&16777215,mo=pe.foregroundColorRGB),zi=pe.options.layer==="top")}),!zi&&Fi&&($t=this._coreBrowserService.isFocused?T.selectionBackgroundOpaque:T.selectionInactiveBackgroundOpaque,wt=$t.rgba>>8&16777215,Ni=50331648,zi=!0,T.selectionForeground&&(Hi=50331648,ot=T.selectionForeground.rgba>>8&16777215,mo=T.selectionForeground)),zi&&ee.push("xterm-decoration-top"),Ni){case 16777216:case 33554432:Kt=T.ansi[wt],ee.push(`xterm-bg-${wt}`);break;case 50331648:Kt=S.rgba.toColor(wt>>16,wt>>8&255,255&wt),this._addStyle(P,`background-color:#${y((wt>>>0).toString(16),"0",6)}`);break;default:go?(Kt=T.foreground,ee.push(`xterm-bg-${f.INVERTED_DEFAULT_COLOR}`)):Kt=T.background}switch($t||te.isDim()&&($t=S.color.multiplyOpacity(Kt,.5)),Hi){case 16777216:case 33554432:te.isBold()&&ot<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ot+=8),this._applyMinimumContrast(P,Kt,T.ansi[ot],te,$t,void 0)||ee.push(`xterm-fg-${ot}`);break;case 50331648:const pe=S.rgba.toColor(ot>>16&255,ot>>8&255,255&ot);this._applyMinimumContrast(P,Kt,pe,te,$t,mo)||this._addStyle(P,`color:#${y(ot.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(P,Kt,T.foreground,te,$t,void 0)||go&&ee.push(`xterm-fg-${f.INVERTED_DEFAULT_COLOR}`)}ee.length&&(P.className=ee.join(" "),ee.length=0),po||We||vo?P.textContent=V:z++,N!==this.defaultSpacing&&(P.style.letterSpacing=`${N}px`),$.push(P),le=Vr}return P&&z&&(P.textContent=V),$}_applyMinimumContrast(x,k,m,b,D,M){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,o.excludeFromContrastRatioDemands)(b.getCode()))return!1;const A=this._getContrastCache(b);let O;if(D||M||(O=A.getColor(k.rgba,m.rgba)),O===void 0){const F=this._optionsService.rawOptions.minimumContrastRatio/(b.isDim()?2:1);O=S.color.ensureContrastRatio(D||k,M||m,F),A.setColor((D||k).rgba,(M||m).rgba,O??null)}return!!O&&(this._addStyle(x,`color:${O.css}`),!0)}_getContrastCache(x){return x.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(x,k){x.setAttribute("style",`${x.getAttribute("style")||""}${k};`)}_isCellInSelection(x,k){const m=this._selectionStart,b=this._selectionEnd;return!(!m||!b)&&(this._columnSelectMode?m[0]<=b[0]?x>=m[0]&&k>=m[1]&&x<b[0]&&k<=b[1]:x<m[0]&&k>=m[1]&&x>=b[0]&&k<=b[1]:k>m[1]&&k<b[1]||m[1]===b[1]&&k===m[1]&&x>=m[0]&&x<b[0]||m[1]<b[1]&&k===b[1]&&x<b[0]||m[1]<b[1]&&k===m[1]&&x>=m[0])}};function y(x,k,m){for(;x.length<m;)x=k+x;return x}n.DomRendererRowFactory=p=d([g(1,l.ICharacterJoinerService),g(2,w.IOptionsService),g(3,l.ICoreBrowserService),g(4,w.ICoreService),g(5,w.IDecorationService),g(6,l.IThemeService)],p)},2550:(v,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WidthCache=void 0,n.WidthCache=class{constructor(u){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=u.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 d=u.createElement("span"),g=u.createElement("span");g.style.fontWeight="bold";const f=u.createElement("span");f.style.fontStyle="italic";const _=u.createElement("span");_.style.fontWeight="bold",_.style.fontStyle="italic",this._measureElements=[d,g,f,_],this._container.appendChild(d),this._container.appendChild(g),this._container.appendChild(f),this._container.appendChild(_),u.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(u,d,g,f){u===this._font&&d===this._fontSize&&g===this._weight&&f===this._weightBold||(this._font=u,this._fontSize=d,this._weight=g,this._weightBold=f,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${g}`,this._measureElements[1].style.fontWeight=`${f}`,this._measureElements[2].style.fontWeight=`${g}`,this._measureElements[3].style.fontWeight=`${f}`,this.clear())}get(u,d,g){let f=0;if(!d&&!g&&u.length===1&&(f=u.charCodeAt(0))<256)return this._flat[f]!==-9999?this._flat[f]:this._flat[f]=this._measure(u,0);let _=u;d&&(_+="B"),g&&(_+="I");let C=this._holey.get(_);if(C===void 0){let w=0;d&&(w|=1),g&&(w|=2),C=this._measure(u,w),this._holey.set(_,C)}return C}_measure(u,d){const g=this._measureElements[d];return g.textContent=u.repeat(32),g.offsetWidth/32}}},2223:(v,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TEXT_BASELINE=n.DIM_OPACITY=n.INVERTED_DEFAULT_COLOR=void 0;const d=u(6114);n.INVERTED_DEFAULT_COLOR=257,n.DIM_OPACITY=.5,n.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(v,n)=>{function u(d){return 57508<=d&&d<=57558}Object.defineProperty(n,"__esModule",{value:!0}),n.createRenderDimensions=n.excludeFromContrastRatioDemands=n.isRestrictedPowerlineGlyph=n.isPowerlineGlyph=n.throwIfFalsy=void 0,n.throwIfFalsy=function(d){if(!d)throw new Error("value must not be falsy");return d},n.isPowerlineGlyph=u,n.isRestrictedPowerlineGlyph=function(d){return 57520<=d&&d<=57527},n.excludeFromContrastRatioDemands=function(d){return u(d)||function(g){return 9472<=g&&g<=9631}(d)},n.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:(v,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SelectionModel=void 0,n.SelectionModel=class{constructor(u){this._bufferService=u,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 u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?u%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)-1]:[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[u,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[Math.max(u,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const u=this.selectionStart,d=this.selectionEnd;return!(!u||!d)&&(u[1]>d[1]||u[1]===d[1]&&u[0]>d[0])}handleTrim(u){return this.selectionStart&&(this.selectionStart[1]-=u),this.selectionEnd&&(this.selectionEnd[1]-=u),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(v,n,u){var d=this&&this.__decorate||function(l,a,o,c){var p,y=arguments.length,x=y<3?a:c===null?c=Object.getOwnPropertyDescriptor(a,o):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(l,a,o,c);else for(var k=l.length-1;k>=0;k--)(p=l[k])&&(x=(y<3?p(x):y>3?p(a,o,x):p(a,o))||x);return y>3&&x&&Object.defineProperty(a,o,x),x},g=this&&this.__param||function(l,a){return function(o,c){a(o,c,l)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CharSizeService=void 0;const f=u(2585),_=u(8460),C=u(844);let w=n.CharSizeService=class extends C.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(l,a,o){super(),this._optionsService=o,this.width=0,this.height=0,this._onCharSizeChange=this.register(new _.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event,this._measureStrategy=new S(l,a,this._optionsService),this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const l=this._measureStrategy.measure();l.width===this.width&&l.height===this.height||(this.width=l.width,this.height=l.height,this._onCharSizeChange.fire())}};n.CharSizeService=w=d([g(2,f.IOptionsService)],w);class S{constructor(a,o,c){this._document=a,this._parentElement=o,this._optionsService=c,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 a={height:Number(this._measureElement.offsetHeight),width:Number(this._measureElement.offsetWidth)};return a.width!==0&&a.height!==0&&(this._result.width=a.width/32,this._result.height=Math.ceil(a.height)),this._result}}},4269:function(v,n,u){var d=this&&this.__decorate||function(a,o,c,p){var y,x=arguments.length,k=x<3?o:p===null?p=Object.getOwnPropertyDescriptor(o,c):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(a,o,c,p);else for(var m=a.length-1;m>=0;m--)(y=a[m])&&(k=(x<3?y(k):x>3?y(o,c,k):y(o,c))||k);return x>3&&k&&Object.defineProperty(o,c,k),k},g=this&&this.__param||function(a,o){return function(c,p){o(c,p,a)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CharacterJoinerService=n.JoinedCellData=void 0;const f=u(3734),_=u(643),C=u(511),w=u(2585);class S extends f.AttributeData{constructor(o,c,p){super(),this.content=0,this.combinedData="",this.fg=o.fg,this.bg=o.bg,this.combinedData=c,this._width=p}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(o){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.JoinedCellData=S;let l=n.CharacterJoinerService=class Lf{constructor(o){this._bufferService=o,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new C.CellData}register(o){const c={id:this._nextCharacterJoinerId++,handler:o};return this._characterJoiners.push(c),c.id}deregister(o){for(let c=0;c<this._characterJoiners.length;c++)if(this._characterJoiners[c].id===o)return this._characterJoiners.splice(c,1),!0;return!1}getJoinedCharacters(o){if(this._characterJoiners.length===0)return[];const c=this._bufferService.buffer.lines.get(o);if(!c||c.length===0)return[];const p=[],y=c.translateToString(!0);let x=0,k=0,m=0,b=c.getFg(0),D=c.getBg(0);for(let M=0;M<c.getTrimmedLength();M++)if(c.loadCell(M,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==b||this._workCell.bg!==D){if(M-x>1){const A=this._getJoinedRanges(y,m,k,c,x);for(let O=0;O<A.length;O++)p.push(A[O])}x=M,m=k,b=this._workCell.fg,D=this._workCell.bg}k+=this._workCell.getChars().length||_.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-x>1){const M=this._getJoinedRanges(y,m,k,c,x);for(let A=0;A<M.length;A++)p.push(M[A])}return p}_getJoinedRanges(o,c,p,y,x){const k=o.substring(c,p);let m=[];try{m=this._characterJoiners[0].handler(k)}catch(b){console.error(b)}for(let b=1;b<this._characterJoiners.length;b++)try{const D=this._characterJoiners[b].handler(k);for(let M=0;M<D.length;M++)Lf._mergeRanges(m,D[M])}catch(D){console.error(D)}return this._stringRangesToCellRanges(m,y,x),m}_stringRangesToCellRanges(o,c,p){let y=0,x=!1,k=0,m=o[y];if(m){for(let b=p;b<this._bufferService.cols;b++){const D=c.getWidth(b),M=c.getString(b).length||_.WHITESPACE_CELL_CHAR.length;if(D!==0){if(!x&&m[0]<=k&&(m[0]=b,x=!0),m[1]<=k){if(m[1]=b,m=o[++y],!m)break;m[0]<=k?(m[0]=b,x=!0):x=!1}k+=M}}m&&(m[1]=this._bufferService.cols)}}static _mergeRanges(o,c){let p=!1;for(let y=0;y<o.length;y++){const x=o[y];if(p){if(c[1]<=x[0])return o[y-1][1]=c[1],o;if(c[1]<=x[1])return o[y-1][1]=Math.max(c[1],x[1]),o.splice(y,1),o;o.splice(y,1),y--}else{if(c[1]<=x[0])return o.splice(y,0,c),o;if(c[1]<=x[1])return x[0]=Math.min(c[0],x[0]),o;c[0]<x[1]&&(x[0]=Math.min(c[0],x[0]),p=!0)}}return p?o[o.length-1][1]=c[1]:o.push(c),o}};n.CharacterJoinerService=l=d([g(0,w.IBufferService)],l)},5114:(v,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CoreBrowserService=void 0,n.CoreBrowserService=class{constructor(u,d){this._textarea=u,this.window=d,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(v,n,u){var d=this&&this.__decorate||function(w,S,l,a){var o,c=arguments.length,p=c<3?S:a===null?a=Object.getOwnPropertyDescriptor(S,l):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(w,S,l,a);else for(var y=w.length-1;y>=0;y--)(o=w[y])&&(p=(c<3?o(p):c>3?o(S,l,p):o(S,l))||p);return c>3&&p&&Object.defineProperty(S,l,p),p},g=this&&this.__param||function(w,S){return function(l,a){S(l,a,w)}};Object.defineProperty(n,"__esModule",{value:!0}),n.MouseService=void 0;const f=u(4725),_=u(9806);let C=n.MouseService=class{constructor(w,S){this._renderService=w,this._charSizeService=S}getCoords(w,S,l,a,o){return(0,_.getCoords)(window,w,S,l,a,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,o)}getMouseReportCoords(w,S){const l=(0,_.getCoordsRelativeToElement)(window,w,S);if(this._charSizeService.hasValidSize)return l[0]=Math.min(Math.max(l[0],0),this._renderService.dimensions.css.canvas.width-1),l[1]=Math.min(Math.max(l[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(l[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(l[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(l[0]),y:Math.floor(l[1])}}};n.MouseService=C=d([g(0,f.IRenderService),g(1,f.ICharSizeService)],C)},3230:function(v,n,u){var d=this&&this.__decorate||function(p,y,x,k){var m,b=arguments.length,D=b<3?y:k===null?k=Object.getOwnPropertyDescriptor(y,x):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(p,y,x,k);else for(var M=p.length-1;M>=0;M--)(m=p[M])&&(D=(b<3?m(D):b>3?m(y,x,D):m(y,x))||D);return b>3&&D&&Object.defineProperty(y,x,D),D},g=this&&this.__param||function(p,y){return function(x,k){y(x,k,p)}};Object.defineProperty(n,"__esModule",{value:!0}),n.RenderService=void 0;const f=u(3656),_=u(6193),C=u(5596),w=u(4725),S=u(8460),l=u(844),a=u(7226),o=u(2585);let c=n.RenderService=class extends l.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(p,y,x,k,m,b,D,M){if(super(),this._rowCount=p,this._charSizeService=k,this._renderer=this.register(new l.MutableDisposable),this._pausedResizeTask=new a.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 S.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new S.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new S.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new S.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new _.RenderDebouncer(D.window,(A,O)=>this._renderRows(A,O)),this.register(this._renderDebouncer),this._screenDprMonitor=new C.ScreenDprMonitor(D.window),this._screenDprMonitor.setListener(()=>this.handleDevicePixelRatioChange()),this.register(this._screenDprMonitor),this.register(b.onResize(()=>this._fullRefresh())),this.register(b.buffers.onBufferActivate(()=>{var A;return(A=this._renderer.value)===null||A===void 0?void 0:A.clear()})),this.register(x.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(m.onDecorationRegistered(()=>this._fullRefresh())),this.register(m.onDecorationRemoved(()=>this._fullRefresh())),this.register(x.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio"],()=>{this.clear(),this.handleResize(b.cols,b.rows),this._fullRefresh()})),this.register(x.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(b.buffer.y,b.buffer.y,!0))),this.register((0,f.addDisposableDomListener)(D.window,"resize",()=>this.handleDevicePixelRatioChange())),this.register(M.onChangeColors(()=>this._fullRefresh())),"IntersectionObserver"in D.window){const A=new D.window.IntersectionObserver(O=>this._handleIntersectionChange(O[O.length-1]),{threshold:0});A.observe(y),this.register({dispose:()=>A.disconnect()})}}_handleIntersectionChange(p){this._isPaused=p.isIntersecting===void 0?p.intersectionRatio===0:!p.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(p,y,x=!1){this._isPaused?this._needsFullRefresh=!0:(x||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(p,y,this._rowCount))}_renderRows(p,y){this._renderer.value&&(p=Math.min(p,this._rowCount-1),y=Math.min(y,this._rowCount-1),this._renderer.value.renderRows(p,y),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:p,end:y}),this._onRender.fire({start:p,end:y}),this._isNextRenderRedrawOnly=!0)}resize(p,y){this._rowCount=y,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(p){this._renderer.value=p,this._renderer.value.onRequestRedraw(y=>this.refreshRows(y.start,y.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh()}addRefreshCallback(p){return this._renderDebouncer.addRefreshCallback(p)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var p,y;this._renderer.value&&((y=(p=this._renderer.value).clearTextureAtlas)===null||y===void 0||y.call(p),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(p,y){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value.handleResize(p,y)):this._renderer.value.handleResize(p,y),this._fullRefresh())}handleCharSizeChanged(){var p;(p=this._renderer.value)===null||p===void 0||p.handleCharSizeChanged()}handleBlur(){var p;(p=this._renderer.value)===null||p===void 0||p.handleBlur()}handleFocus(){var p;(p=this._renderer.value)===null||p===void 0||p.handleFocus()}handleSelectionChanged(p,y,x){var k;this._selectionState.start=p,this._selectionState.end=y,this._selectionState.columnSelectMode=x,(k=this._renderer.value)===null||k===void 0||k.handleSelectionChanged(p,y,x)}handleCursorMove(){var p;(p=this._renderer.value)===null||p===void 0||p.handleCursorMove()}clear(){var p;(p=this._renderer.value)===null||p===void 0||p.clear()}};n.RenderService=c=d([g(2,o.IOptionsService),g(3,w.ICharSizeService),g(4,o.IDecorationService),g(5,o.IBufferService),g(6,w.ICoreBrowserService),g(7,w.IThemeService)],c)},9312:function(v,n,u){var d=this&&this.__decorate||function(m,b,D,M){var A,O=arguments.length,F=O<3?b:M===null?M=Object.getOwnPropertyDescriptor(b,D):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(m,b,D,M);else for(var H=m.length-1;H>=0;H--)(A=m[H])&&(F=(O<3?A(F):O>3?A(b,D,F):A(b,D))||F);return O>3&&F&&Object.defineProperty(b,D,F),F},g=this&&this.__param||function(m,b){return function(D,M){b(D,M,m)}};Object.defineProperty(n,"__esModule",{value:!0}),n.SelectionService=void 0;const f=u(9806),_=u(9504),C=u(456),w=u(4725),S=u(8460),l=u(844),a=u(6114),o=u(4841),c=u(511),p=u(2585),y=" ",x=new RegExp(y,"g");let k=n.SelectionService=class extends l.Disposable{constructor(m,b,D,M,A,O,F,H,U){super(),this._element=m,this._screenElement=b,this._linkifier=D,this._bufferService=M,this._coreService=A,this._mouseService=O,this._optionsService=F,this._renderService=H,this._coreBrowserService=U,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new c.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new S.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new S.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new S.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new S.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=$=>this._handleMouseMove($),this._mouseUpListener=$=>this._handleMouseUp($),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim($=>this._handleTrim($)),this.register(this._bufferService.buffers.onBufferActivate($=>this._handleBufferActivate($))),this.enable(),this._model=new C.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,l.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 m=this._model.finalSelectionStart,b=this._model.finalSelectionEnd;return!(!m||!b||m[0]===b[0]&&m[1]===b[1])}get selectionText(){const m=this._model.finalSelectionStart,b=this._model.finalSelectionEnd;if(!m||!b)return"";const D=this._bufferService.buffer,M=[];if(this._activeSelectionMode===3){if(m[0]===b[0])return"";const A=m[0]<b[0]?m[0]:b[0],O=m[0]<b[0]?b[0]:m[0];for(let F=m[1];F<=b[1];F++){const H=D.translateBufferLineToString(F,!0,A,O);M.push(H)}}else{const A=m[1]===b[1]?b[0]:void 0;M.push(D.translateBufferLineToString(m[1],!0,m[0],A));for(let O=m[1]+1;O<=b[1]-1;O++){const F=D.lines.get(O),H=D.translateBufferLineToString(O,!0);F!=null&&F.isWrapped?M[M.length-1]+=H:M.push(H)}if(m[1]!==b[1]){const O=D.lines.get(b[1]),F=D.translateBufferLineToString(b[1],!0,0,b[0]);O&&O.isWrapped?M[M.length-1]+=F:M.push(F)}}return M.map(A=>A.replace(x," ")).join(a.isWindows?`\r
53
+ `:`
54
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(m){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),a.isLinux&&m&&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(m){const b=this._getMouseBufferCoords(m),D=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!!(D&&M&&b)&&this._areCoordsInSelection(b,D,M)}isCellInSelection(m,b){const D=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!(!D||!M)&&this._areCoordsInSelection([m,b],D,M)}_areCoordsInSelection(m,b,D){return m[1]>b[1]&&m[1]<D[1]||b[1]===D[1]&&m[1]===b[1]&&m[0]>=b[0]&&m[0]<D[0]||b[1]<D[1]&&m[1]===D[1]&&m[0]<D[0]||b[1]<D[1]&&m[1]===b[1]&&m[0]>=b[0]}_selectWordAtCursor(m,b){var D,M;const A=(M=(D=this._linkifier.currentLink)===null||D===void 0?void 0:D.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,o.getRangeLength)(A,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const O=this._getMouseBufferCoords(m);return!!O&&(this._selectWordAt(O,b),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(m,b){this._model.clearSelection(),m=Math.max(m,0),b=Math.min(b,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,m],this._model.selectionEnd=[this._bufferService.cols,b],this.refresh(),this._onSelectionChange.fire()}_handleTrim(m){this._model.handleTrim(m)&&this.refresh()}_getMouseBufferCoords(m){const b=this._mouseService.getCoords(m,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(b)return b[0]--,b[1]--,b[1]+=this._bufferService.buffer.ydisp,b}_getMouseEventScrollAmount(m){let b=(0,f.getCoordsRelativeToElement)(this._coreBrowserService.window,m,this._screenElement)[1];const D=this._renderService.dimensions.css.canvas.height;return b>=0&&b<=D?0:(b>D&&(b-=D),b=Math.min(Math.max(b,-50),50),b/=50,b/Math.abs(b)+Math.round(14*b))}shouldForceSelection(m){return a.isMac?m.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:m.shiftKey}handleMouseDown(m){if(this._mouseDownTimeStamp=m.timeStamp,(m.button!==2||!this.hasSelection)&&m.button===0){if(!this._enabled){if(!this.shouldForceSelection(m))return;m.stopPropagation()}m.preventDefault(),this._dragScrollAmount=0,this._enabled&&m.shiftKey?this._handleIncrementalClick(m):m.detail===1?this._handleSingleClick(m):m.detail===2?this._handleDoubleClick(m):m.detail===3&&this._handleTripleClick(m),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(m){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(m))}_handleSingleClick(m){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(m)?3:0,this._model.selectionStart=this._getMouseBufferCoords(m),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const b=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);b&&b.length!==this._model.selectionStart[0]&&b.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(m){this._selectWordAtCursor(m,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(m){const b=this._getMouseBufferCoords(m);b&&(this._activeSelectionMode=2,this._selectLineAt(b[1]))}shouldColumnSelect(m){return m.altKey&&!(a.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(m){if(m.stopImmediatePropagation(),!this._model.selectionStart)return;const b=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(m),!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(m),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const D=this._bufferService.buffer;if(this._model.selectionEnd[1]<D.lines.length){const M=D.lines.get(this._model.selectionEnd[1]);M&&M.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]++}b&&b[0]===this._model.selectionEnd[0]&&b[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 m=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(m.ydisp+this._bufferService.rows,m.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=m.ydisp),this.refresh()}}_handleMouseUp(m){const b=m.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&b<500&&m.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const D=this._mouseService.getCoords(m,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(D&&D[0]!==void 0&&D[1]!==void 0){const M=(0,_.moveToCellSequence)(D[0]-1,D[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(M,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const m=this._model.finalSelectionStart,b=this._model.finalSelectionEnd,D=!(!m||!b||m[0]===b[0]&&m[1]===b[1]);D?m&&b&&(this._oldSelectionStart&&this._oldSelectionEnd&&m[0]===this._oldSelectionStart[0]&&m[1]===this._oldSelectionStart[1]&&b[0]===this._oldSelectionEnd[0]&&b[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(m,b,D)):this._oldHasSelection&&this._fireOnSelectionChange(m,b,D)}_fireOnSelectionChange(m,b,D){this._oldSelectionStart=m,this._oldSelectionEnd=b,this._oldHasSelection=D,this._onSelectionChange.fire()}_handleBufferActivate(m){this.clearSelection(),this._trimListener.dispose(),this._trimListener=m.activeBuffer.lines.onTrim(b=>this._handleTrim(b))}_convertViewportColToCharacterIndex(m,b){let D=b;for(let M=0;b>=M;M++){const A=m.loadCell(M,this._workCell).getChars().length;this._workCell.getWidth()===0?D--:A>1&&b!==M&&(D+=A-1)}return D}setSelection(m,b,D){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[m,b],this._model.selectionStartLength=D,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(m){this._isClickInSelection(m)||(this._selectWordAtCursor(m,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(m,b,D=!0,M=!0){if(m[0]>=this._bufferService.cols)return;const A=this._bufferService.buffer,O=A.lines.get(m[1]);if(!O)return;const F=A.translateBufferLineToString(m[1],!1);let H=this._convertViewportColToCharacterIndex(O,m[0]),U=H;const $=m[0]-H;let E=0,T=0,P=0,B=0;if(F.charAt(H)===" "){for(;H>0&&F.charAt(H-1)===" ";)H--;for(;U<F.length&&F.charAt(U+1)===" ";)U++}else{let Y=m[0],X=m[0];O.getWidth(Y)===0&&(E++,Y--),O.getWidth(X)===2&&(T++,X++);const oe=O.getString(X).length;for(oe>1&&(B+=oe-1,U+=oe-1);Y>0&&H>0&&!this._isCharWordSeparator(O.loadCell(Y-1,this._workCell));){O.loadCell(Y-1,this._workCell);const R=this._workCell.getChars().length;this._workCell.getWidth()===0?(E++,Y--):R>1&&(P+=R-1,H-=R-1),H--,Y--}for(;X<O.length&&U+1<F.length&&!this._isCharWordSeparator(O.loadCell(X+1,this._workCell));){O.loadCell(X+1,this._workCell);const R=this._workCell.getChars().length;this._workCell.getWidth()===2?(T++,X++):R>1&&(B+=R-1,U+=R-1),U++,X++}}U++;let z=H+$-E+P,V=Math.min(this._bufferService.cols,U-H+E+T-P-B);if(b||F.slice(H,U).trim()!==""){if(D&&z===0&&O.getCodePoint(0)!==32){const Y=A.lines.get(m[1]-1);if(Y&&O.isWrapped&&Y.getCodePoint(this._bufferService.cols-1)!==32){const X=this._getWordAt([this._bufferService.cols-1,m[1]-1],!1,!0,!1);if(X){const oe=this._bufferService.cols-X.start;z-=oe,V+=oe}}}if(M&&z+V===this._bufferService.cols&&O.getCodePoint(this._bufferService.cols-1)!==32){const Y=A.lines.get(m[1]+1);if(Y!=null&&Y.isWrapped&&Y.getCodePoint(0)!==32){const X=this._getWordAt([0,m[1]+1],!1,!1,!0);X&&(V+=X.length)}}return{start:z,length:V}}}_selectWordAt(m,b){const D=this._getWordAt(m,b);if(D){for(;D.start<0;)D.start+=this._bufferService.cols,m[1]--;this._model.selectionStart=[D.start,m[1]],this._model.selectionStartLength=D.length}}_selectToWordAt(m){const b=this._getWordAt(m,!0);if(b){let D=m[1];for(;b.start<0;)b.start+=this._bufferService.cols,D--;if(!this._model.areSelectionValuesReversed())for(;b.start+b.length>this._bufferService.cols;)b.length-=this._bufferService.cols,D++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?b.start:b.start+b.length,D]}}_isCharWordSeparator(m){return m.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(m.getChars())>=0}_selectLineAt(m){const b=this._bufferService.buffer.getWrappedRangeForLine(m),D={start:{x:0,y:b.first},end:{x:this._bufferService.cols-1,y:b.last}};this._model.selectionStart=[0,b.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,o.getRangeLength)(D,this._bufferService.cols)}};n.SelectionService=k=d([g(3,p.IBufferService),g(4,p.ICoreService),g(5,w.IMouseService),g(6,p.IOptionsService),g(7,w.IRenderService),g(8,w.ICoreBrowserService)],k)},4725:(v,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.IThemeService=n.ICharacterJoinerService=n.ISelectionService=n.IRenderService=n.IMouseService=n.ICoreBrowserService=n.ICharSizeService=void 0;const d=u(8343);n.ICharSizeService=(0,d.createDecorator)("CharSizeService"),n.ICoreBrowserService=(0,d.createDecorator)("CoreBrowserService"),n.IMouseService=(0,d.createDecorator)("MouseService"),n.IRenderService=(0,d.createDecorator)("RenderService"),n.ISelectionService=(0,d.createDecorator)("SelectionService"),n.ICharacterJoinerService=(0,d.createDecorator)("CharacterJoinerService"),n.IThemeService=(0,d.createDecorator)("ThemeService")},6731:function(v,n,u){var d=this&&this.__decorate||function(k,m,b,D){var M,A=arguments.length,O=A<3?m:D===null?D=Object.getOwnPropertyDescriptor(m,b):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(k,m,b,D);else for(var F=k.length-1;F>=0;F--)(M=k[F])&&(O=(A<3?M(O):A>3?M(m,b,O):M(m,b))||O);return A>3&&O&&Object.defineProperty(m,b,O),O},g=this&&this.__param||function(k,m){return function(b,D){m(b,D,k)}};Object.defineProperty(n,"__esModule",{value:!0}),n.ThemeService=n.DEFAULT_ANSI_COLORS=void 0;const f=u(7239),_=u(8055),C=u(8460),w=u(844),S=u(2585),l=_.css.toColor("#ffffff"),a=_.css.toColor("#000000"),o=_.css.toColor("#ffffff"),c=_.css.toColor("#000000"),p={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};n.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const k=[_.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")],m=[0,95,135,175,215,255];for(let b=0;b<216;b++){const D=m[b/36%6|0],M=m[b/6%6|0],A=m[b%6];k.push({css:_.channels.toCss(D,M,A),rgba:_.channels.toRgba(D,M,A)})}for(let b=0;b<24;b++){const D=8+10*b;k.push({css:_.channels.toCss(D,D,D),rgba:_.channels.toRgba(D,D,D)})}return k})());let y=n.ThemeService=class extends w.Disposable{get colors(){return this._colors}constructor(k){super(),this._optionsService=k,this._contrastCache=new f.ColorContrastCache,this._halfContrastCache=new f.ColorContrastCache,this._onChangeColors=this.register(new C.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:l,background:a,cursor:o,cursorAccent:c,selectionForeground:void 0,selectionBackgroundTransparent:p,selectionBackgroundOpaque:_.color.blend(a,p),selectionInactiveBackgroundTransparent:p,selectionInactiveBackgroundOpaque:_.color.blend(a,p),ansi:n.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(k={}){const m=this._colors;if(m.foreground=x(k.foreground,l),m.background=x(k.background,a),m.cursor=x(k.cursor,o),m.cursorAccent=x(k.cursorAccent,c),m.selectionBackgroundTransparent=x(k.selectionBackground,p),m.selectionBackgroundOpaque=_.color.blend(m.background,m.selectionBackgroundTransparent),m.selectionInactiveBackgroundTransparent=x(k.selectionInactiveBackground,m.selectionBackgroundTransparent),m.selectionInactiveBackgroundOpaque=_.color.blend(m.background,m.selectionInactiveBackgroundTransparent),m.selectionForeground=k.selectionForeground?x(k.selectionForeground,_.NULL_COLOR):void 0,m.selectionForeground===_.NULL_COLOR&&(m.selectionForeground=void 0),_.color.isOpaque(m.selectionBackgroundTransparent)&&(m.selectionBackgroundTransparent=_.color.opacity(m.selectionBackgroundTransparent,.3)),_.color.isOpaque(m.selectionInactiveBackgroundTransparent)&&(m.selectionInactiveBackgroundTransparent=_.color.opacity(m.selectionInactiveBackgroundTransparent,.3)),m.ansi=n.DEFAULT_ANSI_COLORS.slice(),m.ansi[0]=x(k.black,n.DEFAULT_ANSI_COLORS[0]),m.ansi[1]=x(k.red,n.DEFAULT_ANSI_COLORS[1]),m.ansi[2]=x(k.green,n.DEFAULT_ANSI_COLORS[2]),m.ansi[3]=x(k.yellow,n.DEFAULT_ANSI_COLORS[3]),m.ansi[4]=x(k.blue,n.DEFAULT_ANSI_COLORS[4]),m.ansi[5]=x(k.magenta,n.DEFAULT_ANSI_COLORS[5]),m.ansi[6]=x(k.cyan,n.DEFAULT_ANSI_COLORS[6]),m.ansi[7]=x(k.white,n.DEFAULT_ANSI_COLORS[7]),m.ansi[8]=x(k.brightBlack,n.DEFAULT_ANSI_COLORS[8]),m.ansi[9]=x(k.brightRed,n.DEFAULT_ANSI_COLORS[9]),m.ansi[10]=x(k.brightGreen,n.DEFAULT_ANSI_COLORS[10]),m.ansi[11]=x(k.brightYellow,n.DEFAULT_ANSI_COLORS[11]),m.ansi[12]=x(k.brightBlue,n.DEFAULT_ANSI_COLORS[12]),m.ansi[13]=x(k.brightMagenta,n.DEFAULT_ANSI_COLORS[13]),m.ansi[14]=x(k.brightCyan,n.DEFAULT_ANSI_COLORS[14]),m.ansi[15]=x(k.brightWhite,n.DEFAULT_ANSI_COLORS[15]),k.extendedAnsi){const b=Math.min(m.ansi.length-16,k.extendedAnsi.length);for(let D=0;D<b;D++)m.ansi[D+16]=x(k.extendedAnsi[D],n.DEFAULT_ANSI_COLORS[D+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(k){this._restoreColor(k),this._onChangeColors.fire(this.colors)}_restoreColor(k){if(k!==void 0)switch(k){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[k]=this._restoreColors.ansi[k]}else for(let m=0;m<this._restoreColors.ansi.length;++m)this._colors.ansi[m]=this._restoreColors.ansi[m]}modifyColors(k){k(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 x(k,m){if(k!==void 0)try{return _.css.toColor(k)}catch{}return m}n.ThemeService=y=d([g(0,S.IOptionsService)],y)},6349:(v,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CircularList=void 0;const d=u(8460),g=u(844);class f extends g.Disposable{constructor(C){super(),this._maxLength=C,this.onDeleteEmitter=this.register(new d.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new d.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new d.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(C){if(this._maxLength===C)return;const w=new Array(C);for(let S=0;S<Math.min(C,this.length);S++)w[S]=this._array[this._getCyclicIndex(S)];this._array=w,this._maxLength=C,this._startIndex=0}get length(){return this._length}set length(C){if(C>this._length)for(let w=this._length;w<C;w++)this._array[w]=void 0;this._length=C}get(C){return this._array[this._getCyclicIndex(C)]}set(C,w){this._array[this._getCyclicIndex(C)]=w}push(C){this._array[this._getCyclicIndex(this._length)]=C,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(C,w,...S){if(w){for(let l=C;l<this._length-w;l++)this._array[this._getCyclicIndex(l)]=this._array[this._getCyclicIndex(l+w)];this._length-=w,this.onDeleteEmitter.fire({index:C,amount:w})}for(let l=this._length-1;l>=C;l--)this._array[this._getCyclicIndex(l+S.length)]=this._array[this._getCyclicIndex(l)];for(let l=0;l<S.length;l++)this._array[this._getCyclicIndex(C+l)]=S[l];if(S.length&&this.onInsertEmitter.fire({index:C,amount:S.length}),this._length+S.length>this._maxLength){const l=this._length+S.length-this._maxLength;this._startIndex+=l,this._length=this._maxLength,this.onTrimEmitter.fire(l)}else this._length+=S.length}trimStart(C){C>this._length&&(C=this._length),this._startIndex+=C,this._length-=C,this.onTrimEmitter.fire(C)}shiftElements(C,w,S){if(!(w<=0)){if(C<0||C>=this._length)throw new Error("start argument out of range");if(C+S<0)throw new Error("Cannot shift elements in list beyond index 0");if(S>0){for(let a=w-1;a>=0;a--)this.set(C+a+S,this.get(C+a));const l=C+w+S-this._length;if(l>0)for(this._length+=l;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let l=0;l<w;l++)this.set(C+l+S,this.get(C+l))}}_getCyclicIndex(C){return(this._startIndex+C)%this._maxLength}}n.CircularList=f},1439:(v,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.clone=void 0,n.clone=function u(d,g=5){if(typeof d!="object")return d;const f=Array.isArray(d)?[]:{};for(const _ in d)f[_]=g<=1?d[_]:d[_]&&u(d[_],g-1);return f}},8055:(v,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.contrastRatio=n.toPaddedHex=n.rgba=n.rgb=n.css=n.color=n.channels=n.NULL_COLOR=void 0;const d=u(6114);let g=0,f=0,_=0,C=0;var w,S,l,a,o;function c(y){const x=y.toString(16);return x.length<2?"0"+x:x}function p(y,x){return y<x?(x+.05)/(y+.05):(y+.05)/(x+.05)}n.NULL_COLOR={css:"#00000000",rgba:0},function(y){y.toCss=function(x,k,m,b){return b!==void 0?`#${c(x)}${c(k)}${c(m)}${c(b)}`:`#${c(x)}${c(k)}${c(m)}`},y.toRgba=function(x,k,m,b=255){return(x<<24|k<<16|m<<8|b)>>>0}}(w||(n.channels=w={})),function(y){function x(k,m){return C=Math.round(255*m),[g,f,_]=o.toChannels(k.rgba),{css:w.toCss(g,f,_,C),rgba:w.toRgba(g,f,_,C)}}y.blend=function(k,m){if(C=(255&m.rgba)/255,C===1)return{css:m.css,rgba:m.rgba};const b=m.rgba>>24&255,D=m.rgba>>16&255,M=m.rgba>>8&255,A=k.rgba>>24&255,O=k.rgba>>16&255,F=k.rgba>>8&255;return g=A+Math.round((b-A)*C),f=O+Math.round((D-O)*C),_=F+Math.round((M-F)*C),{css:w.toCss(g,f,_),rgba:w.toRgba(g,f,_)}},y.isOpaque=function(k){return(255&k.rgba)==255},y.ensureContrastRatio=function(k,m,b){const D=o.ensureContrastRatio(k.rgba,m.rgba,b);if(D)return o.toColor(D>>24&255,D>>16&255,D>>8&255)},y.opaque=function(k){const m=(255|k.rgba)>>>0;return[g,f,_]=o.toChannels(m),{css:w.toCss(g,f,_),rgba:m}},y.opacity=x,y.multiplyOpacity=function(k,m){return C=255&k.rgba,x(k,C*m/255)},y.toColorRGB=function(k){return[k.rgba>>24&255,k.rgba>>16&255,k.rgba>>8&255]}}(S||(n.color=S={})),function(y){let x,k;if(!d.isNode){const m=document.createElement("canvas");m.width=1,m.height=1;const b=m.getContext("2d",{willReadFrequently:!0});b&&(x=b,x.globalCompositeOperation="copy",k=x.createLinearGradient(0,0,1,1))}y.toColor=function(m){if(m.match(/#[\da-f]{3,8}/i))switch(m.length){case 4:return g=parseInt(m.slice(1,2).repeat(2),16),f=parseInt(m.slice(2,3).repeat(2),16),_=parseInt(m.slice(3,4).repeat(2),16),o.toColor(g,f,_);case 5:return g=parseInt(m.slice(1,2).repeat(2),16),f=parseInt(m.slice(2,3).repeat(2),16),_=parseInt(m.slice(3,4).repeat(2),16),C=parseInt(m.slice(4,5).repeat(2),16),o.toColor(g,f,_,C);case 7:return{css:m,rgba:(parseInt(m.slice(1),16)<<8|255)>>>0};case 9:return{css:m,rgba:parseInt(m.slice(1),16)>>>0}}const b=m.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(b)return g=parseInt(b[1]),f=parseInt(b[2]),_=parseInt(b[3]),C=Math.round(255*(b[5]===void 0?1:parseFloat(b[5]))),o.toColor(g,f,_,C);if(!x||!k)throw new Error("css.toColor: Unsupported css format");if(x.fillStyle=k,x.fillStyle=m,typeof x.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(x.fillRect(0,0,1,1),[g,f,_,C]=x.getImageData(0,0,1,1).data,C!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:w.toRgba(g,f,_,C),css:m}}}(l||(n.css=l={})),function(y){function x(k,m,b){const D=k/255,M=m/255,A=b/255;return .2126*(D<=.03928?D/12.92:Math.pow((D+.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))}y.relativeLuminance=function(k){return x(k>>16&255,k>>8&255,255&k)},y.relativeLuminance2=x}(a||(n.rgb=a={})),function(y){function x(m,b,D){const M=m>>24&255,A=m>>16&255,O=m>>8&255;let F=b>>24&255,H=b>>16&255,U=b>>8&255,$=p(a.relativeLuminance2(F,H,U),a.relativeLuminance2(M,A,O));for(;$<D&&(F>0||H>0||U>0);)F-=Math.max(0,Math.ceil(.1*F)),H-=Math.max(0,Math.ceil(.1*H)),U-=Math.max(0,Math.ceil(.1*U)),$=p(a.relativeLuminance2(F,H,U),a.relativeLuminance2(M,A,O));return(F<<24|H<<16|U<<8|255)>>>0}function k(m,b,D){const M=m>>24&255,A=m>>16&255,O=m>>8&255;let F=b>>24&255,H=b>>16&255,U=b>>8&255,$=p(a.relativeLuminance2(F,H,U),a.relativeLuminance2(M,A,O));for(;$<D&&(F<255||H<255||U<255);)F=Math.min(255,F+Math.ceil(.1*(255-F))),H=Math.min(255,H+Math.ceil(.1*(255-H))),U=Math.min(255,U+Math.ceil(.1*(255-U))),$=p(a.relativeLuminance2(F,H,U),a.relativeLuminance2(M,A,O));return(F<<24|H<<16|U<<8|255)>>>0}y.ensureContrastRatio=function(m,b,D){const M=a.relativeLuminance(m>>8),A=a.relativeLuminance(b>>8);if(p(M,A)<D){if(A<M){const H=x(m,b,D),U=p(M,a.relativeLuminance(H>>8));if(U<D){const $=k(m,b,D);return U>p(M,a.relativeLuminance($>>8))?H:$}return H}const O=k(m,b,D),F=p(M,a.relativeLuminance(O>>8));if(F<D){const H=x(m,b,D);return F>p(M,a.relativeLuminance(H>>8))?O:H}return O}},y.reduceLuminance=x,y.increaseLuminance=k,y.toChannels=function(m){return[m>>24&255,m>>16&255,m>>8&255,255&m]},y.toColor=function(m,b,D,M){return{css:w.toCss(m,b,D,M),rgba:w.toRgba(m,b,D,M)}}}(o||(n.rgba=o={})),n.toPaddedHex=c,n.contrastRatio=p},8969:(v,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CoreTerminal=void 0;const d=u(844),g=u(2585),f=u(4348),_=u(7866),C=u(744),w=u(7302),S=u(6975),l=u(8460),a=u(1753),o=u(1480),c=u(7994),p=u(9282),y=u(5435),x=u(5981),k=u(2660);let m=!1;class b extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new l.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 d.MutableDisposable),this._onBinary=this.register(new l.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new l.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new l.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new l.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new l.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new l.EventEmitter),this._instantiationService=new f.InstantiationService,this.optionsService=this.register(new w.OptionsService(M)),this._instantiationService.setService(g.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(C.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(S.CoreService)),this._instantiationService.setService(g.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(a.CoreMouseService)),this._instantiationService.setService(g.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(o.UnicodeService)),this._instantiationService.setService(g.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(c.CharsetService),this._instantiationService.setService(g.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(k.OscLinkService),this._instantiationService.setService(g.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new y.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,l.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,l.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,l.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,l.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 x.WriteBuffer((A,O)=>this._inputHandler.parse(A,O))),this.register((0,l.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(M,A){this._writeBuffer.write(M,A)}writeSync(M,A){this._logService.logLevel<=g.LogLevelEnum.WARN&&!m&&(this._logService.warn("writeSync is unreliable and will be removed soon."),m=!0),this._writeBuffer.writeSync(M,A)}resize(M,A){isNaN(M)||isNaN(A)||(M=Math.max(M,C.MINIMUM_COLS),A=Math.max(A,C.MINIMUM_ROWS),this._bufferService.resize(M,A))}scroll(M,A=!1){this._bufferService.scroll(M,A)}scrollLines(M,A,O){this._bufferService.scrollLines(M,A,O)}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(p.updateWindowsModeWrappedState.bind(null,this._bufferService))),M.push(this.registerCsiHandler({final:"H"},()=>((0,p.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)(()=>{for(const A of M)A.dispose()})}}}n.CoreTerminal=b},8460:(v,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.forwardEvent=n.EventEmitter=void 0,n.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===u)return void this._listeners.splice(d,1)}}})),this._event}fire(u,d){const g=[];for(let f=0;f<this._listeners.length;f++)g.push(this._listeners[f]);for(let f=0;f<g.length;f++)g[f].call(void 0,u,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},n.forwardEvent=function(u,d){return u(g=>d.fire(g))}},5435:function(v,n,u){var d=this&&this.__decorate||function($,E,T,P){var B,z=arguments.length,V=z<3?E:P===null?P=Object.getOwnPropertyDescriptor(E,T):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")V=Reflect.decorate($,E,T,P);else for(var Y=$.length-1;Y>=0;Y--)(B=$[Y])&&(V=(z<3?B(V):z>3?B(E,T,V):B(E,T))||V);return z>3&&V&&Object.defineProperty(E,T,V),V},g=this&&this.__param||function($,E){return function(T,P){E(T,P,$)}};Object.defineProperty(n,"__esModule",{value:!0}),n.InputHandler=n.WindowsOptionsReportType=void 0;const f=u(2584),_=u(7116),C=u(2015),w=u(844),S=u(482),l=u(8437),a=u(8460),o=u(643),c=u(511),p=u(3734),y=u(2585),x=u(6242),k=u(6351),m=u(5941),b={"(":0,")":1,"*":2,"+":3,"-":1,".":2},D=131072;function M($,E){if($>24)return E.setWinLines||!1;switch($){case 1:return!!E.restoreWin;case 2:return!!E.minimizeWin;case 3:return!!E.setWinPosition;case 4:return!!E.setWinSizePixels;case 5:return!!E.raiseWin;case 6:return!!E.lowerWin;case 7:return!!E.refreshWin;case 8:return!!E.setWinSizeChars;case 9:return!!E.maximizeWin;case 10:return!!E.fullscreenWin;case 11:return!!E.getWinState;case 13:return!!E.getWinPosition;case 14:return!!E.getWinSizePixels;case 15:return!!E.getScreenSizePixels;case 16:return!!E.getCellSizePixels;case 18:return!!E.getWinSizeChars;case 19:return!!E.getScreenSizeChars;case 20:return!!E.getIconTitle;case 21:return!!E.getWinTitle;case 22:return!!E.pushTitle;case 23:return!!E.popTitle;case 24:return!!E.setWinLines}return!1}var A;(function($){$[$.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",$[$.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(A||(n.WindowsOptionsReportType=A={}));let O=0;class F extends w.Disposable{getAttrData(){return this._curAttrData}constructor(E,T,P,B,z,V,Y,X,oe=new C.EscapeSequenceParser){super(),this._bufferService=E,this._charsetService=T,this._coreService=P,this._logService=B,this._optionsService=z,this._oscLinkService=V,this._coreMouseService=Y,this._unicodeService=X,this._parser=oe,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new S.StringToUtf32,this._utf8Decoder=new S.Utf8ToUtf32,this._workCell=new c.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=l.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=l.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new a.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new a.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new a.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new a.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new a.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new a.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new a.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new a.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new a.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new a.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new a.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new a.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new a.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 H(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(R=>this._activeBuffer=R.activeBuffer)),this._parser.setCsiHandlerFallback((R,j)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(R),params:j.toArray()})}),this._parser.setEscHandlerFallback(R=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(R)})}),this._parser.setExecuteHandlerFallback(R=>{this._logService.debug("Unknown EXECUTE code: ",{code:R})}),this._parser.setOscHandlerFallback((R,j,W)=>{this._logService.debug("Unknown OSC code: ",{identifier:R,action:j,data:W})}),this._parser.setDcsHandlerFallback((R,j,W)=>{j==="HOOK"&&(W=W.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(R),action:j,payload:W})}),this._parser.setPrintHandler((R,j,W)=>this.print(R,j,W)),this._parser.registerCsiHandler({final:"@"},R=>this.insertChars(R)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},R=>this.scrollLeft(R)),this._parser.registerCsiHandler({final:"A"},R=>this.cursorUp(R)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},R=>this.scrollRight(R)),this._parser.registerCsiHandler({final:"B"},R=>this.cursorDown(R)),this._parser.registerCsiHandler({final:"C"},R=>this.cursorForward(R)),this._parser.registerCsiHandler({final:"D"},R=>this.cursorBackward(R)),this._parser.registerCsiHandler({final:"E"},R=>this.cursorNextLine(R)),this._parser.registerCsiHandler({final:"F"},R=>this.cursorPrecedingLine(R)),this._parser.registerCsiHandler({final:"G"},R=>this.cursorCharAbsolute(R)),this._parser.registerCsiHandler({final:"H"},R=>this.cursorPosition(R)),this._parser.registerCsiHandler({final:"I"},R=>this.cursorForwardTab(R)),this._parser.registerCsiHandler({final:"J"},R=>this.eraseInDisplay(R,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},R=>this.eraseInDisplay(R,!0)),this._parser.registerCsiHandler({final:"K"},R=>this.eraseInLine(R,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},R=>this.eraseInLine(R,!0)),this._parser.registerCsiHandler({final:"L"},R=>this.insertLines(R)),this._parser.registerCsiHandler({final:"M"},R=>this.deleteLines(R)),this._parser.registerCsiHandler({final:"P"},R=>this.deleteChars(R)),this._parser.registerCsiHandler({final:"S"},R=>this.scrollUp(R)),this._parser.registerCsiHandler({final:"T"},R=>this.scrollDown(R)),this._parser.registerCsiHandler({final:"X"},R=>this.eraseChars(R)),this._parser.registerCsiHandler({final:"Z"},R=>this.cursorBackwardTab(R)),this._parser.registerCsiHandler({final:"`"},R=>this.charPosAbsolute(R)),this._parser.registerCsiHandler({final:"a"},R=>this.hPositionRelative(R)),this._parser.registerCsiHandler({final:"b"},R=>this.repeatPrecedingCharacter(R)),this._parser.registerCsiHandler({final:"c"},R=>this.sendDeviceAttributesPrimary(R)),this._parser.registerCsiHandler({prefix:">",final:"c"},R=>this.sendDeviceAttributesSecondary(R)),this._parser.registerCsiHandler({final:"d"},R=>this.linePosAbsolute(R)),this._parser.registerCsiHandler({final:"e"},R=>this.vPositionRelative(R)),this._parser.registerCsiHandler({final:"f"},R=>this.hVPosition(R)),this._parser.registerCsiHandler({final:"g"},R=>this.tabClear(R)),this._parser.registerCsiHandler({final:"h"},R=>this.setMode(R)),this._parser.registerCsiHandler({prefix:"?",final:"h"},R=>this.setModePrivate(R)),this._parser.registerCsiHandler({final:"l"},R=>this.resetMode(R)),this._parser.registerCsiHandler({prefix:"?",final:"l"},R=>this.resetModePrivate(R)),this._parser.registerCsiHandler({final:"m"},R=>this.charAttributes(R)),this._parser.registerCsiHandler({final:"n"},R=>this.deviceStatus(R)),this._parser.registerCsiHandler({prefix:"?",final:"n"},R=>this.deviceStatusPrivate(R)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},R=>this.softReset(R)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},R=>this.setCursorStyle(R)),this._parser.registerCsiHandler({final:"r"},R=>this.setScrollRegion(R)),this._parser.registerCsiHandler({final:"s"},R=>this.saveCursor(R)),this._parser.registerCsiHandler({final:"t"},R=>this.windowOptions(R)),this._parser.registerCsiHandler({final:"u"},R=>this.restoreCursor(R)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},R=>this.insertColumns(R)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},R=>this.deleteColumns(R)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},R=>this.selectProtected(R)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},R=>this.requestMode(R,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},R=>this.requestMode(R,!1)),this._parser.setExecuteHandler(f.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(f.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(f.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(f.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(f.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(f.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(f.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(f.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(f.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(f.C1.IND,()=>this.index()),this._parser.setExecuteHandler(f.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(f.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new x.OscHandler(R=>(this.setTitle(R),this.setIconName(R),!0))),this._parser.registerOscHandler(1,new x.OscHandler(R=>this.setIconName(R))),this._parser.registerOscHandler(2,new x.OscHandler(R=>this.setTitle(R))),this._parser.registerOscHandler(4,new x.OscHandler(R=>this.setOrReportIndexedColor(R))),this._parser.registerOscHandler(8,new x.OscHandler(R=>this.setHyperlink(R))),this._parser.registerOscHandler(10,new x.OscHandler(R=>this.setOrReportFgColor(R))),this._parser.registerOscHandler(11,new x.OscHandler(R=>this.setOrReportBgColor(R))),this._parser.registerOscHandler(12,new x.OscHandler(R=>this.setOrReportCursorColor(R))),this._parser.registerOscHandler(104,new x.OscHandler(R=>this.restoreIndexedColor(R))),this._parser.registerOscHandler(110,new x.OscHandler(R=>this.restoreFgColor(R))),this._parser.registerOscHandler(111,new x.OscHandler(R=>this.restoreBgColor(R))),this._parser.registerOscHandler(112,new x.OscHandler(R=>this.restoreCursorColor(R))),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 R in _.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:R},()=>this.selectCharset("("+R)),this._parser.registerEscHandler({intermediates:")",final:R},()=>this.selectCharset(")"+R)),this._parser.registerEscHandler({intermediates:"*",final:R},()=>this.selectCharset("*"+R)),this._parser.registerEscHandler({intermediates:"+",final:R},()=>this.selectCharset("+"+R)),this._parser.registerEscHandler({intermediates:"-",final:R},()=>this.selectCharset("-"+R)),this._parser.registerEscHandler({intermediates:".",final:R},()=>this.selectCharset("."+R)),this._parser.registerEscHandler({intermediates:"/",final:R},()=>this.selectCharset("/"+R));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(R=>(this._logService.error("Parsing error: ",R),R)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new k.DcsHandler((R,j)=>this.requestStatusString(R,j)))}_preserveStack(E,T,P,B){this._parseStack.paused=!0,this._parseStack.cursorStartX=E,this._parseStack.cursorStartY=T,this._parseStack.decodedLength=P,this._parseStack.position=B}_logSlowResolvingAsync(E){this._logService.logLevel<=y.LogLevelEnum.WARN&&Promise.race([E,new Promise((T,P)=>setTimeout(()=>P("#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(E,T){let P,B=this._activeBuffer.x,z=this._activeBuffer.y,V=0;const Y=this._parseStack.paused;if(Y){if(P=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,T))return this._logSlowResolvingAsync(P),P;B=this._parseStack.cursorStartX,z=this._parseStack.cursorStartY,this._parseStack.paused=!1,E.length>D&&(V=this._parseStack.position+D)}if(this._logService.logLevel<=y.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof E=="string"?` "${E}"`:` "${Array.prototype.map.call(E,X=>String.fromCharCode(X)).join("")}"`),typeof E=="string"?E.split("").map(X=>X.charCodeAt(0)):E),this._parseBuffer.length<E.length&&this._parseBuffer.length<D&&(this._parseBuffer=new Uint32Array(Math.min(E.length,D))),Y||this._dirtyRowTracker.clearRange(),E.length>D)for(let X=V;X<E.length;X+=D){const oe=X+D<E.length?X+D:E.length,R=typeof E=="string"?this._stringDecoder.decode(E.substring(X,oe),this._parseBuffer):this._utf8Decoder.decode(E.subarray(X,oe),this._parseBuffer);if(P=this._parser.parse(this._parseBuffer,R))return this._preserveStack(B,z,R,X),this._logSlowResolvingAsync(P),P}else if(!Y){const X=typeof E=="string"?this._stringDecoder.decode(E,this._parseBuffer):this._utf8Decoder.decode(E,this._parseBuffer);if(P=this._parser.parse(this._parseBuffer,X))return this._preserveStack(B,z,X,0),this._logSlowResolvingAsync(P),P}this._activeBuffer.x===B&&this._activeBuffer.y===z||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowTracker.start,this._dirtyRowTracker.end)}print(E,T,P){let B,z;const V=this._charsetService.charset,Y=this._optionsService.rawOptions.screenReaderMode,X=this._bufferService.cols,oe=this._coreService.decPrivateModes.wraparound,R=this._coreService.modes.insertMode,j=this._curAttrData;let W=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&P-T>0&&W.getWidth(this._activeBuffer.x-1)===2&&W.setCellFromCodePoint(this._activeBuffer.x-1,0,1,j.fg,j.bg,j.extended);for(let N=T;N<P;++N){if(B=E[N],z=this._unicodeService.wcwidth(B),B<127&&V){const ee=V[String.fromCharCode(B)];ee&&(B=ee.charCodeAt(0))}if(Y&&this._onA11yChar.fire((0,S.stringFromCodePoint)(B)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),z||!this._activeBuffer.x){if(this._activeBuffer.x+z-1>=X){if(oe){for(;this._activeBuffer.x<X;)W.setCellFromCodePoint(this._activeBuffer.x++,0,1,j.fg,j.bg,j.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),W=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=X-1,z===2)continue}if(R&&(W.insertCells(this._activeBuffer.x,z,this._activeBuffer.getNullCell(j),j),W.getWidth(X-1)===2&&W.setCellFromCodePoint(X-1,o.NULL_CELL_CODE,o.NULL_CELL_WIDTH,j.fg,j.bg,j.extended)),W.setCellFromCodePoint(this._activeBuffer.x++,B,z,j.fg,j.bg,j.extended),z>0)for(;--z;)W.setCellFromCodePoint(this._activeBuffer.x++,0,0,j.fg,j.bg,j.extended)}else W.getWidth(this._activeBuffer.x-1)?W.addCodepointToCell(this._activeBuffer.x-1,B):W.addCodepointToCell(this._activeBuffer.x-2,B)}P-T>0&&(W.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<X&&P-T>0&&W.getWidth(this._activeBuffer.x)===0&&!W.hasContent(this._activeBuffer.x)&&W.setCellFromCodePoint(this._activeBuffer.x,0,1,j.fg,j.bg,j.extended),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(E,T){return E.final!=="t"||E.prefix||E.intermediates?this._parser.registerCsiHandler(E,T):this._parser.registerCsiHandler(E,P=>!M(P.params[0],this._optionsService.rawOptions.windowOptions)||T(P))}registerDcsHandler(E,T){return this._parser.registerDcsHandler(E,new k.DcsHandler(T))}registerEscHandler(E,T){return this._parser.registerEscHandler(E,T)}registerOscHandler(E,T){return this._parser.registerOscHandler(E,new x.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 E;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&&(!((E=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))===null||E===void 0)&&E.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 E=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-E),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(E=this._bufferService.cols-1){this._activeBuffer.x=Math.min(E,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(E,T){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=E,this._activeBuffer.y=this._activeBuffer.scrollTop+T):(this._activeBuffer.x=E,this._activeBuffer.y=T),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(E,T){this._restrictCursor(),this._setCursor(this._activeBuffer.x+E,this._activeBuffer.y+T)}cursorUp(E){const T=this._activeBuffer.y-this._activeBuffer.scrollTop;return T>=0?this._moveCursor(0,-Math.min(T,E.params[0]||1)):this._moveCursor(0,-(E.params[0]||1)),!0}cursorDown(E){const T=this._activeBuffer.scrollBottom-this._activeBuffer.y;return T>=0?this._moveCursor(0,Math.min(T,E.params[0]||1)):this._moveCursor(0,E.params[0]||1),!0}cursorForward(E){return this._moveCursor(E.params[0]||1,0),!0}cursorBackward(E){return this._moveCursor(-(E.params[0]||1),0),!0}cursorNextLine(E){return this.cursorDown(E),this._activeBuffer.x=0,!0}cursorPrecedingLine(E){return this.cursorUp(E),this._activeBuffer.x=0,!0}cursorCharAbsolute(E){return this._setCursor((E.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(E){return this._setCursor(E.length>=2?(E.params[1]||1)-1:0,(E.params[0]||1)-1),!0}charPosAbsolute(E){return this._setCursor((E.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(E){return this._moveCursor(E.params[0]||1,0),!0}linePosAbsolute(E){return this._setCursor(this._activeBuffer.x,(E.params[0]||1)-1),!0}vPositionRelative(E){return this._moveCursor(0,E.params[0]||1),!0}hVPosition(E){return this.cursorPosition(E),!0}tabClear(E){const T=E.params[0];return T===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:T===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(E){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let T=E.params[0]||1;for(;T--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(E){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let T=E.params[0]||1;for(;T--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(E){const T=E.params[0];return T===1&&(this._curAttrData.bg|=536870912),T!==2&&T!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(E,T,P,B=!1,z=!1){const V=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);V.replaceCells(T,P,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),z),B&&(V.isWrapped=!1)}_resetBufferLine(E,T=!1){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);P&&(P.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),T),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+E),P.isWrapped=!1)}eraseInDisplay(E,T=!1){let P;switch(this._restrictCursor(this._bufferService.cols),E.params[0]){case 0:for(P=this._activeBuffer.y,this._dirtyRowTracker.markDirty(P),this._eraseInBufferLine(P++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,T);P<this._bufferService.rows;P++)this._resetBufferLine(P,T);this._dirtyRowTracker.markDirty(P);break;case 1:for(P=this._activeBuffer.y,this._dirtyRowTracker.markDirty(P),this._eraseInBufferLine(P,0,this._activeBuffer.x+1,!0,T),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(P+1).isWrapped=!1);P--;)this._resetBufferLine(P,T);this._dirtyRowTracker.markDirty(0);break;case 2:for(P=this._bufferService.rows,this._dirtyRowTracker.markDirty(P-1);P--;)this._resetBufferLine(P,T);this._dirtyRowTracker.markDirty(0);break;case 3:const B=this._activeBuffer.lines.length-this._bufferService.rows;B>0&&(this._activeBuffer.lines.trimStart(B),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-B,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-B,0),this._onScroll.fire(0))}return!0}eraseInLine(E,T=!1){switch(this._restrictCursor(this._bufferService.cols),E.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(E){this._restrictCursor();let T=E.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=this._activeBuffer.ybase+this._activeBuffer.y,B=this._bufferService.rows-1-this._activeBuffer.scrollBottom,z=this._bufferService.rows-1+this._activeBuffer.ybase-B+1;for(;T--;)this._activeBuffer.lines.splice(z-1,1),this._activeBuffer.lines.splice(P,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(E){this._restrictCursor();let T=E.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=this._activeBuffer.ybase+this._activeBuffer.y;let B;for(B=this._bufferService.rows-1-this._activeBuffer.scrollBottom,B=this._bufferService.rows-1+this._activeBuffer.ybase-B;T--;)this._activeBuffer.lines.splice(P,1),this._activeBuffer.lines.splice(B,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(E){this._restrictCursor();const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return T&&(T.insertCells(this._activeBuffer.x,E.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(E){this._restrictCursor();const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return T&&(T.deleteCells(this._activeBuffer.x,E.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(E){let T=E.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(E){let T=E.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(l.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(E){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=E.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);B.deleteCells(0,T,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(E){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=E.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);B.insertCells(0,T,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(E){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=E.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);B.insertCells(this._activeBuffer.x,T,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(E){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=E.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);B.deleteCells(this._activeBuffer.x,T,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(E){this._restrictCursor();const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return T&&(T.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(E.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(E){if(!this._parser.precedingCodepoint)return!0;const T=E.params[0]||1,P=new Uint32Array(T);for(let B=0;B<T;++B)P[B]=this._parser.precedingCodepoint;return this.print(P,0,P.length),!0}sendDeviceAttributesPrimary(E){return E.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(f.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(f.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(E){return E.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(f.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(f.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(E.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(f.C0.ESC+"[>83;40003;0c")),!0}_is(E){return(this._optionsService.rawOptions.termName+"").indexOf(E)===0}setMode(E){for(let T=0;T<E.length;T++)switch(E.params[T]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(E){for(let T=0;T<E.length;T++)switch(E.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(E){for(let T=0;T<E.length;T++)switch(E.params[T]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(E){for(let T=0;T<E.length;T++)switch(E.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(),E.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(E,T){const P=this._coreService.decPrivateModes,{activeProtocol:B,activeEncoding:z}=this._coreMouseService,V=this._coreService,{buffers:Y,cols:X}=this._bufferService,{active:oe,alt:R}=Y,j=this._optionsService.rawOptions,W=le=>le?1:2,N=E.params[0];return ee=N,G=T?N===2?4:N===4?W(V.modes.insertMode):N===12?3:N===20?W(j.convertEol):0:N===1?W(P.applicationCursorKeys):N===3?j.windowOptions.setWinLines?X===80?2:X===132?1:0:0:N===6?W(P.origin):N===7?W(P.wraparound):N===8?3:N===9?W(B==="X10"):N===12?W(j.cursorBlink):N===25?W(!V.isCursorHidden):N===45?W(P.reverseWraparound):N===66?W(P.applicationKeypad):N===67?4:N===1e3?W(B==="VT200"):N===1002?W(B==="DRAG"):N===1003?W(B==="ANY"):N===1004?W(P.sendFocus):N===1005?4:N===1006?W(z==="SGR"):N===1015?4:N===1016?W(z==="SGR_PIXELS"):N===1048?1:N===47||N===1047||N===1049?W(oe===R):N===2004?W(P.bracketedPasteMode):0,V.triggerDataEvent(`${f.C0.ESC}[${T?"":"?"}${ee};${G}$y`),!0;var ee,G}_updateAttrColor(E,T,P,B,z){return T===2?(E|=50331648,E&=-16777216,E|=p.AttributeData.fromColorRGB([P,B,z])):T===5&&(E&=-50331904,E|=33554432|255&P),E}_extractColor(E,T,P){const B=[0,0,-1,0,0,0];let z=0,V=0;do{if(B[V+z]=E.params[T+V],E.hasSubParams(T+V)){const Y=E.getSubParams(T+V);let X=0;do B[1]===5&&(z=1),B[V+X+1+z]=Y[X];while(++X<Y.length&&X+V+1+z<B.length);break}if(B[1]===5&&V+z>=2||B[1]===2&&V+z>=5)break;B[1]&&(z=1)}while(++V+T<E.length&&V+z<B.length);for(let Y=2;Y<B.length;++Y)B[Y]===-1&&(B[Y]=0);switch(B[0]){case 38:P.fg=this._updateAttrColor(P.fg,B[1],B[3],B[4],B[5]);break;case 48:P.bg=this._updateAttrColor(P.bg,B[1],B[3],B[4],B[5]);break;case 58:P.extended=P.extended.clone(),P.extended.underlineColor=this._updateAttrColor(P.extended.underlineColor,B[1],B[3],B[4],B[5])}return V}_processUnderline(E,T){T.extended=T.extended.clone(),(!~E||E>5)&&(E=1),T.extended.underlineStyle=E,T.fg|=268435456,E===0&&(T.fg&=-268435457),T.updateExtended()}_processSGR0(E){E.fg=l.DEFAULT_ATTR_DATA.fg,E.bg=l.DEFAULT_ATTR_DATA.bg,E.extended=E.extended.clone(),E.extended.underlineStyle=0,E.extended.underlineColor&=-67108864,E.updateExtended()}charAttributes(E){if(E.length===1&&E.params[0]===0)return this._processSGR0(this._curAttrData),!0;const T=E.length;let P;const B=this._curAttrData;for(let z=0;z<T;z++)P=E.params[z],P>=30&&P<=37?(B.fg&=-50331904,B.fg|=16777216|P-30):P>=40&&P<=47?(B.bg&=-50331904,B.bg|=16777216|P-40):P>=90&&P<=97?(B.fg&=-50331904,B.fg|=16777224|P-90):P>=100&&P<=107?(B.bg&=-50331904,B.bg|=16777224|P-100):P===0?this._processSGR0(B):P===1?B.fg|=134217728:P===3?B.bg|=67108864:P===4?(B.fg|=268435456,this._processUnderline(E.hasSubParams(z)?E.getSubParams(z)[0]:1,B)):P===5?B.fg|=536870912:P===7?B.fg|=67108864:P===8?B.fg|=1073741824:P===9?B.fg|=2147483648:P===2?B.bg|=134217728:P===21?this._processUnderline(2,B):P===22?(B.fg&=-134217729,B.bg&=-134217729):P===23?B.bg&=-67108865:P===24?(B.fg&=-268435457,this._processUnderline(0,B)):P===25?B.fg&=-536870913:P===27?B.fg&=-67108865:P===28?B.fg&=-1073741825:P===29?B.fg&=2147483647:P===39?(B.fg&=-67108864,B.fg|=16777215&l.DEFAULT_ATTR_DATA.fg):P===49?(B.bg&=-67108864,B.bg|=16777215&l.DEFAULT_ATTR_DATA.bg):P===38||P===48||P===58?z+=this._extractColor(E,z,B):P===53?B.bg|=1073741824:P===55?B.bg&=-1073741825:P===59?(B.extended=B.extended.clone(),B.extended.underlineColor=-1,B.updateExtended()):P===100?(B.fg&=-67108864,B.fg|=16777215&l.DEFAULT_ATTR_DATA.fg,B.bg&=-67108864,B.bg|=16777215&l.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",P);return!0}deviceStatus(E){switch(E.params[0]){case 5:this._coreService.triggerDataEvent(`${f.C0.ESC}[0n`);break;case 6:const T=this._activeBuffer.y+1,P=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[${T};${P}R`)}return!0}deviceStatusPrivate(E){if(E.params[0]===6){const T=this._activeBuffer.y+1,P=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[?${T};${P}R`)}return!0}softReset(E){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=l.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(E){const T=E.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 P=T%2==1;return this._optionsService.options.cursorBlink=P,!0}setScrollRegion(E){const T=E.params[0]||1;let P;return(E.length<2||(P=E.params[1])>this._bufferService.rows||P===0)&&(P=this._bufferService.rows),P>T&&(this._activeBuffer.scrollTop=T-1,this._activeBuffer.scrollBottom=P-1,this._setCursor(0,0)),!0}windowOptions(E){if(!M(E.params[0],this._optionsService.rawOptions.windowOptions))return!0;const T=E.length>1?E.params[1]:0;switch(E.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(`${f.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(E){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(E){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(E){return this._windowTitle=E,this._onTitleChange.fire(E),!0}setIconName(E){return this._iconName=E,!0}setOrReportIndexedColor(E){const T=[],P=E.split(";");for(;P.length>1;){const B=P.shift(),z=P.shift();if(/^\d+$/.exec(B)){const V=parseInt(B);if(U(V))if(z==="?")T.push({type:0,index:V});else{const Y=(0,m.parseColor)(z);Y&&T.push({type:1,index:V,color:Y})}}}return T.length&&this._onColor.fire(T),!0}setHyperlink(E){const T=E.split(";");return!(T.length<2)&&(T[1]?this._createHyperlink(T[0],T[1]):!T[0]&&this._finishHyperlink())}_createHyperlink(E,T){this._getCurrentLinkId()&&this._finishHyperlink();const P=E.split(":");let B;const z=P.findIndex(V=>V.startsWith("id="));return z!==-1&&(B=P[z].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:B,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(E,T){const P=E.split(";");for(let B=0;B<P.length&&!(T>=this._specialColors.length);++B,++T)if(P[B]==="?")this._onColor.fire([{type:0,index:this._specialColors[T]}]);else{const z=(0,m.parseColor)(P[B]);z&&this._onColor.fire([{type:1,index:this._specialColors[T],color:z}])}return!0}setOrReportFgColor(E){return this._setOrReportSpecialColor(E,0)}setOrReportBgColor(E){return this._setOrReportSpecialColor(E,1)}setOrReportCursorColor(E){return this._setOrReportSpecialColor(E,2)}restoreIndexedColor(E){if(!E)return this._onColor.fire([{type:2}]),!0;const T=[],P=E.split(";");for(let B=0;B<P.length;++B)if(/^\d+$/.exec(P[B])){const z=parseInt(P[B]);U(z)&&T.push({type:2,index:z})}return T.length&&this._onColor.fire(T),!0}restoreFgColor(E){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(E){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(E){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(E){return E.length!==2?(this.selectDefaultCharset(),!0):(E[0]==="/"||this._charsetService.setgCharset(b[E[0]],_.CHARSETS[E[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 E=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,E,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=l.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=l.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(E){return this._charsetService.setgLevel(E),!0}screenAlignmentPattern(){const E=new c.CellData;E.content=4194373,E.fg=this._curAttrData.fg,E.bg=this._curAttrData.bg,this._setCursor(0,0);for(let T=0;T<this._bufferService.rows;++T){const P=this._activeBuffer.ybase+this._activeBuffer.y+T,B=this._activeBuffer.lines.get(P);B&&(B.fill(E),B.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(E,T){const P=this._bufferService.buffer,B=this._optionsService.rawOptions;return(z=>(this._coreService.triggerDataEvent(`${f.C0.ESC}${z}${f.C0.ESC}\\`),!0))(E==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:E==='"p'?'P1$r61;1"p':E==="r"?`P1$r${P.scrollTop+1};${P.scrollBottom+1}r`:E==="m"?"P1$r0m":E===" q"?`P1$r${{block:2,underline:4,bar:6}[B.cursorStyle]-(B.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(E,T){this._dirtyRowTracker.markRangeDirty(E,T)}}n.InputHandler=F;let H=class{constructor($){this._bufferService=$,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty($){$<this.start?this.start=$:$>this.end&&(this.end=$)}markRangeDirty($,E){$>E&&(O=$,$=E,E=O),$<this.start&&(this.start=$),E>this.end&&(this.end=E)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function U($){return 0<=$&&$<256}H=d([g(0,y.IBufferService)],H)},844:(v,n)=>{function u(d){for(const g of d)g.dispose();d.length=0}Object.defineProperty(n,"__esModule",{value:!0}),n.getDisposeArrayDisposable=n.disposeArray=n.toDisposable=n.MutableDisposable=n.Disposable=void 0,n.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const g=this._disposables.indexOf(d);g!==-1&&this._disposables.splice(g,1)}},n.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var g;this._isDisposed||d===this._value||((g=this._value)===null||g===void 0||g.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)===null||d===void 0||d.dispose(),this._value=void 0}},n.toDisposable=function(d){return{dispose:d}},n.disposeArray=u,n.getDisposeArrayDisposable=function(d){return{dispose:()=>u(d)}}},1505:(v,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.FourKeyMap=n.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(g,f,_){this._data[g]||(this._data[g]={}),this._data[g][f]=_}get(g,f){return this._data[g]?this._data[g][f]:void 0}clear(){this._data={}}}n.TwoKeyMap=u,n.FourKeyMap=class{constructor(){this._data=new u}set(d,g,f,_,C){this._data.get(d,g)||this._data.set(d,g,new u),this._data.get(d,g).set(f,_,C)}get(d,g,f,_){var C;return(C=this._data.get(d,g))===null||C===void 0?void 0:C.get(f,_)}clear(){this._data.clear()}}},6114:(v,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.isChromeOS=n.isLinux=n.isWindows=n.isIphone=n.isIpad=n.isMac=n.getSafariVersion=n.isSafari=n.isLegacyEdge=n.isFirefox=n.isNode=void 0,n.isNode=typeof navigator>"u";const u=n.isNode?"node":navigator.userAgent,d=n.isNode?"node":navigator.platform;n.isFirefox=u.includes("Firefox"),n.isLegacyEdge=u.includes("Edge"),n.isSafari=/^((?!chrome|android).)*safari/i.test(u),n.getSafariVersion=function(){if(!n.isSafari)return 0;const g=u.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[1])},n.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),n.isIpad=d==="iPad",n.isIphone=d==="iPhone",n.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),n.isLinux=d.indexOf("Linux")>=0,n.isChromeOS=/\bCrOS\b/.test(u)},6106:(v,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SortedList=void 0;let u=0;n.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(u=this._search(this._getKey(d)),this._array.splice(u,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const g=this._getKey(d);if(g===void 0||(u=this._search(g),u===-1)||this._getKey(this._array[u])!==g)return!1;do if(this._array[u]===d)return this._array.splice(u,1),!0;while(++u<this._array.length&&this._getKey(this._array[u])===g);return!1}*getKeyIterator(d){if(this._array.length!==0&&(u=this._search(d),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===d))do yield this._array[u];while(++u<this._array.length&&this._getKey(this._array[u])===d)}forEachByKey(d,g){if(this._array.length!==0&&(u=this._search(d),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===d))do g(this._array[u]);while(++u<this._array.length&&this._getKey(this._array[u])===d)}values(){return[...this._array].values()}_search(d){let g=0,f=this._array.length-1;for(;f>=g;){let _=g+f>>1;const C=this._getKey(this._array[_]);if(C>d)f=_-1;else{if(!(C<d)){for(;_>0&&this._getKey(this._array[_-1])===d;)_--;return _}g=_+1}}return g}}},7226:(v,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DebouncedIdleTask=n.IdleTaskQueue=n.PriorityTaskQueue=void 0;const d=u(6114);class g{constructor(){this._tasks=[],this._i=0}enqueue(C){this._tasks.push(C),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(C){this._idleCallback=void 0;let w=0,S=0,l=C.timeRemaining(),a=0;for(;this._i<this._tasks.length;){if(w=Date.now(),this._tasks[this._i]()||this._i++,w=Math.max(1,Date.now()-w),S=Math.max(w,S),a=C.timeRemaining(),1.5*S>a)return l-w<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(l-w))}ms`),void this._start();l=a}this.clear()}}class f extends g{_requestCallback(C){return setTimeout(()=>C(this._createDeadline(16)))}_cancelCallback(C){clearTimeout(C)}_createDeadline(C){const w=Date.now()+C;return{timeRemaining:()=>Math.max(0,w-Date.now())}}}n.PriorityTaskQueue=f,n.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends g{_requestCallback(_){return requestIdleCallback(_)}_cancelCallback(_){cancelIdleCallback(_)}}:f,n.DebouncedIdleTask=class{constructor(){this._queue=new n.IdleTaskQueue}set(_){this._queue.clear(),this._queue.enqueue(_)}flush(){this._queue.flush()}}},9282:(v,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.updateWindowsModeWrappedState=void 0;const d=u(643);n.updateWindowsModeWrappedState=function(g){const f=g.buffer.lines.get(g.buffer.ybase+g.buffer.y-1),_=f==null?void 0:f.get(g.cols-1),C=g.buffer.lines.get(g.buffer.ybase+g.buffer.y);C&&_&&(C.isWrapped=_[d.CHAR_DATA_CODE_INDEX]!==d.NULL_CELL_CODE&&_[d.CHAR_DATA_CODE_INDEX]!==d.WHITESPACE_CELL_CODE)}},3734:(v,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ExtendedAttrs=n.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(f){return[f>>>16&255,f>>>8&255,255&f]}static fromColorRGB(f){return(255&f[0])<<16|(255&f[1])<<8|255&f[2]}clone(){const f=new u;return f.fg=this.fg,f.bg=this.bg,f.extended=this.extended.clone(),f}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}}n.AttributeData=u;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(f){this._ext=f}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(f){this._ext&=-469762049,this._ext|=f<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(f){this._ext&=-67108864,this._ext|=67108863&f}get urlId(){return this._urlId}set urlId(f){this._urlId=f}constructor(f=0,_=0){this._ext=0,this._urlId=0,this._ext=f,this._urlId=_}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}n.ExtendedAttrs=d},9092:(v,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Buffer=n.MAX_BUFFER_SIZE=void 0;const d=u(6349),g=u(7226),f=u(3734),_=u(8437),C=u(4634),w=u(511),S=u(643),l=u(4863),a=u(7116);n.MAX_BUFFER_SIZE=4294967295,n.Buffer=class{constructor(o,c,p){this._hasScrollback=o,this._optionsService=c,this._bufferService=p,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=a.DEFAULT_CHARSET,this.markers=[],this._nullCell=w.CellData.fromCharData([0,S.NULL_CELL_CHAR,S.NULL_CELL_WIDTH,S.NULL_CELL_CODE]),this._whitespaceCell=w.CellData.fromCharData([0,S.WHITESPACE_CELL_CHAR,S.WHITESPACE_CELL_WIDTH,S.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 d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(o){return o?(this._nullCell.fg=o.fg,this._nullCell.bg=o.bg,this._nullCell.extended=o.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new f.ExtendedAttrs),this._nullCell}getWhitespaceCell(o){return o?(this._whitespaceCell.fg=o.fg,this._whitespaceCell.bg=o.bg,this._whitespaceCell.extended=o.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new f.ExtendedAttrs),this._whitespaceCell}getBlankLine(o,c){return new _.BufferLine(this._bufferService.cols,this.getNullCell(o),c)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const o=this.ybase+this.y-this.ydisp;return o>=0&&o<this._rows}_getCorrectBufferLength(o){if(!this._hasScrollback)return o;const c=o+this._optionsService.rawOptions.scrollback;return c>n.MAX_BUFFER_SIZE?n.MAX_BUFFER_SIZE:c}fillViewportRows(o){if(this.lines.length===0){o===void 0&&(o=_.DEFAULT_ATTR_DATA);let c=this._rows;for(;c--;)this.lines.push(this.getBlankLine(o))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(o,c){const p=this.getNullCell(_.DEFAULT_ATTR_DATA);let y=0;const x=this._getCorrectBufferLength(c);if(x>this.lines.maxLength&&(this.lines.maxLength=x),this.lines.length>0){if(this._cols<o)for(let m=0;m<this.lines.length;m++)y+=+this.lines.get(m).resize(o,p);let k=0;if(this._rows<c)for(let m=this._rows;m<c;m++)this.lines.length<c+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(o,p)):this.ybase>0&&this.lines.length<=this.ybase+this.y+k+1?(this.ybase--,k++,this.ydisp>0&&this.ydisp--):this.lines.push(new _.BufferLine(o,p)));else for(let m=this._rows;m>c;m--)this.lines.length>c+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(x<this.lines.maxLength){const m=this.lines.length-x;m>0&&(this.lines.trimStart(m),this.ybase=Math.max(this.ybase-m,0),this.ydisp=Math.max(this.ydisp-m,0),this.savedY=Math.max(this.savedY-m,0)),this.lines.maxLength=x}this.x=Math.min(this.x,o-1),this.y=Math.min(this.y,c-1),k&&(this.y+=k),this.savedX=Math.min(this.savedX,o-1),this.scrollTop=0}if(this.scrollBottom=c-1,this._isReflowEnabled&&(this._reflow(o,c),this._cols>o))for(let k=0;k<this.lines.length;k++)y+=+this.lines.get(k).resize(o,p);this._cols=o,this._rows=c,this._memoryCleanupQueue.clear(),y>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let o=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,o=!1);let c=0;for(;this._memoryCleanupPosition<this.lines.length;)if(c+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),c>100)return!0;return o}get _isReflowEnabled(){const o=this._optionsService.rawOptions.windowsPty;return o&&o.buildNumber?this._hasScrollback&&o.backend==="conpty"&&o.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(o,c){this._cols!==o&&(o>this._cols?this._reflowLarger(o,c):this._reflowSmaller(o,c))}_reflowLarger(o,c){const p=(0,C.reflowLargerGetLinesToRemove)(this.lines,this._cols,o,this.ybase+this.y,this.getNullCell(_.DEFAULT_ATTR_DATA));if(p.length>0){const y=(0,C.reflowLargerCreateNewLayout)(this.lines,p);(0,C.reflowLargerApplyNewLayout)(this.lines,y.layout),this._reflowLargerAdjustViewport(o,c,y.countRemoved)}}_reflowLargerAdjustViewport(o,c,p){const y=this.getNullCell(_.DEFAULT_ATTR_DATA);let x=p;for(;x-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<c&&this.lines.push(new _.BufferLine(o,y))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-p,0)}_reflowSmaller(o,c){const p=this.getNullCell(_.DEFAULT_ATTR_DATA),y=[];let x=0;for(let k=this.lines.length-1;k>=0;k--){let m=this.lines.get(k);if(!m||!m.isWrapped&&m.getTrimmedLength()<=o)continue;const b=[m];for(;m.isWrapped&&k>0;)m=this.lines.get(--k),b.unshift(m);const D=this.ybase+this.y;if(D>=k&&D<k+b.length)continue;const M=b[b.length-1].getTrimmedLength(),A=(0,C.reflowSmallerGetNewLineLengths)(b,this._cols,o),O=A.length-b.length;let F;F=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+O):Math.max(0,this.lines.length-this.lines.maxLength+O);const H=[];for(let B=0;B<O;B++){const z=this.getBlankLine(_.DEFAULT_ATTR_DATA,!0);H.push(z)}H.length>0&&(y.push({start:k+b.length+x,newLines:H}),x+=H.length),b.push(...H);let U=A.length-1,$=A[U];$===0&&(U--,$=A[U]);let E=b.length-O-1,T=M;for(;E>=0;){const B=Math.min(T,$);if(b[U]===void 0)break;if(b[U].copyCellsFrom(b[E],T-B,$-B,B,!0),$-=B,$===0&&(U--,$=A[U]),T-=B,T===0){E--;const z=Math.max(E,0);T=(0,C.getWrappedLineTrimmedLength)(b,z,this._cols)}}for(let B=0;B<b.length;B++)A[B]<o&&b[B].setCell(A[B],p);let P=O-F;for(;P-- >0;)this.ybase===0?this.y<c-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+x)-c&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+O,this.ybase+c-1)}if(y.length>0){const k=[],m=[];for(let U=0;U<this.lines.length;U++)m.push(this.lines.get(U));const b=this.lines.length;let D=b-1,M=0,A=y[M];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+x);let O=0;for(let U=Math.min(this.lines.maxLength-1,b+x-1);U>=0;U--)if(A&&A.start>D+O){for(let $=A.newLines.length-1;$>=0;$--)this.lines.set(U--,A.newLines[$]);U++,k.push({index:D+1,amount:A.newLines.length}),O+=A.newLines.length,A=y[++M]}else this.lines.set(U,m[D--]);let F=0;for(let U=k.length-1;U>=0;U--)k[U].index+=F,this.lines.onInsertEmitter.fire(k[U]),F+=k[U].amount;const H=Math.max(0,b+x-this.lines.maxLength);H>0&&this.lines.onTrimEmitter.fire(H)}}translateBufferLineToString(o,c,p=0,y){const x=this.lines.get(o);return x?x.translateToString(c,p,y):""}getWrappedRangeForLine(o){let c=o,p=o;for(;c>0&&this.lines.get(c).isWrapped;)c--;for(;p+1<this.lines.length&&this.lines.get(p+1).isWrapped;)p++;return{first:c,last:p}}setupTabStops(o){for(o!=null?this.tabs[o]||(o=this.prevStop(o)):(this.tabs={},o=0);o<this._cols;o+=this._optionsService.rawOptions.tabStopWidth)this.tabs[o]=!0}prevStop(o){for(o==null&&(o=this.x);!this.tabs[--o]&&o>0;);return o>=this._cols?this._cols-1:o<0?0:o}nextStop(o){for(o==null&&(o=this.x);!this.tabs[++o]&&o<this._cols;);return o>=this._cols?this._cols-1:o<0?0:o}clearMarkers(o){this._isClearing=!0;for(let c=0;c<this.markers.length;c++)this.markers[c].line===o&&(this.markers[c].dispose(),this.markers.splice(c--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let o=0;o<this.markers.length;o++)this.markers[o].dispose(),this.markers.splice(o--,1);this._isClearing=!1}addMarker(o){const c=new l.Marker(o);return this.markers.push(c),c.register(this.lines.onTrim(p=>{c.line-=p,c.line<0&&c.dispose()})),c.register(this.lines.onInsert(p=>{c.line>=p.index&&(c.line+=p.amount)})),c.register(this.lines.onDelete(p=>{c.line>=p.index&&c.line<p.index+p.amount&&c.dispose(),c.line>p.index&&(c.line-=p.amount)})),c.register(c.onDispose(()=>this._removeMarker(c))),c}_removeMarker(o){this._isClearing||this.markers.splice(this.markers.indexOf(o),1)}}},8437:(v,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferLine=n.DEFAULT_ATTR_DATA=void 0;const d=u(3734),g=u(511),f=u(643),_=u(482);n.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let C=0;class w{constructor(l,a,o=!1){this.isWrapped=o,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*l);const c=a||g.CellData.fromCharData([0,f.NULL_CELL_CHAR,f.NULL_CELL_WIDTH,f.NULL_CELL_CODE]);for(let p=0;p<l;++p)this.setCell(p,c);this.length=l}get(l){const a=this._data[3*l+0],o=2097151&a;return[this._data[3*l+1],2097152&a?this._combined[l]:o?(0,_.stringFromCodePoint)(o):"",a>>22,2097152&a?this._combined[l].charCodeAt(this._combined[l].length-1):o]}set(l,a){this._data[3*l+1]=a[f.CHAR_DATA_ATTR_INDEX],a[f.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[l]=a[1],this._data[3*l+0]=2097152|l|a[f.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*l+0]=a[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|a[f.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(l){return this._data[3*l+0]>>22}hasWidth(l){return 12582912&this._data[3*l+0]}getFg(l){return this._data[3*l+1]}getBg(l){return this._data[3*l+2]}hasContent(l){return 4194303&this._data[3*l+0]}getCodePoint(l){const a=this._data[3*l+0];return 2097152&a?this._combined[l].charCodeAt(this._combined[l].length-1):2097151&a}isCombined(l){return 2097152&this._data[3*l+0]}getString(l){const a=this._data[3*l+0];return 2097152&a?this._combined[l]:2097151&a?(0,_.stringFromCodePoint)(2097151&a):""}isProtected(l){return 536870912&this._data[3*l+2]}loadCell(l,a){return C=3*l,a.content=this._data[C+0],a.fg=this._data[C+1],a.bg=this._data[C+2],2097152&a.content&&(a.combinedData=this._combined[l]),268435456&a.bg&&(a.extended=this._extendedAttrs[l]),a}setCell(l,a){2097152&a.content&&(this._combined[l]=a.combinedData),268435456&a.bg&&(this._extendedAttrs[l]=a.extended),this._data[3*l+0]=a.content,this._data[3*l+1]=a.fg,this._data[3*l+2]=a.bg}setCellFromCodePoint(l,a,o,c,p,y){268435456&p&&(this._extendedAttrs[l]=y),this._data[3*l+0]=a|o<<22,this._data[3*l+1]=c,this._data[3*l+2]=p}addCodepointToCell(l,a){let o=this._data[3*l+0];2097152&o?this._combined[l]+=(0,_.stringFromCodePoint)(a):(2097151&o?(this._combined[l]=(0,_.stringFromCodePoint)(2097151&o)+(0,_.stringFromCodePoint)(a),o&=-2097152,o|=2097152):o=a|4194304,this._data[3*l+0]=o)}insertCells(l,a,o,c){if((l%=this.length)&&this.getWidth(l-1)===2&&this.setCellFromCodePoint(l-1,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new d.ExtendedAttrs),a<this.length-l){const p=new g.CellData;for(let y=this.length-l-a-1;y>=0;--y)this.setCell(l+a+y,this.loadCell(l+y,p));for(let y=0;y<a;++y)this.setCell(l+y,o)}else for(let p=l;p<this.length;++p)this.setCell(p,o);this.getWidth(this.length-1)===2&&this.setCellFromCodePoint(this.length-1,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new d.ExtendedAttrs)}deleteCells(l,a,o,c){if(l%=this.length,a<this.length-l){const p=new g.CellData;for(let y=0;y<this.length-l-a;++y)this.setCell(l+y,this.loadCell(l+a+y,p));for(let y=this.length-a;y<this.length;++y)this.setCell(y,o)}else for(let p=l;p<this.length;++p)this.setCell(p,o);l&&this.getWidth(l-1)===2&&this.setCellFromCodePoint(l-1,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new d.ExtendedAttrs),this.getWidth(l)!==0||this.hasContent(l)||this.setCellFromCodePoint(l,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new d.ExtendedAttrs)}replaceCells(l,a,o,c,p=!1){if(p)for(l&&this.getWidth(l-1)===2&&!this.isProtected(l-1)&&this.setCellFromCodePoint(l-1,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new d.ExtendedAttrs),a<this.length&&this.getWidth(a-1)===2&&!this.isProtected(a)&&this.setCellFromCodePoint(a,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new d.ExtendedAttrs);l<a&&l<this.length;)this.isProtected(l)||this.setCell(l,o),l++;else for(l&&this.getWidth(l-1)===2&&this.setCellFromCodePoint(l-1,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new d.ExtendedAttrs),a<this.length&&this.getWidth(a-1)===2&&this.setCellFromCodePoint(a,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new d.ExtendedAttrs);l<a&&l<this.length;)this.setCell(l++,o)}resize(l,a){if(l===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const o=3*l;if(l>this.length){if(this._data.buffer.byteLength>=4*o)this._data=new Uint32Array(this._data.buffer,0,o);else{const c=new Uint32Array(o);c.set(this._data),this._data=c}for(let c=this.length;c<l;++c)this.setCell(c,a)}else{this._data=this._data.subarray(0,o);const c=Object.keys(this._combined);for(let y=0;y<c.length;y++){const x=parseInt(c[y],10);x>=l&&delete this._combined[x]}const p=Object.keys(this._extendedAttrs);for(let y=0;y<p.length;y++){const x=parseInt(p[y],10);x>=l&&delete this._extendedAttrs[x]}}return this.length=l,4*o*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const l=new Uint32Array(this._data.length);return l.set(this._data),this._data=l,1}return 0}fill(l,a=!1){if(a)for(let o=0;o<this.length;++o)this.isProtected(o)||this.setCell(o,l);else{this._combined={},this._extendedAttrs={};for(let o=0;o<this.length;++o)this.setCell(o,l)}}copyFrom(l){this.length!==l.length?this._data=new Uint32Array(l._data):this._data.set(l._data),this.length=l.length,this._combined={};for(const a in l._combined)this._combined[a]=l._combined[a];this._extendedAttrs={};for(const a in l._extendedAttrs)this._extendedAttrs[a]=l._extendedAttrs[a];this.isWrapped=l.isWrapped}clone(){const l=new w(0);l._data=new Uint32Array(this._data),l.length=this.length;for(const a in this._combined)l._combined[a]=this._combined[a];for(const a in this._extendedAttrs)l._extendedAttrs[a]=this._extendedAttrs[a];return l.isWrapped=this.isWrapped,l}getTrimmedLength(){for(let l=this.length-1;l>=0;--l)if(4194303&this._data[3*l+0])return l+(this._data[3*l+0]>>22);return 0}getNoBgTrimmedLength(){for(let l=this.length-1;l>=0;--l)if(4194303&this._data[3*l+0]||50331648&this._data[3*l+2])return l+(this._data[3*l+0]>>22);return 0}copyCellsFrom(l,a,o,c,p){const y=l._data;if(p)for(let k=c-1;k>=0;k--){for(let m=0;m<3;m++)this._data[3*(o+k)+m]=y[3*(a+k)+m];268435456&y[3*(a+k)+2]&&(this._extendedAttrs[o+k]=l._extendedAttrs[a+k])}else for(let k=0;k<c;k++){for(let m=0;m<3;m++)this._data[3*(o+k)+m]=y[3*(a+k)+m];268435456&y[3*(a+k)+2]&&(this._extendedAttrs[o+k]=l._extendedAttrs[a+k])}const x=Object.keys(l._combined);for(let k=0;k<x.length;k++){const m=parseInt(x[k],10);m>=a&&(this._combined[m-a+o]=l._combined[m])}}translateToString(l=!1,a=0,o=this.length){l&&(o=Math.min(o,this.getTrimmedLength()));let c="";for(;a<o;){const p=this._data[3*a+0],y=2097151&p;c+=2097152&p?this._combined[a]:y?(0,_.stringFromCodePoint)(y):f.WHITESPACE_CELL_CHAR,a+=p>>22||1}return c}}n.BufferLine=w},4841:(v,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.getRangeLength=void 0,n.getRangeLength=function(u,d){if(u.start.y>u.end.y)throw new Error(`Buffer range end (${u.end.x}, ${u.end.y}) cannot be before start (${u.start.x}, ${u.start.y})`);return d*(u.end.y-u.start.y)+(u.end.x-u.start.x+1)}},4634:(v,n)=>{function u(d,g,f){if(g===d.length-1)return d[g].getTrimmedLength();const _=!d[g].hasContent(f-1)&&d[g].getWidth(f-1)===1,C=d[g+1].getWidth(0)===2;return _&&C?f-1:f}Object.defineProperty(n,"__esModule",{value:!0}),n.getWrappedLineTrimmedLength=n.reflowSmallerGetNewLineLengths=n.reflowLargerApplyNewLayout=n.reflowLargerCreateNewLayout=n.reflowLargerGetLinesToRemove=void 0,n.reflowLargerGetLinesToRemove=function(d,g,f,_,C){const w=[];for(let S=0;S<d.length-1;S++){let l=S,a=d.get(++l);if(!a.isWrapped)continue;const o=[d.get(S)];for(;l<d.length&&a.isWrapped;)o.push(a),a=d.get(++l);if(_>=S&&_<l){S+=o.length-1;continue}let c=0,p=u(o,c,g),y=1,x=0;for(;y<o.length;){const m=u(o,y,g),b=m-x,D=f-p,M=Math.min(b,D);o[c].copyCellsFrom(o[y],x,p,M,!1),p+=M,p===f&&(c++,p=0),x+=M,x===m&&(y++,x=0),p===0&&c!==0&&o[c-1].getWidth(f-1)===2&&(o[c].copyCellsFrom(o[c-1],f-1,p++,1,!1),o[c-1].setCell(f-1,C))}o[c].replaceCells(p,f,C);let k=0;for(let m=o.length-1;m>0&&(m>c||o[m].getTrimmedLength()===0);m--)k++;k>0&&(w.push(S+o.length-k),w.push(k)),S+=o.length-1}return w},n.reflowLargerCreateNewLayout=function(d,g){const f=[];let _=0,C=g[_],w=0;for(let S=0;S<d.length;S++)if(C===S){const l=g[++_];d.onDeleteEmitter.fire({index:S-w,amount:l}),S+=l-1,w+=l,C=g[++_]}else f.push(S);return{layout:f,countRemoved:w}},n.reflowLargerApplyNewLayout=function(d,g){const f=[];for(let _=0;_<g.length;_++)f.push(d.get(g[_]));for(let _=0;_<f.length;_++)d.set(_,f[_]);d.length=g.length},n.reflowSmallerGetNewLineLengths=function(d,g,f){const _=[],C=d.map((a,o)=>u(d,o,g)).reduce((a,o)=>a+o);let w=0,S=0,l=0;for(;l<C;){if(C-l<f){_.push(C-l);break}w+=f;const a=u(d,S,g);w>a&&(w-=a,S++);const o=d[S].getWidth(w-1)===2;o&&w--;const c=o?f-1:f;_.push(c),l+=c}return _},n.getWrappedLineTrimmedLength=u},5295:(v,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferSet=void 0;const d=u(8460),g=u(844),f=u(9092);class _ extends g.Disposable{constructor(w,S){super(),this._optionsService=w,this._bufferService=S,this._onBufferActivate=this.register(new d.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 f.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new f.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(w){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(w),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(w,S){this._normal.resize(w,S),this._alt.resize(w,S),this.setupTabStops(w)}setupTabStops(w){this._normal.setupTabStops(w),this._alt.setupTabStops(w)}}n.BufferSet=_},511:(v,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CellData=void 0;const d=u(482),g=u(643),f=u(3734);class _ extends f.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new f.ExtendedAttrs,this.combinedData=""}static fromCharData(w){const S=new _;return S.setFromCharData(w),S}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(w){this.fg=w[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let S=!1;if(w[g.CHAR_DATA_CHAR_INDEX].length>2)S=!0;else if(w[g.CHAR_DATA_CHAR_INDEX].length===2){const l=w[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=l&&l<=56319){const a=w[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=a&&a<=57343?this.content=1024*(l-55296)+a-56320+65536|w[g.CHAR_DATA_WIDTH_INDEX]<<22:S=!0}else S=!0}else this.content=w[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|w[g.CHAR_DATA_WIDTH_INDEX]<<22;S&&(this.combinedData=w[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|w[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.CellData=_},643:(v,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WHITESPACE_CELL_CODE=n.WHITESPACE_CELL_WIDTH=n.WHITESPACE_CELL_CHAR=n.NULL_CELL_CODE=n.NULL_CELL_WIDTH=n.NULL_CELL_CHAR=n.CHAR_DATA_CODE_INDEX=n.CHAR_DATA_WIDTH_INDEX=n.CHAR_DATA_CHAR_INDEX=n.CHAR_DATA_ATTR_INDEX=n.DEFAULT_EXT=n.DEFAULT_ATTR=n.DEFAULT_COLOR=void 0,n.DEFAULT_COLOR=0,n.DEFAULT_ATTR=256|n.DEFAULT_COLOR<<9,n.DEFAULT_EXT=0,n.CHAR_DATA_ATTR_INDEX=0,n.CHAR_DATA_CHAR_INDEX=1,n.CHAR_DATA_WIDTH_INDEX=2,n.CHAR_DATA_CODE_INDEX=3,n.NULL_CELL_CHAR="",n.NULL_CELL_WIDTH=1,n.NULL_CELL_CODE=0,n.WHITESPACE_CELL_CHAR=" ",n.WHITESPACE_CELL_WIDTH=1,n.WHITESPACE_CELL_CODE=32},4863:(v,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Marker=void 0;const d=u(8460),g=u(844);class f{get id(){return this._id}constructor(C){this.line=C,this.isDisposed=!1,this._disposables=[],this._id=f._nextId++,this._onDispose=this.register(new d.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(C){return this._disposables.push(C),C}}n.Marker=f,f._nextId=1},7116:(v,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DEFAULT_CHARSET=n.CHARSETS=void 0,n.CHARSETS={},n.DEFAULT_CHARSET=n.CHARSETS.B,n.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:"≥","{":"π","|":"≠","}":"£","~":"·"},n.CHARSETS.A={"#":"£"},n.CHARSETS.B=void 0,n.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},n.CHARSETS.C=n.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},n.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},n.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},n.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},n.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},n.CHARSETS.E=n.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},n.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},n.CHARSETS.H=n.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},n.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(v,n)=>{var u,d,g;Object.defineProperty(n,"__esModule",{value:!0}),n.C1_ESCAPED=n.C1=n.C0=void 0,function(f){f.NUL="\0",f.SOH="",f.STX="",f.ETX="",f.EOT="",f.ENQ="",f.ACK="",f.BEL="\x07",f.BS="\b",f.HT=" ",f.LF=`
55
+ `,f.VT="\v",f.FF="\f",f.CR="\r",f.SO="",f.SI="",f.DLE="",f.DC1="",f.DC2="",f.DC3="",f.DC4="",f.NAK="",f.SYN="",f.ETB="",f.CAN="",f.EM="",f.SUB="",f.ESC="\x1B",f.FS="",f.GS="",f.RS="",f.US="",f.SP=" ",f.DEL=""}(u||(n.C0=u={})),function(f){f.PAD="€",f.HOP="",f.BPH="‚",f.NBH="ƒ",f.IND="„",f.NEL="…",f.SSA="†",f.ESA="‡",f.HTS="ˆ",f.HTJ="‰",f.VTS="Š",f.PLD="‹",f.PLU="Œ",f.RI="",f.SS2="Ž",f.SS3="",f.DCS="",f.PU1="‘",f.PU2="’",f.STS="“",f.CCH="”",f.MW="•",f.SPA="–",f.EPA="—",f.SOS="˜",f.SGCI="™",f.SCI="š",f.CSI="›",f.ST="œ",f.OSC="",f.PM="ž",f.APC="Ÿ"}(d||(n.C1=d={})),function(f){f.ST=`${u.ESC}\\`}(g||(n.C1_ESCAPED=g={}))},7399:(v,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.evaluateKeyboardEvent=void 0;const d=u(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:["'",'"']};n.evaluateKeyboardEvent=function(f,_,C,w){const S={type:0,cancel:!1,key:void 0},l=(f.shiftKey?1:0)|(f.altKey?2:0)|(f.ctrlKey?4:0)|(f.metaKey?8:0);switch(f.keyCode){case 0:f.key==="UIKeyInputUpArrow"?S.key=_?d.C0.ESC+"OA":d.C0.ESC+"[A":f.key==="UIKeyInputLeftArrow"?S.key=_?d.C0.ESC+"OD":d.C0.ESC+"[D":f.key==="UIKeyInputRightArrow"?S.key=_?d.C0.ESC+"OC":d.C0.ESC+"[C":f.key==="UIKeyInputDownArrow"&&(S.key=_?d.C0.ESC+"OB":d.C0.ESC+"[B");break;case 8:if(f.altKey){S.key=d.C0.ESC+d.C0.DEL;break}S.key=d.C0.DEL;break;case 9:if(f.shiftKey){S.key=d.C0.ESC+"[Z";break}S.key=d.C0.HT,S.cancel=!0;break;case 13:S.key=f.altKey?d.C0.ESC+d.C0.CR:d.C0.CR,S.cancel=!0;break;case 27:S.key=d.C0.ESC,f.altKey&&(S.key=d.C0.ESC+d.C0.ESC),S.cancel=!0;break;case 37:if(f.metaKey)break;l?(S.key=d.C0.ESC+"[1;"+(l+1)+"D",S.key===d.C0.ESC+"[1;3D"&&(S.key=d.C0.ESC+(C?"b":"[1;5D"))):S.key=_?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(f.metaKey)break;l?(S.key=d.C0.ESC+"[1;"+(l+1)+"C",S.key===d.C0.ESC+"[1;3C"&&(S.key=d.C0.ESC+(C?"f":"[1;5C"))):S.key=_?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(f.metaKey)break;l?(S.key=d.C0.ESC+"[1;"+(l+1)+"A",C||S.key!==d.C0.ESC+"[1;3A"||(S.key=d.C0.ESC+"[1;5A")):S.key=_?d.C0.ESC+"OA":d.C0.ESC+"[A";break;case 40:if(f.metaKey)break;l?(S.key=d.C0.ESC+"[1;"+(l+1)+"B",C||S.key!==d.C0.ESC+"[1;3B"||(S.key=d.C0.ESC+"[1;5B")):S.key=_?d.C0.ESC+"OB":d.C0.ESC+"[B";break;case 45:f.shiftKey||f.ctrlKey||(S.key=d.C0.ESC+"[2~");break;case 46:S.key=l?d.C0.ESC+"[3;"+(l+1)+"~":d.C0.ESC+"[3~";break;case 36:S.key=l?d.C0.ESC+"[1;"+(l+1)+"H":_?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:S.key=l?d.C0.ESC+"[1;"+(l+1)+"F":_?d.C0.ESC+"OF":d.C0.ESC+"[F";break;case 33:f.shiftKey?S.type=2:f.ctrlKey?S.key=d.C0.ESC+"[5;"+(l+1)+"~":S.key=d.C0.ESC+"[5~";break;case 34:f.shiftKey?S.type=3:f.ctrlKey?S.key=d.C0.ESC+"[6;"+(l+1)+"~":S.key=d.C0.ESC+"[6~";break;case 112:S.key=l?d.C0.ESC+"[1;"+(l+1)+"P":d.C0.ESC+"OP";break;case 113:S.key=l?d.C0.ESC+"[1;"+(l+1)+"Q":d.C0.ESC+"OQ";break;case 114:S.key=l?d.C0.ESC+"[1;"+(l+1)+"R":d.C0.ESC+"OR";break;case 115:S.key=l?d.C0.ESC+"[1;"+(l+1)+"S":d.C0.ESC+"OS";break;case 116:S.key=l?d.C0.ESC+"[15;"+(l+1)+"~":d.C0.ESC+"[15~";break;case 117:S.key=l?d.C0.ESC+"[17;"+(l+1)+"~":d.C0.ESC+"[17~";break;case 118:S.key=l?d.C0.ESC+"[18;"+(l+1)+"~":d.C0.ESC+"[18~";break;case 119:S.key=l?d.C0.ESC+"[19;"+(l+1)+"~":d.C0.ESC+"[19~";break;case 120:S.key=l?d.C0.ESC+"[20;"+(l+1)+"~":d.C0.ESC+"[20~";break;case 121:S.key=l?d.C0.ESC+"[21;"+(l+1)+"~":d.C0.ESC+"[21~";break;case 122:S.key=l?d.C0.ESC+"[23;"+(l+1)+"~":d.C0.ESC+"[23~";break;case 123:S.key=l?d.C0.ESC+"[24;"+(l+1)+"~":d.C0.ESC+"[24~";break;default:if(!f.ctrlKey||f.shiftKey||f.altKey||f.metaKey)if(C&&!w||!f.altKey||f.metaKey)!C||f.altKey||f.ctrlKey||f.shiftKey||!f.metaKey?f.key&&!f.ctrlKey&&!f.altKey&&!f.metaKey&&f.keyCode>=48&&f.key.length===1?S.key=f.key:f.key&&f.ctrlKey&&(f.key==="_"&&(S.key=d.C0.US),f.key==="@"&&(S.key=d.C0.NUL)):f.keyCode===65&&(S.type=1);else{const a=g[f.keyCode],o=a==null?void 0:a[f.shiftKey?1:0];if(o)S.key=d.C0.ESC+o;else if(f.keyCode>=65&&f.keyCode<=90){const c=f.ctrlKey?f.keyCode-64:f.keyCode+32;let p=String.fromCharCode(c);f.shiftKey&&(p=p.toUpperCase()),S.key=d.C0.ESC+p}else if(f.keyCode===32)S.key=d.C0.ESC+(f.ctrlKey?d.C0.NUL:" ");else if(f.key==="Dead"&&f.code.startsWith("Key")){let c=f.code.slice(3,4);f.shiftKey||(c=c.toLowerCase()),S.key=d.C0.ESC+c,S.cancel=!0}}else f.keyCode>=65&&f.keyCode<=90?S.key=String.fromCharCode(f.keyCode-64):f.keyCode===32?S.key=d.C0.NUL:f.keyCode>=51&&f.keyCode<=55?S.key=String.fromCharCode(f.keyCode-51+27):f.keyCode===56?S.key=d.C0.DEL:f.keyCode===219?S.key=d.C0.ESC:f.keyCode===220?S.key=d.C0.FS:f.keyCode===221&&(S.key=d.C0.GS)}return S}},482:(v,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Utf8ToUtf32=n.StringToUtf32=n.utf32ToString=n.stringFromCodePoint=void 0,n.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},n.utf32ToString=function(u,d=0,g=u.length){let f="";for(let _=d;_<g;++_){let C=u[_];C>65535?(C-=65536,f+=String.fromCharCode(55296+(C>>10))+String.fromCharCode(C%1024+56320)):f+=String.fromCharCode(C)}return f},n.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,d){const g=u.length;if(!g)return 0;let f=0,_=0;if(this._interim){const C=u.charCodeAt(_++);56320<=C&&C<=57343?d[f++]=1024*(this._interim-55296)+C-56320+65536:(d[f++]=this._interim,d[f++]=C),this._interim=0}for(let C=_;C<g;++C){const w=u.charCodeAt(C);if(55296<=w&&w<=56319){if(++C>=g)return this._interim=w,f;const S=u.charCodeAt(C);56320<=S&&S<=57343?d[f++]=1024*(w-55296)+S-56320+65536:(d[f++]=w,d[f++]=S)}else w!==65279&&(d[f++]=w)}return f}},n.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,d){const g=u.length;if(!g)return 0;let f,_,C,w,S=0,l=0,a=0;if(this.interim[0]){let p=!1,y=this.interim[0];y&=(224&y)==192?31:(240&y)==224?15:7;let x,k=0;for(;(x=63&this.interim[++k])&&k<4;)y<<=6,y|=x;const m=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,b=m-k;for(;a<b;){if(a>=g)return 0;if(x=u[a++],(192&x)!=128){a--,p=!0;break}this.interim[k++]=x,y<<=6,y|=63&x}p||(m===2?y<128?a--:d[S++]=y:m===3?y<2048||y>=55296&&y<=57343||y===65279||(d[S++]=y):y<65536||y>1114111||(d[S++]=y)),this.interim.fill(0)}const o=g-4;let c=a;for(;c<g;){for(;!(!(c<o)||128&(f=u[c])||128&(_=u[c+1])||128&(C=u[c+2])||128&(w=u[c+3]));)d[S++]=f,d[S++]=_,d[S++]=C,d[S++]=w,c+=4;if(f=u[c++],f<128)d[S++]=f;else if((224&f)==192){if(c>=g)return this.interim[0]=f,S;if(_=u[c++],(192&_)!=128){c--;continue}if(l=(31&f)<<6|63&_,l<128){c--;continue}d[S++]=l}else if((240&f)==224){if(c>=g)return this.interim[0]=f,S;if(_=u[c++],(192&_)!=128){c--;continue}if(c>=g)return this.interim[0]=f,this.interim[1]=_,S;if(C=u[c++],(192&C)!=128){c--;continue}if(l=(15&f)<<12|(63&_)<<6|63&C,l<2048||l>=55296&&l<=57343||l===65279)continue;d[S++]=l}else if((248&f)==240){if(c>=g)return this.interim[0]=f,S;if(_=u[c++],(192&_)!=128){c--;continue}if(c>=g)return this.interim[0]=f,this.interim[1]=_,S;if(C=u[c++],(192&C)!=128){c--;continue}if(c>=g)return this.interim[0]=f,this.interim[1]=_,this.interim[2]=C,S;if(w=u[c++],(192&w)!=128){c--;continue}if(l=(7&f)<<18|(63&_)<<12|(63&C)<<6|63&w,l<65536||l>1114111)continue;d[S++]=l}}return S}}},225:(v,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeV6=void 0;const u=[[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]],d=[[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;n.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 f=0;f<u.length;++f)g.fill(0,u[f][0],u[f][1]+1)}}wcwidth(f){return f<32?0:f<127?1:f<65536?g[f]:function(_,C){let w,S=0,l=C.length-1;if(_<C[0][0]||_>C[l][1])return!1;for(;l>=S;)if(w=S+l>>1,_>C[w][1])S=w+1;else{if(!(_<C[w][0]))return!0;l=w-1}return!1}(f,d)?0:f>=131072&&f<=196605||f>=196608&&f<=262141?2:1}}},5981:(v,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WriteBuffer=void 0;const d=u(8460),g=u(844);class f extends g.Disposable{constructor(C){super(),this._action=C,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(C,w){if(w!==void 0&&this._syncCalls>w)return void(this._syncCalls=0);if(this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let S;for(this._isSyncWriting=!0;S=this._writeBuffer.shift();){this._action(S);const l=this._callbacks.shift();l&&l()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(C,w){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+=C.length,this._writeBuffer.push(C),this._callbacks.push(w),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(w)}_innerWrite(C=0,w=!0){const S=C||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const l=this._writeBuffer[this._bufferOffset],a=this._action(l,w);if(a){const c=p=>Date.now()-S>=12?setTimeout(()=>this._innerWrite(0,p)):this._innerWrite(S,p);return void a.catch(p=>(queueMicrotask(()=>{throw p}),Promise.resolve(!1))).then(c)}const o=this._callbacks[this._bufferOffset];if(o&&o(),this._bufferOffset++,this._pendingData-=l.length,Date.now()-S>=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()}}n.WriteBuffer=f},5941:(v,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.toRgbString=n.parseColor=void 0;const u=/^([\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})$/,d=/^[\da-f]+$/;function g(f,_){const C=f.toString(16),w=C.length<2?"0"+C:C;switch(_){case 4:return C[0];case 8:return w;case 12:return(w+w).slice(0,3);default:return w+w}}n.parseColor=function(f){if(!f)return;let _=f.toLowerCase();if(_.indexOf("rgb:")===0){_=_.slice(4);const C=u.exec(_);if(C){const w=C[1]?15:C[4]?255:C[7]?4095:65535;return[Math.round(parseInt(C[1]||C[4]||C[7]||C[10],16)/w*255),Math.round(parseInt(C[2]||C[5]||C[8]||C[11],16)/w*255),Math.round(parseInt(C[3]||C[6]||C[9]||C[12],16)/w*255)]}}else if(_.indexOf("#")===0&&(_=_.slice(1),d.exec(_)&&[3,6,9,12].includes(_.length))){const C=_.length/3,w=[0,0,0];for(let S=0;S<3;++S){const l=parseInt(_.slice(C*S,C*S+C),16);w[S]=C===1?l<<4:C===2?l:C===3?l>>4:l>>8}return w}},n.toRgbString=function(f,_=16){const[C,w,S]=f;return`rgb:${g(C,_)}/${g(w,_)}/${g(S,_)}`}},5770:(v,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.PAYLOAD_LIMIT=void 0,n.PAYLOAD_LIMIT=1e7},6351:(v,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DcsHandler=n.DcsParser=void 0;const d=u(482),g=u(8742),f=u(5770),_=[];n.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(w,S){this._handlers[w]===void 0&&(this._handlers[w]=[]);const l=this._handlers[w];return l.push(S),{dispose:()=>{const a=l.indexOf(S);a!==-1&&l.splice(a,1)}}}clearHandler(w){this._handlers[w]&&delete this._handlers[w]}setHandlerFallback(w){this._handlerFb=w}reset(){if(this._active.length)for(let w=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;w>=0;--w)this._active[w].unhook(!1);this._stack.paused=!1,this._active=_,this._ident=0}hook(w,S){if(this.reset(),this._ident=w,this._active=this._handlers[w]||_,this._active.length)for(let l=this._active.length-1;l>=0;l--)this._active[l].hook(S);else this._handlerFb(this._ident,"HOOK",S)}put(w,S,l){if(this._active.length)for(let a=this._active.length-1;a>=0;a--)this._active[a].put(w,S,l);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(w,S,l))}unhook(w,S=!0){if(this._active.length){let l=!1,a=this._active.length-1,o=!1;if(this._stack.paused&&(a=this._stack.loopPosition-1,l=S,o=this._stack.fallThrough,this._stack.paused=!1),!o&&l===!1){for(;a>=0&&(l=this._active[a].unhook(w),l!==!0);a--)if(l instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=a,this._stack.fallThrough=!1,l;a--}for(;a>=0;a--)if(l=this._active[a].unhook(!1),l instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=a,this._stack.fallThrough=!0,l}else this._handlerFb(this._ident,"UNHOOK",w);this._active=_,this._ident=0}};const C=new g.Params;C.addParam(0),n.DcsHandler=class{constructor(w){this._handler=w,this._data="",this._params=C,this._hitLimit=!1}hook(w){this._params=w.length>1||w.params[0]?w.clone():C,this._data="",this._hitLimit=!1}put(w,S,l){this._hitLimit||(this._data+=(0,d.utf32ToString)(w,S,l),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(w){let S=!1;if(this._hitLimit)S=!1;else if(w&&(S=this._handler(this._data,this._params),S instanceof Promise))return S.then(l=>(this._params=C,this._data="",this._hitLimit=!1,l));return this._params=C,this._data="",this._hitLimit=!1,S}}},2015:(v,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.EscapeSequenceParser=n.VT500_TRANSITION_TABLE=n.TransitionTable=void 0;const d=u(844),g=u(8742),f=u(6242),_=u(6351);class C{constructor(a){this.table=new Uint8Array(a)}setDefault(a,o){this.table.fill(a<<4|o)}add(a,o,c,p){this.table[o<<8|a]=c<<4|p}addMany(a,o,c,p){for(let y=0;y<a.length;y++)this.table[o<<8|a[y]]=c<<4|p}}n.TransitionTable=C;const w=160;n.VT500_TRANSITION_TABLE=function(){const l=new C(4095),a=Array.apply(null,Array(256)).map((k,m)=>m),o=(k,m)=>a.slice(k,m),c=o(32,127),p=o(0,24);p.push(25),p.push.apply(p,o(28,32));const y=o(0,14);let x;for(x in l.setDefault(1,0),l.addMany(c,0,2,0),y)l.addMany([24,26,153,154],x,3,0),l.addMany(o(128,144),x,3,0),l.addMany(o(144,152),x,3,0),l.add(156,x,0,0),l.add(27,x,11,1),l.add(157,x,4,8),l.addMany([152,158,159],x,0,7),l.add(155,x,11,3),l.add(144,x,11,9);return l.addMany(p,0,3,0),l.addMany(p,1,3,1),l.add(127,1,0,1),l.addMany(p,8,0,8),l.addMany(p,3,3,3),l.add(127,3,0,3),l.addMany(p,4,3,4),l.add(127,4,0,4),l.addMany(p,6,3,6),l.addMany(p,5,3,5),l.add(127,5,0,5),l.addMany(p,2,3,2),l.add(127,2,0,2),l.add(93,1,4,8),l.addMany(c,8,5,8),l.add(127,8,5,8),l.addMany([156,27,24,26,7],8,6,0),l.addMany(o(28,32),8,0,8),l.addMany([88,94,95],1,0,7),l.addMany(c,7,0,7),l.addMany(p,7,0,7),l.add(156,7,0,0),l.add(127,7,0,7),l.add(91,1,11,3),l.addMany(o(64,127),3,7,0),l.addMany(o(48,60),3,8,4),l.addMany([60,61,62,63],3,9,4),l.addMany(o(48,60),4,8,4),l.addMany(o(64,127),4,7,0),l.addMany([60,61,62,63],4,0,6),l.addMany(o(32,64),6,0,6),l.add(127,6,0,6),l.addMany(o(64,127),6,0,0),l.addMany(o(32,48),3,9,5),l.addMany(o(32,48),5,9,5),l.addMany(o(48,64),5,0,6),l.addMany(o(64,127),5,7,0),l.addMany(o(32,48),4,9,5),l.addMany(o(32,48),1,9,2),l.addMany(o(32,48),2,9,2),l.addMany(o(48,127),2,10,0),l.addMany(o(48,80),1,10,0),l.addMany(o(81,88),1,10,0),l.addMany([89,90,92],1,10,0),l.addMany(o(96,127),1,10,0),l.add(80,1,11,9),l.addMany(p,9,0,9),l.add(127,9,0,9),l.addMany(o(28,32),9,0,9),l.addMany(o(32,48),9,9,12),l.addMany(o(48,60),9,8,10),l.addMany([60,61,62,63],9,9,10),l.addMany(p,11,0,11),l.addMany(o(32,128),11,0,11),l.addMany(o(28,32),11,0,11),l.addMany(p,10,0,10),l.add(127,10,0,10),l.addMany(o(28,32),10,0,10),l.addMany(o(48,60),10,8,10),l.addMany([60,61,62,63],10,0,11),l.addMany(o(32,48),10,9,12),l.addMany(p,12,0,12),l.add(127,12,0,12),l.addMany(o(28,32),12,0,12),l.addMany(o(32,48),12,9,12),l.addMany(o(48,64),12,0,11),l.addMany(o(64,127),12,12,13),l.addMany(o(64,127),10,12,13),l.addMany(o(64,127),9,12,13),l.addMany(p,13,13,13),l.addMany(c,13,13,13),l.add(127,13,0,13),l.addMany([27,156,24,26],13,14,0),l.add(w,0,2,0),l.add(w,8,5,8),l.add(w,6,0,6),l.add(w,11,0,11),l.add(w,13,13,13),l}();class S extends d.Disposable{constructor(a=n.VT500_TRANSITION_TABLE){super(),this._transitions=a,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=(o,c,p)=>{},this._executeHandlerFb=o=>{},this._csiHandlerFb=(o,c)=>{},this._escHandlerFb=o=>{},this._errorHandlerFb=o=>o,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,d.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new f.OscParser),this._dcsParser=this.register(new _.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(a,o=[64,126]){let c=0;if(a.prefix){if(a.prefix.length>1)throw new Error("only one byte as prefix supported");if(c=a.prefix.charCodeAt(0),c&&60>c||c>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(a.intermediates){if(a.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let y=0;y<a.intermediates.length;++y){const x=a.intermediates.charCodeAt(y);if(32>x||x>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");c<<=8,c|=x}}if(a.final.length!==1)throw new Error("final must be a single byte");const p=a.final.charCodeAt(0);if(o[0]>p||p>o[1])throw new Error(`final must be in range ${o[0]} .. ${o[1]}`);return c<<=8,c|=p,c}identToString(a){const o=[];for(;a;)o.push(String.fromCharCode(255&a)),a>>=8;return o.reverse().join("")}setPrintHandler(a){this._printHandler=a}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(a,o){const c=this._identifier(a,[48,126]);this._escHandlers[c]===void 0&&(this._escHandlers[c]=[]);const p=this._escHandlers[c];return p.push(o),{dispose:()=>{const y=p.indexOf(o);y!==-1&&p.splice(y,1)}}}clearEscHandler(a){this._escHandlers[this._identifier(a,[48,126])]&&delete this._escHandlers[this._identifier(a,[48,126])]}setEscHandlerFallback(a){this._escHandlerFb=a}setExecuteHandler(a,o){this._executeHandlers[a.charCodeAt(0)]=o}clearExecuteHandler(a){this._executeHandlers[a.charCodeAt(0)]&&delete this._executeHandlers[a.charCodeAt(0)]}setExecuteHandlerFallback(a){this._executeHandlerFb=a}registerCsiHandler(a,o){const c=this._identifier(a);this._csiHandlers[c]===void 0&&(this._csiHandlers[c]=[]);const p=this._csiHandlers[c];return p.push(o),{dispose:()=>{const y=p.indexOf(o);y!==-1&&p.splice(y,1)}}}clearCsiHandler(a){this._csiHandlers[this._identifier(a)]&&delete this._csiHandlers[this._identifier(a)]}setCsiHandlerFallback(a){this._csiHandlerFb=a}registerDcsHandler(a,o){return this._dcsParser.registerHandler(this._identifier(a),o)}clearDcsHandler(a){this._dcsParser.clearHandler(this._identifier(a))}setDcsHandlerFallback(a){this._dcsParser.setHandlerFallback(a)}registerOscHandler(a,o){return this._oscParser.registerHandler(a,o)}clearOscHandler(a){this._oscParser.clearHandler(a)}setOscHandlerFallback(a){this._oscParser.setHandlerFallback(a)}setErrorHandler(a){this._errorHandler=a}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(a,o,c,p,y){this._parseStack.state=a,this._parseStack.handlers=o,this._parseStack.handlerPos=c,this._parseStack.transition=p,this._parseStack.chunkPos=y}parse(a,o,c){let p,y=0,x=0,k=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,k=this._parseStack.chunkPos+1;else{if(c===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const m=this._parseStack.handlers;let b=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(c===!1&&b>-1){for(;b>=0&&(p=m[b](this._params),p!==!0);b--)if(p instanceof Promise)return this._parseStack.handlerPos=b,p}this._parseStack.handlers=[];break;case 4:if(c===!1&&b>-1){for(;b>=0&&(p=m[b](),p!==!0);b--)if(p instanceof Promise)return this._parseStack.handlerPos=b,p}this._parseStack.handlers=[];break;case 6:if(y=a[this._parseStack.chunkPos],p=this._dcsParser.unhook(y!==24&&y!==26,c),p)return p;y===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(y=a[this._parseStack.chunkPos],p=this._oscParser.end(y!==24&&y!==26,c),p)return p;y===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,k=this._parseStack.chunkPos+1,this.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(let m=k;m<o;++m){switch(y=a[m],x=this._transitions.table[this.currentState<<8|(y<160?y:w)],x>>4){case 2:for(let O=m+1;;++O){if(O>=o||(y=a[O])<32||y>126&&y<w){this._printHandler(a,m,O),m=O-1;break}if(++O>=o||(y=a[O])<32||y>126&&y<w){this._printHandler(a,m,O),m=O-1;break}if(++O>=o||(y=a[O])<32||y>126&&y<w){this._printHandler(a,m,O),m=O-1;break}if(++O>=o||(y=a[O])<32||y>126&&y<w){this._printHandler(a,m,O),m=O-1;break}}break;case 3:this._executeHandlers[y]?this._executeHandlers[y]():this._executeHandlerFb(y),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:m,code:y,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const b=this._csiHandlers[this._collect<<8|y];let D=b?b.length-1:-1;for(;D>=0&&(p=b[D](this._params),p!==!0);D--)if(p instanceof Promise)return this._preserveStack(3,b,D,x,m),p;D<0&&this._csiHandlerFb(this._collect<<8|y,this._params),this.precedingCodepoint=0;break;case 8:do switch(y){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(y-48)}while(++m<o&&(y=a[m])>47&&y<60);m--;break;case 9:this._collect<<=8,this._collect|=y;break;case 10:const M=this._escHandlers[this._collect<<8|y];let A=M?M.length-1:-1;for(;A>=0&&(p=M[A](),p!==!0);A--)if(p instanceof Promise)return this._preserveStack(4,M,A,x,m),p;A<0&&this._escHandlerFb(this._collect<<8|y),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|y,this._params);break;case 13:for(let O=m+1;;++O)if(O>=o||(y=a[O])===24||y===26||y===27||y>127&&y<w){this._dcsParser.put(a,m,O),m=O-1;break}break;case 14:if(p=this._dcsParser.unhook(y!==24&&y!==26),p)return this._preserveStack(6,[],0,x,m),p;y===27&&(x|=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 O=m+1;;O++)if(O>=o||(y=a[O])<32||y>127&&y<w){this._oscParser.put(a,m,O),m=O-1;break}break;case 6:if(p=this._oscParser.end(y!==24&&y!==26),p)return this._preserveStack(5,[],0,x,m),p;y===27&&(x|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0}this.currentState=15&x}}}n.EscapeSequenceParser=S},6242:(v,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.OscHandler=n.OscParser=void 0;const d=u(5770),g=u(482),f=[];n.OscParser=class{constructor(){this._state=0,this._active=f,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(_,C){this._handlers[_]===void 0&&(this._handlers[_]=[]);const w=this._handlers[_];return w.push(C),{dispose:()=>{const S=w.indexOf(C);S!==-1&&w.splice(S,1)}}}clearHandler(_){this._handlers[_]&&delete this._handlers[_]}setHandlerFallback(_){this._handlerFb=_}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=f}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=f,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||f,this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].start();else this._handlerFb(this._id,"START")}_put(_,C,w){if(this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].put(_,C,w);else this._handlerFb(this._id,"PUT",(0,g.utf32ToString)(_,C,w))}start(){this.reset(),this._state=1}put(_,C,w){if(this._state!==3){if(this._state===1)for(;C<w;){const S=_[C++];if(S===59){this._state=2,this._start();break}if(S<48||57<S)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+S-48}this._state===2&&w-C>0&&this._put(_,C,w)}}end(_,C=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let w=!1,S=this._active.length-1,l=!1;if(this._stack.paused&&(S=this._stack.loopPosition-1,w=C,l=this._stack.fallThrough,this._stack.paused=!1),!l&&w===!1){for(;S>=0&&(w=this._active[S].end(_),w!==!0);S--)if(w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!1,w;S--}for(;S>=0;S--)if(w=this._active[S].end(!1),w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!0,w}else this._handlerFb(this._id,"END",_);this._active=f,this._id=-1,this._state=0}}},n.OscHandler=class{constructor(_){this._handler=_,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(_,C,w){this._hitLimit||(this._data+=(0,g.utf32ToString)(_,C,w),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(_){let C=!1;if(this._hitLimit)C=!1;else if(_&&(C=this._handler(this._data),C instanceof Promise))return C.then(w=>(this._data="",this._hitLimit=!1,w));return this._data="",this._hitLimit=!1,C}}},8742:(v,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Params=void 0;const u=2147483647;class d{static fromArray(f){const _=new d;if(!f.length)return _;for(let C=Array.isArray(f[0])?1:0;C<f.length;++C){const w=f[C];if(Array.isArray(w))for(let S=0;S<w.length;++S)_.addSubParam(w[S]);else _.addParam(w)}return _}constructor(f=32,_=32){if(this.maxLength=f,this.maxSubParamsLength=_,_>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(f),this.length=0,this._subParams=new Int32Array(_),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(f),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const f=new d(this.maxLength,this.maxSubParamsLength);return f.params.set(this.params),f.length=this.length,f._subParams.set(this._subParams),f._subParamsLength=this._subParamsLength,f._subParamsIdx.set(this._subParamsIdx),f._rejectDigits=this._rejectDigits,f._rejectSubDigits=this._rejectSubDigits,f._digitIsSub=this._digitIsSub,f}toArray(){const f=[];for(let _=0;_<this.length;++_){f.push(this.params[_]);const C=this._subParamsIdx[_]>>8,w=255&this._subParamsIdx[_];w-C>0&&f.push(Array.prototype.slice.call(this._subParams,C,w))}return f}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(f){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=f>u?u:f}}addSubParam(f){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=f>u?u:f,this._subParamsIdx[this.length-1]++}}hasSubParams(f){return(255&this._subParamsIdx[f])-(this._subParamsIdx[f]>>8)>0}getSubParams(f){const _=this._subParamsIdx[f]>>8,C=255&this._subParamsIdx[f];return C-_>0?this._subParams.subarray(_,C):null}getSubParamsAll(){const f={};for(let _=0;_<this.length;++_){const C=this._subParamsIdx[_]>>8,w=255&this._subParamsIdx[_];w-C>0&&(f[_]=this._subParams.slice(C,w))}return f}addDigit(f){let _;if(this._rejectDigits||!(_=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const C=this._digitIsSub?this._subParams:this.params,w=C[_-1];C[_-1]=~w?Math.min(10*w+f,u):f}}n.Params=d},5741:(v,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.AddonManager=void 0,n.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let u=this._addons.length-1;u>=0;u--)this._addons[u].instance.dispose()}loadAddon(u,d){const g={instance:d,dispose:d.dispose,isDisposed:!1};this._addons.push(g),d.dispose=()=>this._wrappedAddonDispose(g),d.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let d=-1;for(let g=0;g<this._addons.length;g++)if(this._addons[g]===u){d=g;break}if(d===-1)throw new Error("Could not dispose an addon that has not been loaded");u.isDisposed=!0,u.dispose.apply(u.instance),this._addons.splice(d,1)}}},8771:(v,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferApiView=void 0;const d=u(3785),g=u(511);n.BufferApiView=class{constructor(f,_){this._buffer=f,this.type=_}init(f){return this._buffer=f,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(f){const _=this._buffer.lines.get(f);if(_)return new d.BufferLineApiView(_)}getNullCell(){return new g.CellData}}},3785:(v,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferLineApiView=void 0;const d=u(511);n.BufferLineApiView=class{constructor(g){this._line=g}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(g,f){if(!(g<0||g>=this._line.length))return f?(this._line.loadCell(g,f),f):this._line.loadCell(g,new d.CellData)}translateToString(g,f,_){return this._line.translateToString(g,f,_)}}},8285:(v,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferNamespaceApi=void 0;const d=u(8771),g=u(8460),f=u(844);class _ extends f.Disposable{constructor(w){super(),this._core=w,this._onBufferChange=this.register(new g.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new d.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new d.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)}}n.BufferNamespaceApi=_},7975:(v,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ParserApi=void 0,n.ParserApi=class{constructor(u){this._core=u}registerCsiHandler(u,d){return this._core.registerCsiHandler(u,g=>d(g.toArray()))}addCsiHandler(u,d){return this.registerCsiHandler(u,d)}registerDcsHandler(u,d){return this._core.registerDcsHandler(u,(g,f)=>d(g,f.toArray()))}addDcsHandler(u,d){return this.registerDcsHandler(u,d)}registerEscHandler(u,d){return this._core.registerEscHandler(u,d)}addEscHandler(u,d){return this.registerEscHandler(u,d)}registerOscHandler(u,d){return this._core.registerOscHandler(u,d)}addOscHandler(u,d){return this.registerOscHandler(u,d)}}},7090:(v,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeApi=void 0,n.UnicodeApi=class{constructor(u){this._core=u}register(u){this._core.unicodeService.register(u)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(u){this._core.unicodeService.activeVersion=u}}},744:function(v,n,u){var d=this&&this.__decorate||function(l,a,o,c){var p,y=arguments.length,x=y<3?a:c===null?c=Object.getOwnPropertyDescriptor(a,o):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(l,a,o,c);else for(var k=l.length-1;k>=0;k--)(p=l[k])&&(x=(y<3?p(x):y>3?p(a,o,x):p(a,o))||x);return y>3&&x&&Object.defineProperty(a,o,x),x},g=this&&this.__param||function(l,a){return function(o,c){a(o,c,l)}};Object.defineProperty(n,"__esModule",{value:!0}),n.BufferService=n.MINIMUM_ROWS=n.MINIMUM_COLS=void 0;const f=u(8460),_=u(844),C=u(5295),w=u(2585);n.MINIMUM_COLS=2,n.MINIMUM_ROWS=1;let S=n.BufferService=class extends _.Disposable{get buffer(){return this.buffers.active}constructor(l){super(),this.isUserScrolling=!1,this._onResize=this.register(new f.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new f.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(l.rawOptions.cols||0,n.MINIMUM_COLS),this.rows=Math.max(l.rawOptions.rows||0,n.MINIMUM_ROWS),this.buffers=this.register(new C.BufferSet(l,this))}resize(l,a){this.cols=l,this.rows=a,this.buffers.resize(l,a),this._onResize.fire({cols:l,rows:a})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(l,a=!1){const o=this.buffer;let c;c=this._cachedBlankLine,c&&c.length===this.cols&&c.getFg(0)===l.fg&&c.getBg(0)===l.bg||(c=o.getBlankLine(l,a),this._cachedBlankLine=c),c.isWrapped=a;const p=o.ybase+o.scrollTop,y=o.ybase+o.scrollBottom;if(o.scrollTop===0){const x=o.lines.isFull;y===o.lines.length-1?x?o.lines.recycle().copyFrom(c):o.lines.push(c.clone()):o.lines.splice(y+1,0,c.clone()),x?this.isUserScrolling&&(o.ydisp=Math.max(o.ydisp-1,0)):(o.ybase++,this.isUserScrolling||o.ydisp++)}else{const x=y-p+1;o.lines.shiftElements(p+1,x-1,-1),o.lines.set(y,c.clone())}this.isUserScrolling||(o.ydisp=o.ybase),this._onScroll.fire(o.ydisp)}scrollLines(l,a,o){const c=this.buffer;if(l<0){if(c.ydisp===0)return;this.isUserScrolling=!0}else l+c.ydisp>=c.ybase&&(this.isUserScrolling=!1);const p=c.ydisp;c.ydisp=Math.max(Math.min(c.ydisp+l,c.ybase),0),p!==c.ydisp&&(a||this._onScroll.fire(c.ydisp))}};n.BufferService=S=d([g(0,w.IOptionsService)],S)},7994:(v,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CharsetService=void 0,n.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(u){this.glevel=u,this.charset=this._charsets[u]}setgCharset(u,d){this._charsets[u]=d,this.glevel===u&&(this.charset=d)}}},1753:function(v,n,u){var d=this&&this.__decorate||function(c,p,y,x){var k,m=arguments.length,b=m<3?p:x===null?x=Object.getOwnPropertyDescriptor(p,y):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(c,p,y,x);else for(var D=c.length-1;D>=0;D--)(k=c[D])&&(b=(m<3?k(b):m>3?k(p,y,b):k(p,y))||b);return m>3&&b&&Object.defineProperty(p,y,b),b},g=this&&this.__param||function(c,p){return function(y,x){p(y,x,c)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CoreMouseService=void 0;const f=u(2585),_=u(8460),C=u(844),w={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:c=>c.button!==4&&c.action===1&&(c.ctrl=!1,c.alt=!1,c.shift=!1,!0)},VT200:{events:19,restrict:c=>c.action!==32},DRAG:{events:23,restrict:c=>c.action!==32||c.button!==3},ANY:{events:31,restrict:c=>!0}};function S(c,p){let y=(c.ctrl?16:0)|(c.shift?4:0)|(c.alt?8:0);return c.button===4?(y|=64,y|=c.action):(y|=3&c.button,4&c.button&&(y|=64),8&c.button&&(y|=128),c.action===32?y|=32:c.action!==0||p||(y|=3)),y}const l=String.fromCharCode,a={DEFAULT:c=>{const p=[S(c,!1)+32,c.col+32,c.row+32];return p[0]>255||p[1]>255||p[2]>255?"":`\x1B[M${l(p[0])}${l(p[1])}${l(p[2])}`},SGR:c=>{const p=c.action===0&&c.button!==4?"m":"M";return`\x1B[<${S(c,!0)};${c.col};${c.row}${p}`},SGR_PIXELS:c=>{const p=c.action===0&&c.button!==4?"m":"M";return`\x1B[<${S(c,!0)};${c.x};${c.y}${p}`}};let o=n.CoreMouseService=class extends C.Disposable{constructor(c,p){super(),this._bufferService=c,this._coreService=p,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new _.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const y of Object.keys(w))this.addProtocol(y,w[y]);for(const y of Object.keys(a))this.addEncoding(y,a[y]);this.reset()}addProtocol(c,p){this._protocols[c]=p}addEncoding(c,p){this._encodings[c]=p}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(c){if(!this._protocols[c])throw new Error(`unknown protocol "${c}"`);this._activeProtocol=c,this._onProtocolChange.fire(this._protocols[c].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(c){if(!this._encodings[c])throw new Error(`unknown encoding "${c}"`);this._activeEncoding=c}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(c){if(c.col<0||c.col>=this._bufferService.cols||c.row<0||c.row>=this._bufferService.rows||c.button===4&&c.action===32||c.button===3&&c.action!==32||c.button!==4&&(c.action===2||c.action===3)||(c.col++,c.row++,c.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,c,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(c))return!1;const p=this._encodings[this._activeEncoding](c);return p&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(p):this._coreService.triggerDataEvent(p,!0)),this._lastEvent=c,!0}explainEvents(c){return{down:!!(1&c),up:!!(2&c),drag:!!(4&c),move:!!(8&c),wheel:!!(16&c)}}_equalEvents(c,p,y){if(y){if(c.x!==p.x||c.y!==p.y)return!1}else if(c.col!==p.col||c.row!==p.row)return!1;return c.button===p.button&&c.action===p.action&&c.ctrl===p.ctrl&&c.alt===p.alt&&c.shift===p.shift}};n.CoreMouseService=o=d([g(0,f.IBufferService),g(1,f.ICoreService)],o)},6975:function(v,n,u){var d=this&&this.__decorate||function(o,c,p,y){var x,k=arguments.length,m=k<3?c:y===null?y=Object.getOwnPropertyDescriptor(c,p):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(o,c,p,y);else for(var b=o.length-1;b>=0;b--)(x=o[b])&&(m=(k<3?x(m):k>3?x(c,p,m):x(c,p))||m);return k>3&&m&&Object.defineProperty(c,p,m),m},g=this&&this.__param||function(o,c){return function(p,y){c(p,y,o)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CoreService=void 0;const f=u(1439),_=u(8460),C=u(844),w=u(2585),S=Object.freeze({insertMode:!1}),l=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let a=n.CoreService=class extends C.Disposable{constructor(o,c,p){super(),this._bufferService=o,this._logService=c,this._optionsService=p,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,f.clone)(S),this.decPrivateModes=(0,f.clone)(l)}reset(){this.modes=(0,f.clone)(S),this.decPrivateModes=(0,f.clone)(l)}triggerDataEvent(o,c=!1){if(this._optionsService.rawOptions.disableStdin)return;const p=this._bufferService.buffer;c&&this._optionsService.rawOptions.scrollOnUserInput&&p.ybase!==p.ydisp&&this._onRequestScrollToBottom.fire(),c&&this._onUserInput.fire(),this._logService.debug(`sending data "${o}"`,()=>o.split("").map(y=>y.charCodeAt(0))),this._onData.fire(o)}triggerBinaryEvent(o){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${o}"`,()=>o.split("").map(c=>c.charCodeAt(0))),this._onBinary.fire(o))}};n.CoreService=a=d([g(0,w.IBufferService),g(1,w.ILogService),g(2,w.IOptionsService)],a)},9074:(v,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DecorationService=void 0;const d=u(8055),g=u(8460),f=u(844),_=u(6106);let C=0,w=0;class S extends f.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new _.SortedList(o=>o==null?void 0:o.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,f.toDisposable)(()=>this.reset()))}registerDecoration(o){if(o.marker.isDisposed)return;const c=new l(o);if(c){const p=c.marker.onDispose(()=>c.dispose());c.onDispose(()=>{c&&(this._decorations.delete(c)&&this._onDecorationRemoved.fire(c),p.dispose())}),this._decorations.insert(c),this._onDecorationRegistered.fire(c)}return c}reset(){for(const o of this._decorations.values())o.dispose();this._decorations.clear()}*getDecorationsAtCell(o,c,p){var y,x,k;let m=0,b=0;for(const D of this._decorations.getKeyIterator(c))m=(y=D.options.x)!==null&&y!==void 0?y:0,b=m+((x=D.options.width)!==null&&x!==void 0?x:1),o>=m&&o<b&&(!p||((k=D.options.layer)!==null&&k!==void 0?k:"bottom")===p)&&(yield D)}forEachDecorationAtCell(o,c,p,y){this._decorations.forEachByKey(c,x=>{var k,m,b;C=(k=x.options.x)!==null&&k!==void 0?k:0,w=C+((m=x.options.width)!==null&&m!==void 0?m:1),o>=C&&o<w&&(!p||((b=x.options.layer)!==null&&b!==void 0?b:"bottom")===p)&&y(x)})}}n.DecorationService=S;class l extends f.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=d.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=d.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(o){super(),this.options=o,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=o.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(v,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.InstantiationService=n.ServiceCollection=void 0;const d=u(2585),g=u(8343);class f{constructor(...C){this._entries=new Map;for(const[w,S]of C)this.set(w,S)}set(C,w){const S=this._entries.get(C);return this._entries.set(C,w),S}forEach(C){for(const[w,S]of this._entries.entries())C(w,S)}has(C){return this._entries.has(C)}get(C){return this._entries.get(C)}}n.ServiceCollection=f,n.InstantiationService=class{constructor(){this._services=new f,this._services.set(d.IInstantiationService,this)}setService(_,C){this._services.set(_,C)}getService(_){return this._services.get(_)}createInstance(_,...C){const w=(0,g.getServiceDependencies)(_).sort((a,o)=>a.index-o.index),S=[];for(const a of w){const o=this._services.get(a.id);if(!o)throw new Error(`[createInstance] ${_.name} depends on UNKNOWN service ${a.id}.`);S.push(o)}const l=w.length>0?w[0].index:C.length;if(C.length!==l)throw new Error(`[createInstance] First service dependency of ${_.name} at position ${l+1} conflicts with ${C.length} static arguments`);return new _(...C,...S)}}},7866:function(v,n,u){var d=this&&this.__decorate||function(l,a,o,c){var p,y=arguments.length,x=y<3?a:c===null?c=Object.getOwnPropertyDescriptor(a,o):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(l,a,o,c);else for(var k=l.length-1;k>=0;k--)(p=l[k])&&(x=(y<3?p(x):y>3?p(a,o,x):p(a,o))||x);return y>3&&x&&Object.defineProperty(a,o,x),x},g=this&&this.__param||function(l,a){return function(o,c){a(o,c,l)}};Object.defineProperty(n,"__esModule",{value:!0}),n.traceCall=n.setTraceLogger=n.LogService=void 0;const f=u(844),_=u(2585),C={trace:_.LogLevelEnum.TRACE,debug:_.LogLevelEnum.DEBUG,info:_.LogLevelEnum.INFO,warn:_.LogLevelEnum.WARN,error:_.LogLevelEnum.ERROR,off:_.LogLevelEnum.OFF};let w,S=n.LogService=class extends f.Disposable{get logLevel(){return this._logLevel}constructor(l){super(),this._optionsService=l,this._logLevel=_.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),w=this}_updateLogLevel(){this._logLevel=C[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(l){for(let a=0;a<l.length;a++)typeof l[a]=="function"&&(l[a]=l[a]())}_log(l,a,o){this._evalLazyOptionalParams(o),l.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+a,...o)}trace(l,...a){var o,c;this._logLevel<=_.LogLevelEnum.TRACE&&this._log((c=(o=this._optionsService.options.logger)===null||o===void 0?void 0:o.trace.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.log,l,a)}debug(l,...a){var o,c;this._logLevel<=_.LogLevelEnum.DEBUG&&this._log((c=(o=this._optionsService.options.logger)===null||o===void 0?void 0:o.debug.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.log,l,a)}info(l,...a){var o,c;this._logLevel<=_.LogLevelEnum.INFO&&this._log((c=(o=this._optionsService.options.logger)===null||o===void 0?void 0:o.info.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.info,l,a)}warn(l,...a){var o,c;this._logLevel<=_.LogLevelEnum.WARN&&this._log((c=(o=this._optionsService.options.logger)===null||o===void 0?void 0:o.warn.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.warn,l,a)}error(l,...a){var o,c;this._logLevel<=_.LogLevelEnum.ERROR&&this._log((c=(o=this._optionsService.options.logger)===null||o===void 0?void 0:o.error.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.error,l,a)}};n.LogService=S=d([g(0,_.IOptionsService)],S),n.setTraceLogger=function(l){w=l},n.traceCall=function(l,a,o){if(typeof o.value!="function")throw new Error("not supported");const c=o.value;o.value=function(...p){if(w.logLevel!==_.LogLevelEnum.TRACE)return c.apply(this,p);w.trace(`GlyphRenderer#${c.name}(${p.map(x=>JSON.stringify(x)).join(", ")})`);const y=c.apply(this,p);return w.trace(`GlyphRenderer#${c.name} return`,y),y}}},7302:(v,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.OptionsService=n.DEFAULT_OPTIONS=void 0;const d=u(8460),g=u(844),f=u(6114);n.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:f.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 C extends g.Disposable{constructor(S){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const l=Object.assign({},n.DEFAULT_OPTIONS);for(const a in S)if(a in l)try{const o=S[a];l[a]=this._sanitizeAndValidateOption(a,o)}catch(o){console.error(o)}this.rawOptions=l,this.options=Object.assign({},l),this._setupOptions()}onSpecificOptionChange(S,l){return this.onOptionChange(a=>{a===S&&l(this.rawOptions[S])})}onMultipleOptionChange(S,l){return this.onOptionChange(a=>{S.indexOf(a)!==-1&&l()})}_setupOptions(){const S=a=>{if(!(a in n.DEFAULT_OPTIONS))throw new Error(`No option with key "${a}"`);return this.rawOptions[a]},l=(a,o)=>{if(!(a in n.DEFAULT_OPTIONS))throw new Error(`No option with key "${a}"`);o=this._sanitizeAndValidateOption(a,o),this.rawOptions[a]!==o&&(this.rawOptions[a]=o,this._onOptionChange.fire(a))};for(const a in this.rawOptions){const o={get:S.bind(this,a),set:l.bind(this,a)};Object.defineProperty(this.options,a,o)}}_sanitizeAndValidateOption(S,l){switch(S){case"cursorStyle":if(l||(l=n.DEFAULT_OPTIONS[S]),!function(a){return a==="block"||a==="underline"||a==="bar"}(l))throw new Error(`"${l}" is not a valid value for ${S}`);break;case"wordSeparator":l||(l=n.DEFAULT_OPTIONS[S]);break;case"fontWeight":case"fontWeightBold":if(typeof l=="number"&&1<=l&&l<=1e3)break;l=_.includes(l)?l:n.DEFAULT_OPTIONS[S];break;case"cursorWidth":l=Math.floor(l);case"lineHeight":case"tabStopWidth":if(l<1)throw new Error(`${S} cannot be less than 1, value: ${l}`);break;case"minimumContrastRatio":l=Math.max(1,Math.min(21,Math.round(10*l)/10));break;case"scrollback":if((l=Math.min(l,4294967295))<0)throw new Error(`${S} cannot be less than 0, value: ${l}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(l<=0)throw new Error(`${S} cannot be less than or equal to 0, value: ${l}`);break;case"rows":case"cols":if(!l&&l!==0)throw new Error(`${S} must be numeric, value: ${l}`);break;case"windowsPty":l=l??{}}return l}}n.OptionsService=C},2660:function(v,n,u){var d=this&&this.__decorate||function(C,w,S,l){var a,o=arguments.length,c=o<3?w:l===null?l=Object.getOwnPropertyDescriptor(w,S):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(C,w,S,l);else for(var p=C.length-1;p>=0;p--)(a=C[p])&&(c=(o<3?a(c):o>3?a(w,S,c):a(w,S))||c);return o>3&&c&&Object.defineProperty(w,S,c),c},g=this&&this.__param||function(C,w){return function(S,l){w(S,l,C)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OscLinkService=void 0;const f=u(2585);let _=n.OscLinkService=class{constructor(C){this._bufferService=C,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(C){const w=this._bufferService.buffer;if(C.id===void 0){const p=w.addMarker(w.ybase+w.y),y={data:C,id:this._nextId++,lines:[p]};return p.onDispose(()=>this._removeMarkerFromLink(y,p)),this._dataByLinkId.set(y.id,y),y.id}const S=C,l=this._getEntryIdKey(S),a=this._entriesWithId.get(l);if(a)return this.addLineToLink(a.id,w.ybase+w.y),a.id;const o=w.addMarker(w.ybase+w.y),c={id:this._nextId++,key:this._getEntryIdKey(S),data:S,lines:[o]};return o.onDispose(()=>this._removeMarkerFromLink(c,o)),this._entriesWithId.set(c.key,c),this._dataByLinkId.set(c.id,c),c.id}addLineToLink(C,w){const S=this._dataByLinkId.get(C);if(S&&S.lines.every(l=>l.line!==w)){const l=this._bufferService.buffer.addMarker(w);S.lines.push(l),l.onDispose(()=>this._removeMarkerFromLink(S,l))}}getLinkData(C){var w;return(w=this._dataByLinkId.get(C))===null||w===void 0?void 0:w.data}_getEntryIdKey(C){return`${C.id};;${C.uri}`}_removeMarkerFromLink(C,w){const S=C.lines.indexOf(w);S!==-1&&(C.lines.splice(S,1),C.lines.length===0&&(C.data.id!==void 0&&this._entriesWithId.delete(C.key),this._dataByLinkId.delete(C.id)))}};n.OscLinkService=_=d([g(0,f.IBufferService)],_)},8343:(v,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createDecorator=n.getServiceDependencies=n.serviceRegistry=void 0;const u="di$target",d="di$dependencies";n.serviceRegistry=new Map,n.getServiceDependencies=function(g){return g[d]||[]},n.createDecorator=function(g){if(n.serviceRegistry.has(g))return n.serviceRegistry.get(g);const f=function(_,C,w){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(S,l,a){l[u]===l?l[d].push({id:S,index:a}):(l[d]=[{id:S,index:a}],l[u]=l)})(f,_,w)};return f.toString=()=>g,n.serviceRegistry.set(g,f),f}},2585:(v,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.IDecorationService=n.IUnicodeService=n.IOscLinkService=n.IOptionsService=n.ILogService=n.LogLevelEnum=n.IInstantiationService=n.ICharsetService=n.ICoreService=n.ICoreMouseService=n.IBufferService=void 0;const d=u(8343);var g;n.IBufferService=(0,d.createDecorator)("BufferService"),n.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),n.ICoreService=(0,d.createDecorator)("CoreService"),n.ICharsetService=(0,d.createDecorator)("CharsetService"),n.IInstantiationService=(0,d.createDecorator)("InstantiationService"),function(f){f[f.TRACE=0]="TRACE",f[f.DEBUG=1]="DEBUG",f[f.INFO=2]="INFO",f[f.WARN=3]="WARN",f[f.ERROR=4]="ERROR",f[f.OFF=5]="OFF"}(g||(n.LogLevelEnum=g={})),n.ILogService=(0,d.createDecorator)("LogService"),n.IOptionsService=(0,d.createDecorator)("OptionsService"),n.IOscLinkService=(0,d.createDecorator)("OscLinkService"),n.IUnicodeService=(0,d.createDecorator)("UnicodeService"),n.IDecorationService=(0,d.createDecorator)("DecorationService")},1480:(v,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeService=void 0;const d=u(8460),g=u(225);n.UnicodeService=class{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const f=new g.UnicodeV6;this.register(f),this._active=f.version,this._activeProvider=f}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(f){if(!this._providers[f])throw new Error(`unknown Unicode version "${f}"`);this._active=f,this._activeProvider=this._providers[f],this._onChange.fire(f)}register(f){this._providers[f.version]=f}wcwidth(f){return this._activeProvider.wcwidth(f)}getStringCellWidth(f){let _=0;const C=f.length;for(let w=0;w<C;++w){let S=f.charCodeAt(w);if(55296<=S&&S<=56319){if(++w>=C)return _+this.wcwidth(S);const l=f.charCodeAt(w);56320<=l&&l<=57343?S=1024*(S-55296)+l-56320+65536:_+=this.wcwidth(l)}_+=this.wcwidth(S)}return _}}}},i={};function s(v){var n=i[v];if(n!==void 0)return n.exports;var u=i[v]={exports:{}};return r[v].call(u.exports,u,u.exports,s),u.exports}var h={};return(()=>{var v=h;Object.defineProperty(v,"__esModule",{value:!0}),v.Terminal=void 0;const n=s(9042),u=s(3236),d=s(844),g=s(5741),f=s(8285),_=s(7975),C=s(7090),w=["cols","rows"];class S extends d.Disposable{constructor(a){super(),this._core=this.register(new u.Terminal(a)),this._addonManager=this.register(new g.AddonManager),this._publicOptions=Object.assign({},this._core.options);const o=p=>this._core.options[p],c=(p,y)=>{this._checkReadonlyOptions(p),this._core.options[p]=y};for(const p in this._core.options){const y={get:o.bind(this,p),set:c.bind(this,p)};Object.defineProperty(this._publicOptions,p,y)}}_checkReadonlyOptions(a){if(w.includes(a))throw new Error(`Option "${a}" 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 C.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 f.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const a=this._core.coreService.decPrivateModes;let o="none";switch(this._core.coreMouseService.activeProtocol){case"X10":o="x10";break;case"VT200":o="vt200";break;case"DRAG":o="drag";break;case"ANY":o="any"}return{applicationCursorKeysMode:a.applicationCursorKeys,applicationKeypadMode:a.applicationKeypad,bracketedPasteMode:a.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:o,originMode:a.origin,reverseWraparoundMode:a.reverseWraparound,sendFocusMode:a.sendFocus,wraparoundMode:a.wraparound}}get options(){return this._publicOptions}set options(a){for(const o in a)this._publicOptions[o]=a[o]}blur(){this._core.blur()}focus(){this._core.focus()}resize(a,o){this._verifyIntegers(a,o),this._core.resize(a,o)}open(a){this._core.open(a)}attachCustomKeyEventHandler(a){this._core.attachCustomKeyEventHandler(a)}registerLinkProvider(a){return this._core.registerLinkProvider(a)}registerCharacterJoiner(a){return this._checkProposedApi(),this._core.registerCharacterJoiner(a)}deregisterCharacterJoiner(a){this._checkProposedApi(),this._core.deregisterCharacterJoiner(a)}registerMarker(a=0){return this._verifyIntegers(a),this._core.registerMarker(a)}registerDecoration(a){var o,c,p;return this._checkProposedApi(),this._verifyPositiveIntegers((o=a.x)!==null&&o!==void 0?o:0,(c=a.width)!==null&&c!==void 0?c:0,(p=a.height)!==null&&p!==void 0?p:0),this._core.registerDecoration(a)}hasSelection(){return this._core.hasSelection()}select(a,o,c){this._verifyIntegers(a,o,c),this._core.select(a,o,c)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(a,o){this._verifyIntegers(a,o),this._core.selectLines(a,o)}dispose(){super.dispose()}scrollLines(a){this._verifyIntegers(a),this._core.scrollLines(a)}scrollPages(a){this._verifyIntegers(a),this._core.scrollPages(a)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(a){this._verifyIntegers(a),this._core.scrollToLine(a)}clear(){this._core.clear()}write(a,o){this._core.write(a,o)}writeln(a,o){this._core.write(a),this._core.write(`\r
56
+ `,o)}paste(a){this._core.paste(a)}refresh(a,o){this._verifyIntegers(a,o),this._core.refresh(a,o)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(a){this._addonManager.loadAddon(this,a)}static get strings(){return n}_verifyIntegers(...a){for(const o of a)if(o===1/0||isNaN(o)||o%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...a){for(const o of a)if(o&&(o===1/0||isNaN(o)||o%1!=0||o<0))throw new Error("This API only accepts positive integers")}}v.Terminal=S})(),h})())})(Rf);var Lg=Rf.exports,Df={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={};return(()=>{var i=r;Object.defineProperty(i,"__esModule",{value:!0}),i.FitAddon=void 0,i.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 h=this._terminal._core;this._terminal.rows===s.rows&&this._terminal.cols===s.cols||(h._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,h=s._renderService.dimensions;if(h.css.cell.width===0||h.css.cell.height===0)return;const v=this._terminal.options.scrollback===0?0:s.viewport.scrollBarWidth,n=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(n.getPropertyValue("height")),d=Math.max(0,parseInt(n.getPropertyValue("width"))),g=window.getComputedStyle(this._terminal.element),f=u-(parseInt(g.getPropertyValue("padding-top"))+parseInt(g.getPropertyValue("padding-bottom"))),_=d-(parseInt(g.getPropertyValue("padding-right"))+parseInt(g.getPropertyValue("padding-left")))-v;return{cols:Math.max(2,Math.floor(_/h.css.cell.width)),rows:Math.max(1,Math.floor(f/h.css.cell.height))}}}})(),r})())})(Df);var Dg=Df.exports,Tf={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={6:(v,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.LinkComputer=n.WebLinkProvider=void 0,n.WebLinkProvider=class{constructor(d,g,f,_={}){this._terminal=d,this._regex=g,this._handler=f,this._options=_}provideLinks(d,g){const f=u.computeLink(d,this._regex,this._terminal,this._handler);g(this._addCallbacks(f))}_addCallbacks(d){return d.map(g=>(g.leave=this._options.leave,g.hover=(f,_)=>{if(this._options.hover){const{range:C}=g;this._options.hover(f,_,C)}},g))}};class u{static computeLink(g,f,_,C){const w=new RegExp(f.source,(f.flags||"")+"g"),[S,l]=u._getWindowedLineStrings(g-1,_),a=S.join("");let o;const c=[];for(;o=w.exec(a);){const p=o[0];try{const D=new URL(p),M=decodeURI(D.toString());if(p!==M&&p+"/"!==M)continue}catch{continue}const[y,x]=u._mapStrIdx(_,l,0,o.index),[k,m]=u._mapStrIdx(_,y,x,p.length);if(y===-1||x===-1||k===-1||m===-1)continue;const b={start:{x:x+1,y:y+1},end:{x:m,y:k+1}};c.push({range:b,text:p,activate:C})}return c}static _getWindowedLineStrings(g,f){let _,C=g,w=g,S=0,l="";const a=[];if(_=f.buffer.active.getLine(g)){const o=_.translateToString(!0);if(_.isWrapped&&o[0]!==" "){for(S=0;(_=f.buffer.active.getLine(--C))&&S<2048&&(l=_.translateToString(!0),S+=l.length,a.push(l),_.isWrapped&&l.indexOf(" ")===-1););a.reverse()}for(a.push(o),S=0;(_=f.buffer.active.getLine(++w))&&_.isWrapped&&S<2048&&(l=_.translateToString(!0),S+=l.length,a.push(l),l.indexOf(" ")===-1););}return[a,C]}static _mapStrIdx(g,f,_,C){const w=g.buffer.active,S=w.getNullCell();let l=_;for(;C;){const a=w.getLine(f);if(!a)return[-1,-1];for(let o=l;o<a.length;++o){a.getCell(o,S);const c=S.getChars();if(S.getWidth()&&(C-=c.length||1,o===a.length-1&&c==="")){const p=w.getLine(f+1);p&&p.isWrapped&&(p.getCell(0,S),S.getWidth()===2&&(C+=1))}if(C<0)return[f,o]}f++,l=0}return[f,l]}}n.LinkComputer=u}},i={};function s(v){var n=i[v];if(n!==void 0)return n.exports;var u=i[v]={exports:{}};return r[v](u,u.exports,s),u.exports}var h={};return(()=>{var v=h;Object.defineProperty(v,"__esModule",{value:!0}),v.WebLinksAddon=void 0;const n=s(6),u=/https?:[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function d(g,f){const _=window.open();if(_){try{_.opener=null}catch{}_.location.href=f}else console.warn("Opening link blocked as opener could not be cleared")}v.WebLinksAddon=class{constructor(g=d,f={}){this._handler=g,this._options=f}activate(g){this._terminal=g;const f=this._options,_=f.urlRegex||u;this._linkProvider=this._terminal.registerLinkProvider(new n.WebLinkProvider(this._terminal,_,this._handler,f))}dispose(){var g;(g=this._linkProvider)===null||g===void 0||g.dispose()}}})(),h})())})(Tf);var Tg=Tf.exports;function Pf({agentGated:e=!1}={}){const t=q.useRef(null),[r,i]=q.useState(null),[s,h]=q.useState(!1),[v,n]=q.useState(!1),[u,d]=q.useState(null);return q.useEffect(()=>{if(!t.current)return;const g=new Lg.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}),f=new Dg.FitAddon;g.loadAddon(f),g.loadAddon(new Tg.WebLinksAddon),g.open(t.current),f.fit();const _=new ResizeObserver(()=>{try{f.fit()}catch{}});_.observe(t.current);const C=window.location.protocol==="https:"?"wss":"ws",w=new WebSocket(`${C}://${window.location.host}/api/agent/ws`);return w.onopen=()=>h(!0),w.onclose=()=>h(!1),w.onerror=()=>h(!1),w.onmessage=S=>{try{const l=JSON.parse(S.data);l.kind==="data"&&typeof l.data=="string"?g.write(l.data):l.kind==="meta"?(i({active:!!l.autoMode,reason:l.reason??""}),typeof l.agentReady=="boolean"&&n(l.agentReady)):l.kind==="auth_url"&&typeof l.url=="string"||(l.kind==="error"?l.recoverable&&l.remediation?d({message:l.message??"agent failed to start",remediation:l.remediation}):g.write(`\r
57
+ \x1B[31m[error] ${l.message??"unknown error"}\x1B[0m\r
58
+ `):l.kind==="exit"&&g.write(`\r
59
+ \x1B[33m[claude session exited]\x1B[0m\r
60
+ `))}catch{}},g.onData(S=>{w.readyState===WebSocket.OPEN&&w.send(JSON.stringify({kind:"input",data:S}))}),g.onResize(({cols:S,rows:l})=>{w.readyState===WebSocket.OPEN&&w.send(JSON.stringify({kind:"resize",cols:S,rows:l}))}),()=>{w.close(),_.disconnect(),g.dispose()}},[]),L.jsxs("div",{className:"h-full w-full flex flex-col",style:{background:"var(--bg-sunken)"},children:[L.jsxs("div",{className:"px-4 py-2 flex items-center justify-between",style:{borderBottom:"1px solid var(--border)",background:"var(--bg-elevated)"},children:[L.jsx("span",{className:"j-mono text-[11px]",style:{color:s?"var(--vow-green)":"var(--fg-dim)",letterSpacing:"0.05em"},children:s?"● connected":"○ disconnected"}),r&&L.jsx("span",{className:"j-label",style:{color:r.active?"var(--accent-gold)":"var(--fg-dim)",fontSize:"10px"},title:r.active?"Claude Code Auto Mode is active":r.reason,children:r.active?"Auto Mode":"Default permissions"})]}),u&&L.jsxs("div",{className:"px-5 py-4 m-3 flex flex-col gap-2",style:{border:"1px solid var(--break-red)",background:"rgba(168, 90, 90, 0.06)",borderRadius:"var(--radius-2)"},children:[L.jsx("span",{className:"j-label",style:{color:"var(--break-red)"},children:"Agent panel unavailable"}),L.jsx("p",{className:"j-mono text-xs",style:{color:"var(--fg-muted)"},children:u.message}),u.remediation&&L.jsxs("p",{className:"j-mono text-xs",style:{color:"var(--fg-dim)"},children:[L.jsx("span",{style:{color:"var(--fg-muted)"},children:"Fix · "}),u.remediation]})]}),L.jsx("div",{ref:t,className:"flex-1 w-full",style:{background:"var(--bg-sunken)",padding:"12px",minHeight:"400px",visibility:e&&!v?"hidden":"visible",display:e&&!v?"none":"block"}}),e&&!v&&!u&&L.jsx(Pg,{})]})}function Pg(){return L.jsx("div",{className:"flex-1 w-full flex items-center justify-center px-6",style:{background:"var(--bg-sunken)"},children:L.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-[34ch] text-center",children:[L.jsx("span",{"aria-hidden":"true",style:{width:"8px",height:"8px",borderRadius:"50%",background:"var(--seer-violet)",boxShadow:"0 0 0 0 rgba(122, 109, 176, 0.6)",animation:"jinnPulse 1.6s ease-out infinite"}}),L.jsx("p",{className:"j-mono text-xs",style:{color:"var(--fg-muted)"},children:"The agent will come online once you sign in to Claude (Phase 1 on the left)."})]})})}const Ag={wallet:{phase:2,subState:null},safe_predicted:{phase:2,subState:null},awaiting_funding:{phase:3,subState:null},safe_deployed:{phase:4,subState:"Deploying"},service_created:{phase:4,subState:"Deploying"},service_activated:{phase:4,subState:"Deploying"},agents_registered:{phase:4,subState:"Deploying"},service_deployed:{phase:4,subState:"Deploying"},service_staked:{phase:4,subState:"Deploying"},staked:{phase:4,subState:"Deploying"},mech_deployed:{phase:4,subState:"Joining the network"},agent_registered:{phase:4,subState:"Joining the network"},safe_binding_pending:{phase:4,subState:"Binding identity"}},Mg={1:"Sign in to Claude",2:"Provisioning your wallet",3:"Fund your wallet",4:"Joining Jinn"};function Og(e){return Ag[e]??{phase:2,subState:null}}function Bg(e,t){return e<t?"done":e===t?"active":"queued"}function Ig(){const{data:e,isLoading:t}=Ai({queryKey:["bootstrap"],queryFn:()=>Ie.getBootstrap(),refetchInterval:2e3}),{data:r,refetch:i}=Ai({queryKey:["claude-auth"],queryFn:()=>Ie.getClaudeAuth(),refetchInterval:4e3});if(t||!e)return L.jsx("div",{className:"min-h-screen flex items-center justify-center",style:{background:"var(--bg)"},children:L.jsx("span",{className:"j-label",children:"Connecting…"})});const s=e.chain==="base"?"https://basescan.org":"https://sepolia.basescan.org",h=e.master_address??"",{phase:v,subState:n}=Og(e.currentStep),u=e.error,d=e.services.find(_=>_.step===e.currentStep)??e.services[0],g=(r==null?void 0:r.authenticated)===!0,f=g?v:1;return L.jsxs("div",{className:"min-h-screen w-full",style:{background:"var(--bg)",color:"var(--fg)"},children:[L.jsx("style",{children:qg}),L.jsxs("div",{className:"max-w-[1280px] mx-auto px-10 py-10 grid grid-cols-12 gap-10",children:[L.jsxs("section",{className:"col-span-12 lg:col-span-7 flex flex-col gap-8",children:[L.jsxs("header",{className:"flex items-baseline justify-between",children:[L.jsx("span",{className:"j-label",style:{color:"var(--accent-gold)"},children:"Jinn · Onboarding"}),L.jsx(jg,{chain:e.chain})]}),L.jsx("h1",{className:"j-display",style:{fontSize:"76px",color:"var(--fg)",lineHeight:1.05},children:"Welcome to Jinn."}),L.jsx("ol",{className:"flex flex-col",children:[1,2,3,4].map(_=>{var S;const C=Bg(_,f),w=u&&_===f&&_!==1;return L.jsxs(Hg,{phase:_,status:w?"error":C,children:[w&&L.jsx(Ug,{envelope:u}),!w&&_===1&&C==="active"&&r&&L.jsx(Fg,{auth:r,onAuthChanged:()=>{i()}}),!w&&_===3&&C==="active"&&h&&L.jsx(Eg,{address:h,minimumWei:((S=e.funding)==null?void 0:S.targetWei)??"10000000000000000",chainExplorerBase:s}),!w&&_===4&&C==="active"&&L.jsx(Kg,{label:n??"Working",step:e.currentStep,serviceIndex:d==null?void 0:d.index,serviceId:d==null?void 0:d.service_id,safeAddress:d==null?void 0:d.safe_address,explorer:s})]},_)})})]}),L.jsxs("aside",{className:"col-span-12 lg:col-span-5 flex flex-col gap-3",children:[L.jsx("span",{className:"j-label",children:"Ask Claude"}),L.jsx("div",{className:"j-card overflow-hidden",style:{height:"calc(100vh - 220px)",minHeight:"520px"},children:L.jsx(Pf,{agentGated:!g})})]})]})]})}function jg({chain:e}){const t=e==="base";return L.jsxs("div",{className:"flex items-center gap-3",children:[L.jsx("span",{className:"j-label",style:{color:t?"var(--fg-dim)":"var(--accent-sky)",padding:"4px 10px",border:t?"1px solid var(--border)":"1px solid var(--accent-sky)",borderRadius:"var(--radius-1)"},children:"Testnet"}),L.jsx("span",{className:"j-label",style:{color:"var(--fg-dim)",padding:"4px 10px",border:"1px dashed var(--border)",borderRadius:"var(--radius-1)",opacity:.6},title:"Mainnet support is coming. v1 supports testnet only.",children:"Mainnet · soon"})]})}function Fg({auth:e,onAuthChanged:t}){const[r,i]=q.useState(!1),[s,h]=q.useState(null),v=e.context!=="bare",n=e.binary.ok===!1,u=async()=>{h(null),i(!0);try{const g=await Ie.signInClaude();g.ok||h(g.reason??"Failed to start sign-in")}catch(g){h(g instanceof Error?g.message:"Failed to start sign-in")}finally{i(!1)}},d=async()=>{h(null),i(!0);try{const g=await Ie.installClaudeCode();if(!g.ok){h(g.detail||"Failed to install Claude Code");return}t()}catch(g){h(g instanceof Error?g.message:"Failed to install Claude Code")}finally{i(!1)}};return L.jsxs("div",{className:"px-5 py-4 flex flex-col gap-3",style:{border:"1px solid var(--seer-violet)",background:"rgba(122, 109, 176, 0.05)",borderRadius:"var(--radius-2)"},children:[n?L.jsxs(L.Fragment,{children:[L.jsx("p",{className:"j-mono text-xs",style:{color:"var(--fg-muted)"},children:"Jinn needs the Claude Code CLI to run the operator agent and complete work."}),L.jsx("button",{type:"button",onClick:d,disabled:r,className:"self-start px-4 py-2 j-label hover:opacity-90 disabled:opacity-50",style:{background:"var(--seer-violet)",color:"var(--fg)",borderRadius:"var(--radius-1)"},children:r?"Installing…":"Install Claude Code"})]}):L.jsxs(L.Fragment,{children:[L.jsx("p",{className:"j-mono text-xs",style:{color:"var(--fg-muted)"},children:"Claude runs the agent panel and the daemon's restorations. One sign-in covers both — this is the only auth step you'll take."}),L.jsx("button",{type:"button",onClick:u,disabled:r,className:"self-start px-4 py-2 j-label hover:opacity-90 disabled:opacity-50",style:{background:"var(--seer-violet)",color:"var(--fg)",borderRadius:"var(--radius-1)"},children:r?"Opening…":"Sign in with Claude →"}),v&&L.jsx("p",{className:"j-mono text-[11px]",style:{color:"var(--fg-dim)"},children:"Container mode: after you sign in, copy the OAuth code from the auth page and paste it into the agent terminal where claude is waiting at 'Paste code here'."})]}),s&&L.jsx("p",{className:"j-mono text-xs",style:{color:"var(--break-red)"},children:s})]})}function Hg({phase:e,status:t,children:r}){const i=t==="active",s=t==="error",h=t==="done",v=i||s,n=s?"var(--break-red)":i?"var(--accent-gold)":h?"var(--accent-sky)":"var(--fg-dim)",u=s||i?"var(--fg)":h?"var(--fg-muted)":"var(--fg-dim)";return L.jsxs("li",{className:"phase-row","data-status":t,style:{borderTop:"1px solid var(--border)"},children:[L.jsxs("div",{className:"grid grid-cols-[3rem_1fr_auto] items-baseline gap-4 py-4",children:[L.jsx("span",{className:"j-mono text-xs tabular-nums",style:{color:n,letterSpacing:"0.05em",transition:"color 240ms ease"},children:String(e).padStart(2,"0")}),L.jsx("span",{className:v?"j-display":"j-mono",style:{fontSize:v?"28px":"14px",color:u,lineHeight:1.2,transition:"color 240ms ease"},children:Mg[e]}),L.jsx(Ng,{status:t})]}),v&&r&&L.jsx("div",{className:"ml-12 pb-5 pr-2",style:{animation:"jinnFadeSlide 320ms ease-out both"},children:r})]})}function Ng({status:e}){return e==="done"?L.jsx("span",{className:"j-label",style:{color:"var(--vow-green)",fontSize:"10px"},children:"✓ Done"}):e==="error"?L.jsx("span",{className:"j-label",style:{color:"var(--break-red)",fontSize:"10px"},children:"! Failed"}):e==="active"?L.jsxs("span",{className:"j-label flex items-center gap-2",style:{color:"var(--accent-gold)",fontSize:"10px"},children:[L.jsx(zg,{}),"Active"]}):L.jsx("span",{className:"j-label",style:{color:"var(--fg-dim)",fontSize:"10px"},children:"Queued"})}function zg(){return L.jsx("span",{"aria-hidden":"true",style:{width:"6px",height:"6px",borderRadius:"50%",background:"var(--accent-gold)",boxShadow:"0 0 0 0 rgba(220, 184, 102, 0.6)",animation:"jinnPulse 1.6s ease-out infinite"}})}function Ug({envelope:e}){const t=Wg(e),r=$g(e.generatedAt);return L.jsxs("div",{className:"px-5 py-4 flex flex-col gap-3",style:{border:"1px solid var(--break-red)",background:"rgba(168, 90, 90, 0.06)",borderRadius:"var(--radius-2)"},children:[L.jsxs("div",{className:"flex items-baseline justify-between",children:[L.jsxs("span",{className:"j-label",style:{color:"var(--break-red)"},children:["Bootstrap halted · ",e.code]}),r&&L.jsx("span",{className:"j-mono text-[10px]",style:{color:"var(--fg-dim)"},children:r})]}),L.jsx("p",{className:"j-mono text-xs break-words",style:{color:"var(--fg)"},children:e.message}),e.hint&&L.jsxs("p",{className:"j-mono text-xs",style:{color:"var(--fg-muted)"},children:[L.jsx("span",{style:{color:"var(--fg-dim)"},children:"Fix · "}),e.hint]}),t&&L.jsx("a",{href:`https://sepolia.basescan.org/tx/${t}`,target:"_blank",rel:"noopener noreferrer",className:"j-mono text-[11px] hover:underline self-start",style:{color:"var(--accent-sky)"},children:"view failed tx ↗"}),L.jsxs("p",{className:"j-mono text-[11px]",style:{color:"var(--fg-dim)"},children:["Setup is paused at this step. Once you've addressed the cause, run"," ",L.jsx("code",{style:{color:"var(--fg-muted)"},children:"jinn run"})," again to retry from the persisted state."]})]})}function Wg(e){var r,i;const t=[(r=e.details)==null?void 0:r.txHash,(i=e.details)==null?void 0:i.cause,e.message];for(const s of t){if(typeof s!="string")continue;const h=/(0x[a-fA-F0-9]{64})/.exec(s);if(h)return h[1]}return null}function $g(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 i=Math.round(r/60);return i<60?`${i}m ago`:`${Math.round(i/60)}h ago`}catch{return null}}function Kg({label:e,step:t,serviceIndex:r,serviceId:i,safeAddress:s,explorer:h}){return L.jsxs("div",{className:"px-4 py-3 flex flex-col gap-3",style:{border:"1px solid var(--border)",borderRadius:"var(--radius-2)",background:"var(--bg-elevated)"},children:[L.jsxs("div",{className:"flex items-center gap-3",children:[L.jsx("span",{"aria-hidden":"true",style:{width:"6px",height:"6px",borderRadius:"50%",background:"var(--accent-sky)",boxShadow:"0 0 0 0 rgba(122, 167, 220, 0.6)",animation:"jinnPulse 1.6s ease-out infinite"}}),L.jsx("span",{className:"j-mono text-sm",style:{color:"var(--fg)"},children:e}),L.jsx("span",{className:"j-mono text-[10px] ml-auto",style:{color:"var(--fg-dim)"},children:"running · no action needed"})]}),L.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[120px_1fr] gap-x-4 gap-y-1 j-mono text-[11px]",style:{color:"var(--fg-muted)"},children:[L.jsx("span",{style:{color:"var(--fg-dim)"},children:"Current step"}),L.jsx("span",{children:Vg(t)}),r!==void 0&&L.jsxs(L.Fragment,{children:[L.jsx("span",{style:{color:"var(--fg-dim)"},children:"Service"}),L.jsxs("span",{children:["#",r,i!==void 0?` · id ${i}`:""]})]}),s&&L.jsxs(L.Fragment,{children:[L.jsx("span",{style:{color:"var(--fg-dim)"},children:"Safe"}),L.jsx("a",{href:`${h}/address/${s}`,target:"_blank",rel:"noopener noreferrer",className:"hover:underline break-all",style:{color:"var(--accent-sky)"},children:s})]})]})]})}function Vg(e){return e.split("_").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}const qg=`
61
+ @keyframes jinnPulse {
62
+ 0% { box-shadow: 0 0 0 0 rgba(220, 184, 102, 0.55); }
63
+ 70% { box-shadow: 0 0 0 10px rgba(220, 184, 102, 0); }
64
+ 100% { box-shadow: 0 0 0 0 rgba(220, 184, 102, 0); }
65
+ }
66
+ @keyframes jinnFadeSlide {
67
+ 0% { opacity: 0; transform: translateY(-4px); }
68
+ 100% { opacity: 1; transform: translateY(0); }
69
+ }
70
+ /* Smooth title scaling when a row activates */
71
+ .phase-row[data-status="active"] {
72
+ background:
73
+ linear-gradient(90deg, rgba(220, 184, 102, 0.04) 0%, transparent 60%);
74
+ transition: background 320ms ease;
75
+ }
76
+ `;function Qg({header:e,tabs:t,rail:r,children:i}){return L.jsxs("div",{className:"w-full",style:{background:"var(--bg)",color:"var(--fg)",display:"grid",gridTemplateRows:"auto auto minmax(0, 1fr)",gridTemplateColumns:"1fr 320px",height:"100vh",overflow:"hidden"},children:[L.jsx("div",{style:{gridColumn:"1 / -1",borderBottom:"1px solid var(--border)"},children:e}),L.jsx("div",{style:{gridColumn:"1 / -1",borderBottom:"1px solid var(--border)"},children:t}),L.jsx("main",{style:{overflowY:"auto",minHeight:0},children:i}),L.jsx("aside",{style:{borderLeft:"1px solid var(--border)",overflowY:"auto",minHeight:0,height:"100%"},children:r})]})}function Gg(e){return!e||e.length<10?e??"—":`${e.slice(0,6)}…${e.slice(-4)}`}function Jg({network:e,rpcHealthy:t,masterAddress:r}){return L.jsxs("header",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"14px 24px"},children:[L.jsx(fo,{href:"/overview",style:{textDecoration:"none",color:"var(--fg)"},children:L.jsx("span",{style:{fontFamily:"'Instrument Serif', 'Times New Roman', serif",fontSize:"26px",color:"var(--fg)"},children:"jinn operator"})}),L.jsxs("div",{style:{display:"flex",gap:"16px",alignItems:"center",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:[L.jsx("span",{style:{border:"1px solid var(--border)",borderRadius:"4px",padding:"2px 8px"},children:e}),L.jsxs("span",{style:{display:"flex",gap:"6px",alignItems:"center"},children:[L.jsx("span",{style:{width:"6px",height:"6px",borderRadius:"50%",background:t?"var(--vow-green)":"var(--break-red)"}}),t?"rpc healthy":"rpc unreachable"]}),L.jsxs("span",{style:{color:"var(--fg-dim)"},children:["master ",Gg(r)]})]})]})}const Xg=[{path:"/overview",label:"Overview"},{path:"/configuration",label:"Configuration"}];function Yg(){const[e]=mg();return L.jsx("nav",{style:{display:"flex",padding:"0 24px"},children:Xg.map(t=>{const r=e===t.path||e.startsWith(`${t.path}/`);return L.jsx(fo,{href:t.path,"data-active":r?"true":"false",style:{padding:"14px 18px",fontFamily:"'JetBrains Mono', ui-monospace, SF Mono, Menlo, monospace",fontSize:"11px",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.14em",color:r?"var(--fg)":"var(--fg-muted)",borderBottom:`1px solid ${r?"var(--accent-sky)":"transparent"}`,marginBottom:"-1px",textDecoration:"none"},children:t.label},t.path)})})}function Zg({agentGated:e}){return L.jsxs("div",{style:{padding:"24px",display:"flex",flexDirection:"column",gap:"12px",height:"100%"},children:[L.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:"Claude"}),L.jsx(Pf,{agentGated:e})]})}function em({restartPending:e,onRestart:t}){return e?L.jsxs("div",{style:{background:"var(--bg-elevated)",borderBottom:"1px solid var(--border-accent)",padding:"10px 24px",display:"flex",justifyContent:"space-between",alignItems:"center",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px"},children:[L.jsx("span",{style:{color:"var(--fg)"},children:"Configuration saved. Restart the node to apply."}),L.jsx("button",{type:"button",onClick:t,style:{background:"var(--accent-sky)",border:"1px solid var(--accent-sky)",color:"var(--bg-sunken)",padding:"6px 14px",borderRadius:"6px",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",cursor:"pointer"},children:"Restart node"})]}):null}function un({label:e,value:t,unit:r}){return L.jsxs("div",{style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"10px",padding:"24px"},children:[L.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)",display:"block",marginBottom:"12px"},children:e}),L.jsxs("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"28px",fontWeight:500,color:"var(--fg)",letterSpacing:"-0.01em"},children:[t,r&&L.jsx("span",{style:{color:"var(--fg-muted)",fontSize:"14px",marginLeft:"6px",fontFamily:"'JetBrains Mono', monospace"},children:r})]})]})}function tm({tasksDelivered:e,jinnEarned:t,gasRunwayDays:r,nodeStatus:i}){return L.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"16px"},children:[L.jsx(un,{label:"Tasks delivered",value:e}),L.jsx(un,{label:"JINN earned",value:t,unit:"JINN"}),L.jsx(un,{label:"Gas runway",value:r,unit:"days"}),L.jsx(un,{label:"Node status",value:i})]})}function Pu({active:e=!0,lead:t,body:r,ctaLabel:i,ctaHref:s}){return e?L.jsxs("div",{style:{border:"1px solid var(--border-accent)",background:"transparent",borderRadius:"10px",padding:"14px 24px",display:"flex",justifyContent:"space-between",alignItems:"center",fontFamily:"'JetBrains Mono', monospace"},children:[L.jsxs("span",{style:{color:"var(--fg)"},children:[L.jsx("span",{style:{color:"var(--accent-gold)",marginRight:"6px"},children:t}),r]}),L.jsxs(fo,{href:s,style:{fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--accent-sky)",textDecoration:"none"},children:[i," →"]})]}):null}function Ji({label:e,value:t,tone:r}){return L.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[L.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:e}),L.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"20px",fontWeight:500,color:r==="warn"?"var(--wane)":"var(--fg)"},children:t})]})}function rm({name:e,totals:t}){return L.jsxs("section",{style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"10px",padding:"20px 24px",display:"flex",flexDirection:"column",gap:"12px",fontFamily:"'JetBrains Mono', monospace"},children:[L.jsxs("span",{style:{fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:["Network · ",e]}),L.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 1fr)",gap:"24px"},children:[L.jsx(Ji,{label:"tasks",value:t.tasks}),L.jsx(Ji,{label:"active",value:t.active}),L.jsx(Ji,{label:"solutions",value:t.solutions}),L.jsx(Ji,{label:"verdicts",value:t.verdicts}),L.jsx(Ji,{label:"failed",value:t.failed,tone:t.failed>0?"warn":void 0})]})]})}function im({name:e,role:t,state:r,waitingMessage:i}){const s=r==="live"?"var(--vow-green)":r==="available"?"var(--fg-muted)":"var(--fg-dim)";return L.jsxs("section",{style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"10px",padding:"20px 24px",display:"flex",flexDirection:"column",gap:"12px",fontFamily:"'JetBrains Mono', monospace"},children:[L.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[L.jsxs("span",{style:{fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:["Your ",e]}),L.jsx("span",{style:{fontSize:"11px",color:s,textTransform:"uppercase",letterSpacing:"0.14em"},children:r.replace("_"," ")})]}),L.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:"16px"},children:[L.jsxs("span",{style:{color:"var(--fg)",fontSize:"14px"},children:["Role ",L.jsx("span",{style:{color:"var(--fg-muted)"},children:"·"})," ",t]}),L.jsx(fo,{href:`/configuration#solvernets/${e}`,style:{color:"var(--accent-sky)",fontSize:"11px",textDecoration:"none",letterSpacing:"0.14em",textTransform:"uppercase"},children:"Configure →"})]}),i&&L.jsx("span",{style:{color:"var(--fg-muted)",fontSize:"12px"},children:i})]})}function sm({events:e,liveBadge:t=!0}){const[r,i]=q.useState(!1),s=r?e:e.slice(0,10);return L.jsxs("section",{style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"10px",padding:"20px 24px",display:"flex",flexDirection:"column",gap:"12px",fontFamily:"'JetBrains Mono', monospace"},children:[L.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[L.jsx("span",{style:{fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:"Recent activity"}),t&&L.jsxs("span",{style:{fontSize:"11px",color:"var(--vow-green)",display:"flex",gap:"6px",alignItems:"center"},children:[L.jsx("span",{style:{width:"6px",height:"6px",borderRadius:"50%",background:"var(--vow-green)"}}),"live"]})]}),s.length===0?L.jsx("span",{style:{fontSize:"12px",color:"var(--fg-muted)"},children:"Quiet. Node running; no events to surface yet."}):L.jsx("ul",{style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:"8px"},children:s.map(h=>L.jsxs("li",{style:{display:"grid",gridTemplateColumns:"64px 1fr 96px",gap:"16px",fontSize:"13px"},children:[L.jsx("span",{style:{color:"var(--fg-dim)"},children:h.ts}),L.jsx("span",{style:{color:"var(--fg)"},children:h.message}),L.jsx("span",{style:{color:h.txHash?"var(--accent-sky)":"var(--fg-dim)",textAlign:"right"},children:h.txHash?`${h.txHash.slice(0,6)}…`:"—"})]},h.id))}),e.length>10&&L.jsxs("button",{type:"button",onClick:()=>i(h=>!h),style:{alignSelf:"flex-start",background:"transparent",border:"none",color:"var(--accent-sky)",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",cursor:"pointer",padding:0},children:[r?"Hide":"View all"," →"]})]})}function hn({label:e,sub:t,onClick:r}){return L.jsxs("button",{type:"button",onClick:r,style:{background:"transparent",border:"1px solid var(--border)",borderRadius:"6px",padding:"14px 16px",textAlign:"left",color:"var(--fg)",fontFamily:"'JetBrains Mono', monospace",cursor:"pointer",display:"flex",flexDirection:"column",gap:"4px"},children:[L.jsx("span",{style:{fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:e}),L.jsx("span",{style:{color:"var(--fg-dim)",fontSize:"12px"},children:t})]})}function nm({claimableJinn:e,gasEth:t,onClaim:r,onTopUp:i,onManage:s,onRestart:h}){return L.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[L.jsx("span",{style:{fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)",fontFamily:"'JetBrains Mono', monospace"},children:"Quick actions"}),L.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"12px"},children:[L.jsx(hn,{label:"Claim JINN",sub:`${e} claimable`,onClick:r}),L.jsx(hn,{label:"Top up gas",sub:`${t} ETH`,onClick:i}),L.jsx(hn,{label:"Manage wallet",sub:"Change keystore password",onClick:s}),L.jsx(hn,{label:"Restart node",sub:"Graceful",onClick:h})]})]})}function om(e){return!e||e.length<10?e??"—":`${e.slice(0,6)}…${e.slice(-4)}`}function am({agentId:e,chain:t,safeAddress:r,services:i=[],bindingError:s}){const h=i.find(S=>S.agentId!==null&&!S.safeBoundToAgent),[v,n]=q.useState(!1),[u,d]=q.useState(!1),[g,f]=q.useState(null),[_,C]=q.useState(s??null),w=async()=>{if(h){d(!0),f(null),C(null);try{const l=(await Ie.retryAgentBinding({serviceIndex:h.index})).attempts[0];(l==null?void 0:l.status)==="success"?(f("success"),n(!1)):(f("reverted"),C((l==null?void 0:l.detail)??"Bind reverted on chain."))}catch(S){f("reverted"),C(S instanceof Error?S.message:String(S))}finally{d(!1)}}};return L.jsxs("section",{style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"10px",padding:"20px 24px",display:"flex",flexDirection:"column",gap:"12px",fontFamily:"'JetBrains Mono', monospace"},children:[L.jsx("span",{style:{fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:"Identity"}),L.jsxs("div",{style:{display:"flex",gap:"32px",fontSize:"13px",flexWrap:"wrap"},children:[L.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[L.jsx("span",{style:{fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-dim)"},children:"Agent"}),L.jsxs("span",{style:{color:"var(--fg)",display:"flex",gap:"8px",alignItems:"center"},children:[e!==null?`#${e}`:"—",h&&L.jsx("button",{type:"button",onClick:()=>n(S=>!S),style:{fontSize:"9px",letterSpacing:"0.12em",textTransform:"uppercase",fontFamily:"'JetBrains Mono', monospace",border:"1px solid var(--wane)",color:"var(--wane)",background:"transparent",borderRadius:"999px",padding:"1px 6px",cursor:"pointer"},children:"binding pending"}),g==="success"&&L.jsx("span",{style:{fontSize:"9px",letterSpacing:"0.12em",textTransform:"uppercase",border:"1px solid var(--vow-green)",color:"var(--vow-green)",borderRadius:"999px",padding:"1px 6px"},children:"bound"})]})]}),L.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[L.jsx("span",{style:{fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-dim)"},children:"Chain"}),L.jsx("span",{style:{color:"var(--fg)"},children:t})]}),L.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[L.jsx("span",{style:{fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-dim)"},children:"Safe"}),L.jsx("span",{style:{color:"var(--fg)"},children:om(r)})]})]}),v&&h&&L.jsxs("div",{style:{marginTop:"8px",padding:"12px 14px",border:"1px solid var(--wane)",borderRadius:"6px",background:"rgba(184, 128, 47, 0.07)",display:"flex",flexDirection:"column",gap:"8px"},children:[L.jsxs("span",{style:{fontSize:"12px",color:"var(--fg)"},children:["Service #",h.index," Safe is not yet bound to agent #",h.agentId,". The bootstrap left it unbound; retry to attempt the ERC-1271 bind again."]}),_&&L.jsx("span",{style:{fontSize:"11px",color:"var(--break-red)"},children:_}),L.jsx("button",{type:"button",onClick:()=>{w()},disabled:u,style:{alignSelf:"flex-start",border:"1px solid var(--accent-sky)",background:"var(--accent-sky)",color:"var(--bg-sunken)",borderRadius:"6px",padding:"8px 14px",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",cursor:u?"wait":"pointer"},children:u?"Retrying…":"Retry binding"})]})]})}function lm(){const[e,t]=q.useState(!1);return L.jsxs("section",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:[L.jsxs("button",{type:"button",onClick:()=>t(r=>!r),style:{alignSelf:"flex-start",background:"transparent",border:"none",color:"var(--fg-dim)",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",cursor:"pointer",padding:0},children:[e?"▾":"▸"," Advanced details"]}),e&&L.jsx("div",{style:{border:"1px solid var(--border)",borderRadius:"10px",padding:"20px 24px",background:"var(--bg-elevated)",color:"var(--fg-muted)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px"},children:"Reserved for future power-user details (raw fleet state, claim history, env provenance)."})]})}function Qo(e){if(!e||!/^\d+$/.test(e))return"—";try{const t=BigInt(e);return(Number(t)/1e18).toFixed(4)}catch{return"—"}}function cm(){var f,_,C,w,S,l,a,o,c,p,y,x,k,m,b,D,M,A,O,F,H;const{data:e}=Ai({queryKey:["status"],queryFn:()=>Ie.getStatus(),refetchInterval:5e3}),t=(f=e==null?void 0:e.predictionV1)==null?void 0:f.operator,r=(t==null?void 0:t.enabled)===!0||((_=t==null?void 0:t.solverNet)==null?void 0:_.enabled)===!0,i={tasks:((w=(C=e==null?void 0:e.predictionV1)==null?void 0:C.totals)==null?void 0:w.observedTasks)??0,active:((l=(S=e==null?void 0:e.predictionV1)==null?void 0:S.totals)==null?void 0:l.activeTaskRuns)??0,solutions:((o=(a=e==null?void 0:e.predictionV1)==null?void 0:a.totals)==null?void 0:o.solutions)??0,verdicts:((p=(c=e==null?void 0:e.predictionV1)==null?void 0:c.totals)==null?void 0:p.verdicts)??0,failed:((x=(y=e==null?void 0:e.predictionV1)==null?void 0:y.totals)==null?void 0:x.failed)??0},s=((t==null?void 0:t.diagnostics)??[]).find(U=>U.severity==="error"&&U.code!=="prediction_solvernet_disabled"),h=(((k=e==null?void 0:e.fleet)==null?void 0:k.services)??[]).map(U=>({index:U.index,safeAddress:U.safeAddress??"",agentId:U.agentId??null,safeBoundToAgent:U.safeBoundToAgent??!1})),v=i.solutions,n=Qo((m=e==null?void 0:e.rewards)==null?void 0:m.pendingStakingRewardsWei),u=((b=e==null?void 0:e.masterGas)==null?void 0:b.runwayDaysExcess)??"—",g=(((D=e==null?void 0:e.fleet)==null?void 0:D.services)??[]).every(U=>U.step==="complete"||U.step==="safe_binding_pending")?"Running":"Resuming";return L.jsxs("div",{style:{padding:"24px",display:"flex",flexDirection:"column",gap:"24px"},children:[L.jsx(tm,{tasksDelivered:v,jinnEarned:n,gasRunwayDays:u,nodeStatus:g}),s&&L.jsx(Pu,{lead:"Needs attention",body:s.message,ctaLabel:"Configure prediction",ctaHref:"/configuration#solvernets/prediction"}),L.jsx(rm,{name:"prediction",totals:i}),r?L.jsx(im,{name:"prediction",role:(t==null?void 0:t.role)??"solving",state:"live",waitingMessage:(M=t==null?void 0:t.nextAction)==null?void 0:M.description}):L.jsx(Pu,{lead:"Get started",body:"Pick a SolverNet to participate in",ctaLabel:"Configure",ctaHref:"/configuration#solvernets"}),L.jsx(sm,{events:[]}),L.jsx(nm,{claimableJinn:Qo((A=e==null?void 0:e.rewards)==null?void 0:A.pendingStakingRewardsWei),gasEth:Qo((O=e==null?void 0:e.masterGas)==null?void 0:O.balanceWei),onClaim:()=>{Ie.claimRewards()},onTopUp:()=>{},onManage:()=>{},onRestart:()=>{Ie.restartDaemon()}}),L.jsx(am,{agentId:((F=h[0])==null?void 0:F.agentId)??null,chain:"Base Sepolia",safeAddress:((H=h[0])==null?void 0:H.safeAddress)??null,services:h}),L.jsx(lm,{})]})}const um={default:{color:"var(--fg-dim)",border:"var(--border)"},live:{color:"var(--vow-green)",border:"var(--vow-green)"},attention:{color:"var(--wane)",border:"var(--wane)"},danger:{color:"var(--break-red)",border:"var(--break-red)"}};function sc({title:e,summary:t,metaChip:r,defaultExpanded:i=!1,variant:s="default",dirty:h,children:v}){const[n,u]=q.useState(i),d=um[(r==null?void 0:r.tone)??"default"],g=s==="danger"?"var(--break-red)":"var(--border)";return L.jsxs("section",{style:{background:"var(--bg-elevated)",border:`1px solid ${g}`,borderRadius:"10px",overflow:"hidden"},children:[L.jsxs("button",{type:"button",onClick:()=>u(f=>!f),style:{display:"grid",gridTemplateColumns:"1fr auto auto",gap:"16px",alignItems:"center",padding:"20px 24px",width:"100%",background:"transparent",border:"none",color:"inherit",textAlign:"left",cursor:"pointer",fontFamily:"'JetBrains Mono', monospace"},children:[L.jsxs("span",{children:[L.jsx("span",{style:{display:"block",fontSize:"17px",fontWeight:500,color:s==="danger"?"var(--break-red)":"var(--fg)",letterSpacing:"-0.01em",marginBottom:"4px"},children:e}),L.jsx("span",{style:{fontSize:"13px",color:"var(--fg-muted)"},children:t})]}),r&&L.jsx("span",{style:{fontSize:"11px",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.14em",color:d.color,border:`1px solid ${d.border}`,borderRadius:"4px",padding:"2px 8px"},children:r.label}),L.jsx("span",{style:{color:n?"var(--fg)":"var(--fg-dim)",fontSize:"14px",width:"16px",textAlign:"right"},children:n?"▾":"▸"})]}),n&&L.jsxs("div",{style:{borderTop:"1px solid var(--border)",padding:"24px",display:"flex",flexDirection:"column",gap:"14px"},children:[v,h&&L.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",paddingTop:"14px",marginTop:"4px",borderTop:"1px solid var(--border)",fontFamily:"'JetBrains Mono', monospace"},children:[L.jsx("span",{style:{fontSize:"12px",color:h.error?"var(--break-red)":"var(--accent-sky)"},children:h.error??(h.saving?"Saving…":h.pendingSummary)}),L.jsxs("span",{style:{display:"flex",gap:"8px"},children:[L.jsx("button",{type:"button",onClick:h.onCancel,disabled:h.saving,style:{border:"1px solid var(--border)",borderRadius:"6px",padding:"10px 20px",background:"transparent",color:"var(--fg)",fontFamily:"'JetBrains Mono', monospace",fontSize:"14px",cursor:h.saving?"wait":"pointer"},children:"Cancel"}),L.jsx("button",{type:"button",onClick:h.onSave,disabled:h.saving,style:{border:"1px solid var(--accent-sky)",background:"var(--accent-sky)",color:"var(--bg-sunken)",borderRadius:"6px",padding:"10px 20px",fontFamily:"'JetBrains Mono', monospace",fontSize:"14px",cursor:h.saving?"wait":"pointer"},children:"Save changes"})]})]})]})]})}function hm(){return L.jsx("span",{style:{color:"var(--wane)",fontSize:"9px",letterSpacing:"0.12em",textTransform:"uppercase",fontFamily:"'JetBrains Mono', monospace",border:"1px solid var(--wane)",borderRadius:"999px",padding:"1px 6px"},children:"restart"})}function Gn({label:e,restartRequired:t,helperText:r,children:i}){return L.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[L.jsxs("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)",display:"flex",gap:"6px",alignItems:"center"},children:[e,t&&L.jsx(hm,{})]}),i,r&&L.jsx("span",{style:{fontSize:"11px",color:"var(--fg-dim)",fontFamily:"'JetBrains Mono', monospace"},children:r})]})}function dm({catalog:e,config:t,onSaved:r,onRestartPending:i}){const[s,h]=q.useState(t),[v,n]=q.useState(!1),[u,d]=q.useState(null),[g,f]=q.useState(!1),_=s.enabled!==t.enabled||s.role!==t.role||s.harness!==t.harness||s.model!==t.model||s.plugins.join(",")!==t.plugins.join(","),C=e.state==="coming_soon"?{label:"Coming soon",color:"var(--fg-dim)"}:t.enabled?{label:"Live",color:"var(--vow-green)"}:{label:"Available",color:"var(--fg-muted)"},w=()=>{if(e.state!=="coming_soon"){if(!s.enabled){h({...s,enabled:!0});return}if(_){f(!0);return}h({...s,enabled:!1})}},S=()=>{h(t),d(null),f(!1)},l=async()=>{n(!0),d(null);try{const a={enabled:s.enabled,role:s.role,harness:s.harness,plugins:s.plugins};(t.modelExplicit||s.model!==t.model)&&(a.model=s.model),(await Ie.updateSolverNet(e.name,a)).restartRequired&&i(),r(),f(!1)}catch(a){d(a instanceof Error?a.message:String(a))}finally{n(!1)}};return L.jsxs("div",{style:{border:"1px solid var(--border)",borderRadius:"6px",background:"var(--bg)",overflow:"hidden"},children:[L.jsxs("div",{style:{display:"grid",gridTemplateColumns:"auto 1fr auto auto",gap:"16px",alignItems:"center",padding:"14px 18px"},children:[L.jsx("span",{style:{width:"26px",height:"26px",border:"1px solid var(--border)",borderRadius:"6px"}}),L.jsxs("span",{children:[L.jsx("span",{style:{fontSize:"15px",fontWeight:500,color:"var(--fg)"},children:e.name}),L.jsx("span",{style:{display:"block",fontSize:"12px",color:"var(--fg-muted)",marginTop:"2px"},children:e.description})]}),L.jsx("span",{style:{fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:C.color,border:`1px solid ${C.color}`,borderRadius:"999px",padding:"2px 10px"},children:C.label}),L.jsx("button",{type:"button",onClick:w,disabled:e.state==="coming_soon","aria-label":s.enabled?`Disable ${e.name}`:`Enable ${e.name}`,style:{background:"var(--bg-elevated)",border:`1px solid ${s.enabled?"var(--accent-sky)":"var(--border)"}`,borderRadius:"999px",width:"36px",height:"18px",position:"relative",cursor:e.state==="coming_soon"?"not-allowed":"pointer",opacity:e.state==="coming_soon"?.5:1},children:L.jsx("span",{style:{position:"absolute",top:"2px",left:s.enabled?"auto":"3px",right:s.enabled?"3px":"auto",width:"12px",height:"12px",borderRadius:"50%",background:s.enabled?"var(--accent-sky)":"var(--fg-muted)"}})})]}),s.enabled&&L.jsxs("div",{style:{borderTop:"1px solid var(--border)",padding:"18px 20px",display:"grid",gridTemplateColumns:"1fr 1fr",gap:"16px",background:"var(--bg-sunken)"},children:[L.jsxs("div",{style:{gridColumn:"1 / -1",display:"flex",flexDirection:"column",gap:"6px"},children:[L.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:"Role"}),L.jsx("div",{style:{display:"grid",gridTemplateColumns:`repeat(${e.supportedRoles.length}, 1fr)`,border:"1px solid var(--border)",borderRadius:"6px",overflow:"hidden"},children:e.supportedRoles.map((a,o)=>{const c=s.role===a;return L.jsxs("button",{type:"button","data-role-active":c?"true":"false",onClick:()=>h({...s,role:a}),style:{padding:"10px 14px",textAlign:"center",color:c?"var(--fg)":"var(--fg-muted)",background:c?"var(--bg)":"transparent",borderRight:o<e.supportedRoles.length-1?"1px solid var(--border)":"none",border:"none",cursor:"pointer",fontFamily:"'JetBrains Mono', monospace"},children:[L.jsx("span",{style:{display:"block",fontSize:"14px",fontWeight:500},children:a.charAt(0).toUpperCase()+a.slice(1)}),L.jsx("span",{style:{display:"block",fontSize:"11px",color:c?"var(--fg-muted)":"var(--fg-dim)"},children:a==="solving"?"attempt forecasts":"verify others' forecasts"})]},a)})})]}),L.jsx(Gn,{label:"Harness",restartRequired:!0,children:L.jsx("select",{value:s.harness,onChange:a=>h({...s,harness:a.target.value}),style:{background:"var(--bg)",border:`1px solid ${s.harness!==t.harness?"var(--accent-sky)":"var(--border)"}`,borderRadius:"6px",padding:"10px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"14px",color:"var(--fg)"},children:e.compatibleHarnesses.filter(a=>a.supportsRoles.includes(s.role)).map(a=>L.jsxs("option",{value:a.name,children:[a.name,"@",a.version]},a.name))})}),L.jsx(Gn,{label:"Claude model",restartRequired:!0,children:L.jsx("input",{type:"text",value:s.model,onChange:a=>h({...s,model:a.target.value}),style:{background:"var(--bg)",border:`1px solid ${s.model!==t.model?"var(--accent-sky)":"var(--border)"}`,borderRadius:"6px",padding:"10px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"14px",color:"var(--fg)"}})}),L.jsxs("div",{style:{gridColumn:"1 / -1",display:"flex",flexDirection:"column",gap:"8px"},children:[L.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:"Plugins"}),s.plugins.map(a=>{const o=e.compatiblePlugins.find(c=>c.name===a);return L.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"10px 14px",border:"1px solid var(--border)",borderRadius:"6px",background:"var(--bg)",fontFamily:"'JetBrains Mono', monospace"},children:[L.jsx("span",{style:{fontSize:"14px"},children:a}),L.jsx("span",{style:{color:"var(--fg-dim)",fontSize:"12px"},children:o?`${o.source} · ${o.version}`:"—"})]},a)}),L.jsx("button",{type:"button",disabled:!0,style:{border:"1px dashed var(--border)",borderRadius:"6px",padding:"10px 14px",background:"transparent",color:"var(--fg-dim)",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",cursor:"not-allowed",textAlign:"center"},children:"+ Add plugin (coming soon)"})]})]}),g&&L.jsxs("div",{style:{padding:"14px 20px",borderTop:"1px solid var(--border)",background:"var(--bg-elevated)",display:"flex",justifyContent:"space-between",alignItems:"center",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",color:"var(--fg)"},children:[L.jsxs("span",{children:["Discard pending changes and disable ",e.name,"?"]}),L.jsxs("span",{style:{display:"flex",gap:"8px"},children:[L.jsx("button",{type:"button",onClick:()=>f(!1),style:{border:"1px solid var(--border)",borderRadius:"6px",padding:"6px 14px",background:"transparent",color:"var(--fg)",fontFamily:"inherit",fontSize:"12px"},children:"Keep"}),L.jsx("button",{type:"button",onClick:()=>{h({...t,enabled:!1}),f(!1)},style:{border:"1px solid var(--break-red)",borderRadius:"6px",padding:"6px 14px",background:"var(--break-red)",color:"var(--fg)",fontFamily:"inherit",fontSize:"12px"},children:"Discard + disable"})]})]}),_&&!g&&L.jsxs("div",{style:{padding:"14px 20px",borderTop:"1px solid var(--border)",display:"flex",justifyContent:"space-between",alignItems:"center",fontFamily:"'JetBrains Mono', monospace"},children:[L.jsx("span",{style:{fontSize:"12px",color:u?"var(--break-red)":"var(--accent-sky)"},children:u??(v?"Saving…":"Changes pending")}),L.jsxs("span",{style:{display:"flex",gap:"8px"},children:[L.jsx("button",{type:"button",onClick:S,disabled:v,style:{border:"1px solid var(--border)",borderRadius:"6px",padding:"10px 20px",background:"transparent",color:"var(--fg)",fontFamily:"inherit",fontSize:"14px"},children:"Cancel"}),L.jsx("button",{type:"button",onClick:()=>{l()},disabled:v,style:{border:"1px solid var(--accent-sky)",borderRadius:"6px",padding:"10px 20px",background:"var(--accent-sky)",color:"var(--bg-sunken)",fontFamily:"inherit",fontSize:"14px"},children:"Save changes"})]})]})]})}const Au={live:0,available:1,coming_soon:2};function fm(e,t){var r;return{enabled:(t==null?void 0:t.enabled)??!1,role:(t==null?void 0:t.role)??e.supportedRoles[0]??"solving",harness:(t==null?void 0:t.harness)??((r=e.compatibleHarnesses[0])==null?void 0:r.name)??"",model:(t==null?void 0:t.model)??"claude-haiku-4-5-20251001",modelExplicit:(t==null?void 0:t.model)!==void 0,plugins:(t==null?void 0:t.plugins)??[]}}function pm({configByName:e,onSaved:t,onRestartPending:r,defaultExpanded:i=!0}){const{data:s,isLoading:h}=Ai({queryKey:["solvernets-catalog"],queryFn:()=>Ie.getSolverNets(),staleTime:6e4}),v=((s==null?void 0:s.nets)??[]).slice().sort((d,g)=>(Au[d.state]??99)-(Au[g.state]??99)),n=v.filter(d=>{var g;return(g=e[d.name])==null?void 0:g.enabled}).length,u=h?"Loading catalog…":`${v.length} available · ${n} enabled · pick what your node participates in`;return L.jsx(sc,{title:"SolverNets",summary:u,defaultExpanded:i,metaChip:n>0?{label:`${n} live`,tone:"live"}:void 0,children:v.map(d=>L.jsx(dm,{catalog:d,config:fm(d,e[d.name]),onSaved:t,onRestartPending:r},d.name))})}function _m({chain:e,rpcUrl:t,defaultRpcUrl:r,rpcHealthy:i,onRestartPending:s,defaultExpanded:h=!1}){const[v,n]=q.useState(t),[u,d]=q.useState(!1),[g,f]=q.useState(null),_=v!==t,C=e==="base"?"Base mainnet (chain id 8453)":"Base Sepolia (chain id 84532)",w=async()=>{d(!0),f(null);try{const S=v.length===0?null:v;(await Ie.updateNetwork({rpcUrl:S})).restartRequired&&s()}catch(S){f(S instanceof Error?S.message:String(S))}finally{d(!1)}};return L.jsx(sc,{title:"Network",summary:`${C.split(" (")[0]} · ${t}`,metaChip:{label:i?"Healthy":"Unreachable",tone:i?"live":"danger"},defaultExpanded:h,dirty:_?{pendingSummary:"RPC URL changed · save to apply",saving:u,error:g??void 0,onSave:()=>{w()},onCancel:()=>{n(t),f(null)}}:void 0,children:L.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"16px"},children:[L.jsxs(Gn,{label:"Chain",helperText:"Switching chains resets fleet state — that's a separate flow.",children:[L.jsx("div",{style:{background:"var(--bg-sunken)",border:"1px solid var(--border)",borderRadius:"6px",padding:"10px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",color:"var(--fg-muted)"},children:C}),L.jsx("span",{style:{alignSelf:"flex-start",fontFamily:"'JetBrains Mono', monospace",fontSize:"9px",letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--fg-dim)",border:"1px solid var(--border)",borderRadius:"999px",padding:"1px 6px",marginTop:"6px"},children:"locked"})]}),L.jsxs(Gn,{label:"RPC URL",restartRequired:!0,helperText:`Default: ${r}`,children:[L.jsx("input",{type:"text",value:v,onChange:S=>n(S.target.value),placeholder:r,style:{background:"var(--bg)",border:`1px solid ${_?"var(--accent-sky)":"var(--border)"}`,borderRadius:"6px",padding:"10px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",color:"var(--fg)"}}),L.jsx("button",{type:"button",onClick:()=>n(""),style:{alignSelf:"flex-start",background:"transparent",border:"none",color:"var(--accent-sky)",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",cursor:"pointer",marginTop:"4px",padding:0},children:"Use default"})]})]})})}function vm({defaultExpanded:e=!1}){const[t,r]=q.useState(""),[i,s]=q.useState(""),[h,v]=q.useState("idle"),[n,u]=q.useState(null),d=async()=>{v("rotating"),u(null);try{await Ie.changeKeystorePassword(t,i),v("rotated"),r(""),s("")}catch(g){u(g instanceof Error?g.message:String(g)),v("failed")}};return L.jsxs(sc,{title:"Security",summary:"Rotate keystore password · last rotated never",metaChip:{label:"Danger zone",tone:"danger"},variant:"danger",defaultExpanded:e,children:[L.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"16px"},children:[L.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[L.jsx("span",{style:{fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:"Current password"}),L.jsx("input",{type:"password",value:t,onChange:g=>r(g.target.value),style:{background:"var(--bg)",border:"1px solid var(--border)",borderRadius:"6px",padding:"10px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"14px",color:"var(--fg)"}})]}),L.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[L.jsx("span",{style:{fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:"New password"}),L.jsx("input",{type:"password",value:i,onChange:g=>s(g.target.value),style:{background:"var(--bg)",border:"1px solid var(--border)",borderRadius:"6px",padding:"10px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"14px",color:"var(--fg)"}})]})]}),L.jsx("button",{type:"button",onClick:()=>{d()},disabled:h==="rotating"||t.length===0||i.length<8,style:{alignSelf:"flex-start",background:"var(--break-red)",border:"1px solid var(--break-red)",color:"var(--fg)",borderRadius:"6px",padding:"10px 20px",fontFamily:"'JetBrains Mono', monospace",fontSize:"14px",cursor:h==="rotating"?"wait":"pointer"},children:h==="rotating"?"Rotating…":"Rotate password"}),h==="rotated"&&L.jsx("span",{style:{color:"var(--vow-green)",fontSize:"12px"},children:"Password rotated. Re-run jinn run with the new password."}),h==="failed"&&L.jsxs("span",{style:{color:"var(--break-red)",fontSize:"12px"},children:["Rotation failed: ",n]})]})}function gm(){const[e,t]=q.useState(null);return q.useEffect(()=>{const r=()=>{const i=window.location.hash.replace(/^#/,"");t(i.length>0?i:null)};return r(),window.addEventListener("hashchange",r),()=>window.removeEventListener("hashchange",r)},[]),e}function mm({onRestartPending:e=()=>{}}){const{data:t,refetch:r}=Ai({queryKey:["bootstrap"],queryFn:()=>Ie.getBootstrap(),refetchInterval:1500}),i=gm(),s=i==null?void 0:i.split("/")[0],h=(t==null?void 0:t.chain)??"base-sepolia",v=(t==null?void 0:t.rpcUrl)??"",n=(t==null?void 0:t.defaultRpcUrl)??(h==="base"?"https://mainnet.base.org":"https://sepolia.base.org");return L.jsxs("div",{style:{padding:"24px",display:"flex",flexDirection:"column",gap:"16px"},children:[L.jsx(pm,{configByName:(t==null?void 0:t.solverNets)??{},onSaved:()=>{r()},onRestartPending:e,defaultExpanded:s==="solvernets"||s===void 0}),L.jsx(_m,{chain:h,rpcUrl:v,defaultRpcUrl:n,rpcHealthy:!0,onRestartPending:e,defaultExpanded:s==="network"}),L.jsx(vm,{defaultExpanded:s==="security"})]})}function ym(){const{data:e,isLoading:t}=Ai({queryKey:["bootstrap"],queryFn:()=>Ie.getBootstrap(),refetchInterval:1500}),[r,i]=q.useState(!1);if(t||!e||e.mode==="uninitialized"){const v=e?e.mode==="uninitialized"?"Setting up your wallet":"Loading":"Starting jinn";return L.jsx(bg,{headline:v})}if(e.mode!=="running")return L.jsx(Ig,{});const s=e.chain==="base"?"mainnet":"testnet",h=e.master_address??"";return L.jsxs(kf,{children:[L.jsx(em,{restartPending:r,onRestart:async()=>{await Ie.restartDaemon(),i(!1)}}),L.jsx(Qg,{header:L.jsx(Jg,{network:s,rpcHealthy:!0,masterAddress:h}),tabs:L.jsx(Yg,{}),rail:L.jsx(Zg,{}),children:L.jsxs(Sg,{children:[L.jsx(qo,{path:"/overview",component:cm}),L.jsx(qo,{path:"/configuration",children:L.jsx(mm,{onRestartPending:()=>i(!0)})}),L.jsx(qo,{children:L.jsx(Cg,{to:"/overview"})})]})})]})}const Sm=new Mv({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:1e3}}});wg().finally(()=>{Go.createRoot(document.getElementById("root")).render(L.jsx(Zu.StrictMode,{children:L.jsx(Bv,{client:Sm,children:L.jsx(ym,{})})}))});