@dotobokuri/fleet-console 1.10.2 → 1.11.0

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 (60) hide show
  1. package/dist/client/assets/{_baseUniq-B0PErl2E.js → _baseUniq-ztWyEFQN.js} +1 -1
  2. package/dist/client/assets/{arc-DZOCtb72.js → arc-EhU8s6Ua.js} +1 -1
  3. package/dist/client/assets/{architectureDiagram-Q4EWVU46-lKeHajPP.js → architectureDiagram-Q4EWVU46-D-A0BxBN.js} +1 -1
  4. package/dist/client/assets/{blockDiagram-DXYQGD6D-nxOjG3tp.js → blockDiagram-DXYQGD6D-2I4IGpqO.js} +1 -1
  5. package/dist/client/assets/{c4Diagram-AHTNJAMY-B6immmFF.js → c4Diagram-AHTNJAMY-CbqNPptt.js} +1 -1
  6. package/dist/client/assets/channel-Dd54JtFQ.js +1 -0
  7. package/dist/client/assets/{chunk-4BX2VUAB-hrDXiMYn.js → chunk-4BX2VUAB-BazJQgjj.js} +1 -1
  8. package/dist/client/assets/{chunk-4TB4RGXK-CjiaitfY.js → chunk-4TB4RGXK-B5U6jXNZ.js} +1 -1
  9. package/dist/client/assets/{chunk-55IACEB6-Dfp3hg95.js → chunk-55IACEB6-0n2BOb9g.js} +1 -1
  10. package/dist/client/assets/{chunk-EDXVE4YY-D91XPfwh.js → chunk-EDXVE4YY-CCIYCj-v.js} +1 -1
  11. package/dist/client/assets/{chunk-FMBD7UC4-DTGdaoi9.js → chunk-FMBD7UC4-De3-snUm.js} +1 -1
  12. package/dist/client/assets/{chunk-OYMX7WX6-j4aVytt_.js → chunk-OYMX7WX6-diQ1neOD.js} +1 -1
  13. package/dist/client/assets/{chunk-QZHKN3VN-CA2z0Wnz.js → chunk-QZHKN3VN-jDt-UT0T.js} +1 -1
  14. package/dist/client/assets/{chunk-YZCP3GAM-B0NhMyF9.js → chunk-YZCP3GAM-DcO9HsKI.js} +1 -1
  15. package/dist/client/assets/classDiagram-6PBFFD2Q-DXlHCr38.js +1 -0
  16. package/dist/client/assets/classDiagram-v2-HSJHXN6E-DXlHCr38.js +1 -0
  17. package/dist/client/assets/clone-aAfeyUSr.js +1 -0
  18. package/dist/client/assets/{cose-bilkent-S5V4N54A-BGHrOYlY.js → cose-bilkent-S5V4N54A--wgqx5mz.js} +1 -1
  19. package/dist/client/assets/{dagre-KV5264BT-BFtQQNJz.js → dagre-KV5264BT-BJ0_Y4Vz.js} +1 -1
  20. package/dist/client/assets/{diagram-5BDNPKRD-Bl5sE460.js → diagram-5BDNPKRD-CfBHVHZE.js} +1 -1
  21. package/dist/client/assets/{diagram-G4DWMVQ6-Cjz1orfi.js → diagram-G4DWMVQ6-DDcFZCuW.js} +1 -1
  22. package/dist/client/assets/{diagram-MMDJMWI5-B-fFQatb.js → diagram-MMDJMWI5-D1h5iLfb.js} +1 -1
  23. package/dist/client/assets/{diagram-TYMM5635-C1aFMoW4.js → diagram-TYMM5635-BDq0icy6.js} +1 -1
  24. package/dist/client/assets/{erDiagram-SMLLAGMA-Dnsp-AHy.js → erDiagram-SMLLAGMA-hM5asp2K.js} +1 -1
  25. package/dist/client/assets/{flowDiagram-DWJPFMVM-Ik7b9ai0.js → flowDiagram-DWJPFMVM-Duycvo32.js} +1 -1
  26. package/dist/client/assets/{ganttDiagram-T4ZO3ILL-BC-NrcBq.js → ganttDiagram-T4ZO3ILL-f43QwkVB.js} +1 -1
  27. package/dist/client/assets/{gitGraphDiagram-UUTBAWPF-DWLFCHqJ.js → gitGraphDiagram-UUTBAWPF-B-fSCy1k.js} +1 -1
  28. package/dist/client/assets/{graph-CFrgLuks.js → graph-Cl_pkMd7.js} +1 -1
  29. package/dist/client/assets/index-BvDAt7ke.js +777 -0
  30. package/dist/client/assets/index-CWhJm0eS.css +1 -0
  31. package/dist/client/assets/{infoDiagram-42DDH7IO-C8LNvGxg.js → infoDiagram-42DDH7IO-CI1F8uHU.js} +1 -1
  32. package/dist/client/assets/{ishikawaDiagram-UXIWVN3A-BVF0c1qh.js → ishikawaDiagram-UXIWVN3A-CPTPh9Lu.js} +1 -1
  33. package/dist/client/assets/{journeyDiagram-VCZTEJTY-DRe82d1J.js → journeyDiagram-VCZTEJTY-D_FHFgB1.js} +1 -1
  34. package/dist/client/assets/{kanban-definition-6JOO6SKY-DWQP2qnF.js → kanban-definition-6JOO6SKY-C_Bn4fd8.js} +1 -1
  35. package/dist/client/assets/{layout-CRE4t3i4.js → layout-Bc8t_qfg.js} +1 -1
  36. package/dist/client/assets/{linear-CEMkymuU.js → linear-GI_b927m.js} +1 -1
  37. package/dist/client/assets/{mermaid.core-Bstsk9cs.js → mermaid.core-Dpt8s_19.js} +4 -4
  38. package/dist/client/assets/{min-Dqb8cdig.js → min-C0TmzA9X.js} +1 -1
  39. package/dist/client/assets/{mindmap-definition-QFDTVHPH-C4IgFjul.js → mindmap-definition-QFDTVHPH-DeVjdvs_.js} +1 -1
  40. package/dist/client/assets/{pieDiagram-DEJITSTG-qQsv3h1d.js → pieDiagram-DEJITSTG-D6vRcSmr.js} +1 -1
  41. package/dist/client/assets/{quadrantDiagram-34T5L4WZ-B9Z5d9Su.js → quadrantDiagram-34T5L4WZ-CHx1fSsQ.js} +1 -1
  42. package/dist/client/assets/{requirementDiagram-MS252O5E-B3bvh52E.js → requirementDiagram-MS252O5E-BYXRdqXr.js} +1 -1
  43. package/dist/client/assets/{sankeyDiagram-XADWPNL6-CzMbxMn4.js → sankeyDiagram-XADWPNL6-DQ6TVGQn.js} +1 -1
  44. package/dist/client/assets/{sequenceDiagram-FGHM5R23-OC2b3ovy.js → sequenceDiagram-FGHM5R23-DLKBakQH.js} +1 -1
  45. package/dist/client/assets/{stateDiagram-FHFEXIEX-DZ794L2W.js → stateDiagram-FHFEXIEX-CKEUdeZY.js} +1 -1
  46. package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-DtBjrVLm.js +1 -0
  47. package/dist/client/assets/{timeline-definition-GMOUNBTQ-VG_E_aeb.js → timeline-definition-GMOUNBTQ-DJ34nw1g.js} +1 -1
  48. package/dist/client/assets/{vennDiagram-DHZGUBPP-rtfRsKP2.js → vennDiagram-DHZGUBPP-DaF9-6LK.js} +1 -1
  49. package/dist/client/assets/{wardley-RL74JXVD-BFVZEiVh.js → wardley-RL74JXVD-B3nUfV4p.js} +1 -1
  50. package/dist/client/assets/{wardleyDiagram-NUSXRM2D-CAwmkN7Y.js → wardleyDiagram-NUSXRM2D-DeYWbpzl.js} +1 -1
  51. package/dist/client/assets/{xychartDiagram-5P7HB3ND-Gk8gTxJJ.js → xychartDiagram-5P7HB3ND-DkpV5JZH.js} +1 -1
  52. package/dist/client/index.html +2 -2
  53. package/package.json +1 -1
  54. package/dist/client/assets/channel-BPvn1RT5.js +0 -1
  55. package/dist/client/assets/classDiagram-6PBFFD2Q-CGvwHQW2.js +0 -1
  56. package/dist/client/assets/classDiagram-v2-HSJHXN6E-CGvwHQW2.js +0 -1
  57. package/dist/client/assets/clone-jCrAo27W.js +0 -1
  58. package/dist/client/assets/index-BSr9Yi1L.css +0 -1
  59. package/dist/client/assets/index-BmsjlgH0.js +0 -777
  60. package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-CWkyT6YP.js +0 -1
@@ -1,777 +0,0 @@
1
- (function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))a(l);new MutationObserver(l=>{for(const p of l)if(p.type==="childList")for(const m of p.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&a(m)}).observe(document,{childList:!0,subtree:!0});function r(l){const p={};return l.integrity&&(p.integrity=l.integrity),l.referrerPolicy&&(p.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?p.credentials="include":l.crossOrigin==="anonymous"?p.credentials="omit":p.credentials="same-origin",p}function a(l){if(l.ep)return;l.ep=!0;const p=r(l);fetch(l.href,p)}})();function cE(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function sB(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var n=e.default;if(typeof n=="function"){var r=function a(){var l=!1;try{l=this instanceof a}catch{}return l?Reflect.construct(n,arguments,this.constructor):n.apply(this,arguments)};r.prototype=n.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(a){var l=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(r,a,l.get?l:{enumerable:!0,get:function(){return e[a]}})}),r}var _f={exports:{}},ol={};var z0;function uE(){if(z0)return ol;z0=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function r(a,l,p){var m=null;if(p!==void 0&&(m=""+p),l.key!==void 0&&(m=""+l.key),"key"in l){p={};for(var c in l)c!=="key"&&(p[c]=l[c])}else p=l;return l=p.ref,{$$typeof:e,type:a,key:m,ref:l!==void 0?l:null,props:p}}return ol.Fragment=n,ol.jsx=r,ol.jsxs=r,ol}var P0;function hE(){return P0||(P0=1,_f.exports=uE()),_f.exports}var S=hE(),vf={exports:{}},Fe={};var H0;function dE(){if(H0)return Fe;H0=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),p=Symbol.for("react.consumer"),m=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),C=Symbol.iterator;function T(N){return N===null||typeof N!="object"?null:(N=C&&N[C]||N["@@iterator"],typeof N=="function"?N:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,d={};function v(N,P,Z){this.props=N,this.context=P,this.refs=d,this.updater=Z||A}v.prototype.isReactComponent={},v.prototype.setState=function(N,P){if(typeof N!="object"&&typeof N!="function"&&N!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,N,P,"setState")},v.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function f(){}f.prototype=v.prototype;function b(N,P,Z){this.props=N,this.context=P,this.refs=d,this.updater=Z||A}var E=b.prototype=new f;E.constructor=b,x(E,v.prototype),E.isPureReactComponent=!0;var L=Array.isArray;function R(){}var M={H:null,A:null,T:null,S:null},k=Object.prototype.hasOwnProperty;function O(N,P,Z){var ae=Z.ref;return{$$typeof:e,type:N,key:P,ref:ae!==void 0?ae:null,props:Z}}function U(N,P){return O(N.type,P,N.props)}function F(N){return typeof N=="object"&&N!==null&&N.$$typeof===e}function G(N){var P={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(Z){return P[Z]})}var I=/\/+/g;function K(N,P){return typeof N=="object"&&N!==null&&N.key!=null?G(""+N.key):P.toString(36)}function te(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(R,R):(N.status="pending",N.then(function(P){N.status==="pending"&&(N.status="fulfilled",N.value=P)},function(P){N.status==="pending"&&(N.status="rejected",N.reason=P)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function q(N,P,Z,ae,ce){var _e=typeof N;(_e==="undefined"||_e==="boolean")&&(N=null);var Q=!1;if(N===null)Q=!0;else switch(_e){case"bigint":case"string":case"number":Q=!0;break;case"object":switch(N.$$typeof){case e:case n:Q=!0;break;case y:return Q=N._init,q(Q(N._payload),P,Z,ae,ce)}}if(Q)return ce=ce(N),Q=ae===""?"."+K(N,0):ae,L(ce)?(Z="",Q!=null&&(Z=Q.replace(I,"$&/")+"/"),q(ce,P,Z,"",function(ge){return ge})):ce!=null&&(F(ce)&&(ce=U(ce,Z+(ce.key==null||N&&N.key===ce.key?"":(""+ce.key).replace(I,"$&/")+"/")+Q)),P.push(ce)),1;Q=0;var z=ae===""?".":ae+":";if(L(N))for(var oe=0;oe<N.length;oe++)ae=N[oe],_e=z+K(ae,oe),Q+=q(ae,P,Z,_e,ce);else if(oe=T(N),typeof oe=="function")for(N=oe.call(N),oe=0;!(ae=N.next()).done;)ae=ae.value,_e=z+K(ae,oe++),Q+=q(ae,P,Z,_e,ce);else if(_e==="object"){if(typeof N.then=="function")return q(te(N),P,Z,ae,ce);throw P=String(N),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.")}return Q}function W(N,P,Z){if(N==null)return N;var ae=[],ce=0;return q(N,ae,"","",function(_e){return P.call(Z,_e,ce++)}),ae}function Y(N){if(N._status===-1){var P=N._result;P=P(),P.then(function(Z){(N._status===0||N._status===-1)&&(N._status=1,N._result=Z)},function(Z){(N._status===0||N._status===-1)&&(N._status=2,N._result=Z)}),N._status===-1&&(N._status=0,N._result=P)}if(N._status===1)return N._result.default;throw N._result}var B=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var P=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent(P))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},$={map:W,forEach:function(N,P,Z){W(N,function(){P.apply(this,arguments)},Z)},count:function(N){var P=0;return W(N,function(){P++}),P},toArray:function(N){return W(N,function(P){return P})||[]},only:function(N){if(!F(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return Fe.Activity=g,Fe.Children=$,Fe.Component=v,Fe.Fragment=r,Fe.Profiler=l,Fe.PureComponent=b,Fe.StrictMode=a,Fe.Suspense=u,Fe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,Fe.__COMPILER_RUNTIME={__proto__:null,c:function(N){return M.H.useMemoCache(N)}},Fe.cache=function(N){return function(){return N.apply(null,arguments)}},Fe.cacheSignal=function(){return null},Fe.cloneElement=function(N,P,Z){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var ae=x({},N.props),ce=N.key;if(P!=null)for(_e in P.key!==void 0&&(ce=""+P.key),P)!k.call(P,_e)||_e==="key"||_e==="__self"||_e==="__source"||_e==="ref"&&P.ref===void 0||(ae[_e]=P[_e]);var _e=arguments.length-2;if(_e===1)ae.children=Z;else if(1<_e){for(var Q=Array(_e),z=0;z<_e;z++)Q[z]=arguments[z+2];ae.children=Q}return O(N.type,ce,ae)},Fe.createContext=function(N){return N={$$typeof:m,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:p,_context:N},N},Fe.createElement=function(N,P,Z){var ae,ce={},_e=null;if(P!=null)for(ae in P.key!==void 0&&(_e=""+P.key),P)k.call(P,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(ce[ae]=P[ae]);var Q=arguments.length-2;if(Q===1)ce.children=Z;else if(1<Q){for(var z=Array(Q),oe=0;oe<Q;oe++)z[oe]=arguments[oe+2];ce.children=z}if(N&&N.defaultProps)for(ae in Q=N.defaultProps,Q)ce[ae]===void 0&&(ce[ae]=Q[ae]);return O(N,_e,ce)},Fe.createRef=function(){return{current:null}},Fe.forwardRef=function(N){return{$$typeof:c,render:N}},Fe.isValidElement=F,Fe.lazy=function(N){return{$$typeof:y,_payload:{_status:-1,_result:N},_init:Y}},Fe.memo=function(N,P){return{$$typeof:h,type:N,compare:P===void 0?null:P}},Fe.startTransition=function(N){var P=M.T,Z={};M.T=Z;try{var ae=N(),ce=M.S;ce!==null&&ce(Z,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(R,B)}catch(_e){B(_e)}finally{P!==null&&Z.types!==null&&(P.types=Z.types),M.T=P}},Fe.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},Fe.use=function(N){return M.H.use(N)},Fe.useActionState=function(N,P,Z){return M.H.useActionState(N,P,Z)},Fe.useCallback=function(N,P){return M.H.useCallback(N,P)},Fe.useContext=function(N){return M.H.useContext(N)},Fe.useDebugValue=function(){},Fe.useDeferredValue=function(N,P){return M.H.useDeferredValue(N,P)},Fe.useEffect=function(N,P){return M.H.useEffect(N,P)},Fe.useEffectEvent=function(N){return M.H.useEffectEvent(N)},Fe.useId=function(){return M.H.useId()},Fe.useImperativeHandle=function(N,P,Z){return M.H.useImperativeHandle(N,P,Z)},Fe.useInsertionEffect=function(N,P){return M.H.useInsertionEffect(N,P)},Fe.useLayoutEffect=function(N,P){return M.H.useLayoutEffect(N,P)},Fe.useMemo=function(N,P){return M.H.useMemo(N,P)},Fe.useOptimistic=function(N,P){return M.H.useOptimistic(N,P)},Fe.useReducer=function(N,P,Z){return M.H.useReducer(N,P,Z)},Fe.useRef=function(N){return M.H.useRef(N)},Fe.useState=function(N){return M.H.useState(N)},Fe.useSyncExternalStore=function(N,P,Z){return M.H.useSyncExternalStore(N,P,Z)},Fe.useTransition=function(){return M.H.useTransition()},Fe.version="19.2.7",Fe}var U0;function vg(){return U0||(U0=1,vf.exports=dE()),vf.exports}var H=vg(),bf={exports:{}},ll={},yf={exports:{}},Sf={};var F0;function fE(){return F0||(F0=1,(function(e){function n(q,W){var Y=q.length;q.push(W);e:for(;0<Y;){var B=Y-1>>>1,$=q[B];if(0<l($,W))q[B]=W,q[Y]=$,Y=B;else break e}}function r(q){return q.length===0?null:q[0]}function a(q){if(q.length===0)return null;var W=q[0],Y=q.pop();if(Y!==W){q[0]=Y;e:for(var B=0,$=q.length,N=$>>>1;B<N;){var P=2*(B+1)-1,Z=q[P],ae=P+1,ce=q[ae];if(0>l(Z,Y))ae<$&&0>l(ce,Z)?(q[B]=ce,q[ae]=Y,B=ae):(q[B]=Z,q[P]=Y,B=P);else if(ae<$&&0>l(ce,Y))q[B]=ce,q[ae]=Y,B=ae;else break e}}return W}function l(q,W){var Y=q.sortIndex-W.sortIndex;return Y!==0?Y:q.id-W.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var p=performance;e.unstable_now=function(){return p.now()}}else{var m=Date,c=m.now();e.unstable_now=function(){return m.now()-c}}var u=[],h=[],y=1,g=null,C=3,T=!1,A=!1,x=!1,d=!1,v=typeof setTimeout=="function"?setTimeout:null,f=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;function E(q){for(var W=r(h);W!==null;){if(W.callback===null)a(h);else if(W.startTime<=q)a(h),W.sortIndex=W.expirationTime,n(u,W);else break;W=r(h)}}function L(q){if(x=!1,E(q),!A)if(r(u)!==null)A=!0,R||(R=!0,G());else{var W=r(h);W!==null&&te(L,W.startTime-q)}}var R=!1,M=-1,k=5,O=-1;function U(){return d?!0:!(e.unstable_now()-O<k)}function F(){if(d=!1,R){var q=e.unstable_now();O=q;var W=!0;try{e:{A=!1,x&&(x=!1,f(M),M=-1),T=!0;var Y=C;try{t:{for(E(q),g=r(u);g!==null&&!(g.expirationTime>q&&U());){var B=g.callback;if(typeof B=="function"){g.callback=null,C=g.priorityLevel;var $=B(g.expirationTime<=q);if(q=e.unstable_now(),typeof $=="function"){g.callback=$,E(q),W=!0;break t}g===r(u)&&a(u),E(q)}else a(u);g=r(u)}if(g!==null)W=!0;else{var N=r(h);N!==null&&te(L,N.startTime-q),W=!1}}break e}finally{g=null,C=Y,T=!1}W=void 0}}finally{W?G():R=!1}}}var G;if(typeof b=="function")G=function(){b(F)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,K=I.port2;I.port1.onmessage=F,G=function(){K.postMessage(null)}}else G=function(){v(F,0)};function te(q,W){M=v(function(){q(e.unstable_now())},W)}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(q){q.callback=null},e.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<q?Math.floor(1e3/q):5},e.unstable_getCurrentPriorityLevel=function(){return C},e.unstable_next=function(q){switch(C){case 1:case 2:case 3:var W=3;break;default:W=C}var Y=C;C=W;try{return q()}finally{C=Y}},e.unstable_requestPaint=function(){d=!0},e.unstable_runWithPriority=function(q,W){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var Y=C;C=q;try{return W()}finally{C=Y}},e.unstable_scheduleCallback=function(q,W,Y){var B=e.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?B+Y:B):Y=B,q){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=Y+$,q={id:y++,callback:W,priorityLevel:q,startTime:Y,expirationTime:$,sortIndex:-1},Y>B?(q.sortIndex=Y,n(h,q),r(u)===null&&q===r(h)&&(x?(f(M),M=-1):x=!0,te(L,Y-B))):(q.sortIndex=$,n(u,q),A||T||(A=!0,R||(R=!0,G()))),q},e.unstable_shouldYield=U,e.unstable_wrapCallback=function(q){var W=C;return function(){var Y=C;C=W;try{return q.apply(this,arguments)}finally{C=Y}}}})(Sf)),Sf}var q0;function pE(){return q0||(q0=1,yf.exports=fE()),yf.exports}var wf={exports:{}},On={};var W0;function gE(){if(W0)return On;W0=1;var e=vg();function n(u){var h="https://react.dev/errors/"+u;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)h+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+u+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var a={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},l=Symbol.for("react.portal");function p(u,h,y){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:g==null?null:""+g,children:u,containerInfo:h,implementation:y}}var m=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(u,h){if(u==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return On.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,On.createPortal=function(u,h){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(n(299));return p(u,h,null,y)},On.flushSync=function(u){var h=m.T,y=a.p;try{if(m.T=null,a.p=2,u)return u()}finally{m.T=h,a.p=y,a.d.f()}},On.preconnect=function(u,h){typeof u=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,a.d.C(u,h))},On.prefetchDNS=function(u){typeof u=="string"&&a.d.D(u)},On.preinit=function(u,h){if(typeof u=="string"&&h&&typeof h.as=="string"){var y=h.as,g=c(y,h.crossOrigin),C=typeof h.integrity=="string"?h.integrity:void 0,T=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;y==="style"?a.d.S(u,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:g,integrity:C,fetchPriority:T}):y==="script"&&a.d.X(u,{crossOrigin:g,integrity:C,fetchPriority:T,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},On.preinitModule=function(u,h){if(typeof u=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var y=c(h.as,h.crossOrigin);a.d.M(u,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&a.d.M(u)},On.preload=function(u,h){if(typeof u=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var y=h.as,g=c(y,h.crossOrigin);a.d.L(u,y,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},On.preloadModule=function(u,h){if(typeof u=="string")if(h){var y=c(h.as,h.crossOrigin);a.d.m(u,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else a.d.m(u)},On.requestFormReset=function(u){a.d.r(u)},On.unstable_batchedUpdates=function(u,h){return u(h)},On.useFormState=function(u,h,y){return m.H.useFormState(u,h,y)},On.useFormStatus=function(){return m.H.useHostTransitionStatus()},On.version="19.2.7",On}var G0;function Ly(){if(G0)return wf.exports;G0=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),wf.exports=gE(),wf.exports}var K0;function mE(){if(K0)return ll;K0=1;var e=pE(),n=vg(),r=Ly();function a(t){var i="https://react.dev/errors/"+t;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)i+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+t+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function p(t){var i=t,s=t;if(t.alternate)for(;i.return;)i=i.return;else{t=i;do i=t,(i.flags&4098)!==0&&(s=i.return),t=i.return;while(t)}return i.tag===3?s:null}function m(t){if(t.tag===13){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function c(t){if(t.tag===31){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function u(t){if(p(t)!==t)throw Error(a(188))}function h(t){var i=t.alternate;if(!i){if(i=p(t),i===null)throw Error(a(188));return i!==t?null:t}for(var s=t,o=i;;){var _=s.return;if(_===null)break;var w=_.alternate;if(w===null){if(o=_.return,o!==null){s=o;continue}break}if(_.child===w.child){for(w=_.child;w;){if(w===s)return u(_),t;if(w===o)return u(_),i;w=w.sibling}throw Error(a(188))}if(s.return!==o.return)s=_,o=w;else{for(var D=!1,j=_.child;j;){if(j===s){D=!0,s=_,o=w;break}if(j===o){D=!0,o=_,s=w;break}j=j.sibling}if(!D){for(j=w.child;j;){if(j===s){D=!0,s=w,o=_;break}if(j===o){D=!0,o=w,s=_;break}j=j.sibling}if(!D)throw Error(a(189))}}if(s.alternate!==o)throw Error(a(190))}if(s.tag!==3)throw Error(a(188));return s.stateNode.current===s?t:i}function y(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t;for(t=t.child;t!==null;){if(i=y(t),i!==null)return i;t=t.sibling}return null}var g=Object.assign,C=Symbol.for("react.element"),T=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),b=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),O=Symbol.for("react.activity"),U=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function G(t){return t===null||typeof t!="object"?null:(t=F&&t[F]||t["@@iterator"],typeof t=="function"?t:null)}var I=Symbol.for("react.client.reference");function K(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===I?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case x:return"Fragment";case v:return"Profiler";case d:return"StrictMode";case L:return"Suspense";case R:return"SuspenseList";case O:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case A:return"Portal";case b:return t.displayName||"Context";case f:return(t._context.displayName||"Context")+".Consumer";case E:var i=t.render;return t=t.displayName,t||(t=i.displayName||i.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case M:return i=t.displayName||null,i!==null?i:K(t.type)||"Memo";case k:i=t._payload,t=t._init;try{return K(t(i))}catch{}}return null}var te=Array.isArray,q=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},B=[],$=-1;function N(t){return{current:t}}function P(t){0>$||(t.current=B[$],B[$]=null,$--)}function Z(t,i){$++,B[$]=t.current,t.current=i}var ae=N(null),ce=N(null),_e=N(null),Q=N(null);function z(t,i){switch(Z(_e,i),Z(ce,t),Z(ae,null),i.nodeType){case 9:case 11:t=(t=i.documentElement)&&(t=t.namespaceURI)?l0(t):0;break;default:if(t=i.tagName,i=i.namespaceURI)i=l0(i),t=c0(i,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}P(ae),Z(ae,t)}function oe(){P(ae),P(ce),P(_e)}function ge(t){t.memoizedState!==null&&Z(Q,t);var i=ae.current,s=c0(i,t.type);i!==s&&(Z(ce,t),Z(ae,s))}function Se(t){ce.current===t&&(P(ae),P(ce)),Q.current===t&&(P(Q),il._currentValue=Y)}var ye,Pe;function qe(t){if(ye===void 0)try{throw Error()}catch(s){var i=s.stack.trim().match(/\n( *(at )?)/);ye=i&&i[1]||"",Pe=-1<s.stack.indexOf(`
2
- at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
3
- `+ye+t+Pe}var Xe=!1;function xt(t,i){if(!t||Xe)return"";Xe=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(i){var fe=function(){throw Error()};if(Object.defineProperty(fe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(fe,[])}catch(le){var se=le}Reflect.construct(t,[],fe)}else{try{fe.call()}catch(le){se=le}t.call(fe.prototype)}}else{try{throw Error()}catch(le){se=le}(fe=t())&&typeof fe.catch=="function"&&fe.catch(function(){})}}catch(le){if(le&&se&&typeof le.stack=="string")return[le.stack,se.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var _=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");_&&_.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=o.DetermineComponentFrameRoot(),D=w[0],j=w[1];if(D&&j){var X=D.split(`
4
- `),re=j.split(`
5
- `);for(_=o=0;o<X.length&&!X[o].includes("DetermineComponentFrameRoot");)o++;for(;_<re.length&&!re[_].includes("DetermineComponentFrameRoot");)_++;if(o===X.length||_===re.length)for(o=X.length-1,_=re.length-1;1<=o&&0<=_&&X[o]!==re[_];)_--;for(;1<=o&&0<=_;o--,_--)if(X[o]!==re[_]){if(o!==1||_!==1)do if(o--,_--,0>_||X[o]!==re[_]){var ue=`
6
- `+X[o].replace(" at new "," at ");return t.displayName&&ue.includes("<anonymous>")&&(ue=ue.replace("<anonymous>",t.displayName)),ue}while(1<=o&&0<=_);break}}}finally{Xe=!1,Error.prepareStackTrace=s}return(s=t?t.displayName||t.name:"")?qe(s):""}function Ne(t,i){switch(t.tag){case 26:case 27:case 5:return qe(t.type);case 16:return qe("Lazy");case 13:return t.child!==i&&i!==null?qe("Suspense Fallback"):qe("Suspense");case 19:return qe("SuspenseList");case 0:case 15:return xt(t.type,!1);case 11:return xt(t.type.render,!1);case 1:return xt(t.type,!0);case 31:return qe("Activity");default:return""}}function en(t){try{var i="",s=null;do i+=Ne(t,s),s=t,t=t.return;while(t);return i}catch(o){return`
7
- Error generating stack: `+o.message+`
8
- `+o.stack}}var bn=Object.prototype.hasOwnProperty,yn=e.unstable_scheduleCallback,pi=e.unstable_cancelCallback,Mi=e.unstable_shouldYield,tn=e.unstable_requestPaint,ut=e.unstable_now,Vt=e.unstable_getCurrentPriorityLevel,$t=e.unstable_ImmediatePriority,zt=e.unstable_UserBlockingPriority,nn=e.unstable_NormalPriority,Di=e.unstable_LowPriority,Mn=e.unstable_IdlePriority,ni=e.log,dt=e.unstable_setDisableYieldValue,Hn=null,Yt=null;function Xt(t){if(typeof ni=="function"&&dt(t),Yt&&typeof Yt.setStrictMode=="function")try{Yt.setStrictMode(Hn,t)}catch{}}var Pt=Math.clz32?Math.clz32:ra,ws=Math.log,ar=Math.LN2;function ra(t){return t>>>=0,t===0?32:31-(ws(t)/ar|0)|0}var Oi=256,Wi=262144,or=4194304;function rn(t){var i=t&42;if(i!==0)return i;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function J(t,i,s){var o=t.pendingLanes;if(o===0)return 0;var _=0,w=t.suspendedLanes,D=t.pingedLanes;t=t.warmLanes;var j=o&134217727;return j!==0?(o=j&~w,o!==0?_=rn(o):(D&=j,D!==0?_=rn(D):s||(s=j&~t,s!==0&&(_=rn(s))))):(j=o&~w,j!==0?_=rn(j):D!==0?_=rn(D):s||(s=o&~t,s!==0&&(_=rn(s)))),_===0?0:i!==0&&i!==_&&(i&w)===0&&(w=_&-_,s=i&-i,w>=s||w===32&&(s&4194048)!==0)?i:_}function he(t,i){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&i)===0}function be(t,i){switch(t){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ie(){var t=or;return or<<=1,(or&62914560)===0&&(or=4194304),t}function wt(t){for(var i=[],s=0;31>s;s++)i.push(t);return i}function ft(t,i){t.pendingLanes|=i,i!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Te(t,i,s,o,_,w){var D=t.pendingLanes;t.pendingLanes=s,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=s,t.entangledLanes&=s,t.errorRecoveryDisabledLanes&=s,t.shellSuspendCounter=0;var j=t.entanglements,X=t.expirationTimes,re=t.hiddenUpdates;for(s=D&~s;0<s;){var ue=31-Pt(s),fe=1<<ue;j[ue]=0,X[ue]=-1;var se=re[ue];if(se!==null)for(re[ue]=null,ue=0;ue<se.length;ue++){var le=se[ue];le!==null&&(le.lane&=-536870913)}s&=~fe}o!==0&&Ce(t,o,0),w!==0&&_===0&&t.tag!==0&&(t.suspendedLanes|=w&~(D&~i))}function Ce(t,i,s){t.pendingLanes|=i,t.suspendedLanes&=~i;var o=31-Pt(i);t.entangledLanes|=i,t.entanglements[o]=t.entanglements[o]|1073741824|s&261930}function je(t,i){var s=t.entangledLanes|=i;for(t=t.entanglements;s;){var o=31-Pt(s),_=1<<o;_&i|t[o]&i&&(t[o]|=i),s&=~_}}function It(t,i){var s=i&-i;return s=(s&42)!==0?1:et(s),(s&(t.suspendedLanes|i))!==0?0:s}function et(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Sn(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function lr(){var t=W.p;return t!==0?t:(t=window.event,t===void 0?32:D0(t.type))}function cr(t,i){var s=W.p;try{return W.p=t,i()}finally{W.p=s}}var Un=Math.random().toString(36).slice(2),At="__reactFiber$"+Un,Et="__reactProps$"+Un,Ni="__reactContainer$"+Un,zr="__reactEvents$"+Un,sa="__reactListeners$"+Un,ur="__reactHandles$"+Un,Cs="__reactResources$"+Un,Gi="__reactMarker$"+Un;function De(t){delete t[At],delete t[Et],delete t[zr],delete t[sa],delete t[ur]}function V(t){var i=t[At];if(i)return i;for(var s=t.parentNode;s;){if(i=s[Ni]||s[At]){if(s=i.alternate,i.child!==null||s!==null&&s.child!==null)for(t=m0(t);t!==null;){if(s=t[At])return s;t=m0(t)}return i}t=s,s=t.parentNode}return null}function pe(t){if(t=t[At]||t[Ni]){var i=t.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return t}return null}function xe(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t.stateNode;throw Error(a(33))}function rt(t){var i=t[Cs];return i||(i=t[Cs]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Ze(t){t[Gi]=!0}var kt=new Set,Ht={};function Ut(t,i){me(t,i),me(t+"Capture",i)}function me(t,i){for(Ht[t]=i,t=0;t<i.length;t++)kt.add(i[t])}var Me=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Oe={},at={};function Ot(t){return bn.call(at,t)?!0:bn.call(Oe,t)?!1:Me.test(t)?at[t]=!0:(Oe[t]=!0,!1)}function Dn(t,i,s){if(Ot(i))if(s===null)t.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":t.removeAttribute(i);return;case"boolean":var o=i.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){t.removeAttribute(i);return}}t.setAttribute(i,""+s)}}function ii(t,i,s){if(s===null)t.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(i);return}t.setAttribute(i,""+s)}}function Fn(t,i,s,o){if(o===null)t.removeAttribute(s);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(s);return}t.setAttributeNS(i,s,""+o)}}function Tt(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function ri(t){var i=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function Kl(t,i,s){var o=Object.getOwnPropertyDescriptor(t.constructor.prototype,i);if(!t.hasOwnProperty(i)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var _=o.get,w=o.set;return Object.defineProperty(t,i,{configurable:!0,get:function(){return _.call(this)},set:function(D){s=""+D,w.call(this,D)}}),Object.defineProperty(t,i,{enumerable:o.enumerable}),{getValue:function(){return s},setValue:function(D){s=""+D},stopTracking:function(){t._valueTracker=null,delete t[i]}}}}function aa(t){if(!t._valueTracker){var i=ri(t)?"checked":"value";t._valueTracker=Kl(t,i,""+t[i])}}function mo(t){if(!t)return!1;var i=t._valueTracker;if(!i)return!0;var s=i.getValue(),o="";return t&&(o=ri(t)?t.checked?"true":"false":t.value),t=o,t!==s?(i.setValue(t),!0):!1}function oa(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var gh=/[\n"\\]/g;function qn(t){return t.replace(gh,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function _o(t,i,s,o,_,w,D,j){t.name="",D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?t.type=D:t.removeAttribute("type"),i!=null?D==="number"?(i===0&&t.value===""||t.value!=i)&&(t.value=""+Tt(i)):t.value!==""+Tt(i)&&(t.value=""+Tt(i)):D!=="submit"&&D!=="reset"||t.removeAttribute("value"),i!=null?la(t,D,Tt(i)):s!=null?la(t,D,Tt(s)):o!=null&&t.removeAttribute("value"),_==null&&w!=null&&(t.defaultChecked=!!w),_!=null&&(t.checked=_&&typeof _!="function"&&typeof _!="symbol"),j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?t.name=""+Tt(j):t.removeAttribute("name")}function xs(t,i,s,o,_,w,D,j){if(w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(t.type=w),i!=null||s!=null){if(!(w!=="submit"&&w!=="reset"||i!=null)){aa(t);return}s=s!=null?""+Tt(s):"",i=i!=null?""+Tt(i):s,j||i===t.value||(t.value=i),t.defaultValue=i}o=o??_,o=typeof o!="function"&&typeof o!="symbol"&&!!o,t.checked=j?t.checked:!!o,t.defaultChecked=!!o,D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"&&(t.name=D),aa(t)}function la(t,i,s){i==="number"&&oa(t.ownerDocument)===t||t.defaultValue===""+s||(t.defaultValue=""+s)}function wn(t,i,s,o){if(t=t.options,i){i={};for(var _=0;_<s.length;_++)i["$"+s[_]]=!0;for(s=0;s<t.length;s++)_=i.hasOwnProperty("$"+t[s].value),t[s].selected!==_&&(t[s].selected=_),_&&o&&(t[s].defaultSelected=!0)}else{for(s=""+Tt(s),i=null,_=0;_<t.length;_++){if(t[_].value===s){t[_].selected=!0,o&&(t[_].defaultSelected=!0);return}i!==null||t[_].disabled||(i=t[_])}i!==null&&(i.selected=!0)}}function Vl(t,i,s){if(i!=null&&(i=""+Tt(i),i!==t.value&&(t.value=i),s==null)){t.defaultValue!==i&&(t.defaultValue=i);return}t.defaultValue=s!=null?""+Tt(s):""}function ca(t,i,s,o){if(i==null){if(o!=null){if(s!=null)throw Error(a(92));if(te(o)){if(1<o.length)throw Error(a(93));o=o[0]}s=o}s==null&&(s=""),i=s}s=Tt(i),t.defaultValue=s,o=t.textContent,o===s&&o!==""&&o!==null&&(t.value=o),aa(t)}function He(t,i){if(i){var s=t.firstChild;if(s&&s===t.lastChild&&s.nodeType===3){s.nodeValue=i;return}}t.textContent=i}var Yl=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function sn(t,i,s){var o=i.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?o?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="":o?t.setProperty(i,s):typeof s!="number"||s===0||Yl.has(i)?i==="float"?t.cssFloat=s:t[i]=(""+s).trim():t[i]=s+"px"}function pt(t,i,s){if(i!=null&&typeof i!="object")throw Error(a(62));if(t=t.style,s!=null){for(var o in s)!s.hasOwnProperty(o)||i!=null&&i.hasOwnProperty(o)||(o.indexOf("--")===0?t.setProperty(o,""):o==="float"?t.cssFloat="":t[o]="");for(var _ in i)o=i[_],i.hasOwnProperty(_)&&s[_]!==o&&sn(t,_,o)}else for(var w in i)i.hasOwnProperty(w)&&sn(t,w,i[w])}function Pr(t){if(t.indexOf("-")===-1)return!1;switch(t){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 hr=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),vo=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Hr(t){return vo.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function we(){}var Re=null;function We(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var tt=null,jt=null;function gi(t){var i=pe(t);if(i&&(t=i.stateNode)){var s=t[Et]||null;e:switch(t=i.stateNode,i.type){case"input":if(_o(t,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),i=s.name,s.type==="radio"&&i!=null){for(s=t;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+qn(""+i)+'"][type="radio"]'),i=0;i<s.length;i++){var o=s[i];if(o!==t&&o.form===t.form){var _=o[Et]||null;if(!_)throw Error(a(90));_o(o,_.value,_.defaultValue,_.defaultValue,_.checked,_.defaultChecked,_.type,_.name)}}for(i=0;i<s.length;i++)o=s[i],o.form===t.form&&mo(o)}break e;case"textarea":Vl(t,s.value,s.defaultValue);break e;case"select":i=s.value,i!=null&&wn(t,!!s.multiple,i,!1)}}}var bo=!1;function Xl(t,i,s){if(bo)return t(i,s);bo=!0;try{var o=t(i);return o}finally{if(bo=!1,(tt!==null||jt!==null)&&(jc(),tt&&(i=tt,t=jt,jt=tt=null,gi(i),t)))for(i=0;i<t.length;i++)gi(t[i])}}function yo(t,i){var s=t.stateNode;if(s===null)return null;var o=s[Et]||null;if(o===null)return null;s=o[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(t=t.type,o=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!o;break e;default:t=!1}if(t)return null;if(s&&typeof s!="function")throw Error(a(231,i,typeof s));return s}var dr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),mh=!1;if(dr)try{var So={};Object.defineProperty(So,"passive",{get:function(){mh=!0}}),window.addEventListener("test",So,So),window.removeEventListener("test",So,So)}catch{mh=!1}var Ur=null,_h=null,Zl=null;function cm(){if(Zl)return Zl;var t,i=_h,s=i.length,o,_="value"in Ur?Ur.value:Ur.textContent,w=_.length;for(t=0;t<s&&i[t]===_[t];t++);var D=s-t;for(o=1;o<=D&&i[s-o]===_[w-o];o++);return Zl=_.slice(t,1<o?1-o:void 0)}function Jl(t){var i=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&i===13&&(t=13)):t=i,t===10&&(t=13),32<=t||t===13?t:0}function Ql(){return!0}function um(){return!1}function Wn(t){function i(s,o,_,w,D){this._reactName=s,this._targetInst=_,this.type=o,this.nativeEvent=w,this.target=D,this.currentTarget=null;for(var j in t)t.hasOwnProperty(j)&&(s=t[j],this[j]=s?s(w):w[j]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?Ql:um,this.isPropagationStopped=um,this}return g(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Ql)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Ql)},persist:function(){},isPersistent:Ql}),i}var Es={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ec=Wn(Es),wo=g({},Es,{view:0,detail:0}),ox=Wn(wo),vh,bh,Co,tc=g({},wo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Sh,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Co&&(Co&&t.type==="mousemove"?(vh=t.screenX-Co.screenX,bh=t.screenY-Co.screenY):bh=vh=0,Co=t),vh)},movementY:function(t){return"movementY"in t?t.movementY:bh}}),hm=Wn(tc),lx=g({},tc,{dataTransfer:0}),cx=Wn(lx),ux=g({},wo,{relatedTarget:0}),yh=Wn(ux),hx=g({},Es,{animationName:0,elapsedTime:0,pseudoElement:0}),dx=Wn(hx),fx=g({},Es,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),px=Wn(fx),gx=g({},Es,{data:0}),dm=Wn(gx),mx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},_x={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"},vx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function bx(t){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(t):(t=vx[t])?!!i[t]:!1}function Sh(){return bx}var yx=g({},wo,{key:function(t){if(t.key){var i=mx[t.key]||t.key;if(i!=="Unidentified")return i}return t.type==="keypress"?(t=Jl(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?_x[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Sh,charCode:function(t){return t.type==="keypress"?Jl(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Jl(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Sx=Wn(yx),wx=g({},tc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),fm=Wn(wx),Cx=g({},wo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Sh}),xx=Wn(Cx),Ex=g({},Es,{propertyName:0,elapsedTime:0,pseudoElement:0}),Tx=Wn(Ex),Ax=g({},tc,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),kx=Wn(Ax),Rx=g({},Es,{newState:0,oldState:0}),Lx=Wn(Rx),Mx=[9,13,27,32],wh=dr&&"CompositionEvent"in window,xo=null;dr&&"documentMode"in document&&(xo=document.documentMode);var Dx=dr&&"TextEvent"in window&&!xo,pm=dr&&(!wh||xo&&8<xo&&11>=xo),gm=" ",mm=!1;function _m(t,i){switch(t){case"keyup":return Mx.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vm(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ua=!1;function Ox(t,i){switch(t){case"compositionend":return vm(i);case"keypress":return i.which!==32?null:(mm=!0,gm);case"textInput":return t=i.data,t===gm&&mm?null:t;default:return null}}function Nx(t,i){if(ua)return t==="compositionend"||!wh&&_m(t,i)?(t=cm(),Zl=_h=Ur=null,ua=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return pm&&i.locale!=="ko"?null:i.data;default:return null}}var Bx={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 bm(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i==="input"?!!Bx[t.type]:i==="textarea"}function ym(t,i,s,o){tt?jt?jt.push(o):jt=[o]:tt=o,i=qc(i,"onChange"),0<i.length&&(s=new ec("onChange","change",null,s,o),t.push({event:s,listeners:i}))}var Eo=null,To=null;function Ix(t){n0(t,0)}function nc(t){var i=xe(t);if(mo(i))return t}function Sm(t,i){if(t==="change")return i}var wm=!1;if(dr){var Ch;if(dr){var xh="oninput"in document;if(!xh){var Cm=document.createElement("div");Cm.setAttribute("oninput","return;"),xh=typeof Cm.oninput=="function"}Ch=xh}else Ch=!1;wm=Ch&&(!document.documentMode||9<document.documentMode)}function xm(){Eo&&(Eo.detachEvent("onpropertychange",Em),To=Eo=null)}function Em(t){if(t.propertyName==="value"&&nc(To)){var i=[];ym(i,To,t,We(t)),Xl(Ix,i)}}function jx(t,i,s){t==="focusin"?(xm(),Eo=i,To=s,Eo.attachEvent("onpropertychange",Em)):t==="focusout"&&xm()}function $x(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return nc(To)}function zx(t,i){if(t==="click")return nc(i)}function Px(t,i){if(t==="input"||t==="change")return nc(i)}function Hx(t,i){return t===i&&(t!==0||1/t===1/i)||t!==t&&i!==i}var si=typeof Object.is=="function"?Object.is:Hx;function Ao(t,i){if(si(t,i))return!0;if(typeof t!="object"||t===null||typeof i!="object"||i===null)return!1;var s=Object.keys(t),o=Object.keys(i);if(s.length!==o.length)return!1;for(o=0;o<s.length;o++){var _=s[o];if(!bn.call(i,_)||!si(t[_],i[_]))return!1}return!0}function Tm(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Am(t,i){var s=Tm(t);t=0;for(var o;s;){if(s.nodeType===3){if(o=t+s.textContent.length,t<=i&&o>=i)return{node:s,offset:i-t};t=o}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Tm(s)}}function km(t,i){return t&&i?t===i?!0:t&&t.nodeType===3?!1:i&&i.nodeType===3?km(t,i.parentNode):"contains"in t?t.contains(i):t.compareDocumentPosition?!!(t.compareDocumentPosition(i)&16):!1:!1}function Rm(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var i=oa(t.document);i instanceof t.HTMLIFrameElement;){try{var s=typeof i.contentWindow.location.href=="string"}catch{s=!1}if(s)t=i.contentWindow;else break;i=oa(t.document)}return i}function Eh(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i&&(i==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||i==="textarea"||t.contentEditable==="true")}var Ux=dr&&"documentMode"in document&&11>=document.documentMode,ha=null,Th=null,ko=null,Ah=!1;function Lm(t,i,s){var o=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Ah||ha==null||ha!==oa(o)||(o=ha,"selectionStart"in o&&Eh(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),ko&&Ao(ko,o)||(ko=o,o=qc(Th,"onSelect"),0<o.length&&(i=new ec("onSelect","select",null,i,s),t.push({event:i,listeners:o}),i.target=ha)))}function Ts(t,i){var s={};return s[t.toLowerCase()]=i.toLowerCase(),s["Webkit"+t]="webkit"+i,s["Moz"+t]="moz"+i,s}var da={animationend:Ts("Animation","AnimationEnd"),animationiteration:Ts("Animation","AnimationIteration"),animationstart:Ts("Animation","AnimationStart"),transitionrun:Ts("Transition","TransitionRun"),transitionstart:Ts("Transition","TransitionStart"),transitioncancel:Ts("Transition","TransitionCancel"),transitionend:Ts("Transition","TransitionEnd")},kh={},Mm={};dr&&(Mm=document.createElement("div").style,"AnimationEvent"in window||(delete da.animationend.animation,delete da.animationiteration.animation,delete da.animationstart.animation),"TransitionEvent"in window||delete da.transitionend.transition);function As(t){if(kh[t])return kh[t];if(!da[t])return t;var i=da[t],s;for(s in i)if(i.hasOwnProperty(s)&&s in Mm)return kh[t]=i[s];return t}var Dm=As("animationend"),Om=As("animationiteration"),Nm=As("animationstart"),Fx=As("transitionrun"),qx=As("transitionstart"),Wx=As("transitioncancel"),Bm=As("transitionend"),Im=new Map,Rh="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Rh.push("scrollEnd");function Bi(t,i){Im.set(t,i),Ut(i,[t])}var ic=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},mi=[],fa=0,Lh=0;function rc(){for(var t=fa,i=Lh=fa=0;i<t;){var s=mi[i];mi[i++]=null;var o=mi[i];mi[i++]=null;var _=mi[i];mi[i++]=null;var w=mi[i];if(mi[i++]=null,o!==null&&_!==null){var D=o.pending;D===null?_.next=_:(_.next=D.next,D.next=_),o.pending=_}w!==0&&jm(s,_,w)}}function sc(t,i,s,o){mi[fa++]=t,mi[fa++]=i,mi[fa++]=s,mi[fa++]=o,Lh|=o,t.lanes|=o,t=t.alternate,t!==null&&(t.lanes|=o)}function Mh(t,i,s,o){return sc(t,i,s,o),ac(t)}function ks(t,i){return sc(t,null,null,i),ac(t)}function jm(t,i,s){t.lanes|=s;var o=t.alternate;o!==null&&(o.lanes|=s);for(var _=!1,w=t.return;w!==null;)w.childLanes|=s,o=w.alternate,o!==null&&(o.childLanes|=s),w.tag===22&&(t=w.stateNode,t===null||t._visibility&1||(_=!0)),t=w,w=w.return;return t.tag===3?(w=t.stateNode,_&&i!==null&&(_=31-Pt(s),t=w.hiddenUpdates,o=t[_],o===null?t[_]=[i]:o.push(i),i.lane=s|536870912),w):null}function ac(t){if(50<Xo)throw Xo=0,Pd=null,Error(a(185));for(var i=t.return;i!==null;)t=i,i=t.return;return t.tag===3?t.stateNode:null}var pa={};function Gx(t,i,s,o){this.tag=t,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ai(t,i,s,o){return new Gx(t,i,s,o)}function Dh(t){return t=t.prototype,!(!t||!t.isReactComponent)}function fr(t,i){var s=t.alternate;return s===null?(s=ai(t.tag,i,t.key,t.mode),s.elementType=t.elementType,s.type=t.type,s.stateNode=t.stateNode,s.alternate=t,t.alternate=s):(s.pendingProps=i,s.type=t.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=t.flags&65011712,s.childLanes=t.childLanes,s.lanes=t.lanes,s.child=t.child,s.memoizedProps=t.memoizedProps,s.memoizedState=t.memoizedState,s.updateQueue=t.updateQueue,i=t.dependencies,s.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},s.sibling=t.sibling,s.index=t.index,s.ref=t.ref,s.refCleanup=t.refCleanup,s}function $m(t,i){t.flags&=65011714;var s=t.alternate;return s===null?(t.childLanes=0,t.lanes=i,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=s.childLanes,t.lanes=s.lanes,t.child=s.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=s.memoizedProps,t.memoizedState=s.memoizedState,t.updateQueue=s.updateQueue,t.type=s.type,i=s.dependencies,t.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),t}function oc(t,i,s,o,_,w){var D=0;if(o=t,typeof t=="function")Dh(t)&&(D=1);else if(typeof t=="string")D=Z2(t,s,ae.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case O:return t=ai(31,s,i,_),t.elementType=O,t.lanes=w,t;case x:return Rs(s.children,_,w,i);case d:D=8,_|=24;break;case v:return t=ai(12,s,i,_|2),t.elementType=v,t.lanes=w,t;case L:return t=ai(13,s,i,_),t.elementType=L,t.lanes=w,t;case R:return t=ai(19,s,i,_),t.elementType=R,t.lanes=w,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case b:D=10;break e;case f:D=9;break e;case E:D=11;break e;case M:D=14;break e;case k:D=16,o=null;break e}D=29,s=Error(a(130,t===null?"null":typeof t,"")),o=null}return i=ai(D,s,i,_),i.elementType=t,i.type=o,i.lanes=w,i}function Rs(t,i,s,o){return t=ai(7,t,o,i),t.lanes=s,t}function Oh(t,i,s){return t=ai(6,t,null,i),t.lanes=s,t}function zm(t){var i=ai(18,null,null,0);return i.stateNode=t,i}function Nh(t,i,s){return i=ai(4,t.children!==null?t.children:[],t.key,i),i.lanes=s,i.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},i}var Pm=new WeakMap;function _i(t,i){if(typeof t=="object"&&t!==null){var s=Pm.get(t);return s!==void 0?s:(i={value:t,source:i,stack:en(i)},Pm.set(t,i),i)}return{value:t,source:i,stack:en(i)}}var ga=[],ma=0,lc=null,Ro=0,vi=[],bi=0,Fr=null,Ki=1,Vi="";function pr(t,i){ga[ma++]=Ro,ga[ma++]=lc,lc=t,Ro=i}function Hm(t,i,s){vi[bi++]=Ki,vi[bi++]=Vi,vi[bi++]=Fr,Fr=t;var o=Ki;t=Vi;var _=32-Pt(o)-1;o&=~(1<<_),s+=1;var w=32-Pt(i)+_;if(30<w){var D=_-_%5;w=(o&(1<<D)-1).toString(32),o>>=D,_-=D,Ki=1<<32-Pt(i)+_|s<<_|o,Vi=w+t}else Ki=1<<w|s<<_|o,Vi=t}function Bh(t){t.return!==null&&(pr(t,1),Hm(t,1,0))}function Ih(t){for(;t===lc;)lc=ga[--ma],ga[ma]=null,Ro=ga[--ma],ga[ma]=null;for(;t===Fr;)Fr=vi[--bi],vi[bi]=null,Vi=vi[--bi],vi[bi]=null,Ki=vi[--bi],vi[bi]=null}function Um(t,i){vi[bi++]=Ki,vi[bi++]=Vi,vi[bi++]=Fr,Ki=i.id,Vi=i.overflow,Fr=t}var Cn=null,Rt=null,st=!1,qr=null,yi=!1,jh=Error(a(519));function Wr(t){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Lo(_i(i,t)),jh}function Fm(t){var i=t.stateNode,s=t.type,o=t.memoizedProps;switch(i[At]=t,i[Et]=o,s){case"dialog":Qe("cancel",i),Qe("close",i);break;case"iframe":case"object":case"embed":Qe("load",i);break;case"video":case"audio":for(s=0;s<Jo.length;s++)Qe(Jo[s],i);break;case"source":Qe("error",i);break;case"img":case"image":case"link":Qe("error",i),Qe("load",i);break;case"details":Qe("toggle",i);break;case"input":Qe("invalid",i),xs(i,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":Qe("invalid",i);break;case"textarea":Qe("invalid",i),ca(i,o.value,o.defaultValue,o.children)}s=o.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||i.textContent===""+s||o.suppressHydrationWarning===!0||a0(i.textContent,s)?(o.popover!=null&&(Qe("beforetoggle",i),Qe("toggle",i)),o.onScroll!=null&&Qe("scroll",i),o.onScrollEnd!=null&&Qe("scrollend",i),o.onClick!=null&&(i.onclick=we),i=!0):i=!1,i||Wr(t,!0)}function qm(t){for(Cn=t.return;Cn;)switch(Cn.tag){case 5:case 31:case 13:yi=!1;return;case 27:case 3:yi=!0;return;default:Cn=Cn.return}}function _a(t){if(t!==Cn)return!1;if(!st)return qm(t),st=!0,!1;var i=t.tag,s;if((s=i!==3&&i!==27)&&((s=i===5)&&(s=t.type,s=!(s!=="form"&&s!=="button")||tf(t.type,t.memoizedProps)),s=!s),s&&Rt&&Wr(t),qm(t),i===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));Rt=g0(t)}else if(i===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));Rt=g0(t)}else i===27?(i=Rt,ss(t.type)?(t=of,of=null,Rt=t):Rt=i):Rt=Cn?wi(t.stateNode.nextSibling):null;return!0}function Ls(){Rt=Cn=null,st=!1}function $h(){var t=qr;return t!==null&&(Yn===null?Yn=t:Yn.push.apply(Yn,t),qr=null),t}function Lo(t){qr===null?qr=[t]:qr.push(t)}var zh=N(null),Ms=null,gr=null;function Gr(t,i,s){Z(zh,i._currentValue),i._currentValue=s}function mr(t){t._currentValue=zh.current,P(zh)}function Ph(t,i,s){for(;t!==null;){var o=t.alternate;if((t.childLanes&i)!==i?(t.childLanes|=i,o!==null&&(o.childLanes|=i)):o!==null&&(o.childLanes&i)!==i&&(o.childLanes|=i),t===s)break;t=t.return}}function Hh(t,i,s,o){var _=t.child;for(_!==null&&(_.return=t);_!==null;){var w=_.dependencies;if(w!==null){var D=_.child;w=w.firstContext;e:for(;w!==null;){var j=w;w=_;for(var X=0;X<i.length;X++)if(j.context===i[X]){w.lanes|=s,j=w.alternate,j!==null&&(j.lanes|=s),Ph(w.return,s,t),o||(D=null);break e}w=j.next}}else if(_.tag===18){if(D=_.return,D===null)throw Error(a(341));D.lanes|=s,w=D.alternate,w!==null&&(w.lanes|=s),Ph(D,s,t),D=null}else D=_.child;if(D!==null)D.return=_;else for(D=_;D!==null;){if(D===t){D=null;break}if(_=D.sibling,_!==null){_.return=D.return,D=_;break}D=D.return}_=D}}function va(t,i,s,o){t=null;for(var _=i,w=!1;_!==null;){if(!w){if((_.flags&524288)!==0)w=!0;else if((_.flags&262144)!==0)break}if(_.tag===10){var D=_.alternate;if(D===null)throw Error(a(387));if(D=D.memoizedProps,D!==null){var j=_.type;si(_.pendingProps.value,D.value)||(t!==null?t.push(j):t=[j])}}else if(_===Q.current){if(D=_.alternate,D===null)throw Error(a(387));D.memoizedState.memoizedState!==_.memoizedState.memoizedState&&(t!==null?t.push(il):t=[il])}_=_.return}t!==null&&Hh(i,t,s,o),i.flags|=262144}function cc(t){for(t=t.firstContext;t!==null;){if(!si(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Ds(t){Ms=t,gr=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function xn(t){return Wm(Ms,t)}function uc(t,i){return Ms===null&&Ds(t),Wm(t,i)}function Wm(t,i){var s=i._currentValue;if(i={context:i,memoizedValue:s,next:null},gr===null){if(t===null)throw Error(a(308));gr=i,t.dependencies={lanes:0,firstContext:i},t.flags|=524288}else gr=gr.next=i;return s}var Kx=typeof AbortController<"u"?AbortController:function(){var t=[],i=this.signal={aborted:!1,addEventListener:function(s,o){t.push(o)}};this.abort=function(){i.aborted=!0,t.forEach(function(s){return s()})}},Vx=e.unstable_scheduleCallback,Yx=e.unstable_NormalPriority,an={$$typeof:b,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Uh(){return{controller:new Kx,data:new Map,refCount:0}}function Mo(t){t.refCount--,t.refCount===0&&Vx(Yx,function(){t.controller.abort()})}var Do=null,Fh=0,ba=0,ya=null;function Xx(t,i){if(Do===null){var s=Do=[];Fh=0,ba=Gd(),ya={status:"pending",value:void 0,then:function(o){s.push(o)}}}return Fh++,i.then(Gm,Gm),i}function Gm(){if(--Fh===0&&Do!==null){ya!==null&&(ya.status="fulfilled");var t=Do;Do=null,ba=0,ya=null;for(var i=0;i<t.length;i++)(0,t[i])()}}function Zx(t,i){var s=[],o={status:"pending",value:null,reason:null,then:function(_){s.push(_)}};return t.then(function(){o.status="fulfilled",o.value=i;for(var _=0;_<s.length;_++)(0,s[_])(i)},function(_){for(o.status="rejected",o.reason=_,_=0;_<s.length;_++)(0,s[_])(void 0)}),o}var Km=q.S;q.S=function(t,i){Lv=ut(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&Xx(t,i),Km!==null&&Km(t,i)};var Os=N(null);function qh(){var t=Os.current;return t!==null?t:Ct.pooledCache}function hc(t,i){i===null?Z(Os,Os.current):Z(Os,i.pool)}function Vm(){var t=qh();return t===null?null:{parent:an._currentValue,pool:t}}var Sa=Error(a(460)),Wh=Error(a(474)),dc=Error(a(542)),fc={then:function(){}};function Ym(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Xm(t,i,s){switch(s=t[s],s===void 0?t.push(i):s!==i&&(i.then(we,we),i=s),i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,Jm(t),t;default:if(typeof i.status=="string")i.then(we,we);else{if(t=Ct,t!==null&&100<t.shellSuspendCounter)throw Error(a(482));t=i,t.status="pending",t.then(function(o){if(i.status==="pending"){var _=i;_.status="fulfilled",_.value=o}},function(o){if(i.status==="pending"){var _=i;_.status="rejected",_.reason=o}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,Jm(t),t}throw Bs=i,Sa}}function Ns(t){try{var i=t._init;return i(t._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Bs=s,Sa):s}}var Bs=null;function Zm(){if(Bs===null)throw Error(a(459));var t=Bs;return Bs=null,t}function Jm(t){if(t===Sa||t===dc)throw Error(a(483))}var wa=null,Oo=0;function pc(t){var i=Oo;return Oo+=1,wa===null&&(wa=[]),Xm(wa,t,i)}function No(t,i){i=i.props.ref,t.ref=i!==void 0?i:null}function gc(t,i){throw i.$$typeof===C?Error(a(525)):(t=Object.prototype.toString.call(i),Error(a(31,t==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":t)))}function Qm(t){function i(ne,ee){if(t){var ie=ne.deletions;ie===null?(ne.deletions=[ee],ne.flags|=16):ie.push(ee)}}function s(ne,ee){if(!t)return null;for(;ee!==null;)i(ne,ee),ee=ee.sibling;return null}function o(ne){for(var ee=new Map;ne!==null;)ne.key!==null?ee.set(ne.key,ne):ee.set(ne.index,ne),ne=ne.sibling;return ee}function _(ne,ee){return ne=fr(ne,ee),ne.index=0,ne.sibling=null,ne}function w(ne,ee,ie){return ne.index=ie,t?(ie=ne.alternate,ie!==null?(ie=ie.index,ie<ee?(ne.flags|=67108866,ee):ie):(ne.flags|=67108866,ee)):(ne.flags|=1048576,ee)}function D(ne){return t&&ne.alternate===null&&(ne.flags|=67108866),ne}function j(ne,ee,ie,de){return ee===null||ee.tag!==6?(ee=Oh(ie,ne.mode,de),ee.return=ne,ee):(ee=_(ee,ie),ee.return=ne,ee)}function X(ne,ee,ie,de){var Be=ie.type;return Be===x?ue(ne,ee,ie.props.children,de,ie.key):ee!==null&&(ee.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===k&&Ns(Be)===ee.type)?(ee=_(ee,ie.props),No(ee,ie),ee.return=ne,ee):(ee=oc(ie.type,ie.key,ie.props,null,ne.mode,de),No(ee,ie),ee.return=ne,ee)}function re(ne,ee,ie,de){return ee===null||ee.tag!==4||ee.stateNode.containerInfo!==ie.containerInfo||ee.stateNode.implementation!==ie.implementation?(ee=Nh(ie,ne.mode,de),ee.return=ne,ee):(ee=_(ee,ie.children||[]),ee.return=ne,ee)}function ue(ne,ee,ie,de,Be){return ee===null||ee.tag!==7?(ee=Rs(ie,ne.mode,de,Be),ee.return=ne,ee):(ee=_(ee,ie),ee.return=ne,ee)}function fe(ne,ee,ie){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return ee=Oh(""+ee,ne.mode,ie),ee.return=ne,ee;if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case T:return ie=oc(ee.type,ee.key,ee.props,null,ne.mode,ie),No(ie,ee),ie.return=ne,ie;case A:return ee=Nh(ee,ne.mode,ie),ee.return=ne,ee;case k:return ee=Ns(ee),fe(ne,ee,ie)}if(te(ee)||G(ee))return ee=Rs(ee,ne.mode,ie,null),ee.return=ne,ee;if(typeof ee.then=="function")return fe(ne,pc(ee),ie);if(ee.$$typeof===b)return fe(ne,uc(ne,ee),ie);gc(ne,ee)}return null}function se(ne,ee,ie,de){var Be=ee!==null?ee.key:null;if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return Be!==null?null:j(ne,ee,""+ie,de);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case T:return ie.key===Be?X(ne,ee,ie,de):null;case A:return ie.key===Be?re(ne,ee,ie,de):null;case k:return ie=Ns(ie),se(ne,ee,ie,de)}if(te(ie)||G(ie))return Be!==null?null:ue(ne,ee,ie,de,null);if(typeof ie.then=="function")return se(ne,ee,pc(ie),de);if(ie.$$typeof===b)return se(ne,ee,uc(ne,ie),de);gc(ne,ie)}return null}function le(ne,ee,ie,de,Be){if(typeof de=="string"&&de!==""||typeof de=="number"||typeof de=="bigint")return ne=ne.get(ie)||null,j(ee,ne,""+de,Be);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case T:return ne=ne.get(de.key===null?ie:de.key)||null,X(ee,ne,de,Be);case A:return ne=ne.get(de.key===null?ie:de.key)||null,re(ee,ne,de,Be);case k:return de=Ns(de),le(ne,ee,ie,de,Be)}if(te(de)||G(de))return ne=ne.get(ie)||null,ue(ee,ne,de,Be,null);if(typeof de.then=="function")return le(ne,ee,ie,pc(de),Be);if(de.$$typeof===b)return le(ne,ee,ie,uc(ee,de),Be);gc(ee,de)}return null}function Ae(ne,ee,ie,de){for(var Be=null,ot=null,Le=ee,Ke=ee=0,it=null;Le!==null&&Ke<ie.length;Ke++){Le.index>Ke?(it=Le,Le=null):it=Le.sibling;var lt=se(ne,Le,ie[Ke],de);if(lt===null){Le===null&&(Le=it);break}t&&Le&&lt.alternate===null&&i(ne,Le),ee=w(lt,ee,Ke),ot===null?Be=lt:ot.sibling=lt,ot=lt,Le=it}if(Ke===ie.length)return s(ne,Le),st&&pr(ne,Ke),Be;if(Le===null){for(;Ke<ie.length;Ke++)Le=fe(ne,ie[Ke],de),Le!==null&&(ee=w(Le,ee,Ke),ot===null?Be=Le:ot.sibling=Le,ot=Le);return st&&pr(ne,Ke),Be}for(Le=o(Le);Ke<ie.length;Ke++)it=le(Le,ne,Ke,ie[Ke],de),it!==null&&(t&&it.alternate!==null&&Le.delete(it.key===null?Ke:it.key),ee=w(it,ee,Ke),ot===null?Be=it:ot.sibling=it,ot=it);return t&&Le.forEach(function(us){return i(ne,us)}),st&&pr(ne,Ke),Be}function $e(ne,ee,ie,de){if(ie==null)throw Error(a(151));for(var Be=null,ot=null,Le=ee,Ke=ee=0,it=null,lt=ie.next();Le!==null&&!lt.done;Ke++,lt=ie.next()){Le.index>Ke?(it=Le,Le=null):it=Le.sibling;var us=se(ne,Le,lt.value,de);if(us===null){Le===null&&(Le=it);break}t&&Le&&us.alternate===null&&i(ne,Le),ee=w(us,ee,Ke),ot===null?Be=us:ot.sibling=us,ot=us,Le=it}if(lt.done)return s(ne,Le),st&&pr(ne,Ke),Be;if(Le===null){for(;!lt.done;Ke++,lt=ie.next())lt=fe(ne,lt.value,de),lt!==null&&(ee=w(lt,ee,Ke),ot===null?Be=lt:ot.sibling=lt,ot=lt);return st&&pr(ne,Ke),Be}for(Le=o(Le);!lt.done;Ke++,lt=ie.next())lt=le(Le,ne,Ke,lt.value,de),lt!==null&&(t&&lt.alternate!==null&&Le.delete(lt.key===null?Ke:lt.key),ee=w(lt,ee,Ke),ot===null?Be=lt:ot.sibling=lt,ot=lt);return t&&Le.forEach(function(lE){return i(ne,lE)}),st&&pr(ne,Ke),Be}function yt(ne,ee,ie,de){if(typeof ie=="object"&&ie!==null&&ie.type===x&&ie.key===null&&(ie=ie.props.children),typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case T:e:{for(var Be=ie.key;ee!==null;){if(ee.key===Be){if(Be=ie.type,Be===x){if(ee.tag===7){s(ne,ee.sibling),de=_(ee,ie.props.children),de.return=ne,ne=de;break e}}else if(ee.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===k&&Ns(Be)===ee.type){s(ne,ee.sibling),de=_(ee,ie.props),No(de,ie),de.return=ne,ne=de;break e}s(ne,ee);break}else i(ne,ee);ee=ee.sibling}ie.type===x?(de=Rs(ie.props.children,ne.mode,de,ie.key),de.return=ne,ne=de):(de=oc(ie.type,ie.key,ie.props,null,ne.mode,de),No(de,ie),de.return=ne,ne=de)}return D(ne);case A:e:{for(Be=ie.key;ee!==null;){if(ee.key===Be)if(ee.tag===4&&ee.stateNode.containerInfo===ie.containerInfo&&ee.stateNode.implementation===ie.implementation){s(ne,ee.sibling),de=_(ee,ie.children||[]),de.return=ne,ne=de;break e}else{s(ne,ee);break}else i(ne,ee);ee=ee.sibling}de=Nh(ie,ne.mode,de),de.return=ne,ne=de}return D(ne);case k:return ie=Ns(ie),yt(ne,ee,ie,de)}if(te(ie))return Ae(ne,ee,ie,de);if(G(ie)){if(Be=G(ie),typeof Be!="function")throw Error(a(150));return ie=Be.call(ie),$e(ne,ee,ie,de)}if(typeof ie.then=="function")return yt(ne,ee,pc(ie),de);if(ie.$$typeof===b)return yt(ne,ee,uc(ne,ie),de);gc(ne,ie)}return typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint"?(ie=""+ie,ee!==null&&ee.tag===6?(s(ne,ee.sibling),de=_(ee,ie),de.return=ne,ne=de):(s(ne,ee),de=Oh(ie,ne.mode,de),de.return=ne,ne=de),D(ne)):s(ne,ee)}return function(ne,ee,ie,de){try{Oo=0;var Be=yt(ne,ee,ie,de);return wa=null,Be}catch(Le){if(Le===Sa||Le===dc)throw Le;var ot=ai(29,Le,null,ne.mode);return ot.lanes=de,ot.return=ne,ot}}}var Is=Qm(!0),e_=Qm(!1),Kr=!1;function Gh(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Kh(t,i){t=t.updateQueue,i.updateQueue===t&&(i.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Vr(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Yr(t,i,s){var o=t.updateQueue;if(o===null)return null;if(o=o.shared,(ht&2)!==0){var _=o.pending;return _===null?i.next=i:(i.next=_.next,_.next=i),o.pending=i,i=ac(t),jm(t,null,s),i}return sc(t,o,i,s),ac(t)}function Bo(t,i,s){if(i=i.updateQueue,i!==null&&(i=i.shared,(s&4194048)!==0)){var o=i.lanes;o&=t.pendingLanes,s|=o,i.lanes=s,je(t,s)}}function Vh(t,i){var s=t.updateQueue,o=t.alternate;if(o!==null&&(o=o.updateQueue,s===o)){var _=null,w=null;if(s=s.firstBaseUpdate,s!==null){do{var D={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};w===null?_=w=D:w=w.next=D,s=s.next}while(s!==null);w===null?_=w=i:w=w.next=i}else _=w=i;s={baseState:o.baseState,firstBaseUpdate:_,lastBaseUpdate:w,shared:o.shared,callbacks:o.callbacks},t.updateQueue=s;return}t=s.lastBaseUpdate,t===null?s.firstBaseUpdate=i:t.next=i,s.lastBaseUpdate=i}var Yh=!1;function Io(){if(Yh){var t=ya;if(t!==null)throw t}}function jo(t,i,s,o){Yh=!1;var _=t.updateQueue;Kr=!1;var w=_.firstBaseUpdate,D=_.lastBaseUpdate,j=_.shared.pending;if(j!==null){_.shared.pending=null;var X=j,re=X.next;X.next=null,D===null?w=re:D.next=re,D=X;var ue=t.alternate;ue!==null&&(ue=ue.updateQueue,j=ue.lastBaseUpdate,j!==D&&(j===null?ue.firstBaseUpdate=re:j.next=re,ue.lastBaseUpdate=X))}if(w!==null){var fe=_.baseState;D=0,ue=re=X=null,j=w;do{var se=j.lane&-536870913,le=se!==j.lane;if(le?(nt&se)===se:(o&se)===se){se!==0&&se===ba&&(Yh=!0),ue!==null&&(ue=ue.next={lane:0,tag:j.tag,payload:j.payload,callback:null,next:null});e:{var Ae=t,$e=j;se=i;var yt=s;switch($e.tag){case 1:if(Ae=$e.payload,typeof Ae=="function"){fe=Ae.call(yt,fe,se);break e}fe=Ae;break e;case 3:Ae.flags=Ae.flags&-65537|128;case 0:if(Ae=$e.payload,se=typeof Ae=="function"?Ae.call(yt,fe,se):Ae,se==null)break e;fe=g({},fe,se);break e;case 2:Kr=!0}}se=j.callback,se!==null&&(t.flags|=64,le&&(t.flags|=8192),le=_.callbacks,le===null?_.callbacks=[se]:le.push(se))}else le={lane:se,tag:j.tag,payload:j.payload,callback:j.callback,next:null},ue===null?(re=ue=le,X=fe):ue=ue.next=le,D|=se;if(j=j.next,j===null){if(j=_.shared.pending,j===null)break;le=j,j=le.next,le.next=null,_.lastBaseUpdate=le,_.shared.pending=null}}while(!0);ue===null&&(X=fe),_.baseState=X,_.firstBaseUpdate=re,_.lastBaseUpdate=ue,w===null&&(_.shared.lanes=0),es|=D,t.lanes=D,t.memoizedState=fe}}function t_(t,i){if(typeof t!="function")throw Error(a(191,t));t.call(i)}function n_(t,i){var s=t.callbacks;if(s!==null)for(t.callbacks=null,t=0;t<s.length;t++)t_(s[t],i)}var Ca=N(null),mc=N(0);function i_(t,i){t=Er,Z(mc,t),Z(Ca,i),Er=t|i.baseLanes}function Xh(){Z(mc,Er),Z(Ca,Ca.current)}function Zh(){Er=mc.current,P(Ca),P(mc)}var oi=N(null),Si=null;function Xr(t){var i=t.alternate;Z(Zt,Zt.current&1),Z(oi,t),Si===null&&(i===null||Ca.current!==null||i.memoizedState!==null)&&(Si=t)}function Jh(t){Z(Zt,Zt.current),Z(oi,t),Si===null&&(Si=t)}function r_(t){t.tag===22?(Z(Zt,Zt.current),Z(oi,t),Si===null&&(Si=t)):Zr()}function Zr(){Z(Zt,Zt.current),Z(oi,oi.current)}function li(t){P(oi),Si===t&&(Si=null),P(Zt)}var Zt=N(0);function _c(t){for(var i=t;i!==null;){if(i.tag===13){var s=i.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||sf(s)||af(s)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var _r=0,Ge=null,vt=null,on=null,vc=!1,xa=!1,js=!1,bc=0,$o=0,Ea=null,Jx=0;function Ft(){throw Error(a(321))}function Qh(t,i){if(i===null)return!1;for(var s=0;s<i.length&&s<t.length;s++)if(!si(t[s],i[s]))return!1;return!0}function ed(t,i,s,o,_,w){return _r=w,Ge=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,q.H=t===null||t.memoizedState===null?H_:gd,js=!1,w=s(o,_),js=!1,xa&&(w=a_(i,s,o,_)),s_(t),w}function s_(t){q.H=Ho;var i=vt!==null&&vt.next!==null;if(_r=0,on=vt=Ge=null,vc=!1,$o=0,Ea=null,i)throw Error(a(300));t===null||ln||(t=t.dependencies,t!==null&&cc(t)&&(ln=!0))}function a_(t,i,s,o){Ge=t;var _=0;do{if(xa&&(Ea=null),$o=0,xa=!1,25<=_)throw Error(a(301));if(_+=1,on=vt=null,t.updateQueue!=null){var w=t.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}q.H=U_,w=i(s,o)}while(xa);return w}function Qx(){var t=q.H,i=t.useState()[0];return i=typeof i.then=="function"?zo(i):i,t=t.useState()[0],(vt!==null?vt.memoizedState:null)!==t&&(Ge.flags|=1024),i}function td(){var t=bc!==0;return bc=0,t}function nd(t,i,s){i.updateQueue=t.updateQueue,i.flags&=-2053,t.lanes&=~s}function id(t){if(vc){for(t=t.memoizedState;t!==null;){var i=t.queue;i!==null&&(i.pending=null),t=t.next}vc=!1}_r=0,on=vt=Ge=null,xa=!1,$o=bc=0,Ea=null}function Bn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return on===null?Ge.memoizedState=on=t:on=on.next=t,on}function Jt(){if(vt===null){var t=Ge.alternate;t=t!==null?t.memoizedState:null}else t=vt.next;var i=on===null?Ge.memoizedState:on.next;if(i!==null)on=i,vt=t;else{if(t===null)throw Ge.alternate===null?Error(a(467)):Error(a(310));vt=t,t={memoizedState:vt.memoizedState,baseState:vt.baseState,baseQueue:vt.baseQueue,queue:vt.queue,next:null},on===null?Ge.memoizedState=on=t:on=on.next=t}return on}function yc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function zo(t){var i=$o;return $o+=1,Ea===null&&(Ea=[]),t=Xm(Ea,t,i),i=Ge,(on===null?i.memoizedState:on.next)===null&&(i=i.alternate,q.H=i===null||i.memoizedState===null?H_:gd),t}function Sc(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return zo(t);if(t.$$typeof===b)return xn(t)}throw Error(a(438,String(t)))}function rd(t){var i=null,s=Ge.updateQueue;if(s!==null&&(i=s.memoCache),i==null){var o=Ge.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(i={data:o.data.map(function(_){return _.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),s===null&&(s=yc(),Ge.updateQueue=s),s.memoCache=i,s=i.data[i.index],s===void 0)for(s=i.data[i.index]=Array(t),o=0;o<t;o++)s[o]=U;return i.index++,s}function vr(t,i){return typeof i=="function"?i(t):i}function wc(t){var i=Jt();return sd(i,vt,t)}function sd(t,i,s){var o=t.queue;if(o===null)throw Error(a(311));o.lastRenderedReducer=s;var _=t.baseQueue,w=o.pending;if(w!==null){if(_!==null){var D=_.next;_.next=w.next,w.next=D}i.baseQueue=_=w,o.pending=null}if(w=t.baseState,_===null)t.memoizedState=w;else{i=_.next;var j=D=null,X=null,re=i,ue=!1;do{var fe=re.lane&-536870913;if(fe!==re.lane?(nt&fe)===fe:(_r&fe)===fe){var se=re.revertLane;if(se===0)X!==null&&(X=X.next={lane:0,revertLane:0,gesture:null,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null}),fe===ba&&(ue=!0);else if((_r&se)===se){re=re.next,se===ba&&(ue=!0);continue}else fe={lane:0,revertLane:re.revertLane,gesture:null,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},X===null?(j=X=fe,D=w):X=X.next=fe,Ge.lanes|=se,es|=se;fe=re.action,js&&s(w,fe),w=re.hasEagerState?re.eagerState:s(w,fe)}else se={lane:fe,revertLane:re.revertLane,gesture:re.gesture,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},X===null?(j=X=se,D=w):X=X.next=se,Ge.lanes|=fe,es|=fe;re=re.next}while(re!==null&&re!==i);if(X===null?D=w:X.next=j,!si(w,t.memoizedState)&&(ln=!0,ue&&(s=ya,s!==null)))throw s;t.memoizedState=w,t.baseState=D,t.baseQueue=X,o.lastRenderedState=w}return _===null&&(o.lanes=0),[t.memoizedState,o.dispatch]}function ad(t){var i=Jt(),s=i.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=t;var o=s.dispatch,_=s.pending,w=i.memoizedState;if(_!==null){s.pending=null;var D=_=_.next;do w=t(w,D.action),D=D.next;while(D!==_);si(w,i.memoizedState)||(ln=!0),i.memoizedState=w,i.baseQueue===null&&(i.baseState=w),s.lastRenderedState=w}return[w,o]}function o_(t,i,s){var o=Ge,_=Jt(),w=st;if(w){if(s===void 0)throw Error(a(407));s=s()}else s=i();var D=!si((vt||_).memoizedState,s);if(D&&(_.memoizedState=s,ln=!0),_=_.queue,cd(u_.bind(null,o,_,t),[t]),_.getSnapshot!==i||D||on!==null&&on.memoizedState.tag&1){if(o.flags|=2048,Ta(9,{destroy:void 0},c_.bind(null,o,_,s,i),null),Ct===null)throw Error(a(349));w||(_r&127)!==0||l_(o,i,s)}return s}function l_(t,i,s){t.flags|=16384,t={getSnapshot:i,value:s},i=Ge.updateQueue,i===null?(i=yc(),Ge.updateQueue=i,i.stores=[t]):(s=i.stores,s===null?i.stores=[t]:s.push(t))}function c_(t,i,s,o){i.value=s,i.getSnapshot=o,h_(i)&&d_(t)}function u_(t,i,s){return s(function(){h_(i)&&d_(t)})}function h_(t){var i=t.getSnapshot;t=t.value;try{var s=i();return!si(t,s)}catch{return!0}}function d_(t){var i=ks(t,2);i!==null&&Xn(i,t,2)}function od(t){var i=Bn();if(typeof t=="function"){var s=t;if(t=s(),js){Xt(!0);try{s()}finally{Xt(!1)}}}return i.memoizedState=i.baseState=t,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vr,lastRenderedState:t},i}function f_(t,i,s,o){return t.baseState=s,sd(t,vt,typeof o=="function"?o:vr)}function e2(t,i,s,o,_){if(Ec(t))throw Error(a(485));if(t=i.action,t!==null){var w={payload:_,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(D){w.listeners.push(D)}};q.T!==null?s(!0):w.isTransition=!1,o(w),s=i.pending,s===null?(w.next=i.pending=w,p_(i,w)):(w.next=s.next,i.pending=s.next=w)}}function p_(t,i){var s=i.action,o=i.payload,_=t.state;if(i.isTransition){var w=q.T,D={};q.T=D;try{var j=s(_,o),X=q.S;X!==null&&X(D,j),g_(t,i,j)}catch(re){ld(t,i,re)}finally{w!==null&&D.types!==null&&(w.types=D.types),q.T=w}}else try{w=s(_,o),g_(t,i,w)}catch(re){ld(t,i,re)}}function g_(t,i,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(o){m_(t,i,o)},function(o){return ld(t,i,o)}):m_(t,i,s)}function m_(t,i,s){i.status="fulfilled",i.value=s,__(i),t.state=s,i=t.pending,i!==null&&(s=i.next,s===i?t.pending=null:(s=s.next,i.next=s,p_(t,s)))}function ld(t,i,s){var o=t.pending;if(t.pending=null,o!==null){o=o.next;do i.status="rejected",i.reason=s,__(i),i=i.next;while(i!==o)}t.action=null}function __(t){t=t.listeners;for(var i=0;i<t.length;i++)(0,t[i])()}function v_(t,i){return i}function b_(t,i){if(st){var s=Ct.formState;if(s!==null){e:{var o=Ge;if(st){if(Rt){t:{for(var _=Rt,w=yi;_.nodeType!==8;){if(!w){_=null;break t}if(_=wi(_.nextSibling),_===null){_=null;break t}}w=_.data,_=w==="F!"||w==="F"?_:null}if(_){Rt=wi(_.nextSibling),o=_.data==="F!";break e}}Wr(o)}o=!1}o&&(i=s[0])}}return s=Bn(),s.memoizedState=s.baseState=i,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:v_,lastRenderedState:i},s.queue=o,s=$_.bind(null,Ge,o),o.dispatch=s,o=od(!1),w=pd.bind(null,Ge,!1,o.queue),o=Bn(),_={state:i,dispatch:null,action:t,pending:null},o.queue=_,s=e2.bind(null,Ge,_,w,s),_.dispatch=s,o.memoizedState=t,[i,s,!1]}function y_(t){var i=Jt();return S_(i,vt,t)}function S_(t,i,s){if(i=sd(t,i,v_)[0],t=wc(vr)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var o=zo(i)}catch(D){throw D===Sa?dc:D}else o=i;i=Jt();var _=i.queue,w=_.dispatch;return s!==i.memoizedState&&(Ge.flags|=2048,Ta(9,{destroy:void 0},t2.bind(null,_,s),null)),[o,w,t]}function t2(t,i){t.action=i}function w_(t){var i=Jt(),s=vt;if(s!==null)return S_(i,s,t);Jt(),i=i.memoizedState,s=Jt();var o=s.queue.dispatch;return s.memoizedState=t,[i,o,!1]}function Ta(t,i,s,o){return t={tag:t,create:s,deps:o,inst:i,next:null},i=Ge.updateQueue,i===null&&(i=yc(),Ge.updateQueue=i),s=i.lastEffect,s===null?i.lastEffect=t.next=t:(o=s.next,s.next=t,t.next=o,i.lastEffect=t),t}function C_(){return Jt().memoizedState}function Cc(t,i,s,o){var _=Bn();Ge.flags|=t,_.memoizedState=Ta(1|i,{destroy:void 0},s,o===void 0?null:o)}function xc(t,i,s,o){var _=Jt();o=o===void 0?null:o;var w=_.memoizedState.inst;vt!==null&&o!==null&&Qh(o,vt.memoizedState.deps)?_.memoizedState=Ta(i,w,s,o):(Ge.flags|=t,_.memoizedState=Ta(1|i,w,s,o))}function x_(t,i){Cc(8390656,8,t,i)}function cd(t,i){xc(2048,8,t,i)}function n2(t){Ge.flags|=4;var i=Ge.updateQueue;if(i===null)i=yc(),Ge.updateQueue=i,i.events=[t];else{var s=i.events;s===null?i.events=[t]:s.push(t)}}function E_(t){var i=Jt().memoizedState;return n2({ref:i,nextImpl:t}),function(){if((ht&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function T_(t,i){return xc(4,2,t,i)}function A_(t,i){return xc(4,4,t,i)}function k_(t,i){if(typeof i=="function"){t=t();var s=i(t);return function(){typeof s=="function"?s():i(null)}}if(i!=null)return t=t(),i.current=t,function(){i.current=null}}function R_(t,i,s){s=s!=null?s.concat([t]):null,xc(4,4,k_.bind(null,i,t),s)}function ud(){}function L_(t,i){var s=Jt();i=i===void 0?null:i;var o=s.memoizedState;return i!==null&&Qh(i,o[1])?o[0]:(s.memoizedState=[t,i],t)}function M_(t,i){var s=Jt();i=i===void 0?null:i;var o=s.memoizedState;if(i!==null&&Qh(i,o[1]))return o[0];if(o=t(),js){Xt(!0);try{t()}finally{Xt(!1)}}return s.memoizedState=[o,i],o}function hd(t,i,s){return s===void 0||(_r&1073741824)!==0&&(nt&261930)===0?t.memoizedState=i:(t.memoizedState=s,t=Dv(),Ge.lanes|=t,es|=t,s)}function D_(t,i,s,o){return si(s,i)?s:Ca.current!==null?(t=hd(t,s,o),si(t,i)||(ln=!0),t):(_r&42)===0||(_r&1073741824)!==0&&(nt&261930)===0?(ln=!0,t.memoizedState=s):(t=Dv(),Ge.lanes|=t,es|=t,i)}function O_(t,i,s,o,_){var w=W.p;W.p=w!==0&&8>w?w:8;var D=q.T,j={};q.T=j,pd(t,!1,i,s);try{var X=_(),re=q.S;if(re!==null&&re(j,X),X!==null&&typeof X=="object"&&typeof X.then=="function"){var ue=Zx(X,o);Po(t,i,ue,hi(t))}else Po(t,i,o,hi(t))}catch(fe){Po(t,i,{then:function(){},status:"rejected",reason:fe},hi())}finally{W.p=w,D!==null&&j.types!==null&&(D.types=j.types),q.T=D}}function i2(){}function dd(t,i,s,o){if(t.tag!==5)throw Error(a(476));var _=N_(t).queue;O_(t,_,i,Y,s===null?i2:function(){return B_(t),s(o)})}function N_(t){var i=t.memoizedState;if(i!==null)return i;i={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vr,lastRenderedState:Y},next:null};var s={};return i.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vr,lastRenderedState:s},next:null},t.memoizedState=i,t=t.alternate,t!==null&&(t.memoizedState=i),i}function B_(t){var i=N_(t);i.next===null&&(i=t.alternate.memoizedState),Po(t,i.next.queue,{},hi())}function fd(){return xn(il)}function I_(){return Jt().memoizedState}function j_(){return Jt().memoizedState}function r2(t){for(var i=t.return;i!==null;){switch(i.tag){case 24:case 3:var s=hi();t=Vr(s);var o=Yr(i,t,s);o!==null&&(Xn(o,i,s),Bo(o,i,s)),i={cache:Uh()},t.payload=i;return}i=i.return}}function s2(t,i,s){var o=hi();s={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Ec(t)?z_(i,s):(s=Mh(t,i,s,o),s!==null&&(Xn(s,t,o),P_(s,i,o)))}function $_(t,i,s){var o=hi();Po(t,i,s,o)}function Po(t,i,s,o){var _={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Ec(t))z_(i,_);else{var w=t.alternate;if(t.lanes===0&&(w===null||w.lanes===0)&&(w=i.lastRenderedReducer,w!==null))try{var D=i.lastRenderedState,j=w(D,s);if(_.hasEagerState=!0,_.eagerState=j,si(j,D))return sc(t,i,_,0),Ct===null&&rc(),!1}catch{}if(s=Mh(t,i,_,o),s!==null)return Xn(s,t,o),P_(s,i,o),!0}return!1}function pd(t,i,s,o){if(o={lane:2,revertLane:Gd(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Ec(t)){if(i)throw Error(a(479))}else i=Mh(t,s,o,2),i!==null&&Xn(i,t,2)}function Ec(t){var i=t.alternate;return t===Ge||i!==null&&i===Ge}function z_(t,i){xa=vc=!0;var s=t.pending;s===null?i.next=i:(i.next=s.next,s.next=i),t.pending=i}function P_(t,i,s){if((s&4194048)!==0){var o=i.lanes;o&=t.pendingLanes,s|=o,i.lanes=s,je(t,s)}}var Ho={readContext:xn,use:Sc,useCallback:Ft,useContext:Ft,useEffect:Ft,useImperativeHandle:Ft,useLayoutEffect:Ft,useInsertionEffect:Ft,useMemo:Ft,useReducer:Ft,useRef:Ft,useState:Ft,useDebugValue:Ft,useDeferredValue:Ft,useTransition:Ft,useSyncExternalStore:Ft,useId:Ft,useHostTransitionStatus:Ft,useFormState:Ft,useActionState:Ft,useOptimistic:Ft,useMemoCache:Ft,useCacheRefresh:Ft};Ho.useEffectEvent=Ft;var H_={readContext:xn,use:Sc,useCallback:function(t,i){return Bn().memoizedState=[t,i===void 0?null:i],t},useContext:xn,useEffect:x_,useImperativeHandle:function(t,i,s){s=s!=null?s.concat([t]):null,Cc(4194308,4,k_.bind(null,i,t),s)},useLayoutEffect:function(t,i){return Cc(4194308,4,t,i)},useInsertionEffect:function(t,i){Cc(4,2,t,i)},useMemo:function(t,i){var s=Bn();i=i===void 0?null:i;var o=t();if(js){Xt(!0);try{t()}finally{Xt(!1)}}return s.memoizedState=[o,i],o},useReducer:function(t,i,s){var o=Bn();if(s!==void 0){var _=s(i);if(js){Xt(!0);try{s(i)}finally{Xt(!1)}}}else _=i;return o.memoizedState=o.baseState=_,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:_},o.queue=t,t=t.dispatch=s2.bind(null,Ge,t),[o.memoizedState,t]},useRef:function(t){var i=Bn();return t={current:t},i.memoizedState=t},useState:function(t){t=od(t);var i=t.queue,s=$_.bind(null,Ge,i);return i.dispatch=s,[t.memoizedState,s]},useDebugValue:ud,useDeferredValue:function(t,i){var s=Bn();return hd(s,t,i)},useTransition:function(){var t=od(!1);return t=O_.bind(null,Ge,t.queue,!0,!1),Bn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,i,s){var o=Ge,_=Bn();if(st){if(s===void 0)throw Error(a(407));s=s()}else{if(s=i(),Ct===null)throw Error(a(349));(nt&127)!==0||l_(o,i,s)}_.memoizedState=s;var w={value:s,getSnapshot:i};return _.queue=w,x_(u_.bind(null,o,w,t),[t]),o.flags|=2048,Ta(9,{destroy:void 0},c_.bind(null,o,w,s,i),null),s},useId:function(){var t=Bn(),i=Ct.identifierPrefix;if(st){var s=Vi,o=Ki;s=(o&~(1<<32-Pt(o)-1)).toString(32)+s,i="_"+i+"R_"+s,s=bc++,0<s&&(i+="H"+s.toString(32)),i+="_"}else s=Jx++,i="_"+i+"r_"+s.toString(32)+"_";return t.memoizedState=i},useHostTransitionStatus:fd,useFormState:b_,useActionState:b_,useOptimistic:function(t){var i=Bn();i.memoizedState=i.baseState=t;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=s,i=pd.bind(null,Ge,!0,s),s.dispatch=i,[t,i]},useMemoCache:rd,useCacheRefresh:function(){return Bn().memoizedState=r2.bind(null,Ge)},useEffectEvent:function(t){var i=Bn(),s={impl:t};return i.memoizedState=s,function(){if((ht&2)!==0)throw Error(a(440));return s.impl.apply(void 0,arguments)}}},gd={readContext:xn,use:Sc,useCallback:L_,useContext:xn,useEffect:cd,useImperativeHandle:R_,useInsertionEffect:T_,useLayoutEffect:A_,useMemo:M_,useReducer:wc,useRef:C_,useState:function(){return wc(vr)},useDebugValue:ud,useDeferredValue:function(t,i){var s=Jt();return D_(s,vt.memoizedState,t,i)},useTransition:function(){var t=wc(vr)[0],i=Jt().memoizedState;return[typeof t=="boolean"?t:zo(t),i]},useSyncExternalStore:o_,useId:I_,useHostTransitionStatus:fd,useFormState:y_,useActionState:y_,useOptimistic:function(t,i){var s=Jt();return f_(s,vt,t,i)},useMemoCache:rd,useCacheRefresh:j_};gd.useEffectEvent=E_;var U_={readContext:xn,use:Sc,useCallback:L_,useContext:xn,useEffect:cd,useImperativeHandle:R_,useInsertionEffect:T_,useLayoutEffect:A_,useMemo:M_,useReducer:ad,useRef:C_,useState:function(){return ad(vr)},useDebugValue:ud,useDeferredValue:function(t,i){var s=Jt();return vt===null?hd(s,t,i):D_(s,vt.memoizedState,t,i)},useTransition:function(){var t=ad(vr)[0],i=Jt().memoizedState;return[typeof t=="boolean"?t:zo(t),i]},useSyncExternalStore:o_,useId:I_,useHostTransitionStatus:fd,useFormState:w_,useActionState:w_,useOptimistic:function(t,i){var s=Jt();return vt!==null?f_(s,vt,t,i):(s.baseState=t,[t,s.queue.dispatch])},useMemoCache:rd,useCacheRefresh:j_};U_.useEffectEvent=E_;function md(t,i,s,o){i=t.memoizedState,s=s(o,i),s=s==null?i:g({},i,s),t.memoizedState=s,t.lanes===0&&(t.updateQueue.baseState=s)}var _d={enqueueSetState:function(t,i,s){t=t._reactInternals;var o=hi(),_=Vr(o);_.payload=i,s!=null&&(_.callback=s),i=Yr(t,_,o),i!==null&&(Xn(i,t,o),Bo(i,t,o))},enqueueReplaceState:function(t,i,s){t=t._reactInternals;var o=hi(),_=Vr(o);_.tag=1,_.payload=i,s!=null&&(_.callback=s),i=Yr(t,_,o),i!==null&&(Xn(i,t,o),Bo(i,t,o))},enqueueForceUpdate:function(t,i){t=t._reactInternals;var s=hi(),o=Vr(s);o.tag=2,i!=null&&(o.callback=i),i=Yr(t,o,s),i!==null&&(Xn(i,t,s),Bo(i,t,s))}};function F_(t,i,s,o,_,w,D){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(o,w,D):i.prototype&&i.prototype.isPureReactComponent?!Ao(s,o)||!Ao(_,w):!0}function q_(t,i,s,o){t=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(s,o),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(s,o),i.state!==t&&_d.enqueueReplaceState(i,i.state,null)}function $s(t,i){var s=i;if("ref"in i){s={};for(var o in i)o!=="ref"&&(s[o]=i[o])}if(t=t.defaultProps){s===i&&(s=g({},s));for(var _ in t)s[_]===void 0&&(s[_]=t[_])}return s}function W_(t){ic(t)}function G_(t){console.error(t)}function K_(t){ic(t)}function Tc(t,i){try{var s=t.onUncaughtError;s(i.value,{componentStack:i.stack})}catch(o){setTimeout(function(){throw o})}}function V_(t,i,s){try{var o=t.onCaughtError;o(s.value,{componentStack:s.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(_){setTimeout(function(){throw _})}}function vd(t,i,s){return s=Vr(s),s.tag=3,s.payload={element:null},s.callback=function(){Tc(t,i)},s}function Y_(t){return t=Vr(t),t.tag=3,t}function X_(t,i,s,o){var _=s.type.getDerivedStateFromError;if(typeof _=="function"){var w=o.value;t.payload=function(){return _(w)},t.callback=function(){V_(i,s,o)}}var D=s.stateNode;D!==null&&typeof D.componentDidCatch=="function"&&(t.callback=function(){V_(i,s,o),typeof _!="function"&&(ts===null?ts=new Set([this]):ts.add(this));var j=o.stack;this.componentDidCatch(o.value,{componentStack:j!==null?j:""})})}function a2(t,i,s,o,_){if(s.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(i=s.alternate,i!==null&&va(i,s,_,!0),s=oi.current,s!==null){switch(s.tag){case 31:case 13:return Si===null?$c():s.alternate===null&&qt===0&&(qt=3),s.flags&=-257,s.flags|=65536,s.lanes=_,o===fc?s.flags|=16384:(i=s.updateQueue,i===null?s.updateQueue=new Set([o]):i.add(o),Fd(t,o,_)),!1;case 22:return s.flags|=65536,o===fc?s.flags|=16384:(i=s.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([o])},s.updateQueue=i):(s=i.retryQueue,s===null?i.retryQueue=new Set([o]):s.add(o)),Fd(t,o,_)),!1}throw Error(a(435,s.tag))}return Fd(t,o,_),$c(),!1}if(st)return i=oi.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=_,o!==jh&&(t=Error(a(422),{cause:o}),Lo(_i(t,s)))):(o!==jh&&(i=Error(a(423),{cause:o}),Lo(_i(i,s))),t=t.current.alternate,t.flags|=65536,_&=-_,t.lanes|=_,o=_i(o,s),_=vd(t.stateNode,o,_),Vh(t,_),qt!==4&&(qt=2)),!1;var w=Error(a(520),{cause:o});if(w=_i(w,s),Yo===null?Yo=[w]:Yo.push(w),qt!==4&&(qt=2),i===null)return!0;o=_i(o,s),s=i;do{switch(s.tag){case 3:return s.flags|=65536,t=_&-_,s.lanes|=t,t=vd(s.stateNode,o,t),Vh(s,t),!1;case 1:if(i=s.type,w=s.stateNode,(s.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(ts===null||!ts.has(w))))return s.flags|=65536,_&=-_,s.lanes|=_,_=Y_(_),X_(_,t,s,o),Vh(s,_),!1}s=s.return}while(s!==null);return!1}var bd=Error(a(461)),ln=!1;function En(t,i,s,o){i.child=t===null?e_(i,null,s,o):Is(i,t.child,s,o)}function Z_(t,i,s,o,_){s=s.render;var w=i.ref;if("ref"in o){var D={};for(var j in o)j!=="ref"&&(D[j]=o[j])}else D=o;return Ds(i),o=ed(t,i,s,D,w,_),j=td(),t!==null&&!ln?(nd(t,i,_),br(t,i,_)):(st&&j&&Bh(i),i.flags|=1,En(t,i,o,_),i.child)}function J_(t,i,s,o,_){if(t===null){var w=s.type;return typeof w=="function"&&!Dh(w)&&w.defaultProps===void 0&&s.compare===null?(i.tag=15,i.type=w,Q_(t,i,w,o,_)):(t=oc(s.type,null,o,i,i.mode,_),t.ref=i.ref,t.return=i,i.child=t)}if(w=t.child,!Ad(t,_)){var D=w.memoizedProps;if(s=s.compare,s=s!==null?s:Ao,s(D,o)&&t.ref===i.ref)return br(t,i,_)}return i.flags|=1,t=fr(w,o),t.ref=i.ref,t.return=i,i.child=t}function Q_(t,i,s,o,_){if(t!==null){var w=t.memoizedProps;if(Ao(w,o)&&t.ref===i.ref)if(ln=!1,i.pendingProps=o=w,Ad(t,_))(t.flags&131072)!==0&&(ln=!0);else return i.lanes=t.lanes,br(t,i,_)}return yd(t,i,s,o,_)}function ev(t,i,s,o){var _=o.children,w=t!==null?t.memoizedState:null;if(t===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((i.flags&128)!==0){if(w=w!==null?w.baseLanes|s:s,t!==null){for(o=i.child=t.child,_=0;o!==null;)_=_|o.lanes|o.childLanes,o=o.sibling;o=_&~w}else o=0,i.child=null;return tv(t,i,w,s,o)}if((s&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},t!==null&&hc(i,w!==null?w.cachePool:null),w!==null?i_(i,w):Xh(),r_(i);else return o=i.lanes=536870912,tv(t,i,w!==null?w.baseLanes|s:s,s,o)}else w!==null?(hc(i,w.cachePool),i_(i,w),Zr(),i.memoizedState=null):(t!==null&&hc(i,null),Xh(),Zr());return En(t,i,_,s),i.child}function Uo(t,i){return t!==null&&t.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function tv(t,i,s,o,_){var w=qh();return w=w===null?null:{parent:an._currentValue,pool:w},i.memoizedState={baseLanes:s,cachePool:w},t!==null&&hc(i,null),Xh(),r_(i),t!==null&&va(t,i,o,!0),i.childLanes=_,null}function Ac(t,i){return i=Rc({mode:i.mode,children:i.children},t.mode),i.ref=t.ref,t.child=i,i.return=t,i}function nv(t,i,s){return Is(i,t.child,null,s),t=Ac(i,i.pendingProps),t.flags|=2,li(i),i.memoizedState=null,t}function o2(t,i,s){var o=i.pendingProps,_=(i.flags&128)!==0;if(i.flags&=-129,t===null){if(st){if(o.mode==="hidden")return t=Ac(i,o),i.lanes=536870912,Uo(null,t);if(Jh(i),(t=Rt)?(t=p0(t,yi),t=t!==null&&t.data==="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:Fr!==null?{id:Ki,overflow:Vi}:null,retryLane:536870912,hydrationErrors:null},s=zm(t),s.return=i,i.child=s,Cn=i,Rt=null)):t=null,t===null)throw Wr(i);return i.lanes=536870912,null}return Ac(i,o)}var w=t.memoizedState;if(w!==null){var D=w.dehydrated;if(Jh(i),_)if(i.flags&256)i.flags&=-257,i=nv(t,i,s);else if(i.memoizedState!==null)i.child=t.child,i.flags|=128,i=null;else throw Error(a(558));else if(ln||va(t,i,s,!1),_=(s&t.childLanes)!==0,ln||_){if(o=Ct,o!==null&&(D=It(o,s),D!==0&&D!==w.retryLane))throw w.retryLane=D,ks(t,D),Xn(o,t,D),bd;$c(),i=nv(t,i,s)}else t=w.treeContext,Rt=wi(D.nextSibling),Cn=i,st=!0,qr=null,yi=!1,t!==null&&Um(i,t),i=Ac(i,o),i.flags|=4096;return i}return t=fr(t.child,{mode:o.mode,children:o.children}),t.ref=i.ref,i.child=t,t.return=i,t}function kc(t,i){var s=i.ref;if(s===null)t!==null&&t.ref!==null&&(i.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(a(284));(t===null||t.ref!==s)&&(i.flags|=4194816)}}function yd(t,i,s,o,_){return Ds(i),s=ed(t,i,s,o,void 0,_),o=td(),t!==null&&!ln?(nd(t,i,_),br(t,i,_)):(st&&o&&Bh(i),i.flags|=1,En(t,i,s,_),i.child)}function iv(t,i,s,o,_,w){return Ds(i),i.updateQueue=null,s=a_(i,o,s,_),s_(t),o=td(),t!==null&&!ln?(nd(t,i,w),br(t,i,w)):(st&&o&&Bh(i),i.flags|=1,En(t,i,s,w),i.child)}function rv(t,i,s,o,_){if(Ds(i),i.stateNode===null){var w=pa,D=s.contextType;typeof D=="object"&&D!==null&&(w=xn(D)),w=new s(o,w),i.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=_d,i.stateNode=w,w._reactInternals=i,w=i.stateNode,w.props=o,w.state=i.memoizedState,w.refs={},Gh(i),D=s.contextType,w.context=typeof D=="object"&&D!==null?xn(D):pa,w.state=i.memoizedState,D=s.getDerivedStateFromProps,typeof D=="function"&&(md(i,s,D,o),w.state=i.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(D=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),D!==w.state&&_d.enqueueReplaceState(w,w.state,null),jo(i,o,w,_),Io(),w.state=i.memoizedState),typeof w.componentDidMount=="function"&&(i.flags|=4194308),o=!0}else if(t===null){w=i.stateNode;var j=i.memoizedProps,X=$s(s,j);w.props=X;var re=w.context,ue=s.contextType;D=pa,typeof ue=="object"&&ue!==null&&(D=xn(ue));var fe=s.getDerivedStateFromProps;ue=typeof fe=="function"||typeof w.getSnapshotBeforeUpdate=="function",j=i.pendingProps!==j,ue||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(j||re!==D)&&q_(i,w,o,D),Kr=!1;var se=i.memoizedState;w.state=se,jo(i,o,w,_),Io(),re=i.memoizedState,j||se!==re||Kr?(typeof fe=="function"&&(md(i,s,fe,o),re=i.memoizedState),(X=Kr||F_(i,s,X,o,se,re,D))?(ue||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(i.flags|=4194308)):(typeof w.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=o,i.memoizedState=re),w.props=o,w.state=re,w.context=D,o=X):(typeof w.componentDidMount=="function"&&(i.flags|=4194308),o=!1)}else{w=i.stateNode,Kh(t,i),D=i.memoizedProps,ue=$s(s,D),w.props=ue,fe=i.pendingProps,se=w.context,re=s.contextType,X=pa,typeof re=="object"&&re!==null&&(X=xn(re)),j=s.getDerivedStateFromProps,(re=typeof j=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(D!==fe||se!==X)&&q_(i,w,o,X),Kr=!1,se=i.memoizedState,w.state=se,jo(i,o,w,_),Io();var le=i.memoizedState;D!==fe||se!==le||Kr||t!==null&&t.dependencies!==null&&cc(t.dependencies)?(typeof j=="function"&&(md(i,s,j,o),le=i.memoizedState),(ue=Kr||F_(i,s,ue,o,se,le,X)||t!==null&&t.dependencies!==null&&cc(t.dependencies))?(re||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(o,le,X),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(o,le,X)),typeof w.componentDidUpdate=="function"&&(i.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof w.componentDidUpdate!="function"||D===t.memoizedProps&&se===t.memoizedState||(i.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||D===t.memoizedProps&&se===t.memoizedState||(i.flags|=1024),i.memoizedProps=o,i.memoizedState=le),w.props=o,w.state=le,w.context=X,o=ue):(typeof w.componentDidUpdate!="function"||D===t.memoizedProps&&se===t.memoizedState||(i.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||D===t.memoizedProps&&se===t.memoizedState||(i.flags|=1024),o=!1)}return w=o,kc(t,i),o=(i.flags&128)!==0,w||o?(w=i.stateNode,s=o&&typeof s.getDerivedStateFromError!="function"?null:w.render(),i.flags|=1,t!==null&&o?(i.child=Is(i,t.child,null,_),i.child=Is(i,null,s,_)):En(t,i,s,_),i.memoizedState=w.state,t=i.child):t=br(t,i,_),t}function sv(t,i,s,o){return Ls(),i.flags|=256,En(t,i,s,o),i.child}var Sd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function wd(t){return{baseLanes:t,cachePool:Vm()}}function Cd(t,i,s){return t=t!==null?t.childLanes&~s:0,i&&(t|=ui),t}function av(t,i,s){var o=i.pendingProps,_=!1,w=(i.flags&128)!==0,D;if((D=w)||(D=t!==null&&t.memoizedState===null?!1:(Zt.current&2)!==0),D&&(_=!0,i.flags&=-129),D=(i.flags&32)!==0,i.flags&=-33,t===null){if(st){if(_?Xr(i):Zr(),(t=Rt)?(t=p0(t,yi),t=t!==null&&t.data!=="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:Fr!==null?{id:Ki,overflow:Vi}:null,retryLane:536870912,hydrationErrors:null},s=zm(t),s.return=i,i.child=s,Cn=i,Rt=null)):t=null,t===null)throw Wr(i);return af(t)?i.lanes=32:i.lanes=536870912,null}var j=o.children;return o=o.fallback,_?(Zr(),_=i.mode,j=Rc({mode:"hidden",children:j},_),o=Rs(o,_,s,null),j.return=i,o.return=i,j.sibling=o,i.child=j,o=i.child,o.memoizedState=wd(s),o.childLanes=Cd(t,D,s),i.memoizedState=Sd,Uo(null,o)):(Xr(i),xd(i,j))}var X=t.memoizedState;if(X!==null&&(j=X.dehydrated,j!==null)){if(w)i.flags&256?(Xr(i),i.flags&=-257,i=Ed(t,i,s)):i.memoizedState!==null?(Zr(),i.child=t.child,i.flags|=128,i=null):(Zr(),j=o.fallback,_=i.mode,o=Rc({mode:"visible",children:o.children},_),j=Rs(j,_,s,null),j.flags|=2,o.return=i,j.return=i,o.sibling=j,i.child=o,Is(i,t.child,null,s),o=i.child,o.memoizedState=wd(s),o.childLanes=Cd(t,D,s),i.memoizedState=Sd,i=Uo(null,o));else if(Xr(i),af(j)){if(D=j.nextSibling&&j.nextSibling.dataset,D)var re=D.dgst;D=re,o=Error(a(419)),o.stack="",o.digest=D,Lo({value:o,source:null,stack:null}),i=Ed(t,i,s)}else if(ln||va(t,i,s,!1),D=(s&t.childLanes)!==0,ln||D){if(D=Ct,D!==null&&(o=It(D,s),o!==0&&o!==X.retryLane))throw X.retryLane=o,ks(t,o),Xn(D,t,o),bd;sf(j)||$c(),i=Ed(t,i,s)}else sf(j)?(i.flags|=192,i.child=t.child,i=null):(t=X.treeContext,Rt=wi(j.nextSibling),Cn=i,st=!0,qr=null,yi=!1,t!==null&&Um(i,t),i=xd(i,o.children),i.flags|=4096);return i}return _?(Zr(),j=o.fallback,_=i.mode,X=t.child,re=X.sibling,o=fr(X,{mode:"hidden",children:o.children}),o.subtreeFlags=X.subtreeFlags&65011712,re!==null?j=fr(re,j):(j=Rs(j,_,s,null),j.flags|=2),j.return=i,o.return=i,o.sibling=j,i.child=o,Uo(null,o),o=i.child,j=t.child.memoizedState,j===null?j=wd(s):(_=j.cachePool,_!==null?(X=an._currentValue,_=_.parent!==X?{parent:X,pool:X}:_):_=Vm(),j={baseLanes:j.baseLanes|s,cachePool:_}),o.memoizedState=j,o.childLanes=Cd(t,D,s),i.memoizedState=Sd,Uo(t.child,o)):(Xr(i),s=t.child,t=s.sibling,s=fr(s,{mode:"visible",children:o.children}),s.return=i,s.sibling=null,t!==null&&(D=i.deletions,D===null?(i.deletions=[t],i.flags|=16):D.push(t)),i.child=s,i.memoizedState=null,s)}function xd(t,i){return i=Rc({mode:"visible",children:i},t.mode),i.return=t,t.child=i}function Rc(t,i){return t=ai(22,t,null,i),t.lanes=0,t}function Ed(t,i,s){return Is(i,t.child,null,s),t=xd(i,i.pendingProps.children),t.flags|=2,i.memoizedState=null,t}function ov(t,i,s){t.lanes|=i;var o=t.alternate;o!==null&&(o.lanes|=i),Ph(t.return,i,s)}function Td(t,i,s,o,_,w){var D=t.memoizedState;D===null?t.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:o,tail:s,tailMode:_,treeForkCount:w}:(D.isBackwards=i,D.rendering=null,D.renderingStartTime=0,D.last=o,D.tail=s,D.tailMode=_,D.treeForkCount=w)}function lv(t,i,s){var o=i.pendingProps,_=o.revealOrder,w=o.tail;o=o.children;var D=Zt.current,j=(D&2)!==0;if(j?(D=D&1|2,i.flags|=128):D&=1,Z(Zt,D),En(t,i,o,s),o=st?Ro:0,!j&&t!==null&&(t.flags&128)!==0)e:for(t=i.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&ov(t,s,i);else if(t.tag===19)ov(t,s,i);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===i)break e;for(;t.sibling===null;){if(t.return===null||t.return===i)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(_){case"forwards":for(s=i.child,_=null;s!==null;)t=s.alternate,t!==null&&_c(t)===null&&(_=s),s=s.sibling;s=_,s===null?(_=i.child,i.child=null):(_=s.sibling,s.sibling=null),Td(i,!1,_,s,w,o);break;case"backwards":case"unstable_legacy-backwards":for(s=null,_=i.child,i.child=null;_!==null;){if(t=_.alternate,t!==null&&_c(t)===null){i.child=_;break}t=_.sibling,_.sibling=s,s=_,_=t}Td(i,!0,s,null,w,o);break;case"together":Td(i,!1,null,null,void 0,o);break;default:i.memoizedState=null}return i.child}function br(t,i,s){if(t!==null&&(i.dependencies=t.dependencies),es|=i.lanes,(s&i.childLanes)===0)if(t!==null){if(va(t,i,s,!1),(s&i.childLanes)===0)return null}else return null;if(t!==null&&i.child!==t.child)throw Error(a(153));if(i.child!==null){for(t=i.child,s=fr(t,t.pendingProps),i.child=s,s.return=i;t.sibling!==null;)t=t.sibling,s=s.sibling=fr(t,t.pendingProps),s.return=i;s.sibling=null}return i.child}function Ad(t,i){return(t.lanes&i)!==0?!0:(t=t.dependencies,!!(t!==null&&cc(t)))}function l2(t,i,s){switch(i.tag){case 3:z(i,i.stateNode.containerInfo),Gr(i,an,t.memoizedState.cache),Ls();break;case 27:case 5:ge(i);break;case 4:z(i,i.stateNode.containerInfo);break;case 10:Gr(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Jh(i),null;break;case 13:var o=i.memoizedState;if(o!==null)return o.dehydrated!==null?(Xr(i),i.flags|=128,null):(s&i.child.childLanes)!==0?av(t,i,s):(Xr(i),t=br(t,i,s),t!==null?t.sibling:null);Xr(i);break;case 19:var _=(t.flags&128)!==0;if(o=(s&i.childLanes)!==0,o||(va(t,i,s,!1),o=(s&i.childLanes)!==0),_){if(o)return lv(t,i,s);i.flags|=128}if(_=i.memoizedState,_!==null&&(_.rendering=null,_.tail=null,_.lastEffect=null),Z(Zt,Zt.current),o)break;return null;case 22:return i.lanes=0,ev(t,i,s,i.pendingProps);case 24:Gr(i,an,t.memoizedState.cache)}return br(t,i,s)}function cv(t,i,s){if(t!==null)if(t.memoizedProps!==i.pendingProps)ln=!0;else{if(!Ad(t,s)&&(i.flags&128)===0)return ln=!1,l2(t,i,s);ln=(t.flags&131072)!==0}else ln=!1,st&&(i.flags&1048576)!==0&&Hm(i,Ro,i.index);switch(i.lanes=0,i.tag){case 16:e:{var o=i.pendingProps;if(t=Ns(i.elementType),i.type=t,typeof t=="function")Dh(t)?(o=$s(t,o),i.tag=1,i=rv(null,i,t,o,s)):(i.tag=0,i=yd(null,i,t,o,s));else{if(t!=null){var _=t.$$typeof;if(_===E){i.tag=11,i=Z_(null,i,t,o,s);break e}else if(_===M){i.tag=14,i=J_(null,i,t,o,s);break e}}throw i=K(t)||t,Error(a(306,i,""))}}return i;case 0:return yd(t,i,i.type,i.pendingProps,s);case 1:return o=i.type,_=$s(o,i.pendingProps),rv(t,i,o,_,s);case 3:e:{if(z(i,i.stateNode.containerInfo),t===null)throw Error(a(387));o=i.pendingProps;var w=i.memoizedState;_=w.element,Kh(t,i),jo(i,o,null,s);var D=i.memoizedState;if(o=D.cache,Gr(i,an,o),o!==w.cache&&Hh(i,[an],s,!0),Io(),o=D.element,w.isDehydrated)if(w={element:o,isDehydrated:!1,cache:D.cache},i.updateQueue.baseState=w,i.memoizedState=w,i.flags&256){i=sv(t,i,o,s);break e}else if(o!==_){_=_i(Error(a(424)),i),Lo(_),i=sv(t,i,o,s);break e}else for(t=i.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,Rt=wi(t.firstChild),Cn=i,st=!0,qr=null,yi=!0,s=e_(i,null,o,s),i.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(Ls(),o===_){i=br(t,i,s);break e}En(t,i,o,s)}i=i.child}return i;case 26:return kc(t,i),t===null?(s=y0(i.type,null,i.pendingProps,null))?i.memoizedState=s:st||(s=i.type,t=i.pendingProps,o=Wc(_e.current).createElement(s),o[At]=i,o[Et]=t,Tn(o,s,t),Ze(o),i.stateNode=o):i.memoizedState=y0(i.type,t.memoizedProps,i.pendingProps,t.memoizedState),null;case 27:return ge(i),t===null&&st&&(o=i.stateNode=_0(i.type,i.pendingProps,_e.current),Cn=i,yi=!0,_=Rt,ss(i.type)?(of=_,Rt=wi(o.firstChild)):Rt=_),En(t,i,i.pendingProps.children,s),kc(t,i),t===null&&(i.flags|=4194304),i.child;case 5:return t===null&&st&&((_=o=Rt)&&(o=$2(o,i.type,i.pendingProps,yi),o!==null?(i.stateNode=o,Cn=i,Rt=wi(o.firstChild),yi=!1,_=!0):_=!1),_||Wr(i)),ge(i),_=i.type,w=i.pendingProps,D=t!==null?t.memoizedProps:null,o=w.children,tf(_,w)?o=null:D!==null&&tf(_,D)&&(i.flags|=32),i.memoizedState!==null&&(_=ed(t,i,Qx,null,null,s),il._currentValue=_),kc(t,i),En(t,i,o,s),i.child;case 6:return t===null&&st&&((t=s=Rt)&&(s=z2(s,i.pendingProps,yi),s!==null?(i.stateNode=s,Cn=i,Rt=null,t=!0):t=!1),t||Wr(i)),null;case 13:return av(t,i,s);case 4:return z(i,i.stateNode.containerInfo),o=i.pendingProps,t===null?i.child=Is(i,null,o,s):En(t,i,o,s),i.child;case 11:return Z_(t,i,i.type,i.pendingProps,s);case 7:return En(t,i,i.pendingProps,s),i.child;case 8:return En(t,i,i.pendingProps.children,s),i.child;case 12:return En(t,i,i.pendingProps.children,s),i.child;case 10:return o=i.pendingProps,Gr(i,i.type,o.value),En(t,i,o.children,s),i.child;case 9:return _=i.type._context,o=i.pendingProps.children,Ds(i),_=xn(_),o=o(_),i.flags|=1,En(t,i,o,s),i.child;case 14:return J_(t,i,i.type,i.pendingProps,s);case 15:return Q_(t,i,i.type,i.pendingProps,s);case 19:return lv(t,i,s);case 31:return o2(t,i,s);case 22:return ev(t,i,s,i.pendingProps);case 24:return Ds(i),o=xn(an),t===null?(_=qh(),_===null&&(_=Ct,w=Uh(),_.pooledCache=w,w.refCount++,w!==null&&(_.pooledCacheLanes|=s),_=w),i.memoizedState={parent:o,cache:_},Gh(i),Gr(i,an,_)):((t.lanes&s)!==0&&(Kh(t,i),jo(i,null,null,s),Io()),_=t.memoizedState,w=i.memoizedState,_.parent!==o?(_={parent:o,cache:o},i.memoizedState=_,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=_),Gr(i,an,o)):(o=w.cache,Gr(i,an,o),o!==_.cache&&Hh(i,[an],s,!0))),En(t,i,i.pendingProps.children,s),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function yr(t){t.flags|=4}function kd(t,i,s,o,_){if((i=(t.mode&32)!==0)&&(i=!1),i){if(t.flags|=16777216,(_&335544128)===_)if(t.stateNode.complete)t.flags|=8192;else if(Iv())t.flags|=8192;else throw Bs=fc,Wh}else t.flags&=-16777217}function uv(t,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!E0(i))if(Iv())t.flags|=8192;else throw Bs=fc,Wh}function Lc(t,i){i!==null&&(t.flags|=4),t.flags&16384&&(i=t.tag!==22?Ie():536870912,t.lanes|=i,La|=i)}function Fo(t,i){if(!st)switch(t.tailMode){case"hidden":i=t.tail;for(var s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?t.tail=null:s.sibling=null;break;case"collapsed":s=t.tail;for(var o=null;s!==null;)s.alternate!==null&&(o=s),s=s.sibling;o===null?i||t.tail===null?t.tail=null:t.tail.sibling=null:o.sibling=null}}function Lt(t){var i=t.alternate!==null&&t.alternate.child===t.child,s=0,o=0;if(i)for(var _=t.child;_!==null;)s|=_.lanes|_.childLanes,o|=_.subtreeFlags&65011712,o|=_.flags&65011712,_.return=t,_=_.sibling;else for(_=t.child;_!==null;)s|=_.lanes|_.childLanes,o|=_.subtreeFlags,o|=_.flags,_.return=t,_=_.sibling;return t.subtreeFlags|=o,t.childLanes=s,i}function c2(t,i,s){var o=i.pendingProps;switch(Ih(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Lt(i),null;case 1:return Lt(i),null;case 3:return s=i.stateNode,o=null,t!==null&&(o=t.memoizedState.cache),i.memoizedState.cache!==o&&(i.flags|=2048),mr(an),oe(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(t===null||t.child===null)&&(_a(i)?yr(i):t===null||t.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,$h())),Lt(i),null;case 26:var _=i.type,w=i.memoizedState;return t===null?(yr(i),w!==null?(Lt(i),uv(i,w)):(Lt(i),kd(i,_,null,o,s))):w?w!==t.memoizedState?(yr(i),Lt(i),uv(i,w)):(Lt(i),i.flags&=-16777217):(t=t.memoizedProps,t!==o&&yr(i),Lt(i),kd(i,_,t,o,s)),null;case 27:if(Se(i),s=_e.current,_=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==o&&yr(i);else{if(!o){if(i.stateNode===null)throw Error(a(166));return Lt(i),null}t=ae.current,_a(i)?Fm(i):(t=_0(_,o,s),i.stateNode=t,yr(i))}return Lt(i),null;case 5:if(Se(i),_=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==o&&yr(i);else{if(!o){if(i.stateNode===null)throw Error(a(166));return Lt(i),null}if(w=ae.current,_a(i))Fm(i);else{var D=Wc(_e.current);switch(w){case 1:w=D.createElementNS("http://www.w3.org/2000/svg",_);break;case 2:w=D.createElementNS("http://www.w3.org/1998/Math/MathML",_);break;default:switch(_){case"svg":w=D.createElementNS("http://www.w3.org/2000/svg",_);break;case"math":w=D.createElementNS("http://www.w3.org/1998/Math/MathML",_);break;case"script":w=D.createElement("div"),w.innerHTML="<script><\/script>",w=w.removeChild(w.firstChild);break;case"select":w=typeof o.is=="string"?D.createElement("select",{is:o.is}):D.createElement("select"),o.multiple?w.multiple=!0:o.size&&(w.size=o.size);break;default:w=typeof o.is=="string"?D.createElement(_,{is:o.is}):D.createElement(_)}}w[At]=i,w[Et]=o;e:for(D=i.child;D!==null;){if(D.tag===5||D.tag===6)w.appendChild(D.stateNode);else if(D.tag!==4&&D.tag!==27&&D.child!==null){D.child.return=D,D=D.child;continue}if(D===i)break e;for(;D.sibling===null;){if(D.return===null||D.return===i)break e;D=D.return}D.sibling.return=D.return,D=D.sibling}i.stateNode=w;e:switch(Tn(w,_,o),_){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&yr(i)}}return Lt(i),kd(i,i.type,t===null?null:t.memoizedProps,i.pendingProps,s),null;case 6:if(t&&i.stateNode!=null)t.memoizedProps!==o&&yr(i);else{if(typeof o!="string"&&i.stateNode===null)throw Error(a(166));if(t=_e.current,_a(i)){if(t=i.stateNode,s=i.memoizedProps,o=null,_=Cn,_!==null)switch(_.tag){case 27:case 5:o=_.memoizedProps}t[At]=i,t=!!(t.nodeValue===s||o!==null&&o.suppressHydrationWarning===!0||a0(t.nodeValue,s)),t||Wr(i,!0)}else t=Wc(t).createTextNode(o),t[At]=i,i.stateNode=t}return Lt(i),null;case 31:if(s=i.memoizedState,t===null||t.memoizedState!==null){if(o=_a(i),s!==null){if(t===null){if(!o)throw Error(a(318));if(t=i.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(557));t[At]=i}else Ls(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Lt(i),t=!1}else s=$h(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=s),t=!0;if(!t)return i.flags&256?(li(i),i):(li(i),null);if((i.flags&128)!==0)throw Error(a(558))}return Lt(i),null;case 13:if(o=i.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(_=_a(i),o!==null&&o.dehydrated!==null){if(t===null){if(!_)throw Error(a(318));if(_=i.memoizedState,_=_!==null?_.dehydrated:null,!_)throw Error(a(317));_[At]=i}else Ls(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Lt(i),_=!1}else _=$h(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=_),_=!0;if(!_)return i.flags&256?(li(i),i):(li(i),null)}return li(i),(i.flags&128)!==0?(i.lanes=s,i):(s=o!==null,t=t!==null&&t.memoizedState!==null,s&&(o=i.child,_=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(_=o.alternate.memoizedState.cachePool.pool),w=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(w=o.memoizedState.cachePool.pool),w!==_&&(o.flags|=2048)),s!==t&&s&&(i.child.flags|=8192),Lc(i,i.updateQueue),Lt(i),null);case 4:return oe(),t===null&&Xd(i.stateNode.containerInfo),Lt(i),null;case 10:return mr(i.type),Lt(i),null;case 19:if(P(Zt),o=i.memoizedState,o===null)return Lt(i),null;if(_=(i.flags&128)!==0,w=o.rendering,w===null)if(_)Fo(o,!1);else{if(qt!==0||t!==null&&(t.flags&128)!==0)for(t=i.child;t!==null;){if(w=_c(t),w!==null){for(i.flags|=128,Fo(o,!1),t=w.updateQueue,i.updateQueue=t,Lc(i,t),i.subtreeFlags=0,t=s,s=i.child;s!==null;)$m(s,t),s=s.sibling;return Z(Zt,Zt.current&1|2),st&&pr(i,o.treeForkCount),i.child}t=t.sibling}o.tail!==null&&ut()>Bc&&(i.flags|=128,_=!0,Fo(o,!1),i.lanes=4194304)}else{if(!_)if(t=_c(w),t!==null){if(i.flags|=128,_=!0,t=t.updateQueue,i.updateQueue=t,Lc(i,t),Fo(o,!0),o.tail===null&&o.tailMode==="hidden"&&!w.alternate&&!st)return Lt(i),null}else 2*ut()-o.renderingStartTime>Bc&&s!==536870912&&(i.flags|=128,_=!0,Fo(o,!1),i.lanes=4194304);o.isBackwards?(w.sibling=i.child,i.child=w):(t=o.last,t!==null?t.sibling=w:i.child=w,o.last=w)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=ut(),t.sibling=null,s=Zt.current,Z(Zt,_?s&1|2:s&1),st&&pr(i,o.treeForkCount),t):(Lt(i),null);case 22:case 23:return li(i),Zh(),o=i.memoizedState!==null,t!==null?t.memoizedState!==null!==o&&(i.flags|=8192):o&&(i.flags|=8192),o?(s&536870912)!==0&&(i.flags&128)===0&&(Lt(i),i.subtreeFlags&6&&(i.flags|=8192)):Lt(i),s=i.updateQueue,s!==null&&Lc(i,s.retryQueue),s=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),o=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),o!==s&&(i.flags|=2048),t!==null&&P(Os),null;case 24:return s=null,t!==null&&(s=t.memoizedState.cache),i.memoizedState.cache!==s&&(i.flags|=2048),mr(an),Lt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function u2(t,i){switch(Ih(i),i.tag){case 1:return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 3:return mr(an),oe(),t=i.flags,(t&65536)!==0&&(t&128)===0?(i.flags=t&-65537|128,i):null;case 26:case 27:case 5:return Se(i),null;case 31:if(i.memoizedState!==null){if(li(i),i.alternate===null)throw Error(a(340));Ls()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 13:if(li(i),t=i.memoizedState,t!==null&&t.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Ls()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 19:return P(Zt),null;case 4:return oe(),null;case 10:return mr(i.type),null;case 22:case 23:return li(i),Zh(),t!==null&&P(Os),t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 24:return mr(an),null;case 25:return null;default:return null}}function hv(t,i){switch(Ih(i),i.tag){case 3:mr(an),oe();break;case 26:case 27:case 5:Se(i);break;case 4:oe();break;case 31:i.memoizedState!==null&&li(i);break;case 13:li(i);break;case 19:P(Zt);break;case 10:mr(i.type);break;case 22:case 23:li(i),Zh(),t!==null&&P(Os);break;case 24:mr(an)}}function qo(t,i){try{var s=i.updateQueue,o=s!==null?s.lastEffect:null;if(o!==null){var _=o.next;s=_;do{if((s.tag&t)===t){o=void 0;var w=s.create,D=s.inst;o=w(),D.destroy=o}s=s.next}while(s!==_)}}catch(j){mt(i,i.return,j)}}function Jr(t,i,s){try{var o=i.updateQueue,_=o!==null?o.lastEffect:null;if(_!==null){var w=_.next;o=w;do{if((o.tag&t)===t){var D=o.inst,j=D.destroy;if(j!==void 0){D.destroy=void 0,_=i;var X=s,re=j;try{re()}catch(ue){mt(_,X,ue)}}}o=o.next}while(o!==w)}}catch(ue){mt(i,i.return,ue)}}function dv(t){var i=t.updateQueue;if(i!==null){var s=t.stateNode;try{n_(i,s)}catch(o){mt(t,t.return,o)}}}function fv(t,i,s){s.props=$s(t.type,t.memoizedProps),s.state=t.memoizedState;try{s.componentWillUnmount()}catch(o){mt(t,i,o)}}function Wo(t,i){try{var s=t.ref;if(s!==null){switch(t.tag){case 26:case 27:case 5:var o=t.stateNode;break;case 30:o=t.stateNode;break;default:o=t.stateNode}typeof s=="function"?t.refCleanup=s(o):s.current=o}}catch(_){mt(t,i,_)}}function Yi(t,i){var s=t.ref,o=t.refCleanup;if(s!==null)if(typeof o=="function")try{o()}catch(_){mt(t,i,_)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(_){mt(t,i,_)}else s.current=null}function pv(t){var i=t.type,s=t.memoizedProps,o=t.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":s.autoFocus&&o.focus();break e;case"img":s.src?o.src=s.src:s.srcSet&&(o.srcset=s.srcSet)}}catch(_){mt(t,t.return,_)}}function Rd(t,i,s){try{var o=t.stateNode;D2(o,t.type,s,i),o[Et]=i}catch(_){mt(t,t.return,_)}}function gv(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&ss(t.type)||t.tag===4}function Ld(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||gv(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&ss(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Md(t,i,s){var o=t.tag;if(o===5||o===6)t=t.stateNode,i?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(t,i):(i=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,i.appendChild(t),s=s._reactRootContainer,s!=null||i.onclick!==null||(i.onclick=we));else if(o!==4&&(o===27&&ss(t.type)&&(s=t.stateNode,i=null),t=t.child,t!==null))for(Md(t,i,s),t=t.sibling;t!==null;)Md(t,i,s),t=t.sibling}function Mc(t,i,s){var o=t.tag;if(o===5||o===6)t=t.stateNode,i?s.insertBefore(t,i):s.appendChild(t);else if(o!==4&&(o===27&&ss(t.type)&&(s=t.stateNode),t=t.child,t!==null))for(Mc(t,i,s),t=t.sibling;t!==null;)Mc(t,i,s),t=t.sibling}function mv(t){var i=t.stateNode,s=t.memoizedProps;try{for(var o=t.type,_=i.attributes;_.length;)i.removeAttributeNode(_[0]);Tn(i,o,s),i[At]=t,i[Et]=s}catch(w){mt(t,t.return,w)}}var Sr=!1,cn=!1,Dd=!1,_v=typeof WeakSet=="function"?WeakSet:Set,pn=null;function h2(t,i){if(t=t.containerInfo,Qd=Jc,t=Rm(t),Eh(t)){if("selectionStart"in t)var s={start:t.selectionStart,end:t.selectionEnd};else e:{s=(s=t.ownerDocument)&&s.defaultView||window;var o=s.getSelection&&s.getSelection();if(o&&o.rangeCount!==0){s=o.anchorNode;var _=o.anchorOffset,w=o.focusNode;o=o.focusOffset;try{s.nodeType,w.nodeType}catch{s=null;break e}var D=0,j=-1,X=-1,re=0,ue=0,fe=t,se=null;t:for(;;){for(var le;fe!==s||_!==0&&fe.nodeType!==3||(j=D+_),fe!==w||o!==0&&fe.nodeType!==3||(X=D+o),fe.nodeType===3&&(D+=fe.nodeValue.length),(le=fe.firstChild)!==null;)se=fe,fe=le;for(;;){if(fe===t)break t;if(se===s&&++re===_&&(j=D),se===w&&++ue===o&&(X=D),(le=fe.nextSibling)!==null)break;fe=se,se=fe.parentNode}fe=le}s=j===-1||X===-1?null:{start:j,end:X}}else s=null}s=s||{start:0,end:0}}else s=null;for(ef={focusedElem:t,selectionRange:s},Jc=!1,pn=i;pn!==null;)if(i=pn,t=i.child,(i.subtreeFlags&1028)!==0&&t!==null)t.return=i,pn=t;else for(;pn!==null;){switch(i=pn,w=i.alternate,t=i.flags,i.tag){case 0:if((t&4)!==0&&(t=i.updateQueue,t=t!==null?t.events:null,t!==null))for(s=0;s<t.length;s++)_=t[s],_.ref.impl=_.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&w!==null){t=void 0,s=i,_=w.memoizedProps,w=w.memoizedState,o=s.stateNode;try{var Ae=$s(s.type,_);t=o.getSnapshotBeforeUpdate(Ae,w),o.__reactInternalSnapshotBeforeUpdate=t}catch($e){mt(s,s.return,$e)}}break;case 3:if((t&1024)!==0){if(t=i.stateNode.containerInfo,s=t.nodeType,s===9)rf(t);else if(s===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":rf(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(a(163))}if(t=i.sibling,t!==null){t.return=i.return,pn=t;break}pn=i.return}}function vv(t,i,s){var o=s.flags;switch(s.tag){case 0:case 11:case 15:Cr(t,s),o&4&&qo(5,s);break;case 1:if(Cr(t,s),o&4)if(t=s.stateNode,i===null)try{t.componentDidMount()}catch(D){mt(s,s.return,D)}else{var _=$s(s.type,i.memoizedProps);i=i.memoizedState;try{t.componentDidUpdate(_,i,t.__reactInternalSnapshotBeforeUpdate)}catch(D){mt(s,s.return,D)}}o&64&&dv(s),o&512&&Wo(s,s.return);break;case 3:if(Cr(t,s),o&64&&(t=s.updateQueue,t!==null)){if(i=null,s.child!==null)switch(s.child.tag){case 27:case 5:i=s.child.stateNode;break;case 1:i=s.child.stateNode}try{n_(t,i)}catch(D){mt(s,s.return,D)}}break;case 27:i===null&&o&4&&mv(s);case 26:case 5:Cr(t,s),i===null&&o&4&&pv(s),o&512&&Wo(s,s.return);break;case 12:Cr(t,s);break;case 31:Cr(t,s),o&4&&Sv(t,s);break;case 13:Cr(t,s),o&4&&wv(t,s),o&64&&(t=s.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(s=y2.bind(null,s),P2(t,s))));break;case 22:if(o=s.memoizedState!==null||Sr,!o){i=i!==null&&i.memoizedState!==null||cn,_=Sr;var w=cn;Sr=o,(cn=i)&&!w?xr(t,s,(s.subtreeFlags&8772)!==0):Cr(t,s),Sr=_,cn=w}break;case 30:break;default:Cr(t,s)}}function bv(t){var i=t.alternate;i!==null&&(t.alternate=null,bv(i)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(i=t.stateNode,i!==null&&De(i)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Nt=null,Gn=!1;function wr(t,i,s){for(s=s.child;s!==null;)yv(t,i,s),s=s.sibling}function yv(t,i,s){if(Yt&&typeof Yt.onCommitFiberUnmount=="function")try{Yt.onCommitFiberUnmount(Hn,s)}catch{}switch(s.tag){case 26:cn||Yi(s,i),wr(t,i,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:cn||Yi(s,i);var o=Nt,_=Gn;ss(s.type)&&(Nt=s.stateNode,Gn=!1),wr(t,i,s),el(s.stateNode),Nt=o,Gn=_;break;case 5:cn||Yi(s,i);case 6:if(o=Nt,_=Gn,Nt=null,wr(t,i,s),Nt=o,Gn=_,Nt!==null)if(Gn)try{(Nt.nodeType===9?Nt.body:Nt.nodeName==="HTML"?Nt.ownerDocument.body:Nt).removeChild(s.stateNode)}catch(w){mt(s,i,w)}else try{Nt.removeChild(s.stateNode)}catch(w){mt(s,i,w)}break;case 18:Nt!==null&&(Gn?(t=Nt,d0(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,s.stateNode),$a(t)):d0(Nt,s.stateNode));break;case 4:o=Nt,_=Gn,Nt=s.stateNode.containerInfo,Gn=!0,wr(t,i,s),Nt=o,Gn=_;break;case 0:case 11:case 14:case 15:Jr(2,s,i),cn||Jr(4,s,i),wr(t,i,s);break;case 1:cn||(Yi(s,i),o=s.stateNode,typeof o.componentWillUnmount=="function"&&fv(s,i,o)),wr(t,i,s);break;case 21:wr(t,i,s);break;case 22:cn=(o=cn)||s.memoizedState!==null,wr(t,i,s),cn=o;break;default:wr(t,i,s)}}function Sv(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{$a(t)}catch(s){mt(i,i.return,s)}}}function wv(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{$a(t)}catch(s){mt(i,i.return,s)}}function d2(t){switch(t.tag){case 31:case 13:case 19:var i=t.stateNode;return i===null&&(i=t.stateNode=new _v),i;case 22:return t=t.stateNode,i=t._retryCache,i===null&&(i=t._retryCache=new _v),i;default:throw Error(a(435,t.tag))}}function Dc(t,i){var s=d2(t);i.forEach(function(o){if(!s.has(o)){s.add(o);var _=S2.bind(null,t,o);o.then(_,_)}})}function Kn(t,i){var s=i.deletions;if(s!==null)for(var o=0;o<s.length;o++){var _=s[o],w=t,D=i,j=D;e:for(;j!==null;){switch(j.tag){case 27:if(ss(j.type)){Nt=j.stateNode,Gn=!1;break e}break;case 5:Nt=j.stateNode,Gn=!1;break e;case 3:case 4:Nt=j.stateNode.containerInfo,Gn=!0;break e}j=j.return}if(Nt===null)throw Error(a(160));yv(w,D,_),Nt=null,Gn=!1,w=_.alternate,w!==null&&(w.return=null),_.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Cv(i,t),i=i.sibling}var Ii=null;function Cv(t,i){var s=t.alternate,o=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Kn(i,t),Vn(t),o&4&&(Jr(3,t,t.return),qo(3,t),Jr(5,t,t.return));break;case 1:Kn(i,t),Vn(t),o&512&&(cn||s===null||Yi(s,s.return)),o&64&&Sr&&(t=t.updateQueue,t!==null&&(o=t.callbacks,o!==null&&(s=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=s===null?o:s.concat(o))));break;case 26:var _=Ii;if(Kn(i,t),Vn(t),o&512&&(cn||s===null||Yi(s,s.return)),o&4){var w=s!==null?s.memoizedState:null;if(o=t.memoizedState,s===null)if(o===null)if(t.stateNode===null){e:{o=t.type,s=t.memoizedProps,_=_.ownerDocument||_;t:switch(o){case"title":w=_.getElementsByTagName("title")[0],(!w||w[Gi]||w[At]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=_.createElement(o),_.head.insertBefore(w,_.querySelector("head > title"))),Tn(w,o,s),w[At]=t,Ze(w),o=w;break e;case"link":var D=C0("link","href",_).get(o+(s.href||""));if(D){for(var j=0;j<D.length;j++)if(w=D[j],w.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&w.getAttribute("rel")===(s.rel==null?null:s.rel)&&w.getAttribute("title")===(s.title==null?null:s.title)&&w.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){D.splice(j,1);break t}}w=_.createElement(o),Tn(w,o,s),_.head.appendChild(w);break;case"meta":if(D=C0("meta","content",_).get(o+(s.content||""))){for(j=0;j<D.length;j++)if(w=D[j],w.getAttribute("content")===(s.content==null?null:""+s.content)&&w.getAttribute("name")===(s.name==null?null:s.name)&&w.getAttribute("property")===(s.property==null?null:s.property)&&w.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&w.getAttribute("charset")===(s.charSet==null?null:s.charSet)){D.splice(j,1);break t}}w=_.createElement(o),Tn(w,o,s),_.head.appendChild(w);break;default:throw Error(a(468,o))}w[At]=t,Ze(w),o=w}t.stateNode=o}else x0(_,t.type,t.stateNode);else t.stateNode=w0(_,o,t.memoizedProps);else w!==o?(w===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):w.count--,o===null?x0(_,t.type,t.stateNode):w0(_,o,t.memoizedProps)):o===null&&t.stateNode!==null&&Rd(t,t.memoizedProps,s.memoizedProps)}break;case 27:Kn(i,t),Vn(t),o&512&&(cn||s===null||Yi(s,s.return)),s!==null&&o&4&&Rd(t,t.memoizedProps,s.memoizedProps);break;case 5:if(Kn(i,t),Vn(t),o&512&&(cn||s===null||Yi(s,s.return)),t.flags&32){_=t.stateNode;try{He(_,"")}catch(Ae){mt(t,t.return,Ae)}}o&4&&t.stateNode!=null&&(_=t.memoizedProps,Rd(t,_,s!==null?s.memoizedProps:_)),o&1024&&(Dd=!0);break;case 6:if(Kn(i,t),Vn(t),o&4){if(t.stateNode===null)throw Error(a(162));o=t.memoizedProps,s=t.stateNode;try{s.nodeValue=o}catch(Ae){mt(t,t.return,Ae)}}break;case 3:if(Vc=null,_=Ii,Ii=Gc(i.containerInfo),Kn(i,t),Ii=_,Vn(t),o&4&&s!==null&&s.memoizedState.isDehydrated)try{$a(i.containerInfo)}catch(Ae){mt(t,t.return,Ae)}Dd&&(Dd=!1,xv(t));break;case 4:o=Ii,Ii=Gc(t.stateNode.containerInfo),Kn(i,t),Vn(t),Ii=o;break;case 12:Kn(i,t),Vn(t);break;case 31:Kn(i,t),Vn(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,Dc(t,o)));break;case 13:Kn(i,t),Vn(t),t.child.flags&8192&&t.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Nc=ut()),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,Dc(t,o)));break;case 22:_=t.memoizedState!==null;var X=s!==null&&s.memoizedState!==null,re=Sr,ue=cn;if(Sr=re||_,cn=ue||X,Kn(i,t),cn=ue,Sr=re,Vn(t),o&8192)e:for(i=t.stateNode,i._visibility=_?i._visibility&-2:i._visibility|1,_&&(s===null||X||Sr||cn||zs(t)),s=null,i=t;;){if(i.tag===5||i.tag===26){if(s===null){X=s=i;try{if(w=X.stateNode,_)D=w.style,typeof D.setProperty=="function"?D.setProperty("display","none","important"):D.display="none";else{j=X.stateNode;var fe=X.memoizedProps.style,se=fe!=null&&fe.hasOwnProperty("display")?fe.display:null;j.style.display=se==null||typeof se=="boolean"?"":(""+se).trim()}}catch(Ae){mt(X,X.return,Ae)}}}else if(i.tag===6){if(s===null){X=i;try{X.stateNode.nodeValue=_?"":X.memoizedProps}catch(Ae){mt(X,X.return,Ae)}}}else if(i.tag===18){if(s===null){X=i;try{var le=X.stateNode;_?f0(le,!0):f0(X.stateNode,!1)}catch(Ae){mt(X,X.return,Ae)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===t)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;s===i&&(s=null),i=i.return}s===i&&(s=null),i.sibling.return=i.return,i=i.sibling}o&4&&(o=t.updateQueue,o!==null&&(s=o.retryQueue,s!==null&&(o.retryQueue=null,Dc(t,s))));break;case 19:Kn(i,t),Vn(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,Dc(t,o)));break;case 30:break;case 21:break;default:Kn(i,t),Vn(t)}}function Vn(t){var i=t.flags;if(i&2){try{for(var s,o=t.return;o!==null;){if(gv(o)){s=o;break}o=o.return}if(s==null)throw Error(a(160));switch(s.tag){case 27:var _=s.stateNode,w=Ld(t);Mc(t,w,_);break;case 5:var D=s.stateNode;s.flags&32&&(He(D,""),s.flags&=-33);var j=Ld(t);Mc(t,j,D);break;case 3:case 4:var X=s.stateNode.containerInfo,re=Ld(t);Md(t,re,X);break;default:throw Error(a(161))}}catch(ue){mt(t,t.return,ue)}t.flags&=-3}i&4096&&(t.flags&=-4097)}function xv(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var i=t;xv(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),t=t.sibling}}function Cr(t,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)vv(t,i.alternate,i),i=i.sibling}function zs(t){for(t=t.child;t!==null;){var i=t;switch(i.tag){case 0:case 11:case 14:case 15:Jr(4,i,i.return),zs(i);break;case 1:Yi(i,i.return);var s=i.stateNode;typeof s.componentWillUnmount=="function"&&fv(i,i.return,s),zs(i);break;case 27:el(i.stateNode);case 26:case 5:Yi(i,i.return),zs(i);break;case 22:i.memoizedState===null&&zs(i);break;case 30:zs(i);break;default:zs(i)}t=t.sibling}}function xr(t,i,s){for(s=s&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var o=i.alternate,_=t,w=i,D=w.flags;switch(w.tag){case 0:case 11:case 15:xr(_,w,s),qo(4,w);break;case 1:if(xr(_,w,s),o=w,_=o.stateNode,typeof _.componentDidMount=="function")try{_.componentDidMount()}catch(re){mt(o,o.return,re)}if(o=w,_=o.updateQueue,_!==null){var j=o.stateNode;try{var X=_.shared.hiddenCallbacks;if(X!==null)for(_.shared.hiddenCallbacks=null,_=0;_<X.length;_++)t_(X[_],j)}catch(re){mt(o,o.return,re)}}s&&D&64&&dv(w),Wo(w,w.return);break;case 27:mv(w);case 26:case 5:xr(_,w,s),s&&o===null&&D&4&&pv(w),Wo(w,w.return);break;case 12:xr(_,w,s);break;case 31:xr(_,w,s),s&&D&4&&Sv(_,w);break;case 13:xr(_,w,s),s&&D&4&&wv(_,w);break;case 22:w.memoizedState===null&&xr(_,w,s),Wo(w,w.return);break;case 30:break;default:xr(_,w,s)}i=i.sibling}}function Od(t,i){var s=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),t=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(t=i.memoizedState.cachePool.pool),t!==s&&(t!=null&&t.refCount++,s!=null&&Mo(s))}function Nd(t,i){t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&Mo(t))}function ji(t,i,s,o){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Ev(t,i,s,o),i=i.sibling}function Ev(t,i,s,o){var _=i.flags;switch(i.tag){case 0:case 11:case 15:ji(t,i,s,o),_&2048&&qo(9,i);break;case 1:ji(t,i,s,o);break;case 3:ji(t,i,s,o),_&2048&&(t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&Mo(t)));break;case 12:if(_&2048){ji(t,i,s,o),t=i.stateNode;try{var w=i.memoizedProps,D=w.id,j=w.onPostCommit;typeof j=="function"&&j(D,i.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(X){mt(i,i.return,X)}}else ji(t,i,s,o);break;case 31:ji(t,i,s,o);break;case 13:ji(t,i,s,o);break;case 23:break;case 22:w=i.stateNode,D=i.alternate,i.memoizedState!==null?w._visibility&2?ji(t,i,s,o):Go(t,i):w._visibility&2?ji(t,i,s,o):(w._visibility|=2,Aa(t,i,s,o,(i.subtreeFlags&10256)!==0||!1)),_&2048&&Od(D,i);break;case 24:ji(t,i,s,o),_&2048&&Nd(i.alternate,i);break;default:ji(t,i,s,o)}}function Aa(t,i,s,o,_){for(_=_&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var w=t,D=i,j=s,X=o,re=D.flags;switch(D.tag){case 0:case 11:case 15:Aa(w,D,j,X,_),qo(8,D);break;case 23:break;case 22:var ue=D.stateNode;D.memoizedState!==null?ue._visibility&2?Aa(w,D,j,X,_):Go(w,D):(ue._visibility|=2,Aa(w,D,j,X,_)),_&&re&2048&&Od(D.alternate,D);break;case 24:Aa(w,D,j,X,_),_&&re&2048&&Nd(D.alternate,D);break;default:Aa(w,D,j,X,_)}i=i.sibling}}function Go(t,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var s=t,o=i,_=o.flags;switch(o.tag){case 22:Go(s,o),_&2048&&Od(o.alternate,o);break;case 24:Go(s,o),_&2048&&Nd(o.alternate,o);break;default:Go(s,o)}i=i.sibling}}var Ko=8192;function ka(t,i,s){if(t.subtreeFlags&Ko)for(t=t.child;t!==null;)Tv(t,i,s),t=t.sibling}function Tv(t,i,s){switch(t.tag){case 26:ka(t,i,s),t.flags&Ko&&t.memoizedState!==null&&J2(s,Ii,t.memoizedState,t.memoizedProps);break;case 5:ka(t,i,s);break;case 3:case 4:var o=Ii;Ii=Gc(t.stateNode.containerInfo),ka(t,i,s),Ii=o;break;case 22:t.memoizedState===null&&(o=t.alternate,o!==null&&o.memoizedState!==null?(o=Ko,Ko=16777216,ka(t,i,s),Ko=o):ka(t,i,s));break;default:ka(t,i,s)}}function Av(t){var i=t.alternate;if(i!==null&&(t=i.child,t!==null)){i.child=null;do i=t.sibling,t.sibling=null,t=i;while(t!==null)}}function Vo(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var o=i[s];pn=o,Rv(o,t)}Av(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)kv(t),t=t.sibling}function kv(t){switch(t.tag){case 0:case 11:case 15:Vo(t),t.flags&2048&&Jr(9,t,t.return);break;case 3:Vo(t);break;case 12:Vo(t);break;case 22:var i=t.stateNode;t.memoizedState!==null&&i._visibility&2&&(t.return===null||t.return.tag!==13)?(i._visibility&=-3,Oc(t)):Vo(t);break;default:Vo(t)}}function Oc(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var o=i[s];pn=o,Rv(o,t)}Av(t)}for(t=t.child;t!==null;){switch(i=t,i.tag){case 0:case 11:case 15:Jr(8,i,i.return),Oc(i);break;case 22:s=i.stateNode,s._visibility&2&&(s._visibility&=-3,Oc(i));break;default:Oc(i)}t=t.sibling}}function Rv(t,i){for(;pn!==null;){var s=pn;switch(s.tag){case 0:case 11:case 15:Jr(8,s,i);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var o=s.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:Mo(s.memoizedState.cache)}if(o=s.child,o!==null)o.return=s,pn=o;else e:for(s=t;pn!==null;){o=pn;var _=o.sibling,w=o.return;if(bv(o),o===s){pn=null;break e}if(_!==null){_.return=w,pn=_;break e}pn=w}}}var f2={getCacheForType:function(t){var i=xn(an),s=i.data.get(t);return s===void 0&&(s=t(),i.data.set(t,s)),s},cacheSignal:function(){return xn(an).controller.signal}},p2=typeof WeakMap=="function"?WeakMap:Map,ht=0,Ct=null,Je=null,nt=0,gt=0,ci=null,Qr=!1,Ra=!1,Bd=!1,Er=0,qt=0,es=0,Ps=0,Id=0,ui=0,La=0,Yo=null,Yn=null,jd=!1,Nc=0,Lv=0,Bc=1/0,Ic=null,ts=null,fn=0,ns=null,Ma=null,Tr=0,$d=0,zd=null,Mv=null,Xo=0,Pd=null;function hi(){return(ht&2)!==0&&nt!==0?nt&-nt:q.T!==null?Gd():lr()}function Dv(){if(ui===0)if((nt&536870912)===0||st){var t=Wi;Wi<<=1,(Wi&3932160)===0&&(Wi=262144),ui=t}else ui=536870912;return t=oi.current,t!==null&&(t.flags|=32),ui}function Xn(t,i,s){(t===Ct&&(gt===2||gt===9)||t.cancelPendingCommit!==null)&&(Da(t,0),is(t,nt,ui,!1)),ft(t,s),((ht&2)===0||t!==Ct)&&(t===Ct&&((ht&2)===0&&(Ps|=s),qt===4&&is(t,nt,ui,!1)),Xi(t))}function Ov(t,i,s){if((ht&6)!==0)throw Error(a(327));var o=!s&&(i&127)===0&&(i&t.expiredLanes)===0||he(t,i),_=o?_2(t,i):Ud(t,i,!0),w=o;do{if(_===0){Ra&&!o&&is(t,i,0,!1);break}else{if(s=t.current.alternate,w&&!g2(s)){_=Ud(t,i,!1),w=!1;continue}if(_===2){if(w=i,t.errorRecoveryDisabledLanes&w)var D=0;else D=t.pendingLanes&-536870913,D=D!==0?D:D&536870912?536870912:0;if(D!==0){i=D;e:{var j=t;_=Yo;var X=j.current.memoizedState.isDehydrated;if(X&&(Da(j,D).flags|=256),D=Ud(j,D,!1),D!==2){if(Bd&&!X){j.errorRecoveryDisabledLanes|=w,Ps|=w,_=4;break e}w=Yn,Yn=_,w!==null&&(Yn===null?Yn=w:Yn.push.apply(Yn,w))}_=D}if(w=!1,_!==2)continue}}if(_===1){Da(t,0),is(t,i,0,!0);break}e:{switch(o=t,w=_,w){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:is(o,i,ui,!Qr);break e;case 2:Yn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(_=Nc+300-ut(),10<_)){if(is(o,i,ui,!Qr),J(o,0,!0)!==0)break e;Tr=i,o.timeoutHandle=u0(Nv.bind(null,o,s,Yn,Ic,jd,i,ui,Ps,La,Qr,w,"Throttled",-0,0),_);break e}Nv(o,s,Yn,Ic,jd,i,ui,Ps,La,Qr,w,null,-0,0)}}break}while(!0);Xi(t)}function Nv(t,i,s,o,_,w,D,j,X,re,ue,fe,se,le){if(t.timeoutHandle=-1,fe=i.subtreeFlags,fe&8192||(fe&16785408)===16785408){fe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:we},Tv(i,w,fe);var Ae=(w&62914560)===w?Nc-ut():(w&4194048)===w?Lv-ut():0;if(Ae=Q2(fe,Ae),Ae!==null){Tr=w,t.cancelPendingCommit=Ae(Uv.bind(null,t,i,w,s,o,_,D,j,X,ue,fe,null,se,le)),is(t,w,D,!re);return}}Uv(t,i,w,s,o,_,D,j,X)}function g2(t){for(var i=t;;){var s=i.tag;if((s===0||s===11||s===15)&&i.flags&16384&&(s=i.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var o=0;o<s.length;o++){var _=s[o],w=_.getSnapshot;_=_.value;try{if(!si(w(),_))return!1}catch{return!1}}if(s=i.child,i.subtreeFlags&16384&&s!==null)s.return=i,i=s;else{if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function is(t,i,s,o){i&=~Id,i&=~Ps,t.suspendedLanes|=i,t.pingedLanes&=~i,o&&(t.warmLanes|=i),o=t.expirationTimes;for(var _=i;0<_;){var w=31-Pt(_),D=1<<w;o[w]=-1,_&=~D}s!==0&&Ce(t,s,i)}function jc(){return(ht&6)===0?(Zo(0),!1):!0}function Hd(){if(Je!==null){if(gt===0)var t=Je.return;else t=Je,gr=Ms=null,id(t),wa=null,Oo=0,t=Je;for(;t!==null;)hv(t.alternate,t),t=t.return;Je=null}}function Da(t,i){var s=t.timeoutHandle;s!==-1&&(t.timeoutHandle=-1,B2(s)),s=t.cancelPendingCommit,s!==null&&(t.cancelPendingCommit=null,s()),Tr=0,Hd(),Ct=t,Je=s=fr(t.current,null),nt=i,gt=0,ci=null,Qr=!1,Ra=he(t,i),Bd=!1,La=ui=Id=Ps=es=qt=0,Yn=Yo=null,jd=!1,(i&8)!==0&&(i|=i&32);var o=t.entangledLanes;if(o!==0)for(t=t.entanglements,o&=i;0<o;){var _=31-Pt(o),w=1<<_;i|=t[_],o&=~w}return Er=i,rc(),s}function Bv(t,i){Ge=null,q.H=Ho,i===Sa||i===dc?(i=Zm(),gt=3):i===Wh?(i=Zm(),gt=4):gt=i===bd?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,ci=i,Je===null&&(qt=1,Tc(t,_i(i,t.current)))}function Iv(){var t=oi.current;return t===null?!0:(nt&4194048)===nt?Si===null:(nt&62914560)===nt||(nt&536870912)!==0?t===Si:!1}function jv(){var t=q.H;return q.H=Ho,t===null?Ho:t}function $v(){var t=q.A;return q.A=f2,t}function $c(){qt=4,Qr||(nt&4194048)!==nt&&oi.current!==null||(Ra=!0),(es&134217727)===0&&(Ps&134217727)===0||Ct===null||is(Ct,nt,ui,!1)}function Ud(t,i,s){var o=ht;ht|=2;var _=jv(),w=$v();(Ct!==t||nt!==i)&&(Ic=null,Da(t,i)),i=!1;var D=qt;e:do try{if(gt!==0&&Je!==null){var j=Je,X=ci;switch(gt){case 8:Hd(),D=6;break e;case 3:case 2:case 9:case 6:oi.current===null&&(i=!0);var re=gt;if(gt=0,ci=null,Oa(t,j,X,re),s&&Ra){D=0;break e}break;default:re=gt,gt=0,ci=null,Oa(t,j,X,re)}}m2(),D=qt;break}catch(ue){Bv(t,ue)}while(!0);return i&&t.shellSuspendCounter++,gr=Ms=null,ht=o,q.H=_,q.A=w,Je===null&&(Ct=null,nt=0,rc()),D}function m2(){for(;Je!==null;)zv(Je)}function _2(t,i){var s=ht;ht|=2;var o=jv(),_=$v();Ct!==t||nt!==i?(Ic=null,Bc=ut()+500,Da(t,i)):Ra=he(t,i);e:do try{if(gt!==0&&Je!==null){i=Je;var w=ci;t:switch(gt){case 1:gt=0,ci=null,Oa(t,i,w,1);break;case 2:case 9:if(Ym(w)){gt=0,ci=null,Pv(i);break}i=function(){gt!==2&&gt!==9||Ct!==t||(gt=7),Xi(t)},w.then(i,i);break e;case 3:gt=7;break e;case 4:gt=5;break e;case 7:Ym(w)?(gt=0,ci=null,Pv(i)):(gt=0,ci=null,Oa(t,i,w,7));break;case 5:var D=null;switch(Je.tag){case 26:D=Je.memoizedState;case 5:case 27:var j=Je;if(D?E0(D):j.stateNode.complete){gt=0,ci=null;var X=j.sibling;if(X!==null)Je=X;else{var re=j.return;re!==null?(Je=re,zc(re)):Je=null}break t}}gt=0,ci=null,Oa(t,i,w,5);break;case 6:gt=0,ci=null,Oa(t,i,w,6);break;case 8:Hd(),qt=6;break e;default:throw Error(a(462))}}v2();break}catch(ue){Bv(t,ue)}while(!0);return gr=Ms=null,q.H=o,q.A=_,ht=s,Je!==null?0:(Ct=null,nt=0,rc(),qt)}function v2(){for(;Je!==null&&!Mi();)zv(Je)}function zv(t){var i=cv(t.alternate,t,Er);t.memoizedProps=t.pendingProps,i===null?zc(t):Je=i}function Pv(t){var i=t,s=i.alternate;switch(i.tag){case 15:case 0:i=iv(s,i,i.pendingProps,i.type,void 0,nt);break;case 11:i=iv(s,i,i.pendingProps,i.type.render,i.ref,nt);break;case 5:id(i);default:hv(s,i),i=Je=$m(i,Er),i=cv(s,i,Er)}t.memoizedProps=t.pendingProps,i===null?zc(t):Je=i}function Oa(t,i,s,o){gr=Ms=null,id(i),wa=null,Oo=0;var _=i.return;try{if(a2(t,_,i,s,nt)){qt=1,Tc(t,_i(s,t.current)),Je=null;return}}catch(w){if(_!==null)throw Je=_,w;qt=1,Tc(t,_i(s,t.current)),Je=null;return}i.flags&32768?(st||o===1?t=!0:Ra||(nt&536870912)!==0?t=!1:(Qr=t=!0,(o===2||o===9||o===3||o===6)&&(o=oi.current,o!==null&&o.tag===13&&(o.flags|=16384))),Hv(i,t)):zc(i)}function zc(t){var i=t;do{if((i.flags&32768)!==0){Hv(i,Qr);return}t=i.return;var s=c2(i.alternate,i,Er);if(s!==null){Je=s;return}if(i=i.sibling,i!==null){Je=i;return}Je=i=t}while(i!==null);qt===0&&(qt=5)}function Hv(t,i){do{var s=u2(t.alternate,t);if(s!==null){s.flags&=32767,Je=s;return}if(s=t.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!i&&(t=t.sibling,t!==null)){Je=t;return}Je=t=s}while(t!==null);qt=6,Je=null}function Uv(t,i,s,o,_,w,D,j,X){t.cancelPendingCommit=null;do Pc();while(fn!==0);if((ht&6)!==0)throw Error(a(327));if(i!==null){if(i===t.current)throw Error(a(177));if(w=i.lanes|i.childLanes,w|=Lh,Te(t,s,w,D,j,X),t===Ct&&(Je=Ct=null,nt=0),Ma=i,ns=t,Tr=s,$d=w,zd=_,Mv=o,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,w2(nn,function(){return Kv(),null})):(t.callbackNode=null,t.callbackPriority=0),o=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||o){o=q.T,q.T=null,_=W.p,W.p=2,D=ht,ht|=4;try{h2(t,i,s)}finally{ht=D,W.p=_,q.T=o}}fn=1,Fv(),qv(),Wv()}}function Fv(){if(fn===1){fn=0;var t=ns,i=Ma,s=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||s){s=q.T,q.T=null;var o=W.p;W.p=2;var _=ht;ht|=4;try{Cv(i,t);var w=ef,D=Rm(t.containerInfo),j=w.focusedElem,X=w.selectionRange;if(D!==j&&j&&j.ownerDocument&&km(j.ownerDocument.documentElement,j)){if(X!==null&&Eh(j)){var re=X.start,ue=X.end;if(ue===void 0&&(ue=re),"selectionStart"in j)j.selectionStart=re,j.selectionEnd=Math.min(ue,j.value.length);else{var fe=j.ownerDocument||document,se=fe&&fe.defaultView||window;if(se.getSelection){var le=se.getSelection(),Ae=j.textContent.length,$e=Math.min(X.start,Ae),yt=X.end===void 0?$e:Math.min(X.end,Ae);!le.extend&&$e>yt&&(D=yt,yt=$e,$e=D);var ne=Am(j,$e),ee=Am(j,yt);if(ne&&ee&&(le.rangeCount!==1||le.anchorNode!==ne.node||le.anchorOffset!==ne.offset||le.focusNode!==ee.node||le.focusOffset!==ee.offset)){var ie=fe.createRange();ie.setStart(ne.node,ne.offset),le.removeAllRanges(),$e>yt?(le.addRange(ie),le.extend(ee.node,ee.offset)):(ie.setEnd(ee.node,ee.offset),le.addRange(ie))}}}}for(fe=[],le=j;le=le.parentNode;)le.nodeType===1&&fe.push({element:le,left:le.scrollLeft,top:le.scrollTop});for(typeof j.focus=="function"&&j.focus(),j=0;j<fe.length;j++){var de=fe[j];de.element.scrollLeft=de.left,de.element.scrollTop=de.top}}Jc=!!Qd,ef=Qd=null}finally{ht=_,W.p=o,q.T=s}}t.current=i,fn=2}}function qv(){if(fn===2){fn=0;var t=ns,i=Ma,s=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||s){s=q.T,q.T=null;var o=W.p;W.p=2;var _=ht;ht|=4;try{vv(t,i.alternate,i)}finally{ht=_,W.p=o,q.T=s}}fn=3}}function Wv(){if(fn===4||fn===3){fn=0,tn();var t=ns,i=Ma,s=Tr,o=Mv;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?fn=5:(fn=0,Ma=ns=null,Gv(t,t.pendingLanes));var _=t.pendingLanes;if(_===0&&(ts=null),Sn(s),i=i.stateNode,Yt&&typeof Yt.onCommitFiberRoot=="function")try{Yt.onCommitFiberRoot(Hn,i,void 0,(i.current.flags&128)===128)}catch{}if(o!==null){i=q.T,_=W.p,W.p=2,q.T=null;try{for(var w=t.onRecoverableError,D=0;D<o.length;D++){var j=o[D];w(j.value,{componentStack:j.stack})}}finally{q.T=i,W.p=_}}(Tr&3)!==0&&Pc(),Xi(t),_=t.pendingLanes,(s&261930)!==0&&(_&42)!==0?t===Pd?Xo++:(Xo=0,Pd=t):Xo=0,Zo(0)}}function Gv(t,i){(t.pooledCacheLanes&=i)===0&&(i=t.pooledCache,i!=null&&(t.pooledCache=null,Mo(i)))}function Pc(){return Fv(),qv(),Wv(),Kv()}function Kv(){if(fn!==5)return!1;var t=ns,i=$d;$d=0;var s=Sn(Tr),o=q.T,_=W.p;try{W.p=32>s?32:s,q.T=null,s=zd,zd=null;var w=ns,D=Tr;if(fn=0,Ma=ns=null,Tr=0,(ht&6)!==0)throw Error(a(331));var j=ht;if(ht|=4,kv(w.current),Ev(w,w.current,D,s),ht=j,Zo(0,!1),Yt&&typeof Yt.onPostCommitFiberRoot=="function")try{Yt.onPostCommitFiberRoot(Hn,w)}catch{}return!0}finally{W.p=_,q.T=o,Gv(t,i)}}function Vv(t,i,s){i=_i(s,i),i=vd(t.stateNode,i,2),t=Yr(t,i,2),t!==null&&(ft(t,2),Xi(t))}function mt(t,i,s){if(t.tag===3)Vv(t,t,s);else for(;i!==null;){if(i.tag===3){Vv(i,t,s);break}else if(i.tag===1){var o=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(ts===null||!ts.has(o))){t=_i(s,t),s=Y_(2),o=Yr(i,s,2),o!==null&&(X_(s,o,i,t),ft(o,2),Xi(o));break}}i=i.return}}function Fd(t,i,s){var o=t.pingCache;if(o===null){o=t.pingCache=new p2;var _=new Set;o.set(i,_)}else _=o.get(i),_===void 0&&(_=new Set,o.set(i,_));_.has(s)||(Bd=!0,_.add(s),t=b2.bind(null,t,i,s),i.then(t,t))}function b2(t,i,s){var o=t.pingCache;o!==null&&o.delete(i),t.pingedLanes|=t.suspendedLanes&s,t.warmLanes&=~s,Ct===t&&(nt&s)===s&&(qt===4||qt===3&&(nt&62914560)===nt&&300>ut()-Nc?(ht&2)===0&&Da(t,0):Id|=s,La===nt&&(La=0)),Xi(t)}function Yv(t,i){i===0&&(i=Ie()),t=ks(t,i),t!==null&&(ft(t,i),Xi(t))}function y2(t){var i=t.memoizedState,s=0;i!==null&&(s=i.retryLane),Yv(t,s)}function S2(t,i){var s=0;switch(t.tag){case 31:case 13:var o=t.stateNode,_=t.memoizedState;_!==null&&(s=_.retryLane);break;case 19:o=t.stateNode;break;case 22:o=t.stateNode._retryCache;break;default:throw Error(a(314))}o!==null&&o.delete(i),Yv(t,s)}function w2(t,i){return yn(t,i)}var Hc=null,Na=null,qd=!1,Uc=!1,Wd=!1,rs=0;function Xi(t){t!==Na&&t.next===null&&(Na===null?Hc=Na=t:Na=Na.next=t),Uc=!0,qd||(qd=!0,x2())}function Zo(t,i){if(!Wd&&Uc){Wd=!0;do for(var s=!1,o=Hc;o!==null;){if(t!==0){var _=o.pendingLanes;if(_===0)var w=0;else{var D=o.suspendedLanes,j=o.pingedLanes;w=(1<<31-Pt(42|t)+1)-1,w&=_&~(D&~j),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(s=!0,Qv(o,w))}else w=nt,w=J(o,o===Ct?w:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(w&3)===0||he(o,w)||(s=!0,Qv(o,w));o=o.next}while(s);Wd=!1}}function C2(){Xv()}function Xv(){Uc=qd=!1;var t=0;rs!==0&&N2()&&(t=rs);for(var i=ut(),s=null,o=Hc;o!==null;){var _=o.next,w=Zv(o,i);w===0?(o.next=null,s===null?Hc=_:s.next=_,_===null&&(Na=s)):(s=o,(t!==0||(w&3)!==0)&&(Uc=!0)),o=_}fn!==0&&fn!==5||Zo(t),rs!==0&&(rs=0)}function Zv(t,i){for(var s=t.suspendedLanes,o=t.pingedLanes,_=t.expirationTimes,w=t.pendingLanes&-62914561;0<w;){var D=31-Pt(w),j=1<<D,X=_[D];X===-1?((j&s)===0||(j&o)!==0)&&(_[D]=be(j,i)):X<=i&&(t.expiredLanes|=j),w&=~j}if(i=Ct,s=nt,s=J(t,t===i?s:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o=t.callbackNode,s===0||t===i&&(gt===2||gt===9)||t.cancelPendingCommit!==null)return o!==null&&o!==null&&pi(o),t.callbackNode=null,t.callbackPriority=0;if((s&3)===0||he(t,s)){if(i=s&-s,i===t.callbackPriority)return i;switch(o!==null&&pi(o),Sn(s)){case 2:case 8:s=zt;break;case 32:s=nn;break;case 268435456:s=Mn;break;default:s=nn}return o=Jv.bind(null,t),s=yn(s,o),t.callbackPriority=i,t.callbackNode=s,i}return o!==null&&o!==null&&pi(o),t.callbackPriority=2,t.callbackNode=null,2}function Jv(t,i){if(fn!==0&&fn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var s=t.callbackNode;if(Pc()&&t.callbackNode!==s)return null;var o=nt;return o=J(t,t===Ct?o:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o===0?null:(Ov(t,o,i),Zv(t,ut()),t.callbackNode!=null&&t.callbackNode===s?Jv.bind(null,t):null)}function Qv(t,i){if(Pc())return null;Ov(t,i,!0)}function x2(){I2(function(){(ht&6)!==0?yn($t,C2):Xv()})}function Gd(){if(rs===0){var t=ba;t===0&&(t=Oi,Oi<<=1,(Oi&261888)===0&&(Oi=256)),rs=t}return rs}function e0(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Hr(""+t)}function t0(t,i){var s=i.ownerDocument.createElement("input");return s.name=i.name,s.value=i.value,t.id&&s.setAttribute("form",t.id),i.parentNode.insertBefore(s,i),t=new FormData(t),s.parentNode.removeChild(s),t}function E2(t,i,s,o,_){if(i==="submit"&&s&&s.stateNode===_){var w=e0((_[Et]||null).action),D=o.submitter;D&&(i=(i=D[Et]||null)?e0(i.formAction):D.getAttribute("formAction"),i!==null&&(w=i,D=null));var j=new ec("action","action",null,o,_);t.push({event:j,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(rs!==0){var X=D?t0(_,D):new FormData(_);dd(s,{pending:!0,data:X,method:_.method,action:w},null,X)}}else typeof w=="function"&&(j.preventDefault(),X=D?t0(_,D):new FormData(_),dd(s,{pending:!0,data:X,method:_.method,action:w},w,X))},currentTarget:_}]})}}for(var Kd=0;Kd<Rh.length;Kd++){var Vd=Rh[Kd],T2=Vd.toLowerCase(),A2=Vd[0].toUpperCase()+Vd.slice(1);Bi(T2,"on"+A2)}Bi(Dm,"onAnimationEnd"),Bi(Om,"onAnimationIteration"),Bi(Nm,"onAnimationStart"),Bi("dblclick","onDoubleClick"),Bi("focusin","onFocus"),Bi("focusout","onBlur"),Bi(Fx,"onTransitionRun"),Bi(qx,"onTransitionStart"),Bi(Wx,"onTransitionCancel"),Bi(Bm,"onTransitionEnd"),me("onMouseEnter",["mouseout","mouseover"]),me("onMouseLeave",["mouseout","mouseover"]),me("onPointerEnter",["pointerout","pointerover"]),me("onPointerLeave",["pointerout","pointerover"]),Ut("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ut("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ut("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ut("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ut("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ut("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Jo="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(" "),k2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Jo));function n0(t,i){i=(i&4)!==0;for(var s=0;s<t.length;s++){var o=t[s],_=o.event;o=o.listeners;e:{var w=void 0;if(i)for(var D=o.length-1;0<=D;D--){var j=o[D],X=j.instance,re=j.currentTarget;if(j=j.listener,X!==w&&_.isPropagationStopped())break e;w=j,_.currentTarget=re;try{w(_)}catch(ue){ic(ue)}_.currentTarget=null,w=X}else for(D=0;D<o.length;D++){if(j=o[D],X=j.instance,re=j.currentTarget,j=j.listener,X!==w&&_.isPropagationStopped())break e;w=j,_.currentTarget=re;try{w(_)}catch(ue){ic(ue)}_.currentTarget=null,w=X}}}}function Qe(t,i){var s=i[zr];s===void 0&&(s=i[zr]=new Set);var o=t+"__bubble";s.has(o)||(i0(i,t,2,!1),s.add(o))}function Yd(t,i,s){var o=0;i&&(o|=4),i0(s,t,o,i)}var Fc="_reactListening"+Math.random().toString(36).slice(2);function Xd(t){if(!t[Fc]){t[Fc]=!0,kt.forEach(function(s){s!=="selectionchange"&&(k2.has(s)||Yd(s,!1,t),Yd(s,!0,t))});var i=t.nodeType===9?t:t.ownerDocument;i===null||i[Fc]||(i[Fc]=!0,Yd("selectionchange",!1,i))}}function i0(t,i,s,o){switch(D0(i)){case 2:var _=nE;break;case 8:_=iE;break;default:_=df}s=_.bind(null,i,s,t),_=void 0,!mh||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(_=!0),o?_!==void 0?t.addEventListener(i,s,{capture:!0,passive:_}):t.addEventListener(i,s,!0):_!==void 0?t.addEventListener(i,s,{passive:_}):t.addEventListener(i,s,!1)}function Zd(t,i,s,o,_){var w=o;if((i&1)===0&&(i&2)===0&&o!==null)e:for(;;){if(o===null)return;var D=o.tag;if(D===3||D===4){var j=o.stateNode.containerInfo;if(j===_)break;if(D===4)for(D=o.return;D!==null;){var X=D.tag;if((X===3||X===4)&&D.stateNode.containerInfo===_)return;D=D.return}for(;j!==null;){if(D=V(j),D===null)return;if(X=D.tag,X===5||X===6||X===26||X===27){o=w=D;continue e}j=j.parentNode}}o=o.return}Xl(function(){var re=w,ue=We(s),fe=[];e:{var se=Im.get(t);if(se!==void 0){var le=ec,Ae=t;switch(t){case"keypress":if(Jl(s)===0)break e;case"keydown":case"keyup":le=Sx;break;case"focusin":Ae="focus",le=yh;break;case"focusout":Ae="blur",le=yh;break;case"beforeblur":case"afterblur":le=yh;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":le=hm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":le=cx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":le=xx;break;case Dm:case Om:case Nm:le=dx;break;case Bm:le=Tx;break;case"scroll":case"scrollend":le=ox;break;case"wheel":le=kx;break;case"copy":case"cut":case"paste":le=px;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":le=fm;break;case"toggle":case"beforetoggle":le=Lx}var $e=(i&4)!==0,yt=!$e&&(t==="scroll"||t==="scrollend"),ne=$e?se!==null?se+"Capture":null:se;$e=[];for(var ee=re,ie;ee!==null;){var de=ee;if(ie=de.stateNode,de=de.tag,de!==5&&de!==26&&de!==27||ie===null||ne===null||(de=yo(ee,ne),de!=null&&$e.push(Qo(ee,de,ie))),yt)break;ee=ee.return}0<$e.length&&(se=new le(se,Ae,null,s,ue),fe.push({event:se,listeners:$e}))}}if((i&7)===0){e:{if(se=t==="mouseover"||t==="pointerover",le=t==="mouseout"||t==="pointerout",se&&s!==Re&&(Ae=s.relatedTarget||s.fromElement)&&(V(Ae)||Ae[Ni]))break e;if((le||se)&&(se=ue.window===ue?ue:(se=ue.ownerDocument)?se.defaultView||se.parentWindow:window,le?(Ae=s.relatedTarget||s.toElement,le=re,Ae=Ae?V(Ae):null,Ae!==null&&(yt=p(Ae),$e=Ae.tag,Ae!==yt||$e!==5&&$e!==27&&$e!==6)&&(Ae=null)):(le=null,Ae=re),le!==Ae)){if($e=hm,de="onMouseLeave",ne="onMouseEnter",ee="mouse",(t==="pointerout"||t==="pointerover")&&($e=fm,de="onPointerLeave",ne="onPointerEnter",ee="pointer"),yt=le==null?se:xe(le),ie=Ae==null?se:xe(Ae),se=new $e(de,ee+"leave",le,s,ue),se.target=yt,se.relatedTarget=ie,de=null,V(ue)===re&&($e=new $e(ne,ee+"enter",Ae,s,ue),$e.target=ie,$e.relatedTarget=yt,de=$e),yt=de,le&&Ae)t:{for($e=R2,ne=le,ee=Ae,ie=0,de=ne;de;de=$e(de))ie++;de=0;for(var Be=ee;Be;Be=$e(Be))de++;for(;0<ie-de;)ne=$e(ne),ie--;for(;0<de-ie;)ee=$e(ee),de--;for(;ie--;){if(ne===ee||ee!==null&&ne===ee.alternate){$e=ne;break t}ne=$e(ne),ee=$e(ee)}$e=null}else $e=null;le!==null&&r0(fe,se,le,$e,!1),Ae!==null&&yt!==null&&r0(fe,yt,Ae,$e,!0)}}e:{if(se=re?xe(re):window,le=se.nodeName&&se.nodeName.toLowerCase(),le==="select"||le==="input"&&se.type==="file")var ot=Sm;else if(bm(se))if(wm)ot=Px;else{ot=$x;var Le=jx}else le=se.nodeName,!le||le.toLowerCase()!=="input"||se.type!=="checkbox"&&se.type!=="radio"?re&&Pr(re.elementType)&&(ot=Sm):ot=zx;if(ot&&(ot=ot(t,re))){ym(fe,ot,s,ue);break e}Le&&Le(t,se,re),t==="focusout"&&re&&se.type==="number"&&re.memoizedProps.value!=null&&la(se,"number",se.value)}switch(Le=re?xe(re):window,t){case"focusin":(bm(Le)||Le.contentEditable==="true")&&(ha=Le,Th=re,ko=null);break;case"focusout":ko=Th=ha=null;break;case"mousedown":Ah=!0;break;case"contextmenu":case"mouseup":case"dragend":Ah=!1,Lm(fe,s,ue);break;case"selectionchange":if(Ux)break;case"keydown":case"keyup":Lm(fe,s,ue)}var Ke;if(wh)e:{switch(t){case"compositionstart":var it="onCompositionStart";break e;case"compositionend":it="onCompositionEnd";break e;case"compositionupdate":it="onCompositionUpdate";break e}it=void 0}else ua?_m(t,s)&&(it="onCompositionEnd"):t==="keydown"&&s.keyCode===229&&(it="onCompositionStart");it&&(pm&&s.locale!=="ko"&&(ua||it!=="onCompositionStart"?it==="onCompositionEnd"&&ua&&(Ke=cm()):(Ur=ue,_h="value"in Ur?Ur.value:Ur.textContent,ua=!0)),Le=qc(re,it),0<Le.length&&(it=new dm(it,t,null,s,ue),fe.push({event:it,listeners:Le}),Ke?it.data=Ke:(Ke=vm(s),Ke!==null&&(it.data=Ke)))),(Ke=Dx?Ox(t,s):Nx(t,s))&&(it=qc(re,"onBeforeInput"),0<it.length&&(Le=new dm("onBeforeInput","beforeinput",null,s,ue),fe.push({event:Le,listeners:it}),Le.data=Ke)),E2(fe,t,re,s,ue)}n0(fe,i)})}function Qo(t,i,s){return{instance:t,listener:i,currentTarget:s}}function qc(t,i){for(var s=i+"Capture",o=[];t!==null;){var _=t,w=_.stateNode;if(_=_.tag,_!==5&&_!==26&&_!==27||w===null||(_=yo(t,s),_!=null&&o.unshift(Qo(t,_,w)),_=yo(t,i),_!=null&&o.push(Qo(t,_,w))),t.tag===3)return o;t=t.return}return[]}function R2(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function r0(t,i,s,o,_){for(var w=i._reactName,D=[];s!==null&&s!==o;){var j=s,X=j.alternate,re=j.stateNode;if(j=j.tag,X!==null&&X===o)break;j!==5&&j!==26&&j!==27||re===null||(X=re,_?(re=yo(s,w),re!=null&&D.unshift(Qo(s,re,X))):_||(re=yo(s,w),re!=null&&D.push(Qo(s,re,X)))),s=s.return}D.length!==0&&t.push({event:i,listeners:D})}var L2=/\r\n?/g,M2=/\u0000|\uFFFD/g;function s0(t){return(typeof t=="string"?t:""+t).replace(L2,`
9
- `).replace(M2,"")}function a0(t,i){return i=s0(i),s0(t)===i}function bt(t,i,s,o,_,w){switch(s){case"children":typeof o=="string"?i==="body"||i==="textarea"&&o===""||He(t,o):(typeof o=="number"||typeof o=="bigint")&&i!=="body"&&He(t,""+o);break;case"className":ii(t,"class",o);break;case"tabIndex":ii(t,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":ii(t,s,o);break;case"style":pt(t,o,w);break;case"data":if(i!=="object"){ii(t,"data",o);break}case"src":case"href":if(o===""&&(i!=="a"||s!=="href")){t.removeAttribute(s);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(s);break}o=Hr(""+o),t.setAttribute(s,o);break;case"action":case"formAction":if(typeof o=="function"){t.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof w=="function"&&(s==="formAction"?(i!=="input"&&bt(t,i,"name",_.name,_,null),bt(t,i,"formEncType",_.formEncType,_,null),bt(t,i,"formMethod",_.formMethod,_,null),bt(t,i,"formTarget",_.formTarget,_,null)):(bt(t,i,"encType",_.encType,_,null),bt(t,i,"method",_.method,_,null),bt(t,i,"target",_.target,_,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(s);break}o=Hr(""+o),t.setAttribute(s,o);break;case"onClick":o!=null&&(t.onclick=we);break;case"onScroll":o!=null&&Qe("scroll",t);break;case"onScrollEnd":o!=null&&Qe("scrollend",t);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(a(61));if(s=o.__html,s!=null){if(_.children!=null)throw Error(a(60));t.innerHTML=s}}break;case"multiple":t.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":t.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){t.removeAttribute("xlink:href");break}s=Hr(""+o),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(s,""+o):t.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":o&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(s,""):t.removeAttribute(s);break;case"capture":case"download":o===!0?t.setAttribute(s,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(s,o):t.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?t.setAttribute(s,o):t.removeAttribute(s);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?t.removeAttribute(s):t.setAttribute(s,o);break;case"popover":Qe("beforetoggle",t),Qe("toggle",t),Dn(t,"popover",o);break;case"xlinkActuate":Fn(t,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":Fn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":Fn(t,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":Fn(t,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":Fn(t,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":Fn(t,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":Fn(t,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":Fn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":Fn(t,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":Dn(t,"is",o);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=hr.get(s)||s,Dn(t,s,o))}}function Jd(t,i,s,o,_,w){switch(s){case"style":pt(t,o,w);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(a(61));if(s=o.__html,s!=null){if(_.children!=null)throw Error(a(60));t.innerHTML=s}}break;case"children":typeof o=="string"?He(t,o):(typeof o=="number"||typeof o=="bigint")&&He(t,""+o);break;case"onScroll":o!=null&&Qe("scroll",t);break;case"onScrollEnd":o!=null&&Qe("scrollend",t);break;case"onClick":o!=null&&(t.onclick=we);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ht.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(_=s.endsWith("Capture"),i=s.slice(2,_?s.length-7:void 0),w=t[Et]||null,w=w!=null?w[s]:null,typeof w=="function"&&t.removeEventListener(i,w,_),typeof o=="function")){typeof w!="function"&&w!==null&&(s in t?t[s]=null:t.hasAttribute(s)&&t.removeAttribute(s)),t.addEventListener(i,o,_);break e}s in t?t[s]=o:o===!0?t.setAttribute(s,""):Dn(t,s,o)}}}function Tn(t,i,s){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Qe("error",t),Qe("load",t);var o=!1,_=!1,w;for(w in s)if(s.hasOwnProperty(w)){var D=s[w];if(D!=null)switch(w){case"src":o=!0;break;case"srcSet":_=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:bt(t,i,w,D,s,null)}}_&&bt(t,i,"srcSet",s.srcSet,s,null),o&&bt(t,i,"src",s.src,s,null);return;case"input":Qe("invalid",t);var j=w=D=_=null,X=null,re=null;for(o in s)if(s.hasOwnProperty(o)){var ue=s[o];if(ue!=null)switch(o){case"name":_=ue;break;case"type":D=ue;break;case"checked":X=ue;break;case"defaultChecked":re=ue;break;case"value":w=ue;break;case"defaultValue":j=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(a(137,i));break;default:bt(t,i,o,ue,s,null)}}xs(t,w,j,X,re,D,_,!1);return;case"select":Qe("invalid",t),o=D=w=null;for(_ in s)if(s.hasOwnProperty(_)&&(j=s[_],j!=null))switch(_){case"value":w=j;break;case"defaultValue":D=j;break;case"multiple":o=j;default:bt(t,i,_,j,s,null)}i=w,s=D,t.multiple=!!o,i!=null?wn(t,!!o,i,!1):s!=null&&wn(t,!!o,s,!0);return;case"textarea":Qe("invalid",t),w=_=o=null;for(D in s)if(s.hasOwnProperty(D)&&(j=s[D],j!=null))switch(D){case"value":o=j;break;case"defaultValue":_=j;break;case"children":w=j;break;case"dangerouslySetInnerHTML":if(j!=null)throw Error(a(91));break;default:bt(t,i,D,j,s,null)}ca(t,o,_,w);return;case"option":for(X in s)s.hasOwnProperty(X)&&(o=s[X],o!=null)&&(X==="selected"?t.selected=o&&typeof o!="function"&&typeof o!="symbol":bt(t,i,X,o,s,null));return;case"dialog":Qe("beforetoggle",t),Qe("toggle",t),Qe("cancel",t),Qe("close",t);break;case"iframe":case"object":Qe("load",t);break;case"video":case"audio":for(o=0;o<Jo.length;o++)Qe(Jo[o],t);break;case"image":Qe("error",t),Qe("load",t);break;case"details":Qe("toggle",t);break;case"embed":case"source":case"link":Qe("error",t),Qe("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(re in s)if(s.hasOwnProperty(re)&&(o=s[re],o!=null))switch(re){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:bt(t,i,re,o,s,null)}return;default:if(Pr(i)){for(ue in s)s.hasOwnProperty(ue)&&(o=s[ue],o!==void 0&&Jd(t,i,ue,o,s,void 0));return}}for(j in s)s.hasOwnProperty(j)&&(o=s[j],o!=null&&bt(t,i,j,o,s,null))}function D2(t,i,s,o){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var _=null,w=null,D=null,j=null,X=null,re=null,ue=null;for(le in s){var fe=s[le];if(s.hasOwnProperty(le)&&fe!=null)switch(le){case"checked":break;case"value":break;case"defaultValue":X=fe;default:o.hasOwnProperty(le)||bt(t,i,le,null,o,fe)}}for(var se in o){var le=o[se];if(fe=s[se],o.hasOwnProperty(se)&&(le!=null||fe!=null))switch(se){case"type":w=le;break;case"name":_=le;break;case"checked":re=le;break;case"defaultChecked":ue=le;break;case"value":D=le;break;case"defaultValue":j=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(a(137,i));break;default:le!==fe&&bt(t,i,se,le,o,fe)}}_o(t,D,j,X,re,ue,w,_);return;case"select":le=D=j=se=null;for(w in s)if(X=s[w],s.hasOwnProperty(w)&&X!=null)switch(w){case"value":break;case"multiple":le=X;default:o.hasOwnProperty(w)||bt(t,i,w,null,o,X)}for(_ in o)if(w=o[_],X=s[_],o.hasOwnProperty(_)&&(w!=null||X!=null))switch(_){case"value":se=w;break;case"defaultValue":j=w;break;case"multiple":D=w;default:w!==X&&bt(t,i,_,w,o,X)}i=j,s=D,o=le,se!=null?wn(t,!!s,se,!1):!!o!=!!s&&(i!=null?wn(t,!!s,i,!0):wn(t,!!s,s?[]:"",!1));return;case"textarea":le=se=null;for(j in s)if(_=s[j],s.hasOwnProperty(j)&&_!=null&&!o.hasOwnProperty(j))switch(j){case"value":break;case"children":break;default:bt(t,i,j,null,o,_)}for(D in o)if(_=o[D],w=s[D],o.hasOwnProperty(D)&&(_!=null||w!=null))switch(D){case"value":se=_;break;case"defaultValue":le=_;break;case"children":break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(a(91));break;default:_!==w&&bt(t,i,D,_,o,w)}Vl(t,se,le);return;case"option":for(var Ae in s)se=s[Ae],s.hasOwnProperty(Ae)&&se!=null&&!o.hasOwnProperty(Ae)&&(Ae==="selected"?t.selected=!1:bt(t,i,Ae,null,o,se));for(X in o)se=o[X],le=s[X],o.hasOwnProperty(X)&&se!==le&&(se!=null||le!=null)&&(X==="selected"?t.selected=se&&typeof se!="function"&&typeof se!="symbol":bt(t,i,X,se,o,le));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var $e in s)se=s[$e],s.hasOwnProperty($e)&&se!=null&&!o.hasOwnProperty($e)&&bt(t,i,$e,null,o,se);for(re in o)if(se=o[re],le=s[re],o.hasOwnProperty(re)&&se!==le&&(se!=null||le!=null))switch(re){case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(a(137,i));break;default:bt(t,i,re,se,o,le)}return;default:if(Pr(i)){for(var yt in s)se=s[yt],s.hasOwnProperty(yt)&&se!==void 0&&!o.hasOwnProperty(yt)&&Jd(t,i,yt,void 0,o,se);for(ue in o)se=o[ue],le=s[ue],!o.hasOwnProperty(ue)||se===le||se===void 0&&le===void 0||Jd(t,i,ue,se,o,le);return}}for(var ne in s)se=s[ne],s.hasOwnProperty(ne)&&se!=null&&!o.hasOwnProperty(ne)&&bt(t,i,ne,null,o,se);for(fe in o)se=o[fe],le=s[fe],!o.hasOwnProperty(fe)||se===le||se==null&&le==null||bt(t,i,fe,se,o,le)}function o0(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function O2(){if(typeof performance.getEntriesByType=="function"){for(var t=0,i=0,s=performance.getEntriesByType("resource"),o=0;o<s.length;o++){var _=s[o],w=_.transferSize,D=_.initiatorType,j=_.duration;if(w&&j&&o0(D)){for(D=0,j=_.responseEnd,o+=1;o<s.length;o++){var X=s[o],re=X.startTime;if(re>j)break;var ue=X.transferSize,fe=X.initiatorType;ue&&o0(fe)&&(X=X.responseEnd,D+=ue*(X<j?1:(j-re)/(X-re)))}if(--o,i+=8*(w+D)/(_.duration/1e3),t++,10<t)break}}if(0<t)return i/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Qd=null,ef=null;function Wc(t){return t.nodeType===9?t:t.ownerDocument}function l0(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function c0(t,i){if(t===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&i==="foreignObject"?0:t}function tf(t,i){return t==="textarea"||t==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var nf=null;function N2(){var t=window.event;return t&&t.type==="popstate"?t===nf?!1:(nf=t,!0):(nf=null,!1)}var u0=typeof setTimeout=="function"?setTimeout:void 0,B2=typeof clearTimeout=="function"?clearTimeout:void 0,h0=typeof Promise=="function"?Promise:void 0,I2=typeof queueMicrotask=="function"?queueMicrotask:typeof h0<"u"?function(t){return h0.resolve(null).then(t).catch(j2)}:u0;function j2(t){setTimeout(function(){throw t})}function ss(t){return t==="head"}function d0(t,i){var s=i,o=0;do{var _=s.nextSibling;if(t.removeChild(s),_&&_.nodeType===8)if(s=_.data,s==="/$"||s==="/&"){if(o===0){t.removeChild(_),$a(i);return}o--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")o++;else if(s==="html")el(t.ownerDocument.documentElement);else if(s==="head"){s=t.ownerDocument.head,el(s);for(var w=s.firstChild;w;){var D=w.nextSibling,j=w.nodeName;w[Gi]||j==="SCRIPT"||j==="STYLE"||j==="LINK"&&w.rel.toLowerCase()==="stylesheet"||s.removeChild(w),w=D}}else s==="body"&&el(t.ownerDocument.body);s=_}while(s);$a(i)}function f0(t,i){var s=t;t=0;do{var o=s.nextSibling;if(s.nodeType===1?i?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(i?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),o&&o.nodeType===8)if(s=o.data,s==="/$"){if(t===0)break;t--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||t++;s=o}while(s)}function rf(t){var i=t.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var s=i;switch(i=i.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":rf(s),De(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}t.removeChild(s)}}function $2(t,i,s,o){for(;t.nodeType===1;){var _=s;if(t.nodeName.toLowerCase()!==i.toLowerCase()){if(!o&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(o){if(!t[Gi])switch(i){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(w=t.getAttribute("rel"),w==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(w!==_.rel||t.getAttribute("href")!==(_.href==null||_.href===""?null:_.href)||t.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin)||t.getAttribute("title")!==(_.title==null?null:_.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(w=t.getAttribute("src"),(w!==(_.src==null?null:_.src)||t.getAttribute("type")!==(_.type==null?null:_.type)||t.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin))&&w&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(i==="input"&&t.type==="hidden"){var w=_.name==null?null:""+_.name;if(_.type==="hidden"&&t.getAttribute("name")===w)return t}else return t;if(t=wi(t.nextSibling),t===null)break}return null}function z2(t,i,s){if(i==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!s||(t=wi(t.nextSibling),t===null))return null;return t}function p0(t,i){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!i||(t=wi(t.nextSibling),t===null))return null;return t}function sf(t){return t.data==="$?"||t.data==="$~"}function af(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function P2(t,i){var s=t.ownerDocument;if(t.data==="$~")t._reactRetry=i;else if(t.data!=="$?"||s.readyState!=="loading")i();else{var o=function(){i(),s.removeEventListener("DOMContentLoaded",o)};s.addEventListener("DOMContentLoaded",o),t._reactRetry=o}}function wi(t){for(;t!=null;t=t.nextSibling){var i=t.nodeType;if(i===1||i===3)break;if(i===8){if(i=t.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return t}var of=null;function g0(t){t=t.nextSibling;for(var i=0;t;){if(t.nodeType===8){var s=t.data;if(s==="/$"||s==="/&"){if(i===0)return wi(t.nextSibling);i--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||i++}t=t.nextSibling}return null}function m0(t){t=t.previousSibling;for(var i=0;t;){if(t.nodeType===8){var s=t.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(i===0)return t;i--}else s!=="/$"&&s!=="/&"||i++}t=t.previousSibling}return null}function _0(t,i,s){switch(i=Wc(s),t){case"html":if(t=i.documentElement,!t)throw Error(a(452));return t;case"head":if(t=i.head,!t)throw Error(a(453));return t;case"body":if(t=i.body,!t)throw Error(a(454));return t;default:throw Error(a(451))}}function el(t){for(var i=t.attributes;i.length;)t.removeAttributeNode(i[0]);De(t)}var Ci=new Map,v0=new Set;function Gc(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Ar=W.d;W.d={f:H2,r:U2,D:F2,C:q2,L:W2,m:G2,X:V2,S:K2,M:Y2};function H2(){var t=Ar.f(),i=jc();return t||i}function U2(t){var i=pe(t);i!==null&&i.tag===5&&i.type==="form"?B_(i):Ar.r(t)}var Ba=typeof document>"u"?null:document;function b0(t,i,s){var o=Ba;if(o&&typeof i=="string"&&i){var _=qn(i);_='link[rel="'+t+'"][href="'+_+'"]',typeof s=="string"&&(_+='[crossorigin="'+s+'"]'),v0.has(_)||(v0.add(_),t={rel:t,crossOrigin:s,href:i},o.querySelector(_)===null&&(i=o.createElement("link"),Tn(i,"link",t),Ze(i),o.head.appendChild(i)))}}function F2(t){Ar.D(t),b0("dns-prefetch",t,null)}function q2(t,i){Ar.C(t,i),b0("preconnect",t,i)}function W2(t,i,s){Ar.L(t,i,s);var o=Ba;if(o&&t&&i){var _='link[rel="preload"][as="'+qn(i)+'"]';i==="image"&&s&&s.imageSrcSet?(_+='[imagesrcset="'+qn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(_+='[imagesizes="'+qn(s.imageSizes)+'"]')):_+='[href="'+qn(t)+'"]';var w=_;switch(i){case"style":w=Ia(t);break;case"script":w=ja(t)}Ci.has(w)||(t=g({rel:"preload",href:i==="image"&&s&&s.imageSrcSet?void 0:t,as:i},s),Ci.set(w,t),o.querySelector(_)!==null||i==="style"&&o.querySelector(tl(w))||i==="script"&&o.querySelector(nl(w))||(i=o.createElement("link"),Tn(i,"link",t),Ze(i),o.head.appendChild(i)))}}function G2(t,i){Ar.m(t,i);var s=Ba;if(s&&t){var o=i&&typeof i.as=="string"?i.as:"script",_='link[rel="modulepreload"][as="'+qn(o)+'"][href="'+qn(t)+'"]',w=_;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=ja(t)}if(!Ci.has(w)&&(t=g({rel:"modulepreload",href:t},i),Ci.set(w,t),s.querySelector(_)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(nl(w)))return}o=s.createElement("link"),Tn(o,"link",t),Ze(o),s.head.appendChild(o)}}}function K2(t,i,s){Ar.S(t,i,s);var o=Ba;if(o&&t){var _=rt(o).hoistableStyles,w=Ia(t);i=i||"default";var D=_.get(w);if(!D){var j={loading:0,preload:null};if(D=o.querySelector(tl(w)))j.loading=5;else{t=g({rel:"stylesheet",href:t,"data-precedence":i},s),(s=Ci.get(w))&&lf(t,s);var X=D=o.createElement("link");Ze(X),Tn(X,"link",t),X._p=new Promise(function(re,ue){X.onload=re,X.onerror=ue}),X.addEventListener("load",function(){j.loading|=1}),X.addEventListener("error",function(){j.loading|=2}),j.loading|=4,Kc(D,i,o)}D={type:"stylesheet",instance:D,count:1,state:j},_.set(w,D)}}}function V2(t,i){Ar.X(t,i);var s=Ba;if(s&&t){var o=rt(s).hoistableScripts,_=ja(t),w=o.get(_);w||(w=s.querySelector(nl(_)),w||(t=g({src:t,async:!0},i),(i=Ci.get(_))&&cf(t,i),w=s.createElement("script"),Ze(w),Tn(w,"link",t),s.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},o.set(_,w))}}function Y2(t,i){Ar.M(t,i);var s=Ba;if(s&&t){var o=rt(s).hoistableScripts,_=ja(t),w=o.get(_);w||(w=s.querySelector(nl(_)),w||(t=g({src:t,async:!0,type:"module"},i),(i=Ci.get(_))&&cf(t,i),w=s.createElement("script"),Ze(w),Tn(w,"link",t),s.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},o.set(_,w))}}function y0(t,i,s,o){var _=(_=_e.current)?Gc(_):null;if(!_)throw Error(a(446));switch(t){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(i=Ia(s.href),s=rt(_).hoistableStyles,o=s.get(i),o||(o={type:"style",instance:null,count:0,state:null},s.set(i,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){t=Ia(s.href);var w=rt(_).hoistableStyles,D=w.get(t);if(D||(_=_.ownerDocument||_,D={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(t,D),(w=_.querySelector(tl(t)))&&!w._p&&(D.instance=w,D.state.loading=5),Ci.has(t)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},Ci.set(t,s),w||X2(_,t,s,D.state))),i&&o===null)throw Error(a(528,""));return D}if(i&&o!==null)throw Error(a(529,""));return null;case"script":return i=s.async,s=s.src,typeof s=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=ja(s),s=rt(_).hoistableScripts,o=s.get(i),o||(o={type:"script",instance:null,count:0,state:null},s.set(i,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,t))}}function Ia(t){return'href="'+qn(t)+'"'}function tl(t){return'link[rel="stylesheet"]['+t+"]"}function S0(t){return g({},t,{"data-precedence":t.precedence,precedence:null})}function X2(t,i,s,o){t.querySelector('link[rel="preload"][as="style"]['+i+"]")?o.loading=1:(i=t.createElement("link"),o.preload=i,i.addEventListener("load",function(){return o.loading|=1}),i.addEventListener("error",function(){return o.loading|=2}),Tn(i,"link",s),Ze(i),t.head.appendChild(i))}function ja(t){return'[src="'+qn(t)+'"]'}function nl(t){return"script[async]"+t}function w0(t,i,s){if(i.count++,i.instance===null)switch(i.type){case"style":var o=t.querySelector('style[data-href~="'+qn(s.href)+'"]');if(o)return i.instance=o,Ze(o),o;var _=g({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return o=(t.ownerDocument||t).createElement("style"),Ze(o),Tn(o,"style",_),Kc(o,s.precedence,t),i.instance=o;case"stylesheet":_=Ia(s.href);var w=t.querySelector(tl(_));if(w)return i.state.loading|=4,i.instance=w,Ze(w),w;o=S0(s),(_=Ci.get(_))&&lf(o,_),w=(t.ownerDocument||t).createElement("link"),Ze(w);var D=w;return D._p=new Promise(function(j,X){D.onload=j,D.onerror=X}),Tn(w,"link",o),i.state.loading|=4,Kc(w,s.precedence,t),i.instance=w;case"script":return w=ja(s.src),(_=t.querySelector(nl(w)))?(i.instance=_,Ze(_),_):(o=s,(_=Ci.get(w))&&(o=g({},s),cf(o,_)),t=t.ownerDocument||t,_=t.createElement("script"),Ze(_),Tn(_,"link",o),t.head.appendChild(_),i.instance=_);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(o=i.instance,i.state.loading|=4,Kc(o,s.precedence,t));return i.instance}function Kc(t,i,s){for(var o=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),_=o.length?o[o.length-1]:null,w=_,D=0;D<o.length;D++){var j=o[D];if(j.dataset.precedence===i)w=j;else if(w!==_)break}w?w.parentNode.insertBefore(t,w.nextSibling):(i=s.nodeType===9?s.head:s,i.insertBefore(t,i.firstChild))}function lf(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.title==null&&(t.title=i.title)}function cf(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.integrity==null&&(t.integrity=i.integrity)}var Vc=null;function C0(t,i,s){if(Vc===null){var o=new Map,_=Vc=new Map;_.set(s,o)}else _=Vc,o=_.get(s),o||(o=new Map,_.set(s,o));if(o.has(t))return o;for(o.set(t,null),s=s.getElementsByTagName(t),_=0;_<s.length;_++){var w=s[_];if(!(w[Gi]||w[At]||t==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var D=w.getAttribute(i)||"";D=t+D;var j=o.get(D);j?j.push(w):o.set(D,[w])}}return o}function x0(t,i,s){t=t.ownerDocument||t,t.head.insertBefore(s,i==="title"?t.querySelector("head > title"):null)}function Z2(t,i,s){if(s===1||i.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;return i.rel==="stylesheet"?(t=i.disabled,typeof i.precedence=="string"&&t==null):!0;case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function E0(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function J2(t,i,s,o){if(s.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var _=Ia(o.href),w=i.querySelector(tl(_));if(w){i=w._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(t.count++,t=Yc.bind(t),i.then(t,t)),s.state.loading|=4,s.instance=w,Ze(w);return}w=i.ownerDocument||i,o=S0(o),(_=Ci.get(_))&&lf(o,_),w=w.createElement("link"),Ze(w);var D=w;D._p=new Promise(function(j,X){D.onload=j,D.onerror=X}),Tn(w,"link",o),s.instance=w}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(s,i),(i=s.state.preload)&&(s.state.loading&3)===0&&(t.count++,s=Yc.bind(t),i.addEventListener("load",s),i.addEventListener("error",s))}}var uf=0;function Q2(t,i){return t.stylesheets&&t.count===0&&Zc(t,t.stylesheets),0<t.count||0<t.imgCount?function(s){var o=setTimeout(function(){if(t.stylesheets&&Zc(t,t.stylesheets),t.unsuspend){var w=t.unsuspend;t.unsuspend=null,w()}},6e4+i);0<t.imgBytes&&uf===0&&(uf=62500*O2());var _=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Zc(t,t.stylesheets),t.unsuspend)){var w=t.unsuspend;t.unsuspend=null,w()}},(t.imgBytes>uf?50:800)+i);return t.unsuspend=s,function(){t.unsuspend=null,clearTimeout(o),clearTimeout(_)}}:null}function Yc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Zc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Xc=null;function Zc(t,i){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Xc=new Map,i.forEach(eE,t),Xc=null,Yc.call(t))}function eE(t,i){if(!(i.state.loading&4)){var s=Xc.get(t);if(s)var o=s.get(null);else{s=new Map,Xc.set(t,s);for(var _=t.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<_.length;w++){var D=_[w];(D.nodeName==="LINK"||D.getAttribute("media")!=="not all")&&(s.set(D.dataset.precedence,D),o=D)}o&&s.set(null,o)}_=i.instance,D=_.getAttribute("data-precedence"),w=s.get(D)||o,w===o&&s.set(null,_),s.set(D,_),this.count++,o=Yc.bind(this),_.addEventListener("load",o),_.addEventListener("error",o),w?w.parentNode.insertBefore(_,w.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(_,t.firstChild)),i.state.loading|=4}}var il={$$typeof:b,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function tE(t,i,s,o,_,w,D,j,X){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=wt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wt(0),this.hiddenUpdates=wt(null),this.identifierPrefix=o,this.onUncaughtError=_,this.onCaughtError=w,this.onRecoverableError=D,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=X,this.incompleteTransitions=new Map}function T0(t,i,s,o,_,w,D,j,X,re,ue,fe){return t=new tE(t,i,s,D,X,re,ue,fe,j),i=1,w===!0&&(i|=24),w=ai(3,null,null,i),t.current=w,w.stateNode=t,i=Uh(),i.refCount++,t.pooledCache=i,i.refCount++,w.memoizedState={element:o,isDehydrated:s,cache:i},Gh(w),t}function A0(t){return t?(t=pa,t):pa}function k0(t,i,s,o,_,w){_=A0(_),o.context===null?o.context=_:o.pendingContext=_,o=Vr(i),o.payload={element:s},w=w===void 0?null:w,w!==null&&(o.callback=w),s=Yr(t,o,i),s!==null&&(Xn(s,t,i),Bo(s,t,i))}function R0(t,i){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var s=t.retryLane;t.retryLane=s!==0&&s<i?s:i}}function hf(t,i){R0(t,i),(t=t.alternate)&&R0(t,i)}function L0(t){if(t.tag===13||t.tag===31){var i=ks(t,67108864);i!==null&&Xn(i,t,67108864),hf(t,67108864)}}function M0(t){if(t.tag===13||t.tag===31){var i=hi();i=et(i);var s=ks(t,i);s!==null&&Xn(s,t,i),hf(t,i)}}var Jc=!0;function nE(t,i,s,o){var _=q.T;q.T=null;var w=W.p;try{W.p=2,df(t,i,s,o)}finally{W.p=w,q.T=_}}function iE(t,i,s,o){var _=q.T;q.T=null;var w=W.p;try{W.p=8,df(t,i,s,o)}finally{W.p=w,q.T=_}}function df(t,i,s,o){if(Jc){var _=ff(o);if(_===null)Zd(t,i,o,Qc,s),O0(t,o);else if(sE(_,t,i,s,o))o.stopPropagation();else if(O0(t,o),i&4&&-1<rE.indexOf(t)){for(;_!==null;){var w=pe(_);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var D=rn(w.pendingLanes);if(D!==0){var j=w;for(j.pendingLanes|=2,j.entangledLanes|=2;D;){var X=1<<31-Pt(D);j.entanglements[1]|=X,D&=~X}Xi(w),(ht&6)===0&&(Bc=ut()+500,Zo(0))}}break;case 31:case 13:j=ks(w,2),j!==null&&Xn(j,w,2),jc(),hf(w,2)}if(w=ff(o),w===null&&Zd(t,i,o,Qc,s),w===_)break;_=w}_!==null&&o.stopPropagation()}else Zd(t,i,o,null,s)}}function ff(t){return t=We(t),pf(t)}var Qc=null;function pf(t){if(Qc=null,t=V(t),t!==null){var i=p(t);if(i===null)t=null;else{var s=i.tag;if(s===13){if(t=m(i),t!==null)return t;t=null}else if(s===31){if(t=c(i),t!==null)return t;t=null}else if(s===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;t=null}else i!==t&&(t=null)}}return Qc=t,null}function D0(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Vt()){case $t:return 2;case zt:return 8;case nn:case Di:return 32;case Mn:return 268435456;default:return 32}default:return 32}}var gf=!1,as=null,os=null,ls=null,rl=new Map,sl=new Map,cs=[],rE="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function O0(t,i){switch(t){case"focusin":case"focusout":as=null;break;case"dragenter":case"dragleave":os=null;break;case"mouseover":case"mouseout":ls=null;break;case"pointerover":case"pointerout":rl.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":sl.delete(i.pointerId)}}function al(t,i,s,o,_,w){return t===null||t.nativeEvent!==w?(t={blockedOn:i,domEventName:s,eventSystemFlags:o,nativeEvent:w,targetContainers:[_]},i!==null&&(i=pe(i),i!==null&&L0(i)),t):(t.eventSystemFlags|=o,i=t.targetContainers,_!==null&&i.indexOf(_)===-1&&i.push(_),t)}function sE(t,i,s,o,_){switch(i){case"focusin":return as=al(as,t,i,s,o,_),!0;case"dragenter":return os=al(os,t,i,s,o,_),!0;case"mouseover":return ls=al(ls,t,i,s,o,_),!0;case"pointerover":var w=_.pointerId;return rl.set(w,al(rl.get(w)||null,t,i,s,o,_)),!0;case"gotpointercapture":return w=_.pointerId,sl.set(w,al(sl.get(w)||null,t,i,s,o,_)),!0}return!1}function N0(t){var i=V(t.target);if(i!==null){var s=p(i);if(s!==null){if(i=s.tag,i===13){if(i=m(s),i!==null){t.blockedOn=i,cr(t.priority,function(){M0(s)});return}}else if(i===31){if(i=c(s),i!==null){t.blockedOn=i,cr(t.priority,function(){M0(s)});return}}else if(i===3&&s.stateNode.current.memoizedState.isDehydrated){t.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}t.blockedOn=null}function eu(t){if(t.blockedOn!==null)return!1;for(var i=t.targetContainers;0<i.length;){var s=ff(t.nativeEvent);if(s===null){s=t.nativeEvent;var o=new s.constructor(s.type,s);Re=o,s.target.dispatchEvent(o),Re=null}else return i=pe(s),i!==null&&L0(i),t.blockedOn=s,!1;i.shift()}return!0}function B0(t,i,s){eu(t)&&s.delete(i)}function aE(){gf=!1,as!==null&&eu(as)&&(as=null),os!==null&&eu(os)&&(os=null),ls!==null&&eu(ls)&&(ls=null),rl.forEach(B0),sl.forEach(B0)}function tu(t,i){t.blockedOn===i&&(t.blockedOn=null,gf||(gf=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,aE)))}var nu=null;function I0(t){nu!==t&&(nu=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){nu===t&&(nu=null);for(var i=0;i<t.length;i+=3){var s=t[i],o=t[i+1],_=t[i+2];if(typeof o!="function"){if(pf(o||s)===null)continue;break}var w=pe(s);w!==null&&(t.splice(i,3),i-=3,dd(w,{pending:!0,data:_,method:s.method,action:o},o,_))}}))}function $a(t){function i(X){return tu(X,t)}as!==null&&tu(as,t),os!==null&&tu(os,t),ls!==null&&tu(ls,t),rl.forEach(i),sl.forEach(i);for(var s=0;s<cs.length;s++){var o=cs[s];o.blockedOn===t&&(o.blockedOn=null)}for(;0<cs.length&&(s=cs[0],s.blockedOn===null);)N0(s),s.blockedOn===null&&cs.shift();if(s=(t.ownerDocument||t).$$reactFormReplay,s!=null)for(o=0;o<s.length;o+=3){var _=s[o],w=s[o+1],D=_[Et]||null;if(typeof w=="function")D||I0(s);else if(D){var j=null;if(w&&w.hasAttribute("formAction")){if(_=w,D=w[Et]||null)j=D.formAction;else if(pf(_)!==null)continue}else j=D.action;typeof j=="function"?s[o+1]=j:(s.splice(o,3),o-=3),I0(s)}}}function j0(){function t(w){w.canIntercept&&w.info==="react-transition"&&w.intercept({handler:function(){return new Promise(function(D){return _=D})},focusReset:"manual",scroll:"manual"})}function i(){_!==null&&(_(),_=null),o||setTimeout(s,20)}function s(){if(!o&&!navigation.transition){var w=navigation.currentEntry;w&&w.url!=null&&navigation.navigate(w.url,{state:w.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,_=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(s,100),function(){o=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),_!==null&&(_(),_=null)}}}function mf(t){this._internalRoot=t}iu.prototype.render=mf.prototype.render=function(t){var i=this._internalRoot;if(i===null)throw Error(a(409));var s=i.current,o=hi();k0(s,o,t,i,null,null)},iu.prototype.unmount=mf.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var i=t.containerInfo;k0(t.current,2,null,t,null,null),jc(),i[Ni]=null}};function iu(t){this._internalRoot=t}iu.prototype.unstable_scheduleHydration=function(t){if(t){var i=lr();t={blockedOn:null,target:t,priority:i};for(var s=0;s<cs.length&&i!==0&&i<cs[s].priority;s++);cs.splice(s,0,t),s===0&&N0(t)}};var $0=n.version;if($0!=="19.2.7")throw Error(a(527,$0,"19.2.7"));W.findDOMNode=function(t){var i=t._reactInternals;if(i===void 0)throw typeof t.render=="function"?Error(a(188)):(t=Object.keys(t).join(","),Error(a(268,t)));return t=h(i),t=t!==null?y(t):null,t=t===null?null:t.stateNode,t};var oE={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:q,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ru=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ru.isDisabled&&ru.supportsFiber)try{Hn=ru.inject(oE),Yt=ru}catch{}}return ll.createRoot=function(t,i){if(!l(t))throw Error(a(299));var s=!1,o="",_=W_,w=G_,D=K_;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(o=i.identifierPrefix),i.onUncaughtError!==void 0&&(_=i.onUncaughtError),i.onCaughtError!==void 0&&(w=i.onCaughtError),i.onRecoverableError!==void 0&&(D=i.onRecoverableError)),i=T0(t,1,!1,null,null,s,o,null,_,w,D,j0),t[Ni]=i.current,Xd(t),new mf(i)},ll.hydrateRoot=function(t,i,s){if(!l(t))throw Error(a(299));var o=!1,_="",w=W_,D=G_,j=K_,X=null;return s!=null&&(s.unstable_strictMode===!0&&(o=!0),s.identifierPrefix!==void 0&&(_=s.identifierPrefix),s.onUncaughtError!==void 0&&(w=s.onUncaughtError),s.onCaughtError!==void 0&&(D=s.onCaughtError),s.onRecoverableError!==void 0&&(j=s.onRecoverableError),s.formState!==void 0&&(X=s.formState)),i=T0(t,1,!0,i,s??null,o,_,X,w,D,j,j0),i.context=A0(null),s=i.current,o=hi(),o=et(o),_=Vr(o),_.callback=null,Yr(s,_,o),s=o,i.current.lanes=s,ft(i,s),Xi(i),t[Ni]=i.current,Xd(t),new iu(i)},ll.version="19.2.7",ll}var V0;function _E(){if(V0)return bf.exports;V0=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),bf.exports=mE(),bf.exports}var vE=_E();var Y0="popstate";function X0(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function bE(e={}){function n(a,l){let p=l.state?.masked,{pathname:m,search:c,hash:u}=p||a.location;return _p("",{pathname:m,search:c,hash:u},l.state&&l.state.usr||null,l.state&&l.state.key||"default",p?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function r(a,l){return typeof l=="string"?l:Ol(l)}return SE(n,r,null,e)}function Bt(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function Fi(e,n){if(!e){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function yE(){return Math.random().toString(36).substring(2,10)}function Z0(e,n){return{usr:e.state,key:e.key,idx:n,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function _p(e,n,r=null,a,l){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof n=="string"?so(n):n,state:r,key:n&&n.key||a||yE(),mask:l}}function Ol({pathname:e="/",search:n="",hash:r=""}){return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function so(e){let n={};if(e){let r=e.indexOf("#");r>=0&&(n.hash=e.substring(r),e=e.substring(0,r));let a=e.indexOf("?");a>=0&&(n.search=e.substring(a),e=e.substring(0,a)),e&&(n.pathname=e)}return n}function SE(e,n,r,a={}){let{window:l=document.defaultView,v5Compat:p=!1}=a,m=l.history,c="POP",u=null,h=y();h==null&&(h=0,m.replaceState({...m.state,idx:h},""));function y(){return(m.state||{idx:null}).idx}function g(){c="POP";let d=y(),v=d==null?null:d-h;h=d,u&&u({action:c,location:x.location,delta:v})}function C(d,v){c="PUSH";let f=X0(d)?d:_p(x.location,d,v);h=y()+1;let b=Z0(f,h),E=x.createHref(f.mask||f);try{m.pushState(b,"",E)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;l.location.assign(E)}p&&u&&u({action:c,location:x.location,delta:1})}function T(d,v){c="REPLACE";let f=X0(d)?d:_p(x.location,d,v);h=y();let b=Z0(f,h),E=x.createHref(f.mask||f);m.replaceState(b,"",E),p&&u&&u({action:c,location:x.location,delta:0})}function A(d){return wE(l,d)}let x={get action(){return c},get location(){return e(l,m)},listen(d){if(u)throw new Error("A history only accepts one active listener");return l.addEventListener(Y0,g),u=d,()=>{l.removeEventListener(Y0,g),u=null}},createHref(d){return n(l,d)},createURL:A,encodeLocation(d){let v=A(d);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:C,replace:T,go(d){return m.go(d)}};return x}function wE(e,n,r=!1){let a="http://localhost";e&&(a=e.location.origin!=="null"?e.location.origin:e.location.href),Bt(a,"No window.location.(origin|href) available to create URL");let l=typeof n=="string"?n:Ol(n);return l=l.replace(/ $/,"%20"),!r&&l.startsWith("//")&&(l=a+l),new URL(l,a)}function My(e,n,r="/"){return CE(e,n,r,!1)}function CE(e,n,r,a,l){let p=typeof n=="string"?so(n):n,m=jr(p.pathname||"/",r);if(m==null)return null;let c=xE(e),u=null,h=IE(m);for(let y=0;u==null&&y<c.length;++y)u=NE(c[y],h,a);return u}function xE(e){let n=Dy(e);return EE(n),n}function Dy(e,n=[],r=[],a="",l=!1){let p=(m,c,u=l,h)=>{let y={relativePath:h===void 0?m.path||"":h,caseSensitive:m.caseSensitive===!0,childrenIndex:c,route:m};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(a)&&u)return;Bt(y.relativePath.startsWith(a),`Absolute route path "${y.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(a.length)}let g=Ui([a,y.relativePath]),C=r.concat(y);m.children&&m.children.length>0&&(Bt(m.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),Dy(m.children,n,C,g,u)),!(m.path==null&&!m.index)&&n.push({path:g,score:DE(g,m.index),routesMeta:C})};return e.forEach((m,c)=>{if(m.path===""||!m.path?.includes("?"))p(m,c);else for(let u of Oy(m.path))p(m,c,!0,u)}),n}function Oy(e){let n=e.split("/");if(n.length===0)return[];let[r,...a]=n,l=r.endsWith("?"),p=r.replace(/\?$/,"");if(a.length===0)return l?[p,""]:[p];let m=Oy(a.join("/")),c=[];return c.push(...m.map(u=>u===""?p:[p,u].join("/"))),l&&c.push(...m),c.map(u=>e.startsWith("/")&&u===""?"/":u)}function EE(e){e.sort((n,r)=>n.score!==r.score?r.score-n.score:OE(n.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var TE=/^:[\w-]+$/,AE=3,kE=2,RE=1,LE=10,ME=-2,J0=e=>e==="*";function DE(e,n){let r=e.split("/"),a=r.length;return r.some(J0)&&(a+=ME),n&&(a+=kE),r.filter(l=>!J0(l)).reduce((l,p)=>l+(TE.test(p)?AE:p===""?RE:LE),a)}function OE(e,n){return e.length===n.length&&e.slice(0,-1).every((a,l)=>a===n[l])?e[e.length-1]-n[n.length-1]:0}function NE(e,n,r=!1){let{routesMeta:a}=e,l={},p="/",m=[];for(let c=0;c<a.length;++c){let u=a[c],h=c===a.length-1,y=p==="/"?n:n.slice(p.length)||"/",g=$u({path:u.relativePath,caseSensitive:u.caseSensitive,end:h},y),C=u.route;if(!g&&h&&r&&!a[a.length-1].route.index&&(g=$u({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},y)),!g)return null;Object.assign(l,g.params),m.push({params:l,pathname:Ui([p,g.pathname]),pathnameBase:PE(Ui([p,g.pathnameBase])),route:C}),g.pathnameBase!=="/"&&(p=Ui([p,g.pathnameBase]))}return m}function $u(e,n){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=BE(e.path,e.caseSensitive,e.end),l=n.match(r);if(!l)return null;let p=l[0],m=p.replace(/(.)\/+$/,"$1"),c=l.slice(1);return{params:a.reduce((h,{paramName:y,isOptional:g},C)=>{if(y==="*"){let A=c[C]||"";m=p.slice(0,p.length-A.length).replace(/(.)\/+$/,"$1")}const T=c[C];return g&&!T?h[y]=void 0:h[y]=(T||"").replace(/%2F/g,"/"),h},{}),pathname:p,pathnameBase:m,pattern:e}}function BE(e,n=!1,r=!0){Fi(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,c,u,h,y)=>{if(a.push({paramName:c,isOptional:u!=null}),u){let g=y.charAt(h+m.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,n?void 0:"i"),a]}function IE(e){try{return e.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return Fi(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${n}).`),e}}function jr(e,n){if(n==="/")return e;if(!e.toLowerCase().startsWith(n.toLowerCase()))return null;let r=n.endsWith("/")?n.length-1:n.length,a=e.charAt(r);return a&&a!=="/"?null:e.slice(r)||"/"}var jE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function $E(e,n="/"){let{pathname:r,search:a="",hash:l=""}=typeof e=="string"?so(e):e,p;return r?(r=Ny(r),r.startsWith("/")?p=Q0(r.substring(1),"/"):p=Q0(r,n)):p=n,{pathname:p,search:HE(a),hash:UE(l)}}function Q0(e,n){let r=zu(n).split("/");return e.split("/").forEach(l=>{l===".."?r.length>1&&r.pop():l!=="."&&r.push(l)}),r.length>1?r.join("/"):"/"}function Cf(e,n,r,a){return`Cannot include a '${e}' character in a manually specified \`to.${n}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function zE(e){return e.filter((n,r)=>r===0||n.route.path&&n.route.path.length>0)}function bg(e){let n=zE(e);return n.map((r,a)=>a===n.length-1?r.pathname:r.pathnameBase)}function th(e,n,r,a=!1){let l;typeof e=="string"?l=so(e):(l={...e},Bt(!l.pathname||!l.pathname.includes("?"),Cf("?","pathname","search",l)),Bt(!l.pathname||!l.pathname.includes("#"),Cf("#","pathname","hash",l)),Bt(!l.search||!l.search.includes("#"),Cf("#","search","hash",l)));let p=e===""||l.pathname==="",m=p?"/":l.pathname,c;if(m==null)c=r;else{let g=n.length-1;if(!a&&m.startsWith("..")){let C=m.split("/");for(;C[0]==="..";)C.shift(),g-=1;l.pathname=C.join("/")}c=g>=0?n[g]:"/"}let u=$E(l,c),h=m&&m!=="/"&&m.endsWith("/"),y=(p||m===".")&&r.endsWith("/");return!u.pathname.endsWith("/")&&(h||y)&&(u.pathname+="/"),u}var Ny=e=>e.replace(/\/\/+/g,"/"),Ui=e=>Ny(e.join("/")),zu=e=>e.replace(/\/+$/,""),PE=e=>zu(e).replace(/^\/*/,"/"),HE=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,UE=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,FE=class{constructor(e,n,r,a=!1){this.status=e,this.statusText=n||"",this.internal=a,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function qE(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function WE(e){let n=e.map(r=>r.route.path).filter(Boolean);return Ui(n)||"/"}var By=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Iy(e,n){let r=e;if(typeof r!="string"||!jE.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let a=r,l=!1;if(By)try{let p=new URL(window.location.href),m=r.startsWith("//")?new URL(p.protocol+r):new URL(r),c=jr(m.pathname,n);m.origin===p.origin&&c!=null?r=c+m.search+m.hash:l=!0}catch{Fi(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:l,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var jy=["POST","PUT","PATCH","DELETE"];new Set(jy);var GE=["GET",...jy];new Set(GE);var ao=H.createContext(null);ao.displayName="DataRouter";var nh=H.createContext(null);nh.displayName="DataRouterState";var $y=H.createContext(!1);function KE(){return H.useContext($y)}var zy=H.createContext({isTransitioning:!1});zy.displayName="ViewTransition";var VE=H.createContext(new Map);VE.displayName="Fetchers";var YE=H.createContext(null);YE.displayName="Await";var fi=H.createContext(null);fi.displayName="Navigation";var Hl=H.createContext(null);Hl.displayName="Location";var ir=H.createContext({outlet:null,matches:[],isDataRoute:!1});ir.displayName="Route";var yg=H.createContext(null);yg.displayName="RouteError";var Py="REACT_ROUTER_ERROR",XE="REDIRECT",ZE="ROUTE_ERROR_RESPONSE";function JE(e){if(e.startsWith(`${Py}:${XE}:{`))try{let n=JSON.parse(e.slice(28));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.location=="string"&&typeof n.reloadDocument=="boolean"&&typeof n.replace=="boolean")return n}catch{}}function QE(e){if(e.startsWith(`${Py}:${ZE}:{`))try{let n=JSON.parse(e.slice(40));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string")return new FE(n.status,n.statusText,n.data)}catch{}}function e5(e,{relative:n}={}){Bt(oo(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=H.useContext(fi),{hash:l,pathname:p,search:m}=Ul(e,{relative:n}),c=p;return r!=="/"&&(c=p==="/"?r:Ui([r,p])),a.createHref({pathname:c,search:m,hash:l})}function oo(){return H.useContext(Hl)!=null}function Li(){return Bt(oo(),"useLocation() may be used only in the context of a <Router> component."),H.useContext(Hl).location}var Hy="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Uy(e){H.useContext(fi).static||H.useLayoutEffect(e)}function lo(){let{isDataRoute:e}=H.useContext(ir);return e?f5():t5()}function t5(){Bt(oo(),"useNavigate() may be used only in the context of a <Router> component.");let e=H.useContext(ao),{basename:n,navigator:r}=H.useContext(fi),{matches:a}=H.useContext(ir),{pathname:l}=Li(),p=JSON.stringify(bg(a)),m=H.useRef(!1);return Uy(()=>{m.current=!0}),H.useCallback((u,h={})=>{if(Fi(m.current,Hy),!m.current)return;if(typeof u=="number"){r.go(u);return}let y=th(u,JSON.parse(p),l,h.relative==="path");e==null&&n!=="/"&&(y.pathname=y.pathname==="/"?n:Ui([n,y.pathname])),(h.replace?r.replace:r.push)(y,h.state,h)},[n,r,p,l,e])}H.createContext(null);function Ul(e,{relative:n}={}){let{matches:r}=H.useContext(ir),{pathname:a}=Li(),l=JSON.stringify(bg(r));return H.useMemo(()=>th(e,JSON.parse(l),a,n==="path"),[e,l,a,n])}function n5(e,n){return Fy(e,n)}function Fy(e,n,r){Bt(oo(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=H.useContext(fi),{matches:l}=H.useContext(ir),p=l[l.length-1],m=p?p.params:{},c=p?p.pathname:"/",u=p?p.pathnameBase:"/",h=p&&p.route;{let d=h&&h.path||"";Wy(c,!h||d.endsWith("*")||d.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${d}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
10
-
11
- Please change the parent <Route path="${d}"> to <Route path="${d==="/"?"*":`${d}/*`}">.`)}let y=Li(),g;if(n){let d=typeof n=="string"?so(n):n;Bt(u==="/"||d.pathname?.startsWith(u),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${u}" but pathname "${d.pathname}" was given in the \`location\` prop.`),g=d}else g=y;let C=g.pathname||"/",T=C;if(u!=="/"){let d=u.replace(/^\//,"").split("/");T="/"+C.replace(/^\//,"").split("/").slice(d.length).join("/")}let A=r&&r.state.matches.length?r.state.matches.map(d=>Object.assign(d,{route:r.manifest[d.route.id]||d.route})):My(e,{pathname:T});Fi(h||A!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),Fi(A==null||A[A.length-1].route.element!==void 0||A[A.length-1].route.Component!==void 0||A[A.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let x=o5(A&&A.map(d=>Object.assign({},d,{params:Object.assign({},m,d.params),pathname:Ui([u,a.encodeLocation?a.encodeLocation(d.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:d.pathname]),pathnameBase:d.pathnameBase==="/"?u:Ui([u,a.encodeLocation?a.encodeLocation(d.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:d.pathnameBase])})),l,r);return n&&x?H.createElement(Hl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...g},navigationType:"POP"}},x):x}function i5(){let e=d5(),n=qE(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:a},p={padding:"2px 4px",backgroundColor:a},m=null;return console.error("Error handled by React Router default ErrorBoundary:",e),m=H.createElement(H.Fragment,null,H.createElement("p",null,"💿 Hey developer 👋"),H.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",H.createElement("code",{style:p},"ErrorBoundary")," or"," ",H.createElement("code",{style:p},"errorElement")," prop on your route.")),H.createElement(H.Fragment,null,H.createElement("h2",null,"Unexpected Application Error!"),H.createElement("h3",{style:{fontStyle:"italic"}},n),r?H.createElement("pre",{style:l},r):null,m)}var r5=H.createElement(i5,null),qy=class extends H.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){this.props.onError?this.props.onError(e,n):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const r=QE(e.digest);r&&(e=r)}let n=e!==void 0?H.createElement(ir.Provider,{value:this.props.routeContext},H.createElement(yg.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?H.createElement(s5,{error:e},n):n}};qy.contextType=$y;var xf=new WeakMap;function s5({children:e,error:n}){let{basename:r}=H.useContext(fi);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let a=JE(n.digest);if(a){let l=xf.get(n);if(l)throw l;let p=Iy(a.location,r);if(By&&!xf.get(n))if(p.isExternal||a.reloadDocument)window.location.href=p.absoluteURL||p.to;else{const m=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(p.to,{replace:a.replace}));throw xf.set(n,m),m}return H.createElement("meta",{httpEquiv:"refresh",content:`0;url=${p.absoluteURL||p.to}`})}}return e}function a5({routeContext:e,match:n,children:r}){let a=H.useContext(ao);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),H.createElement(ir.Provider,{value:e},r)}function o5(e,n=[],r){let a=r?.state;if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(n.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let l=e,p=a?.errors;if(p!=null){let y=l.findIndex(g=>g.route.id&&p?.[g.route.id]!==void 0);Bt(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(p).join(",")}`),l=l.slice(0,Math.min(l.length,y+1))}let m=!1,c=-1;if(r&&a){m=a.renderFallback;for(let y=0;y<l.length;y++){let g=l[y];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(c=y),g.route.id){let{loaderData:C,errors:T}=a,A=g.route.loader&&!C.hasOwnProperty(g.route.id)&&(!T||T[g.route.id]===void 0);if(g.route.lazy||A){r.isStatic&&(m=!0),c>=0?l=l.slice(0,c+1):l=[l[0]];break}}}}let u=r?.onError,h=a&&u?(y,g)=>{u(y,{location:a.location,params:a.matches?.[0]?.params??{},pattern:WE(a.matches),errorInfo:g})}:void 0;return l.reduceRight((y,g,C)=>{let T,A=!1,x=null,d=null;a&&(T=p&&g.route.id?p[g.route.id]:void 0,x=g.route.errorElement||r5,m&&(c<0&&C===0?(Wy("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),A=!0,d=null):c===C&&(A=!0,d=g.route.hydrateFallbackElement||null)));let v=n.concat(l.slice(0,C+1)),f=()=>{let b;return T?b=x:A?b=d:g.route.Component?b=H.createElement(g.route.Component,null):g.route.element?b=g.route.element:b=y,H.createElement(a5,{match:g,routeContext:{outlet:y,matches:v,isDataRoute:a!=null},children:b})};return a&&(g.route.ErrorBoundary||g.route.errorElement||C===0)?H.createElement(qy,{location:a.location,revalidation:a.revalidation,component:x,error:T,children:f(),routeContext:{outlet:null,matches:v,isDataRoute:!0},onError:h}):f()},null)}function Sg(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function l5(e){let n=H.useContext(ao);return Bt(n,Sg(e)),n}function c5(e){let n=H.useContext(nh);return Bt(n,Sg(e)),n}function u5(e){let n=H.useContext(ir);return Bt(n,Sg(e)),n}function wg(e){let n=u5(e),r=n.matches[n.matches.length-1];return Bt(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function h5(){return wg("useRouteId")}function d5(){let e=H.useContext(yg),n=c5("useRouteError"),r=wg("useRouteError");return e!==void 0?e:n.errors?.[r]}function f5(){let{router:e}=l5("useNavigate"),n=wg("useNavigate"),r=H.useRef(!1);return Uy(()=>{r.current=!0}),H.useCallback(async(l,p={})=>{Fi(r.current,Hy),r.current&&(typeof l=="number"?await e.navigate(l):await e.navigate(l,{fromRouteId:n,...p}))},[e,n])}var eb={};function Wy(e,n,r){!n&&!eb[e]&&(eb[e]=!0,Fi(!1,r))}H.memo(p5);function p5({routes:e,manifest:n,future:r,state:a,isStatic:l,onError:p}){return Fy(e,void 0,{manifest:n,state:a,isStatic:l,onError:p})}function tb({to:e,replace:n,state:r,relative:a}){Bt(oo(),"<Navigate> may be used only in the context of a <Router> component.");let{static:l}=H.useContext(fi);Fi(!l,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:p}=H.useContext(ir),{pathname:m}=Li(),c=lo(),u=th(e,bg(p),m,a==="path"),h=JSON.stringify(u);return H.useEffect(()=>{c(JSON.parse(h),{replace:n,state:r,relative:a})},[c,h,a,n,r]),null}function qs(e){Bt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function g5({basename:e="/",children:n=null,location:r,navigationType:a="POP",navigator:l,static:p=!1,useTransitions:m}){Bt(!oo(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),u=H.useMemo(()=>({basename:c,navigator:l,static:p,useTransitions:m,future:{}}),[c,l,p,m]);typeof r=="string"&&(r=so(r));let{pathname:h="/",search:y="",hash:g="",state:C=null,key:T="default",mask:A}=r,x=H.useMemo(()=>{let d=jr(h,c);return d==null?null:{location:{pathname:d,search:y,hash:g,state:C,key:T,mask:A},navigationType:a}},[c,h,y,g,C,T,a,A]);return Fi(x!=null,`<Router basename="${c}"> is not able to match the URL "${h}${y}${g}" because it does not start with the basename, so the <Router> won't render anything.`),x==null?null:H.createElement(fi.Provider,{value:u},H.createElement(Hl.Provider,{children:n,value:x}))}function m5({children:e,location:n}){return n5(vp(e),n)}function vp(e,n=[]){let r=[];return H.Children.forEach(e,(a,l)=>{if(!H.isValidElement(a))return;let p=[...n,l];if(a.type===H.Fragment){r.push.apply(r,vp(a.props.children,p));return}Bt(a.type===qs,`[${typeof a.type=="string"?a.type:a.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Bt(!a.props.index||!a.props.children,"An index route cannot have child routes.");let m={id:a.props.id||p.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,middleware:a.props.middleware,loader:a.props.loader,action:a.props.action,hydrateFallbackElement:a.props.hydrateFallbackElement,HydrateFallback:a.props.HydrateFallback,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.hasErrorBoundary===!0||a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(m.children=vp(a.props.children,p)),r.push(m)}),r}var Cu="get",xu="application/x-www-form-urlencoded";function ih(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function _5(e){return ih(e)&&e.tagName.toLowerCase()==="button"}function v5(e){return ih(e)&&e.tagName.toLowerCase()==="form"}function b5(e){return ih(e)&&e.tagName.toLowerCase()==="input"}function y5(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function S5(e,n){return e.button===0&&(!n||n==="_self")&&!y5(e)}var su=null;function w5(){if(su===null)try{new FormData(document.createElement("form"),0),su=!1}catch{su=!0}return su}var C5=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ef(e){return e!=null&&!C5.has(e)?(Fi(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${xu}"`),null):e}function x5(e,n){let r,a,l,p,m;if(v5(e)){let c=e.getAttribute("action");a=c?jr(c,n):null,r=e.getAttribute("method")||Cu,l=Ef(e.getAttribute("enctype"))||xu,p=new FormData(e)}else if(_5(e)||b5(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=e.getAttribute("formaction")||c.getAttribute("action");if(a=u?jr(u,n):null,r=e.getAttribute("formmethod")||c.getAttribute("method")||Cu,l=Ef(e.getAttribute("formenctype"))||Ef(c.getAttribute("enctype"))||xu,p=new FormData(c,e),!w5()){let{name:h,type:y,value:g}=e;if(y==="image"){let C=h?`${h}.`:"";p.append(`${C}x`,"0"),p.append(`${C}y`,"0")}else h&&p.append(h,g)}}else{if(ih(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Cu,a=null,l=xu,m=e}return p&&l==="text/plain"&&(m=p,p=void 0),{action:a,method:r.toLowerCase(),encType:l,formData:p,body:m}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Cg(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function Gy(e,n,r,a){let l=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?l.pathname.endsWith("/")?l.pathname=`${l.pathname}_.${a}`:l.pathname=`${l.pathname}.${a}`:l.pathname==="/"?l.pathname=`_root.${a}`:n&&jr(l.pathname,n)==="/"?l.pathname=`${zu(n)}/_root.${a}`:l.pathname=`${zu(l.pathname)}.${a}`,l}async function E5(e,n){if(e.id in n)return n[e.id];try{let r=await import(e.module);return n[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function T5(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function A5(e,n,r){let a=await Promise.all(e.map(async l=>{let p=n.routes[l.route.id];if(p){let m=await E5(p,r);return m.links?m.links():[]}return[]}));return M5(a.flat(1).filter(T5).filter(l=>l.rel==="stylesheet"||l.rel==="preload").map(l=>l.rel==="stylesheet"?{...l,rel:"prefetch",as:"style"}:{...l,rel:"prefetch"}))}function nb(e,n,r,a,l,p){let m=(u,h)=>r[h]?u.route.id!==r[h].route.id:!0,c=(u,h)=>r[h].pathname!==u.pathname||r[h].route.path?.endsWith("*")&&r[h].params["*"]!==u.params["*"];return p==="assets"?n.filter((u,h)=>m(u,h)||c(u,h)):p==="data"?n.filter((u,h)=>{let y=a.routes[u.route.id];if(!y||!y.hasLoader)return!1;if(m(u,h)||c(u,h))return!0;if(u.route.shouldRevalidate){let g=u.route.shouldRevalidate({currentUrl:new URL(l.pathname+l.search+l.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof g=="boolean")return g}return!0}):[]}function k5(e,n,{includeHydrateFallback:r}={}){return R5(e.map(a=>{let l=n.routes[a.route.id];if(!l)return[];let p=[l.module];return l.clientActionModule&&(p=p.concat(l.clientActionModule)),l.clientLoaderModule&&(p=p.concat(l.clientLoaderModule)),r&&l.hydrateFallbackModule&&(p=p.concat(l.hydrateFallbackModule)),l.imports&&(p=p.concat(l.imports)),p}).flat(1))}function R5(e){return[...new Set(e)]}function L5(e){let n={},r=Object.keys(e).sort();for(let a of r)n[a]=e[a];return n}function M5(e,n){let r=new Set;return new Set(n),e.reduce((a,l)=>{let p=JSON.stringify(L5(l));return r.has(p)||(r.add(p),a.push({key:p,link:l})),a},[])}function xg(){let e=H.useContext(ao);return Cg(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function D5(){let e=H.useContext(nh);return Cg(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Eg=H.createContext(void 0);Eg.displayName="FrameworkContext";function Tg(){let e=H.useContext(Eg);return Cg(e,"You must render this element inside a <HydratedRouter> element"),e}function O5(e,n){let r=H.useContext(Eg),[a,l]=H.useState(!1),[p,m]=H.useState(!1),{onFocus:c,onBlur:u,onMouseEnter:h,onMouseLeave:y,onTouchStart:g}=n,C=H.useRef(null);H.useEffect(()=>{if(e==="render"&&m(!0),e==="viewport"){let x=v=>{v.forEach(f=>{m(f.isIntersecting)})},d=new IntersectionObserver(x,{threshold:.5});return C.current&&d.observe(C.current),()=>{d.disconnect()}}},[e]),H.useEffect(()=>{if(a){let x=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout(x)}}},[a]);let T=()=>{l(!0)},A=()=>{l(!1),m(!1)};return r?e!=="intent"?[p,C,{}]:[p,C,{onFocus:cl(c,T),onBlur:cl(u,A),onMouseEnter:cl(h,T),onMouseLeave:cl(y,A),onTouchStart:cl(g,T)}]:[!1,C,{}]}function cl(e,n){return r=>{e&&e(r),r.defaultPrevented||n(r)}}function N5({page:e,...n}){let r=KE(),{router:a}=xg(),l=H.useMemo(()=>My(a.routes,e,a.basename),[a.routes,e,a.basename]);return l?r?H.createElement(I5,{page:e,matches:l,...n}):H.createElement(j5,{page:e,matches:l,...n}):null}function B5(e){let{manifest:n,routeModules:r}=Tg(),[a,l]=H.useState([]);return H.useEffect(()=>{let p=!1;return A5(e,n,r).then(m=>{p||l(m)}),()=>{p=!0}},[e,n,r]),a}function I5({page:e,matches:n,...r}){let a=Li(),{future:l}=Tg(),{basename:p}=xg(),m=H.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let c=Gy(e,p,l.v8_trailingSlashAwareDataRequests,"rsc"),u=!1,h=[];for(let y of n)typeof y.route.shouldRevalidate=="function"?u=!0:h.push(y.route.id);return u&&h.length>0&&c.searchParams.set("_routes",h.join(",")),[c.pathname+c.search]},[p,l.v8_trailingSlashAwareDataRequests,e,a,n]);return H.createElement(H.Fragment,null,m.map(c=>H.createElement("link",{key:c,rel:"prefetch",as:"fetch",href:c,...r})))}function j5({page:e,matches:n,...r}){let a=Li(),{future:l,manifest:p,routeModules:m}=Tg(),{basename:c}=xg(),{loaderData:u,matches:h}=D5(),y=H.useMemo(()=>nb(e,n,h,p,a,"data"),[e,n,h,p,a]),g=H.useMemo(()=>nb(e,n,h,p,a,"assets"),[e,n,h,p,a]),C=H.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let x=new Set,d=!1;if(n.forEach(f=>{let b=p.routes[f.route.id];!b||!b.hasLoader||(!y.some(E=>E.route.id===f.route.id)&&f.route.id in u&&m[f.route.id]?.shouldRevalidate||b.hasClientLoader?d=!0:x.add(f.route.id))}),x.size===0)return[];let v=Gy(e,c,l.v8_trailingSlashAwareDataRequests,"data");return d&&x.size>0&&v.searchParams.set("_routes",n.filter(f=>x.has(f.route.id)).map(f=>f.route.id).join(",")),[v.pathname+v.search]},[c,l.v8_trailingSlashAwareDataRequests,u,a,p,y,n,e,m]),T=H.useMemo(()=>k5(g,p),[g,p]),A=B5(g);return H.createElement(H.Fragment,null,C.map(x=>H.createElement("link",{key:x,rel:"prefetch",as:"fetch",href:x,...r})),T.map(x=>H.createElement("link",{key:x,rel:"modulepreload",href:x,...r})),A.map(({key:x,link:d})=>H.createElement("link",{key:x,nonce:r.nonce,...d,crossOrigin:d.crossOrigin??r.crossOrigin})))}function $5(...e){return n=>{e.forEach(r=>{typeof r=="function"?r(n):r!=null&&(r.current=n)})}}var z5=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{z5&&(window.__reactRouterVersion="7.17.0")}catch{}function P5({basename:e,children:n,useTransitions:r,window:a}){let l=H.useRef();l.current==null&&(l.current=bE({window:a,v5Compat:!0}));let p=l.current,[m,c]=H.useState({action:p.action,location:p.location}),u=H.useCallback(h=>{r===!1?c(h):H.startTransition(()=>c(h))},[r]);return H.useLayoutEffect(()=>p.listen(u),[p,u]),H.createElement(g5,{basename:e,children:n,location:m.location,navigationType:m.action,navigator:p,useTransitions:r})}var Ky=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Nl=H.forwardRef(function({onClick:n,discover:r="render",prefetch:a="none",relative:l,reloadDocument:p,replace:m,mask:c,state:u,target:h,to:y,preventScrollReset:g,viewTransition:C,defaultShouldRevalidate:T,...A},x){let{basename:d,navigator:v,useTransitions:f}=H.useContext(fi),b=typeof y=="string"&&Ky.test(y),E=Iy(y,d);y=E.to;let L=e5(y,{relative:l}),R=Li(),M=null;if(c){let te=th(c,[],R.mask?R.mask.pathname:"/",!0);d!=="/"&&(te.pathname=te.pathname==="/"?d:Ui([d,te.pathname])),M=v.createHref(te)}let[k,O,U]=O5(a,A),F=q5(y,{replace:m,mask:c,state:u,target:h,preventScrollReset:g,relative:l,viewTransition:C,defaultShouldRevalidate:T,useTransitions:f});function G(te){n&&n(te),te.defaultPrevented||F(te)}let I=!(E.isExternal||p),K=H.createElement("a",{...A,...U,href:(I?M:void 0)||E.absoluteURL||L,onClick:I?G:n,ref:$5(x,O),target:h,"data-discover":!b&&r==="render"?"true":void 0});return k&&!b?H.createElement(H.Fragment,null,K,H.createElement(N5,{page:L})):K});Nl.displayName="Link";var H5=H.forwardRef(function({"aria-current":n="page",caseSensitive:r=!1,className:a="",end:l=!1,style:p,to:m,viewTransition:c,children:u,...h},y){let g=Ul(m,{relative:h.relative}),C=Li(),T=H.useContext(nh),{navigator:A,basename:x}=H.useContext(fi),d=T!=null&&Y5(g)&&c===!0,v=A.encodeLocation?A.encodeLocation(g).pathname:g.pathname,f=C.pathname,b=T&&T.navigation&&T.navigation.location?T.navigation.location.pathname:null;r||(f=f.toLowerCase(),b=b?b.toLowerCase():null,v=v.toLowerCase()),b&&x&&(b=jr(b,x)||b);const E=v!=="/"&&v.endsWith("/")?v.length-1:v.length;let L=f===v||!l&&f.startsWith(v)&&f.charAt(E)==="/",R=b!=null&&(b===v||!l&&b.startsWith(v)&&b.charAt(v.length)==="/"),M={isActive:L,isPending:R,isTransitioning:d},k=L?n:void 0,O;typeof a=="function"?O=a(M):O=[a,L?"active":null,R?"pending":null,d?"transitioning":null].filter(Boolean).join(" ");let U=typeof p=="function"?p(M):p;return H.createElement(Nl,{...h,"aria-current":k,className:O,ref:y,style:U,to:m,viewTransition:c},typeof u=="function"?u(M):u)});H5.displayName="NavLink";var U5=H.forwardRef(({discover:e="render",fetcherKey:n,navigate:r,reloadDocument:a,replace:l,state:p,method:m=Cu,action:c,onSubmit:u,relative:h,preventScrollReset:y,viewTransition:g,defaultShouldRevalidate:C,...T},A)=>{let{useTransitions:x}=H.useContext(fi),d=K5(),v=V5(c,{relative:h}),f=m.toLowerCase()==="get"?"get":"post",b=typeof c=="string"&&Ky.test(c),E=L=>{if(u&&u(L),L.defaultPrevented)return;L.preventDefault();let R=L.nativeEvent.submitter,M=R?.getAttribute("formmethod")||m,k=()=>d(R||L.currentTarget,{fetcherKey:n,method:M,navigate:r,replace:l,state:p,relative:h,preventScrollReset:y,viewTransition:g,defaultShouldRevalidate:C});x&&r!==!1?H.startTransition(()=>k()):k()};return H.createElement("form",{ref:A,method:f,action:v,onSubmit:a?u:E,...T,"data-discover":!b&&e==="render"?"true":void 0})});U5.displayName="Form";function F5(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Vy(e){let n=H.useContext(ao);return Bt(n,F5(e)),n}function q5(e,{target:n,replace:r,mask:a,state:l,preventScrollReset:p,relative:m,viewTransition:c,defaultShouldRevalidate:u,useTransitions:h}={}){let y=lo(),g=Li(),C=Ul(e,{relative:m});return H.useCallback(T=>{if(S5(T,n)){T.preventDefault();let A=r!==void 0?r:Ol(g)===Ol(C),x=()=>y(e,{replace:A,mask:a,state:l,preventScrollReset:p,relative:m,viewTransition:c,defaultShouldRevalidate:u});h?H.startTransition(()=>x()):x()}},[g,y,C,r,a,l,n,e,p,m,c,u,h])}var W5=0,G5=()=>`__${String(++W5)}__`;function K5(){let{router:e}=Vy("useSubmit"),{basename:n}=H.useContext(fi),r=h5(),a=e.fetch,l=e.navigate;return H.useCallback(async(p,m={})=>{let{action:c,method:u,encType:h,formData:y,body:g}=x5(p,n);if(m.navigate===!1){let C=m.fetcherKey||G5();await a(C,r,m.action||c,{defaultShouldRevalidate:m.defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:y,body:g,formMethod:m.method||u,formEncType:m.encType||h,flushSync:m.flushSync})}else await l(m.action||c,{defaultShouldRevalidate:m.defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:y,body:g,formMethod:m.method||u,formEncType:m.encType||h,replace:m.replace,state:m.state,fromRouteId:r,flushSync:m.flushSync,viewTransition:m.viewTransition})},[a,l,n,r])}function V5(e,{relative:n}={}){let{basename:r}=H.useContext(fi),a=H.useContext(ir);Bt(a,"useFormAction must be used inside a RouteContext");let[l]=a.matches.slice(-1),p={...Ul(e||".",{relative:n})},m=Li();if(e==null){p.search=m.search;let c=new URLSearchParams(p.search),u=c.getAll("index");if(u.some(y=>y==="")){c.delete("index"),u.filter(g=>g).forEach(g=>c.append("index",g));let y=c.toString();p.search=y?`?${y}`:""}}return(!e||e===".")&&l.route.index&&(p.search=p.search?p.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(p.pathname=p.pathname==="/"?r:Ui([r,p.pathname])),Ol(p)}function Y5(e,{relative:n}={}){let r=H.useContext(zy);Bt(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=Vy("useViewTransitionState"),l=Ul(e,{relative:n});if(!r.isTransitioning)return!1;let p=jr(r.currentLocation.pathname,a)||r.currentLocation.pathname,m=jr(r.nextLocation.pathname,a)||r.nextLocation.pathname;return $u(l.pathname,m)!=null||$u(l.pathname,p)!=null}var X5=Ly();const Z5="fleet-console.canvas.",Yy="fleet-console.canvas.backgroundAnimation",Xy="fleet-console.canvas.maximized",Zy="fleet-console.canvas.dockExpanded",J5=400,bp=640,yp=400,ib=40,rb=96,Q5=.25,eT=1,Tf=.2,sb=.5,tT=.001,Ka={x:0,y:0,zoom:1},Za={viewport:Ka,panels:{},minimized:[]},Sp=new Set,wp=new Set,Cp=new Set,xp=new Set;let Bl=null,bs=null,_t=Za,Eu=RT(),Al=MT(),Tu=OT(),vs=Ka,Vs=null,io=0;function Jy(e){return Sp.add(e),()=>{Sp.delete(e)}}function ab(){return _t}function nT(){return H.useSyncExternalStore(Jy,ab,ab)}function iT(){return H.useSyncExternalStore(vT,ob,ob)}function Qy(){return H.useSyncExternalStore(yT,lb,lb)}function rT(){return H.useSyncExternalStore(Jy,cb,cb)}function sT(){return H.useSyncExternalStore(wT,ub,ub)}function er(e){_t={viewport:e.viewport??_t.viewport,panels:e.panels??_t.panels,minimized:e.minimized??_t.minimized},ET(),eS()}function Au(e){Ag();const n=kg(e);vs=n,er({viewport:n})}function aT(e){const n=kg(e);if(typeof window>"u"||typeof window.requestAnimationFrame!="function"||xT()){Au(n);return}vs=n,Vs===null&&(Vs=window.requestAnimationFrame(tS))}function kl(e,n){const r=co();er({panels:{..._t.panels,[e]:{...Rg(n,r),zIndex:r}}})}function oT(e){_t.minimized.includes(e)||er({minimized:[..._t.minimized,e]})}function lT(e){if(!_t.minimized.includes(e))return;const n=_t.minimized.filter(l=>l!==e),r=_t.panels[e];if(!r){er({minimized:n});return}const a=co();er({minimized:n,panels:{..._t.panels,[e]:{...r,zIndex:a}}})}function co(){return io+=1,io}function cT(e){io=Math.max(io,e)}function uT(e){const n=_t.panels[e];if(n)return n;const r=Object.keys(_t.panels).length,a={x:r*ib,y:r*ib,width:bp,height:yp,zIndex:co()};return er({panels:{..._t.panels,[e]:a}}),a}function hT(e){const n=new Set(e),r={};let a=!1;for(const[m,c]of Object.entries(_t.panels))n.has(m)?r[m]=c:a=!0;const l=_t.minimized.filter(m=>n.has(m)),p=l.length!==_t.minimized.length;(a||p)&&er({panels:r,minimized:l})}function dT(e){TT(),Ag(),Bl=e,_t=e?kT(e):Za,vs=_t.viewport,io=Math.max(io,rS(_t.panels)),eS()}function fT(e,n){const r=_t.panels[e];if(!r)return;const a=Math.max(Q5,Math.min(eT,Math.min((n.width-rb)/r.width,(n.height-rb)/r.height))),l={x:n.width/2-(r.x+r.width/2)*a,y:n.height/2-(r.y+r.height/2)*a,zoom:a};Ag(),vs=l;const p=co(),m=_t.minimized.includes(e);er({viewport:l,panels:{..._t.panels,[e]:{...Rg(r,p),zIndex:p}},...m?{minimized:_t.minimized.filter(c=>c!==e)}:{}})}function pT(){Eu=!Eu,LT(Eu),bT()}function gT(){mT(!Al)}function mT(e){Al!==e&&(Al=e,DT(Al),ST())}function _T(){Tu=!Tu,NT(Tu),CT()}function vT(e){return wp.add(e),()=>{wp.delete(e)}}function ob(){return Eu}function eS(){for(const e of Sp)e()}function bT(){for(const e of wp)e()}function yT(e){return Cp.add(e),()=>{Cp.delete(e)}}function lb(){return Al}function cb(){return _t.minimized}function ST(){for(const e of Cp)e()}function wT(e){return xp.add(e),()=>{xp.delete(e)}}function ub(){return Tu}function CT(){for(const e of xp)e()}function tS(){const e=_t.viewport,n=vs.x-e.x,r=vs.y-e.y,a=vs.zoom-e.zoom;if(Math.abs(n)<sb&&Math.abs(r)<sb&&Math.abs(a)<tT){Vs=null,er({viewport:vs});return}er({viewport:{x:e.x+n*Tf,y:e.y+r*Tf,zoom:e.zoom+a*Tf}}),Vs=typeof window<"u"?window.requestAnimationFrame(tS):null}function Ag(){Vs===null||typeof window>"u"||(window.cancelAnimationFrame(Vs),Vs=null)}function xT(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function ET(){!Bl||typeof window>"u"||(AT(),bs=window.setTimeout(()=>{bs=null,nS(Bl,_t)},J5))}function TT(){!bs||!Bl||typeof window>"u"||(window.clearTimeout(bs),bs=null,nS(Bl,_t))}function AT(){!bs||typeof window>"u"||(window.clearTimeout(bs),bs=null)}function kT(e){if(typeof window>"u")return Za;try{const n=window.localStorage.getItem(iS(e));if(!n)return Za;const r=JSON.parse(n);return BT(r)}catch{return Za}}function nS(e,n){if(!(!e||typeof window>"u"))try{window.localStorage.setItem(iS(e),JSON.stringify(n))}catch{}}function RT(){if(typeof window>"u")return!0;try{const e=window.localStorage.getItem(Yy);return e===null?!0:e==="true"}catch{return!0}}function LT(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Yy,String(e))}catch{}}function MT(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(Xy)==="true"}catch{return!1}}function DT(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Xy,String(e))}catch{}}function OT(){if(typeof window>"u")return!0;try{const e=window.localStorage.getItem(Zy);return e===null?!0:e==="true"}catch{return!0}}function NT(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Zy,String(e))}catch{}}function iS(e){return`${Z5}${e}`}function BT(e){if(!Il(e))return Za;const n=jT(e.panels);return{viewport:kg(e.viewport),panels:n,minimized:IT(e.minimized,n)}}function IT(e,n){if(!Array.isArray(e))return[];const r=new Set,a=[];for(const l of e)typeof l!="string"||r.has(l)||!(l in n)||(r.add(l),a.push(l));return a}function kg(e){if(!Il(e))return Ka;const n=Rl(e.x,Ka.x),r=Rl(e.y,Ka.y),a=Ep(e.zoom,Ka.zoom);return{x:n,y:r,zoom:a}}function jT(e){if(!Il(e))return{};const n={};for(const[r,a]of Object.entries(e))Il(a)&&(n[r]=Rg(a,$T(n)));return n}function Rg(e,n){return Il(e)?{x:Rl(e.x,0),y:Rl(e.y,0),width:Ep(e.width,bp),height:Ep(e.height,yp),zIndex:Rl(e.zIndex,n)}:{x:0,y:0,width:bp,height:yp,zIndex:n}}function $T(e){return rS(e)+1}function rS(e){return Math.max(0,...Object.values(e).map(n=>n.zIndex))}function Rl(e,n){return typeof e=="number"&&Number.isFinite(e)?e:n}function Ep(e,n){return typeof e=="number"&&Number.isFinite(e)&&e>0?e:n}function Il(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const sS="fleet-console.codex.view-mode",aS="fleet-console.codex.side-width",Af="route",wl=460,zT=120,Tp=new Set;let Ap=qT(),kp=WT(),oS=!1;function PT(){return H.useSyncExternalStore(Lg,hb,hb)}function HT(e){if(oS=!0,Ap===e){Rp();return}Ap=e,uS(sS,e),Rp()}function UT(){return H.useSyncExternalStore(Lg,fb,fb)}function lS(){return H.useSyncExternalStore(Lg,db,db)}function FT(e){const n=cS(e);kp!==n&&(kp=n,uS(aS,String(n)),Rp())}function Lg(e){return Tp.add(e),()=>{Tp.delete(e)}}function hb(){return Ap}function db(){return kp}function fb(){return oS}function Rp(){for(const e of Tp)e()}function cS(e){return Number.isFinite(e)?Math.max(zT,Math.round(e)):wl}function qT(){if(typeof window>"u")return Af;try{const e=window.localStorage.getItem(sS);return e==="route"||e==="side"?e:Af}catch{return Af}}function WT(){if(typeof window>"u")return wl;try{const e=window.localStorage.getItem(aS);if(e===null)return wl;const n=Number.parseInt(e,10);return Number.isNaN(n)?wl:cS(n)}catch{return wl}}function uS(e,n){if(!(typeof window>"u"))try{window.localStorage.setItem(e,n)}catch{}}const GT=["canonicalCwd","cwd","providerSession","ticket","token","transcriptPath"];class Ue extends Error{status;constructor(n,r){super(r),this.name="ApiError",this.status=n}}async function hS(e){const n=await fetch("/observer/tenants",{signal:e});await Ln(n);const r=await n.json();if(!Array.isArray(r.tenants))throw new Ue(n.status,"Invalid tenants response");return r.tenants.map(a=>aA(a,n.status))}async function KT(e){const n=await fetch("/observer/jobs",{signal:e});return await Ln(n),(await n.json()).tenants}async function VT(e){const n=await fetch("/observer/events",{signal:e});if(await Ln(n),!n.body)throw new Ue(n.status,"Observer stream unavailable");return n.body.getReader()}async function dS(e){const n=await fetch("/observer/theaters",{signal:e});await Ln(n);const r=await n.json();if(!Array.isArray(r.theaters))throw new Ue(n.status,"Invalid Theater response");const a=Array.isArray(r.agentClis)?r.agentClis.map(l=>sA(l,n.status)):[];return{theaters:r.theaters.map(l=>bS(l,n.status)),agentClis:a}}async function YT(e,n){const r=e?`?theaterId=${encodeURIComponent(e)}`:"",a=await fetch(`/observer/status${r}`,{signal:n});return await Ln(a),oA(await a.json(),a.status)}async function fS(e={}){const n=e.force?"?force=true":"",r=await fetch(`/observer/release-notes${n}`,{signal:e.signal});return await Ln(r),cA(await r.json(),r.status)}async function XT(e){const n=await fetch("/update/apply",{method:"POST",signal:e});return await Ln(n),lA(await n.json(),n.status)}async function pS(e,n){const r=await fetch("/observer/theaters",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({folderGrantId:e}),signal:n});await Ln(r);const a=await r.json();return bS(a,r.status)}async function pb(e,n,r){const a=await fetch(`/observer/theaters/${encodeURIComponent(e)}/sessions`,{method:"POST",...n?{headers:{"Content-Type":"application/json"},body:JSON.stringify({cliId:n})}:{},signal:r});return await Ln(a),rh(await a.json(),a.status)}async function ZT(e,n){const r=await fetch("/terminal/folders/list",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e}),signal:n});return await Ln(r),iA(await r.json(),r.status)}async function gS(e,n){const r=await fetch("/terminal/folders/grants",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e}),signal:n});await Ln(r);const a=await r.json();if(typeof a.folderGrantId!="string")throw new Ue(r.status,"Invalid folder grant response");return a.folderGrantId}async function mS(e,n){const r=await fetch(`/terminal/sessions/${encodeURIComponent(e)}`,{method:"DELETE",signal:n});await Ln(r)}async function _S(e,n){const r=await fetch(`/terminal/sessions/${encodeURIComponent(e)}/resume`,{method:"POST",signal:n});return await Ln(r),rh(await r.json(),r.status)}async function JT(e,n){const r=await fetch(`/observer/theaters/${encodeURIComponent(e)}`,{method:"DELETE",signal:n});await Ln(r)}async function QT(e,n){const r=await fetch(`/terminal/sessions/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({label:n})});return await Ln(r),rh(await r.json(),r.status)}async function eA(e){const n=await fetch("/terminal/sessions",{signal:e});await Ln(n);const r=await n.json();if(!Array.isArray(r.sessions))throw new Ue(n.status,"Invalid terminal sessions response");return r.sessions.map(a=>rh(a,n.status))}async function tA(e,n){const r=nA(n),a=await fetch("/terminal/ticket",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:e,...r.kind?{kind:r.kind}:{},...r.theaterId?{theaterId:r.theaterId}:{}}),signal:r.signal});await Ln(a);const l=await a.json();if(typeof l.ticket!="string"||typeof l.ttlMs!="number")throw new Ue(a.status,"Invalid terminal ticket response");return{ticket:l.ticket,ttlMs:l.ttlMs}}function nA(e){return e?e instanceof AbortSignal?{signal:e}:e:{}}function rh(e,n){const r=e;if(!r||typeof r.sessionId!="string"||typeof r.cwdLabel!="string"||typeof r.sequence!="number"||typeof r.status!="string"||typeof r.createdAt!="number"||vS(r))throw new Ue(n,"Invalid terminal session response");return{sessionId:r.sessionId,terminalSessionId:typeof r.terminalSessionId=="string"?r.terminalSessionId:r.sessionId,cwdLabel:r.cwdLabel,sequence:r.sequence,label:typeof r.label=="string"?r.label:void 0,cliId:typeof r.cliId=="string"?r.cliId:void 0,cliLabel:typeof r.cliLabel=="string"?r.cliLabel:void 0,status:r.status,turnState:r.turnState==="running"||r.turnState==="ended"?r.turnState:"none",createdAt:r.createdAt,theaterId:typeof r.theaterId=="string"?r.theaterId:void 0,tenantId:typeof r.tenantId=="string"?r.tenantId:void 0,registrationId:typeof r.registrationId=="string"?r.registrationId:void 0,resumeAvailable:r.resumeAvailable===!0}}function iA(e,n){const r=e;if(!r||typeof r.path!="string"||r.parentPath!==null&&typeof r.parentPath!="string"||!Array.isArray(r.roots)||!r.roots.every(a=>typeof a=="string")||!Array.isArray(r.entries))throw new Ue(n,"Invalid folder list response");return{path:r.path,parentPath:r.parentPath,roots:r.roots,entries:r.entries.map(a=>rA(a,n)),...r.truncated===!0?{truncated:!0}:{}}}function rA(e,n){const r=e;if(!r||typeof r.name!="string"||typeof r.path!="string"||r.kind!=="dir"||typeof r.accessible!="boolean")throw new Ue(n,"Invalid folder list response");return{name:r.name,path:r.path,kind:"dir",accessible:r.accessible}}function sA(e,n){const r=e;if(!r||typeof r.id!="string"||typeof r.label!="string"||typeof r.available!="boolean"||typeof r.signedIn!="boolean")throw new Ue(n,"Invalid Agent CLI metadata response");return{id:r.id,label:r.label,available:r.available,signedIn:r.signedIn}}function aA(e,n){const r=e;if(!r||typeof r.tenantId!="string"||typeof r.tenantLabel!="string"||typeof r.createdAt!="number"||typeof r.sessions!="number"||vS(r))throw new Ue(n,"Invalid tenants response");return{tenantId:r.tenantId,tenantLabel:r.tenantLabel,createdAt:r.createdAt,sessions:r.sessions,status:r.status,cliRunId:typeof r.cliRunId=="string"?r.cliRunId:void 0,registrationId:typeof r.registrationId=="string"?r.registrationId:void 0,theaterId:typeof r.theaterId=="string"?r.theaterId:void 0,terminalSessionId:typeof r.terminalSessionId=="string"?r.terminalSessionId:void 0}}function vS(e){return GT.some(n=>n in e)}function oA(e,n){const r=e;if(!r||typeof r.workspaces!="number"||typeof r.jobs!="number"||typeof r.version!="string"||r.channel!=="stable"&&r.channel!=="local"&&r.channel!=="unknown"||typeof r.updateAvailable!="boolean"||r.latestVersion!==void 0&&typeof r.latestVersion!="string"||typeof r.port!="number"||r.wikiServerStatus!=="available"&&r.wikiServerStatus!=="unavailable"&&r.wikiServerStatus!=="unknown"||"token"in r||"path"in r||"cwd"in r||"knowledgeRoot"in r)throw new Ue(n,"Invalid observer status response");return{workspaces:r.workspaces,jobs:r.jobs,version:r.version,channel:r.channel,updateAvailable:r.updateAvailable,...r.latestVersion!==void 0?{latestVersion:r.latestVersion}:{},port:r.port,wikiServerStatus:r.wikiServerStatus}}function lA(e,n){const r=e;if(!r||r.status!=="accepted"||"packageName"in r||"packageVersion"in r||"path"in r||"token"in r)throw new Ue(n,"Invalid update apply response");return{status:"accepted"}}function cA(e,n){const r=e;if(!r||!Array.isArray(r.notes)||r.sourceRef!=="main"||typeof r.fetchedAt!="number"||typeof r.stale!="boolean"||"url"in r||"token"in r||"path"in r)throw new Ue(n,"Invalid release notes response");return{notes:r.notes.map(a=>uA(a,n)),sourceRef:"main",fetchedAt:r.fetchedAt,stale:r.stale}}function uA(e,n){const r=e;if(!r||typeof r.version!="string"||r.date!==null&&typeof r.date!="string"||!Array.isArray(r.sections))throw new Ue(n,"Invalid release notes response");return{version:r.version,date:r.date,sections:r.sections.map(a=>hA(a,n))}}function hA(e,n){const r=e;if(!r||r.heading!=="Added"&&r.heading!=="Changed"&&r.heading!=="Fixed"&&r.heading!=="Removed"&&r.heading!=="Breaking Changes"||!Array.isArray(r.items))throw new Ue(n,"Invalid release notes response");return{heading:r.heading,items:r.items.map(a=>dA(a,n))}}function dA(e,n){const r=e;if(!r||!Array.isArray(r.packageTags)||!r.packageTags.every(a=>typeof a=="string")||typeof r.text!="string")throw new Ue(n,"Invalid release notes response");return{packageTags:r.packageTags,text:r.text}}function bS(e,n){const r=e;if(!r||typeof r.id!="string"||typeof r.label!="string"||"path"in r||typeof r.createdAt!="string"||typeof r.lastOpenedAt!="string"||typeof r.hasWiki!="boolean"||typeof r.activeAdmiralCount!="number")throw new Ue(n,"Invalid Theater response");return{id:r.id,label:r.label,createdAt:r.createdAt,lastOpenedAt:r.lastOpenedAt,hasWiki:r.hasWiki,activeAdmiralCount:r.activeAdmiralCount}}async function Ln(e){if(e.ok)return;let n=e.statusText;try{n=(await e.json()).error??n}catch{}throw new Ue(e.status,n||`HTTP ${e.status}`)}const gb=120,fA="active",Lp=new Set(["done","error","aborted"]);function pA(e,n){let r=SS(e,n.jobId,n.updatedAt);for(const a of n.events)r=yS(r,a);return Lp.has(n.status)&&!Lp.has(r.status)&&(r={...r,status:n.status}),r}function yS(e,n){if(n.id<=e.lastEventId)return e;const r=n.event,a={...e,updatedAt:n.at,lastEventId:n.id,recentEvents:yA(e.recentEvents,n)};switch(n.type){case"job:registered":return vA(a,r);case"job:finalized":return{...a,status:un(r.status)??"done",finishedAt:fs(r.finishedAt)??n.at,summary:un(r.summary),error:un(r.error)};case"track:begin":return za(a,r,l=>({...l,startedAt:fs(r.startedAt)??n.at,requestPreview:un(r.requestPreview)}));case"track:status":return za(a,r,l=>({...l,status:un(r.status)??l.status}));case"track:text":return za(a,r,l=>({...l,status:"stream",text:l.text+(un(r.text)??""),sentTextLength:l.sentTextLength+(fs(r.textLength)??un(r.text)?.length??0)}));case"track:thought":return za(a,r,l=>({...l,thought:l.thought+(un(r.text)??""),sentThoughtLength:l.sentThoughtLength+(fs(r.textLength)??un(r.text)?.length??0)}));case"track:tool":return za(a,r,l=>({...l,status:"stream",tools:bA(l.tools,r)}));case"track:finalized":return za(a,r,l=>{const p=_b(l.text,l.sentTextLength,un(r.fallbackText),fs(r.fallbackTextLength)),m=_b(l.thought,l.sentThoughtLength,un(r.fallbackThought),fs(r.fallbackThoughtLength));return{...l,status:un(r.status)??"done",finishedAt:fs(r.finishedAt)??n.at,error:un(r.error),text:p.text,sentTextLength:p.sentLength,thought:m.text,sentThoughtLength:m.sentLength}});default:return a}}function SS(e,n,r){return{jobId:n,tenantId:e,status:fA,updatedAt:r,trackOrder:[],tracks:{},lastEventId:0,recentEvents:[]}}function Mg(e){return Lp.has(e)}function gA(e){return e.operationsViewActive?new Set:new Set}function mA(e,n){const r=[],a=[];for(const l of e)n.has(l.sessionId)?a.push(l):r.push(l);return{hidden:r,visible:a}}function mb(e){const n=new Map;for(const r of[...e].sort((a,l)=>l.lastRaisedSeq-a.lastRaisedSeq)){const a=r.theaterId??"__unknown__",l=n.get(a)??{theaterId:r.theaterId,theaterLabel:r.theaterLabel,notifications:[],totalCount:0};l.notifications.push(r),l.totalCount+=r.count,n.set(a,l)}return[...n.values()].sort((r,a)=>{const l=r.notifications[0]?.lastRaisedSeq??0;return(a.notifications[0]?.lastRaisedSeq??0)-l})}function _A(e,n){return n.globalMute||n.dnd?[]:e.filter(r=>!r.theaterId||n.mutedTheaterIds[r.theaterId]!==!0)}function vA(e,n){const r=Array.isArray(n.tracks)?n.tracks:[];let a=e.trackOrder,l=e.tracks;for(const p of r){if(!p.trackId)continue;const m=l[p.trackId],c={...m??wS(p.trackId),displayName:p.displayName??m?.displayName??p.trackId,displayCli:p.displayCli??m?.displayCli,model:p.model??m?.model,effort:p.effort??m?.effort,subtitle:p.subtitle??m?.subtitle,kind:p.kind??m?.kind,startedAt:p.startedAt??m?.startedAt};m||(a=[...a,p.trackId]),l={...l,[p.trackId]:c}}return{...e,label:un(n.label)??e.label,ownerCarrierId:un(n.ownerCarrierId)??e.ownerCarrierId,kind:un(n.kind)??e.kind,startedAt:fs(n.startedAt)??e.startedAt,trackOrder:a,tracks:l}}function za(e,n,r){const a=un(n.trackId);if(!a)return e;const l=e.tracks[a],p=r(l??wS(a));return{...e,trackOrder:l?e.trackOrder:[...e.trackOrder,a],tracks:{...e.tracks,[a]:p}}}function wS(e){return{trackId:e,displayName:e,status:"queued",text:"",thought:"",sentTextLength:0,sentThoughtLength:0,tools:[]}}function _b(e,n,r,a){const l=a??r?.length??0;return r!==void 0&&l>e.length?{text:r,sentLength:Math.max(l,n)}:{text:e,sentLength:Math.max(n,l)}}function bA(e,n){const r=un(n.title)??"tool",a=un(n.status)??"",l=un(n.toolCallId),p=l??`${r}#${e.length}`;if(l){const m=e.findIndex(c=>c.key===l);if(m>=0){const c=[...e];return c[m]={key:l,title:r,status:a},c}}return[...e,{key:p,title:r,status:a}]}function yA(e,n){const r=[...e,n];return r.length>gb?r.slice(-gb):r}function un(e){return typeof e=="string"?e:void 0}function fs(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function CS(e){return new Date(e).toLocaleTimeString([],{hour12:!1})}function Fl(e){return e.label?.trim()||`#${e.sequence} Operation`}function SA(e,n){const r=Math.max(0,Math.round((n-e)/1e3)),a=Math.floor(r/60),l=r%60;return a===0?`${l}s`:a<60?`${a}m ${String(l).padStart(2,"0")}s`:`${Math.floor(a/60)}h ${String(a%60).padStart(2,"0")}m`}function Mp(e){return e.length<=14?e:`${e.slice(0,6)}…${e.slice(-6)}`}function wA(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function Dp(e){switch(e){case"active":return"running";case"done":return"done";case"error":return"error";case"aborted":return"aborted";default:return e}}function CA(e){switch(e){case"queued":return"queued";case"conn":return"connecting";case"stream":return"streaming";case"done":return"done";case"err":return"error";case"aborted":return"aborted";default:return e}}function xS(e,n){return e.status==="dormant"?"tenant-beacon is-dormant":n>0?"tenant-beacon is-live":e.turnState==="running"?"tenant-beacon is-turn-running":e.turnState==="ended"?"tenant-beacon is-turn-ended":"tenant-beacon"}function sh(e){switch(e){case"stream":case"active":case"conn":return"live";case"done":return"ok";case"err":case"error":return"bad";default:return"idle"}}function xA(e){if(e.status!=="active")return null;const n=e.trackOrder.map(l=>e.tracks[l]).filter(l=>!!l),r=n.filter(l=>l.status==="stream"||l.status==="conn"),a=r.length>0?r:n;for(let l=a.length-1;l>=0;l--){const p=a[l],m=p?EA(p):null;if(m)return m}return null}function EA(e){return vb(e.text)??vb(e.thought)??e.tools[e.tools.length-1]?.title??null}function vb(e){if(!e)return null;const n=e.split(`
12
- `);for(let r=n.length-1;r>=0;r--){const a=n[r]?.trim();if(a)return a}return null}const TA="__unassigned__";function AA(e){const n=new Map(e.theaters.map(a=>[a.id,a])),r=[];for(const a of e.sessionOrder){const l=e.sessions[a];l&&l.theaterId&&r.push(LA(l,n.get(l.theaterId)))}return r}function kA(e,n){const r=ES(n);return r.length===0?e:e.filter(a=>{const l=MA(a);return r.every(p=>l.includes(p))})}function RA(e){const n=[],r=new Map;for(const a of e){const l=a.theaterId??TA,p=r.get(l);if(p!==void 0){const m=n[p];m&&(n[p]={...m,entries:[...m.entries,a]});continue}r.set(l,n.length),n.push({theaterId:a.theaterId,theaterLabel:a.theaterLabel,entries:[a]})}return n}function ES(e){return e.trim().toLocaleLowerCase().split(/\s+/).filter(Boolean)}function LA(e,n){return{sessionId:e.sessionId,theaterId:e.theaterId??null,theaterLabel:n?.label??e.theaterId??"",operationName:Fl(e),cliLabel:e.cliLabel,status:e.status}}function MA(e){return[e.operationName,e.theaterLabel,e.cliLabel??""].join(" ").toLocaleLowerCase()}const DA="fleet-console.canvas.shell.",OA=400,bb=560,yb=360,Op=new Set;let ei={},Zs=null,Js=null,ys=null;function NA(){return H.useSyncExternalStore(TS,Cb,Cb)}function BA(){return H.useSyncExternalStore(TS,Sb,Sb)}function Sb(){return Zs}function Pu(e){Zs!==e&&(Zs=e,uo())}function IA(e,n){const r=qA();return ei={...ei,[r]:{theaterId:e,geometry:n}},Dg(),uo(),r}function kf(e,n){const r=ei[e];r&&(ei={...ei,[e]:{...r,geometry:n}},Dg(),uo())}function wb(e){if(!(e in ei))return;const n={...ei};delete n[e],ei=n,Zs===e&&(Zs=null),Dg(),uo()}function jA(e){zA(),Js=e,ei=e?PA(e):{},Zs=null,cT(FA(ei)),uo()}function $A(e){if(typeof window<"u")try{window.sessionStorage.removeItem(Og(e))}catch{}Js===e&&(AS(),Js=null,ei={},Zs=null,uo())}function TS(e){return Op.add(e),()=>{Op.delete(e)}}function Cb(){return ei}function uo(){for(const e of Op)e()}function Dg(){!Js||typeof window>"u"||(AS(),ys=window.setTimeout(()=>{ys=null,kS(Js,ei)},OA))}function zA(){!ys||!Js||typeof window>"u"||(window.clearTimeout(ys),ys=null,kS(Js,ei))}function AS(){!ys||typeof window>"u"||(window.clearTimeout(ys),ys=null)}function PA(e){if(typeof window>"u")return{};try{const n=window.sessionStorage.getItem(Og(e));return n?HA(JSON.parse(n),e):{}}catch{return{}}}function kS(e,n){if(!(!e||typeof window>"u"))try{window.sessionStorage.setItem(Og(e),JSON.stringify({panels:n}))}catch{}}function Og(e){return`${DA}${e}`}function HA(e,n){if(!ku(e)||!ku(e.panels))return{};const r={};for(const[a,l]of Object.entries(e.panels))!a.startsWith("shell:")||!ku(l)||l.theaterId===n&&(r[a]={theaterId:n,geometry:UA(l.geometry)});return r}function UA(e){return ku(e)?{x:Rf(e.x,0),y:Rf(e.y,0),width:xb(e.width,bb),height:xb(e.height,yb),zIndex:Rf(e.zIndex,0)}:{x:0,y:0,width:bb,height:yb,zIndex:0}}function FA(e){return Math.max(0,...Object.values(e).map(n=>n.geometry.zIndex))}function Rf(e,n){return typeof e=="number"&&Number.isFinite(e)?e:n}function xb(e,n){return typeof e=="number"&&Number.isFinite(e)&&e>0?e:n}function ku(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function qA(){return`shell:${typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}`}const Np=200,Bp="fleet-console.activeTheaterId",RS="fleet-console.activeTheme",LS="fleet-console.terminalRenderer",MS="fleet-console.commissioningSeen",DS="fleet-console.whatsNewSeenVersion",OS="fleet-console.notificationPreferences",NS=1,Lf="maritime",Mf="webgl",au={globalMute:!1,dnd:!1,mutedTheaterIds:{}},Ip=new Set;let jp=null,ve={connection:"connecting",connectionError:null,activeTheme:nw(),terminalRenderer:XA(),version:"",updateAvailable:!1,latestVersion:null,tenants:[],theaters:[],agentClis:[],activeTheaterId:null,addingTheater:!1,theaterError:null,sessions:{},sessionOrder:[],activeTerminalSessionId:null,operationsViewActive:!1,creatingTerminalSession:!1,terminalSessionError:null,tenantJobs:{},tenantOrder:[],timelineOpen:!1,operationSearchOpen:!1,shortcutsOpen:!1,whatsNewOpen:!1,releaseNotes:[],releaseNotesLoading:!1,releaseNotesError:null,releaseNotesSourceRef:null,releaseNotesFetchedAt:null,releaseNotesStale:!1,automaticWhatsNewVersion:null,selectedReleaseNoteKey:null,onboardingOpen:!1,bootstrapped:!1,terminalSessionsHydrated:!1,pendingOperationFocus:null,selectedJobId:null,operationNotifications:{},notificationPreferences:Ck()},Eb=0;function Tb(){return ve}function WA(e){return Ip.add(e),()=>{Ip.delete(e)}}function ze(e){ve={...ve,...e},iw()}function GA(e){ve.operationsViewActive!==e&&ze({operationsViewActive:e})}function KA(){$S(nw())}function VA(e){Tk(e),$S(e),ze({activeTheme:e})}function YA(e){Ak(e),ze({terminalRenderer:e})}function XA(){if(typeof window>"u")return Mf;try{const e=window.localStorage.getItem(LS);return e==="webgl"||e==="dom"?e:Mf}catch{return Mf}}function ZA(e){ze({version:e.version,updateAvailable:e.updateAvailable,latestVersion:e.latestVersion??null,...VS({...ve,version:e.version})})}function BS(){ze({releaseNotesLoading:!0,releaseNotesError:null})}function IS(e){const n={...ve,releaseNotes:e.notes,releaseNotesLoading:!1,releaseNotesError:null,releaseNotesSourceRef:e.sourceRef,releaseNotesFetchedAt:e.fetchedAt,releaseNotesStale:e.stale,selectedReleaseNoteKey:ve.selectedReleaseNoteKey&&XS(e.notes,ve.selectedReleaseNoteKey)?ve.selectedReleaseNoteKey:YS(e.notes)};ze({releaseNotes:n.releaseNotes,releaseNotesLoading:n.releaseNotesLoading,releaseNotesError:n.releaseNotesError,releaseNotesSourceRef:n.releaseNotesSourceRef,releaseNotesFetchedAt:n.releaseNotesFetchedAt,releaseNotesStale:n.releaseNotesStale,...VS(n)})}function jS(e){ze({releaseNotesLoading:!1,releaseNotesError:e})}function $S(e){if(!(typeof document>"u")){if(e==="maritime"){document.documentElement.removeAttribute("data-theme");return}document.documentElement.setAttribute("data-theme",e)}}function JA(e){const n={};for(const l of e)n[l.sessionId]=oh(l);const r=[...e].sort((l,p)=>p.createdAt-l.createdAt).map(l=>l.sessionId),a=ew(n,ve.tenants);ze({sessions:a,sessionOrder:r,activeTerminalSessionId:Ss(ve.activeTheaterId,a,r,ve.activeTerminalSessionId),terminalSessionsHydrated:!0})}function zS(e){const n=tw(e.theaters,ve.activeTheaterId);ze({theaters:e.theaters,agentClis:e.agentClis,activeTheaterId:n,activeTerminalSessionId:Ss(n,ve.sessions,ve.sessionOrder,ve.activeTerminalSessionId),selectedJobId:null})}function QA(e){ch(e),ze({activeTheaterId:e,activeTerminalSessionId:Ss(e,ve.sessions,ve.sessionOrder,null),selectedJobId:null})}function PS(){ze({addingTheater:!0,theaterError:null})}function HS(e){const n=[e,...ve.theaters.filter(r=>r.id!==e.id)];ch(e.id),ze({theaters:n,activeTheaterId:e.id,addingTheater:!1,theaterError:null,activeTerminalSessionId:Ss(e.id,ve.sessions,ve.sessionOrder,null),selectedJobId:null})}function ek(){ze({addingTheater:!1,theaterError:null})}function $p(e){ze({addingTheater:!1,theaterError:e})}function Pi(e){ze({activeTerminalSessionId:e,selectedJobId:null,operationNotifications:e?lh(ve.operationNotifications,e):ve.operationNotifications})}function Ng(e){const n=ve.sessions[e];n&&(ch(n.theaterId??null),ze({activeTheaterId:n.theaterId??null,activeTerminalSessionId:e,selectedJobId:null,pendingOperationFocus:e,operationNotifications:lh(ve.operationNotifications,e)}))}function Ab(){ve.pendingOperationFocus!==null&&ze({pendingOperationFocus:null})}function tk(e,n,r){if(e.length===0)return null;const a=n?e.indexOf(n):-1,l=a===-1?r>0?0:e.length-1:(a+r+e.length)%e.length;return e[l]??null}function Df(){ze({operationSearchOpen:!1})}function nk(){ze({operationSearchOpen:!ve.operationSearchOpen})}function kb(){ze({creatingTerminalSession:!0,terminalSessionError:null})}function Rb(e){const n=oh(e);ze({sessions:{...ve.sessions,[n.sessionId]:n},sessionOrder:[n.sessionId,...ve.sessionOrder.filter(r=>r!==n.sessionId)],activeTerminalSessionId:!ve.activeTheaterId||Uu(n,ve.activeTheaterId)?n.sessionId:ve.activeTerminalSessionId,creatingTerminalSession:!1,terminalSessionError:null,selectedJobId:null})}function ah(e){const n=ve.sessions[e.sessionId],r=oh({...n??{},...e}),a=!!n,l={...ve.sessions,[r.sessionId]:r},p=a?ve.sessionOrder:[r.sessionId,...ve.sessionOrder.filter(c=>c!==r.sessionId)],m=n?bk(ve.operationNotifications,n,r):ve.operationNotifications;ze({sessions:l,sessionOrder:p,activeTerminalSessionId:Ss(ve.activeTheaterId,l,p,ve.activeTerminalSessionId),operationNotifications:m})}function ik(e,n){const r=ve.sessions[e.sessionId]??oh(e);n==="idle_prompt"&&QS(r)||ze({operationNotifications:JS(ve.operationNotifications,ZS("input-waiting",r))})}function rk(e){const n={...ve.notificationPreferences,globalMute:e};jg(n),ze({notificationPreferences:n})}function sk(e){const n={...ve.notificationPreferences,dnd:e};jg(n),ze({notificationPreferences:n})}function ak(e){const n={...ve.notificationPreferences.mutedTheaterIds};n[e]?delete n[e]:n[e]=!0;const r={...ve.notificationPreferences,mutedTheaterIds:n};jg(r),ze({notificationPreferences:r})}function Lb(e){ze({creatingTerminalSession:!1,terminalSessionError:e})}function ok(){ze({timelineOpen:!ve.timelineOpen})}function lk(){ve.shortcutsOpen||ze({shortcutsOpen:!0})}function Of(){ve.shortcutsOpen&&ze({shortcutsOpen:!1})}function ck(){ve.releaseNotes.length===0||ve.whatsNewOpen||ze({whatsNewOpen:!0,selectedReleaseNoteKey:ve.selectedReleaseNoteKey??YS(ve.releaseNotes)})}function ou(){ve.whatsNewOpen&&(ve.automaticWhatsNewVersion&&Rk(ve.automaticWhatsNewVersion),ze({whatsNewOpen:!1,automaticWhatsNewVersion:null}))}function Mb(e){XS(ve.releaseNotes,e)&&ze({selectedReleaseNoteKey:e})}function ul(){kk(!0),ve.onboardingOpen&&ze({onboardingOpen:!1})}function Db(){if(ve.bootstrapped)return;const e=ve.theaters.length===0&&!xk();ze({bootstrapped:!0,onboardingOpen:e?!0:ve.onboardingOpen})}function US(e){ze({terminalSessionError:e})}function FS(e){ze({terminalSessionError:e})}function uk(e){ze({terminalSessionError:e})}function Ob(e){$A(e);const n=ve.theaters.filter(m=>m.id!==e),r={},a=[];for(const m of ve.sessionOrder){const c=ve.sessions[m];!c||c.theaterId===e||(r[m]=c,a.push(m))}const l=tw(n,ve.activeTheaterId===e?null:ve.activeTheaterId),p=yk(ve.operationNotifications,e);ch(l),ze({theaters:n,sessions:r,sessionOrder:a,activeTheaterId:l,activeTerminalSessionId:Ss(l,r,a,ve.activeTerminalSessionId),selectedJobId:null,operationNotifications:p})}function qS(e){if(!ve.sessions[e])return;const n={...ve.sessions};delete n[e];const r=ve.sessionOrder.filter(l=>l!==e),a=ve.activeTerminalSessionId===e;ze({sessions:n,sessionOrder:r,activeTerminalSessionId:a?Ss(ve.activeTheaterId,n,r,null):ve.activeTerminalSessionId,selectedJobId:a?null:ve.selectedJobId,operationNotifications:lh(ve.operationNotifications,e)})}function WS(e){ze({selectedJobId:ve.selectedJobId===e?null:e})}function Nf(){ze({selectedJobId:null})}function GS(e){const n=new Set(e.map(l=>l.tenantId)),r=ew(ve.sessions,e),a=[...e.map(l=>l.tenantId),...ve.tenantOrder.filter(l=>!n.has(l)&&ve.tenantJobs[l])];ze({tenants:e,sessions:r,tenantOrder:a,activeTerminalSessionId:Ss(ve.activeTheaterId,r,ve.sessionOrder,ve.activeTerminalSessionId)})}function hk(e){const n={},r=[];for(const l of e){const p={};for(const c of l.jobs)p[c.jobId]=pA(l.tenantId,c);const m=Object.values(p).sort((c,u)=>(c.startedAt??c.updatedAt)-(u.startedAt??u.updatedAt)).map(c=>c.jobId);n[l.tenantId]={tenantId:l.tenantId,tenantLabel:l.tenantLabel,jobOrder:m,jobs:p,truncation:l.truncation},r.push(l.tenantId)}const a=[...ve.tenantOrder.filter(l=>n[l]),...r.filter(l=>!ve.tenantOrder.includes(l))];ze({tenantJobs:n,tenantOrder:a.length>0?a:r})}function dk(e,n){const r=ve.tenantJobs[e.tenantId],a=!r&&!ve.tenants.some(c=>c.tenantId===e.tenantId),l=r??{tenantId:e.tenantId,tenantLabel:n,jobOrder:[],jobs:{},truncation:{droppedCount:0}};let p=n&&l.tenantLabel!==n?{...l,tenantLabel:n}:l;if(e.jobId){const c=p.jobs[e.jobId],u=yS(c??SS(e.tenantId,e.jobId,e.at),e),h=c?p.jobOrder:[...p.jobOrder,e.jobId];p={...p,jobs:Lk({...p.jobs,[e.jobId]:u},h),jobOrder:h.slice(-Np)}}const m={...ve.tenantJobs,[e.tenantId]:p};return ve={...ve,connection:"live",connectionError:null,tenantJobs:m,tenantOrder:ve.tenantOrder.includes(e.tenantId)?ve.tenantOrder:[...ve.tenantOrder,e.tenantId]},iw(),{unknownTenant:a}}function fk(e,n,r){const a=ve.tenantJobs[e]??{tenantId:e,tenantLabel:n,jobOrder:[],jobs:{},truncation:{droppedCount:0}};ze({tenantJobs:{...ve.tenantJobs,[e]:{...a,truncation:r}},tenantOrder:ve.tenantOrder.includes(e)?ve.tenantOrder:[...ve.tenantOrder,e]})}function pk(e){if(!e.selectedJobId||e.activeTheaterId&&e.activeTerminalSessionId&&!Hu(e).includes(e.activeTerminalSessionId))return null;const n=gk(e);return n?e.tenantJobs[n]?.jobs[e.selectedJobId]??null:null}function gk(e){return e.activeTerminalSessionId?Bg(e.sessions[e.activeTerminalSessionId]):null}function mk(e){return Hu(e).map(n=>e.sessions[n]).filter(n=>!!n)}function Hu(e){return e.activeTheaterId?e.sessionOrder.filter(n=>Uu(e.sessions[n],e.activeTheaterId)):[]}function _k(e){return AA(e)}function KS(e,n){const r=Bg(n);if(!r)return[];const a=e.tenantJobs[r];if(!a)return[];const l=[];for(const p of a.jobOrder){const m=a.jobs[p];m&&l.push({job:m,tenant:a})}return l}function Bg(e){return e?.tenantId??e?.sessionId??null}function oh(e){return{...e,terminalSessionId:e.terminalSessionId??e.sessionId,status:e.status==="starting"&&e.tenantId?"registered":e.status,turnState:e.turnState??"none",resumeAvailable:e.resumeAvailable===!0}}function VS(e){const n=e.releaseNotes.findIndex(a=>a.version!=="Unreleased"),r=n>=0?e.releaseNotes[n]:void 0;return!r||!e.version||r.version!==e.version||Ek()===r.version?{whatsNewOpen:e.whatsNewOpen,automaticWhatsNewVersion:e.automaticWhatsNewVersion,selectedReleaseNoteKey:e.selectedReleaseNoteKey}:{whatsNewOpen:!0,automaticWhatsNewVersion:r.version,selectedReleaseNoteKey:Ig(r.version,n)}}function YS(e){return e[0]?Ig(e[0].version,0):null}function XS(e,n){return e.some((r,a)=>Ig(r.version,a)===n)}function Ig(e,n){return`${e}:${n}`}function vk(e){return e?ve.theaters.find(n=>n.id===e)?.label??e:"—"}function ZS(e,n){return Eb+=1,{kind:e,sessionId:n.sessionId,theaterId:n.theaterId??null,theaterLabel:vk(n.theaterId),operationLabel:Fl(n),count:1,lastRaisedSeq:Eb}}function bk(e,n,r){return n.turnState!=="running"&&r.turnState==="running"?lh(e,r.sessionId):n.turnState!=="ended"&&r.turnState==="ended"&&!QS(r)?JS(e,ZS("ended",r)):e}function JS(e,n){const r=e[n.sessionId];return{...e,[n.sessionId]:{...n,count:r?.kind==="input-waiting"&&n.kind==="input-waiting"?r.count+1:1}}}function lh(e,n){if(!e[n])return e;const r={...e};return delete r[n],r}function yk(e,n){let r=!1;const a={};for(const[l,p]of Object.entries(e)){if(p.theaterId===n){r=!0;continue}a[l]=p}return r?a:e}function QS(e){const n=Bg(e);return n?Sk(ve.tenantJobs[n]):!1}function Sk(e){return e?e.jobOrder.some(n=>{const r=e.jobs[n];return r?!r.finishedAt&&!Mg(r.status):!1}):!1}function ew(e,n){const r={...e};for(const a of n){if(!a.terminalSessionId)continue;const l=r[a.terminalSessionId];l&&(r[a.terminalSessionId]={...l,status:a.status==="closed"?"closed":a.status==="dormant"?"dormant":"registered",tenantId:a.tenantId,registrationId:a.registrationId,theaterId:a.theaterId??l.theaterId})}return r}function tw(e,n){const r=new Set(e.map(l=>l.id)),a=wk();return a&&r.has(a)?a:n&&r.has(n)?n:e[0]?.id??null}function Ss(e,n,r,a){return e?a&&Uu(n[a],e)&&lu(n[a])?a:r.find(l=>Uu(n[l],e)&&lu(n[l]))??null:a&&n[a]&&lu(n[a])?a:r.find(l=>lu(n[l]))??null}function Uu(e,n){return!e||!n?!1:e.theaterId===n}function lu(e){return!!(e&&e.status!=="dormant")}function wk(){if(typeof window>"u")return null;try{return window.localStorage.getItem(Bp)}catch{return null}}function ch(e){if(!(typeof window>"u"))try{e?window.localStorage.setItem(Bp,e):window.localStorage.removeItem(Bp)}catch{}}function nw(){if(typeof window>"u")return Lf;try{const e=window.localStorage.getItem(RS);return e==="maritime"||e==="carbon"?e:Lf}catch{return Lf}}function Ck(){if(typeof window>"u")return au;try{const e=window.localStorage.getItem(OS);if(!e)return au;const n=JSON.parse(e);return Mk(n)?{globalMute:n.preferences.globalMute,dnd:n.preferences.dnd,mutedTheaterIds:n.preferences.mutedTheaterIds}:au}catch{return au}}function xk(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(MS)==="1"}catch{return!1}}function Ek(){if(jp!==null)return jp;if(typeof window>"u")return null;try{return window.localStorage.getItem(DS)}catch{return null}}function Tk(e){if(!(typeof window>"u"))try{window.localStorage.setItem(RS,e)}catch{}}function Ak(e){if(!(typeof window>"u"))try{window.localStorage.setItem(LS,e)}catch{}}function jg(e){if(!(typeof window>"u"))try{window.localStorage.setItem(OS,JSON.stringify({version:NS,preferences:e}))}catch{}}function kk(e){if(!(typeof window>"u"))try{window.localStorage.setItem(MS,e?"1":"0")}catch{}}function Rk(e){if(jp=e,!(typeof window>"u"))try{window.localStorage.setItem(DS,e)}catch{}}function Lk(e,n){if(n.length<=Np)return e;const r=new Set(n.slice(-Np)),a={};for(const l of Object.keys(e))r.has(l)&&(a[l]=e[l]);return a}function Mk(e){if(!e||typeof e!="object")return!1;const n=e;if(n.version!==NS||!n.preferences||typeof n.preferences.globalMute!="boolean"||typeof n.preferences.dnd!="boolean")return!1;const r=n.preferences.mutedTheaterIds;return!!r&&typeof r=="object"&&!Array.isArray(r)}function iw(){for(const e of Ip)e()}const cu="directory-browser-sectors";function rw({open:e,onCancel:n,onConfirm:r}){const[a,l]=H.useState(null),[p,m]=H.useState(null),[c,u]=H.useState(null),[h,y]=H.useState(""),[g,C]=H.useState(0),T=H.useRef(null),A=H.useRef(null),x=async(O,U)=>{m(O),u(null),y(""),C(0);try{const F=await ZT(O,U);l(F)}catch(F){if(F instanceof DOMException&&F.name==="AbortError")return;u(F instanceof Ue?F.message:String(F))}finally{m(null)}};H.useEffect(()=>{if(!e)return;const O=new AbortController;return x(null,O.signal),()=>O.abort()},[e]),H.useEffect(()=>{e&&T.current?.focus()},[e,a?.path]);const d=a?.entries??[],v=H.useMemo(()=>{const O=h.trim().toLowerCase();return O===""?d:d.filter(U=>U.name.toLowerCase().includes(O))},[d,h]),f=H.useMemo(()=>a?Dk(a):[],[a]),b=v.length===0?-1:Math.min(g,v.length-1);if(H.useEffect(()=>{if(b<0)return;A.current?.querySelector(`[data-index="${b}"]`)?.scrollIntoView({block:"nearest"})},[b,a?.path]),!e)return null;const E=O=>{O.accessible&&p===null&&x(O.path)},L=()=>{a?.parentPath!=null&&p===null&&x(a.parentPath)},R=a?.path??null,M=b>=0?`${cu}-${b}`:void 0,k=O=>{switch(O.key){case"Escape":h!==""?y(""):n();return;case"ArrowDown":O.preventDefault(),C(U=>Math.min(U+1,Math.max(v.length-1,0)));return;case"ArrowUp":O.preventDefault(),C(U=>Math.max(U-1,0));return;case"Enter":{O.preventDefault();const U=v[b];U&&E(U);return}case"Backspace":h===""&&(O.preventDefault(),L());return;default:return}};return X5.createPortal(S.jsxs("div",{className:"directory-browser-overlay",role:"presentation",children:[S.jsx("button",{type:"button",className:"directory-browser-scrim","aria-label":"Close",onClick:n}),S.jsxs("section",{className:"directory-browser-card",role:"dialog","aria-modal":"true","aria-label":"Establish Theater of Operations",onKeyDown:k,children:[S.jsxs("header",{className:"directory-browser-header",children:[S.jsx("span",{className:"directory-browser-sigil","aria-hidden":"true",children:S.jsx(Nk,{})}),S.jsxs("div",{className:"directory-browser-heading",children:[S.jsx("span",{className:"directory-browser-kicker",children:"Theater of Operations"}),S.jsx("h2",{children:"Establish Theater"})]}),S.jsx("button",{type:"button",className:"directory-browser-close",onClick:n,"aria-label":"Close",children:"×"})]}),S.jsx("nav",{className:"directory-browser-course","aria-label":"Path",children:f.map((O,U)=>{const F=U===f.length-1;return S.jsxs("span",{className:"directory-browser-course-seg",children:[U>0?S.jsx("span",{className:"directory-browser-course-sep","aria-hidden":"true",children:"›"}):null,S.jsx("button",{type:"button",className:`directory-browser-crumb ${F?"is-current":""}`,"aria-current":F?"location":void 0,disabled:F||p!==null,title:O.path,onClick:()=>{x(O.path)},children:O.label})]},O.path)})}),S.jsxs("div",{className:"directory-browser-toolbar",children:[S.jsxs("div",{className:"directory-browser-filter",children:[S.jsx("span",{className:"directory-browser-filter-glyph","aria-hidden":"true",children:S.jsx(Ik,{})}),S.jsx("input",{ref:T,type:"text",className:"directory-browser-filter-input",placeholder:"Filter sectors…","aria-label":"Filter folders","aria-controls":cu,value:h,spellCheck:!1,autoComplete:"off",onChange:O=>{y(O.target.value),C(0)}})]}),S.jsxs("button",{type:"button",className:"directory-browser-up",disabled:a?.parentPath==null||p!==null,title:"Up one sector (Backspace)",onClick:L,children:[S.jsx(jk,{}),S.jsx("span",{children:"Up"})]})]}),c?S.jsx("p",{className:"directory-browser-error",role:"alert",children:c}):null,S.jsx("div",{className:"directory-browser-list",id:cu,role:"listbox","aria-label":"Folders","aria-busy":p!==null,"aria-activedescendant":M,ref:A,children:p!==null?S.jsxs("p",{className:"directory-browser-state is-live",children:[S.jsx("span",{className:"directory-browser-scan-dot","aria-hidden":"true"}),"Scouting…"]}):v.length===0?S.jsx("p",{className:"directory-browser-state",children:h!==""?"No sectors match the filter.":"No sectors to advance into."}):v.map((O,U)=>S.jsxs("div",{id:`${cu}-${U}`,"data-index":U,role:"option","aria-selected":U===b,"aria-disabled":!O.accessible,className:`directory-browser-sector ${U===b?"is-active":""} ${O.accessible?"":"is-locked"}`,title:O.path,onClick:()=>{C(U),E(O)},children:[S.jsx("span",{className:"directory-browser-sector-glyph","aria-hidden":"true",children:S.jsx(Bk,{})}),S.jsx("span",{className:"directory-browser-sector-name",children:O.name}),O.accessible?S.jsx("span",{className:"directory-browser-sector-advance","aria-hidden":"true",children:"›"}):S.jsxs("span",{className:"directory-browser-sector-lock",children:[S.jsx($k,{})," Locked"]})]},O.path))}),a?.truncated?S.jsx("p",{className:"directory-browser-note",children:"Charting first 500 sectors only."}):null,S.jsxs("footer",{className:"directory-browser-actions",children:[S.jsxs("div",{className:"directory-browser-target",children:[S.jsx("span",{className:"directory-browser-target-label",children:"Theater Root"}),S.jsx("span",{className:"directory-browser-target-path",title:R??"",children:R??"Scouting…"})]}),S.jsxs("div",{className:"directory-browser-buttons",children:[S.jsx("button",{type:"button",className:"directory-browser-button",onClick:n,children:"Cancel"}),S.jsx("button",{type:"button",className:"directory-browser-button is-primary",disabled:R===null||p!==null,onClick:()=>R&&r(R),children:"Establish Theater"})]})]})]})]}),document.body)}function Dk(e){if(Ok(e)==="/"){const m=[{label:"/",path:"/"}];let c="";for(const u of e.path.split("/").filter(Boolean))c+=`/${u}`,m.push({label:u,path:c});return m}const r=/^([A-Za-z]:)\\?/.exec(e.path),a=r?`${r[1]}\\`:e.roots[0]??"C:\\",l=[{label:a,path:a}];let p=a.replace(/\\$/,"");for(const m of e.path.slice(a.length).split("\\").filter(Boolean))p+=`\\${m}`,l.push({label:m,path:p});return l}function Ok(e){return e.roots.some(n=>/^[A-Za-z]:\\$/.test(n))||/^[A-Za-z]:\\/.test(e.path)?"\\":"/"}function Nk(){return S.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[S.jsx("circle",{cx:"10",cy:"10",r:"6.6",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),S.jsx("circle",{cx:"10",cy:"10",r:"2.1",fill:"currentColor"}),S.jsx("path",{d:"M10 1.6v3.2M10 15.2v3.2M1.6 10h3.2M15.2 10h3.2",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function Bk(){return S.jsx("svg",{viewBox:"0 0 18 18","aria-hidden":"true",children:S.jsx("path",{d:"M2.4 5.2c0-.7.6-1.3 1.3-1.3h2.7l1.4 1.5h6.5c.7 0 1.3.6 1.3 1.3v6.4c0 .7-.6 1.3-1.3 1.3H3.7c-.7 0-1.3-.6-1.3-1.3z",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinejoin:"round"})})}function Ik(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("circle",{cx:"7",cy:"7",r:"4.2",fill:"none",stroke:"currentColor",strokeWidth:"1.3"}),S.jsx("path",{d:"M10.2 10.2 13.5 13.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]})}function jk(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M8 12.5V4M4.5 7.5 8 4l3.5 3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round"})})}function $k(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("rect",{x:"3.6",y:"7",width:"8.8",height:"6.2",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),S.jsx("path",{d:"M5.6 7V5.4a2.4 2.4 0 0 1 4.8 0V7",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}const zk=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function Pk({state:e}){const[n,r]=H.useState(!1),a=H.useRef(null),l=H.useRef(null),p=H.useRef(null),m=e.theaters.length>0;if(H.useEffect(()=>{if(e.onboardingOpen)return a.current=document.activeElement,l.current?.focus(),()=>{const y=a.current;a.current=null,y?.focus?.()}},[e.onboardingOpen]),H.useEffect(()=>{if(!e.onboardingOpen)return;const y=g=>{n||(g.key==="Escape"?(g.preventDefault(),ul()):g.key==="Tab"&&Hk(g,p.current),g.stopImmediatePropagation())};return window.addEventListener("keydown",y,!0),()=>window.removeEventListener("keydown",y,!0)},[n,e.onboardingOpen]),!e.onboardingOpen)return null;const c=()=>{r(!0)},u=()=>{r(!1)},h=async y=>{r(!1),PS();try{const g=await gS(y),C=await pS(g);HS(C)}catch(g){$p(g instanceof Error?g.message:String(g))}};return S.jsxs("div",{className:"commissioning-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"commissioning-title",children:[S.jsx("button",{type:"button",className:"commissioning-scrim",onClick:ul,"aria-label":"Close Commissioning guide"}),S.jsxs("section",{className:"commissioning-card",ref:p,children:[S.jsxs("header",{className:"commissioning-header",children:[S.jsx("span",{className:"commissioning-eyebrow",children:"COMMISSIONING · FLEET CONSOLE"}),S.jsx("h2",{id:"commissioning-title",children:"Bring your fleet online"}),S.jsx("p",{children:"Three steps to go from an empty bridge to live carrier operations."})]}),S.jsxs("ol",{className:"commissioning-steps",children:[S.jsxs("li",{className:`commissioning-step commissioning-step--primary ${m?"is-complete":"is-current"}`,children:[S.jsx("span",{className:"commissioning-step-node","aria-hidden":"true",children:m?"✓":"01"}),S.jsxs("div",{className:"commissioning-step-body",children:[S.jsx("h3",{children:"Register a Theater"}),S.jsx("p",{children:"A Theater is a project directory the fleet operates in. Choose the folder you want to work from."}),m?S.jsx(Nl,{ref:y=>{l.current=y},className:"commissioning-primary-action",to:"/operations",onClick:ul,children:"Go to Operations →"}):S.jsx("button",{ref:y=>{l.current=y},type:"button",className:"commissioning-primary-action is-live",disabled:e.addingTheater,onClick:c,children:e.addingTheater?"Adding Theater…":"Choose a folder…"}),e.theaterError?S.jsx("p",{className:"commissioning-error",role:"alert",children:e.theaterError}):null]})]}),S.jsxs("li",{className:"commissioning-step",children:[S.jsx("span",{className:"commissioning-step-node","aria-hidden":"true",children:"02"}),S.jsxs("div",{className:"commissioning-step-body",children:[S.jsx("h3",{children:"Open an Operation"}),S.jsx("p",{children:"An Operation is a live terminal session running an Agent CLI. Start one from the Operations tab to begin a working session."}),S.jsx(Nl,{className:"commissioning-secondary-link",to:"/operations",onClick:ul,children:"Go to Operations"})]})]}),S.jsxs("li",{className:"commissioning-step",children:[S.jsx("span",{className:"commissioning-step-node","aria-hidden":"true",children:"03"}),S.jsxs("div",{className:"commissioning-step-body",children:[S.jsx("h3",{children:"Observe carriers"}),S.jsx("p",{children:"Carriers are specialist agents your Admiral dispatches. Their sorties stream here in real time as they run."})]})]})]}),S.jsxs("footer",{className:"commissioning-footer",children:[S.jsx("p",{children:"Theaters with a Fleet Wiki knowledge root also unlock Codex — your decision log and reference library."}),S.jsx("button",{type:"button",className:"commissioning-skip",onClick:ul,children:"Skip for now"})]})]}),S.jsx(rw,{open:n,onCancel:u,onConfirm:h})]})}function Hk(e,n){if(!n)return;const r=Array.from(n.querySelectorAll(zk)),a=r[0],l=r[r.length-1];!a||!l||(e.shiftKey&&document.activeElement===a?(e.preventDefault(),l.focus()):!e.shiftKey&&document.activeElement===l&&(e.preventDefault(),a.focus()))}function ql(){return H.useSyncExternalStore(WA,Tb,Tb)}const Uk={ended:"Stood down","input-waiting":"Awaiting orders"},sw="fleet-console.notificationsDockOpen",Bf=!1;function Fk(){const e=ql(),n=lo(),[r,a]=H.useState(qk),[l,p]=H.useState(!1),m=H.useRef(null),c=H.useRef(null),u=H.useMemo(()=>Object.values(e.operationNotifications),[e.operationNotifications]),h=gA(e),y=mA(u,h).hidden,g=_A(y,e.notificationPreferences),C=mb(g),T=mb(y),A=C.reduce((O,U)=>O+U.totalCount,0),x=Nb(C,"input-waiting"),d=Nb(C,"ended");Gk(e.notificationPreferences);const v=C.length===0,f=v?"muted":x>0?"awaiting":"ended",b=H.useMemo(()=>g.reduce((O,U)=>Math.max(O,U.lastRaisedSeq),0),[g]),E=H.useRef(b),[L,R]=H.useState(0),M=H.useCallback(O=>{a(O),Wk(O)},[]);H.useEffect(()=>{b>E.current&&!r&&R(O=>O+1),E.current=b},[b,r]),H.useEffect(()=>{if(!r)return;const O=U=>{const F=U.target;if(!(F instanceof Node)){M(!1);return}c.current?.contains(F)||m.current?.contains(F)||M(!1)};return document.addEventListener("pointerdown",O),()=>{document.removeEventListener("pointerdown",O)}},[r,M]);const k=O=>{Ng(O.sessionId),n("/operations"),M(!1)};return r?S.jsx("div",{className:"notification-dock-layer",children:S.jsxs("aside",{ref:c,className:`notification-dock ${f==="awaiting"?"has-awaiting":""}`,"aria-live":"polite","aria-label":"Operation notifications",children:[S.jsxs("header",{className:"notification-dock-head",children:[S.jsx("span",{className:"notification-dock-eyebrow",children:"Notifications"}),v?null:S.jsxs("span",{className:"notification-dock-tallies","aria-hidden":"true",children:[x>0?S.jsx("span",{className:"notification-tally is-input-waiting",children:x}):null,d>0?S.jsx("span",{className:"notification-tally is-ended",children:d}):null]}),S.jsx("button",{type:"button",className:"notification-dock-icon",onClick:()=>p(!l),"aria-expanded":l,"aria-label":"Notification settings",title:"Notification settings",children:S.jsx(Yk,{})}),S.jsx("button",{type:"button",className:"notification-dock-icon",onClick:()=>M(!1),"aria-label":"Close notifications",title:"Close",children:S.jsx(Xk,{})})]}),l?S.jsx(Kk,{groups:T}):null,v?S.jsx("p",{className:"notification-dock-empty",children:"No active alerts"}):S.jsx("div",{className:"notification-dock-deck",children:C.map(O=>S.jsxs("section",{className:"notification-cluster-group",children:[S.jsxs("header",{className:"notification-cluster-group-head",children:[S.jsx("span",{className:"notification-cluster-theater",children:O.theaterLabel}),S.jsx("span",{className:"notification-cluster-group-count",children:O.totalCount})]}),S.jsx("ul",{className:"notification-cluster-roster",children:O.notifications.map(U=>S.jsxs("li",{className:`notification-row is-${U.kind}`,children:[S.jsx("span",{className:"notification-row-beacon","aria-hidden":"true"}),S.jsxs("span",{className:"notification-row-body",children:[S.jsx("span",{className:"notification-row-op",children:U.operationLabel}),S.jsx("span",{className:"notification-row-state",children:Uk[U.kind]})]}),U.count>1?S.jsx("span",{className:"notification-row-count",children:U.count}):null,S.jsx("button",{type:"button",className:"notification-row-move",onClick:()=>k(U),"aria-label":`Open ${O.theaterLabel} ${U.operationLabel}`,children:"Open"})]},U.sessionId))})]},O.theaterId??"__unknown__"))})]})}):S.jsxs("button",{ref:m,type:"button",className:`notification-handle is-${f} ${f==="awaiting"?"has-awaiting":""}`,onClick:()=>M(!0),"aria-label":`Open notifications (${A})`,children:[S.jsx("span",{className:"notification-handle-count",children:v?0:A}),S.jsx("span",{className:"notification-handle-label",children:"Alerts"}),S.jsx(Zk,{className:"notification-handle-chevron"}),L>0?S.jsx("span",{className:"notification-handle-pulse","aria-hidden":"true"},L):null]})}function qk(){if(typeof window>"u")return Bf;try{const e=window.localStorage.getItem(sw);return e===null?Bf:e==="true"}catch{return Bf}}function Wk(e){if(!(typeof window>"u"))try{window.localStorage.setItem(sw,String(e))}catch{}}function Gk(e){return e.globalMute||e.dnd||Object.keys(e.mutedTheaterIds).length>0}function Nb(e,n){let r=0;for(const a of e)for(const l of a.notifications)l.kind===n&&(r+=l.count);return r}function Kk({groups:e}){const n=ql(),r=Vk(e,n.notificationPreferences.mutedTheaterIds,n.theaters);return S.jsxs("div",{className:"notification-cluster-settings",role:"dialog","aria-label":"Notification settings",children:[S.jsx("p",{className:"notification-cluster-settings-eyebrow",children:"Display"}),S.jsxs("label",{className:"notification-cluster-setting",children:[S.jsx("input",{type:"checkbox",checked:n.notificationPreferences.globalMute,onChange:a=>rk(a.currentTarget.checked)}),S.jsx("span",{children:"Mute all"})]}),S.jsxs("label",{className:"notification-cluster-setting",children:[S.jsx("input",{type:"checkbox",checked:n.notificationPreferences.dnd,onChange:a=>sk(a.currentTarget.checked)}),S.jsx("span",{children:"Do not disturb"})]}),r.length>0?S.jsx("p",{className:"notification-cluster-settings-eyebrow",children:"By Theater"}):null,r.map(a=>S.jsxs("label",{className:"notification-cluster-setting",children:[S.jsx("input",{type:"checkbox",checked:a.theaterId?n.notificationPreferences.mutedTheaterIds[a.theaterId]===!0:!1,onChange:()=>{a.theaterId&&ak(a.theaterId)}}),S.jsx("span",{children:a.theaterLabel})]},a.theaterId))]})}function Vk(e,n,r){const a=new Map;for(const l of e)l.theaterId&&a.set(l.theaterId,l);for(const l of Object.keys(n))a.has(l)||a.set(l,{theaterId:l,theaterLabel:r.find(p=>p.id===l)?.label??l,notifications:[],totalCount:0});return[...a.values()]}function Yk(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("path",{d:"M8 5.4a2.6 2.6 0 1 1 0 5.2 2.6 2.6 0 0 1 0-5.2Z",fill:"none",stroke:"currentColor",strokeWidth:"1.25"}),S.jsx("path",{d:"M8 2.2v1.6M8 12.2v1.6M3.9 3.9 5 5M11 11l1.1 1.1M2.2 8h1.6M12.2 8h1.6M3.9 12.1 5 11M11 5l1.1-1.1",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"})]})}function Xk(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M4 4l8 8M12 4l-8 8",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function Zk({className:e}){return S.jsx("svg",{className:e,viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M6 4l4 4-4 4",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}const aw=[{title:"Console",entries:[{combos:[["Mod","K"]],description:"Search Operations across Theaters"},{combos:[["Esc"]],description:"Close the open overlay or menu"}]},{title:"Operations",entries:[{combos:[["Esc"]],description:"Close the carrier job stream"},{combos:[["Shift","Enter"]],description:"Insert a newline in the terminal instead of submitting"},{combos:[["Enter"],["Esc"]],description:"Confirm or cancel a session rename"},{combos:[["↑"],["↓"]],description:"Move between Theater, Theme, and launch menu items"}]},{title:"Map",entries:[{combos:[["Alt","←"],["Alt","→"]],description:"Focus the previous / next Operation"},{combos:[["Drag"]],description:"Pan the operations map"},{combos:[["Shift","Drag"]],description:"Draw a new Operation terminal"},{combos:[["Space","Drag"]],description:"Pan even while a terminal has focus"},{combos:[["Scroll"]],description:"Zoom the map in or out"},{combos:[["Right-click"]],description:"Open the canvas actions menu"},{combos:[["Double-click"]],description:"Focus a panel from its title bar; rename from its name"},{combos:[["Click"]],description:"Clear terminal focus on the empty canvas"}]},{title:"Codex",entries:[{combos:[["Mod","K"]],description:"Toggle the command palette"},{combos:[["↑"],["↓"]],description:"Move through command palette results"},{combos:[["Enter"]],description:"Open the selected result"},{combos:[["Tab"]],description:"Move focus within the command palette"},{combos:[["Esc"]],description:"Close the command palette or diagram lightbox"},{combos:[["+"],["−"],["0"]],description:"Zoom the diagram lightbox in / out / reset"},{combos:[["F"]],description:"Fit the diagram lightbox to the viewport"}]}],Jk=/mac|iphone|ipad|ipod/i,Qk=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function eR({state:e}){const n=H.useRef(null),r=H.useRef(null),a=H.useRef(null);if(e.shortcutsOpen&&n.current===null&&(n.current=document.activeElement),H.useEffect(()=>{if(!e.shortcutsOpen)return;const p=m=>{m.key==="Escape"?(Of(),m.preventDefault()):m.key==="Tab"&&nR(m,a.current),m.stopImmediatePropagation()};return r.current?.focus(),window.addEventListener("keydown",p,!0),()=>{window.removeEventListener("keydown",p,!0);const m=n.current;n.current=null,m?.focus?.()}},[e.shortcutsOpen]),!e.shortcutsOpen)return null;const l=tR();return S.jsxs("div",{className:"shortcuts-overlay",role:"dialog","aria-modal":"true","aria-label":"Keyboard shortcuts",children:[S.jsx("button",{type:"button",className:"shortcuts-overlay-scrim",onClick:Of,"aria-label":"Close keyboard shortcuts"}),S.jsxs("section",{className:"shortcuts-overlay-card",ref:a,children:[S.jsxs("header",{className:"shortcuts-overlay-header",children:[S.jsx("span",{className:"shortcuts-overlay-kicker",children:"Reference Map"}),S.jsx("h2",{children:"Keyboard Shortcuts"})]}),S.jsx("button",{ref:r,type:"button",className:"shortcuts-overlay-close",onClick:Of,"aria-label":"Close keyboard shortcuts",children:"×"}),S.jsx("div",{className:"shortcuts-overlay-groups",children:aw.map(p=>S.jsxs("section",{className:"shortcuts-group","aria-labelledby":`shortcuts-${p.title.toLowerCase()}`,children:[S.jsx("h3",{id:`shortcuts-${p.title.toLowerCase()}`,children:p.title}),S.jsx("dl",{className:"shortcuts-list",children:p.entries.map(m=>S.jsxs("div",{className:"shortcuts-entry",children:[S.jsx("dt",{className:"shortcuts-combos",children:m.combos.map((c,u)=>S.jsxs("span",{className:"shortcuts-combo",children:[u>0?S.jsx("span",{className:"shortcuts-combo-separator",children:"or"}):null,S.jsx("span",{className:"shortcuts-keyset",children:c.map(h=>S.jsx("kbd",{children:h==="Mod"?l:h},h))})]},`${m.description}:${c.join("+")}`))}),S.jsx("dd",{children:m.description})]},`${p.title}:${m.description}`))})]},p.title))})]})]})}function tR(){const n=navigator.userAgentData?.platform??navigator.platform;return Jk.test(n)?"⌘":"Ctrl"}function nR(e,n){if(!n)return;const r=Array.from(n.querySelectorAll(Qk)),a=r[0],l=r[r.length-1];!a||!l||(e.shiftKey&&document.activeElement===a?(e.preventDefault(),l.focus()):!e.shiftKey&&document.activeElement===l&&(e.preventDefault(),a.focus()))}const iR="a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex='-1'])",Bb="operation-search-listbox",ow="__unassigned__";function rR({state:e}){const n=lo(),[r,a]=H.useState(""),[l,p]=H.useState(0),m=H.useRef(null),c=H.useRef(null),u=H.useRef(null),h=H.useRef(new Map),y=H.useMemo(()=>_k(e),[e]),g=H.useMemo(()=>kA(y,r),[y,r]),C=H.useMemo(()=>RA(g),[g]),T=H.useMemo(()=>ES(r),[r]),A=Ib(l,g.length),x=g[A]?jb(g[A].sessionId):void 0;if(H.useEffect(()=>{if(!e.operationSearchOpen)return;u.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const f=document.body.style.overflow;return document.body.style.overflow="hidden",window.setTimeout(()=>m.current?.focus(),0),()=>{document.body.style.overflow=f,u.current?.focus()}},[e.operationSearchOpen]),H.useEffect(()=>{if(!e.operationSearchOpen){a(""),p(0);return}p(0)},[e.operationSearchOpen,r]),H.useEffect(()=>{if(!e.operationSearchOpen)return;const f=g[A];f&&h.current.get(f.sessionId)?.scrollIntoView({block:"nearest"})},[A,g,e.operationSearchOpen]),!e.operationSearchOpen)return null;const d=f=>{Ng(f),n("/operations"),Df()},v=f=>{if(f.key==="Escape"){f.preventDefault(),Df();return}if(f.key==="ArrowDown"||f.key==="ArrowUp"){f.preventDefault(),p(b=>Ib(b+(f.key==="ArrowDown"?1:-1),g.length));return}if(f.key==="Enter"){const b=g[A];if(!b)return;f.preventDefault(),d(b.sessionId);return}f.key==="Tab"&&lR(f,c.current)};return S.jsx("div",{className:"operation-search-overlay",onMouseDown:f=>{f.target===f.currentTarget&&Df()},children:S.jsxs("section",{ref:c,className:"operation-search-card",role:"dialog","aria-modal":"true","aria-label":"Operation quick search",tabIndex:-1,onKeyDown:v,children:[S.jsxs("div",{className:"operation-search-field",children:[S.jsx(cR,{}),S.jsx("input",{ref:m,id:"operation-search-input",type:"search",value:r,onChange:f=>a(f.target.value),placeholder:"Search Operations across Theaters",autoComplete:"off",role:"combobox","aria-expanded":!0,"aria-controls":Bb,"aria-activedescendant":x,"aria-autocomplete":"list",spellCheck:!1}),S.jsx("kbd",{children:"esc"})]}),S.jsx("div",{id:Bb,className:"operation-search-results",role:"listbox","aria-label":"Operation results",children:C.length>0?C.map(f=>{const b=aR(f.theaterId);return S.jsxs("section",{className:"operation-search-section",role:"group","aria-labelledby":b,children:[S.jsx("h2",{id:b,className:"operation-search-section-heading",children:If(f.theaterLabel,T)}),f.entries.map(E=>{const L=g.indexOf(E),R=L===A;return S.jsxs("button",{id:jb(E.sessionId),ref:M=>{M?h.current.set(E.sessionId,M):h.current.delete(E.sessionId)},type:"button",className:`operation-search-result ${R?"is-active":""}`,role:"option","aria-selected":R,onMouseEnter:()=>p(L),onClick:()=>d(E.sessionId),children:[S.jsxs("span",{className:"operation-search-result-text",children:[S.jsx("strong",{children:If(E.operationName,T)}),S.jsx("small",{children:sR(E)})]}),S.jsx("span",{className:"operation-search-theater",children:If(E.theaterLabel,T)})]},E.sessionId)})]},f.theaterId??ow)}):S.jsx("p",{className:"operation-search-empty",children:"No matching Operations."})})]})})}function Ib(e,n){return n<=0?0:Math.max(0,Math.min(e,n-1))}function sR(e){return[e.cliLabel,e.status].filter(Boolean).join(" · ")}function aR(e){return`operation-search-heading-${lw(e??ow)}`}function jb(e){return`operation-search-option-${lw(e)}`}function lw(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-")}function If(e,n){if(n.length===0)return e;const r=[];let a=0;for(;a<e.length;){const l=oR(e,n,a);if(!l){r.push(e.slice(a));break}l.start>a&&r.push(e.slice(a,l.start)),r.push(S.jsx("mark",{children:e.slice(l.start,l.end)},`${l.start}-${l.end}`)),a=l.end}return r}function oR(e,n,r){const a=e.toLocaleLowerCase();let l=null;for(const p of n){const m=a.indexOf(p,r);m!==-1&&(!l||m<l.start)&&(l={start:m,end:m+p.length})}return l}function lR(e,n){if(!n)return;const r=Array.from(n.querySelectorAll(iR)).filter(p=>p.offsetParent!==null);if(r.length===0)return;const a=r[0],l=r[r.length-1];if(e.shiftKey&&document.activeElement===a){e.preventDefault(),l?.focus();return}!e.shiftKey&&document.activeElement===l&&(e.preventDefault(),a?.focus())}function cR(){return S.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:S.jsx("path",{d:"m14.2 14.2 3 3M8.9 15.2a6.3 6.3 0 1 1 0-12.6 6.3 6.3 0 0 1 0 12.6Z",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function uR({open:e,title:n,message:r,tone:a="info",onDismiss:l}){return e?S.jsx("div",{className:"app-toast-host",children:S.jsxs("div",{className:`app-toast app-toast--${a}`,role:"status","aria-live":"polite",children:[S.jsx("span",{className:"app-toast-dot","aria-hidden":"true"}),S.jsxs("div",{className:"app-toast-body",children:[S.jsx("p",{className:"app-toast-title",children:n}),r?S.jsx("p",{className:"app-toast-message",children:r}):null]}),l?S.jsx("button",{type:"button",className:"app-toast-close",onClick:l,"aria-label":"Dismiss notification",children:"×"}):null]})}):null}function hR({state:e}){if(e.releaseNotesLoading||e.releaseNotes.length===0||e.releaseNotesError&&!e.releaseNotesStale)return null;const n=e.releaseNotes.find(a=>a.version===e.version),r=n&&e.version?` v${n.version}`:"";return S.jsx("button",{type:"button",className:"topbar-whatsnew-button",onMouseDown:a=>a.preventDefault(),onClick:ck,"aria-label":`What's new${r}`,title:`What's new${r}`,children:S.jsx("span",{children:"What's new"})})}const dR=1400,fR="https://github.com/sbluemin/fleet-harness",pR="https://github.com/sbluemin/fleet-harness/stargazers",gR="https://api.github.com/repos/sbluemin/fleet-harness",$g="fleet-console.github-stars",mR=360*60*1e3;function _R({state:e}){const n=e.connectionError!==null,r=Li().pathname,a=lo(),l=r.startsWith("/carrier-settings"),p=r.startsWith("/settings"),m=u=>{a(r.startsWith(u)?"/operations":u)},c=r.startsWith("/codex")?S.jsx(BR,{}):r.startsWith("/carrier-settings")?S.jsx(zb,{}):r.startsWith("/settings")?S.jsx($b,{}):r.startsWith("/operations")?S.jsx(NR,{}):S.jsx(OR,{});return S.jsxs("header",{className:"topbar",children:[S.jsxs("div",{className:"topbar-lead",children:[S.jsxs(Nl,{className:"topbar-brand",to:"/operations","aria-label":"Operations로 이동",children:[S.jsx("span",{className:`topbar-sigil ${n?"is-alert":""}`,"aria-hidden":"true",title:e.connectionError??void 0,children:c}),S.jsxs("h1",{className:"topbar-title",children:["Fleet",S.jsx("span",{className:"topbar-title-thin",children:"Console"})]})]}),S.jsxs("span",{className:"topbar-preview-badge",children:[S.jsx("span",{className:"topbar-preview-label",children:"Research Preview"}),e.version?S.jsxs("span",{className:"topbar-preview-version",children:["v",e.version]}):null]}),S.jsx(CR,{}),S.jsx(hR,{state:e})]}),S.jsx(wR,{state:e}),S.jsxs("div",{className:"topbar-meta",children:[e.updateAvailable?S.jsx(vR,{latestVersion:e.latestVersion}):null,S.jsx("button",{type:"button",className:"topbar-icon-button topbar-shortcuts-button",onMouseDown:u=>u.preventDefault(),onClick:lk,"aria-label":"Keyboard shortcuts",title:"Keyboard shortcuts",children:S.jsx(zR,{})}),S.jsxs("button",{type:"button",className:`topbar-nav-link ${l?"is-active":""}`,title:l?"Back to Operations":"Carrier settings","aria-current":l?"page":void 0,onClick:()=>m("/carrier-settings"),children:[S.jsx("span",{className:"topbar-nav-icon","aria-hidden":"true",children:S.jsx(zb,{})}),S.jsx("span",{children:"Carriers"})]}),S.jsxs("button",{type:"button",className:`topbar-nav-link ${p?"is-active":""}`,title:p?"Back to Operations":"Settings","aria-current":p?"page":void 0,onClick:()=>m("/settings"),children:[S.jsx("span",{className:"topbar-nav-icon","aria-hidden":"true",children:S.jsx($b,{})}),S.jsx("span",{children:"Settings"})]})]})]})}function vR({latestVersion:e}){const[n,r]=H.useState("idle"),[a,l]=H.useState(null),p=H.useRef(null),m=bR(n,a,e);H.useEffect(()=>()=>{p.current!==null&&window.clearTimeout(p.current)},[]);const c=async()=>{if(!m.disabled){p.current!==null&&(window.clearTimeout(p.current),p.current=null),r("applying"),l(null);try{if((await XT()).status!=="accepted"){r("error"),l("invalid_response");return}r("accepted"),p.current=window.setTimeout(()=>{p.current=null,r("completed")},dR)}catch(u){const h=u instanceof Ue?u.message:"network_error";l(h),r(SR(h)?"blocked":"error")}}};return S.jsx("button",{type:"button",className:`topbar-update-badge topbar-update-badge--${m.tone}`,onClick:c,disabled:m.disabled,title:m.title,"aria-live":"polite",children:m.label})}function bR(e,n,r){const a=r?`최신 버전 ${r}`:"업데이트 가능";return e==="applying"?{label:"요청 중",title:"업데이트 적용 요청을 보내는 중입니다.",tone:"live",disabled:!0}:e==="accepted"?{label:"업데이트 중",title:"서버가 곧 재시작되고 새 창에서 콘솔을 엽니다.",tone:"live",disabled:!0}:e==="completed"?{label:"완료: 새 창에서 계속",title:"새 창에서 재시작된 콘솔을 계속 사용하세요.",tone:"live",disabled:!0}:e==="blocked"?yR(n):e==="error"?{label:"재시도",title:"업데이트 요청에 실패했습니다. 다시 시도할 수 있습니다.",tone:"error",disabled:!1}:{label:"Update available",title:a,tone:"warn",disabled:!1}}function yR(e){return e==="local_channel"?{label:"로컬 빌드",title:"로컬 개발 빌드는 콘솔에서 업데이트하지 않습니다.",tone:"blocked",disabled:!0}:e==="active_terminal_sessions"?{label:"세션 종료 필요",title:"실행 중인 Operation을 종료한 뒤 업데이트하세요.",tone:"blocked",disabled:!1}:e==="update_already_in_progress"?{label:"이미 진행 중",title:"다른 업데이트 적용이 이미 진행 중입니다.",tone:"blocked",disabled:!0}:e==="update_not_available"?{label:"업데이트 없음",title:"서버 재확인 결과 적용할 업데이트가 없습니다.",tone:"blocked",disabled:!0}:{label:"콘솔 준비 안 됨",title:"콘솔이 업데이트를 시작할 준비가 되지 않았습니다. 잠시 뒤 다시 시도하세요.",tone:"error",disabled:!1}}function SR(e){return e==="active_terminal_sessions"||e==="local_channel"||e==="update_already_in_progress"||e==="update_not_available"}function wR({state:e}){const[n,r]=H.useState(!1),[a,l]=H.useState(!1),p=H.useRef(null),m=H.useRef(null),c=H.useRef(null),u=e.theaters.find(d=>d.id===e.activeTheaterId)??null,h=u?.label??(e.theaters.length===0?"No Theaters":"Theater");H.useEffect(()=>{if(!n)return;const d=f=>{p.current?.contains(f.target)||r(!1)},v=f=>{f.key==="Escape"&&(r(!1),m.current?.focus())};return document.addEventListener("mousedown",d),document.addEventListener("keydown",v),()=>{document.removeEventListener("mousedown",d),document.removeEventListener("keydown",v)}},[n]),H.useEffect(()=>{if(!n)return;const d=c.current;if(!d)return;(d.querySelector('[data-active="true"]')??d.querySelector("[role^='menuitem']"))?.focus()},[n]);const y=d=>{QA(d),r(!1),m.current?.focus()},g=async()=>{r(!1),l(!0)},C=()=>{l(!1),ek()},T=async d=>{l(!1),PS();try{const v=await gS(d),f=await pS(v);HS(f)}catch(v){$p(v instanceof Error?v.message:String(v))}},A=async()=>{if(u){r(!1);try{await JT(u.id),Ob(u.id)}catch(d){if(d instanceof Ue&&d.status===404){Ob(u.id);return}$p(d instanceof Error?d.message:String(d))}}},x=d=>{if(d.key!=="ArrowDown"&&d.key!=="ArrowUp")return;d.preventDefault();const v=Array.from(c.current?.querySelectorAll("[role^='menuitem']")??[]);if(v.length===0)return;const f=v.indexOf(document.activeElement),b=d.key==="ArrowDown"?1:-1,E=(f+b+v.length)%v.length;v[E]?.focus()};return S.jsxs("div",{className:"theater-control",ref:p,children:[S.jsx("span",{className:"theater-eyebrow","aria-hidden":"true",children:"Theater"}),S.jsxs("button",{type:"button",ref:m,className:`theater-trigger ${n?"is-open":""}`,"aria-haspopup":"menu","aria-expanded":n,"aria-label":"Theater",title:u?.label??e.theaterError??void 0,onClick:()=>r(d=>!d),children:[S.jsx("span",{className:"theater-trigger-sigil","aria-hidden":"true",children:S.jsx(RR,{})}),S.jsx("span",{className:"theater-trigger-label",children:h}),S.jsx("span",{className:"theater-trigger-caret","aria-hidden":"true",children:S.jsx(LR,{})})]}),n?S.jsxs("div",{className:"theater-menu",role:"menu","aria-label":"Theater",ref:c,onKeyDown:x,children:[e.theaters.length>0?S.jsx("ul",{className:"theater-menu-list",children:e.theaters.map(d=>{const v=d.id===e.activeTheaterId;return S.jsx("li",{children:S.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":v,"data-active":v?"true":void 0,className:`theater-menu-item ${v?"is-active":""}`,title:d.label,onClick:()=>y(d.id),children:[S.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:v?S.jsx(MR,{}):null}),S.jsx("span",{className:"theater-menu-label",children:d.label})]})},d.id)})}):S.jsx("p",{className:"theater-menu-empty",children:"No Theaters yet."}),S.jsx("div",{className:"theater-menu-divider",role:"separator"}),u?S.jsxs(S.Fragment,{children:[S.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item theater-menu-forget",onClick:A,children:[S.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:S.jsx(DR,{})}),S.jsx("span",{className:"theater-menu-label",children:"Forget Theater"})]}),S.jsx("div",{className:"theater-menu-divider",role:"separator"})]}):null,S.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item theater-menu-add",disabled:e.addingTheater,onClick:g,children:[S.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:S.jsx(IR,{})}),S.jsx("span",{className:"theater-menu-label",children:e.addingTheater?"Adding Theater…":"Add Theater…"})]}),e.theaterError?S.jsx("p",{className:"theater-menu-error",children:e.theaterError}):null]}):null,S.jsx(rw,{open:a,onCancel:C,onConfirm:T})]})}function CR(){const e=xR(),n=e.count!==null;return S.jsxs("div",{className:"topbar-github",role:"group","aria-label":"GitHub",children:[S.jsx("a",{className:"topbar-github-link",href:fR,target:"_blank",rel:"noopener noreferrer","aria-label":"GitHub 저장소 열기",title:"GitHub 저장소",children:S.jsx(jR,{})}),S.jsxs("a",{className:"topbar-github-stars",href:pR,target:"_blank",rel:"noopener noreferrer","aria-label":n?`GitHub 스타 ${e.count.toLocaleString()}개 — 스타 누르기`:"GitHub에서 스타 누르기",title:"GitHub에서 스타 누르기",children:[S.jsx($R,{}),n?S.jsx("span",{className:"topbar-github-stars-count",children:kR(e.count)}):null]})]})}function xR(){const[e,n]=H.useState(()=>{const r=ER();return r===null?{count:null,status:"idle"}:{count:r,status:"ready"}});return H.useEffect(()=>{if(TR())return;let r=!1;return n(a=>a.status==="ready"?a:{...a,status:"loading"}),fetch(gR,{headers:{Accept:"application/vnd.github+json"}}).then(a=>a.ok?a.json():Promise.reject(new Error(`status ${a.status}`))).then(a=>{if(r)return;const l=typeof a.stargazers_count=="number"?a.stargazers_count:null;if(l===null){n(p=>({count:p.count,status:p.count===null?"error":"ready"}));return}AR(l),n({count:l,status:"ready"})}).catch(()=>{r||n(a=>({count:a.count,status:a.count===null?"error":"ready"}))}),()=>{r=!0}},[]),e}function ER(){try{const e=window.localStorage.getItem($g);if(!e)return null;const n=JSON.parse(e);return typeof n.count=="number"?n.count:null}catch{return null}}function TR(){try{const e=window.localStorage.getItem($g);if(!e)return!1;const n=JSON.parse(e);return typeof n.at=="number"&&Date.now()-n.at<mR}catch{return!1}}function AR(e){try{window.localStorage.setItem($g,JSON.stringify({count:e,at:Date.now()}))}catch{}}function kR(e){if(e<1e3)return String(e);const n=e/1e3;return n<10?`${n.toFixed(1)}k`:`${Math.round(n)}k`}function RR(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("circle",{cx:"8",cy:"3.2",r:"1.5",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),S.jsx("path",{d:"M8 4.7v8.1M4.3 8.2H11.7M3.4 9.1A4.7 4.7 0 0 0 12.6 9.1",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function LR(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M4.5 6.5 8 10l3.5-3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})})}function MR(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M3.5 8.5 6.5 11.5 12.5 5",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function DR(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M4.7 4.7 11.3 11.3M11.3 4.7 4.7 11.3",fill:"none",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round"})})}function OR(){return S.jsxs("svg",{viewBox:"0 0 16 16",width:"16",height:"16",children:[S.jsx("path",{d:"M8 1.8 9.5 6.5 14.2 8 9.5 9.5 8 14.2 6.5 9.5 1.8 8 6.5 6.5Z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),S.jsx("path",{d:"M8 4.7 8.7 7.3 11.3 8 8.7 8.7 8 11.3 7.3 8.7 4.7 8 7.3 7.3Z",fill:"currentColor"})]})}function NR(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("circle",{cx:"8",cy:"8",r:"5.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),S.jsx("path",{d:"M8 3.7v2.1M8 10.2v2.1M3.7 8h2.1M10.2 8h2.1M8 8l3.1-2.1",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"}),S.jsx("circle",{cx:"8",cy:"8",r:"1.1",fill:"currentColor"})]})}function BR(){return S.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[S.jsx("circle",{cx:"12",cy:"12",r:"9"}),S.jsx("circle",{cx:"12",cy:"12",r:"3.2",fill:"currentColor",stroke:"none",opacity:"0.16"}),S.jsx("path",{d:"M12 3v3.6M12 17.4V21M3 12h3.6M17.4 12H21"}),S.jsx("path",{d:"M12 8.6 14.2 12 12 15.4 9.8 12Z",fill:"currentColor",stroke:"none"})]})}function $b(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("path",{d:"M3 4.4h10M3 8h10M3 11.6h10",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"}),S.jsx("circle",{cx:"6.2",cy:"4.4",r:"1.3",fill:"var(--surface-glass-strong)",stroke:"currentColor",strokeWidth:"1.2"}),S.jsx("circle",{cx:"10",cy:"8",r:"1.3",fill:"var(--surface-glass-strong)",stroke:"currentColor",strokeWidth:"1.2"}),S.jsx("circle",{cx:"7.4",cy:"11.6",r:"1.3",fill:"var(--surface-glass-strong)",stroke:"currentColor",strokeWidth:"1.2"})]})}function zb(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("circle",{cx:"4",cy:"4.2",r:"1.15",fill:"currentColor"}),S.jsx("circle",{cx:"4",cy:"8",r:"1.15",fill:"currentColor"}),S.jsx("circle",{cx:"4",cy:"11.8",r:"1.15",fill:"currentColor"}),S.jsx("path",{d:"M7.2 4.2h6M7.2 8h6M7.2 11.8h6",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function IR(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M8 3.4v9.2M3.4 8h9.2",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function jR(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{fill:"currentColor",d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82a7.65 7.65 0 0 1 2-.27c.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z"})})}function $R(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M8 2.2 9.41 6.26 13.71 6.35 10.28 8.94 11.53 13.05 8 10.6 4.47 13.05 5.72 8.94 2.29 6.35 6.59 6.26Z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"})})}function zR(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("rect",{x:"2.4",y:"4.1",width:"11.2",height:"7.8",rx:"1.8",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),S.jsx("path",{d:"M4.5 6.3h.1M6.8 6.3h.1M9.1 6.3h.1M11.4 6.3h.1M4.5 8.2h.1M6.8 8.2h.1M9.1 8.2h.1M11.4 8.2h.1M5.8 10.1h4.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}const PR=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(","),hl=10;function HR({state:e}){const n=H.useRef(null),r=H.useRef(null),a=H.useRef(null),l=!e.bootstrapped||e.onboardingOpen||e.operationSearchOpen||e.shortcutsOpen||e.timelineOpen;if(e.whatsNewOpen&&!l&&n.current===null&&(n.current=document.activeElement),H.useEffect(()=>{if(!e.whatsNewOpen||l)return;const x=d=>{d.key==="Escape"?(d.preventDefault(),ou()):d.key==="Tab"&&qR(d,a.current),d.stopImmediatePropagation()};return r.current?.focus(),window.addEventListener("keydown",x,!0),()=>{window.removeEventListener("keydown",x,!0);const d=n.current;n.current=null,d?.focus?.()}},[e.whatsNewOpen,l]),!e.whatsNewOpen||l||e.releaseNotes.length===0)return null;const p=e.selectedReleaseNoteKey??Pa(e.releaseNotes[0]?.version??"",0),m=e.releaseNotes.findIndex((x,d)=>Pa(x.version,d)===p),c=e.releaseNotes[m]??e.releaseNotes[0],u=Pa(c.version,m>=0?m:0),h=()=>{BS(),fS({force:!0}).then(IS).catch(x=>jS(x instanceof Error?x.message:String(x)))},y=Math.max(1,Math.ceil(e.releaseNotes.length/hl)),g=Math.min(y-1,Math.floor((m>=0?m:0)/hl)),C=g*hl,T=e.releaseNotes.slice(C,C+hl),A=x=>{const d=g+x;if(d<0||d>=y)return;const v=d*hl,f=e.releaseNotes[v];f&&Mb(Pa(f.version,v))};return S.jsxs("div",{className:"whatsnew-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"whatsnew-title",children:[S.jsx("button",{type:"button",className:"whatsnew-scrim",onClick:ou,"aria-label":"Close What's new"}),S.jsxs("section",{className:"whatsnew-card",ref:a,children:[S.jsxs("header",{className:"whatsnew-header",children:[S.jsxs("div",{className:"whatsnew-heading-row",children:[S.jsx("h2",{id:"whatsnew-title",children:"What's new"}),S.jsxs("span",{className:"whatsnew-version-badge",children:["v",c.version]})]}),S.jsxs("div",{className:"whatsnew-meta-row",children:[c.date?S.jsxs("time",{className:"whatsnew-date",dateTime:c.date,children:["Released ",c.date]}):S.jsx("span",{className:"whatsnew-date",children:"Unreleased"}),e.releaseNotesStale?S.jsx("span",{className:"whatsnew-stale",children:"Stale"}):null]})]}),S.jsx("button",{ref:r,type:"button",className:"whatsnew-close",onClick:ou,"aria-label":"Close What's new",children:"x"}),S.jsxs("div",{className:"whatsnew-body",children:[S.jsxs("div",{className:"whatsnew-version-selector",children:[S.jsx("select",{"aria-label":"Release version",value:u,onChange:x=>Mb(x.currentTarget.value),children:T.map((x,d)=>{const v=C+d;return S.jsxs("option",{value:Pa(x.version,v),children:[x.version==="Unreleased"?"Unreleased":`v${x.version}`,x.date?` · ${x.date}`:""]},Pa(x.version,v))})}),y>1?S.jsxs("div",{className:"whatsnew-pagination",children:[S.jsx("button",{type:"button",className:"whatsnew-page-button",onClick:()=>A(-1),disabled:g===0,"aria-label":"Newer versions",children:"‹"}),S.jsxs("span",{className:"whatsnew-page-status",children:[g+1," / ",y]}),S.jsx("button",{type:"button",className:"whatsnew-page-button",onClick:()=>A(1),disabled:g>=y-1,"aria-label":"Older versions",children:"›"})]}):null,S.jsx("button",{type:"button",className:"whatsnew-refresh",onClick:h,disabled:e.releaseNotesLoading,children:e.releaseNotesLoading?"Refreshing":"Refresh"})]}),e.releaseNotesError?S.jsx("p",{className:"whatsnew-error",children:"Release notes could not be refreshed."}):null,c.sections.map((x,d)=>S.jsx(UR,{section:x,index:d},x.heading))]}),S.jsx("footer",{className:"whatsnew-footer",children:S.jsx("button",{type:"button",className:"whatsnew-done",onClick:ou,children:"Close"})})]})]})}function UR({section:e,index:n}){const r=e.heading.toLowerCase().replaceAll(" ","-"),a={"--whatsnew-delay":`${n*55}ms`};return S.jsxs("section",{className:`whatsnew-section whatsnew-section--${r}`,style:a,children:[S.jsx("h3",{children:S.jsx("span",{className:"whatsnew-section-chip",children:e.heading})}),S.jsx("ul",{children:e.items.map((l,p)=>S.jsx("li",{children:S.jsx(FR,{item:l})},`${l.text}:${p}`))})]})}function FR({item:e}){return S.jsxs(S.Fragment,{children:[e.packageTags.map((n,r)=>S.jsx("span",{className:`whatsnew-package-chip whatsnew-package-chip--${r%2===0?"brass":"aurora"}`,children:n},`${n}:${r}`)),S.jsx("span",{children:e.text})]})}function Pa(e,n){return`${e}:${n}`}function qR(e,n){if(!n)return;const r=Array.from(n.querySelectorAll(PR)),a=r[0],l=r[r.length-1];!a||!l||(e.shiftKey&&document.activeElement===a?(e.preventDefault(),l.focus()):!e.shiftKey&&document.activeElement===l&&(e.preventDefault(),a.focus()))}const WR=new Set(["idle_prompt","permission_prompt","auth_success","elicitation_dialog","elicitation_complete","elicitation_response"]);function GR(){let e="";return n=>{e+=n;const r=[];let a=e.indexOf(`
13
-
14
- `);for(;a>=0;){const l=e.slice(0,a);e=e.slice(a+2);const p=VR(l);p&&r.push(p),a=e.indexOf(`
15
-
16
- `)}return r}}function KR(e){if(!e.data)return null;let n;try{n=JSON.parse(e.data)}catch{return null}if(e.event==="observer:truncated"){const a=n.tenant?.tenantId;return!a||!n.truncation?null:{kind:"truncation",tenantId:a,tenantLabel:n.tenant?.tenantLabel,truncation:n.truncation}}if(e.event==="session:updated"){const a=Hb(n.session);return a?{kind:"session",tenantId:a.tenantId??a.sessionId,session:a}:null}if(e.event==="session:attention"){const a=Hb(n.session);return a?{kind:"attention",tenantId:a.tenantId??a.sessionId,session:a,reason:YR(n.reason)}:null}const r=Pb(n.event)??Pb(n);return r?{kind:"event",tenantId:r.tenantId,tenantLabel:n.tenant?.tenantLabel,event:r}:null}function VR(e){const n=e.split(`
17
- `),r=n.find(l=>l.startsWith("event:"))?.slice(6).trim()??"message",a=n.filter(l=>l.startsWith("data:")).map(l=>l.slice(5).trim()).join(`
18
- `);return!a&&r==="message"?null:{event:r,data:a}}function Pb(e){if(typeof e!="object"||e===null)return null;const n=e;return typeof n.id!="number"||typeof n.tenantId!="string"||typeof n.type!="string"||typeof n.at!="number"?null:typeof n.event!="object"||n.event===null?{...n,event:{}}:n}function Hb(e){if(typeof e!="object"||e===null)return null;const n=e;return typeof n.sessionId!="string"||typeof n.cwdLabel!="string"||typeof n.sequence!="number"||typeof n.status!="string"||typeof n.createdAt!="number"||"cwd"in n||"canonicalCwd"in n||"providerSession"in n||"ticket"in n||"token"in n||"transcriptPath"in n?null:{sessionId:n.sessionId,terminalSessionId:typeof n.terminalSessionId=="string"?n.terminalSessionId:n.sessionId,cwdLabel:n.cwdLabel,sequence:n.sequence,label:typeof n.label=="string"?n.label:void 0,cliId:typeof n.cliId=="string"?n.cliId:void 0,cliLabel:typeof n.cliLabel=="string"?n.cliLabel:void 0,status:n.status,turnState:n.turnState==="running"||n.turnState==="ended"?n.turnState:"none",createdAt:n.createdAt,theaterId:typeof n.theaterId=="string"?n.theaterId:void 0,tenantId:typeof n.tenantId=="string"?n.tenantId:void 0,registrationId:typeof n.registrationId=="string"?n.registrationId:void 0,resumeAvailable:n.resumeAvailable===!0}}function YR(e){return typeof e=="string"&&WR.has(e)?e:void 0}const Ub=250,XR=5e3;function ZR(){const e=new AbortController;return JR(e.signal),()=>e.abort()}async function JR(e){let n=Ub,r=!1;const a=async()=>{if(!r){r=!0;try{GS(await hS(e))}catch{}finally{r=!1}}};for(;!e.aborted;){ze({connection:"connecting"});try{await e3(e);const l=await VT(e);ze({connection:"live",connectionError:null}),n=Ub,await QR(l,e,a),e.aborted||ze({connection:"connecting",connectionError:null})}catch(l){if(e.aborted)return;ze({connection:"connecting",connectionError:l instanceof Error?l.message:String(l)})}if(e.aborted)return;await t3(n,e),n=Math.min(n*2,XR)}}async function QR(e,n,r){const a=new TextDecoder,l=GR();for(;!n.aborted;){const p=await e.read();if(p.done)return;for(const m of l(a.decode(p.value,{stream:!0}))){const c=KR(m);if(c){if(c.kind==="truncation"&&c.truncation){fk(c.tenantId,c.tenantLabel,c.truncation);continue}if(c.kind==="session"&&c.session){ah(c.session);continue}if(c.kind==="attention"&&c.session){ik(c.session,c.reason);continue}if(c.event){const{unknownTenant:u}=dk(c.event,c.tenantLabel);u&&r()}}}}}async function e3(e){const[n,r]=await Promise.all([hS(e),KT(e)]);GS(n),hk(r)}async function t3(e,n){await new Promise(r=>{const a=()=>{clearTimeout(l),n.removeEventListener("abort",a),r()},l=setTimeout(a,e);n.addEventListener("abort",a)})}const n3=new Set(["token","credential","cwd","path","persona","prompt","toolAllowlist","allowedExecutorTools"]);async function cw(e){const n=await fetch("/carrier-settings/state",{signal:e});return await zg(n),uw(await n.json(),n.status)}async function i3(e){const n=await fetch("/carrier-settings/options",{signal:e});return await zg(n),c3(await n.json(),n.status)}async function r3(e,n,r){return ho(`/carrier-settings/carriers/${encodeURIComponent(e)}/cli`,"PUT",{cliType:n},r)}async function s3(e,n,r){return ho(`/carrier-settings/carriers/${encodeURIComponent(e)}/model`,"PUT",n,r)}async function a3(e,n,r){return ho(`/carrier-settings/carriers/${encodeURIComponent(e)}/display-name`,"PATCH",{displayName:n},r)}async function Fb(e,n,r){return ho(`/carrier-settings/carriers/${encodeURIComponent(e)}/agent-mode`,"PUT",{agentMode:n},r)}async function o3(e,n,r,a){return ho(`/carrier-settings/carriers/${encodeURIComponent(e)}/taskforce/${encodeURIComponent(n)}`,"PUT",r,a)}async function l3(e,n,r){return ho(`/carrier-settings/carriers/${encodeURIComponent(e)}/taskforce/${encodeURIComponent(n)}`,"DELETE",{},r)}async function ho(e,n,r,a){const l=await fetch(e,{method:n,headers:{"Content-Type":"application/json"},body:JSON.stringify(r),signal:a});await zg(l);const p=await l.json();if(!p||typeof p!="object"||!("state"in p))throw new Ue(l.status,"Invalid carrier settings mutation response");return{state:uw(p.state,l.status)}}async function zg(e){if(e.ok)return;let n=e.statusText||`HTTP ${e.status}`;try{const r=await e.json();typeof r.error=="string"&&(n=r.error)}catch{}throw new Ue(e.status,n)}function uw(e,n){hw(e,n);const r=e;if(!r||typeof r.generation!="number"||!Array.isArray(r.carriers))throw new Ue(n,"Invalid carrier settings state response");return{generation:r.generation,carriers:r.carriers.map(a=>u3(a,n))}}function c3(e,n){hw(e,n);const r=e;if(!r||!Array.isArray(r.cliTypes)||!r.taskForceConstraints||typeof r.taskForceConstraints.minBackends!="number")throw new Ue(n,"Invalid carrier settings options response");return{cliTypes:r.cliTypes.map(a=>h3(a,n)),taskForceConstraints:{minBackends:r.taskForceConstraints.minBackends}}}function u3(e,n){const r=e;if(!r||typeof r.carrierId!="string"||typeof r.displayName!="string"||typeof r.sourceDisplayName!="string"||typeof r.role!="string"||typeof r.roleDescription!="string"||typeof r.slot!="number"||typeof r.cliType!="string"||typeof r.defaultCliType!="string"||typeof r.model!="string"||r.effort!==void 0&&typeof r.effort!="string"||r.agentMode!=="cli"&&r.agentMode!=="subagent"||typeof r.subagentMode!="boolean"||typeof r.taskForceBackendCount!="number"||!r.taskforce||!Array.isArray(r.taskforce.backends))throw new Ue(n,"Invalid carrier settings carrier response");return{carrierId:r.carrierId,displayName:r.displayName,sourceDisplayName:r.sourceDisplayName,role:r.role,roleDescription:r.roleDescription,...r.category?{category:r.category}:{},slot:r.slot,cliType:r.cliType,defaultCliType:r.defaultCliType,model:r.model,...r.effort?{effort:r.effort}:{},agentMode:r.agentMode,subagentMode:r.subagentMode,taskForceBackendCount:r.taskForceBackendCount,taskforce:{backends:r.taskforce.backends.map(a=>f3(a,n))}}}function h3(e,n){const r=e;if(!r||typeof r.id!="string"||typeof r.displayName!="string"||typeof r.supportsSubagent!="boolean"||!Array.isArray(r.models)||typeof r.defaultModel!="string")throw new Ue(n,"Invalid carrier settings CLI option");return{id:r.id,displayName:r.displayName,supportsSubagent:r.supportsSubagent,models:r.models.map(a=>d3(a,n)),defaultModel:r.defaultModel}}function d3(e,n){const r=e;if(!r||typeof r.modelId!="string"||typeof r.name!="string")throw new Ue(n,"Invalid carrier settings model option");if(r.effort!==void 0&&(!Array.isArray(r.effort.levels)||typeof r.effort.default!="string"))throw new Ue(n,"Invalid carrier settings effort option");return{modelId:r.modelId,name:r.name,...r.effort?{effort:{levels:r.effort.levels.filter(a=>typeof a=="string"),default:r.effort.default}}:{}}}function f3(e,n){const r=e;if(!r||typeof r.cliType!="string"||typeof r.model!="string"||r.effort!==void 0&&typeof r.effort!="string")throw new Ue(n,"Invalid carrier settings Task Force backend");return{cliType:r.cliType,model:r.model,...r.effort?{effort:r.effort}:{}}}function hw(e,n){const r=[e];for(;r.length>0;){const a=r.pop();if(!(!a||typeof a!="object"))for(const[l,p]of Object.entries(a)){if(n3.has(l))throw new Ue(n,"Carrier settings response leaked a restricted field");p&&typeof p=="object"&&r.push(p)}}}const p3={cliType:"",model:"",effort:"",displayName:"",agentMode:"cli",taskforce:{}},zp=new Set;let Rn={loading:!1,state:null,options:null,activeCarrierId:null,draft:p3,savingActionId:null,error:null};function dw(){return H.useSyncExternalStore(g3,qb,qb)}function qb(){return Rn}function g3(e){return zp.add(e),()=>{zp.delete(e)}}async function Wb(e){Qi({loading:!0,error:null});try{const[n,r]=await Promise.all([cw(e),i3(e)]);fw(n,r)}catch(n){if(e?.aborted)return;Qi({loading:!1,error:gw(n)})}}function m3(e){const n=Rn.state?.carriers.find(r=>r.carrierId===e);Qi({activeCarrierId:e,draft:n?Pg(n,Rn.options):Rn.draft,error:null})}function Ws(e){Qi({draft:{...Rn.draft,...e},error:null})}function Pp(e,n){const r=Rn.draft.taskforce[e]??{model:"",effort:""};Qi({draft:{...Rn.draft,taskforce:{...Rn.draft.taskforce,[e]:{...r,...n}}},error:null})}function _3(){const e=pw();e&&Qi({draft:Pg(e,Rn.options),error:null})}async function v3(e){const n=pw();return n?b3("save-all",async()=>{const r=Rn.draft;let a=null;r.displayName!==n.displayName&&(a=(await a3(n.carrierId,r.displayName)).state);const l=r.cliType!==n.cliType;return l&&(a=(await r3(n.carrierId,r.cliType)).state),(l||r.model!==n.model||(r.effort||"")!==(n.effort||""))&&(a=(await s3(n.carrierId,S3(r))).state),r.agentMode==="subagent"?(n.agentMode!=="subagent"||n.taskForceBackendCount>0)&&(a=(await Fb(n.carrierId,"subagent")).state):(n.agentMode!=="cli"&&(a=(await Fb(n.carrierId,"cli")).state),a=await w3(n,e,a)),{state:a??await cw()}}):!1}function fw(e,n){const r=C3(e,Rn.activeCarrierId),a=e.carriers.find(l=>l.carrierId===r)??null;Qi({loading:!1,state:e,options:n,activeCarrierId:r,draft:a?Pg(a,n):Rn.draft,error:null})}async function b3(e,n){Qi({savingActionId:e,error:null});try{const r=await n();return fw(r.state,Rn.options??{cliTypes:[],taskForceConstraints:{minBackends:2}}),Qi({savingActionId:null}),!0}catch(r){return Qi({savingActionId:null,error:gw(r)}),!1}}function Pg(e,n){const r=Object.fromEntries((n?.cliTypes??[]).map(a=>{const l=e.taskforce.backends.find(p=>p.cliType===a.id);return[a.id,{model:l?.model??a.defaultModel,effort:l?.effort??y3(a.id,l?.model??a.defaultModel,n)??""}]}));return{cliType:e.cliType,model:e.model,effort:e.effort??"",displayName:e.displayName,agentMode:e.agentMode,taskforce:r}}function y3(e,n,r){return r?.cliTypes.find(p=>p.id===e)?.models.find(p=>p.modelId===n)?.effort?.default??null}function S3(e){return{model:e.model,...e.effort?{effort:e.effort}:{}}}function pw(){return Rn.state?.carriers.find(e=>e.carrierId===Rn.activeCarrierId)??null}async function w3(e,n,r){const a=new Set(n.map(l=>l.cliType));for(const l of e.taskforce.backends)a.has(l.cliType)||(r=(await l3(e.carrierId,l.cliType)).state);for(const l of n){const p=e.taskforce.backends.find(m=>m.cliType===l.cliType);p&&p.model===l.model&&(p.effort||"")===(l.effort||"")||(r=(await o3(e.carrierId,l.cliType,{model:l.model,...l.effort?{effort:l.effort}:{}})).state)}return r}function C3(e,n){return n&&e.carriers.some(r=>r.carrierId===n)?n:e.carriers[0]?.carrierId??null}function Qi(e){Rn={...Rn,...e};for(const n of zp)n()}function gw(e){return e instanceof Error?e.message:String(e)}const x3=50,E3=2400,T3={nimitz:"var(--captain-nimitz)",kirov:"var(--captain-kirov)",genesis:"var(--captain-genesis)",ohio:"var(--captain-ohio)",sentinel:"var(--captain-sentinel)",vanguard:"var(--captain-vanguard)",tempest:"var(--captain-tempest)",chronicle:"var(--captain-chronicle)"};function A3(){const e=dw(),n=e.state?.carriers.find(f=>f.carrierId===e.activeCarrierId)??null,r=e.options?.cliTypes.find(f=>f.id===e.draft.cliType)??null,a=r?.models.find(f=>f.modelId===e.draft.model)??null,[l,p]=H.useState(!1),[m,c]=H.useState([]),[u,h]=H.useState("idle"),y=m.length>0,g=e.draft.agentMode==="subagent",C=e.draft.agentMode==="subagent",T=e.savingActionId==="save-all",A=n?O3(n,e.draft,m):!1,x=n?.taskforce.backends.map(f=>`${f.cliType}:${f.model}:${f.effort??""}`).join("|")??"";H.useEffect(()=>{const f=new AbortController;return Wb(f.signal),()=>f.abort()},[]),H.useEffect(()=>{p(!1),c(n?.taskforce.backends.map(f=>f.cliType)??[]),h("idle")},[n?.carrierId,x]),H.useEffect(()=>{if(u!=="saved")return;const f=window.setTimeout(()=>h("idle"),E3);return()=>window.clearTimeout(f)},[u]);function d(){n&&(_3(),c(n.taskforce.backends.map(f=>f.cliType)),p(!1),h("idle"))}async function v(){if(!n)return;if(h("saving"),!await v3(B3(m,e.draft.taskforce))){h("idle");return}p(!1),h("saved")}return S.jsxs("main",{className:"carrier-settings-page",children:[S.jsxs("section",{className:"carrier-settings-hero","aria-labelledby":"carrier-settings-title",children:[S.jsxs("div",{children:[S.jsx("p",{className:"bridge-kicker",children:"Carrier Control Surface"}),S.jsx("h2",{id:"carrier-settings-title",children:"Carrier Settings"})]}),S.jsxs("div",{className:"carrier-settings-hero-actions",children:[S.jsx("div",{className:`carrier-settings-save-status ${u==="saved"?"is-positive":""}`,role:"status","aria-live":"polite",children:u==="saving"||T?"Saving…":u==="saved"?"Saved ✓":""}),n?S.jsxs("div",{className:"carrier-settings-save-actions",children:[S.jsx("button",{type:"button",className:`carrier-settings-action-button ${A?"is-dirty":""}`,disabled:!A||T,onClick:()=>{v()},children:"Save"}),S.jsx("button",{type:"button",className:`carrier-settings-action-button ${A?"is-dirty":""}`,disabled:!A||T,onClick:d,children:"Discard"})]}):null,S.jsx("button",{type:"button",className:"carrier-settings-action-button carrier-settings-hero-refresh",disabled:e.loading,onClick:()=>{Wb()},children:"Refresh"})]})]}),e.error?S.jsx("p",{className:"carrier-settings-error",role:"alert",children:e.error}):null,S.jsxs("section",{className:"carrier-settings-grid",children:[S.jsxs("div",{className:"carrier-settings-list","aria-label":"Carrier list",children:[e.loading&&!e.state?S.jsx("p",{className:"carrier-settings-empty",children:"Loading carrier settings."}):null,e.state&&e.state.carriers.length===0?S.jsx("p",{className:"carrier-settings-empty",children:"No carriers registered."}):null,e.state?.carriers.map(f=>S.jsx(k3,{carrier:f,active:f.carrierId===e.activeCarrierId,minBackends:e.options?.taskForceConstraints.minBackends??2,onSelect:()=>m3(f.carrierId)},f.carrierId))]}),n&&e.options&&r?S.jsxs("div",{className:"carrier-settings-detail",style:vw(n.carrierId),children:[S.jsxs("div",{className:"carrier-settings-detail-head",children:[S.jsxs("div",{className:"carrier-settings-detail-title-block",children:[S.jsxs("div",{className:"carrier-settings-captain-id",children:[S.jsx("span",{children:"Captain"})," · ",n.carrierId.toUpperCase()]}),S.jsx("div",{className:`carrier-settings-name-line ${l?"is-editing":""}`,children:l?S.jsxs(S.Fragment,{children:[S.jsx("input",{id:"carrier-display-name",className:"carrier-settings-input carrier-settings-name-input",value:e.draft.displayName,maxLength:x3,onChange:f=>Ws({displayName:f.target.value})}),S.jsx("button",{type:"button",className:"carrier-settings-icon-button","aria-label":"Save display name",disabled:T,onClick:()=>{p(!1)},children:S.jsx(j3,{})}),S.jsx("button",{type:"button",className:"carrier-settings-icon-button","aria-label":"Cancel display name edit",onClick:()=>{Ws({displayName:n.displayName}),p(!1)},children:S.jsx($3,{})})]}):S.jsxs(S.Fragment,{children:[S.jsx("h3",{className:"carrier-settings-captain-name",children:n.displayName}),S.jsx("button",{type:"button",className:"carrier-settings-icon-button","aria-label":"Edit display name",onClick:()=>{Ws({displayName:n.displayName}),p(!0)},children:S.jsx(I3,{})})]})}),S.jsx("div",{className:"carrier-settings-captain-role",children:n.role})]}),S.jsxs("div",{className:"carrier-settings-cli-badge",children:[S.jsx("span",{className:"ind","aria-hidden":"true"}),n.cliType]})]}),S.jsxs("div",{className:"carrier-settings-body",children:[S.jsxs("div",{className:"carrier-settings-control-group",children:[S.jsx("div",{className:"carrier-settings-resp-title",children:"Identity"}),S.jsxs("div",{className:"carrier-settings-mission",children:['"',n.roleDescription,'"']})]}),S.jsxs("div",{className:"carrier-settings-control-group",children:[S.jsx("div",{className:"carrier-settings-resp-title",children:"Runtime"}),S.jsxs("div",{className:"carrier-settings-runtime",children:[S.jsx("div",{className:"carrier-settings-runtime-row carrier-settings-runtime-row--cli",children:S.jsxs("div",{className:"carrier-settings-field carrier-settings-field--wide",children:[S.jsx("label",{className:"carrier-settings-label",htmlFor:"carrier-cli",children:"CLI"}),S.jsx("select",{id:"carrier-cli",className:"carrier-settings-select",value:e.draft.cliType,onChange:f=>L3(f.target.value,e.options?.cliTypes??[]),children:e.options.cliTypes.map(f=>S.jsx("option",{value:f.id,children:f.displayName},f.id))})]})}),S.jsxs("div",{className:"carrier-settings-runtime-row carrier-settings-runtime-row--model",children:[S.jsx(mw,{id:"carrier-model",label:"Model",models:r.models,value:e.draft.model,onChange:f=>M3(r,f)}),S.jsx(_w,{id:"carrier-effort",model:a,value:e.draft.effort,onChange:f=>Ws({effort:f})})]})]})]}),S.jsx("div",{className:"carrier-settings-control-group",children:S.jsxs("div",{className:"carrier-settings-toggle-row",children:[S.jsxs("div",{children:[S.jsx("p",{className:"carrier-settings-resp-title",children:"SubAgent"}),S.jsx("p",{className:"carrier-settings-help",children:y?"Task Force draft is present. Remove every backend to enable SubAgent.":r.supportsSubagent?"Enabling SubAgent clears Task Force backends when saved.":"This CLI does not support SubAgent mode."})]}),S.jsx("button",{type:"button",className:`carrier-settings-toggle ${g?"is-on":""}`,disabled:T||!g&&(!r.supportsSubagent||y),"aria-pressed":g,onClick:()=>Ws({agentMode:g?"cli":"subagent"}),children:S.jsx("span",{children:g?"On":"Off"})})]})}),S.jsx(R3,{carrier:n,cliOptions:e.options.cliTypes,minBackends:e.options.taskForceConstraints.minBackends,savingActionId:e.savingActionId,rows:m,disabled:C,onRowsChange:c})]})]},n.carrierId):S.jsx("div",{className:"carrier-settings-detail",children:S.jsx("p",{className:"carrier-settings-empty",children:"Select a carrier."})})]})]})}function k3({carrier:e,active:n,minBackends:r,onSelect:a}){const l=e.taskForceBackendCount>=r;return S.jsxs("button",{type:"button",className:`carrier-settings-row ${n?"is-active":""}`,style:vw(e.carrierId),onClick:a,children:[S.jsx("span",{className:"carrier-settings-captain-dot","aria-hidden":"true"}),S.jsxs("span",{className:"carrier-settings-row-text",children:[S.jsx("span",{className:"carrier-settings-row-name",children:e.displayName}),S.jsx("span",{className:"carrier-settings-row-role",children:e.role})]}),S.jsxs("span",{className:"carrier-settings-row-live","aria-hidden":"true",children:[S.jsx("span",{className:`carrier-settings-live-dot ${e.subagentMode?"is-live":""}`}),S.jsx("span",{className:`carrier-settings-live-dot ${l?"is-live":""}`})]})]})}function mw({id:e,label:n,models:r,value:a,disabled:l=!1,onChange:p}){return S.jsxs("div",{className:"carrier-settings-field",children:[S.jsx("label",{className:"carrier-settings-label",htmlFor:e,children:n}),S.jsx("select",{id:e,className:"carrier-settings-select",value:a,disabled:l,onChange:m=>p(m.target.value),children:r.map(m=>S.jsx("option",{value:m.modelId,children:m.name},m.modelId))})]})}function _w({id:e,model:n,value:r,disabled:a=!1,onChange:l}){return n?.effort?S.jsxs("div",{className:"carrier-settings-field",children:[S.jsx("label",{className:"carrier-settings-label",htmlFor:e,children:"Effort"}),S.jsx("select",{id:e,className:"carrier-settings-select",value:r||n.effort.default,disabled:a,onChange:p=>l(p.target.value),children:n.effort.levels.map(p=>S.jsx("option",{value:p,children:p},p))})]}):S.jsxs("div",{className:"carrier-settings-field",children:[S.jsx("span",{className:"carrier-settings-label",children:"Effort"}),S.jsx("p",{className:"carrier-settings-help",children:"Not supported for this model."})]})}function R3({carrier:e,cliOptions:n,minBackends:r,savingActionId:a,rows:l,disabled:p,onRowsChange:m}){const c=dw(),u=e.taskforce.backends.length,[h,y]=H.useState(u>0),[g,C]=H.useState(!1),[T,A]=H.useState(""),x=e.taskForceBackendCount>=r,d=n.filter(f=>!l.includes(f.id)),v=T||d[0]?.id||"";return S.jsxs("div",{className:`carrier-settings-control-group carrier-settings-control-group--taskforce ${h?"is-expanded":""} ${p?"is-disabled":""}`,children:[S.jsxs("div",{className:"carrier-settings-section-head",children:[S.jsxs("div",{children:[S.jsx("p",{className:"carrier-settings-resp-title",children:"Task Force"}),S.jsx("p",{className:"carrier-settings-help",children:p?"Disabled while SubAgent is on. Turn SubAgent off before composing Task Force backends.":u>0?`${u} backend${u===1?"":"s"} configured${x?" · active":` · needs ${r}+ to activate`}.`:`Run this carrier across multiple CLI backends. Needs at least ${r} to activate.`})]}),S.jsx("div",{className:"carrier-settings-tf-head-actions",children:S.jsx("button",{type:"button",className:"carrier-settings-tf-toggle","aria-expanded":h,onClick:()=>y(f=>!f),children:h?"Hide":"Configure"})})]}),h?S.jsxs("div",{className:"carrier-settings-tf-list",children:[l.length===0?S.jsx("p",{className:"carrier-settings-tf-empty",children:"No Task Force backend drafted."}):null,l.map(f=>{const b=n.find(M=>M.id===f);if(!b)return null;const E=c.draft.taskforce[b.id]??{model:b.defaultModel,effort:""},L=b.models.find(M=>M.modelId===E.model)??b.models[0]??null,R=e.taskforce.backends.some(M=>M.cliType===b.id);return S.jsxs("div",{className:`carrier-settings-tf-item ${R?"is-active":""}`,children:[S.jsxs("div",{className:"carrier-settings-tf-title",children:[S.jsx("span",{className:`carrier-settings-live-dot ${R?"is-live":""}`,"aria-hidden":"true"}),S.jsx("strong",{children:b.displayName})]}),S.jsx(mw,{id:`tf-${b.id}-model`,label:"Model",models:b.models,value:E.model,disabled:p,onChange:M=>D3(b,M)}),S.jsx(_w,{id:`tf-${b.id}-effort`,model:L,value:E.effort,disabled:p,onChange:M=>Pp(b.id,{effort:M})}),S.jsx("div",{className:"carrier-settings-tf-actions",children:S.jsx("button",{type:"button",className:"carrier-settings-ghost-button",disabled:p||a==="save-all",onClick:()=>m(l.filter(M=>M!==b.id)),children:"Remove"})})]},b.id)}),S.jsxs("div",{className:"carrier-settings-tf-add-row",children:[g&&d.length>0?S.jsx("select",{className:"carrier-settings-select carrier-settings-tf-add-select",value:v,onChange:f=>A(f.target.value),"aria-label":"Task Force CLI to add",children:d.map(f=>S.jsx("option",{value:f.id,children:f.displayName},f.id))}):null,S.jsx("button",{type:"button",className:"carrier-settings-ghost-button",disabled:p||d.length===0||a==="save-all",onClick:()=>{if(!g){C(!0);return}const f=v,b=n.find(L=>L.id===f),E=b?.models.find(L=>L.modelId===b.defaultModel)??b?.models[0]??null;!b||!E||(Pp(b.id,{model:E.modelId,effort:E.effort?.default??""}),m(l.includes(b.id)?l:[...l,b.id]),A(""),C(!1))},children:"Add"})]})]}):null]})}function L3(e,n){const r=n.find(p=>p.id===e),a=r?.models.find(p=>p.modelId===r.defaultModel)??r?.models[0]??null,l={cliType:e,model:a?.modelId??"",effort:a?.effort?.default??""};r?.supportsSubagent||(l.agentMode="cli"),Ws(l)}function M3(e,n){const r=e.models.find(a=>a.modelId===n);Ws({model:n,effort:r?.effort?.default??""})}function D3(e,n){const r=e.models.find(a=>a.modelId===n);Pp(e.id,{model:n,effort:r?.effort?.default??""})}function O3(e,n,r){return n.displayName!==e.displayName||n.cliType!==e.cliType||n.model!==e.model||(n.effort||"")!==(e.effort||"")||n.agentMode!==e.agentMode?!0:n.agentMode==="subagent"?e.taskForceBackendCount>0:N3(e,r,n.taskforce)}function N3(e,n,r){if(n.length!==e.taskforce.backends.length)return!0;const a=new Set(n);for(const l of e.taskforce.backends){if(!a.has(l.cliType))return!0;const p=r[l.cliType];if(!p||p.model!==l.model||(p.effort||"")!==(l.effort||""))return!0}return!1}function B3(e,n){return e.map(r=>{const a=n[r];return a?{cliType:r,model:a.model,...a.effort?{effort:a.effort}:{}}:null}).filter(r=>r!==null)}function vw(e){return{"--cap-color":T3[e]??"var(--brass)"}}function I3(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[S.jsx("path",{d:"M10.8 2.2 13.8 5.2 5.2 13.8 2 14.5 2.7 11.3 10.8 2.2Z"}),S.jsx("path",{d:"M9.7 3.4 12.6 6.3"})]})}function j3(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:S.jsx("path",{d:"M3 8.3 6.4 11.7 13.2 4.5"})})}function $3(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[S.jsx("path",{d:"M4.2 4.2 11.8 11.8"}),S.jsx("path",{d:"M11.8 4.2 4.2 11.8"})]})}function Ee(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Ye(e){return Ee(e).replace(/"/g,"&quot;")}const z3="contextual-knowledge-not-instructions";function P3(e,n,r){const a=r?.whyThisMatched??e.frontmatter.whyThisMatched,l=Sw(e,n);return`
19
- <div class="context-actions-grid">
20
- <button class="context-action-btn" type="button" data-action="copy-compact-context">
21
- <span class="context-action-label">Compact context</span>
22
- <span class="context-action-meta">${Ru(bw(e))} tok</span>
23
- </button>
24
- <button class="context-action-btn" type="button" data-action="copy-provenance-context">
25
- <span class="context-action-label">Provenance</span>
26
- <span class="context-action-meta">${Ru(yw(e))} tok</span>
27
- </button>
28
- <button class="context-action-btn" type="button" data-action="copy-related-context">
29
- <span class="context-action-label">Context pack</span>
30
- <span class="context-action-meta">${Ru(l)} tok</span>
31
- </button>
32
- ${a?`
33
- <button class="context-action-btn context-action-btn--secondary" type="button" data-action="toggle-why-matched">
34
- <span class="context-action-label">Why this matched</span>
35
- </button>
36
- <div class="context-why-matched" hidden>${Ee(a)}</div>
37
- `:""}
38
- </div>
39
- `}function bw(e){const n={id:e.frontmatter.id,title:e.frontmatter.title,status:e.frontmatter.status??null,tags:e.frontmatter.tags,updated:e.frontmatter.updated,summary:Hg(e.body)};return JSON.stringify({...n,token_estimate:Ru(JSON.stringify(n))},null,2)}function yw(e){return[`# ${e.frontmatter.title} (\`${e.frontmatter.id}\`)`,"",`- updated: ${e.frontmatter.updated}`,`- status: ${e.frontmatter.status??"unknown"}`,`- raw_source_ref: ${e.frontmatter.rawSourceRef??"(none)"}`,`- raw_source_refs: ${(e.frontmatter.rawSourceRefs??[]).join(", ")||"(none)"}`,"","## Summary",Hg(e.body)].join(`
40
- `)}function Sw(e,n){const r=new Set([...e.frontmatter.related??[]]),a=n.filter(l=>r.has(l.id)).sort((l,p)=>l.title.localeCompare(p.title));return[`<fleet-wiki-context boundary="${z3}">`,"# Fleet Wiki Context Pack","",`## Entry: ${e.frontmatter.title} (\`${e.frontmatter.id}\`)`,"",`- updated: ${e.frontmatter.updated}`,`- status: ${e.frontmatter.status??"unknown"}`,`- tags: ${e.frontmatter.tags.join(", ")||"(none)"}`,"","### Summary",Hg(e.body),"","### Related Entries",...a.length>0?a.map(l=>`- [[wiki:${l.id}]] — ${l.title}`):["- (none)"],"","</fleet-wiki-context>"].join(`
41
- `)}function Ru(e){return Math.max(1,Math.ceil(e.length/4))}function Hg(e){return e.replace(/\s+/g," ").trim().slice(0,240)||"(empty)"}async function H3(){return rr(ti("/health"))}async function U3(){return rr(ti("/workspaces"))}async function F3(){return rr(ti("/index"))}async function q3(){return Cw(ti("/index-md"))}async function W3(e){return rr(ti(`/entry/${encodeURIComponent(e)}`))}async function G3(e,n=[],r=!1){const a=new URLSearchParams;e&&a.set("q",e),n.length>0&&a.set("tags",n.join(",")),r&&a.set("enhanced","true");const l=a.toString();return rr(ti(`/search${l?`?${l}`:""}`))}async function K3(e){return Cw(ti(`/raw?ref=${encodeURIComponent(e)}`))}async function uh(e){return rr(ti(`/queue?status=${encodeURIComponent(e)}`))}async function V3(e){return rr(ti(`/queue/${encodeURIComponent(e)}`))}async function Y3(e){return xw(ti(`/queue/${encodeURIComponent(e)}/approve`),{})}async function X3(e,n){return xw(ti(`/queue/${encodeURIComponent(e)}/reject`),{reason:n})}async function ww(){return rr(ti("/conflicts"))}async function Z3(e){return rr(ti(`/conflicts/${encodeURIComponent(e)}`))}async function J3(e){const n=typeof e=="number"?`?limit=${encodeURIComponent(String(e))}`:"";return rr(ti(`/log${n}`))}function ti(e){const n=window.location.pathname.match(/^\/console\/codex\/w\/([^/]+)(?:\/|$)/),r=e.startsWith("/")?e:`/${e}`;return n?`/console/codex/w/${encodeURIComponent(decodeURIComponent(n[1]??""))}/api${r}`:`/console/codex/api${r}`}async function rr(e){const n=await fetch(e,{headers:{accept:"application/json"}});if(!n.ok)throw new Error(await Ug(e,n));return n.json()}async function Cw(e){const n=await fetch(e,{headers:{accept:"text/markdown,text/plain"}});if(!n.ok)throw new Error(await Ug(e,n));return n.text()}async function xw(e,n){const r=await fetch(e,{method:"POST",headers:{"content-type":"application/json",accept:"application/json"},body:JSON.stringify(n)});if(!r.ok)throw new Error(await Ug(e,r));return r.json()}async function Ug(e,n){return(await n.json().catch(()=>null))?.error??`${e} request failed: ${n.status}`}const Q3=/^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{3}Z-[0-9a-f]{8}$/,Hi="/console/codex",Hp=new Set;let Ja=null;function Wl(){const e=oL(lL(Rw(window.location.pathname)).pathname);return e.name==="queue"?{name:"queue",tab:new URLSearchParams(window.location.search).get("tab")==="archived"?"archived":"pending"}:e}function Up(){return kw(Rw(window.location.pathname))?.wsId??null}function Qs(e){e!==window.location.pathname+window.location.search&&(window.history.pushState({},"",e),qg(Wl()))}function eL(e){window.history.replaceState({},"",e),qg(Wl())}function tL(e){return Hp.add(e),()=>Hp.delete(e)}function nL(){Ja||(Ja=()=>qg(Wl()),window.addEventListener("popstate",Ja))}function iL(){Ja&&(window.removeEventListener("popstate",Ja),Ja=null)}function $r(e){return tr(`/entry/${encodeURIComponent(e)}`)}function Ew(e){return tr(`/raw/${encodeURIComponent(e)}`)}function ro(e="pending"){return tr(e==="archived"?"/queue?tab=archived":"/queue")}function rL(e){return tr(`/queue/${encodeURIComponent(e)}`)}function sL(){return tr("/conflicts")}function aL(e){return tr(`/conflicts/${encodeURIComponent(e)}`)}function Tw(){return tr("/index-md")}function Aw(e){return tr(typeof e!="number"?"/log":`/log?limit=${encodeURIComponent(String(e))}`)}function Fg(){return tr("/")}function Gb(e){return`${Hi}/w/${encodeURIComponent(e)}/`}function oL(e){if(e==="/index"||e==="/index-md")return{name:"index-md"};if(e==="/log"){const p=new URLSearchParams(window.location.search).get("limit"),m=Number(p??20);return{name:"log",limit:Number.isInteger(m)?m:20}}if(e==="/conflicts")return{name:"conflicts"};const n=e.match(/^\/conflicts\/([^/]+)$/);if(n)return{name:"conflict-detail",id:decodeURIComponent(n[1]??"")};const r=e.match(/^\/entry\/([^/]+)$/);if(r)return{name:"entry",id:decodeURIComponent(r[1]??"")};const a=e.match(/^\/raw\/(.+)$/);if(a)return{name:"raw",ref:decodeURIComponent(a[1]??"")};if(e==="/queue")return{name:"queue",tab:"pending"};const l=e.match(/^\/queue\/([^/]+)$/);if(l){const p=decodeURIComponent(l[1]??"");return Q3.test(p)?{name:"queue-detail",patchId:p}:{name:"home"}}return{name:"home"}}function tr(e){const n=Up();return n?`${Hi}/w/${encodeURIComponent(n)}${e}`:`${Hi}${e}`}function lL(e){const n=kw(e);return n?{pathname:n.pathname,wsId:n.wsId}:{pathname:e,wsId:null}}function kw(e){const n=e.match(/^\/w\/([^/]+)(\/.*)?$/);return n?{wsId:decodeURIComponent(n[1]??""),pathname:n[2]??"/"}:null}function Rw(e){return e===Hi||e===`${Hi}/`?"/":e.startsWith(`${Hi}/`)?e.slice(Hi.length)||"/":e}function qg(e){for(const n of Hp)n(e)}const Lw="fleet-wiki-web-recent",Fp=new Set,ea={health:null,index:[],currentEntry:null,currentMatchHint:null,conflicts:[],currentConflict:null,indexMarkdown:null,log:null,loading:!1,error:null,recentIds:_L(),pendingPatchCount:0,currentWorkspaceId:null,workspaces:[]};function Lu(){return ea}function cL(e){return Fp.add(e),()=>Fp.delete(e)}async function uL(){Qt({loading:!0,error:null});try{const[e,n,r,a]=await Promise.all([H3(),F3(),uh("pending").catch(()=>null),U3().catch(()=>null)]);Qt({health:e,index:n,pendingPatchCount:r?.pendingCount??0,currentWorkspaceId:a?.currentWorkspaceId??null,workspaces:a?.workspaces??[],loading:!1})}catch(e){Qt({loading:!1,error:fo(e)})}}async function hL(e){Qt({loading:!0,error:null,currentEntry:null,currentMatchHint:ea.currentMatchHint?.id===e?ea.currentMatchHint:null,currentConflict:null,indexMarkdown:null,log:null});try{const n=await W3(e),r=mL(e);Qt({currentEntry:n,currentConflict:null,indexMarkdown:null,log:null,recentIds:r,loading:!1})}catch(n){Qt({loading:!1,error:fo(n)})}}async function dL(){Qt({loading:!0,error:null,currentEntry:null,currentConflict:null,log:null});try{Qt({indexMarkdown:await q3(),loading:!1})}catch(e){Qt({loading:!1,error:fo(e)})}}async function fL(e){Qt({loading:!0,error:null,currentEntry:null,currentConflict:null,indexMarkdown:null});try{Qt({log:await J3(e),loading:!1})}catch(n){Qt({loading:!1,error:fo(n)})}}async function pL(){Qt({loading:!0,error:null,currentEntry:null,currentConflict:null,indexMarkdown:null,log:null});try{Qt({conflicts:await ww(),loading:!1})}catch(e){Qt({loading:!1,error:fo(e)})}}async function gL(e){Qt({loading:!0,error:null,currentEntry:null,indexMarkdown:null,log:null});try{const[n,r]=await Promise.all([Z3(e),ww().catch(()=>ea.conflicts)]);Qt({currentConflict:n,conflicts:r,loading:!1})}catch(n){Qt({loading:!1,error:fo(n)})}}function jf(){Qt({currentEntry:null,currentMatchHint:null,currentConflict:null,indexMarkdown:null,log:null,error:null,loading:!1})}function Mw(e){Qt({currentMatchHint:e})}function Wg(e){Qt({pendingPatchCount:e})}function Qt(e){Object.assign(ea,e);for(const n of Fp)n(ea)}function mL(e){const n=[e,...ea.recentIds.filter(r=>r!==e)].slice(0,8);return window.localStorage.setItem(Lw,JSON.stringify(n)),n}function _L(){try{const e=window.localStorage.getItem(Lw),n=e?JSON.parse(e):[];return Array.isArray(n)?n.filter(r=>typeof r=="string").slice(0,8):[]}catch{return[]}}function fo(e){return e instanceof Error?e.message:String(e)}const ke={open:!1,query:"",selectedIndex:0,results:[],debounceId:null,searchSeq:0,previousBodyOverflow:null,previousActiveElement:null};let qp=[],Gg=[];function vL(e,n){qp=e,Gg=n,ke.open&&!ke.query&&(ke.results=Kg(),ke.selectedIndex=0,Fu())}function Dw(){if(ke.open){Vb();return}ke.open=!0,ke.query="",ke.selectedIndex=0,ke.results=Kg(),ke.previousActiveElement=document.activeElement instanceof HTMLElement?document.activeElement:null,RL(),xL(),Fu(),Vb()}function Qa(){ke.open&&(ke.open=!1,ke.searchSeq++,ke.debounceId!==null&&(window.clearTimeout(ke.debounceId),ke.debounceId=null),EL(),LL(),ML())}function bL(){document.addEventListener("keydown",Ow),document.addEventListener("input",Nw),document.addEventListener("click",Bw),document.addEventListener("mouseover",Iw)}function yL(){ke.open&&Qa(),document.removeEventListener("keydown",Ow),document.removeEventListener("input",Nw),document.removeEventListener("click",Bw),document.removeEventListener("mouseover",Iw)}function SL(){return ke.open}function Ow(e){if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()==="k"){e.preventDefault(),ke.open?Qa():Dw();return}if(ke.open){if(e.key==="Tab"){DL(e);return}if(e.key==="Escape"){e.preventDefault(),Qa();return}if(e.key==="ArrowDown"){e.preventDefault(),ke.selectedIndex=Math.min(ke.selectedIndex+1,Math.max(0,ke.results.length-1)),Wp({scroll:!0});return}if(e.key==="ArrowUp"){e.preventDefault(),ke.selectedIndex=Math.max(0,ke.selectedIndex-1),Wp({scroll:!0});return}if(e.key==="Enter"){e.preventDefault();const r=ke.results[ke.selectedIndex];if(!r)return;Mw(r),Qs($r(r.id)),Qa()}}}function Nw(e){const n=e.target;!(n instanceof HTMLInputElement)||n.id!=="command-input"||(ke.query=n.value.trim(),ke.selectedIndex=0,ke.debounceId!==null&&window.clearTimeout(ke.debounceId),ke.debounceId=window.setTimeout(()=>{wL(ke.query)},150))}function Bw(e){const n=e.target;if(!(n instanceof Element))return;if(n.matches("[data-action='open-command']")||n.closest("[data-action='open-command']")){Dw();return}if(!ke.open)return;if(n.classList.contains("command-overlay")){Qa();return}const r=n.closest("[data-command-entry-id]");if(r){const a=ke.results.find(l=>l.id===(r.dataset.commandEntryId??""));Mw(a??null),Qs($r(r.dataset.commandEntryId??"")),Qa()}}function Iw(e){if(!ke.open)return;const n=e.target;if(!(n instanceof Element))return;const r=n.closest("[data-command-index]");if(!r)return;const a=Number(r.dataset.commandIndex);!Number.isInteger(a)||a<0||a>=ke.results.length||(ke.selectedIndex=a,Wp({scroll:!1}))}async function wL(e){const n=++ke.searchSeq;if(!e){ke.results=Kg(),ke.selectedIndex=0,Fu();return}let r;try{r=await G3(e)}catch{r=[]}n!==ke.searchSeq||!ke.open||(ke.results=r,ke.selectedIndex=0,Fu())}function CL(){let e=document.querySelector("#command-palette-root");return e||(e=document.createElement("div"),e.id="command-palette-root",document.body.append(e)),e}function xL(){const e=CL();e.querySelector(".command-overlay")||(e.innerHTML=TL())}function EL(){const e=document.querySelector("#command-palette-root");e&&(e.innerHTML="")}function Fu(){const e=document.querySelector("#command-results-list");if(e){if(ke.results.length===0){e.innerHTML=`<p class="empty-state">${Ee("No results found.")}</p>`;return}e.innerHTML=ke.query?ke.results.map(jw).join(""):AL()}}function Wp(e={scroll:!0}){const n=document.querySelectorAll(".command-result");n.forEach((a,l)=>{a.classList.toggle("active",l===ke.selectedIndex)});const r=n[ke.selectedIndex];e.scroll&&r?.scrollIntoView({block:"nearest"})}function TL(){const e=Ye("Command palette"),n=Ye("Search titles · tags · content");return`
42
- <div class="command-overlay">
43
- <section class="command-card" role="dialog" aria-modal="true" aria-label="${e}" tabindex="-1">
44
- <div class="command-search">
45
- <svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
46
- <circle cx="11" cy="11" r="6.5" />
47
- <path d="m20 20-3.5-3.5" />
48
- </svg>
49
- <input id="command-input" type="search" autocomplete="off" spellcheck="false" placeholder="${n}" />
50
- <kbd>esc</kbd>
51
- </div>
52
- <div class="command-results" id="command-results-list"></div>
53
- </section>
54
- </div>
55
- `}function jw(e,n){const r=n===ke.selectedIndex?" active":"",a=Ye(e.title),l=e.tags.slice(0,2),p=e.tags.length-l.length,m=IL(e),c=l.map(h=>`<span class="chip chip-tag">${Ee(h)}</span>`).join(""),u=p>0?`<span class="chip chip-muted">+${p}</span>`:"";return`
56
- <button class="command-result${r}" type="button" data-command-entry-id="${Ye(e.id)}" data-command-index="${n}" title="${a}">
57
- <span class="command-result-text">
58
- <strong>${NL(e.title,ke.query)}</strong>
59
- <small>${Ee(BL(e))}</small>
60
- ${m?`<small class="command-result-excerpt">${Ee(m)}</small>`:""}
61
- </span>
62
- <span class="command-result-aside">${c}${u}</span>
63
- </button>
64
- `}function AL(){const e=kL(),n=ke.results.slice(0,e),r=ke.results.slice(e);return[n.length>0?Kb("Recent",n,0):"",r.length>0?Kb("All",r,e):""].join("")}function Kb(e,n,r){return`
65
- <div class="command-section-heading">${Ee(e)}</div>
66
- ${n.map((a,l)=>jw(a,r+l)).join("")}
67
- `}function Kg(){const e=new Set(Gg),n=$w().map(a=>qp.find(l=>l.id===a)).filter(a=>!!a),r=qp.filter(a=>!e.has(a.id));return[...n,...r].slice(0,12).map((a,l)=>({id:a.id,title:a.title,score:Math.max(1,100-l),reason:"title",excerpt:"",path:a.path,tags:a.tags,updated:a.updated}))}function kL(){return $w().filter((e,n)=>ke.results[n]?.id===e).length}function $w(){return Array.from(new Set(Gg))}function RL(){ke.previousBodyOverflow===null&&(ke.previousBodyOverflow=document.body.style.overflow,document.body.style.overflow="hidden")}function LL(){ke.previousBodyOverflow!==null&&(document.body.style.overflow=ke.previousBodyOverflow,ke.previousBodyOverflow=null)}function ML(){const e=ke.previousActiveElement;ke.previousActiveElement=null,e?.isConnected&&e.focus()}function Vb(){window.setTimeout(()=>{const e=document.querySelector("#command-input");e&&(e.focus(),e.select())},0)}function DL(e){const n=document.querySelector(".command-card");if(!n)return;const r=OL(n);if(r.length===0){e.preventDefault(),n.focus();return}const a=document.activeElement,l=a instanceof HTMLElement?r.indexOf(a):-1,p=e.shiftKey?l<=0?r.length-1:l-1:l===-1||l===r.length-1?0:l+1;(l===-1||e.shiftKey&&l===0||!e.shiftKey&&l===r.length-1)&&(e.preventDefault(),r[p]?.focus())}function OL(e){const n=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");return Array.from(e.querySelectorAll(n)).filter(r=>!r.hasAttribute("hidden")&&r.offsetParent!==null)}function NL(e,n){if(!n)return Ee(e);const r=e.toLocaleLowerCase(),a=n.toLocaleLowerCase();if(!a)return Ee(e);let l=0,p="";for(;l<e.length;){const m=r.indexOf(a,l);if(m===-1)break;p+=Ee(e.slice(l,m)),p+=`<mark class="command-highlight">${Ee(e.slice(m,m+n.length))}</mark>`,l=m+n.length}return p+Ee(e.slice(l))}function BL(e){switch(e.reason){case"id":return"id match";case"alias":return"alias match";case"tag":return"tag match";case"title":return"title match";case"body":return"body match";default:return"match"}}function IL(e){const n=e.matchedSnippets?.find(a=>a.field==="body")?.snippet;if(e.reason!=="body")return"";const r=n??e.excerpt;return jL(r??"")}function jL(e){return zL($L(e)).replace(/\s+/g," ").trim().slice(0,180)}function $L(e){return e.replace(/<<<[^>]*>>>/g," ")}function zL(e){return e.replace(/!\[[^\]]*]\([^)]*\)/g," ").replace(/\[\[wiki:([^\]\|]+)(?:\|[^\]]*)?]]/g,"$1").replace(/\[([^\]]+)]\([^)]*\)/g,"$1").replace(/^#{1,6}\s+/gm,"").replace(/^\s*(?:[-*]\s+|\d+\.\s+)/gm,"").replace(/^\s*>\s?/gm,"").replace(/`+/g,"").replace(/\*\*([^*]+)\*\*/g,"$1").replace(/__([^_]+)__/g,"$1").replace(/\*([^*\n]+)\*/g,"$1").replace(/_([^_\n]+)_/g,"$1")}function Vg(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ia=Vg();function zw(e){ia=e}var Ll={exec:()=>null};function ct(e,n=""){let r=typeof e=="string"?e:e.source,a={replace:(l,p)=>{let m=typeof p=="string"?p:p.source;return m=m.replace(zn.caret,"$1"),r=r.replace(l,m),a},getRegex:()=>new RegExp(r,n)};return a}var PL=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),zn={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},HL=/^(?:[ \t]*(?:\n|$))+/,UL=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,FL=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Gl=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,qL=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Yg=/(?:[*+-]|\d{1,9}[.)])/,Pw=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Hw=ct(Pw).replace(/bull/g,Yg).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),WL=ct(Pw).replace(/bull/g,Yg).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Xg=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,GL=/^[^\n]+/,Zg=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,KL=ct(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Zg).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),VL=ct(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Yg).getRegex(),hh="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Jg=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,YL=ct("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Jg).replace("tag",hh).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Uw=ct(Xg).replace("hr",Gl).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",hh).getRegex(),XL=ct(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Uw).getRegex(),Qg={blockquote:XL,code:UL,def:KL,fences:FL,heading:qL,hr:Gl,html:YL,lheading:Hw,list:VL,newline:HL,paragraph:Uw,table:Ll,text:GL},Yb=ct("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Gl).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",hh).getRegex(),ZL={...Qg,lheading:WL,table:Yb,paragraph:ct(Xg).replace("hr",Gl).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Yb).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",hh).getRegex()},JL={...Qg,html:ct(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Jg).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ll,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ct(Xg).replace("hr",Gl).replace("heading",` *#{1,6} *[^
68
- ]`).replace("lheading",Hw).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},QL=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,eM=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Fw=/^( {2,}|\\)\n(?!\s*$)/,tM=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,dh=/[\p{P}\p{S}]/u,em=/[\s\p{P}\p{S}]/u,qw=/[^\s\p{P}\p{S}]/u,nM=ct(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,em).getRegex(),Ww=/(?!~)[\p{P}\p{S}]/u,iM=/(?!~)[\s\p{P}\p{S}]/u,rM=/(?:[^\s\p{P}\p{S}]|~)/u,sM=ct(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",PL?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Gw=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,aM=ct(Gw,"u").replace(/punct/g,dh).getRegex(),oM=ct(Gw,"u").replace(/punct/g,Ww).getRegex(),Kw="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",lM=ct(Kw,"gu").replace(/notPunctSpace/g,qw).replace(/punctSpace/g,em).replace(/punct/g,dh).getRegex(),cM=ct(Kw,"gu").replace(/notPunctSpace/g,rM).replace(/punctSpace/g,iM).replace(/punct/g,Ww).getRegex(),uM=ct("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,qw).replace(/punctSpace/g,em).replace(/punct/g,dh).getRegex(),hM=ct(/\\(punct)/,"gu").replace(/punct/g,dh).getRegex(),dM=ct(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),fM=ct(Jg).replace("(?:-->|$)","-->").getRegex(),pM=ct("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",fM).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),qu=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,gM=ct(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",qu).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Vw=ct(/^!?\[(label)\]\[(ref)\]/).replace("label",qu).replace("ref",Zg).getRegex(),Yw=ct(/^!?\[(ref)\](?:\[\])?/).replace("ref",Zg).getRegex(),mM=ct("reflink|nolink(?!\\()","g").replace("reflink",Vw).replace("nolink",Yw).getRegex(),Xb=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,tm={_backpedal:Ll,anyPunctuation:hM,autolink:dM,blockSkip:sM,br:Fw,code:eM,del:Ll,emStrongLDelim:aM,emStrongRDelimAst:lM,emStrongRDelimUnd:uM,escape:QL,link:gM,nolink:Yw,punctuation:nM,reflink:Vw,reflinkSearch:mM,tag:pM,text:tM,url:Ll},_M={...tm,link:ct(/^!?\[(label)\]\((.*?)\)/).replace("label",qu).getRegex(),reflink:ct(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",qu).getRegex()},Gp={...tm,emStrongRDelimAst:cM,emStrongLDelim:oM,url:ct(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Xb).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:ct(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Xb).getRegex()},vM={...Gp,br:ct(Fw).replace("{2,}","*").getRegex(),text:ct(Gp.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},uu={normal:Qg,gfm:ZL,pedantic:JL},dl={normal:tm,gfm:Gp,breaks:vM,pedantic:_M},bM={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Zb=e=>bM[e];function Ji(e,n){if(n){if(zn.escapeTest.test(e))return e.replace(zn.escapeReplace,Zb)}else if(zn.escapeTestNoEncode.test(e))return e.replace(zn.escapeReplaceNoEncode,Zb);return e}function Jb(e){try{e=encodeURI(e).replace(zn.percentDecode,"%")}catch{return null}return e}function Qb(e,n){let r=e.replace(zn.findPipe,(p,m,c)=>{let u=!1,h=m;for(;--h>=0&&c[h]==="\\";)u=!u;return u?"|":" |"}),a=r.split(zn.splitPipe),l=0;if(a[0].trim()||a.shift(),a.length>0&&!a.at(-1)?.trim()&&a.pop(),n)if(a.length>n)a.splice(n);else for(;a.length<n;)a.push("");for(;l<a.length;l++)a[l]=a[l].trim().replace(zn.slashPipe,"|");return a}function fl(e,n,r){let a=e.length;if(a===0)return"";let l=0;for(;l<a&&e.charAt(a-l-1)===n;)l++;return e.slice(0,a-l)}function yM(e,n){if(e.indexOf(n[1])===-1)return-1;let r=0;for(let a=0;a<e.length;a++)if(e[a]==="\\")a++;else if(e[a]===n[0])r++;else if(e[a]===n[1]&&(r--,r<0))return a;return r>0?-2:-1}function e1(e,n,r,a,l){let p=n.href,m=n.title||null,c=e[1].replace(l.other.outputLinkReplace,"$1");a.state.inLink=!0;let u={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:p,title:m,text:c,tokens:a.inlineTokens(c)};return a.state.inLink=!1,u}function SM(e,n,r){let a=e.match(r.other.indentCodeCompensation);if(a===null)return n;let l=a[1];return n.split(`
69
- `).map(p=>{let m=p.match(r.other.beginningSpace);if(m===null)return p;let[c]=m;return c.length>=l.length?p.slice(l.length):p}).join(`
70
- `)}var Wu=class{options;rules;lexer;constructor(e){this.options=e||ia}space(e){let n=this.rules.block.newline.exec(e);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(e){let n=this.rules.block.code.exec(e);if(n){let r=n[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:fl(r,`
71
- `)}}}fences(e){let n=this.rules.block.fences.exec(e);if(n){let r=n[0],a=SM(r,n[3]||"",this.rules);return{type:"code",raw:r,lang:n[2]?n[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):n[2],text:a}}}heading(e){let n=this.rules.block.heading.exec(e);if(n){let r=n[2].trim();if(this.rules.other.endingHash.test(r)){let a=fl(r,"#");(this.options.pedantic||!a||this.rules.other.endingSpaceChar.test(a))&&(r=a.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){let n=this.rules.block.hr.exec(e);if(n)return{type:"hr",raw:fl(n[0],`
72
- `)}}blockquote(e){let n=this.rules.block.blockquote.exec(e);if(n){let r=fl(n[0],`
73
- `).split(`
74
- `),a="",l="",p=[];for(;r.length>0;){let m=!1,c=[],u;for(u=0;u<r.length;u++)if(this.rules.other.blockquoteStart.test(r[u]))c.push(r[u]),m=!0;else if(!m)c.push(r[u]);else break;r=r.slice(u);let h=c.join(`
75
- `),y=h.replace(this.rules.other.blockquoteSetextReplace,`
76
- $1`).replace(this.rules.other.blockquoteSetextReplace2,"");a=a?`${a}
77
- ${h}`:h,l=l?`${l}
78
- ${y}`:y;let g=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(y,p,!0),this.lexer.state.top=g,r.length===0)break;let C=p.at(-1);if(C?.type==="code")break;if(C?.type==="blockquote"){let T=C,A=T.raw+`
79
- `+r.join(`
80
- `),x=this.blockquote(A);p[p.length-1]=x,a=a.substring(0,a.length-T.raw.length)+x.raw,l=l.substring(0,l.length-T.text.length)+x.text;break}else if(C?.type==="list"){let T=C,A=T.raw+`
81
- `+r.join(`
82
- `),x=this.list(A);p[p.length-1]=x,a=a.substring(0,a.length-C.raw.length)+x.raw,l=l.substring(0,l.length-T.raw.length)+x.raw,r=A.substring(p.at(-1).raw.length).split(`
83
- `);continue}}return{type:"blockquote",raw:a,tokens:p,text:l}}}list(e){let n=this.rules.block.list.exec(e);if(n){let r=n[1].trim(),a=r.length>1,l={type:"list",raw:"",ordered:a,start:a?+r.slice(0,-1):"",loose:!1,items:[]};r=a?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=a?r:"[*+-]");let p=this.rules.other.listItemRegex(r),m=!1;for(;e;){let u=!1,h="",y="";if(!(n=p.exec(e))||this.rules.block.hr.test(e))break;h=n[0],e=e.substring(h.length);let g=n[2].split(`
84
- `,1)[0].replace(this.rules.other.listReplaceTabs,v=>" ".repeat(3*v.length)),C=e.split(`
85
- `,1)[0],T=!g.trim(),A=0;if(this.options.pedantic?(A=2,y=g.trimStart()):T?A=n[1].length+1:(A=n[2].search(this.rules.other.nonSpaceChar),A=A>4?1:A,y=g.slice(A),A+=n[1].length),T&&this.rules.other.blankLine.test(C)&&(h+=C+`
86
- `,e=e.substring(C.length+1),u=!0),!u){let v=this.rules.other.nextBulletRegex(A),f=this.rules.other.hrRegex(A),b=this.rules.other.fencesBeginRegex(A),E=this.rules.other.headingBeginRegex(A),L=this.rules.other.htmlBeginRegex(A);for(;e;){let R=e.split(`
87
- `,1)[0],M;if(C=R,this.options.pedantic?(C=C.replace(this.rules.other.listReplaceNesting," "),M=C):M=C.replace(this.rules.other.tabCharGlobal," "),b.test(C)||E.test(C)||L.test(C)||v.test(C)||f.test(C))break;if(M.search(this.rules.other.nonSpaceChar)>=A||!C.trim())y+=`
88
- `+M.slice(A);else{if(T||g.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||b.test(g)||E.test(g)||f.test(g))break;y+=`
89
- `+C}!T&&!C.trim()&&(T=!0),h+=R+`
90
- `,e=e.substring(R.length+1),g=M.slice(A)}}l.loose||(m?l.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(m=!0));let x=null,d;this.options.gfm&&(x=this.rules.other.listIsTask.exec(y),x&&(d=x[0]!=="[ ] ",y=y.replace(this.rules.other.listReplaceTask,""))),l.items.push({type:"list_item",raw:h,task:!!x,checked:d,loose:!1,text:y,tokens:[]}),l.raw+=h}let c=l.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;l.raw=l.raw.trimEnd();for(let u=0;u<l.items.length;u++)if(this.lexer.state.top=!1,l.items[u].tokens=this.lexer.blockTokens(l.items[u].text,[]),!l.loose){let h=l.items[u].tokens.filter(g=>g.type==="space"),y=h.length>0&&h.some(g=>this.rules.other.anyLine.test(g.raw));l.loose=y}if(l.loose)for(let u=0;u<l.items.length;u++)l.items[u].loose=!0;return l}}html(e){let n=this.rules.block.html.exec(e);if(n)return{type:"html",block:!0,raw:n[0],pre:n[1]==="pre"||n[1]==="script"||n[1]==="style",text:n[0]}}def(e){let n=this.rules.block.def.exec(e);if(n){let r=n[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),a=n[2]?n[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",l=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):n[3];return{type:"def",tag:r,raw:n[0],href:a,title:l}}}table(e){let n=this.rules.block.table.exec(e);if(!n||!this.rules.other.tableDelimiter.test(n[2]))return;let r=Qb(n[1]),a=n[2].replace(this.rules.other.tableAlignChars,"").split("|"),l=n[3]?.trim()?n[3].replace(this.rules.other.tableRowBlankLine,"").split(`
91
- `):[],p={type:"table",raw:n[0],header:[],align:[],rows:[]};if(r.length===a.length){for(let m of a)this.rules.other.tableAlignRight.test(m)?p.align.push("right"):this.rules.other.tableAlignCenter.test(m)?p.align.push("center"):this.rules.other.tableAlignLeft.test(m)?p.align.push("left"):p.align.push(null);for(let m=0;m<r.length;m++)p.header.push({text:r[m],tokens:this.lexer.inline(r[m]),header:!0,align:p.align[m]});for(let m of l)p.rows.push(Qb(m,p.header.length).map((c,u)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:p.align[u]})));return p}}lheading(e){let n=this.rules.block.lheading.exec(e);if(n)return{type:"heading",raw:n[0],depth:n[2].charAt(0)==="="?1:2,text:n[1],tokens:this.lexer.inline(n[1])}}paragraph(e){let n=this.rules.block.paragraph.exec(e);if(n){let r=n[1].charAt(n[1].length-1)===`
92
- `?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:r,tokens:this.lexer.inline(r)}}}text(e){let n=this.rules.block.text.exec(e);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(e){let n=this.rules.inline.escape.exec(e);if(n)return{type:"escape",raw:n[0],text:n[1]}}tag(e){let n=this.rules.inline.tag.exec(e);if(n)return!this.lexer.state.inLink&&this.rules.other.startATag.test(n[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:n[0]}}link(e){let n=this.rules.inline.link.exec(e);if(n){let r=n[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let p=fl(r.slice(0,-1),"\\");if((r.length-p.length)%2===0)return}else{let p=yM(n[2],"()");if(p===-2)return;if(p>-1){let m=(n[0].indexOf("!")===0?5:4)+n[1].length+p;n[2]=n[2].substring(0,p),n[0]=n[0].substring(0,m).trim(),n[3]=""}}let a=n[2],l="";if(this.options.pedantic){let p=this.rules.other.pedanticHrefTitle.exec(a);p&&(a=p[1],l=p[3])}else l=n[3]?n[3].slice(1,-1):"";return a=a.trim(),this.rules.other.startAngleBracket.test(a)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?a=a.slice(1):a=a.slice(1,-1)),e1(n,{href:a&&a.replace(this.rules.inline.anyPunctuation,"$1"),title:l&&l.replace(this.rules.inline.anyPunctuation,"$1")},n[0],this.lexer,this.rules)}}reflink(e,n){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let a=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),l=n[a.toLowerCase()];if(!l){let p=r[0].charAt(0);return{type:"text",raw:p,text:p}}return e1(r,l,r[0],this.lexer,this.rules)}}emStrong(e,n,r=""){let a=this.rules.inline.emStrongLDelim.exec(e);if(!(!a||a[3]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(a[1]||a[2])||!r||this.rules.inline.punctuation.exec(r))){let l=[...a[0]].length-1,p,m,c=l,u=0,h=a[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,n=n.slice(-1*e.length+l);(a=h.exec(n))!=null;){if(p=a[1]||a[2]||a[3]||a[4]||a[5]||a[6],!p)continue;if(m=[...p].length,a[3]||a[4]){c+=m;continue}else if((a[5]||a[6])&&l%3&&!((l+m)%3)){u+=m;continue}if(c-=m,c>0)continue;m=Math.min(m,m+c+u);let y=[...a[0]][0].length,g=e.slice(0,l+a.index+y+m);if(Math.min(l,m)%2){let T=g.slice(1,-1);return{type:"em",raw:g,text:T,tokens:this.lexer.inlineTokens(T)}}let C=g.slice(2,-2);return{type:"strong",raw:g,text:C,tokens:this.lexer.inlineTokens(C)}}}}codespan(e){let n=this.rules.inline.code.exec(e);if(n){let r=n[2].replace(this.rules.other.newLineCharGlobal," "),a=this.rules.other.nonSpaceChar.test(r),l=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return a&&l&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:n[0],text:r}}}br(e){let n=this.rules.inline.br.exec(e);if(n)return{type:"br",raw:n[0]}}del(e){let n=this.rules.inline.del.exec(e);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(e){let n=this.rules.inline.autolink.exec(e);if(n){let r,a;return n[2]==="@"?(r=n[1],a="mailto:"+r):(r=n[1],a=r),{type:"link",raw:n[0],text:r,href:a,tokens:[{type:"text",raw:r,text:r}]}}}url(e){let n;if(n=this.rules.inline.url.exec(e)){let r,a;if(n[2]==="@")r=n[0],a="mailto:"+r;else{let l;do l=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])?.[0]??"";while(l!==n[0]);r=n[0],n[1]==="www."?a="http://"+n[0]:a=n[0]}return{type:"link",raw:n[0],text:r,href:a,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){let n=this.rules.inline.text.exec(e);if(n){let r=this.lexer.state.inRawBlock;return{type:"text",raw:n[0],text:n[0],escaped:r}}}},$i=class Kp{tokens;options;state;tokenizer;inlineQueue;constructor(n){this.tokens=[],this.tokens.links=Object.create(null),this.options=n||ia,this.options.tokenizer=this.options.tokenizer||new Wu,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:zn,block:uu.normal,inline:dl.normal};this.options.pedantic?(r.block=uu.pedantic,r.inline=dl.pedantic):this.options.gfm&&(r.block=uu.gfm,this.options.breaks?r.inline=dl.breaks:r.inline=dl.gfm),this.tokenizer.rules=r}static get rules(){return{block:uu,inline:dl}}static lex(n,r){return new Kp(r).lex(n)}static lexInline(n,r){return new Kp(r).inlineTokens(n)}lex(n){n=n.replace(zn.carriageReturn,`
93
- `),this.blockTokens(n,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let a=this.inlineQueue[r];this.inlineTokens(a.src,a.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(n,r=[],a=!1){for(this.options.pedantic&&(n=n.replace(zn.tabCharGlobal," ").replace(zn.spaceLine,""));n;){let l;if(this.options.extensions?.block?.some(m=>(l=m.call({lexer:this},n,r))?(n=n.substring(l.raw.length),r.push(l),!0):!1))continue;if(l=this.tokenizer.space(n)){n=n.substring(l.raw.length);let m=r.at(-1);l.raw.length===1&&m!==void 0?m.raw+=`
94
- `:r.push(l);continue}if(l=this.tokenizer.code(n)){n=n.substring(l.raw.length);let m=r.at(-1);m?.type==="paragraph"||m?.type==="text"?(m.raw+=(m.raw.endsWith(`
95
- `)?"":`
96
- `)+l.raw,m.text+=`
97
- `+l.text,this.inlineQueue.at(-1).src=m.text):r.push(l);continue}if(l=this.tokenizer.fences(n)){n=n.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.heading(n)){n=n.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.hr(n)){n=n.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.blockquote(n)){n=n.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.list(n)){n=n.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.html(n)){n=n.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.def(n)){n=n.substring(l.raw.length);let m=r.at(-1);m?.type==="paragraph"||m?.type==="text"?(m.raw+=(m.raw.endsWith(`
98
- `)?"":`
99
- `)+l.raw,m.text+=`
100
- `+l.raw,this.inlineQueue.at(-1).src=m.text):this.tokens.links[l.tag]||(this.tokens.links[l.tag]={href:l.href,title:l.title},r.push(l));continue}if(l=this.tokenizer.table(n)){n=n.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.lheading(n)){n=n.substring(l.raw.length),r.push(l);continue}let p=n;if(this.options.extensions?.startBlock){let m=1/0,c=n.slice(1),u;this.options.extensions.startBlock.forEach(h=>{u=h.call({lexer:this},c),typeof u=="number"&&u>=0&&(m=Math.min(m,u))}),m<1/0&&m>=0&&(p=n.substring(0,m+1))}if(this.state.top&&(l=this.tokenizer.paragraph(p))){let m=r.at(-1);a&&m?.type==="paragraph"?(m.raw+=(m.raw.endsWith(`
101
- `)?"":`
102
- `)+l.raw,m.text+=`
103
- `+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=m.text):r.push(l),a=p.length!==n.length,n=n.substring(l.raw.length);continue}if(l=this.tokenizer.text(n)){n=n.substring(l.raw.length);let m=r.at(-1);m?.type==="text"?(m.raw+=(m.raw.endsWith(`
104
- `)?"":`
105
- `)+l.raw,m.text+=`
106
- `+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=m.text):r.push(l);continue}if(n){let m="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return this.state.top=!0,r}inline(n,r=[]){return this.inlineQueue.push({src:n,tokens:r}),r}inlineTokens(n,r=[]){let a=n,l=null;if(this.tokens.links){let u=Object.keys(this.tokens.links);if(u.length>0)for(;(l=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null;)u.includes(l[0].slice(l[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,l.index)+"["+"a".repeat(l[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(l=this.tokenizer.rules.inline.anyPunctuation.exec(a))!=null;)a=a.slice(0,l.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let p;for(;(l=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)p=l[2]?l[2].length:0,a=a.slice(0,l.index+p)+"["+"a".repeat(l[0].length-p-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);a=this.options.hooks?.emStrongMask?.call({lexer:this},a)??a;let m=!1,c="";for(;n;){m||(c=""),m=!1;let u;if(this.options.extensions?.inline?.some(y=>(u=y.call({lexer:this},n,r))?(n=n.substring(u.raw.length),r.push(u),!0):!1))continue;if(u=this.tokenizer.escape(n)){n=n.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.tag(n)){n=n.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.link(n)){n=n.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.reflink(n,this.tokens.links)){n=n.substring(u.raw.length);let y=r.at(-1);u.type==="text"&&y?.type==="text"?(y.raw+=u.raw,y.text+=u.text):r.push(u);continue}if(u=this.tokenizer.emStrong(n,a,c)){n=n.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.codespan(n)){n=n.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.br(n)){n=n.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.del(n)){n=n.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.autolink(n)){n=n.substring(u.raw.length),r.push(u);continue}if(!this.state.inLink&&(u=this.tokenizer.url(n))){n=n.substring(u.raw.length),r.push(u);continue}let h=n;if(this.options.extensions?.startInline){let y=1/0,g=n.slice(1),C;this.options.extensions.startInline.forEach(T=>{C=T.call({lexer:this},g),typeof C=="number"&&C>=0&&(y=Math.min(y,C))}),y<1/0&&y>=0&&(h=n.substring(0,y+1))}if(u=this.tokenizer.inlineText(h)){n=n.substring(u.raw.length),u.raw.slice(-1)!=="_"&&(c=u.raw.slice(-1)),m=!0;let y=r.at(-1);y?.type==="text"?(y.raw+=u.raw,y.text+=u.text):r.push(u);continue}if(n){let y="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(y);break}else throw new Error(y)}}return r}},Gu=class{options;parser;constructor(e){this.options=e||ia}space(e){return""}code({text:e,lang:n,escaped:r}){let a=(n||"").match(zn.notSpaceStart)?.[0],l=e.replace(zn.endingNewline,"")+`
107
- `;return a?'<pre><code class="language-'+Ji(a)+'">'+(r?l:Ji(l,!0))+`</code></pre>
108
- `:"<pre><code>"+(r?l:Ji(l,!0))+`</code></pre>
109
- `}blockquote({tokens:e}){return`<blockquote>
110
- ${this.parser.parse(e)}</blockquote>
111
- `}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:n}){return`<h${n}>${this.parser.parseInline(e)}</h${n}>
112
- `}hr(e){return`<hr>
113
- `}list(e){let n=e.ordered,r=e.start,a="";for(let m=0;m<e.items.length;m++){let c=e.items[m];a+=this.listitem(c)}let l=n?"ol":"ul",p=n&&r!==1?' start="'+r+'"':"";return"<"+l+p+`>
114
- `+a+"</"+l+`>
115
- `}listitem(e){let n="";if(e.task){let r=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type==="paragraph"?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=r+" "+Ji(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):n+=r+" "}return n+=this.parser.parse(e.tokens,!!e.loose),`<li>${n}</li>
116
- `}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
117
- `}table(e){let n="",r="";for(let l=0;l<e.header.length;l++)r+=this.tablecell(e.header[l]);n+=this.tablerow({text:r});let a="";for(let l=0;l<e.rows.length;l++){let p=e.rows[l];r="";for(let m=0;m<p.length;m++)r+=this.tablecell(p[m]);a+=this.tablerow({text:r})}return a&&(a=`<tbody>${a}</tbody>`),`<table>
118
- <thead>
119
- `+n+`</thead>
120
- `+a+`</table>
121
- `}tablerow({text:e}){return`<tr>
122
- ${e}</tr>
123
- `}tablecell(e){let n=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+n+`</${r}>
124
- `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Ji(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:n,tokens:r}){let a=this.parser.parseInline(r),l=Jb(e);if(l===null)return a;e=l;let p='<a href="'+e+'"';return n&&(p+=' title="'+Ji(n)+'"'),p+=">"+a+"</a>",p}image({href:e,title:n,text:r,tokens:a}){a&&(r=this.parser.parseInline(a,this.parser.textRenderer));let l=Jb(e);if(l===null)return Ji(r);e=l;let p=`<img src="${e}" alt="${r}"`;return n&&(p+=` title="${Ji(n)}"`),p+=">",p}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Ji(e.text)}},nm=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},zi=class Vp{options;renderer;textRenderer;constructor(n){this.options=n||ia,this.options.renderer=this.options.renderer||new Gu,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new nm}static parse(n,r){return new Vp(r).parse(n)}static parseInline(n,r){return new Vp(r).parseInline(n)}parse(n,r=!0){let a="";for(let l=0;l<n.length;l++){let p=n[l];if(this.options.extensions?.renderers?.[p.type]){let c=p,u=this.options.extensions.renderers[c.type].call({parser:this},c);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(c.type)){a+=u||"";continue}}let m=p;switch(m.type){case"space":{a+=this.renderer.space(m);continue}case"hr":{a+=this.renderer.hr(m);continue}case"heading":{a+=this.renderer.heading(m);continue}case"code":{a+=this.renderer.code(m);continue}case"table":{a+=this.renderer.table(m);continue}case"blockquote":{a+=this.renderer.blockquote(m);continue}case"list":{a+=this.renderer.list(m);continue}case"html":{a+=this.renderer.html(m);continue}case"def":{a+=this.renderer.def(m);continue}case"paragraph":{a+=this.renderer.paragraph(m);continue}case"text":{let c=m,u=this.renderer.text(c);for(;l+1<n.length&&n[l+1].type==="text";)c=n[++l],u+=`
125
- `+this.renderer.text(c);r?a+=this.renderer.paragraph({type:"paragraph",raw:u,text:u,tokens:[{type:"text",raw:u,text:u,escaped:!0}]}):a+=u;continue}default:{let c='Token with "'+m.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return a}parseInline(n,r=this.renderer){let a="";for(let l=0;l<n.length;l++){let p=n[l];if(this.options.extensions?.renderers?.[p.type]){let c=this.options.extensions.renderers[p.type].call({parser:this},p);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(p.type)){a+=c||"";continue}}let m=p;switch(m.type){case"escape":{a+=r.text(m);break}case"html":{a+=r.html(m);break}case"link":{a+=r.link(m);break}case"image":{a+=r.image(m);break}case"strong":{a+=r.strong(m);break}case"em":{a+=r.em(m);break}case"codespan":{a+=r.codespan(m);break}case"br":{a+=r.br(m);break}case"del":{a+=r.del(m);break}case"text":{a+=r.text(m);break}default:{let c='Token with "'+m.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return a}},Cl=class{options;block;constructor(e){this.options=e||ia}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?$i.lex:$i.lexInline}provideParser(){return this.block?zi.parse:zi.parseInline}},Xw=class{defaults=Vg();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=zi;Renderer=Gu;TextRenderer=nm;Lexer=$i;Tokenizer=Wu;Hooks=Cl;constructor(...n){this.use(...n)}walkTokens(n,r){let a=[];for(let l of n)switch(a=a.concat(r.call(this,l)),l.type){case"table":{let p=l;for(let m of p.header)a=a.concat(this.walkTokens(m.tokens,r));for(let m of p.rows)for(let c of m)a=a.concat(this.walkTokens(c.tokens,r));break}case"list":{let p=l;a=a.concat(this.walkTokens(p.items,r));break}default:{let p=l;this.defaults.extensions?.childTokens?.[p.type]?this.defaults.extensions.childTokens[p.type].forEach(m=>{let c=p[m].flat(1/0);a=a.concat(this.walkTokens(c,r))}):p.tokens&&(a=a.concat(this.walkTokens(p.tokens,r)))}}return a}use(...n){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(a=>{let l={...a};if(l.async=this.defaults.async||l.async||!1,a.extensions&&(a.extensions.forEach(p=>{if(!p.name)throw new Error("extension name required");if("renderer"in p){let m=r.renderers[p.name];m?r.renderers[p.name]=function(...c){let u=p.renderer.apply(this,c);return u===!1&&(u=m.apply(this,c)),u}:r.renderers[p.name]=p.renderer}if("tokenizer"in p){if(!p.level||p.level!=="block"&&p.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let m=r[p.level];m?m.unshift(p.tokenizer):r[p.level]=[p.tokenizer],p.start&&(p.level==="block"?r.startBlock?r.startBlock.push(p.start):r.startBlock=[p.start]:p.level==="inline"&&(r.startInline?r.startInline.push(p.start):r.startInline=[p.start]))}"childTokens"in p&&p.childTokens&&(r.childTokens[p.name]=p.childTokens)}),l.extensions=r),a.renderer){let p=this.defaults.renderer||new Gu(this.defaults);for(let m in a.renderer){if(!(m in p))throw new Error(`renderer '${m}' does not exist`);if(["options","parser"].includes(m))continue;let c=m,u=a.renderer[c],h=p[c];p[c]=(...y)=>{let g=u.apply(p,y);return g===!1&&(g=h.apply(p,y)),g||""}}l.renderer=p}if(a.tokenizer){let p=this.defaults.tokenizer||new Wu(this.defaults);for(let m in a.tokenizer){if(!(m in p))throw new Error(`tokenizer '${m}' does not exist`);if(["options","rules","lexer"].includes(m))continue;let c=m,u=a.tokenizer[c],h=p[c];p[c]=(...y)=>{let g=u.apply(p,y);return g===!1&&(g=h.apply(p,y)),g}}l.tokenizer=p}if(a.hooks){let p=this.defaults.hooks||new Cl;for(let m in a.hooks){if(!(m in p))throw new Error(`hook '${m}' does not exist`);if(["options","block"].includes(m))continue;let c=m,u=a.hooks[c],h=p[c];Cl.passThroughHooks.has(m)?p[c]=y=>{if(this.defaults.async&&Cl.passThroughHooksRespectAsync.has(m))return(async()=>{let C=await u.call(p,y);return h.call(p,C)})();let g=u.call(p,y);return h.call(p,g)}:p[c]=(...y)=>{if(this.defaults.async)return(async()=>{let C=await u.apply(p,y);return C===!1&&(C=await h.apply(p,y)),C})();let g=u.apply(p,y);return g===!1&&(g=h.apply(p,y)),g}}l.hooks=p}if(a.walkTokens){let p=this.defaults.walkTokens,m=a.walkTokens;l.walkTokens=function(c){let u=[];return u.push(m.call(this,c)),p&&(u=u.concat(p.call(this,c))),u}}this.defaults={...this.defaults,...l}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,r){return $i.lex(n,r??this.defaults)}parser(n,r){return zi.parse(n,r??this.defaults)}parseMarkdown(n){return(r,a)=>{let l={...a},p={...this.defaults,...l},m=this.onError(!!p.silent,!!p.async);if(this.defaults.async===!0&&l.async===!1)return m(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return m(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return m(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(p.hooks&&(p.hooks.options=p,p.hooks.block=n),p.async)return(async()=>{let c=p.hooks?await p.hooks.preprocess(r):r,u=await(p.hooks?await p.hooks.provideLexer():n?$i.lex:$i.lexInline)(c,p),h=p.hooks?await p.hooks.processAllTokens(u):u;p.walkTokens&&await Promise.all(this.walkTokens(h,p.walkTokens));let y=await(p.hooks?await p.hooks.provideParser():n?zi.parse:zi.parseInline)(h,p);return p.hooks?await p.hooks.postprocess(y):y})().catch(m);try{p.hooks&&(r=p.hooks.preprocess(r));let c=(p.hooks?p.hooks.provideLexer():n?$i.lex:$i.lexInline)(r,p);p.hooks&&(c=p.hooks.processAllTokens(c)),p.walkTokens&&this.walkTokens(c,p.walkTokens);let u=(p.hooks?p.hooks.provideParser():n?zi.parse:zi.parseInline)(c,p);return p.hooks&&(u=p.hooks.postprocess(u)),u}catch(c){return m(c)}}}onError(n,r){return a=>{if(a.message+=`
126
- Please report this to https://github.com/markedjs/marked.`,n){let l="<p>An error occurred:</p><pre>"+Ji(a.message+"",!0)+"</pre>";return r?Promise.resolve(l):l}if(r)return Promise.reject(a);throw a}}},ta=new Xw;function St(e,n){return ta.parse(e,n)}St.options=St.setOptions=function(e){return ta.setOptions(e),St.defaults=ta.defaults,zw(St.defaults),St};St.getDefaults=Vg;St.defaults=ia;St.use=function(...e){return ta.use(...e),St.defaults=ta.defaults,zw(St.defaults),St};St.walkTokens=function(e,n){return ta.walkTokens(e,n)};St.parseInline=ta.parseInline;St.Parser=zi;St.parser=zi.parse;St.Renderer=Gu;St.TextRenderer=nm;St.Lexer=$i;St.lexer=$i.lex;St.Tokenizer=Wu;St.Hooks=Cl;St.parse=St;St.options;St.setOptions;St.use;St.walkTokens;St.parseInline;zi.parse;$i.lex;const{entries:Zw,setPrototypeOf:t1,isFrozen:wM,getPrototypeOf:CM,getOwnPropertyDescriptor:xM}=Object;let{freeze:Pn,seal:Ri,create:qa}=Object,{apply:Yp,construct:Xp}=typeof Reflect<"u"&&Reflect;Pn||(Pn=function(n){return n});Ri||(Ri=function(n){return n});Yp||(Yp=function(n,r){for(var a=arguments.length,l=new Array(a>2?a-2:0),p=2;p<a;p++)l[p-2]=arguments[p];return n.apply(r,l)});Xp||(Xp=function(n){for(var r=arguments.length,a=new Array(r>1?r-1:0),l=1;l<r;l++)a[l-1]=arguments[l];return new n(...a)});const pl=dn(Array.prototype.forEach),EM=dn(Array.prototype.lastIndexOf),n1=dn(Array.prototype.pop),gl=dn(Array.prototype.push),TM=dn(Array.prototype.splice),jn=Array.isArray,xl=dn(String.prototype.toLowerCase),$f=dn(String.prototype.toString),i1=dn(String.prototype.match),Ha=dn(String.prototype.replace),r1=dn(String.prototype.indexOf),AM=dn(String.prototype.trim),kM=dn(Number.prototype.toString),RM=dn(Boolean.prototype.toString),s1=typeof BigInt>"u"?null:dn(BigInt.prototype.toString),a1=typeof Symbol>"u"?null:dn(Symbol.prototype.toString),Gt=dn(Object.prototype.hasOwnProperty),ml=dn(Object.prototype.toString),kn=dn(RegExp.prototype.test),hu=LM(TypeError);function dn(e){return function(n){n instanceof RegExp&&(n.lastIndex=0);for(var r=arguments.length,a=new Array(r>1?r-1:0),l=1;l<r;l++)a[l-1]=arguments[l];return Yp(e,n,a)}}function LM(e){return function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Xp(e,r)}}function Ve(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:xl;if(t1&&t1(e,null),!jn(n))return e;let a=n.length;for(;a--;){let l=n[a];if(typeof l=="string"){const p=r(l);p!==l&&(wM(n)||(n[a]=p),l=p)}e[l]=!0}return e}function MM(e){for(let n=0;n<e.length;n++)Gt(e,n)||(e[n]=null);return e}function Jn(e){const n=qa(null);for(const[r,a]of Zw(e))Gt(e,r)&&(jn(a)?n[r]=MM(a):a&&typeof a=="object"&&a.constructor===Object?n[r]=Jn(a):n[r]=a);return n}function DM(e){switch(typeof e){case"string":return e;case"number":return kM(e);case"boolean":return RM(e);case"bigint":return s1?s1(e):"0";case"symbol":return a1?a1(e):"Symbol()";case"undefined":return ml(e);case"function":case"object":{if(e===null)return ml(e);const n=e,r=Wa(n,"toString");if(typeof r=="function"){const a=r(n);return typeof a=="string"?a:ml(a)}return ml(e)}default:return ml(e)}}function Wa(e,n){for(;e!==null;){const a=xM(e,n);if(a){if(a.get)return dn(a.get);if(typeof a.value=="function")return dn(a.value)}e=CM(e)}function r(){return null}return r}function OM(e){try{return kn(e,""),!0}catch{return!1}}const o1=Pn(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),zf=Pn(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Pf=Pn(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),NM=Pn(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Hf=Pn(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),BM=Pn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),l1=Pn(["#text"]),c1=Pn(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Uf=Pn(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),u1=Pn(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),du=Pn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),IM=Ri(/\{\{[\w\W]*|[\w\W]*\}\}/gm),jM=Ri(/<%[\w\W]*|[\w\W]*%>/gm),$M=Ri(/\$\{[\w\W]*/gm),zM=Ri(/^data-[\-\w.\u00B7-\uFFFF]+$/),PM=Ri(/^aria-[\-\w]+$/),Jw=Ri(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),HM=Ri(/^(?:\w+script|data):/i),UM=Ri(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Qw=Ri(/^html$/i),FM=Ri(/^[a-z][.\w]*(-[.\w]+)+$/i);var h1=Object.freeze({__proto__:null,ARIA_ATTR:PM,ATTR_WHITESPACE:UM,CUSTOM_ELEMENT:FM,DATA_ATTR:zM,DOCTYPE_NAME:Qw,ERB_EXPR:jM,IS_ALLOWED_URI:Jw,IS_SCRIPT_OR_DATA:HM,MUSTACHE_EXPR:IM,TMPLIT_EXPR:$M});const _l={element:1,text:3,progressingInstruction:7,comment:8,document:9},qM=function(){return typeof window>"u"?null:window},WM=function(n,r){if(typeof n!="object"||typeof n.createPolicy!="function")return null;let a=null;const l="data-tt-policy-suffix";r&&r.hasAttribute(l)&&(a=r.getAttribute(l));const p="dompurify"+(a?"#"+a:"");try{return n.createPolicy(p,{createHTML(m){return m},createScriptURL(m){return m}})}catch{return console.warn("TrustedTypes policy "+p+" could not be created."),null}},d1=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function eC(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:qM();const n=De=>eC(De);if(n.version="3.4.2",n.removed=[],!e||!e.document||e.document.nodeType!==_l.document||!e.Element)return n.isSupported=!1,n;let{document:r}=e;const a=r,l=a.currentScript,{DocumentFragment:p,HTMLTemplateElement:m,Node:c,Element:u,NodeFilter:h,NamedNodeMap:y=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:g,DOMParser:C,trustedTypes:T}=e,A=u.prototype,x=Wa(A,"cloneNode"),d=Wa(A,"remove"),v=Wa(A,"nextSibling"),f=Wa(A,"childNodes"),b=Wa(A,"parentNode");if(typeof m=="function"){const De=r.createElement("template");De.content&&De.content.ownerDocument&&(r=De.content.ownerDocument)}let E,L="";const{implementation:R,createNodeIterator:M,createDocumentFragment:k,getElementsByTagName:O}=r,{importNode:U}=a;let F=d1();n.isSupported=typeof Zw=="function"&&typeof b=="function"&&R&&R.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:G,ERB_EXPR:I,TMPLIT_EXPR:K,DATA_ATTR:te,ARIA_ATTR:q,IS_SCRIPT_OR_DATA:W,ATTR_WHITESPACE:Y,CUSTOM_ELEMENT:B}=h1;let{IS_ALLOWED_URI:$}=h1,N=null;const P=Ve({},[...o1,...zf,...Pf,...Hf,...l1]);let Z=null;const ae=Ve({},[...c1,...Uf,...u1,...du]);let ce=Object.seal(qa(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),_e=null,Q=null;const z=Object.seal(qa(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let oe=!0,ge=!0,Se=!1,ye=!0,Pe=!1,qe=!0,Xe=!1,xt=!1,Ne=!1,en=!1,bn=!1,yn=!1,pi=!0,Mi=!1;const tn="user-content-";let ut=!0,Vt=!1,$t={},zt=null;const nn=Ve({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Di=null;const Mn=Ve({},["audio","video","img","source","image","track"]);let ni=null;const dt=Ve({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Hn="http://www.w3.org/1998/Math/MathML",Yt="http://www.w3.org/2000/svg",Xt="http://www.w3.org/1999/xhtml";let Pt=Xt,ws=!1,ar=null;const ra=Ve({},[Hn,Yt,Xt],$f);let Oi=Ve({},["mi","mo","mn","ms","mtext"]),Wi=Ve({},["annotation-xml"]);const or=Ve({},["title","style","font","a","script"]);let rn=null;const J=["application/xhtml+xml","text/html"],he="text/html";let be=null,Ie=null;const wt=r.createElement("form"),ft=function(V){return V instanceof RegExp||V instanceof Function},Te=function(){let V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Ie&&Ie===V)return;(!V||typeof V!="object")&&(V={}),V=Jn(V),rn=J.indexOf(V.PARSER_MEDIA_TYPE)===-1?he:V.PARSER_MEDIA_TYPE,be=rn==="application/xhtml+xml"?$f:xl,N=Gt(V,"ALLOWED_TAGS")&&jn(V.ALLOWED_TAGS)?Ve({},V.ALLOWED_TAGS,be):P,Z=Gt(V,"ALLOWED_ATTR")&&jn(V.ALLOWED_ATTR)?Ve({},V.ALLOWED_ATTR,be):ae,ar=Gt(V,"ALLOWED_NAMESPACES")&&jn(V.ALLOWED_NAMESPACES)?Ve({},V.ALLOWED_NAMESPACES,$f):ra,ni=Gt(V,"ADD_URI_SAFE_ATTR")&&jn(V.ADD_URI_SAFE_ATTR)?Ve(Jn(dt),V.ADD_URI_SAFE_ATTR,be):dt,Di=Gt(V,"ADD_DATA_URI_TAGS")&&jn(V.ADD_DATA_URI_TAGS)?Ve(Jn(Mn),V.ADD_DATA_URI_TAGS,be):Mn,zt=Gt(V,"FORBID_CONTENTS")&&jn(V.FORBID_CONTENTS)?Ve({},V.FORBID_CONTENTS,be):nn,_e=Gt(V,"FORBID_TAGS")&&jn(V.FORBID_TAGS)?Ve({},V.FORBID_TAGS,be):Jn({}),Q=Gt(V,"FORBID_ATTR")&&jn(V.FORBID_ATTR)?Ve({},V.FORBID_ATTR,be):Jn({}),$t=Gt(V,"USE_PROFILES")?V.USE_PROFILES&&typeof V.USE_PROFILES=="object"?Jn(V.USE_PROFILES):V.USE_PROFILES:!1,oe=V.ALLOW_ARIA_ATTR!==!1,ge=V.ALLOW_DATA_ATTR!==!1,Se=V.ALLOW_UNKNOWN_PROTOCOLS||!1,ye=V.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Pe=V.SAFE_FOR_TEMPLATES||!1,qe=V.SAFE_FOR_XML!==!1,Xe=V.WHOLE_DOCUMENT||!1,en=V.RETURN_DOM||!1,bn=V.RETURN_DOM_FRAGMENT||!1,yn=V.RETURN_TRUSTED_TYPE||!1,Ne=V.FORCE_BODY||!1,pi=V.SANITIZE_DOM!==!1,Mi=V.SANITIZE_NAMED_PROPS||!1,ut=V.KEEP_CONTENT!==!1,Vt=V.IN_PLACE||!1,$=OM(V.ALLOWED_URI_REGEXP)?V.ALLOWED_URI_REGEXP:Jw,Pt=typeof V.NAMESPACE=="string"?V.NAMESPACE:Xt,Oi=Gt(V,"MATHML_TEXT_INTEGRATION_POINTS")&&V.MATHML_TEXT_INTEGRATION_POINTS&&typeof V.MATHML_TEXT_INTEGRATION_POINTS=="object"?Jn(V.MATHML_TEXT_INTEGRATION_POINTS):Ve({},["mi","mo","mn","ms","mtext"]),Wi=Gt(V,"HTML_INTEGRATION_POINTS")&&V.HTML_INTEGRATION_POINTS&&typeof V.HTML_INTEGRATION_POINTS=="object"?Jn(V.HTML_INTEGRATION_POINTS):Ve({},["annotation-xml"]);const pe=Gt(V,"CUSTOM_ELEMENT_HANDLING")&&V.CUSTOM_ELEMENT_HANDLING&&typeof V.CUSTOM_ELEMENT_HANDLING=="object"?Jn(V.CUSTOM_ELEMENT_HANDLING):qa(null);if(ce=qa(null),Gt(pe,"tagNameCheck")&&ft(pe.tagNameCheck)&&(ce.tagNameCheck=pe.tagNameCheck),Gt(pe,"attributeNameCheck")&&ft(pe.attributeNameCheck)&&(ce.attributeNameCheck=pe.attributeNameCheck),Gt(pe,"allowCustomizedBuiltInElements")&&typeof pe.allowCustomizedBuiltInElements=="boolean"&&(ce.allowCustomizedBuiltInElements=pe.allowCustomizedBuiltInElements),Pe&&(ge=!1),bn&&(en=!0),$t&&(N=Ve({},l1),Z=qa(null),$t.html===!0&&(Ve(N,o1),Ve(Z,c1)),$t.svg===!0&&(Ve(N,zf),Ve(Z,Uf),Ve(Z,du)),$t.svgFilters===!0&&(Ve(N,Pf),Ve(Z,Uf),Ve(Z,du)),$t.mathMl===!0&&(Ve(N,Hf),Ve(Z,u1),Ve(Z,du))),z.tagCheck=null,z.attributeCheck=null,Gt(V,"ADD_TAGS")&&(typeof V.ADD_TAGS=="function"?z.tagCheck=V.ADD_TAGS:jn(V.ADD_TAGS)&&(N===P&&(N=Jn(N)),Ve(N,V.ADD_TAGS,be))),Gt(V,"ADD_ATTR")&&(typeof V.ADD_ATTR=="function"?z.attributeCheck=V.ADD_ATTR:jn(V.ADD_ATTR)&&(Z===ae&&(Z=Jn(Z)),Ve(Z,V.ADD_ATTR,be))),Gt(V,"ADD_URI_SAFE_ATTR")&&jn(V.ADD_URI_SAFE_ATTR)&&Ve(ni,V.ADD_URI_SAFE_ATTR,be),Gt(V,"FORBID_CONTENTS")&&jn(V.FORBID_CONTENTS)&&(zt===nn&&(zt=Jn(zt)),Ve(zt,V.FORBID_CONTENTS,be)),Gt(V,"ADD_FORBID_CONTENTS")&&jn(V.ADD_FORBID_CONTENTS)&&(zt===nn&&(zt=Jn(zt)),Ve(zt,V.ADD_FORBID_CONTENTS,be)),ut&&(N["#text"]=!0),Xe&&Ve(N,["html","head","body"]),N.table&&(Ve(N,["tbody"]),delete _e.tbody),V.TRUSTED_TYPES_POLICY){if(typeof V.TRUSTED_TYPES_POLICY.createHTML!="function")throw hu('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof V.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw hu('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');E=V.TRUSTED_TYPES_POLICY,L=E.createHTML("")}else E===void 0&&(E=WM(T,l)),E!==null&&typeof L=="string"&&(L=E.createHTML(""));Pn&&Pn(V),Ie=V},Ce=Ve({},[...zf,...Pf,...NM]),je=Ve({},[...Hf,...BM]),It=function(V){let pe=b(V);(!pe||!pe.tagName)&&(pe={namespaceURI:Pt,tagName:"template"});const xe=xl(V.tagName),rt=xl(pe.tagName);return ar[V.namespaceURI]?V.namespaceURI===Yt?pe.namespaceURI===Xt?xe==="svg":pe.namespaceURI===Hn?xe==="svg"&&(rt==="annotation-xml"||Oi[rt]):!!Ce[xe]:V.namespaceURI===Hn?pe.namespaceURI===Xt?xe==="math":pe.namespaceURI===Yt?xe==="math"&&Wi[rt]:!!je[xe]:V.namespaceURI===Xt?pe.namespaceURI===Yt&&!Wi[rt]||pe.namespaceURI===Hn&&!Oi[rt]?!1:!je[xe]&&(or[xe]||!Ce[xe]):!!(rn==="application/xhtml+xml"&&ar[V.namespaceURI]):!1},et=function(V){gl(n.removed,{element:V});try{b(V).removeChild(V)}catch{d(V)}},Sn=function(V,pe){try{gl(n.removed,{attribute:pe.getAttributeNode(V),from:pe})}catch{gl(n.removed,{attribute:null,from:pe})}if(pe.removeAttribute(V),V==="is")if(en||bn)try{et(pe)}catch{}else try{pe.setAttribute(V,"")}catch{}},lr=function(V){let pe=null,xe=null;if(Ne)V="<remove></remove>"+V;else{const kt=i1(V,/^[\r\n\t ]+/);xe=kt&&kt[0]}rn==="application/xhtml+xml"&&Pt===Xt&&(V='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+V+"</body></html>");const rt=E?E.createHTML(V):V;if(Pt===Xt)try{pe=new C().parseFromString(rt,rn)}catch{}if(!pe||!pe.documentElement){pe=R.createDocument(Pt,"template",null);try{pe.documentElement.innerHTML=ws?L:rt}catch{}}const Ze=pe.body||pe.documentElement;return V&&xe&&Ze.insertBefore(r.createTextNode(xe),Ze.childNodes[0]||null),Pt===Xt?O.call(pe,Xe?"html":"body")[0]:Xe?pe.documentElement:Ze},cr=function(V){return M.call(V.ownerDocument||V,V,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT|h.SHOW_PROCESSING_INSTRUCTION|h.SHOW_CDATA_SECTION,null)},Un=function(V){return V instanceof g&&(typeof V.nodeName!="string"||typeof V.textContent!="string"||typeof V.removeChild!="function"||!(V.attributes instanceof y)||typeof V.removeAttribute!="function"||typeof V.setAttribute!="function"||typeof V.namespaceURI!="string"||typeof V.insertBefore!="function"||typeof V.hasChildNodes!="function")},At=function(V){return typeof c=="function"&&V instanceof c};function Et(De,V,pe){pl(De,xe=>{xe.call(n,V,pe,Ie)})}const Ni=function(V){let pe=null;if(Et(F.beforeSanitizeElements,V,null),Un(V))return et(V),!0;const xe=be(V.nodeName);if(Et(F.uponSanitizeElement,V,{tagName:xe,allowedTags:N}),qe&&V.hasChildNodes()&&!At(V.firstElementChild)&&kn(/<[/\w!]/g,V.innerHTML)&&kn(/<[/\w!]/g,V.textContent)||qe&&V.namespaceURI===Xt&&xe==="style"&&At(V.firstElementChild)||V.nodeType===_l.progressingInstruction||qe&&V.nodeType===_l.comment&&kn(/<[/\w]/g,V.data))return et(V),!0;if(_e[xe]||!(z.tagCheck instanceof Function&&z.tagCheck(xe))&&!N[xe]){if(!_e[xe]&&ur(xe)&&(ce.tagNameCheck instanceof RegExp&&kn(ce.tagNameCheck,xe)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(xe)))return!1;if(ut&&!zt[xe]){const rt=b(V)||V.parentNode,Ze=f(V)||V.childNodes;if(Ze&&rt){const kt=Ze.length;for(let Ht=kt-1;Ht>=0;--Ht){const Ut=x(Ze[Ht],!0);rt.insertBefore(Ut,v(V))}}}return et(V),!0}return V instanceof u&&!It(V)||(xe==="noscript"||xe==="noembed"||xe==="noframes")&&kn(/<\/no(script|embed|frames)/i,V.innerHTML)?(et(V),!0):(Pe&&V.nodeType===_l.text&&(pe=V.textContent,pl([G,I,K],rt=>{pe=Ha(pe,rt," ")}),V.textContent!==pe&&(gl(n.removed,{element:V.cloneNode()}),V.textContent=pe)),Et(F.afterSanitizeElements,V,null),!1)},zr=function(V,pe,xe){if(Q[pe]||pi&&(pe==="id"||pe==="name")&&(xe in r||xe in wt))return!1;const rt=Z[pe]||z.attributeCheck instanceof Function&&z.attributeCheck(pe,V);if(!(ge&&!Q[pe]&&kn(te,pe))){if(!(oe&&kn(q,pe))){if(!rt||Q[pe]){if(!(ur(V)&&(ce.tagNameCheck instanceof RegExp&&kn(ce.tagNameCheck,V)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(V))&&(ce.attributeNameCheck instanceof RegExp&&kn(ce.attributeNameCheck,pe)||ce.attributeNameCheck instanceof Function&&ce.attributeNameCheck(pe,V))||pe==="is"&&ce.allowCustomizedBuiltInElements&&(ce.tagNameCheck instanceof RegExp&&kn(ce.tagNameCheck,xe)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(xe))))return!1}else if(!ni[pe]){if(!kn($,Ha(xe,Y,""))){if(!((pe==="src"||pe==="xlink:href"||pe==="href")&&V!=="script"&&r1(xe,"data:")===0&&Di[V])){if(!(Se&&!kn(W,Ha(xe,Y,"")))){if(xe)return!1}}}}}}return!0},sa=Ve({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ur=function(V){return!sa[xl(V)]&&kn(B,V)},Cs=function(V){Et(F.beforeSanitizeAttributes,V,null);const{attributes:pe}=V;if(!pe||Un(V))return;const xe={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Z,forceKeepAttr:void 0};let rt=pe.length;for(;rt--;){const Ze=pe[rt],{name:kt,namespaceURI:Ht,value:Ut}=Ze,me=be(kt),Me=Ut;let Oe=kt==="value"?Me:AM(Me);if(xe.attrName=me,xe.attrValue=Oe,xe.keepAttr=!0,xe.forceKeepAttr=void 0,Et(F.uponSanitizeAttribute,V,xe),Oe=xe.attrValue,Mi&&(me==="id"||me==="name")&&r1(Oe,tn)!==0&&(Sn(kt,V),Oe=tn+Oe),qe&&kn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Oe)){Sn(kt,V);continue}if(me==="attributename"&&i1(Oe,"href")){Sn(kt,V);continue}if(xe.forceKeepAttr)continue;if(!xe.keepAttr){Sn(kt,V);continue}if(!ye&&kn(/\/>/i,Oe)){Sn(kt,V);continue}Pe&&pl([G,I,K],Ot=>{Oe=Ha(Oe,Ot," ")});const at=be(V.nodeName);if(!zr(at,me,Oe)){Sn(kt,V);continue}if(E&&typeof T=="object"&&typeof T.getAttributeType=="function"&&!Ht)switch(T.getAttributeType(at,me)){case"TrustedHTML":{Oe=E.createHTML(Oe);break}case"TrustedScriptURL":{Oe=E.createScriptURL(Oe);break}}if(Oe!==Me)try{Ht?V.setAttributeNS(Ht,kt,Oe):V.setAttribute(kt,Oe),Un(V)?et(V):n1(n.removed)}catch{Sn(kt,V)}}Et(F.afterSanitizeAttributes,V,null)},Gi=function(V){let pe=null;const xe=cr(V);for(Et(F.beforeSanitizeShadowDOM,V,null);pe=xe.nextNode();)Et(F.uponSanitizeShadowNode,pe,null),Ni(pe),Cs(pe),pe.content instanceof p&&Gi(pe.content);Et(F.afterSanitizeShadowDOM,V,null)};return n.sanitize=function(De){let V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},pe=null,xe=null,rt=null,Ze=null;if(ws=!De,ws&&(De="<!-->"),typeof De!="string"&&!At(De)&&(De=DM(De),typeof De!="string"))throw hu("dirty is not a string, aborting");if(!n.isSupported)return De;if(xt||Te(V),n.removed=[],typeof De=="string"&&(Vt=!1),Vt){const Ut=De.nodeName;if(typeof Ut=="string"){const me=be(Ut);if(!N[me]||_e[me])throw hu("root node is forbidden and cannot be sanitized in-place")}}else if(De instanceof c)pe=lr("<!---->"),xe=pe.ownerDocument.importNode(De,!0),xe.nodeType===_l.element&&xe.nodeName==="BODY"||xe.nodeName==="HTML"?pe=xe:pe.appendChild(xe);else{if(!en&&!Pe&&!Xe&&De.indexOf("<")===-1)return E&&yn?E.createHTML(De):De;if(pe=lr(De),!pe)return en?null:yn?L:""}pe&&Ne&&et(pe.firstChild);const kt=cr(Vt?De:pe);for(;rt=kt.nextNode();)Ni(rt),Cs(rt),rt.content instanceof p&&Gi(rt.content);if(Vt)return De;if(en){if(Pe){pe.normalize();let Ut=pe.innerHTML;pl([G,I,K],me=>{Ut=Ha(Ut,me," ")}),pe.innerHTML=Ut}if(bn)for(Ze=k.call(pe.ownerDocument);pe.firstChild;)Ze.appendChild(pe.firstChild);else Ze=pe;return(Z.shadowroot||Z.shadowrootmode)&&(Ze=U.call(a,Ze,!0)),Ze}let Ht=Xe?pe.outerHTML:pe.innerHTML;return Xe&&N["!doctype"]&&pe.ownerDocument&&pe.ownerDocument.doctype&&pe.ownerDocument.doctype.name&&kn(Qw,pe.ownerDocument.doctype.name)&&(Ht="<!DOCTYPE "+pe.ownerDocument.doctype.name+`>
127
- `+Ht),Pe&&pl([G,I,K],Ut=>{Ht=Ha(Ht,Ut," ")}),E&&yn?E.createHTML(Ht):Ht},n.setConfig=function(){let De=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Te(De),xt=!0},n.clearConfig=function(){Ie=null,xt=!1},n.isValidAttribute=function(De,V,pe){Ie||Te({});const xe=be(De),rt=be(V);return zr(xe,rt,pe)},n.addHook=function(De,V){typeof V=="function"&&gl(F[De],V)},n.removeHook=function(De,V){if(V!==void 0){const pe=EM(F[De],V);return pe===-1?void 0:TM(F[De],pe,1)[0]}return n1(F[De])},n.removeHooks=function(De){F[De]=[]},n.removeAllHooks=function(){F=d1()},n}var Ml=eC(),Ff,f1;function GM(){if(f1)return Ff;f1=1;function e(J){return J instanceof Map?J.clear=J.delete=J.set=function(){throw new Error("map is read-only")}:J instanceof Set&&(J.add=J.clear=J.delete=function(){throw new Error("set is read-only")}),Object.freeze(J),Object.getOwnPropertyNames(J).forEach(he=>{const be=J[he],Ie=typeof be;(Ie==="object"||Ie==="function")&&!Object.isFrozen(be)&&e(be)}),J}class n{constructor(he){he.data===void 0&&(he.data={}),this.data=he.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function r(J){return J.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function a(J,...he){const be=Object.create(null);for(const Ie in J)be[Ie]=J[Ie];return he.forEach(function(Ie){for(const wt in Ie)be[wt]=Ie[wt]}),be}const l="</span>",p=J=>!!J.scope,m=(J,{prefix:he})=>{if(J.startsWith("language:"))return J.replace("language:","language-");if(J.includes(".")){const be=J.split(".");return[`${he}${be.shift()}`,...be.map((Ie,wt)=>`${Ie}${"_".repeat(wt+1)}`)].join(" ")}return`${he}${J}`};class c{constructor(he,be){this.buffer="",this.classPrefix=be.classPrefix,he.walk(this)}addText(he){this.buffer+=r(he)}openNode(he){if(!p(he))return;const be=m(he.scope,{prefix:this.classPrefix});this.span(be)}closeNode(he){p(he)&&(this.buffer+=l)}value(){return this.buffer}span(he){this.buffer+=`<span class="${he}">`}}const u=(J={})=>{const he={children:[]};return Object.assign(he,J),he};class h{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(he){this.top.children.push(he)}openNode(he){const be=u({scope:he});this.add(be),this.stack.push(be)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(he){return this.constructor._walk(he,this.rootNode)}static _walk(he,be){return typeof be=="string"?he.addText(be):be.children&&(he.openNode(be),be.children.forEach(Ie=>this._walk(he,Ie)),he.closeNode(be)),he}static _collapse(he){typeof he!="string"&&he.children&&(he.children.every(be=>typeof be=="string")?he.children=[he.children.join("")]:he.children.forEach(be=>{h._collapse(be)}))}}class y extends h{constructor(he){super(),this.options=he}addText(he){he!==""&&this.add(he)}startScope(he){this.openNode(he)}endScope(){this.closeNode()}__addSublanguage(he,be){const Ie=he.root;be&&(Ie.scope=`language:${be}`),this.add(Ie)}toHTML(){return new c(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function g(J){return J?typeof J=="string"?J:J.source:null}function C(J){return x("(?=",J,")")}function T(J){return x("(?:",J,")*")}function A(J){return x("(?:",J,")?")}function x(...J){return J.map(be=>g(be)).join("")}function d(J){const he=J[J.length-1];return typeof he=="object"&&he.constructor===Object?(J.splice(J.length-1,1),he):{}}function v(...J){return"("+(d(J).capture?"":"?:")+J.map(Ie=>g(Ie)).join("|")+")"}function f(J){return new RegExp(J.toString()+"|").exec("").length-1}function b(J,he){const be=J&&J.exec(he);return be&&be.index===0}const E=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function L(J,{joinWith:he}){let be=0;return J.map(Ie=>{be+=1;const wt=be;let ft=g(Ie),Te="";for(;ft.length>0;){const Ce=E.exec(ft);if(!Ce){Te+=ft;break}Te+=ft.substring(0,Ce.index),ft=ft.substring(Ce.index+Ce[0].length),Ce[0][0]==="\\"&&Ce[1]?Te+="\\"+String(Number(Ce[1])+wt):(Te+=Ce[0],Ce[0]==="("&&be++)}return Te}).map(Ie=>`(${Ie})`).join(he)}const R=/\b\B/,M="[a-zA-Z]\\w*",k="[a-zA-Z_]\\w*",O="\\b\\d+(\\.\\d+)?",U="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",F="\\b(0b[01]+)",G="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",I=(J={})=>{const he=/^#![ ]*\//;return J.binary&&(J.begin=x(he,/.*\b/,J.binary,/\b.*/)),a({scope:"meta",begin:he,end:/$/,relevance:0,"on:begin":(be,Ie)=>{be.index!==0&&Ie.ignoreMatch()}},J)},K={begin:"\\\\[\\s\\S]",relevance:0},te={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[K]},q={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[K]},W={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Y=function(J,he,be={}){const Ie=a({scope:"comment",begin:J,end:he,contains:[]},be);Ie.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const wt=v("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return Ie.contains.push({begin:x(/[ ]+/,"(",wt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Ie},B=Y("//","$"),$=Y("/\\*","\\*/"),N=Y("#","$"),P={scope:"number",begin:O,relevance:0},Z={scope:"number",begin:U,relevance:0},ae={scope:"number",begin:F,relevance:0},ce={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[K,{begin:/\[/,end:/\]/,relevance:0,contains:[K]}]},_e={scope:"title",begin:M,relevance:0},Q={scope:"title",begin:k,relevance:0},z={begin:"\\.\\s*"+k,relevance:0};var ge=Object.freeze({__proto__:null,APOS_STRING_MODE:te,BACKSLASH_ESCAPE:K,BINARY_NUMBER_MODE:ae,BINARY_NUMBER_RE:F,COMMENT:Y,C_BLOCK_COMMENT_MODE:$,C_LINE_COMMENT_MODE:B,C_NUMBER_MODE:Z,C_NUMBER_RE:U,END_SAME_AS_BEGIN:function(J){return Object.assign(J,{"on:begin":(he,be)=>{be.data._beginMatch=he[1]},"on:end":(he,be)=>{be.data._beginMatch!==he[1]&&be.ignoreMatch()}})},HASH_COMMENT_MODE:N,IDENT_RE:M,MATCH_NOTHING_RE:R,METHOD_GUARD:z,NUMBER_MODE:P,NUMBER_RE:O,PHRASAL_WORDS_MODE:W,QUOTE_STRING_MODE:q,REGEXP_MODE:ce,RE_STARTERS_RE:G,SHEBANG:I,TITLE_MODE:_e,UNDERSCORE_IDENT_RE:k,UNDERSCORE_TITLE_MODE:Q});function Se(J,he){J.input[J.index-1]==="."&&he.ignoreMatch()}function ye(J,he){J.className!==void 0&&(J.scope=J.className,delete J.className)}function Pe(J,he){he&&J.beginKeywords&&(J.begin="\\b("+J.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",J.__beforeBegin=Se,J.keywords=J.keywords||J.beginKeywords,delete J.beginKeywords,J.relevance===void 0&&(J.relevance=0))}function qe(J,he){Array.isArray(J.illegal)&&(J.illegal=v(...J.illegal))}function Xe(J,he){if(J.match){if(J.begin||J.end)throw new Error("begin & end are not supported with match");J.begin=J.match,delete J.match}}function xt(J,he){J.relevance===void 0&&(J.relevance=1)}const Ne=(J,he)=>{if(!J.beforeMatch)return;if(J.starts)throw new Error("beforeMatch cannot be used with starts");const be=Object.assign({},J);Object.keys(J).forEach(Ie=>{delete J[Ie]}),J.keywords=be.keywords,J.begin=x(be.beforeMatch,C(be.begin)),J.starts={relevance:0,contains:[Object.assign(be,{endsParent:!0})]},J.relevance=0,delete be.beforeMatch},en=["of","and","for","in","not","or","if","then","parent","list","value"],bn="keyword";function yn(J,he,be=bn){const Ie=Object.create(null);return typeof J=="string"?wt(be,J.split(" ")):Array.isArray(J)?wt(be,J):Object.keys(J).forEach(function(ft){Object.assign(Ie,yn(J[ft],he,ft))}),Ie;function wt(ft,Te){he&&(Te=Te.map(Ce=>Ce.toLowerCase())),Te.forEach(function(Ce){const je=Ce.split("|");Ie[je[0]]=[ft,pi(je[0],je[1])]})}}function pi(J,he){return he?Number(he):Mi(J)?0:1}function Mi(J){return en.includes(J.toLowerCase())}const tn={},ut=J=>{console.error(J)},Vt=(J,...he)=>{console.log(`WARN: ${J}`,...he)},$t=(J,he)=>{tn[`${J}/${he}`]||(console.log(`Deprecated as of ${J}. ${he}`),tn[`${J}/${he}`]=!0)},zt=new Error;function nn(J,he,{key:be}){let Ie=0;const wt=J[be],ft={},Te={};for(let Ce=1;Ce<=he.length;Ce++)Te[Ce+Ie]=wt[Ce],ft[Ce+Ie]=!0,Ie+=f(he[Ce-1]);J[be]=Te,J[be]._emit=ft,J[be]._multi=!0}function Di(J){if(Array.isArray(J.begin)){if(J.skip||J.excludeBegin||J.returnBegin)throw ut("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),zt;if(typeof J.beginScope!="object"||J.beginScope===null)throw ut("beginScope must be object"),zt;nn(J,J.begin,{key:"beginScope"}),J.begin=L(J.begin,{joinWith:""})}}function Mn(J){if(Array.isArray(J.end)){if(J.skip||J.excludeEnd||J.returnEnd)throw ut("skip, excludeEnd, returnEnd not compatible with endScope: {}"),zt;if(typeof J.endScope!="object"||J.endScope===null)throw ut("endScope must be object"),zt;nn(J,J.end,{key:"endScope"}),J.end=L(J.end,{joinWith:""})}}function ni(J){J.scope&&typeof J.scope=="object"&&J.scope!==null&&(J.beginScope=J.scope,delete J.scope)}function dt(J){ni(J),typeof J.beginScope=="string"&&(J.beginScope={_wrap:J.beginScope}),typeof J.endScope=="string"&&(J.endScope={_wrap:J.endScope}),Di(J),Mn(J)}function Hn(J){function he(Te,Ce){return new RegExp(g(Te),"m"+(J.case_insensitive?"i":"")+(J.unicodeRegex?"u":"")+(Ce?"g":""))}class be{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Ce,je){je.position=this.position++,this.matchIndexes[this.matchAt]=je,this.regexes.push([je,Ce]),this.matchAt+=f(Ce)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Ce=this.regexes.map(je=>je[1]);this.matcherRe=he(L(Ce,{joinWith:"|"}),!0),this.lastIndex=0}exec(Ce){this.matcherRe.lastIndex=this.lastIndex;const je=this.matcherRe.exec(Ce);if(!je)return null;const It=je.findIndex((Sn,lr)=>lr>0&&Sn!==void 0),et=this.matchIndexes[It];return je.splice(0,It),Object.assign(je,et)}}class Ie{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Ce){if(this.multiRegexes[Ce])return this.multiRegexes[Ce];const je=new be;return this.rules.slice(Ce).forEach(([It,et])=>je.addRule(It,et)),je.compile(),this.multiRegexes[Ce]=je,je}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Ce,je){this.rules.push([Ce,je]),je.type==="begin"&&this.count++}exec(Ce){const je=this.getMatcher(this.regexIndex);je.lastIndex=this.lastIndex;let It=je.exec(Ce);if(this.resumingScanAtSamePosition()&&!(It&&It.index===this.lastIndex)){const et=this.getMatcher(0);et.lastIndex=this.lastIndex+1,It=et.exec(Ce)}return It&&(this.regexIndex+=It.position+1,this.regexIndex===this.count&&this.considerAll()),It}}function wt(Te){const Ce=new Ie;return Te.contains.forEach(je=>Ce.addRule(je.begin,{rule:je,type:"begin"})),Te.terminatorEnd&&Ce.addRule(Te.terminatorEnd,{type:"end"}),Te.illegal&&Ce.addRule(Te.illegal,{type:"illegal"}),Ce}function ft(Te,Ce){const je=Te;if(Te.isCompiled)return je;[ye,Xe,dt,Ne].forEach(et=>et(Te,Ce)),J.compilerExtensions.forEach(et=>et(Te,Ce)),Te.__beforeBegin=null,[Pe,qe,xt].forEach(et=>et(Te,Ce)),Te.isCompiled=!0;let It=null;return typeof Te.keywords=="object"&&Te.keywords.$pattern&&(Te.keywords=Object.assign({},Te.keywords),It=Te.keywords.$pattern,delete Te.keywords.$pattern),It=It||/\w+/,Te.keywords&&(Te.keywords=yn(Te.keywords,J.case_insensitive)),je.keywordPatternRe=he(It,!0),Ce&&(Te.begin||(Te.begin=/\B|\b/),je.beginRe=he(je.begin),!Te.end&&!Te.endsWithParent&&(Te.end=/\B|\b/),Te.end&&(je.endRe=he(je.end)),je.terminatorEnd=g(je.end)||"",Te.endsWithParent&&Ce.terminatorEnd&&(je.terminatorEnd+=(Te.end?"|":"")+Ce.terminatorEnd)),Te.illegal&&(je.illegalRe=he(Te.illegal)),Te.contains||(Te.contains=[]),Te.contains=[].concat(...Te.contains.map(function(et){return Xt(et==="self"?Te:et)})),Te.contains.forEach(function(et){ft(et,je)}),Te.starts&&ft(Te.starts,Ce),je.matcher=wt(je),je}if(J.compilerExtensions||(J.compilerExtensions=[]),J.contains&&J.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return J.classNameAliases=a(J.classNameAliases||{}),ft(J)}function Yt(J){return J?J.endsWithParent||Yt(J.starts):!1}function Xt(J){return J.variants&&!J.cachedVariants&&(J.cachedVariants=J.variants.map(function(he){return a(J,{variants:null},he)})),J.cachedVariants?J.cachedVariants:Yt(J)?a(J,{starts:J.starts?a(J.starts):null}):Object.isFrozen(J)?a(J):J}var Pt="11.11.1";class ws extends Error{constructor(he,be){super(he),this.name="HTMLInjectionError",this.html=be}}const ar=r,ra=a,Oi=Symbol("nomatch"),Wi=7,or=function(J){const he=Object.create(null),be=Object.create(null),Ie=[];let wt=!0;const ft="Could not find the language '{}', did you forget to load/include a language module?",Te={disableAutodetect:!0,name:"Plain text",contains:[]};let Ce={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:y};function je(me){return Ce.noHighlightRe.test(me)}function It(me){let Me=me.className+" ";Me+=me.parentNode?me.parentNode.className:"";const Oe=Ce.languageDetectRe.exec(Me);if(Oe){const at=V(Oe[1]);return at||(Vt(ft.replace("{}",Oe[1])),Vt("Falling back to no-highlight mode for this block.",me)),at?Oe[1]:"no-highlight"}return Me.split(/\s+/).find(at=>je(at)||V(at))}function et(me,Me,Oe){let at="",Ot="";typeof Me=="object"?(at=me,Oe=Me.ignoreIllegals,Ot=Me.language):($t("10.7.0","highlight(lang, code, ...args) has been deprecated."),$t("10.7.0",`Please use highlight(code, options) instead.
128
- https://github.com/highlightjs/highlight.js/issues/2277`),Ot=me,at=Me),Oe===void 0&&(Oe=!0);const Dn={code:at,language:Ot};Ht("before:highlight",Dn);const ii=Dn.result?Dn.result:Sn(Dn.language,Dn.code,Oe);return ii.code=Dn.code,Ht("after:highlight",ii),ii}function Sn(me,Me,Oe,at){const Ot=Object.create(null);function Dn(we,Re){return we.keywords[Re]}function ii(){if(!He.keywords){sn.addText(pt);return}let we=0;He.keywordPatternRe.lastIndex=0;let Re=He.keywordPatternRe.exec(pt),We="";for(;Re;){We+=pt.substring(we,Re.index);const tt=wn.case_insensitive?Re[0].toLowerCase():Re[0],jt=Dn(He,tt);if(jt){const[gi,bo]=jt;if(sn.addText(We),We="",Ot[tt]=(Ot[tt]||0)+1,Ot[tt]<=Wi&&(Pr+=bo),gi.startsWith("_"))We+=Re[0];else{const Xl=wn.classNameAliases[gi]||gi;ri(Re[0],Xl)}}else We+=Re[0];we=He.keywordPatternRe.lastIndex,Re=He.keywordPatternRe.exec(pt)}We+=pt.substring(we),sn.addText(We)}function Fn(){if(pt==="")return;let we=null;if(typeof He.subLanguage=="string"){if(!he[He.subLanguage]){sn.addText(pt);return}we=Sn(He.subLanguage,pt,!0,Yl[He.subLanguage]),Yl[He.subLanguage]=we._top}else we=cr(pt,He.subLanguage.length?He.subLanguage:null);He.relevance>0&&(Pr+=we.relevance),sn.__addSublanguage(we._emitter,we.language)}function Tt(){He.subLanguage!=null?Fn():ii(),pt=""}function ri(we,Re){we!==""&&(sn.startScope(Re),sn.addText(we),sn.endScope())}function Kl(we,Re){let We=1;const tt=Re.length-1;for(;We<=tt;){if(!we._emit[We]){We++;continue}const jt=wn.classNameAliases[we[We]]||we[We],gi=Re[We];jt?ri(gi,jt):(pt=gi,ii(),pt=""),We++}}function aa(we,Re){return we.scope&&typeof we.scope=="string"&&sn.openNode(wn.classNameAliases[we.scope]||we.scope),we.beginScope&&(we.beginScope._wrap?(ri(pt,wn.classNameAliases[we.beginScope._wrap]||we.beginScope._wrap),pt=""):we.beginScope._multi&&(Kl(we.beginScope,Re),pt="")),He=Object.create(we,{parent:{value:He}}),He}function mo(we,Re,We){let tt=b(we.endRe,We);if(tt){if(we["on:end"]){const jt=new n(we);we["on:end"](Re,jt),jt.isMatchIgnored&&(tt=!1)}if(tt){for(;we.endsParent&&we.parent;)we=we.parent;return we}}if(we.endsWithParent)return mo(we.parent,Re,We)}function oa(we){return He.matcher.regexIndex===0?(pt+=we[0],1):(Hr=!0,0)}function gh(we){const Re=we[0],We=we.rule,tt=new n(We),jt=[We.__beforeBegin,We["on:begin"]];for(const gi of jt)if(gi&&(gi(we,tt),tt.isMatchIgnored))return oa(Re);return We.skip?pt+=Re:(We.excludeBegin&&(pt+=Re),Tt(),!We.returnBegin&&!We.excludeBegin&&(pt=Re)),aa(We,we),We.returnBegin?0:Re.length}function qn(we){const Re=we[0],We=Me.substring(we.index),tt=mo(He,we,We);if(!tt)return Oi;const jt=He;He.endScope&&He.endScope._wrap?(Tt(),ri(Re,He.endScope._wrap)):He.endScope&&He.endScope._multi?(Tt(),Kl(He.endScope,we)):jt.skip?pt+=Re:(jt.returnEnd||jt.excludeEnd||(pt+=Re),Tt(),jt.excludeEnd&&(pt=Re));do He.scope&&sn.closeNode(),!He.skip&&!He.subLanguage&&(Pr+=He.relevance),He=He.parent;while(He!==tt.parent);return tt.starts&&aa(tt.starts,we),jt.returnEnd?0:Re.length}function _o(){const we=[];for(let Re=He;Re!==wn;Re=Re.parent)Re.scope&&we.unshift(Re.scope);we.forEach(Re=>sn.openNode(Re))}let xs={};function la(we,Re){const We=Re&&Re[0];if(pt+=we,We==null)return Tt(),0;if(xs.type==="begin"&&Re.type==="end"&&xs.index===Re.index&&We===""){if(pt+=Me.slice(Re.index,Re.index+1),!wt){const tt=new Error(`0 width match regex (${me})`);throw tt.languageName=me,tt.badRule=xs.rule,tt}return 1}if(xs=Re,Re.type==="begin")return gh(Re);if(Re.type==="illegal"&&!Oe){const tt=new Error('Illegal lexeme "'+We+'" for mode "'+(He.scope||"<unnamed>")+'"');throw tt.mode=He,tt}else if(Re.type==="end"){const tt=qn(Re);if(tt!==Oi)return tt}if(Re.type==="illegal"&&We==="")return pt+=`
129
- `,1;if(vo>1e5&&vo>Re.index*3)throw new Error("potential infinite loop, way more iterations than matches");return pt+=We,We.length}const wn=V(me);if(!wn)throw ut(ft.replace("{}",me)),new Error('Unknown language: "'+me+'"');const Vl=Hn(wn);let ca="",He=at||Vl;const Yl={},sn=new Ce.__emitter(Ce);_o();let pt="",Pr=0,hr=0,vo=0,Hr=!1;try{if(wn.__emitTokens)wn.__emitTokens(Me,sn);else{for(He.matcher.considerAll();;){vo++,Hr?Hr=!1:He.matcher.considerAll(),He.matcher.lastIndex=hr;const we=He.matcher.exec(Me);if(!we)break;const Re=Me.substring(hr,we.index),We=la(Re,we);hr=we.index+We}la(Me.substring(hr))}return sn.finalize(),ca=sn.toHTML(),{language:me,value:ca,relevance:Pr,illegal:!1,_emitter:sn,_top:He}}catch(we){if(we.message&&we.message.includes("Illegal"))return{language:me,value:ar(Me),illegal:!0,relevance:0,_illegalBy:{message:we.message,index:hr,context:Me.slice(hr-100,hr+100),mode:we.mode,resultSoFar:ca},_emitter:sn};if(wt)return{language:me,value:ar(Me),illegal:!1,relevance:0,errorRaised:we,_emitter:sn,_top:He};throw we}}function lr(me){const Me={value:ar(me),illegal:!1,relevance:0,_top:Te,_emitter:new Ce.__emitter(Ce)};return Me._emitter.addText(me),Me}function cr(me,Me){Me=Me||Ce.languages||Object.keys(he);const Oe=lr(me),at=Me.filter(V).filter(xe).map(Tt=>Sn(Tt,me,!1));at.unshift(Oe);const Ot=at.sort((Tt,ri)=>{if(Tt.relevance!==ri.relevance)return ri.relevance-Tt.relevance;if(Tt.language&&ri.language){if(V(Tt.language).supersetOf===ri.language)return 1;if(V(ri.language).supersetOf===Tt.language)return-1}return 0}),[Dn,ii]=Ot,Fn=Dn;return Fn.secondBest=ii,Fn}function Un(me,Me,Oe){const at=Me&&be[Me]||Oe;me.classList.add("hljs"),me.classList.add(`language-${at}`)}function At(me){let Me=null;const Oe=It(me);if(je(Oe))return;if(Ht("before:highlightElement",{el:me,language:Oe}),me.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",me);return}if(me.children.length>0&&(Ce.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(me)),Ce.throwUnescapedHTML))throw new ws("One of your code blocks includes unescaped HTML.",me.innerHTML);Me=me;const at=Me.textContent,Ot=Oe?et(at,{language:Oe,ignoreIllegals:!0}):cr(at);me.innerHTML=Ot.value,me.dataset.highlighted="yes",Un(me,Oe,Ot.language),me.result={language:Ot.language,re:Ot.relevance,relevance:Ot.relevance},Ot.secondBest&&(me.secondBest={language:Ot.secondBest.language,relevance:Ot.secondBest.relevance}),Ht("after:highlightElement",{el:me,result:Ot,text:at})}function Et(me){Ce=ra(Ce,me)}const Ni=()=>{ur(),$t("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function zr(){ur(),$t("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let sa=!1;function ur(){function me(){ur()}if(document.readyState==="loading"){sa||window.addEventListener("DOMContentLoaded",me,!1),sa=!0;return}document.querySelectorAll(Ce.cssSelector).forEach(At)}function Cs(me,Me){let Oe=null;try{Oe=Me(J)}catch(at){if(ut("Language definition for '{}' could not be registered.".replace("{}",me)),wt)ut(at);else throw at;Oe=Te}Oe.name||(Oe.name=me),he[me]=Oe,Oe.rawDefinition=Me.bind(null,J),Oe.aliases&&pe(Oe.aliases,{languageName:me})}function Gi(me){delete he[me];for(const Me of Object.keys(be))be[Me]===me&&delete be[Me]}function De(){return Object.keys(he)}function V(me){return me=(me||"").toLowerCase(),he[me]||he[be[me]]}function pe(me,{languageName:Me}){typeof me=="string"&&(me=[me]),me.forEach(Oe=>{be[Oe.toLowerCase()]=Me})}function xe(me){const Me=V(me);return Me&&!Me.disableAutodetect}function rt(me){me["before:highlightBlock"]&&!me["before:highlightElement"]&&(me["before:highlightElement"]=Me=>{me["before:highlightBlock"](Object.assign({block:Me.el},Me))}),me["after:highlightBlock"]&&!me["after:highlightElement"]&&(me["after:highlightElement"]=Me=>{me["after:highlightBlock"](Object.assign({block:Me.el},Me))})}function Ze(me){rt(me),Ie.push(me)}function kt(me){const Me=Ie.indexOf(me);Me!==-1&&Ie.splice(Me,1)}function Ht(me,Me){const Oe=me;Ie.forEach(function(at){at[Oe]&&at[Oe](Me)})}function Ut(me){return $t("10.7.0","highlightBlock will be removed entirely in v12.0"),$t("10.7.0","Please use highlightElement now."),At(me)}Object.assign(J,{highlight:et,highlightAuto:cr,highlightAll:ur,highlightElement:At,highlightBlock:Ut,configure:Et,initHighlighting:Ni,initHighlightingOnLoad:zr,registerLanguage:Cs,unregisterLanguage:Gi,listLanguages:De,getLanguage:V,registerAliases:pe,autoDetection:xe,inherit:ra,addPlugin:Ze,removePlugin:kt}),J.debugMode=function(){wt=!1},J.safeMode=function(){wt=!0},J.versionString=Pt,J.regex={concat:x,lookahead:C,either:v,optional:A,anyNumberOfTimes:T};for(const me in ge)typeof ge[me]=="object"&&e(ge[me]);return Object.assign(J,ge),J},rn=or({});return rn.newInstance=()=>or({}),Ff=rn,rn.HighlightJS=rn,rn.default=rn,Ff}var KM=GM();const xi=cE(KM);function p1(e){const n=e.regex,r={},a={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[r]}]};Object.assign(r,{className:"variable",variants:[{begin:n.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},a]});const l={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},p=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),m={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},c={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,r,l]};l.contains.push(c);const u={match:/\\"/},h={className:"string",begin:/'/,end:/'/},y={match:/\\'/},g={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,r]},C=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],T=e.SHEBANG({binary:`(${C.join("|")})`,relevance:10}),A={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},x=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],d=["true","false"],v={match:/(\/[a-z._-]+)+/},f=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],b=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],E=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],L=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:x,literal:d,built_in:[...f,...b,"set","shopt",...E,...L]},contains:[T,e.SHEBANG(),A,g,p,m,v,c,u,h,y,r]}}const g1="[A-Za-z$_][0-9A-Za-z$_]*",VM=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],YM=["true","false","null","undefined","NaN","Infinity"],tC=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],nC=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],iC=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],XM=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],ZM=[].concat(iC,tC,nC);function m1(e){const n=e.regex,r=(Y,{after:B})=>{const $="</"+Y[0].slice(1);return Y.input.indexOf($,B)!==-1},a=g1,l={begin:"<>",end:"</>"},p=/<[A-Za-z0-9\\._:-]+\s*\/>/,m={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Y,B)=>{const $=Y[0].length+Y.index,N=Y.input[$];if(N==="<"||N===","){B.ignoreMatch();return}N===">"&&(r(Y,{after:$})||B.ignoreMatch());let P;const Z=Y.input.substring($);if(P=Z.match(/^\s*=/)){B.ignoreMatch();return}if((P=Z.match(/^\s+extends\s+/))&&P.index===0){B.ignoreMatch();return}}},c={$pattern:g1,keyword:VM,literal:YM,built_in:ZM,"variable.language":XM},u="[0-9](_?[0-9])*",h=`\\.(${u})`,y="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",g={className:"number",variants:[{begin:`(\\b(${y})((${h})|\\.)?|(${h}))[eE][+-]?(${u})\\b`},{begin:`\\b(${y})\\b((${h})\\b|\\.)?|(${h})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},C={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},T={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,C],subLanguage:"xml"}},A={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,C],subLanguage:"css"}},x={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,C],subLanguage:"graphql"}},d={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,C]},f={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:a+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},b=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,T,A,x,d,{match:/\$\d+/},g];C.contains=b.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(b)});const E=[].concat(f,C.contains),L=E.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(E)}]),R={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:L},M={variants:[{match:[/class/,/\s+/,a,/\s+/,/extends/,/\s+/,n.concat(a,"(",n.concat(/\./,a),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,a],scope:{1:"keyword",3:"title.class"}}]},k={relevance:0,match:n.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...tC,...nC]}},O={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},U={variants:[{match:[/function/,/\s+/,a,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[R],illegal:/%/},F={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function G(Y){return n.concat("(?!",Y.join("|"),")")}const I={match:n.concat(/\b/,G([...iC,"super","import"].map(Y=>`${Y}\\s*\\(`)),a,n.lookahead(/\s*\(/)),className:"title.function",relevance:0},K={begin:n.concat(/\./,n.lookahead(n.concat(a,/(?![0-9A-Za-z$_(])/))),end:a,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},te={match:[/get|set/,/\s+/,a,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},R]},q="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",W={match:[/const|var|let/,/\s+/,a,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(q)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[R]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:L,CLASS_REFERENCE:k},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),O,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,T,A,x,d,f,{match:/\$\d+/},g,k,{scope:"attr",match:a+n.lookahead(":"),relevance:0},W,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[f,e.REGEXP_MODE,{className:"function",begin:q,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:L}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:l.begin,end:l.end},{match:p},{begin:m.begin,"on:begin":m.isTrulyOpeningTag,end:m.end}],subLanguage:"xml",contains:[{begin:m.begin,end:m.end,skip:!0,contains:["self"]}]}]},U,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[R,e.inherit(e.TITLE_MODE,{begin:a,className:"title.function"})]},{match:/\.\.\./,relevance:0},K,{match:"\\$"+a,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[R]},I,F,M,te,{match:/\$[(.]/}]}}function JM(e){const n={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},r={match:/[{}[\],:]/,className:"punctuation",relevance:0},a=["true","false","null"],l={scope:"literal",beginKeywords:a.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:a},contains:[n,r,e.QUOTE_STRING_MODE,l,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function _1(e){const n=e.regex,r={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},a={begin:"^[-\\*]{3,}",end:"$"},l={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},p={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},m={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},c=/[A-Za-z][A-Za-z0-9+.-]*/,u={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:n.concat(/\[.+?\]\(/,c,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},h={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},y={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},g=e.inherit(h,{contains:[]}),C=e.inherit(y,{contains:[]});h.contains.push(C),y.contains.push(g);let T=[r,u];return[h,y,g,C].forEach(v=>{v.contains=v.contains.concat(T)}),T=T.concat(h,y),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:T},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:T}]}]},r,p,h,y,{className:"quote",begin:"^>\\s+",contains:T,end:"$"},l,a,u,m,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function v1(e){const n=e.regex,r=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),a=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],c={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:a,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},u={className:"meta",begin:/^(>>>|\.\.\.) /},h={className:"subst",begin:/\{/,end:/\}/,keywords:c,illegal:/#/},y={begin:/\{\{/,relevance:0},g={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,u,y,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,u,y,h]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,y,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,y,h]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},C="[0-9](_?[0-9])*",T=`(\\b(${C}))?\\.(${C})|\\b(${C})\\.`,A=`\\b|${a.join("|")}`,x={className:"number",relevance:0,variants:[{begin:`(\\b(${C})|(${T}))[eE][+-]?(${C})[jJ]?(?=${A})`},{begin:`(${T})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${A})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${A})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${A})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${A})`},{begin:`\\b(${C})[jJ](?=${A})`}]},d={className:"comment",begin:n.lookahead(/# type:/),end:/$/,keywords:c,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},v={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:["self",u,x,g,e.HASH_COMMENT_MODE]}]};return h.contains=[g,x,u],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:c,illegal:/(<\/|\?)|=>/,contains:[u,x,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},g,d,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[v]},{variants:[{match:[/\bclass/,/\s+/,r,/\s*/,/\(\s*/,r,/\s*\)/]},{match:[/\bclass/,/\s+/,r]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[x,v,g]}]}}const Ku="[A-Za-z$_][0-9A-Za-z$_]*",rC=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],sC=["true","false","null","undefined","NaN","Infinity"],aC=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],oC=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],lC=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],cC=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],uC=[].concat(lC,aC,oC);function QM(e){const n=e.regex,r=(Y,{after:B})=>{const $="</"+Y[0].slice(1);return Y.input.indexOf($,B)!==-1},a=Ku,l={begin:"<>",end:"</>"},p=/<[A-Za-z0-9\\._:-]+\s*\/>/,m={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Y,B)=>{const $=Y[0].length+Y.index,N=Y.input[$];if(N==="<"||N===","){B.ignoreMatch();return}N===">"&&(r(Y,{after:$})||B.ignoreMatch());let P;const Z=Y.input.substring($);if(P=Z.match(/^\s*=/)){B.ignoreMatch();return}if((P=Z.match(/^\s+extends\s+/))&&P.index===0){B.ignoreMatch();return}}},c={$pattern:Ku,keyword:rC,literal:sC,built_in:uC,"variable.language":cC},u="[0-9](_?[0-9])*",h=`\\.(${u})`,y="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",g={className:"number",variants:[{begin:`(\\b(${y})((${h})|\\.)?|(${h}))[eE][+-]?(${u})\\b`},{begin:`\\b(${y})\\b((${h})\\b|\\.)?|(${h})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},C={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},T={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,C],subLanguage:"xml"}},A={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,C],subLanguage:"css"}},x={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,C],subLanguage:"graphql"}},d={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,C]},f={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:a+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},b=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,T,A,x,d,{match:/\$\d+/},g];C.contains=b.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(b)});const E=[].concat(f,C.contains),L=E.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(E)}]),R={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:L},M={variants:[{match:[/class/,/\s+/,a,/\s+/,/extends/,/\s+/,n.concat(a,"(",n.concat(/\./,a),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,a],scope:{1:"keyword",3:"title.class"}}]},k={relevance:0,match:n.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...aC,...oC]}},O={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},U={variants:[{match:[/function/,/\s+/,a,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[R],illegal:/%/},F={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function G(Y){return n.concat("(?!",Y.join("|"),")")}const I={match:n.concat(/\b/,G([...lC,"super","import"].map(Y=>`${Y}\\s*\\(`)),a,n.lookahead(/\s*\(/)),className:"title.function",relevance:0},K={begin:n.concat(/\./,n.lookahead(n.concat(a,/(?![0-9A-Za-z$_(])/))),end:a,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},te={match:[/get|set/,/\s+/,a,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},R]},q="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",W={match:[/const|var|let/,/\s+/,a,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(q)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[R]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:L,CLASS_REFERENCE:k},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),O,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,T,A,x,d,f,{match:/\$\d+/},g,k,{scope:"attr",match:a+n.lookahead(":"),relevance:0},W,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[f,e.REGEXP_MODE,{className:"function",begin:q,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:L}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:l.begin,end:l.end},{match:p},{begin:m.begin,"on:begin":m.isTrulyOpeningTag,end:m.end}],subLanguage:"xml",contains:[{begin:m.begin,end:m.end,skip:!0,contains:["self"]}]}]},U,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[R,e.inherit(e.TITLE_MODE,{begin:a,className:"title.function"})]},{match:/\.\.\./,relevance:0},K,{match:"\\$"+a,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[R]},I,F,M,te,{match:/\$[(.]/}]}}function b1(e){const n=e.regex,r=QM(e),a=Ku,l=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],p={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},m={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:l},contains:[r.exports.CLASS_REFERENCE]},c={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},u=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],h={$pattern:Ku,keyword:rC.concat(u),literal:sC,built_in:uC.concat(l),"variable.language":cC},y={className:"meta",begin:"@"+a},g=(x,d,v)=>{const f=x.contains.findIndex(b=>b.label===d);if(f===-1)throw new Error("can not find mode to replace");x.contains.splice(f,1,v)};Object.assign(r.keywords,h),r.exports.PARAMS_CONTAINS.push(y);const C=r.contains.find(x=>x.scope==="attr"),T=Object.assign({},C,{match:n.concat(a,n.lookahead(/\s*\?:/))});r.exports.PARAMS_CONTAINS.push([r.exports.CLASS_REFERENCE,C,T]),r.contains=r.contains.concat([y,p,m,T]),g(r,"shebang",e.SHEBANG()),g(r,"use_strict",c);const A=r.contains.find(x=>x.label==="func.def");return A.relevance=0,Object.assign(r,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),r}const e6=/\[\[wiki:([^\]]+)\]\]/g,t6=new Xw({gfm:!0,breaks:!1}),y1={ALLOWED_URI_REGEXP:/^(?:(?:https?|mailto):|[#/]|\.{0,2}\/|[^:]+$)/i,ADD_ATTR:["target","rel","data-entry-id"]},qf=d6();function po(e,n={}){const r=r6(e),a=t6.parse(r,{async:!1}),l=Ml.sanitize(a,y1),p=new DOMParser().parseFromString(l,"text/html");return a6(p,n.omitDuplicateTitle),s6(p),o6(p),c6(p),{html:Ml.sanitize(p.body.innerHTML,y1),toc:u6(p)}}function n6(e){const n=new TextEncoder().encode(e);let r="";for(const a of n)r+=String.fromCharCode(a);return btoa(r)}function i6(e){const n=atob(e),r=new Uint8Array(n.length);for(let a=0;a<n.length;a++)r[a]=n.charCodeAt(a);return new TextDecoder().decode(r)}function r6(e){return e.replace(e6,(n,r)=>{const a=r.trim();if(!a)return"";const l=Ee(a),p=encodeURIComponent(a);return`<a href="${$r(a)}" data-entry-id="${p}">${l}</a>`})}function s6(e){const n=new Map;for(const r of e.querySelectorAll("h2, h3")){const a=r.textContent?.trim()??"",l=g6(a||"section"),p=n.get(l)??0;n.set(l,p+1),r.id=p===0?l:`${l}-${p+1}`}}function a6(e,n){if(!n)return;const r=e.body.querySelector("h1, h2, h3, h4, h5, h6");!r||r.tagName.toLowerCase()!=="h1"||S1(r.textContent??"")===S1(n)&&r.remove()}function o6(e){for(const n of e.querySelectorAll("pre > code")){const r=f6(n.className),a=n.textContent??"",l=n.parentElement;if(!l)continue;if(r==="mermaid"){const m=e.createElement("div");m.className="diagram-block",m.setAttribute("data-mermaid-source",n6(a)),m.setAttribute("data-diagram-state","pending"),l.replaceWith(m);continue}const p=h6(a,r);n.innerHTML=p,n.classList.add("hljs"),l.classList.add("code-block"),l.dataset.code=a,l.insertBefore(l6(e,r||"text"),l.firstChild)}}function l6(e,n){const r=e.createElement("div");r.className="code-block-toolbar";const a=e.createElement("span");a.className="code-block-dots",a.setAttribute("aria-hidden","true");for(let m=0;m<3;m++)a.append(e.createElement("span"));const l=e.createElement("span");l.className="code-block-language",l.textContent=n;const p=e.createElement("button");return p.className="copy-code",p.type="button",p.dataset.action="copy-code",p.setAttribute("aria-label",`Copy ${n} code`),p.textContent="Copy",r.append(a,l,p),r}function c6(e){for(const n of e.querySelectorAll("a")){const r=n.getAttribute("href")??"";p6(r)&&(n.setAttribute("target","_blank"),n.setAttribute("rel","noopener noreferrer"))}}function u6(e){return[...e.querySelectorAll("h2, h3")].map(n=>({id:n.id,text:n.textContent?.trim()??n.id,level:n.tagName.toLowerCase()==="h2"?2:3}))}function h6(e,n){return n&&qf.getLanguage(n)?qf.highlight(e,{language:n}).value:qf.highlightAuto(e).value}function d6(){return xi.registerLanguage("bash",p1),xi.registerLanguage("sh",p1),xi.registerLanguage("javascript",m1),xi.registerLanguage("js",m1),xi.registerLanguage("json",JM),xi.registerLanguage("markdown",_1),xi.registerLanguage("md",_1),xi.registerLanguage("python",v1),xi.registerLanguage("py",v1),xi.registerLanguage("typescript",b1),xi.registerLanguage("ts",b1),xi}function f6(e){return e.match(/language-([a-z0-9_-]+)/i)?.[1]?.toLowerCase()??null}function p6(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)&&!e.startsWith(window.location.origin)}function g6(e){return e.trim().toLowerCase().replace(/[^\p{Letter}\p{Number}]+/gu,"-").replace(/^-+|-+$/g,"")||"section"}function S1(e){return e.trim().replace(/\s+/g," ").toLocaleLowerCase("en-US")}function m6(e){return`
130
- <article class="document">
131
- <header class="document-header">
132
- <p class="eyebrow">MANIFEST · DRYDOCK</p>
133
- <h1>Conflicts</h1>
134
- </header>
135
- ${e.length>0?`
136
- <ul class="conflict-list">
137
- ${e.map(n=>`
138
- <li>
139
- <a class="conflict-list-item" href="${aL(n.id)}">
140
- <span class="conflict-list-copy">
141
- <strong>${Ee(n.title)}</strong>
142
- <small>${Ee(n.id)}</small>
143
- </span>
144
- <span class="chip ${n.status==="open"?"chip-coral":"chip"}">${Ee(n.status)}</span>
145
- </a>
146
- </li>
147
- `).join("")}
148
- </ul>
149
- `:'<p class="empty-state">No conflicts to display.</p>'}
150
- </article>
151
- `}function _6(e){const n=[Wf("Current",e.current),Wf("Proposed",e.proposed),Wf("Raw Source",e.rawSource)].filter(Boolean).join("");return`
152
- <article class="document">
153
- <header class="document-header">
154
- <p class="eyebrow">MANIFEST · DRYDOCK</p>
155
- <h1>${Ee(e.id)}</h1>
156
- <div class="meta-chips">
157
- <span class="chip chip-coral">${Ee(String(e.meta.status??"unknown"))}</span>
158
- </div>
159
- </header>
160
- <section class="conflict-meta-card">
161
- <pre>${Ee(JSON.stringify(e.meta,null,2))}</pre>
162
- </section>
163
- ${n||'<p class="empty-state">No conflicts to display.</p>'}
164
- </article>
165
- `}function Wf(e,n){if(!n)return"";const r=po(n);return`
166
- <section class="conflict-section">
167
- <h2>${Ee(e)}</h2>
168
- <div class="markdown-body">${r.html}</div>
169
- </section>
170
- `}function v6(e){return`
171
- <article class="document">
172
- <header class="document-header">
173
- <p class="eyebrow">MANIFEST · CODEX</p>
174
- <h1>Index</h1>
175
- </header>
176
- <div class="markdown-body">${po(e).html}</div>
177
- </article>
178
- `}function Zp(e,n){try{return new Date(e).toLocaleString(n??"en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}catch{return e}}function Vu(e){const n=Date.now()-new Date(e).getTime(),r=Math.floor(n/6e4);if(r<1)return"just now";if(r<60)return`${r} min ago`;const a=Math.floor(r/60);if(a<24)return`${a} hr ago`;const l=Math.floor(a/24);return l<30?`${l} days ago`:`${Math.floor(l/30)} months ago`}const b6=`
179
- <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
180
- <path d="M7 17 17 7M9 7h8v8" />
181
- </svg>
182
- `;function y6(e,n,r){if(!e)return"";const{frontmatter:a}=e,l=Zp(a.created),p=Vu(a.created),m=Zp(a.updated),c=Vu(a.updated),u=P3(e,n,r),h=a.tags.length>0?`<div class="queue-card-chips">${a.tags.map(g=>`<span class="chip chip-muted">${Ee(g)}</span>`).join("")}</div>`:'<span class="queue-dl-muted">None</span>',y=a.rawSourceRef?`<a class="manifest-link queue-raw-link" href="${Ye(Ew(a.rawSourceRef))}" data-raw-ref="${Ye(a.rawSourceRef)}">
183
- <span class="manifest-ref">${Ee(a.rawSourceRef)}</span>
184
- <span class="manifest-arrow" aria-hidden="true">${b6}</span>
185
- </a>`:'<span class="queue-dl-muted">None</span>';return`
186
- <details class="manifest-card" open>
187
- <summary class="manifest-summary" aria-label="Toggle document manifest">
188
- <span class="manifest-summary-copy">
189
- <span class="drydock-eyebrow">MANIFEST · CODEX</span>
190
- <span class="manifest-subtitle">Document Manifest</span>
191
- </span>
192
- <span class="manifest-summary-indicator" aria-hidden="true"></span>
193
- </summary>
194
- <dl class="queue-dl">
195
- <dt class="queue-dl-key">Created</dt>
196
- <dd class="queue-dl-value queue-dl-time">
197
- <time datetime="${Ye(a.created)}" title="${Ye(l)}">
198
- ${Ee(l)}
199
- <span class="queue-dl-relative">(${Ee(p)})</span>
200
- </time>
201
- </dd>
202
- <dt class="queue-dl-key">Updated</dt>
203
- <dd class="queue-dl-value queue-dl-time">
204
- <time datetime="${Ye(a.updated)}" title="${Ye(m)}">
205
- ${Ee(m)}
206
- <span class="queue-dl-relative">(${Ee(c)})</span>
207
- </time>
208
- </dd>
209
- <dt class="queue-dl-key">Version</dt>
210
- <dd class="queue-dl-value queue-dl-mono">v${a.version}</dd>
211
- <dt class="queue-dl-key">Tags</dt>
212
- <dd class="queue-dl-value">${h}</dd>
213
- <dt class="queue-dl-key">Source</dt>
214
- <dd class="queue-dl-value">${y}</dd>
215
- </dl>
216
- ${u?`<div class="manifest-actions">${u}</div>`:""}
217
- </details>
218
- `}const S6="modulepreload",w6=function(e){return"/console/"+e},w1={},C6=function(n,r,a){let l=Promise.resolve();if(r&&r.length>0){let u=function(h){return Promise.all(h.map(y=>Promise.resolve(y).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const m=document.querySelector("meta[property=csp-nonce]"),c=m?.nonce||m?.getAttribute("nonce");l=u(r.map(h=>{if(h=w6(h),h in w1)return;w1[h]=!0;const y=h.endsWith(".css"),g=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${g}`))return;const C=document.createElement("link");if(C.rel=y?"stylesheet":S6,y||(C.as="script"),C.crossOrigin="",C.href=h,c&&C.setAttribute("nonce",c),document.head.appendChild(C),y)return new Promise((T,A)=>{C.addEventListener("load",T),C.addEventListener("error",()=>A(new Error(`Unable to preload CSS for ${h}`)))})}))}function p(m){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=m,window.dispatchEvent(c),!c.defaultPrevented)throw m}return l.then(m=>{for(const c of m||[])c.status==="rejected"&&p(c.reason);return n().catch(p)})},x6=".diagram-block[data-mermaid-source]:not([data-diagram-state='rendered']):not([data-diagram-state='error'])",E6=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(","),T6=/^on/i,A6={USE_PROFILES:{svg:!0,svgFilters:!1},FORBID_TAGS:["foreignObject","script"],FORBID_ATTR:["href","xlink:href"]},C1="diagramInteractionBound",k6=/^oklch\s*\(\s*([^)]+)\s*\)$/i,R6=/^(-?\d+(?:\.\d+)?)(deg)?$/i,Ai=[25,50,75,100,125,150,200],L6=["pie1","pie2","pie3","pie4","pie5","pie6","pie7","pie8","pie9","pie10","pie11","pie12"];let Gf=null,x1=!1,M6=0,D6=0,jl=null;function ms(e){const n=e.trim();if(!n)return n;const r=t4(n);return r?n4(r):n}function O6(e){if(x1)return;x1=!0,E1(e);const n=e instanceof Node?e:document.body;new MutationObserver(a=>{let l=!1;for(const p of a)if(p.type==="childList"){jl&&!jl.trigger.isConnected&&El(!1);for(const m of p.addedNodes)if(m instanceof Element&&(m.matches?.(".diagram-block[data-mermaid-source]")||m.querySelector?.(".diagram-block[data-mermaid-source]"))){l=!0;break}if(l)break}l&&E1(e)}).observe(n,{childList:!0,subtree:!0})}function E1(e){const n=e.querySelectorAll(x6);for(const r of n)r.dataset.diagramHydrating!=="true"&&(r.dataset.diagramHydrating="true",r.dataset.diagramState="pending",N6(r))}async function N6(e){const n=e.getAttribute("data-mermaid-source")??"";let r="";try{r=i6(n)}catch{Kf(e,"Invalid diagram source");return}if(!r.trim()){Kf(e,"Empty diagram source");return}try{const a=await I6(),l=`mermaid-diagram-${++M6}`,{svg:p}=await a.render(l,r);e.innerHTML=B6(p),z6(e,p),P6(e),H6(e),e.dataset.diagramState="rendered"}catch(a){const l=a instanceof Error?a.message:String(a);Kf(e,l)}}function Kf(e,n){e.dataset.diagramState="error",e.textContent=`Diagram render failed: ${n}`}function B6(e){const n=(r,a)=>{T6.test(a.attrName)&&(a.keepAttr=!1)};Ml.addHook("uponSanitizeAttribute",n);try{return Ml.sanitize(e,A6)}finally{Ml.removeHook("uponSanitizeAttribute",n)}}async function I6(){return Gf||(Gf=(async()=>{const e=await C6(()=>import("./mermaid.core-Bstsk9cs.js").then(r=>r.bC),[]),n=e.default??e;return n.initialize({securityLevel:"strict",htmlLabels:!1,suppressErrorRendering:!0,startOnLoad:!1,theme:"base",look:"handDrawn",themeVariables:j6(),themeCSS:$6(),flowchart:{htmlLabels:!1,useMaxWidth:!1}}),n})()),Gf}function j6(){const e=getComputedStyle(document.documentElement),n=(x,d)=>{const v=e.getPropertyValue(x).trim();return ms(v||d)},r=(x,d)=>e.getPropertyValue(x).trim()||d,a=n("--brass","#c69a4a"),l=n("--brass-bright","#e6b86a"),p=n("--brass-deep","#a0782a"),m=n("--aurora","#8bd7e6"),c=n("--aurora-deep","#1f8aa8"),u=n("--coral","#ef7c63"),h=n("--ink-deep","#1d2734"),y=n("--ink-fog","#a6afbb"),g=n("--ink-pearl","#e6e9ef"),C=n("--ink-spectral","#bcc4d0"),T=[l,a,m,u,ms("oklch(70% 0.11 68)"),c,ms("oklch(76% 0.09 205)"),p,ms("oklch(68% 0.14 30)"),y,ms("oklch(62% 0.08 228)"),ms("oklch(52% 0.05 248)")],A=Object.fromEntries(L6.map((x,d)=>[x,T[d]??h]));return{background:"transparent",primaryColor:"transparent",primaryTextColor:g,primaryBorderColor:a,secondaryColor:"transparent",secondaryTextColor:g,secondaryBorderColor:l,tertiaryColor:"transparent",tertiaryTextColor:C,tertiaryBorderColor:a,lineColor:c,edgeLabelBackground:"transparent",titleColor:l,fontFamily:"JetBrains Mono Variable, ui-monospace, monospace",mainBkg:"transparent",nodeBorder:a,clusterBkg:"transparent",clusterBorder:a,pieTitleTextColor:l,pieTitleTextSize:r("--font-size-title-lg","19px"),pieSectionTextColor:g,pieSectionTextSize:r("--font-size-md","13px"),pieLegendTextColor:g,pieLegendTextSize:r("--font-size-lg","14px"),pieStrokeColor:p,pieStrokeWidth:"1.35px",pieOuterStrokeColor:l,pieOuterStrokeWidth:"2.5px",pieOpacity:"0.96",...A}}function $6(){const e=getComputedStyle(document.documentElement),n=(h,y)=>{const g=e.getPropertyValue(h).trim();return ms(g||y)},r=n("--brass-deep","#a0782a"),a=n("--brass-bright","#e6b86a"),l=n("--aurora-deep","#1f8aa8"),p=n("--ink-abyss","#131920"),m=ms("oklch(15% 0.04 250 / 34%)"),c=n("--surface-glass","#1d2734"),u=n("--ink-pearl","#e6e9ef");return`
219
- .node rect, .node polygon, .node circle, .node ellipse, .actor, .classGroup rect {
220
- stroke: ${r};
221
- fill: ${c};
222
- }
223
- .edgePath path, .messageLine0, .messageLine1, .relation {
224
- stroke: ${l};
225
- }
226
- .nodeLabel, .edgeLabel, .actor text, .messageText {
227
- fill: ${u};
228
- font-family: "Manrope Variable", "Manrope", ui-sans-serif, sans-serif;
229
- }
230
- .pieCircle {
231
- stroke: ${r};
232
- stroke-width: 1.35px;
233
- opacity: 0.96;
234
- filter: drop-shadow(0 0 1.5px ${m});
235
- }
236
- .pieOuterCircle {
237
- stroke: ${a};
238
- opacity: 0.7;
239
- }
240
- .slice, .legend text, .pieTitleText {
241
- fill: ${u};
242
- paint-order: stroke;
243
- stroke: ${p};
244
- stroke-width: 3px;
245
- stroke-linejoin: round;
246
- font-family: "Manrope Variable", "Manrope", ui-sans-serif, sans-serif;
247
- }
248
- .slice {
249
- font-weight: 600;
250
- letter-spacing: 0.04em;
251
- font-style: italic;
252
- }
253
- .pieTitleText {
254
- font-weight: 600;
255
- letter-spacing: 0.12em;
256
- font-style: italic;
257
- }
258
- .legend text {
259
- font-weight: 500;
260
- letter-spacing: 0.03em;
261
- }
262
- .legend rect {
263
- rx: 999px;
264
- ry: 999px;
265
- opacity: 0.9;
266
- stroke: ${p};
267
- stroke-width: 1.5px;
268
- paint-order: stroke;
269
- filter: saturate(0.78) brightness(0.92) drop-shadow(0 0 0.55px ${a});
270
- }
271
- `}function z6(e,n){const r=new DOMParser().parseFromString(n,"image/svg+xml"),a=Array.from(r.querySelectorAll("a")),l=Array.from(e.querySelectorAll("a")),p=Math.min(a.length,l.length);for(let m=0;m<p;m++){const c=a[m],u=l[m];if(!c||!u)continue;const h=c.getAttribute("href")??c.getAttribute("xlink:href")??"",y=dC(h);y&&u.setAttribute("href",y)}}function P6(e){const n=e.querySelector("svg");if(!n)return;let r;try{r=n.getBBox()}catch{return}const{x:a,y:l,width:p,height:m}=r;!Number.isFinite(a)||!Number.isFinite(l)||!Number.isFinite(p)||!Number.isFinite(m)||a<0||l<0||p<=0||m<=0||n.setAttribute("viewBox",`${Va(a)} ${Va(l)} ${Va(p)} ${Va(m)}`)}function H6(e){e.tabIndex=0,e.setAttribute("aria-label","Open diagram in expanded view"),J6(e),e.dataset[C1]!=="true"&&(e.dataset[C1]="true",e.addEventListener("click",U6),e.addEventListener("keydown",F6))}function U6(e){if(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0||Yu(e.target))return;const n=e.currentTarget;n instanceof HTMLElement&&(e.preventDefault(),hC(n))}function F6(e){if(e.key!=="Enter"&&e.key!==" "||Yu(e.target))return;const n=e.currentTarget;n instanceof HTMLElement&&(e.preventDefault(),hC(n))}function hC(e){const n=e.querySelector("svg");if(!n)return;El(!1);const r=typeof HTMLDialogElement<"u"&&typeof HTMLDialogElement.prototype.showModal=="function",a=document.createElement(r?"dialog":"div"),l=++D6,p=`diagram-lightbox-title-${l}`;a.className="diagram-lightbox",a.setAttribute("aria-labelledby",p),r||(a.setAttribute("role","dialog"),a.setAttribute("aria-modal","true"),a.tabIndex=-1);const m=document.createElement("div");m.className="diagram-lightbox__frame";const c=document.createElement("div");c.className="diagram-lightbox__header";const u=document.createElement("h2");u.id=p,u.textContent="MANIFEST · DIAGRAM";const h=document.createElement("button");h.className="diagram-lightbox__close",h.type="button",h.setAttribute("aria-label","Close expanded diagram"),h.textContent="Close";const y=document.createElement("div");y.className="diagram-lightbox__controls",y.setAttribute("aria-label","Diagram zoom controls");const g=fu("−","Zoom out","out"),C=document.createElement("span");C.className="diagram-lightbox__zoom-readout",C.setAttribute("aria-live","polite");const T=fu("+","Zoom in","in"),A=fu("Fit","Fit diagram to viewport","fit"),x=fu("Reset","Reset diagram zoom","reset");y.append(g,C,T,A,x);const d=document.createElement("div");d.className="diagram-lightbox__viewport";const v=G6(n),f=n.cloneNode(!0);f.removeAttribute("style"),V6(f,`diagram-lightbox-svg-${l}`),d.append(f),c.append(u,y,h),m.append(c,d),a.append(m),document.body.append(a);const b=new q6(d,f,C,v);g.addEventListener("click",()=>b.zoomOut()),T.addEventListener("click",()=>b.zoomIn()),A.addEventListener("click",()=>b.fit()),x.addEventListener("click",()=>b.reset());const E=Y6(a),L=k=>{(k.target===a||k.target===h)&&El(!0)},R=k=>{if(k.key==="Escape"){k.preventDefault(),El(!0);return}b.handleKeyboard(k)||k.key==="Tab"&&Z6(k,a)},M={dialog:a,trigger:e,inertStates:E,onClick:L,onKeyDown:R,cleanupPanZoom:()=>b.destroy()};r&&(M.onCancel=k=>{k.preventDefault(),El(!0)},a.addEventListener("cancel",M.onCancel),a.showModal()),a.addEventListener("click",L),document.addEventListener("keydown",R,!0),jl=M,b.fit(),h.focus()}function fu(e,n,r){const a=document.createElement("button");return a.className="diagram-lightbox__zoom-button",a.type="button",a.dataset.zoomAction=r,a.setAttribute("aria-label",n),a.textContent=e,a}class q6{constructor(n,r,a,l){this.viewport=n,this.svg=r,this.readout=a,this.baseSize=l,this.applyZoom(this.zoomIndex),n.addEventListener("pointerdown",this.onPointerDown),n.addEventListener("pointermove",this.onPointerMove),n.addEventListener("pointerup",this.onPointerEnd),n.addEventListener("pointercancel",this.onPointerEnd),n.addEventListener("wheel",this.onWheel,{passive:!1}),n.addEventListener("dblclick",this.onDoubleClick),window.addEventListener("resize",this.onResize)}viewport;svg;readout;baseSize;zoomIndex=Ai.indexOf(100);dragStart=null;pinchStart=null;pointers=new Map;destroy(){this.viewport.removeEventListener("pointerdown",this.onPointerDown),this.viewport.removeEventListener("pointermove",this.onPointerMove),this.viewport.removeEventListener("pointerup",this.onPointerEnd),this.viewport.removeEventListener("pointercancel",this.onPointerEnd),this.viewport.removeEventListener("wheel",this.onWheel),this.viewport.removeEventListener("dblclick",this.onDoubleClick),window.removeEventListener("resize",this.onResize),this.pointers.clear()}zoomIn(){this.zoomAroundViewportCenter(Math.min(this.zoomIndex+1,Ai.length-1))}zoomOut(){this.zoomAroundViewportCenter(Math.max(this.zoomIndex-1,0))}reset(){this.zoomAroundViewportCenter(Ai.indexOf(100))}fit(){const n=this.viewport.clientWidth||this.viewport.getBoundingClientRect().width||this.baseSize.width,r=this.viewport.clientHeight||this.viewport.getBoundingClientRect().height||this.baseSize.height,a=Math.min(n/this.baseSize.width,r/this.baseSize.height),l=Math.floor(a*100),p=Ai.findIndex(c=>c>l),m=p===-1?Ai.length-1:Math.max(0,p-1);this.applyZoom(m),this.viewport.scrollLeft=Math.max(0,(this.svgWidth-n)/2),this.viewport.scrollTop=Math.max(0,(this.svgHeight-r)/2)}handleKeyboard(n){return n.key==="+"||n.key==="="?(n.preventDefault(),this.zoomIn(),!0):n.key==="-"||n.key==="_"?(n.preventDefault(),this.zoomOut(),!0):n.key==="0"?(n.preventDefault(),this.reset(),!0):n.key.toLowerCase()==="f"?(n.preventDefault(),this.fit(),!0):!1}get svgWidth(){return this.baseSize.width*(pu(this.zoomIndex)/100)}get svgHeight(){return this.baseSize.height*(pu(this.zoomIndex)/100)}applyZoom(n){this.zoomIndex=n;const r=pu(this.zoomIndex),a=r/100;this.svg.setAttribute("width",Va(this.baseSize.width*a)),this.svg.setAttribute("height",Va(this.baseSize.height*a)),this.readout.textContent=`${r}%`}zoomAroundViewportCenter(n){const r=this.viewport.getBoundingClientRect();this.zoomAroundPoint(n,r.left+r.width/2,r.top+r.height/2)}zoomAroundPoint(n,r,a){if(n===this.zoomIndex)return;const l=this.svgWidth,p=this.svgHeight,m=this.viewport.getBoundingClientRect(),c=this.viewport.scrollLeft+r-m.left,u=this.viewport.scrollTop+a-m.top;this.applyZoom(n),this.viewport.scrollLeft=c/l*this.svgWidth-(r-m.left),this.viewport.scrollTop=u/p*this.svgHeight-(a-m.top)}onPointerDown=n=>{if(n.button!==0||Yu(n.target))return;const r=n.pointerId??1;if(this.pointers.set(r,n),this.pointers.size===2){this.pinchStart={distance:this.pointerDistance(),zoomIndex:this.zoomIndex};return}this.dragStart={x:n.clientX,y:n.clientY,scrollLeft:this.viewport.scrollLeft,scrollTop:this.viewport.scrollTop,pointerId:r},this.viewport.setPointerCapture?.(r)};onPointerMove=n=>{const r=n.pointerId??1;if(this.pointers.has(r)&&this.pointers.set(r,n),this.pinchStart&&this.pointers.size>=2){const a=this.pointerDistance()/this.pinchStart.distance,l=pu(this.pinchStart.zoomIndex)*a;this.applyZoom(K6(l));return}!this.dragStart||this.dragStart.pointerId!==r||(n.preventDefault(),this.viewport.scrollLeft=this.dragStart.scrollLeft-(n.clientX-this.dragStart.x),this.viewport.scrollTop=this.dragStart.scrollTop-(n.clientY-this.dragStart.y))};onPointerEnd=n=>{const r=n.pointerId??1;this.pointers.delete(r),this.viewport.releasePointerCapture?.(r),this.dragStart?.pointerId===r&&(this.dragStart=null),this.pointers.size<2&&(this.pinchStart=null)};onWheel=n=>{if(!n.ctrlKey&&!n.metaKey)return;n.preventDefault();const r=n.deltaY<0?Math.min(this.zoomIndex+1,Ai.length-1):Math.max(this.zoomIndex-1,0);this.zoomAroundPoint(r,n.clientX,n.clientY)};onDoubleClick=n=>{Yu(n.target)||(n.preventDefault(),this.zoomAroundPoint(this.zoomIndex===Ai.indexOf(200)?Ai.indexOf(100):Ai.indexOf(200),n.clientX,n.clientY))};onResize=()=>{this.fit()};pointerDistance(){const[n,r]=Array.from(this.pointers.values());return!n||!r?1:Math.hypot(r.clientX-n.clientX,r.clientY-n.clientY)}}function W6(e){const n=T1(e.getAttribute("width")),r=T1(e.getAttribute("height"));if(n&&r)return{width:n,height:r};const a=e.getAttribute("viewBox")?.trim().split(/[\s,]+/).map(Number)??[],l=a[2],p=a[3],m=l!==void 0&&Number.isFinite(l)&&l>0?l:null,c=p!==void 0&&Number.isFinite(p)&&p>0?p:null;return{width:n??m??800,height:r??c??600}}function G6(e){const n=e.getBoundingClientRect();return n.width>0&&n.height>0?{width:n.width,height:n.height}:W6(e)}function T1(e){if(!e)return null;const n=/^(\d+(?:\.\d+)?)/.exec(e.trim());if(!n)return null;const r=Number(n[1]);return Number.isFinite(r)&&r>0?r:null}function Va(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/\.?0+$/,"")}function K6(e){let n=0,r=Number.POSITIVE_INFINITY;return Ai.forEach((a,l)=>{const p=Math.abs(a-e);p<r&&(r=p,n=l)}),n}function pu(e){return Ai[e]??Ai[0]}function V6(e,n){const r=e.getAttribute("id")??"";e.setAttribute("id",n);const a=e.querySelector("style");!r||!a?.textContent||(a.textContent=a.textContent.split(`#${r}`).join(`#${n}`))}function El(e){const n=jl;n&&(n.dialog.removeEventListener("click",n.onClick),document.removeEventListener("keydown",n.onKeyDown,!0),n.onCancel&&n.dialog.removeEventListener("cancel",n.onCancel),n.cleanupPanZoom(),X6(n.inertStates),n.dialog instanceof HTMLDialogElement&&n.dialog.open&&typeof n.dialog.close=="function"&&n.dialog.close(),n.dialog.remove(),jl=null,e&&n.trigger.isConnected&&n.trigger.focus())}function Y6(e){const n=[];for(const r of Array.from(document.body.children))!(r instanceof HTMLElement)||r===e||(n.push({element:r,ariaHidden:r.getAttribute("aria-hidden"),inert:r.inert}),r.inert=!0,r.setAttribute("aria-hidden","true"));return n}function X6(e){for(const n of e)n.element.inert=n.inert,n.ariaHidden===null?n.element.removeAttribute("aria-hidden"):n.element.setAttribute("aria-hidden",n.ariaHidden)}function Z6(e,n){const r=Array.from(n.querySelectorAll(E6)).filter(e4);if(r.length===0){e.preventDefault(),n.focus();return}const a=r[0],l=r[r.length-1];!a||!l||(e.shiftKey&&document.activeElement===a?(e.preventDefault(),l.focus()):!e.shiftKey&&document.activeElement===l&&(e.preventDefault(),a.focus()))}function J6(e){e.querySelector("a[href]")?e.removeAttribute("role"):e.setAttribute("role","button")}function Yu(e){if(!(e instanceof Element))return!1;const n=e.closest("a[href]");return!n||!(n.getAttribute("href")?.trim()??"")?!1:!Q6(n)}function Q6(e){return Array.from(e.children).some(n=>n.tagName.toLowerCase()==="svg")}function e4(e){return!(e.inert||e.hidden||e.getAttribute("aria-hidden")==="true"||"disabled"in e&&e.disabled)}function dC(e){const n=e.trim();if(!n||n.includes(".."))return null;if(/^[a-z][a-z0-9+.-]*:/i.test(n)){if(/^javascript:/i.test(n)||/^data:/i.test(n))return null;let a;try{a=new URL(n)}catch{return null}return a.origin!==window.location.origin?null:dC(a.pathname)}if(/^\/entry\/[^/?#]+$/.exec(n)){const a=n.slice(7);let l;try{l=decodeURIComponent(a)}catch{return null}return/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/.test(l)?`/entry/${encodeURIComponent(l)}`:null}return/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/.test(n)?`/entry/${encodeURIComponent(n)}`:null}function t4(e){const n=k6.exec(e);if(!n)return null;const r=n[1]?.trim();if(!r)return null;const a=r.indexOf("/"),l=a>=0?r.slice(0,a):r,p=a>=0?r.slice(a+1).trim():"",m=l.trim().split(/[\s,]+/).filter(Boolean);if(m.length!==3)return null;const[c,u,h]=m;if(!c||!u||!h)return null;const y=Vf(c,1),g=Vf(u,.4),C=i4(h);if(y===null||g===null||C===null)return null;let T=1;if(a>=0){const A=Vf(p,1);if(A===null)return null;T=A}return{L:y,C:g,h:C,alpha:T}}function n4(e){const n=e.h*Math.PI/180,r=e.C*Math.cos(n),a=e.C*Math.sin(n),l=e.L,p=l+.3963377774*r+.2158037573*a,m=l-.1055613458*r-.0638541728*a,c=l-.0894841775*r-1.291485548*a,u=p**3,h=m**3,y=c**3,g=4.0767416621*u-3.3077115913*h+.2309699292*y,C=-1.2684380046*u+2.6097574011*h-.3413193965*y,T=-.0041960863*u-.7034186147*h+1.707614701*y,A=gu(Yf(g)),x=gu(Yf(C)),d=gu(Yf(T));if(e.alpha<1){const v=gu(e.alpha);return`#${Hs(A)}${Hs(x)}${Hs(d)}${Hs(v)}`}return`#${Hs(A)}${Hs(x)}${Hs(d)}`}function Vf(e,n){if(!e)return null;if(e.endsWith("%")){const a=Number(e.slice(0,-1));return Number.isFinite(a)?a/100*n:null}const r=Number(e);return Number.isFinite(r)?r:null}function i4(e){const n=R6.exec(e);if(!n)return null;const r=Number(n[1]);return Number.isFinite(r)?r:null}function Yf(e){const n=Math.max(0,Math.min(1,e));return n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n}function gu(e){return Math.round(Math.max(0,Math.min(1,e))*255)}function Hs(e){return e.toString(16).padStart(2,"0")}function r4(e,n){const r=s4(e,n);return`
272
- <nav class="breadcrumb" aria-label="Entry location">
273
- <ol>
274
- ${r.map((a,l)=>`
275
- <li>
276
- ${a.href?`<a href="${Ye(a.href)}">${Ee(a.label)}</a>`:`<span aria-current="${l===r.length-1?"page":"false"}">${Ee(a.label)}</span>`}
277
- </li>
278
- `).join("")}
279
- </ol>
280
- </nav>
281
- `}function s4(e,n){const r=n.find(p=>p.id===e.frontmatter.id),a=e.frontmatter.tags[0]??r?.tags[0]??null,l=[{label:"Codex",href:Fg()},{label:"Index",href:Tw()}];return a&&l.push({label:a}),l.push({label:e.frontmatter.title}),l}function a4(e){const n=e.tags.map(a=>`<span class="chip chip-tag">${Ee(a)}</span>`).join(""),r=l4(e);return`
282
- <div class="meta-chips">
283
- ${n}
284
- ${r}
285
- <span class="chip">Updated ${Ee(o4(e.updated))}</span>
286
- </div>
287
- `}function fC(e){return e.map(n=>`<span class="chip chip-muted">${Ee(n)}</span>`).join("")}function o4(e){const n=new Date(e);return Number.isNaN(n.getTime())?e:n.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}function l4(e){const n=c4(e);return n?`<span class="chip ${n.tone==="deprecated"?"chip-coral":n.tone==="stale"?"chip-stale":""}" title="${Ye(n.title)}">${Ee(n.label)}</span>`:""}function c4(e,n=new Date){const r=e.status,a=typeof e.revalidateAfter=="string"&&!Number.isNaN(Date.parse(e.revalidateAfter))&&Date.parse(e.revalidateAfter)<n.getTime();return r==="deprecated"||r==="superseded"?{label:r,tone:"deprecated",title:a?`${r} · stale`:r}:a?{label:"stale",tone:"stale",title:e.revalidateAfter??"stale"}:r==="current"||r==="draft"?{label:r,tone:"neutral",title:r}:null}function u4(e,n,r){const a=h4(e,n,r);return a.length===0?"":`
288
- <section class="related-list">
289
- <h2>Related entries</h2>
290
- <div class="related-items">
291
- ${a.map(l=>`
292
- <a class="related-card" href="${$r(l.entry.id)}" data-entry-id="${Ye(l.entry.id)}">
293
- <strong>${Ee(l.entry.title)}</strong>
294
- <span>${fC(l.matchingTags)}</span>
295
- </a>
296
- `).join("")}
297
- </div>
298
- </section>
299
- `}function h4(e,n,r){const a=new Set(n),l="en-US";return r.filter(p=>p.id!==e).map(p=>({entry:p,matchingTags:p.tags.filter(m=>a.has(m))})).filter(p=>p.matchingTags.length>0).sort((p,m)=>m.matchingTags.length-p.matchingTags.length||p.entry.title.localeCompare(m.entry.title,l,{sensitivity:"base",numeric:!0})).slice(0,5)}const d4=`
300
- <svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
301
- <path d="M6 6 18 18M18 6 6 18" />
302
- </svg>
303
- `,f4=`
304
- <svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
305
- <path d="M8 6h12M8 12h12M8 18h12" />
306
- <path d="M4 6h.01M4 12h.01M4 18h.01" />
307
- </svg>
308
- `;function p4(e){return e.length===0?"":`
309
- <button class="toc-drawer-trigger" type="button" data-action="open-toc-drawer" aria-haspopup="dialog" aria-controls="toc-drawer">
310
- ${f4}
311
- <span>Contents</span>
312
- </button>
313
- `}function g4(e){return e.length===0?"":`
314
- <div class="toc-drawer" id="toc-drawer" role="dialog" aria-modal="true" aria-labelledby="toc-drawer-title" hidden>
315
- <button class="toc-drawer-backdrop" type="button" data-action="close-toc-drawer" aria-label="Close contents"></button>
316
- <section class="toc-drawer-panel">
317
- <header class="toc-drawer-header">
318
- <div>
319
- <p class="drydock-eyebrow">Reading Position</p>
320
- <h2 id="toc-drawer-title">Contents</h2>
321
- </div>
322
- <button class="icon-button" type="button" data-action="close-toc-drawer" aria-label="Close contents">${d4}</button>
323
- </header>
324
- <nav class="toc-drawer-nav" aria-label="Document contents">
325
- ${e.map(n=>`
326
- <a class="toc-drawer-link toc-level-${n.level}" href="#${Ye(n.id)}" data-toc-id="${Ye(n.id)}">
327
- ${Ee(n.text)}
328
- </a>
329
- `).join("")}
330
- </nav>
331
- </section>
332
- </div>
333
- `}const m4=`
334
- <svg class="arrow" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" width="16" height="16">
335
- <path d="M5 12h14M13 6l6 6-6 6" />
336
- </svg>
337
- `;function _4(e,n,r=!0){const a=e.length,l=e.slice(0,6),p=e[0]??null;return`
338
- <article class="document welcome">
339
- <header class="welcome-title">
340
- <p class="eyebrow">Fleet · Codex</p>
341
- <h1>The <em>Codex</em></h1>
342
- </header>
343
- <div class="welcome-divider"></div>
344
- <p class="lead">Navigate your workspace Fleet Wiki. Browse entries by tag from the left compass, or jump instantly with the <kbd>⌘K</kbd> command palette.</p>
345
- ${r?"":'<p class="error-box">No workspace is registered in this daemon. Re-run <code>fleet-wiki</code> in the target directory.</p>'}
346
- <div class="workspace-meta">
347
- <span class="chip chip-aurora">${a} entries</span>
348
- ${n?`<span class="workspace-path">${Ee(n)}</span>`:""}
349
- </div>
350
- ${p?`
351
- <a class="primary-link" href="${Ye($r(p.id))}" data-entry-id="${Ye(p.id)}">
352
- <span>Open first entry — ${Ee(p.title)}</span>
353
- ${m4}
354
- </a>
355
- `:'<p class="empty-state">No wiki entries yet. Add entries with <code>wiki_ingest</code>.</p>'}
356
- ${l.length>0?`
357
- <div class="welcome-grid">
358
- ${l.map(m=>`
359
- <a class="welcome-card" href="${Ye($r(m.id))}" data-entry-id="${Ye(m.id)}">
360
- <strong>${Ee(m.title)}</strong>
361
- <span class="welcome-card-tags">${fC(m.tags.slice(0,3))}</span>
362
- </a>
363
- `).join("")}
364
- </div>
365
- `:""}
366
- </article>
367
- `}function v4(e,n){const r=po(e.body,{omitDuplicateTitle:e.frontmatter.title});return{toc:r.toc,html:`
368
- <article class="document">
369
- <header class="document-header">
370
- ${r4(e,n)}
371
- <p class="eyebrow">Current Entry</p>
372
- <h1>${Ee(e.frontmatter.title)}</h1>
373
- ${a4(e.frontmatter)}
374
- ${p4(r.toc)}
375
- </header>
376
- <div class="markdown-body" id="markdown-body">
377
- ${r.html}
378
- </div>
379
- ${u4(e.frontmatter.id,e.frontmatter.tags,n)}
380
- ${g4(r.toc)}
381
- </article>
382
- `}}function b4(){return`
383
- <article class="document">
384
- <p class="loading">Loading entry</p>
385
- </article>
386
- `}function y4(e){return`
387
- <article class="document">
388
- <p class="error-box">${Ee(e)}</p>
389
- </article>
390
- `}const Mu=new Set;let Mr="entries";const S4=`
391
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
392
- <circle cx="11" cy="11" r="6.5" />
393
- <path d="m20 20-3.5-3.5" />
394
- </svg>
395
- `,w4=`
396
- <svg class="caret" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
397
- <path d="m6 9 6 6 6-6" />
398
- </svg>
399
- `,C4=`
400
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" width="14" height="14">
401
- <path d="M6 6 18 18M18 6 6 18" />
402
- </svg>
403
- `,x4=`
404
- <svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
405
- <circle cx="12" cy="5" r="2" />
406
- <path d="M12 7v14M8 11H4a8 8 0 0 0 16 0h-4" />
407
- </svg>
408
- `;function E4(e,n,r,a=[],l=null,p){const m=e.length,c=k4(e),u=m===0?'<p class="empty-state">No wiki entries yet.</p>':Mr==="tags"?R4(e,n):L4(e,n),h=Mr==="tags"?`Tags · ${c}`:`Entries · ${m}`,y=Mr==="tags"?"tag-tree":"entry-list",g=Mr==="tags"?"Entries by tag":"All entries",C=O4(p??(typeof window<"u"?window.location.pathname:"")),T=C.startsWith("/queue"),A=C==="/index",x=C==="/log",d=C.startsWith("/conflicts"),v=r>0?`<span class="nav-drydock-badge">${r}</span>`:"";return`
409
- <aside class="sidebar" id="sidebar">
410
- <div class="sidebar-header">
411
- <div class="sidebar-header-actions">
412
- <button class="icon-button mobile-close" type="button" data-action="toggle-nav" aria-label="Close">${C4}</button>
413
- </div>
414
- </div>
415
- <button class="command-entry" type="button" data-action="open-command">
416
- <span class="command-entry-label">${S4}<span>Search entries</span></span>
417
- <kbd>⌘K</kbd>
418
- </button>
419
- <div class="nav-drydock-section">
420
- <a class="nav-drydock-link${T?" active":""}" href="${Ye(ro())}">
421
- <span class="nav-drydock-icon">${x4}</span>
422
- <span class="nav-drydock-label">Drydock</span>
423
- ${v}
424
- </a>
425
- <a class="nav-drydock-link${A?" active":""}" href="${Ye(Tw())}">
426
- <span class="nav-drydock-label">Index</span>
427
- </a>
428
- <a class="nav-drydock-link${x?" active":""}" href="${Ye(Aw())}">
429
- <span class="nav-drydock-label">Log</span>
430
- </a>
431
- <a class="nav-drydock-link${d?" active":""}" href="${Ye(sL())}">
432
- <span class="nav-drydock-label">Conflicts</span>
433
- </a>
434
- </div>
435
- <div class="nav-tabs" role="tablist" aria-label="Navigation mode">
436
- <button class="nav-tab${Mr==="entries"?" active":""}" type="button" role="tab" aria-selected="${Mr==="entries"}" data-action="set-nav-mode" data-mode="entries">
437
- Entries
438
- </button>
439
- <button class="nav-tab${Mr==="tags"?" active":""}" type="button" role="tab" aria-selected="${Mr==="tags"}" data-action="set-nav-mode" data-mode="tags">
440
- Tags
441
- </button>
442
- </div>
443
- <p class="nav-section-label">${h}</p>
444
- <nav class="${y}" aria-label="${g}">
445
- ${u}
446
- </nav>
447
- </aside>
448
- `}function T4(e){if(Mu.has(e)){Mu.delete(e);return}Mu.add(e)}function A4(e){Mr=e}function k4(e){const n=new Set;for(const r of e){if(r.tags.length===0){n.add("untagged");continue}for(const a of r.tags)n.add(a)}return n.size}function R4(e,n){return M4(e).map(a=>D4(a,n)).join("")}function L4(e,n){const r="en-US";return[...e].sort((l,p)=>l.title.localeCompare(p.title,r,{sensitivity:"base",numeric:!0})).map(l=>pC(l,n)).join("")}function M4(e){const n="en-US",r=new Map;for(const a of e){const l=a.tags.length>0?a.tags:["untagged"];for(const p of l){const m=r.get(p)??[];m.push(a),r.set(p,m)}}return[...r.entries()].map(([a,l])=>({tag:a,entries:l.sort((p,m)=>p.title.localeCompare(m.title,n,{sensitivity:"base",numeric:!0}))})).sort((a,l)=>a.tag.localeCompare(l.tag,n,{sensitivity:"base",numeric:!0}))}function D4(e,n){const r=Mu.has(e.tag),a=r?"":e.entries.map(l=>pC(l,n)).join("");return`
449
- <section class="tag-group" data-collapsed="${r?"true":"false"}">
450
- <button class="tag-group-button" type="button" data-action="toggle-tag" data-tag="${Ye(e.tag)}">
451
- ${w4}
452
- <span>${e.tag==="untagged"?"Untagged":Ee(e.tag)}</span>
453
- <span class="count">${e.entries.length}</span>
454
- </button>
455
- <div class="tag-group-list">${a}</div>
456
- </section>
457
- `}function pC(e,n){const r=e.id===n?" active":"",a=Ye(e.title);return`
458
- <a class="nav-entry${r}" href="${$r(e.id)}" data-entry-id="${Ye(e.id)}" title="${a}">
459
- <span class="nav-entry-text">${Ee(e.title)}</span>
460
- </a>
461
- `}function O4(e){const n=e===Hi||e===`${Hi}/`?"/":e.startsWith(`${Hi}/`)?e.slice(Hi.length)||"/":e,r=n.match(/^\/w\/[^/]+(\/.*)?$/);return r?r[1]??"/":n}const N4=`
462
- <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
463
- <path d="M15 18 9 12l6-6" />
464
- </svg>
465
- `,B4=`
466
- <svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
467
- <path d="M5 4h11a3 3 0 0 1 3 3v9.5a3.5 3.5 0 0 1-3.5 3.5H8a3 3 0 0 1-3-3V4z" />
468
- <path d="M9 9h6M9 13h6" />
469
- </svg>
470
- `;function I4(e){const n=e.ref??"";let r;return e.loading?r='<p class="loading">Loading source</p>':e.error?r=`<p class="error-box">Failed to load source — ${Ee(e.error)}</p>`:e.content?r=`<div class="markdown-body">${po(e.content).html}</div>`:r='<p class="empty-state">Source is empty.</p>',`
471
- <div class="raw-shell">
472
- <header class="raw-header">
473
- <a class="raw-back" href="/" data-action="navigate-home" aria-label="Back to Codex">
474
- ${N4}
475
- <span>Codex</span>
476
- </a>
477
- <div class="raw-meta">
478
- <span class="raw-glyph">${B4}</span>
479
- <div class="raw-meta-text">
480
- <p class="eyebrow">Manifest · Raw Source</p>
481
- <h1 class="raw-title">${Ee(n)}</h1>
482
- </div>
483
- </div>
484
- <div class="raw-divider"></div>
485
- </header>
486
- <article class="raw-document">
487
- ${r}
488
- </article>
489
- </div>
490
- `}function im(e,n){const r=e==="create_wiki"||!n,a=r?"+":"↻",l=r?"CREATE":"UPDATE";return`<span class="op-badge ${r?"op-badge--create":"op-badge--update"}" aria-label="${l}">
491
- <span class="op-badge-glyph" aria-hidden="true">${a}</span>
492
- <span class="op-badge-label">${l}</span>
493
- </span>`}function j4(e){const{tab:n,items:r,pendingCount:a,archivedCount:l,loading:p,error:m}=e;if(p&&r.length===0)return'<div class="queue-view"><p class="loading">Loading patch queue</p></div>';if(m)return`<div class="queue-view"><p class="error-box">Failed to load queue — ${Ee(m)}</p></div>`;const c=r.length===0?$4(n):r.map(y=>z4(y)).join(""),u=a>0?`<span class="queue-badge">${a}</span>`:"",h=l>0?`<span class="queue-badge queue-badge--muted">${l}</span>`:"";return`
494
- <div class="queue-view">
495
- <div class="queue-header">
496
- <p class="drydock-eyebrow">MANIFEST · DRYDOCK</p>
497
- <h1 class="queue-title">Patch Queue</h1>
498
- </div>
499
- <div class="queue-tabs" role="tablist" aria-label="Queue tabs">
500
- <a class="queue-tab${n==="pending"?" active":""}"
501
- href="${Ye(ro("pending"))}"
502
- role="tab"
503
- aria-selected="${n==="pending"}">
504
- Pending${u}
505
- </a>
506
- <a class="queue-tab${n==="archived"?" active":""}"
507
- href="${Ye(ro("archived"))}"
508
- role="tab"
509
- aria-selected="${n==="archived"}">
510
- Archived${h}
511
- </a>
512
- </div>
513
- <div class="queue-list">
514
- ${c}
515
- </div>
516
- </div>
517
- `}function $4(e){return`<p class="queue-empty">${e==="pending"?"No pending patches.":"No archived patches."}</p>`}function z4(e){const{id:n,meta:r,source:a,summary:l,op:p,target:m}=e,c=P4(r.status),u=Vu(r.createdAt),h=r.warnings??[],y=h.slice(0,3).map(d=>`<span class="chip chip-muted">${Ee(d)}</span>`).join(""),g=h.length>3?`<span class="chip chip-muted">+${h.length-3}</span>`:"",C=a==="archive"?`<span class="chip">${Ee(r.status)}</span>`:"",T=p?im(p,!0):"",A=l?`<p class="queue-card-summary">${Ee(l)}</p>`:"",x=m?`<span class="queue-card-target">${Ee(m)}</span>`:"";return`
518
- <a class="queue-card" href="${Ye(rL(n))}">
519
- ${A}
520
- <div class="queue-card-top">
521
- <span class="queue-card-id">${Ee(n)}</span>
522
- ${c}
523
- </div>
524
- <div class="queue-card-meta">
525
- ${T}
526
- ${x}
527
- <span class="queue-card-time">${Ee(u)}</span>
528
- ${C}
529
- <div class="queue-card-chips">
530
- ${y}${g}
531
- </div>
532
- </div>
533
- </a>
534
- `}function P4(e){return`<span class="status-dot ${e==="pending"?"status-dot--pending":e==="accepted"?"status-dot--accepted":"status-dot--rejected"}" aria-label="${Ye(e)}"></span>`}const H4=`
535
- <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
536
- <path d="M15 18 9 12l6-6" />
537
- </svg>
538
- `,U4=`
539
- <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
540
- <path d="M7 17 17 7M9 7h8v8" />
541
- </svg>
542
- `;function F4(e){const{current:n,loading:r,error:a}=e;return r?'<div class="queue-detail-view"><p class="loading">Loading patch</p></div>':a?`<div class="queue-detail-view"><p class="error-box">Failed to load patch — ${Ee(a)}</p></div>`:n?q4(n,e):'<div class="queue-detail-view"><p class="empty-state">Patch not found.</p></div>'}function q4(e,n){const{patch:r,meta:a,wikiEntry:l,targetExists:p}=e,{frontmatter:m}=r,c=po(l.body),u=im(m.op,p),h=a.rawSourceRef;return`
543
- <div class="queue-detail-view">
544
- <div class="queue-detail-layout">
545
- <div class="queue-detail-main">
546
- <a class="raw-back queue-back" href="${Ye(ro())}" aria-label="Back to Drydock">
547
- ${H4}
548
- <span>Drydock</span>
549
- </a>
550
- <div class="queue-detail-header">
551
- <p class="drydock-eyebrow">MANIFEST · PATCH</p>
552
- <p class="queue-patch-id">${Ee(a.id)}</p>
553
- <h1 class="queue-summary">${Ee(m.summary)}</h1>
554
- ${u}
555
- </div>
556
- <article class="document">
557
- <div class="markdown-body" id="markdown-body">${c.html}</div>
558
- </article>
559
- </div>
560
- <aside class="queue-rail">
561
- ${W4(e,h)}
562
- ${V4(c.toc)}
563
- ${K4(e)}
564
- ${G4(e,n)}
565
- </aside>
566
- </div>
567
- </div>
568
- `}function W4(e,n){const{patch:r,meta:a,targetExists:l}=e,{frontmatter:p}=r,m=im(p.op,l),c=Zp(a.createdAt),u=Vu(a.createdAt),h=Y4(a.status),y=a.warnings??[],g=n?`<dd class="queue-dl-value">
569
- <a class="manifest-link queue-raw-link" href="${Ye(Ew(n))}" data-raw-ref="${Ye(n)}">
570
- <span class="manifest-ref">${Ee(n)}</span>
571
- <span class="manifest-arrow">${U4}</span>
572
- </a>
573
- </dd>`:'<dd class="queue-dl-value queue-dl-muted">None</dd>',C=y.length>0?`<dt class="queue-dl-key">Warnings</dt>
574
- <dd class="queue-dl-value">
575
- <div class="queue-card-chips">
576
- ${y.map(T=>`<span class="chip chip-muted">${Ee(T)}</span>`).join("")}
577
- </div>
578
- </dd>`:"";return`
579
- <div class="queue-rail-card">
580
- <div class="queue-rail-header">
581
- <p class="drydock-eyebrow">MANIFEST · PATCH</p>
582
- <p class="queue-rail-subtitle">Patch Manifest</p>
583
- </div>
584
- <dl class="queue-dl">
585
- <dt class="queue-dl-key">OP</dt>
586
- <dd class="queue-dl-value">${m}</dd>
587
- <dt class="queue-dl-key">Target</dt>
588
- <dd class="queue-dl-value queue-dl-mono">${Ee(p.target)}</dd>
589
- <dt class="queue-dl-key">Proposer</dt>
590
- <dd class="queue-dl-value">${Ee(p.proposer)}</dd>
591
- <dt class="queue-dl-key">Created</dt>
592
- <dd class="queue-dl-value queue-dl-time">
593
- <time datetime="${Ye(a.createdAt)}" title="${Ye(c)}">
594
- ${Ee(c)}
595
- <span class="queue-dl-relative">(${Ee(u)})</span>
596
- </time>
597
- </dd>
598
- <dt class="queue-dl-key">Status</dt>
599
- <dd class="queue-dl-value queue-dl-status">${h}<span>${Ee(a.status)}</span></dd>
600
- <dt class="queue-dl-key">Source</dt>
601
- ${g}
602
- ${C}
603
- </dl>
604
- </div>
605
- `}function G4(e,n){const{meta:r,source:a}=e;if(r.status!=="pending"||a!=="queue")return"";const{actionPending:l,actionError:p}=n,m=l?" disabled":"",c=Ye(r.id),u=p?`<p class="queue-action-error">${Ee(p)}</p>`:"";return`
606
- <div class="queue-rail-card queue-actions-card">
607
- <div class="queue-rail-header">
608
- <p class="drydock-eyebrow">ACTIONS</p>
609
- <p class="queue-rail-subtitle">Decision</p>
610
- </div>
611
- ${l?'<span class="queue-action-spinner" aria-label="Processing"></span>':""}
612
- <div class="queue-action-buttons">
613
- <button class="queue-action-btn queue-action-btn--approve" type="button"
614
- data-action="queue-approve" data-patch-id="${c}"${m}
615
- aria-label="Approve this patch">
616
- <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" aria-hidden="true"><path d="M5 12h14M12 5l7 7-7 7"/></svg>
617
- Approve
618
- </button>
619
- <button class="queue-action-btn queue-action-btn--reject" type="button"
620
- data-action="queue-reject-toggle"${m}
621
- aria-label="Reject this patch">
622
- <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" aria-hidden="true"><path d="M18 6 6 18M6 6l12 12"/></svg>
623
- Reject
624
- </button>
625
- </div>
626
- <form class="queue-reject-form" hidden data-action="queue-reject-submit" data-patch-id="${c}">
627
- <textarea class="queue-reject-textarea" name="reason" minlength="1" maxlength="256" required placeholder="Enter rejection reason (max 256 chars)"></textarea>
628
- <div class="queue-action-buttons">
629
- <button class="queue-action-btn queue-action-btn--reject-submit" type="submit"${m}>Confirm</button>
630
- <button class="queue-action-btn queue-action-btn--cancel" type="button" data-action="queue-reject-cancel"${m}>Cancel</button>
631
- </div>
632
- </form>
633
- ${u}
634
- </div>
635
- `}function K4(e){const n=e.patchSet;return!n||n.members.length===0?"":`
636
- <div class="queue-rail-card">
637
- <div class="queue-rail-header">
638
- <p class="drydock-eyebrow">MANIFEST · DRYDOCK</p>
639
- <p class="queue-rail-subtitle">Patch Set</p>
640
- </div>
641
- <p class="queue-patch-id">${Ee(n.id)}</p>
642
- <ul class="patch-set-list">
643
- ${n.members.map(r=>`
644
- <li class="patch-set-item">
645
- <span class="patch-set-item-copy">
646
- <strong>${Ee(r.summary??r.id)}</strong>
647
- <small>${Ee(r.target??r.id)}</small>
648
- </span>
649
- <span class="chip ${r.status==="rejected"?"chip-coral":""}">${Ee(r.status??r.source)}</span>
650
- </li>
651
- `).join("")}
652
- </ul>
653
- </div>
654
- `}function V4(e){return e.length===0?"":`
655
- <div class="queue-rail-card queue-toc-card">
656
- <div class="queue-rail-header">
657
- <p class="drydock-eyebrow">CONTENTS</p>
658
- </div>
659
- <nav class="queue-toc-nav" aria-label="Table of contents">
660
- ${e.map(r=>`<a class="queue-toc-link queue-toc-level-${r.level}" href="#${Ye(r.id)}">${Ee(r.text)}</a>`).join("")}
661
- </nav>
662
- </div>
663
- `}function Y4(e){return`<span class="status-dot ${e==="pending"?"status-dot--pending":e==="accepted"?"status-dot--accepted":"status-dot--rejected"}" aria-label="${Ye(e)}"></span>`}const X4="active",Z4=".toc-panel a[data-toc-id], .toc-drawer-link[data-toc-id]";function J4(e){return e.length===0?"":`
664
- <nav class="toc-panel" aria-label="Table of contents">
665
- <h2>Contents</h2>
666
- ${e.map(n=>`
667
- <a class="toc-level-${n.level}" href="#${Ye(n.id)}" data-toc-id="${Ye(n.id)}">
668
- ${Ee(n.text)}
669
- </a>
670
- `).join("")}
671
- </nav>
672
- `}function Q4(e,n){if(n.length===0||typeof IntersectionObserver>"u")return()=>{};const r=[...e.querySelectorAll(Z4)],a=new Set(n.map(u=>u.id)),l=[...e.querySelectorAll("#markdown-body h2[id], #markdown-body h3[id]")].filter(u=>a.has(u.id));if(r.length===0||l.length===0)return()=>{};const p=e instanceof HTMLElement?e.closest(".codex-host"):null,m=new Set,c=new IntersectionObserver(u=>{for(const y of u){const g=y.target instanceof HTMLElement?y.target.id:"";g&&(y.isIntersecting?m.add(g):m.delete(g))}const h=eD(l,m)??tD(l,p)??l[0]?.id??null;A1(r,h)},{root:p,rootMargin:"-20% 0px -65% 0px",threshold:[0,.2,.6,1]});for(const u of l)c.observe(u);return A1(r,l[0]?.id??null),()=>c.disconnect()}function eD(e,n){for(const r of e)if(n.has(r.id))return r.id;return null}function tD(e,n){const r=n?n.getBoundingClientRect().top:0;let a=null;for(const l of e)if(l.getBoundingClientRect().top-r<=80)a=l.id;else break;return a}function A1(e,n){for(const r of e){const a=!!(n&&r.dataset.tocId===n);r.classList.toggle(X4,a),a?r.setAttribute("aria-current","location"):r.removeAttribute("aria-current")}}function nD(e){const n=e.entries.join(`
673
-
674
- `),r=po(n);return`
675
- <article class="document">
676
- <header class="document-header">
677
- <p class="eyebrow">MANIFEST · DRYDOCK</p>
678
- <h1>Log</h1>
679
- <div class="log-controls">
680
- ${[10,20,50,100].map(l=>`
681
- <a class="chip ${l===e.limit?"chip-tag":""}" href="${Aw(l)}">${l}</a>
682
- `).join("")}
683
- </div>
684
- </header>
685
- <p class="empty-state">${`Latest ${e.limit} of ${e.totalEntries} entries`}</p>
686
- <div class="markdown-body">${r.html}</div>
687
- </article>
688
- `}const Jp=new Set,na={tab:"pending",items:[],pendingCount:0,archivedCount:0,current:null,loading:!1,error:null,actionPending:!1,actionError:null};function Xu(){return na}function iD(e){return Jp.add(e),()=>Jp.delete(e)}async function rD(e){Qn({tab:e,loading:!0,error:null,current:null});try{const n=await uh(e);Qn({items:n.items,pendingCount:n.pendingCount,archivedCount:n.archivedCount,loading:!1}),Wg(n.pendingCount)}catch(n){Qn({loading:!1,error:fh(n)})}}async function sD(e){Qn({loading:!0,error:null,current:null});try{const n=await V3(e);Qn({current:n,loading:!1})}catch(n){Qn({loading:!1,error:fh(n)})}}function Us(){Qn({items:[],current:null,error:null,loading:!1,actionPending:!1,actionError:null})}async function aD(){if(na.actionPending)return;const e=na.current?.meta.id;if(e){Qn({actionPending:!0,actionError:null});try{await Y3(e);const n=await uh("pending");Qn({actionPending:!1,pendingCount:n.pendingCount,archivedCount:n.archivedCount}),Wg(n.pendingCount),Qs(ro("archived"))}catch(n){Qn({actionPending:!1,actionError:fh(n)})}}}async function oD(e){if(na.actionPending)return;const n=na.current?.meta.id;if(!n)return;const r=e.trim();if(!r||r.length>256){Qn({actionError:r?"Rejection reason must be 256 characters or less.":"Please enter a rejection reason."});return}Qn({actionPending:!0,actionError:null});try{await X3(n,r);const a=await uh("pending");Qn({actionPending:!1,pendingCount:a.pendingCount,archivedCount:a.archivedCount}),Wg(a.pendingCount),Qs(ro("archived"))}catch(a){Qn({actionPending:!1,actionError:fh(a)})}}function Qn(e){Object.assign(na,e);for(const n of Jp)n(na)}function fh(e){return e instanceof Error?e.message:String(e)}const Qp=new Set,_s={ref:null,content:null,loading:!1,error:null};function lD(){return _s}function cD(e){return Qp.add(e),()=>Qp.delete(e)}async function uD(e){if(!(_s.ref===e&&_s.content!==null&&!_s.error)){Du({ref:e,content:null,loading:!0,error:null});try{const n=await K3(e);if(_s.ref!==e)return;Du({content:n,loading:!1})}catch(n){if(_s.ref!==e)return;Du({loading:!1,error:hD(n)})}}}function hs(){Du({ref:null,content:null,loading:!1,error:null})}function Du(e){Object.assign(_s,e);for(const n of Qp)n(_s)}function hD(e){return e instanceof Error?e.message:String(e)}let eo,eg=!1;const gC="fleet-console.codex.nav-collapsed",mC="fleet-console.codex.rail-collapsed";let Zu=_C("nav"),Ju=_C("rail"),tg=null,ng=null,Dl="route";function dD(e,n={}){eo=e,eg=!1,document.documentElement.lang="en",nL(),bL();const r=cL(()=>Br()),a=cD(()=>Br()),l=iD(()=>Br()),p=tL(m=>{vC(m)});return document.addEventListener("click",R1),document.addEventListener("submit",M1),window.addEventListener("keydown",L1,!0),O6(e),n.initialWorkspaceId&&Up()!==n.initialWorkspaceId&&eL(Gb(n.initialWorkspaceId)),mD(),{navigateToWorkspace(m){Up()!==m&&Qs(Gb(m))},destroy(){r(),a(),l(),p(),document.removeEventListener("click",R1),document.removeEventListener("submit",M1),window.removeEventListener("keydown",L1,!0),SC(),$l(!1),yL(),iL(),e.innerHTML=""}}}function fD(e,n){e==="nav"?Zu=n:Ju=n,gD(e,n),eo&&Br()}function k1(e){return e==="nav"?Zu:Ju}function pD(e){Dl!==e&&(Dl=e,eo&&Br())}function _C(e){if(typeof window>"u")return!1;try{return window.localStorage.getItem(e==="nav"?gC:mC)==="true"}catch{return!1}}function gD(e,n){if(!(typeof window>"u"))try{window.localStorage.setItem(e==="nav"?gC:mC,String(n))}catch{}}async function mD(){Br(),await uL(),await vC(Wl())}async function vC(e){if(e.name==="entry"){Us(),hs(),await hL(e.id);return}if(e.name==="raw"){Us(),await uD(e.ref);return}if(e.name==="queue"){jf(),hs(),await rD(e.tab);return}if(e.name==="queue-detail"){jf(),hs(),await sD(e.patchId);return}if(e.name==="index-md"){Us(),hs(),await dL();return}if(e.name==="log"){Us(),hs(),await fL(e.limit);return}if(e.name==="conflicts"){Us(),hs(),await pL();return}if(e.name==="conflict-detail"){Us(),hs(),await gL(e.id);return}jf(),hs(),Us(),Br()}function Br(){const e=Wl();_D(Lu(),e)}function _D(e,n){const r=n.name==="entry"?n.id:null,a=yD(n),l=Dl!=="side"||!Zu,p=!yC(n)&&(Dl!=="side"||!Ju),m=e.currentEntry?v4(e.currentEntry,e.index):null;vL(e.index,e.recentIds);const c=Dl==="side"?`${Zu?" app-shell--nav-collapsed":""}${Ju?" app-shell--rail-collapsed":""}`:"";SC(),$l(!1),eo.innerHTML=`
689
- <div class="app-shell${a}${c}">
690
- <button class="mobile-menu" type="button" data-action="toggle-nav" aria-label="Open menu">
691
- <svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
692
- <path d="M4 7h16M4 12h16M4 17h10" />
693
- </svg>
694
- </button>
695
- ${l?E4(e.index,r,e.pendingPatchCount,e.workspaces,e.currentWorkspaceId,window.location.pathname):""}
696
- <main class="content">
697
- ${vD(e,n,m)}
698
- </main>
699
- ${p?`<div class="rail">${bD(e,n,m)}</div>`:""}
700
- </div>
701
- <div class="toast" id="toast" aria-live="polite"></div>
702
- `,eg?eo.classList.add("is-revealed"):eg=!0,n.name==="entry"&&m&&(tg=Q4(eo,m.toc))}function vD(e,n,r){return n.name==="raw"?I4(lD()):n.name==="queue"?j4(Xu()):n.name==="queue-detail"?F4(Xu()):e.error?y4(e.error):e.loading&&!e.currentEntry&&!e.indexMarkdown&&!e.log&&!e.currentConflict?b4():n.name==="index-md"&&e.indexMarkdown?v6(e.indexMarkdown):n.name==="log"&&e.log?nD(e.log):n.name==="conflicts"?m6(e.conflicts):n.name==="conflict-detail"&&e.currentConflict?_6(e.currentConflict):e.currentEntry&&r?r.html:_4(e.index,e.health?.cwd??null,!!e.currentWorkspaceId)}function bD(e,n,r){return yC(n)?"":`
703
- ${r?J4(r.toc):""}
704
- ${y6(e.currentEntry,e.index,e.currentMatchHint)}
705
- `}function yD(e){return e.name==="raw"?" app-shell--raw":bC(e)?" app-shell--wide":""}function bC(e){return e.name==="home"||e.name==="index-md"||e.name==="log"||e.name==="conflicts"||e.name==="queue"||e.name==="queue-detail"}function yC(e){return e.name==="raw"||bC(e)}function R1(e){const n=e.target;if(!(n instanceof Element))return;const r=n.closest("[data-action]");if(r?.dataset.action==="toggle-nav"){document.body.classList.toggle("nav-open");return}if(r?.dataset.action==="navigate-home"){if(O1(e))return;e.preventDefault(),document.body.classList.remove("nav-open"),Qs(Fg());return}if(r?.dataset.action==="set-nav-mode"){const m=r.dataset.mode;(m==="tags"||m==="entries")&&(A4(m),Br());return}if(r?.dataset.action==="toggle-tag"){T4(r.dataset.tag??""),Br();return}if(r?.dataset.action==="open-toc-drawer"){wD(r);return}if(r?.dataset.action==="close-toc-drawer"){$l(!0);return}if(r?.dataset.action==="copy-code"){CD(r);return}if(r?.dataset.action==="copy-compact-context"){const m=Lu();m.currentEntry&&Ou(bw(m.currentEntry),"Copied compact context.");return}if(r?.dataset.action==="copy-provenance-context"){const m=Lu();m.currentEntry&&Ou(yw(m.currentEntry),"Copied provenance context.");return}if(r?.dataset.action==="copy-related-context"){const m=Lu();m.currentEntry&&Ou(Sw(m.currentEntry,m.index),"Copied related context pack.");return}if(r?.dataset.action==="toggle-why-matched"){const m=r.closest(".context-actions-grid")?.querySelector(".context-why-matched");m&&(m.hidden=!m.hidden);return}if(r?.dataset.action==="queue-approve"){if(Xu().actionPending||!confirm("Approve this patch?"))return;r.setAttribute("disabled",""),aD();return}if(r?.dataset.action==="queue-reject-toggle"){const c=r.closest(".queue-actions-card")?.querySelector(".queue-reject-form");c&&(c.hidden=!c.hidden,c.hidden||c.querySelector("textarea")?.focus());return}if(r?.dataset.action==="queue-reject-cancel"){const c=r.closest(".queue-actions-card")?.querySelector(".queue-reject-form");c&&(c.hidden=!0);return}const a=n.closest("[data-toc-id]");if(a){e.preventDefault(),document.getElementById(a.dataset.tocId??"")?.scrollIntoView({block:"start"}),$l(!1);return}const l=n.closest("a");if(!l||O1(e))return;const p=xD(l);p&&(e.preventDefault(),document.body.classList.remove("nav-open"),Qs(p))}function L1(e){const n=document.querySelector("#toc-drawer:not([hidden])");if(!n)return;if(e.key==="Escape"){e.preventDefault(),e.stopImmediatePropagation(),$l(!0);return}if(e.key==="Tab"){SD(n,e),e.stopImmediatePropagation();return}const r=e.target,a=r instanceof Node&&n.contains(r),l=e.metaKey||e.ctrlKey||e.altKey;(!a||l)&&(e.preventDefault(),e.stopImmediatePropagation())}function SD(e,n){const r=[...e.querySelectorAll("a[href], button:not([disabled])")].filter(m=>m.offsetParent!==null),a=r[0],l=r[r.length-1];if(!a||!l)return;const p=document.activeElement;e.contains(p)?n.shiftKey&&p===a?(n.preventDefault(),l.focus()):!n.shiftKey&&p===l&&(n.preventDefault(),a.focus()):(n.preventDefault(),a.focus())}function wD(e){const n=document.querySelector("#toc-drawer");n&&(ng=e,document.body.classList.remove("nav-open"),document.body.classList.add("toc-open"),n.hidden=!1,(n.querySelector(".toc-drawer-link")??n.querySelector(".toc-drawer-panel [data-action='close-toc-drawer']"))?.focus())}function $l(e){const n=document.querySelector("#toc-drawer");n&&(n.hidden=!0,document.body.classList.remove("toc-open"),e&&ng?.focus(),ng=null)}function SC(){tg?.(),tg=null}function M1(e){const n=e.target;if(n instanceof HTMLFormElement&&n.dataset.action==="queue-reject-submit"){if(e.preventDefault(),Xu().actionPending)return;const r=n.querySelector("button[type='submit']");r&&(r.disabled=!0);const a=n.querySelector("textarea[name='reason']");oD(a?.value??"")}}async function CD(e){const r=e.closest(".code-block")?.dataset.code??"";r&&await Ou(r,"Code copied.")}async function Ou(e,n){try{await navigator.clipboard.writeText(e),D1(n)}catch{D1("Failed to copy to clipboard.")}}function D1(e){const n=document.querySelector("#toast");n&&(n.textContent=e,n.classList.add("visible"),window.setTimeout(()=>n.classList.remove("visible"),1400))}function O1(e){return e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0}function xD(e){const n=e.getAttribute("href")??"",r=e.dataset.entryId;if(r)return $r(decodeURIComponent(r));if(/^[a-z][a-z0-9+.-]*:/i.test(n)&&!n.startsWith(window.location.origin))return null;const a=new URL(n,window.location.origin);if(a.origin!==window.location.origin)return null;if(a.pathname==="/"||a.pathname==="/console/codex"||a.pathname==="/console/codex/")return Fg();if(a.pathname.match(/^\/w\/[^/]+(\/|$)/)||a.pathname.match(/^\/console\/codex\/w\/[^/]+(\/|$)/))return a.pathname+a.search;if(a.pathname.startsWith("/console/codex/entry/")||a.pathname.startsWith("/console/codex/raw/"))return a.pathname;if(a.pathname.startsWith("/console/codex/queue")||a.pathname.startsWith("/console/codex/conflicts")||a.pathname==="/console/codex/index"||a.pathname==="/console/codex/index-md"||a.pathname==="/console/codex/log")return a.pathname+a.search;if(a.pathname.startsWith("/entry/")||a.pathname.startsWith("/raw/"))return a.pathname;if(a.pathname.startsWith("/queue")||a.pathname.startsWith("/conflicts")||a.pathname==="/index"||a.pathname==="/index-md"||a.pathname==="/log")return a.pathname+a.search;if(!a.pathname.endsWith(".md"))return null;const l=a.pathname.split("/").pop()??"",p=decodeURIComponent(l.replace(/\.md$/,""));return p?$r(p):null}let Gs=null,zl=null;function ED(e,n){const r=AD();r.parentElement!==e&&e.appendChild(r),zl||(zl=dD(r,{initialWorkspaceId:n}))}function TD(e){zl?.navigateToWorkspace(e)}function N1(){zl?.destroy(),zl=null,Gs?.parentElement&&Gs.parentElement.removeChild(Gs)}function AD(){return Gs||(Gs=document.createElement("div"),Gs.className="codex-host"),Gs}function kD({state:e,mode:n,onClose:r}){const a=H.useRef(null),l=lS(),p=H.useRef(null),m=e.theaters.find(A=>A.id===e.activeTheaterId)??null,c=m?.id??null,u=!!m?.hasWiki;H.useEffect(()=>{if(!u){N1();return}return()=>{N1()}},[u]),H.useEffect(()=>{!u||!a.current||!c||(pD(n),ED(a.current,c))},[n,u,c]),H.useEffect(()=>{!u||!c||TD(c)},[c,u]),H.useEffect(()=>{if(n==="route")return;const A=x=>{x.key!=="Escape"||SL()||(x.preventDefault(),r())};return window.addEventListener("keydown",A,!0),()=>window.removeEventListener("keydown",A,!0)},[n,r]);const h=A=>{A.preventDefault(),p.current={pointerId:A.pointerId,startX:A.clientX,startWidth:l},A.currentTarget.setPointerCapture(A.pointerId),A.currentTarget.classList.add("is-dragging")},y=A=>{const x=p.current;!x||x.pointerId!==A.pointerId||FT(x.startWidth+(x.startX-A.clientX))},g=A=>{p.current?.pointerId===A.pointerId&&(p.current=null,A.currentTarget.releasePointerCapture(A.pointerId),A.currentTarget.classList.remove("is-dragging"))},C=m?.label??"Fleet Wiki",T=u?S.jsx("div",{className:"codex-surface-host",ref:a}):S.jsx(LD,{activeTheater:m,hasTheaters:e.theaters.length>0});return n==="route"?S.jsx("section",{className:"codex-route-host","aria-label":"Codex",children:T}):S.jsx("aside",{className:"codex-side-layer",style:{"--codex-side-width":`${l}px`},role:"complementary","aria-label":"Codex",children:S.jsxs("div",{className:"codex-side-panel",children:[S.jsx("div",{className:"codex-side-resize",role:"separator","aria-orientation":"vertical","aria-label":"Resize Codex panel",onPointerDown:h,onPointerMove:y,onPointerUp:g,onPointerCancel:g}),S.jsx(RD,{title:C,onClose:r}),T]})})}function RD({title:e,onClose:n}){const[r,a]=H.useState(()=>k1("nav")),[l,p]=H.useState(()=>k1("rail")),m=c=>{const u=c==="nav"?!r:!l;fD(c,u),c==="nav"?a(u):p(u)};return S.jsxs("header",{className:"codex-surface-header",children:[S.jsxs("div",{className:"codex-surface-heading",children:[S.jsx("span",{className:"codex-surface-eyebrow",children:"Codex"}),S.jsx("h2",{className:"codex-surface-title",title:e,children:e})]}),S.jsxs("div",{className:"codex-surface-actions",children:[S.jsx("button",{type:"button",className:`codex-pane-toggle ${r?"is-collapsed":""}`,onClick:()=>m("nav"),"aria-pressed":!r,"aria-label":r?"Nav 펼치기":"Nav 접기",title:r?"Nav 펼치기":"Nav 접기",children:S.jsx(MD,{})}),S.jsx("button",{type:"button",className:`codex-pane-toggle ${l?"is-collapsed":""}`,onClick:()=>m("rail"),"aria-pressed":!l,"aria-label":l?"ToC 펼치기":"ToC 접기",title:l?"ToC 펼치기":"ToC 접기",children:S.jsx(DD,{})}),S.jsx("button",{type:"button",className:"codex-surface-close",onClick:n,"aria-label":"Close Codex",children:"×"})]})]})}function LD({activeTheater:e,hasTheaters:n}){return n?S.jsxs("section",{className:"codex-empty-state",children:[S.jsx("p",{className:"codex-empty-eyebrow",children:"Codex unavailable"}),S.jsx("h1",{children:e?.label??"This Theater"}),S.jsx("p",{children:"This Theater does not have Fleet Wiki data mounted."})]}):S.jsxs("section",{className:"codex-empty-state",children:[S.jsx("p",{className:"codex-empty-eyebrow",children:"Codex"}),S.jsx("h1",{children:"Add a Theater"}),S.jsx("p",{children:"Use the top bar Theater control to choose a project root before opening Codex."})]})}function MD(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("rect",{x:"2.5",y:"3.5",width:"11",height:"9",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),S.jsx("path",{d:"M6.1 3.5v9",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),S.jsx("rect",{x:"3.2",y:"4.2",width:"2.2",height:"7.6",rx:"0.7",fill:"currentColor",opacity:"0.5",stroke:"none"})]})}function DD(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("rect",{x:"2.5",y:"3.5",width:"11",height:"9",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),S.jsx("path",{d:"M9.9 3.5v9",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),S.jsx("rect",{x:"10.6",y:"4.2",width:"2.2",height:"7.6",rx:"0.7",fill:"currentColor",opacity:"0.5",stroke:"none"})]})}async function OD(e){const n=await fetch("/agent-cli/state",{signal:e});return await ND(n),BD(await n.json(),n.status)}async function ND(e){if(e.ok)return;let n=e.statusText||`HTTP ${e.status}`;try{const r=await e.json();typeof r.error=="string"&&(n=r.error)}catch{}throw new Ue(e.status,n)}function BD(e,n){const r=e;if(!r||typeof r!="object"||!Array.isArray(r.clis))throw new Ue(n,"Invalid agent CLI state response");return{clis:r.clis.map(a=>ID(a,n))}}function ID(e,n){const r=e;if(!r||typeof r!="object"||typeof r.id!="string"||typeof r.displayName!="string"||typeof r.available!="boolean"||!(r.version===null||typeof r.version=="string"))throw new Ue(n,"Invalid agent CLI status entry");if(Object.prototype.hasOwnProperty.call(r,"path"))throw new Ue(n,"Agent CLI status must not expose filesystem paths");return{id:r.id,displayName:r.displayName,available:r.available,version:r.version}}const ig=new Set;let rg={loading:!1,state:null,error:null};function jD(){return H.useSyncExternalStore($D,B1,B1)}function B1(){return rg}function $D(e){return ig.add(e),()=>{ig.delete(e)}}async function zD(e){Xf({loading:!0,error:null});try{const n=await OD(e);Xf({loading:!1,state:n,error:null})}catch(n){if(e?.aborted)return;Xf({loading:!1,error:PD(n)})}}function Xf(e){rg={...rg,...e};for(const n of ig)n()}function PD(e){return e instanceof Error?e.message:String(e)}function HD(){const e=jD();return H.useEffect(()=>{const n=new AbortController;return zD(n.signal),()=>n.abort()},[]),S.jsxs("section",{className:"global-settings-card","aria-label":"Agent CLI availability",children:[S.jsxs("div",{className:"agent-cli-head",children:[S.jsx("p",{className:"global-settings-resp-title",children:"Agent CLI"}),S.jsx("p",{className:"global-settings-help",children:"Whether each Agent CLI is installed and discoverable on this machine's PATH, with its detected version. Carriers can only run on an Agent CLI shown as available here."})]}),e.error?S.jsx("p",{className:"global-settings-error",role:"alert",children:e.error}):null,e.loading&&!e.state?S.jsx("p",{className:"global-settings-help",children:"Checking Agent CLIs."}):null,e.state?.clis.map(n=>S.jsx(UD,{cli:n},n.id)),S.jsx("p",{className:"global-settings-foot",children:"Install or update a CLI, then reopen this page to re-check availability."})]})}function UD({cli:e}){return S.jsxs("div",{className:"agent-cli-row",children:[S.jsx("span",{className:"agent-cli-name",children:e.displayName}),S.jsxs("span",{className:"agent-cli-meta",children:[e.available&&e.version?S.jsx("span",{className:"agent-cli-version",children:e.version}):null,S.jsx("span",{className:`agent-cli-status ${e.available?"is-on":""}`,children:e.available?"Available":"Not found"})]})]})}async function FD(e){const n=await fetch("/observer/api-catalog",{signal:e});return await qD(n),WD(await n.json(),n.status).routes}async function qD(e){if(e.ok)return;let n=e.statusText||`HTTP ${e.status}`;try{const r=await e.json();typeof r.error=="string"&&(n=r.error)}catch{}throw new Ue(e.status,n)}function WD(e,n){const r=e;if(!r||typeof r!="object"||!("version"in r)||!Array.isArray(r.routes))throw new Ue(n,"Invalid backend API catalog response");return{routes:r.routes.map(a=>GD(a,n))}}function GD(e,n){const r=e;if(!r||typeof r!="object"||typeof r.method!="string"||typeof r.path!="string"||typeof r.summary!="string"||typeof r.category!="string"||typeof r.gate!="string")throw new Ue(n,"Invalid backend API catalog entry");return{method:r.method,path:r.path,summary:r.summary,category:r.category,gate:r.gate}}const sg=new Set;let ag={loading:!1,state:null,error:null};function KD(){return H.useSyncExternalStore(VD,I1,I1)}function I1(){return ag}function VD(e){return sg.add(e),()=>{sg.delete(e)}}async function YD(e){Zf({loading:!0,error:null});try{const n=await FD(e);Zf({loading:!1,state:n,error:null})}catch(n){if(e?.aborted)return;Zf({loading:!1,error:XD(n)})}}function Zf(e){ag={...ag,...e};for(const n of sg)n()}function XD(e){return e instanceof Error?e.message:String(e)}function ZD(){const e=KD(),[n,r]=H.useState(!0),a=H.useMemo(()=>eO(e.state??[]),[e.state]),l=e.state?.length??0,p=a.length;return H.useEffect(()=>{const m=new AbortController;return YD(m.signal),()=>m.abort()},[]),S.jsxs("section",{className:"global-settings-card backend-api-section","aria-label":"Backend API catalog",children:[S.jsx("div",{className:`backend-api-control carrier-settings-control-group--taskforce ${n?"is-expanded":""}`,children:S.jsxs("div",{className:"carrier-settings-section-head",children:[S.jsxs("div",{className:"backend-api-head",children:[S.jsx("p",{className:"global-settings-resp-title",children:"Backend API"}),S.jsx("p",{className:"global-settings-help",children:l>0?`${l} loopback route${l===1?"":"s"} across ${p} categor${p===1?"y":"ies"} reported by backend introspection.`:"Backend introspection route list for this console."})]}),S.jsx("div",{className:"carrier-settings-tf-head-actions",children:S.jsx("button",{type:"button",className:"carrier-settings-tf-toggle","aria-expanded":n,onClick:()=>r(m=>!m),children:n?"Hide":"Show"})})]})}),e.error?S.jsx("p",{className:"global-settings-error",role:"alert",children:e.error}):null,e.loading&&!e.state?S.jsx("p",{className:"global-settings-help",children:"Loading backend API catalog."}):null,n?S.jsxs("div",{className:"backend-api-groups",children:[a.length>0?a.map(m=>S.jsx(JD,{group:m},m.category)):null,e.state&&a.length===0?S.jsx("p",{className:"global-settings-help",children:"No backend API routes reported."}):null]}):null,S.jsx("p",{className:"global-settings-foot",children:"Console backend routes are fetched from GET /observer/api-catalog, so newly registered routes appear here automatically. The Codex/Fleet Wiki API surface is not included."})]})}function JD({group:e}){return S.jsxs("div",{className:"backend-api-group",children:[S.jsxs("div",{className:"backend-api-group-head",children:[S.jsx("span",{children:e.category}),S.jsx("span",{children:e.entries.length})]}),S.jsx("div",{className:"backend-api-list",children:e.entries.map(n=>S.jsx(QD,{entry:n},`${n.method}:${n.path}`))})]})}function QD({entry:e}){return S.jsxs("div",{className:"backend-api-row",children:[S.jsx("span",{className:"backend-api-method",children:e.method.toUpperCase()}),S.jsx("code",{className:"backend-api-path",children:e.path}),S.jsx("span",{className:"backend-api-summary",children:e.summary}),S.jsx("span",{className:"backend-api-gate",children:e.gate})]})}function eO(e){const n=new Map;for(const r of e){const a=r.category.trim()||"Uncategorized",l=n.get(a);l?l.push(r):n.set(a,[r])}return Array.from(n.entries()).map(([r,a])=>({category:r,entries:a}))}async function tO(e){const n=await fetch("/model-auth/state",{signal:e});return await rm(n),CC(await n.json(),n.status)}async function nO(e,n,r){const a=await fetch(`/model-auth/providers/${encodeURIComponent(e)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:n}),signal:r});return await rm(a),wC(await a.json(),a.status)}async function iO(e,n){const r=await fetch(`/model-auth/providers/${encodeURIComponent(e)}`,{method:"DELETE",signal:n});return await rm(r),wC(await r.json(),r.status)}async function rm(e){if(e.ok)return;let n=e.statusText||`HTTP ${e.status}`;try{const r=await e.json();typeof r.error=="string"&&(n=r.error)}catch{}throw new Ue(e.status,n)}function wC(e,n){const r=e;if(!r||typeof r!="object"||!("state"in r))throw new Ue(n,"Invalid model auth mutation response");return{state:CC(r.state,n)}}function CC(e,n){const r=e;if(!r||typeof r!="object"||!Array.isArray(r.providers))throw new Ue(n,"Invalid model auth state response");return{providers:r.providers.map(a=>rO(a,n))}}function rO(e,n){const r=e;if(typeof r.cli!="string"||typeof r.displayName!="string"||typeof r.signedIn!="boolean")throw new Ue(n,"Invalid model auth provider response");return{cli:r.cli,displayName:r.displayName,signedIn:r.signedIn}}const og=new Set;let lg={loading:!1,state:null,busyCli:null,error:null};function sO(){return H.useSyncExternalStore(aO,j1,j1)}function j1(){return lg}function aO(e){return og.add(e),()=>{og.delete(e)}}async function oO(e){Ir({loading:!0,error:null});try{const n=await tO(e);Ir({loading:!1,state:n,error:null})}catch(n){if(e?.aborted)return;Ir({loading:!1,error:sm(n)})}}async function lO(e,n){Ir({busyCli:e,error:null});try{const r=await nO(e,n);return Ir({state:r.state,busyCli:null,error:null}),await xC(),!0}catch(r){return Ir({busyCli:null,error:sm(r)}),!1}}async function cO(e){Ir({busyCli:e,error:null});try{const n=await iO(e);return Ir({state:n.state,busyCli:null,error:null}),await xC(),!0}catch(n){return Ir({busyCli:null,error:sm(n)}),!1}}async function xC(){try{zS(await dS())}catch{}}function Ir(e){lg={...lg,...e};for(const n of og)n()}function sm(e){return e instanceof Error?e.message:String(e)}function uO(){const e=sO();return H.useEffect(()=>{const n=new AbortController;return oO(n.signal),()=>n.abort()},[]),S.jsxs("section",{className:"global-settings-card","aria-label":"Model sign-in",children:[S.jsxs("div",{className:"model-auth-head",children:[S.jsx("p",{className:"global-settings-resp-title",children:"Model Sign-in"}),S.jsx("p",{className:"global-settings-help",children:"Register a provider API key so carriers can run on that model. Keys are validated against the provider, stored locally, and never shown back in the browser."})]}),e.error?S.jsx("p",{className:"global-settings-error",role:"alert",children:e.error}):null,e.loading&&!e.state?S.jsx("p",{className:"global-settings-help",children:"Loading sign-in state."}):null,e.state?.providers.map(n=>S.jsx(hO,{provider:n,busy:e.busyCli===n.cli},n.cli)),S.jsx("p",{className:"global-settings-foot",children:"Sign-in changes apply to newly launched sessions. Running sessions keep their current credentials until relaunched."})]})}function hO({provider:e,busy:n}){const[r,a]=H.useState(""),l=async()=>{await lO(e.cli,r)&&a("")},p=async()=>{await cO(e.cli)};return S.jsxs("div",{className:"model-auth-row",children:[S.jsxs("div",{className:"model-auth-row-head",children:[S.jsx("span",{className:"model-auth-name",children:e.displayName}),S.jsx("span",{className:`model-auth-status ${e.signedIn?"is-on":""}`,children:e.signedIn?"Signed in":"Not signed in"})]}),e.signedIn?S.jsx("div",{className:"model-auth-actions",children:S.jsx("button",{type:"button",className:"model-auth-button",disabled:n,onClick:()=>{p()},children:n?"Working…":"Sign out"})}):S.jsxs("form",{className:"model-auth-form",onSubmit:m=>{m.preventDefault(),l()},children:[S.jsx("input",{type:"password",className:"model-auth-input",placeholder:"API key",value:r,autoComplete:"off",spellCheck:!1,disabled:n,"aria-label":`${e.displayName} API key`,onChange:m=>a(m.target.value)}),S.jsx("button",{type:"submit",className:"model-auth-button is-primary",disabled:n||r.trim().length===0,children:n?"Verifying…":"Sign in"})]})]})}async function dO(e){const n=await fetch("/global-settings/state",{signal:e});return await EC(n),TC(await n.json(),n.status)}async function fO(e,n){const r=await fetch("/global-settings",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:n});await EC(r);const a=await r.json();if(!a||typeof a!="object"||!("state"in a))throw new Ue(r.status,"Invalid global settings mutation response");return{state:TC(a.state,r.status)}}async function EC(e){if(e.ok)return;let n=e.statusText||`HTTP ${e.status}`;try{const r=await e.json();typeof r.error=="string"&&(n=r.error)}catch{}throw new Ue(e.status,n)}function TC(e,n){const r=e;if(!r||typeof r.replaceSystemPrompt!="boolean"||typeof r.enableMetaphor!="boolean")throw new Ue(n,"Invalid global settings state response");return{replaceSystemPrompt:r.replaceSystemPrompt,enableMetaphor:r.enableMetaphor}}const cg=new Set;let ug={loading:!1,state:null,savingField:null,error:null};function pO(){return H.useSyncExternalStore(gO,$1,$1)}function $1(){return ug}function gO(e){return cg.add(e),()=>{cg.delete(e)}}async function mO(e){to({loading:!0,error:null});try{const n=await dO(e);to({loading:!1,state:n,error:null})}catch(n){if(e?.aborted)return;to({loading:!1,error:AC(n)})}}async function z1(e,n){to({savingField:e,error:null});try{const r=await fO({[e]:n});return to({state:r.state,savingField:null,error:null}),!0}catch(r){return to({savingField:null,error:AC(r)}),!1}}function to(e){ug={...ug,...e};for(const n of cg)n()}function AC(e){return e instanceof Error?e.message:String(e)}const _O=[{id:"maritime",label:"Maritime",swatch:["oklch(78% 0.13 75)","oklch(82% 0.13 195)","oklch(32% 0.04 248)"]},{id:"carbon",label:"Carbon",swatch:["oklch(76% 0.115 62)","oklch(80% 0.105 205)","oklch(25% 0.007 252)"]}],vO=[{id:"webgl",label:"WebGL"},{id:"dom",label:"DOM"}],bO=[{id:"appearance",label:"Appearance",eyebrow:"Theme · Renderer"},{id:"general",label:"General",eyebrow:"Prompt · Metaphor"},{id:"agent-cli",label:"Agent CLI",eyebrow:"Availability · Sign-in"},{id:"backend-api",label:"Backend API",eyebrow:"Loopback routes"}];function yO(){const e=pO(),n=e.state,r=e.savingField!==null,[a,l]=H.useState("appearance");return H.useEffect(()=>{const p=new AbortController;return mO(p.signal),()=>p.abort()},[]),S.jsxs("main",{className:"global-settings-page",children:[S.jsxs("section",{className:"global-settings-hero","aria-labelledby":"global-settings-title",children:[S.jsxs("div",{children:[S.jsx("p",{className:"bridge-kicker",children:"Fleet Control Surface"}),S.jsx("h2",{id:"global-settings-title",children:"Settings"})]}),S.jsx("div",{className:"global-settings-status",role:"status","aria-live":"polite",children:r?"Saving…":""})]}),e.error?S.jsx("p",{className:"global-settings-error",role:"alert",children:e.error}):null,S.jsxs("section",{className:"global-settings-grid",children:[S.jsx("div",{className:"global-settings-list","aria-label":"Settings sections",children:bO.map(p=>S.jsxs("button",{type:"button",className:`global-settings-nav-item ${p.id===a?"is-active":""}`,"aria-pressed":p.id===a,onClick:()=>l(p.id),children:[S.jsx("span",{className:"global-settings-nav-label",children:p.label}),S.jsx("span",{className:"global-settings-nav-eyebrow",children:p.eyebrow})]},p.id))}),S.jsx("div",{className:"global-settings-detail",children:SO(a,n,r)},a)]})]})}function SO(e,n,r){switch(e){case"appearance":return S.jsx(wO,{});case"general":return S.jsx(CO,{state:n,saving:r});case"agent-cli":return S.jsxs(S.Fragment,{children:[S.jsx(HD,{}),S.jsx(uO,{})]});case"backend-api":return S.jsx(ZD,{})}}function wO(){const{activeTheme:e,terminalRenderer:n}=ql();return S.jsxs("section",{className:"global-settings-card","aria-label":"Appearance",children:[S.jsxs("div",{className:"global-settings-row",children:[S.jsxs("div",{className:"global-settings-row-text",children:[S.jsx("p",{className:"global-settings-resp-title",children:"Theme"}),S.jsx("p",{className:"global-settings-help",children:"Console color scheme. Applies immediately and is remembered on this browser."})]}),S.jsx("div",{className:"theme-picker",role:"group","aria-label":"Theme",children:_O.map(r=>{const a=r.id===e;return S.jsxs("button",{type:"button","aria-pressed":a,className:`theme-card ${a?"is-active":""}`,onClick:()=>VA(r.id),children:[S.jsx("span",{className:"theme-card-swatch","aria-hidden":"true",children:r.swatch.map(l=>S.jsx("i",{style:{background:l}},l))}),S.jsx("span",{className:"theme-card-label",children:r.label}),S.jsx("span",{className:"theme-card-check","aria-hidden":"true",children:a?S.jsx(xO,{}):null})]},r.id)})})]}),S.jsxs("div",{className:"global-settings-row",children:[S.jsxs("div",{className:"global-settings-row-text",children:[S.jsx("p",{className:"global-settings-resp-title",children:"Terminal Renderer"}),S.jsx("p",{className:"global-settings-help",children:"WebGL paints the terminal on the GPU for sharper, faster output; DOM is a compatibility fallback. Switching applies to the live terminal instantly without dropping the session."})]}),S.jsx("div",{className:"segmented",role:"group","aria-label":"Terminal renderer",children:vO.map(r=>{const a=r.id===n;return S.jsx("button",{type:"button","aria-pressed":a,className:`segmented-option ${a?"is-active":""}`,onClick:()=>YA(r.id),children:r.label},r.id)})})]}),S.jsx("p",{className:"global-settings-foot",children:"Appearance preferences apply immediately and are stored per browser, separate from session settings."})]})}function CO({state:e,saving:n}){return S.jsxs("section",{className:"global-settings-card","aria-label":"General",children:[e?S.jsxs(S.Fragment,{children:[S.jsx(P1,{title:"System Prompt Injection",help:"Append keeps the Agent CLI's built-in system prompt and layers Fleet doctrine on top. Replace swaps it entirely for Fleet doctrine. Affects Claude-family CLIs only; Codex always receives doctrine through its profile.",onLabel:"Replace",offLabel:"Append",value:e.replaceSystemPrompt,disabled:n,onToggle:()=>{z1("replaceSystemPrompt",!e.replaceSystemPrompt)}}),S.jsx(P1,{title:"Metaphor",help:"Enabled layers the naval tone overlay — clipped reporting cadence and Fleet vocabulary — onto every session. Off keeps the Admiral persona without the tone.",onLabel:"Enabled",offLabel:"Off",value:e.enableMetaphor,disabled:n,onToggle:()=>{z1("enableMetaphor",!e.enableMetaphor)}})]}):S.jsx("p",{className:"global-settings-help",children:"Loading settings."}),S.jsx("p",{className:"global-settings-foot",children:"Changes apply to newly launched sessions. Running sessions keep their current configuration until relaunched."})]})}function P1({title:e,help:n,onLabel:r,offLabel:a,value:l,disabled:p,onToggle:m}){return S.jsxs("div",{className:"global-settings-row",children:[S.jsxs("div",{className:"global-settings-row-text",children:[S.jsx("p",{className:"global-settings-resp-title",children:e}),S.jsx("p",{className:"global-settings-help",children:n})]}),S.jsx("button",{type:"button",className:`global-settings-toggle ${l?"is-on":""}`,disabled:p,"aria-pressed":l,onClick:m,children:S.jsx("span",{children:l?r:a})})]})}function xO(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M3.5 8.5 6.5 11.5 12.5 5",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}const EO="button",TO=184,AO=320,mu=12;function kO({state:e,onSelect:n,mode:r=EO,anchor:a,viewportBounds:l,onClose:p}){const[m,c]=H.useState(r==="menu"),u=H.useRef(null),h=H.useRef(null),y=H.useRef(null),g=e.creatingTerminalSession||e.addingTheater||!e.activeTheaterId||e.agentClis.length===0,C=r==="menu"||m;H.useEffect(()=>{r==="menu"&&c(!0)},[r,a?.x,a?.y]),H.useEffect(()=>{if(!C)return;const d=f=>{u.current?.contains(f.target)||T()},v=f=>{f.key==="Escape"&&(T(),h.current?.focus())};return document.addEventListener("mousedown",d),document.addEventListener("keydown",v),()=>{document.removeEventListener("mousedown",d),document.removeEventListener("keydown",v)}},[C]),H.useEffect(()=>{C&&y.current?.focus()},[C]);const T=()=>{c(!1),p?.()},A=async d=>{g||hg(d)!==null||(c(!1),h.current?.focus(),await n(d))},x=d=>{if(d.key!=="ArrowDown"&&d.key!=="ArrowUp")return;d.preventDefault();const v=Array.from(y.current?.querySelectorAll("[role^='menuitem']:not(:disabled)")??[]);if(v.length===0)return;const f=v.indexOf(document.activeElement),b=f===-1?d.key==="ArrowDown"?0:v.length-1:(f+(d.key==="ArrowDown"?1:-1)+v.length)%v.length;v[b]?.focus()};return S.jsxs("div",{className:`operation-launch-control ${r==="menu"?"operation-launch-control--canvas":""}`,ref:u,style:a?RO(a,l):void 0,"data-canvas-blocker":!0,children:[r==="button"?S.jsx("button",{type:"button",ref:h,className:`workspace-add-button ${m?"is-open":""}`,onClick:()=>c(d=>!d),disabled:g,"aria-haspopup":"menu","aria-expanded":m,"aria-label":"Launch operation",children:S.jsx(LO,{})}):null,C?S.jsx("div",{className:"operation-launch-menu theater-menu",role:"menu","aria-label":"Launch operation",tabIndex:-1,ref:y,onKeyDown:x,children:e.agentClis.length>0?S.jsx("ul",{className:"theater-menu-list",children:e.agentClis.map(d=>{const v=hg(d),f=g||v!==null;return S.jsx("li",{children:S.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item operation-launch-menu-item",disabled:f,"aria-disabled":f,title:v??void 0,onClick:()=>{A(d)},children:[S.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:kC(d.id)}),S.jsx("span",{className:"theater-menu-label",children:d.label}),v?S.jsx("span",{className:"operation-launch-menu-reason",children:v}):null]})},d.id)})}):S.jsx("p",{className:"theater-menu-empty",children:"No Agent CLI available."})}):null]})}function hg(e){return e.available?e.signedIn?null:"Sign-in required":"Not installed"}function RO(e,n){return n?{left:Math.max(mu,Math.min(e.x,n.width-TO-mu)),top:Math.max(mu,Math.min(e.y,n.height-AO-mu))}:{left:e.x,top:e.y}}function LO(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M8 3.4v9.2M3.4 8h9.2",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function kC(e){return e==="claude"?S.jsx(MO,{}):e==="claude-kimi"?S.jsx(DO,{}):e==="claude-glm"?S.jsx(OO,{}):e==="codex"?S.jsx(NO,{}):S.jsx(BO,{})}function MO(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M8 2.6 9.15 6.85 13.4 8 9.15 9.15 8 13.4 6.85 9.15 2.6 8 6.85 6.85Z",fill:"none",stroke:"currentColor",strokeWidth:"1.15",strokeLinejoin:"round"})})}function DO(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M9.7 3.2A5 5 0 1 0 9.7 12.8 4 4 0 1 1 9.7 3.2Z",fill:"none",stroke:"currentColor",strokeWidth:"1.15",strokeLinejoin:"round"})})}function OO(){return S.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",style:{display:"inline-block",verticalAlign:"middle"},children:S.jsx("polygon",{points:"5,1 8.5,3 8.5,7 5,9 1.5,7 1.5,3",stroke:"currentColor",strokeWidth:"1.2",fill:"none"})})}function NO(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M6.2 4.8 3.2 8 6.2 11.2M9.8 4.8 12.8 8 9.8 11.2",fill:"none",stroke:"currentColor",strokeWidth:"1.15",strokeLinecap:"round",strokeLinejoin:"round"})})}function BO(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("rect",{x:"2.8",y:"3.4",width:"10.4",height:"8.2",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.15"}),S.jsx("path",{d:"M5 6.2 6.7 8 5 9.8M7.8 9.8h3",fill:"none",stroke:"currentColor",strokeWidth:"1.15",strokeLinecap:"round",strokeLinejoin:"round"})]})}const IO=208,jO=360,_u=12;function $O({state:e,anchor:n,viewportBounds:r,onLaunchCli:a,onOpenShell:l,onResetView:p,onClose:m}){const c=H.useRef(null),u=H.useRef(null),h=e.creatingTerminalSession||e.addingTheater||!e.activeTheaterId||e.agentClis.length===0,y=!e.activeTheaterId;return H.useEffect(()=>{const g=T=>{c.current?.contains(T.target)||m()},C=T=>{T.key==="Escape"&&m()};return document.addEventListener("mousedown",g),document.addEventListener("keydown",C),()=>{document.removeEventListener("mousedown",g),document.removeEventListener("keydown",C)}},[m]),H.useEffect(()=>{u.current?.focus()},[]),S.jsx("div",{className:"operation-launch-control operation-launch-control--canvas",ref:c,style:zO(n,r),"data-canvas-blocker":!0,children:S.jsxs("div",{className:"operation-launch-menu theater-menu canvas-context-menu",role:"menu","aria-label":"Canvas actions",tabIndex:-1,ref:u,children:[S.jsx("p",{className:"canvas-context-menu-group",children:"New Operation"}),e.agentClis.length>0?S.jsx("ul",{className:"theater-menu-list",children:e.agentClis.map(g=>{const C=hg(g),T=h||C!==null;return S.jsx("li",{children:S.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item operation-launch-menu-item",disabled:T,"aria-disabled":T,title:C??void 0,onClick:()=>{C===null&&!h&&a(g)},children:[S.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:kC(g.id)}),S.jsx("span",{className:"theater-menu-label",children:g.label}),C?S.jsx("span",{className:"operation-launch-menu-reason",children:C}):null]})},g.id)})}):S.jsx("p",{className:"theater-menu-empty",children:"No Agent CLI available."}),S.jsx("div",{className:"theater-menu-divider",role:"separator"}),S.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item canvas-context-menu-item",disabled:y,onClick:l,children:[S.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:S.jsx(PO,{})}),S.jsx("span",{className:"theater-menu-label",children:"Open Shell"})]}),S.jsx("div",{className:"theater-menu-divider",role:"separator"}),S.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item canvas-context-menu-item",onClick:p,children:[S.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:S.jsx(HO,{})}),S.jsx("span",{className:"theater-menu-label",children:"Reset view"})]})]})})}function zO(e,n){return n?{left:Math.max(_u,Math.min(e.x,n.width-IO-_u)),top:Math.max(_u,Math.min(e.y,n.height-jO-_u))}:{left:e.x,top:e.y}}function PO(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("rect",{x:"2.8",y:"3.4",width:"10.4",height:"9.2",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.15"}),S.jsx("path",{d:"M5 6.6 6.8 8.4 5 10.2M8.4 10.2h2.8",fill:"none",stroke:"currentColor",strokeWidth:"1.15",strokeLinecap:"round",strokeLinejoin:"round"})]})}function HO(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("path",{d:"M4.4 7.2A4 4 0 1 1 4 9.2",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"}),S.jsx("path",{d:"M2.4 4.6v2.8h2.8",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})]})}const H1=256,U1=176,Jf=12,vu=220,RC="fleet-console.map.radarCollapsed";function UO({panels:e,shellPanels:n,viewport:r,canvasSize:a,onJump:l}){const p=H.useRef(null),m=H.useRef(!1),[c,u]=H.useState(FO);if(a.width<=0||a.height<=0||r.zoom<=0)return null;const h=[...Object.entries(e).map(([I,K])=>({id:I,kind:"op",x:K.x,y:K.y,width:K.width,height:K.height})),...Object.entries(n).map(([I,K])=>({id:I,kind:"shell",x:K.geometry.x,y:K.geometry.y,width:K.geometry.width,height:K.geometry.height}))];if(h.length===0)return null;const y=()=>{u(I=>{const K=!I;return qO(K),K})};if(c)return S.jsx("button",{type:"button",className:"canvas-minimap-fab","data-canvas-blocker":!0,onClick:y,"aria-label":"Radar 펼치기",title:"Show radar",children:S.jsx(GO,{})});const g=H1-Jf*2,C=U1-Jf*2,T={x:-r.x/r.zoom,y:-r.y/r.zoom,width:a.width/r.zoom,height:a.height/r.zoom};let A=Math.min(T.x,...h.map(I=>I.x)),x=Math.min(T.y,...h.map(I=>I.y)),d=Math.max(T.x+T.width,...h.map(I=>I.x+I.width)),v=Math.max(T.y+T.height,...h.map(I=>I.y+I.height));A-=vu,x-=vu,d+=vu,v+=vu;const f=d-A,b=v-x,E=Math.min(g/f,C/b),L=(g-f*E)/2,R=(C-b*E)/2,M=I=>L+(I-A)*E,k=I=>R+(I-x)*E,O=I=>{const K=p.current?.getBoundingClientRect();if(!K)return;const te=I.clientX-K.left,q=I.clientY-K.top;l({x:A+(te-L)/E,y:x+(q-R)/E})},U=I=>{I.stopPropagation(),m.current=!0,I.currentTarget.setPointerCapture(I.pointerId),O(I)},F=I=>{m.current&&(I.stopPropagation(),O(I))},G=I=>{m.current=!1;try{I.currentTarget.releasePointerCapture(I.pointerId)}catch{}};return S.jsxs("div",{className:"canvas-minimap","data-canvas-blocker":!0,style:{width:H1,height:U1},children:[S.jsx("span",{className:"canvas-minimap-label","aria-hidden":"true",children:"Radar"}),S.jsx("button",{type:"button",className:"canvas-minimap-toggle",onClick:y,"aria-label":"Radar 접기",title:"Collapse radar",children:S.jsx(WO,{})}),S.jsxs("div",{ref:p,className:"canvas-minimap-inner",style:{inset:Jf},onPointerDown:U,onPointerMove:F,onPointerUp:G,onPointerCancel:G,role:"presentation","aria-label":"Canvas minimap — drag to navigate",children:[h.map(I=>S.jsx("div",{className:`canvas-minimap-panel ${I.kind==="shell"?"is-shell":""}`,style:{left:M(I.x),top:k(I.y),width:Math.max(2,I.width*E),height:Math.max(2,I.height*E)}},I.id)),S.jsx("div",{className:"canvas-minimap-view",style:{left:M(T.x),top:k(T.y),width:T.width*E,height:T.height*E}})]})]})}function FO(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(RC)==="true"}catch{return!1}}function qO(e){if(!(typeof window>"u"))try{window.localStorage.setItem(RC,String(e))}catch{}}function WO(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M5.5 4.5 10.5 8l-5 3.5M11 8H5.5",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function GO(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("rect",{x:"2",y:"3",width:"12",height:"10",rx:"2",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),S.jsx("rect",{x:"4.2",y:"5",width:"4.2",height:"3.1",rx:"0.6",fill:"none",stroke:"currentColor",strokeWidth:"1"}),S.jsx("circle",{cx:"11",cy:"10.2",r:"0.95",fill:"currentColor"})]})}function KO({jobs:e,selectedJobId:n,onSelect:r}){const a=r??WS;return S.jsx("ol",{className:"terminal-job-lines",children:e.map(l=>S.jsx(VO,{job:l,active:n===l.jobId,onSelect:a},l.jobId))})}function VO({job:e,active:n,onSelect:r}){const a=sh(e.status),l=xA(e),p=e.ownerCarrierId?`${wA(e.ownerCarrierId)} · ${Dp(e.status)}`:Dp(e.status);return S.jsx("li",{children:S.jsxs("button",{type:"button",className:`terminal-job-line ${n?"is-active":""}`,onClick:()=>r(e.jobId),"aria-current":n||void 0,children:[S.jsx("span",{className:`status-dot status-dot--${a}`,"aria-hidden":"true"}),S.jsx("span",{className:"terminal-job-line-label",children:e.label??Mp(e.jobId)}),S.jsx("span",{className:"terminal-job-line-meta",children:p}),l?S.jsxs(S.Fragment,{children:[S.jsx("span",{className:"terminal-job-line-sep","aria-hidden":"true",children:"-"}),S.jsx("span",{className:"terminal-job-line-stream",children:l})]}):null]})})}var Qf={exports:{}},F1;function YO(){return F1||(F1=1,(function(e,n){(function(r,a){e.exports=a()})(self,(()=>(()=>{var r={};return(()=>{var a=r;Object.defineProperty(a,"__esModule",{value:!0}),a.FitAddon=void 0,a.FitAddon=class{activate(l){this._terminal=l}dispose(){}fit(){const l=this.proposeDimensions();if(!l||!this._terminal||isNaN(l.cols)||isNaN(l.rows))return;const p=this._terminal._core;this._terminal.rows===l.rows&&this._terminal.cols===l.cols||(p._renderService.clear(),this._terminal.resize(l.cols,l.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const l=this._terminal._core,p=l._renderService.dimensions;if(p.css.cell.width===0||p.css.cell.height===0)return;const m=this._terminal.options.scrollback===0?0:l.viewport.scrollBarWidth,c=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(c.getPropertyValue("height")),h=Math.max(0,parseInt(c.getPropertyValue("width"))),y=window.getComputedStyle(this._terminal.element),g=u-(parseInt(y.getPropertyValue("padding-top"))+parseInt(y.getPropertyValue("padding-bottom"))),C=h-(parseInt(y.getPropertyValue("padding-right"))+parseInt(y.getPropertyValue("padding-left")))-m;return{cols:Math.max(2,Math.floor(C/p.css.cell.width)),rows:Math.max(1,Math.floor(g/p.css.cell.height))}}}})(),r})()))})(Qf)),Qf.exports}var XO=YO(),Nu={exports:{}},ZO=Nu.exports,q1;function JO(){return q1||(q1=1,(function(e,n){(function(r,a){e.exports=a()})(ZO,(()=>(()=>{var r={433:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeV11=void 0;const h=u(938),y=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],g=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],C=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],T=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]];let A;function x(d,v){let f,b=0,E=v.length-1;if(d<v[0][0]||d>v[E][1])return!1;for(;E>=b;)if(f=b+E>>1,d>v[f][1])b=f+1;else{if(!(d<v[f][0]))return!0;E=f-1}return!1}c.UnicodeV11=class{constructor(){if(this.version="11",!A){A=new Uint8Array(65536),A.fill(1),A[0]=0,A.fill(0,1,32),A.fill(0,127,160);for(let d=0;d<y.length;++d)A.fill(0,y[d][0],y[d][1]+1);for(let d=0;d<C.length;++d)A.fill(2,C[d][0],C[d][1]+1)}}wcwidth(d){return d<32?0:d<127?1:d<65536?A[d]:x(d,g)?0:x(d,T)?2:1}charProperties(d,v){let f=this.wcwidth(d),b=f===0&&v!==0;if(b){const E=h.UnicodeService.extractWidth(v);E===0?b=!1:E>f&&(f=E)}return h.UnicodeService.createPropertyValue(0,f,b)}}},345:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.runAndSubscribe=c.forwardEvent=c.EventEmitter=void 0,c.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 h=0;h<this._listeners.length;h++)if(this._listeners[h]===u)return void this._listeners.splice(h,1)}}})),this._event}fire(u,h){const y=[];for(let g=0;g<this._listeners.length;g++)y.push(this._listeners[g]);for(let g=0;g<y.length;g++)y[g].call(void 0,u,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},c.forwardEvent=function(u,h){return u((y=>h.fire(y)))},c.runAndSubscribe=function(u,h){return h(void 0),u((y=>h(y)))}},490:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeV6=void 0;const h=u(938),y=[[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]],g=[[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 C;c.UnicodeV6=class{constructor(){if(this.version="6",!C){C=new Uint8Array(65536),C.fill(1),C[0]=0,C.fill(0,1,32),C.fill(0,127,160),C.fill(2,4352,4448),C[9001]=2,C[9002]=2,C.fill(2,11904,42192),C[12351]=1,C.fill(2,44032,55204),C.fill(2,63744,64256),C.fill(2,65040,65050),C.fill(2,65072,65136),C.fill(2,65280,65377),C.fill(2,65504,65511);for(let T=0;T<y.length;++T)C.fill(0,y[T][0],y[T][1]+1)}}wcwidth(T){return T<32?0:T<127?1:T<65536?C[T]:(function(A,x){let d,v=0,f=x.length-1;if(A<x[0][0]||A>x[f][1])return!1;for(;f>=v;)if(d=v+f>>1,A>x[d][1])v=d+1;else{if(!(A<x[d][0]))return!0;f=d-1}return!1})(T,g)?0:T>=131072&&T<=196605||T>=196608&&T<=262141?2:1}charProperties(T,A){let x=this.wcwidth(T),d=x===0&&A!==0;if(d){const v=h.UnicodeService.extractWidth(A);v===0?d=!1:v>x&&(x=v)}return h.UnicodeService.createPropertyValue(0,x,d)}}},938:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeService=void 0;const h=u(345),y=u(490);class g{static extractShouldJoin(T){return(1&T)!=0}static extractWidth(T){return T>>1&3}static extractCharKind(T){return T>>3}static createPropertyValue(T,A,x=!1){return(16777215&T)<<3|(3&A)<<1|(x?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const T=new y.UnicodeV6;this.register(T),this._active=T.version,this._activeProvider=T}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(T){if(!this._providers[T])throw new Error(`unknown Unicode version "${T}"`);this._active=T,this._activeProvider=this._providers[T],this._onChange.fire(T)}register(T){this._providers[T.version]=T}wcwidth(T){return this._activeProvider.wcwidth(T)}getStringCellWidth(T){let A=0,x=0;const d=T.length;for(let v=0;v<d;++v){let f=T.charCodeAt(v);if(55296<=f&&f<=56319){if(++v>=d)return A+this.wcwidth(f);const L=T.charCodeAt(v);56320<=L&&L<=57343?f=1024*(f-55296)+L-56320+65536:A+=this.wcwidth(L)}const b=this.charProperties(f,x);let E=g.extractWidth(b);g.extractShouldJoin(b)&&(E-=g.extractWidth(x)),A+=E,x=b}return A}charProperties(T,A){return this._activeProvider.charProperties(T,A)}}c.UnicodeService=g}},a={};function l(m){var c=a[m];if(c!==void 0)return c.exports;var u=a[m]={exports:{}};return r[m](u,u.exports,l),u.exports}var p={};return(()=>{var m=p;Object.defineProperty(m,"__esModule",{value:!0}),m.Unicode11Addon=void 0;const c=l(433);m.Unicode11Addon=class{activate(u){u.unicode.register(new c.UnicodeV11)}dispose(){}}})(),p})()))})(Nu)),Nu.exports}var QO=JO();var eN=(e,n,r,a)=>{for(var l=n,p=e.length-1,m;p>=0;p--)(m=e[p])&&(l=m(l)||l);return l},tN=(e,n)=>(r,a)=>n(r,a,e),nN=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?W1.isErrorNoTelemetry(e)?new W1(e.message+`
706
-
707
- `+e.stack):new Error(e.message+`
708
-
709
- `+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(n=>{n(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},iN=new nN;function ep(e){rN(e)||iN.onUnexpectedError(e)}var dg="Canceled";function rN(e){return e instanceof sN?!0:e instanceof Error&&e.name===dg&&e.message===dg}var sN=class extends Error{constructor(){super(dg),this.name=this.message}},W1=class fg extends Error{constructor(n){super(n),this.name="CodeExpectedError"}static fromError(n){if(n instanceof fg)return n;let r=new fg;return r.message=n.message,r.stack=n.stack,r}static isErrorNoTelemetry(n){return n.name==="CodeExpectedError"}},aN;(e=>{function n(p){return p<0}e.isLessThan=n;function r(p){return p<=0}e.isLessThanOrEqual=r;function a(p){return p>0}e.isGreaterThan=a;function l(p){return p===0}e.isNeitherLessOrGreaterThan=l,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(aN||={});function oN(e,n){let r=this,a=!1,l;return function(){return a||(a=!0,n||(l=e.apply(r,arguments))),l}}var LC;(e=>{function n(E){return E&&typeof E=="object"&&typeof E[Symbol.iterator]=="function"}e.is=n;let r=Object.freeze([]);function a(){return r}e.empty=a;function*l(E){yield E}e.single=l;function p(E){return n(E)?E:l(E)}e.wrap=p;function m(E){return E||r}e.from=m;function*c(E){for(let L=E.length-1;L>=0;L--)yield E[L]}e.reverse=c;function u(E){return!E||E[Symbol.iterator]().next().done===!0}e.isEmpty=u;function h(E){return E[Symbol.iterator]().next().value}e.first=h;function y(E,L){let R=0;for(let M of E)if(L(M,R++))return!0;return!1}e.some=y;function g(E,L){for(let R of E)if(L(R))return R}e.find=g;function*C(E,L){for(let R of E)L(R)&&(yield R)}e.filter=C;function*T(E,L){let R=0;for(let M of E)yield L(M,R++)}e.map=T;function*A(E,L){let R=0;for(let M of E)yield*L(M,R++)}e.flatMap=A;function*x(...E){for(let L of E)yield*L}e.concat=x;function d(E,L,R){let M=R;for(let k of E)M=L(M,k);return M}e.reduce=d;function*v(E,L,R=E.length){for(L<0&&(L+=E.length),R<0?R+=E.length:R>E.length&&(R=E.length);L<R;L++)yield E[L]}e.slice=v;function f(E,L=Number.POSITIVE_INFINITY){let R=[];if(L===0)return[R,E];let M=E[Symbol.iterator]();for(let k=0;k<L;k++){let O=M.next();if(O.done)return[R,e.empty()];R.push(O.value)}return[R,{[Symbol.iterator](){return M}}]}e.consume=f;async function b(E){let L=[];for await(let R of E)L.push(R);return Promise.resolve(L)}e.asyncToArray=b})(LC||={});function MC(e){if(LC.is(e)){let n=[];for(let r of e)if(r)try{r.dispose()}catch(a){n.push(a)}if(n.length===1)throw n[0];if(n.length>1)throw new AggregateError(n,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function DC(...e){return Nn(()=>MC(e))}function Nn(e){return{dispose:oN(()=>{e()})}}var OC=class NC{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{MC(this._toDispose)}finally{this._toDispose.clear()}}add(n){if(!n)return n;if(n===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?NC.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(n),n}delete(n){if(n){if(n===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(n),n.dispose()}}deleteAndLeak(n){n&&this._toDispose.has(n)&&(this._toDispose.delete(n),void 0)}};OC.DISABLE_DISPOSED_WARNING=!1;var no=OC,qi=class{constructor(){this._store=new no,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};qi.None=Object.freeze({dispose(){}});var vl=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},am=typeof process<"u"&&"title"in process,ph=am?"node":navigator.userAgent,lN=am?"node":navigator.platform,cN=ph.includes("Firefox"),uN=ph.includes("Edge"),BC=/^((?!chrome|android).)*safari/i.test(ph);function hN(){if(!BC)return 0;let e=ph.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}lN.indexOf("Linux")>=0;var dN="",mn=0,_n=0,vn=0,Kt=0,Ei={css:"#00000000",rgba:0},$n;(e=>{function n(l,p,m,c){return c!==void 0?`#${Fs(l)}${Fs(p)}${Fs(m)}${Fs(c)}`:`#${Fs(l)}${Fs(p)}${Fs(m)}`}e.toCss=n;function r(l,p,m,c=255){return(l<<24|p<<16|m<<8|c)>>>0}e.toRgba=r;function a(l,p,m,c){return{css:e.toCss(l,p,m,c),rgba:e.toRgba(l,p,m,c)}}e.toColor=a})($n||={});var Tl;(e=>{function n(u,h){if(Kt=(h.rgba&255)/255,Kt===1)return{css:h.css,rgba:h.rgba};let y=h.rgba>>24&255,g=h.rgba>>16&255,C=h.rgba>>8&255,T=u.rgba>>24&255,A=u.rgba>>16&255,x=u.rgba>>8&255;mn=T+Math.round((y-T)*Kt),_n=A+Math.round((g-A)*Kt),vn=x+Math.round((C-x)*Kt);let d=$n.toCss(mn,_n,vn),v=$n.toRgba(mn,_n,vn);return{css:d,rgba:v}}e.blend=n;function r(u){return(u.rgba&255)===255}e.isOpaque=r;function a(u,h,y){let g=Ys.ensureContrastRatio(u.rgba,h.rgba,y);if(g)return $n.toColor(g>>24&255,g>>16&255,g>>8&255)}e.ensureContrastRatio=a;function l(u){let h=(u.rgba|255)>>>0;return[mn,_n,vn]=Ys.toChannels(h),{css:$n.toCss(mn,_n,vn),rgba:h}}e.opaque=l;function p(u,h){return Kt=Math.round(h*255),[mn,_n,vn]=Ys.toChannels(u.rgba),{css:$n.toCss(mn,_n,vn,Kt),rgba:$n.toRgba(mn,_n,vn,Kt)}}e.opacity=p;function m(u,h){return Kt=u.rgba&255,p(u,Kt*h/255)}e.multiplyOpacity=m;function c(u){return[u.rgba>>24&255,u.rgba>>16&255,u.rgba>>8&255]}e.toColorRGB=c})(Tl||={});var fN;(e=>{let n,r;try{let l=document.createElement("canvas");l.width=1,l.height=1;let p=l.getContext("2d",{willReadFrequently:!0});p&&(n=p,n.globalCompositeOperation="copy",r=n.createLinearGradient(0,0,1,1))}catch{}function a(l){if(l.match(/#[\da-f]{3,8}/i))switch(l.length){case 4:return mn=parseInt(l.slice(1,2).repeat(2),16),_n=parseInt(l.slice(2,3).repeat(2),16),vn=parseInt(l.slice(3,4).repeat(2),16),$n.toColor(mn,_n,vn);case 5:return mn=parseInt(l.slice(1,2).repeat(2),16),_n=parseInt(l.slice(2,3).repeat(2),16),vn=parseInt(l.slice(3,4).repeat(2),16),Kt=parseInt(l.slice(4,5).repeat(2),16),$n.toColor(mn,_n,vn,Kt);case 7:return{css:l,rgba:(parseInt(l.slice(1),16)<<8|255)>>>0};case 9:return{css:l,rgba:parseInt(l.slice(1),16)>>>0}}let p=l.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(p)return mn=parseInt(p[1]),_n=parseInt(p[2]),vn=parseInt(p[3]),Kt=Math.round((p[5]===void 0?1:parseFloat(p[5]))*255),$n.toColor(mn,_n,vn,Kt);if(!n||!r)throw new Error("css.toColor: Unsupported css format");if(n.fillStyle=r,n.fillStyle=l,typeof n.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(n.fillRect(0,0,1,1),[mn,_n,vn,Kt]=n.getImageData(0,0,1,1).data,Kt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:$n.toRgba(mn,_n,vn,Kt),css:l}}e.toColor=a})(fN||={});var In;(e=>{function n(a){return r(a>>16&255,a>>8&255,a&255)}e.relativeLuminance=n;function r(a,l,p){let m=a/255,c=l/255,u=p/255,h=m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4),y=c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4),g=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4);return h*.2126+y*.7152+g*.0722}e.relativeLuminance2=r})(In||={});var Ys;(e=>{function n(m,c){if(Kt=(c&255)/255,Kt===1)return c;let u=c>>24&255,h=c>>16&255,y=c>>8&255,g=m>>24&255,C=m>>16&255,T=m>>8&255;return mn=g+Math.round((u-g)*Kt),_n=C+Math.round((h-C)*Kt),vn=T+Math.round((y-T)*Kt),$n.toRgba(mn,_n,vn)}e.blend=n;function r(m,c,u){let h=In.relativeLuminance(m>>8),y=In.relativeLuminance(c>>8);if(kr(h,y)<u){if(y<h){let T=a(m,c,u),A=kr(h,In.relativeLuminance(T>>8));if(A<u){let x=l(m,c,u),d=kr(h,In.relativeLuminance(x>>8));return A>d?T:x}return T}let g=l(m,c,u),C=kr(h,In.relativeLuminance(g>>8));if(C<u){let T=a(m,c,u),A=kr(h,In.relativeLuminance(T>>8));return C>A?g:T}return g}}e.ensureContrastRatio=r;function a(m,c,u){let h=m>>24&255,y=m>>16&255,g=m>>8&255,C=c>>24&255,T=c>>16&255,A=c>>8&255,x=kr(In.relativeLuminance2(C,T,A),In.relativeLuminance2(h,y,g));for(;x<u&&(C>0||T>0||A>0);)C-=Math.max(0,Math.ceil(C*.1)),T-=Math.max(0,Math.ceil(T*.1)),A-=Math.max(0,Math.ceil(A*.1)),x=kr(In.relativeLuminance2(C,T,A),In.relativeLuminance2(h,y,g));return(C<<24|T<<16|A<<8|255)>>>0}e.reduceLuminance=a;function l(m,c,u){let h=m>>24&255,y=m>>16&255,g=m>>8&255,C=c>>24&255,T=c>>16&255,A=c>>8&255,x=kr(In.relativeLuminance2(C,T,A),In.relativeLuminance2(h,y,g));for(;x<u&&(C<255||T<255||A<255);)C=Math.min(255,C+Math.ceil((255-C)*.1)),T=Math.min(255,T+Math.ceil((255-T)*.1)),A=Math.min(255,A+Math.ceil((255-A)*.1)),x=kr(In.relativeLuminance2(C,T,A),In.relativeLuminance2(h,y,g));return(C<<24|T<<16|A<<8|255)>>>0}e.increaseLuminance=l;function p(m){return[m>>24&255,m>>16&255,m>>8&255,m&255]}e.toChannels=p})(Ys||={});function Fs(e){let n=e.toString(16);return n.length<2?"0"+n:n}function kr(e,n){return e<n?(n+.05)/(e+.05):(e+.05)/(n+.05)}function hn(e){if(!e)throw new Error("value must not be falsy");return e}function om(e){return 57508<=e&&e<=57558}function pN(e){return 57520<=e&&e<=57527}function gN(e){return 57344<=e&&e<=63743}function mN(e){return 9472<=e&&e<=9631}function _N(e){return e>=128512&&e<=128591||e>=127744&&e<=128511||e>=128640&&e<=128767||e>=9728&&e<=9983||e>=9984&&e<=10175||e>=65024&&e<=65039||e>=129280&&e<=129535||e>=127462&&e<=127487}function vN(e,n,r,a){return n===1&&r>Math.ceil(a*1.5)&&e!==void 0&&e>255&&!_N(e)&&!om(e)&&!gN(e)}function IC(e){return om(e)||mN(e)}function bN(){return{css:{canvas:bu(),cell:bu()},device:{canvas:bu(),cell:bu(),char:{width:0,height:0,left:0,top:0}}}}function bu(){return{width:0,height:0}}function yN(e,n,r=0){return(e-(Math.round(n)*2-r))%(Math.round(n)*2)}var An=0,gn=0,Zi=!1,Rr=!1,yu=!1,Zn,tp=0,SN=class{constructor(e,n,r,a,l,p){this._terminal=e,this._optionService=n,this._selectionRenderModel=r,this._decorationService=a,this._coreBrowserService=l,this._themeService=p,this.result={fg:0,bg:0,ext:0}}resolve(e,n,r,a){if(this.result.bg=e.bg,this.result.fg=e.fg,this.result.ext=e.bg&268435456?e.extended.ext:0,gn=0,An=0,Rr=!1,Zi=!1,yu=!1,Zn=this._themeService.colors,tp=0,e.getCode()!==0&&e.extended.underlineStyle===4){let l=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));tp=n*a%(Math.round(l)*2)}if(this._decorationService.forEachDecorationAtCell(n,r,"bottom",l=>{l.backgroundColorRGB&&(gn=l.backgroundColorRGB.rgba>>8&16777215,Rr=!0),l.foregroundColorRGB&&(An=l.foregroundColorRGB.rgba>>8&16777215,Zi=!0)}),yu=this._selectionRenderModel.isCellSelected(this._terminal,n,r),yu){if(this.result.fg&67108864||(this.result.bg&50331648)!==0){if(this.result.fg&67108864)switch(this.result.fg&50331648){case 16777216:case 33554432:gn=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:gn=(this.result.fg&16777215)<<8|255;break;default:gn=this._themeService.colors.foreground.rgba}else switch(this.result.bg&50331648){case 16777216:case 33554432:gn=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:gn=(this.result.bg&16777215)<<8|255;break}gn=Ys.blend(gn,(this._coreBrowserService.isFocused?Zn.selectionBackgroundOpaque:Zn.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}else gn=(this._coreBrowserService.isFocused?Zn.selectionBackgroundOpaque:Zn.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(Rr=!0,Zn.selectionForeground&&(An=Zn.selectionForeground.rgba>>8&16777215,Zi=!0),IC(e.getCode())){if(this.result.fg&67108864&&(this.result.bg&50331648)===0)An=(this._coreBrowserService.isFocused?Zn.selectionBackgroundOpaque:Zn.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(this.result.fg&67108864)switch(this.result.bg&50331648){case 16777216:case 33554432:An=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:An=(this.result.bg&16777215)<<8|255;break}else switch(this.result.fg&50331648){case 16777216:case 33554432:An=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:An=(this.result.fg&16777215)<<8|255;break;default:An=this._themeService.colors.foreground.rgba}An=Ys.blend(An,(this._coreBrowserService.isFocused?Zn.selectionBackgroundOpaque:Zn.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}Zi=!0}}this._decorationService.forEachDecorationAtCell(n,r,"top",l=>{l.backgroundColorRGB&&(gn=l.backgroundColorRGB.rgba>>8&16777215,Rr=!0),l.foregroundColorRGB&&(An=l.foregroundColorRGB.rgba>>8&16777215,Zi=!0)}),Rr&&(yu?gn=e.bg&-16777216&-134217729|gn|50331648:gn=e.bg&-16777216|gn|50331648),Zi&&(An=e.fg&-16777216&-67108865|An|50331648),this.result.fg&67108864&&(Rr&&!Zi&&((this.result.bg&50331648)===0?An=this.result.fg&-134217728|Zn.background.rgba>>8&16777215&16777215|50331648:An=this.result.fg&-134217728|this.result.bg&67108863,Zi=!0),!Rr&&Zi&&((this.result.fg&50331648)===0?gn=this.result.bg&-67108864|Zn.foreground.rgba>>8&16777215&16777215|50331648:gn=this.result.bg&-67108864|this.result.fg&67108863,Rr=!0)),Zn=void 0,this.result.bg=Rr?gn:this.result.bg,this.result.fg=Zi?An:this.result.fg,this.result.ext&=536870911,this.result.ext|=tp<<29&3758096384}},wN=.5,jC=cN||uN?"bottom":"ideographic",CN={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]},xN={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]},EN={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(e,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"║":{1:(e,n)=>`M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╒":{1:(e,n)=>`M.5,1 L.5,${.5-n} L1,${.5-n} M.5,${.5+n} L1,${.5+n}`},"╓":{1:(e,n)=>`M${.5-e},1 L${.5-e},.5 L1,.5 M${.5+e},.5 L${.5+e},1`},"╔":{1:(e,n)=>`M1,${.5-n} L${.5-e},${.5-n} L${.5-e},1 M1,${.5+n} L${.5+e},${.5+n} L${.5+e},1`},"╕":{1:(e,n)=>`M0,${.5-n} L.5,${.5-n} L.5,1 M0,${.5+n} L.5,${.5+n}`},"╖":{1:(e,n)=>`M${.5+e},1 L${.5+e},.5 L0,.5 M${.5-e},.5 L${.5-e},1`},"╗":{1:(e,n)=>`M0,${.5+n} L${.5-e},${.5+n} L${.5-e},1 M0,${.5-n} L${.5+e},${.5-n} L${.5+e},1`},"╘":{1:(e,n)=>`M.5,0 L.5,${.5+n} L1,${.5+n} M.5,${.5-n} L1,${.5-n}`},"╙":{1:(e,n)=>`M1,.5 L${.5-e},.5 L${.5-e},0 M${.5+e},.5 L${.5+e},0`},"╚":{1:(e,n)=>`M1,${.5-n} L${.5+e},${.5-n} L${.5+e},0 M1,${.5+n} L${.5-e},${.5+n} L${.5-e},0`},"╛":{1:(e,n)=>`M0,${.5+n} L.5,${.5+n} L.5,0 M0,${.5-n} L.5,${.5-n}`},"╜":{1:(e,n)=>`M0,.5 L${.5+e},.5 L${.5+e},0 M${.5-e},.5 L${.5-e},0`},"╝":{1:(e,n)=>`M0,${.5-n} L${.5-e},${.5-n} L${.5-e},0 M0,${.5+n} L${.5+e},${.5+n} L${.5+e},0`},"╞":{1:(e,n)=>`M.5,0 L.5,1 M.5,${.5-n} L1,${.5-n} M.5,${.5+n} L1,${.5+n}`},"╟":{1:(e,n)=>`M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1 M${.5+e},.5 L1,.5`},"╠":{1:(e,n)=>`M${.5-e},0 L${.5-e},1 M1,${.5+n} L${.5+e},${.5+n} L${.5+e},1 M1,${.5-n} L${.5+e},${.5-n} L${.5+e},0`},"╡":{1:(e,n)=>`M.5,0 L.5,1 M0,${.5-n} L.5,${.5-n} M0,${.5+n} L.5,${.5+n}`},"╢":{1:(e,n)=>`M0,.5 L${.5-e},.5 M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╣":{1:(e,n)=>`M${.5+e},0 L${.5+e},1 M0,${.5+n} L${.5-e},${.5+n} L${.5-e},1 M0,${.5-n} L${.5-e},${.5-n} L${.5-e},0`},"╤":{1:(e,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n} M.5,${.5+n} L.5,1`},"╥":{1:(e,n)=>`M0,.5 L1,.5 M${.5-e},.5 L${.5-e},1 M${.5+e},.5 L${.5+e},1`},"╦":{1:(e,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L${.5-e},${.5+n} L${.5-e},1 M1,${.5+n} L${.5+e},${.5+n} L${.5+e},1`},"╧":{1:(e,n)=>`M.5,0 L.5,${.5-n} M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"╨":{1:(e,n)=>`M0,.5 L1,.5 M${.5-e},.5 L${.5-e},0 M${.5+e},.5 L${.5+e},0`},"╩":{1:(e,n)=>`M0,${.5+n} L1,${.5+n} M0,${.5-n} L${.5-e},${.5-n} L${.5-e},0 M1,${.5-n} L${.5+e},${.5-n} L${.5+e},0`},"╪":{1:(e,n)=>`M.5,0 L.5,1 M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"╫":{1:(e,n)=>`M0,.5 L1,.5 M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╬":{1:(e,n)=>`M0,${.5+n} L${.5-e},${.5+n} L${.5-e},1 M1,${.5+n} L${.5+e},${.5+n} L${.5+e},1 M0,${.5-n} L${.5-e},${.5-n} L${.5-e},0 M1,${.5-n} L${.5+e},${.5-n} L${.5+e},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(e,n)=>`M.5,1 L.5,${.5+n/.15*.5} C.5,${.5+n/.15*.5},.5,.5,1,.5`},"╮":{1:(e,n)=>`M.5,1 L.5,${.5+n/.15*.5} C.5,${.5+n/.15*.5},.5,.5,0,.5`},"╯":{1:(e,n)=>`M.5,0 L.5,${.5-n/.15*.5} C.5,${.5-n/.15*.5},.5,.5,0,.5`},"╰":{1:(e,n)=>`M.5,0 L.5,${.5-n/.15*.5} C.5,${.5-n/.15*.5},.5,.5,1,.5`}},Pl={"":{d:"M.3,1 L.03,1 L.03,.88 C.03,.82,.06,.78,.11,.73 C.15,.7,.2,.68,.28,.65 L.43,.6 C.49,.58,.53,.56,.56,.53 C.59,.5,.6,.47,.6,.43 L.6,.27 L.4,.27 L.69,.1 L.98,.27 L.78,.27 L.78,.46 C.78,.52,.76,.56,.72,.61 C.68,.66,.63,.67,.56,.7 L.48,.72 C.42,.74,.38,.76,.35,.78 C.32,.8,.31,.84,.31,.88 L.31,1 M.3,.5 L.03,.59 L.03,.09 L.3,.09 L.3,.655",type:0},"":{d:"M.7,.4 L.7,.47 L.2,.47 L.2,.03 L.355,.03 L.355,.4 L.705,.4 M.7,.5 L.86,.5 L.86,.95 L.69,.95 L.44,.66 L.46,.86 L.46,.95 L.3,.95 L.3,.49 L.46,.49 L.71,.78 L.69,.565 L.69,.5",type:0},"":{d:"M.25,.94 C.16,.94,.11,.92,.11,.87 L.11,.53 C.11,.48,.15,.455,.23,.45 L.23,.3 C.23,.25,.26,.22,.31,.19 C.36,.16,.43,.15,.51,.15 C.59,.15,.66,.16,.71,.19 C.77,.22,.79,.26,.79,.3 L.79,.45 C.87,.45,.91,.48,.91,.53 L.91,.87 C.91,.92,.86,.94,.77,.94 L.24,.94 M.53,.2 C.49,.2,.45,.21,.42,.23 C.39,.25,.38,.27,.38,.3 L.38,.45 L.68,.45 L.68,.3 C.68,.27,.67,.25,.64,.23 C.61,.21,.58,.2,.53,.2 M.58,.82 L.58,.66 C.63,.65,.65,.63,.65,.6 C.65,.58,.64,.57,.61,.56 C.58,.55,.56,.54,.52,.54 C.48,.54,.46,.55,.43,.56 C.4,.57,.39,.59,.39,.6 C.39,.63,.41,.64,.46,.66 L.46,.82 L.57,.82",type:0},"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}};Pl[""]=Pl[""];Pl[""]=Pl[""];function TN(e,n,r,a,l,p,m,c){let u=CN[n];if(u)return AN(e,u,r,a,l,p),!0;let h=xN[n];if(h)return kN(e,h,r,a,l,p),!0;let y=EN[n];if(y)return RN(e,y,r,a,l,p,c),!0;let g=Pl[n];return g?(LN(e,g,r,a,l,p,m,c),!0):!1}function AN(e,n,r,a,l,p){for(let m=0;m<n.length;m++){let c=n[m],u=l/8,h=p/8;e.fillRect(r+c.x*u,a+c.y*h,c.w*u,c.h*h)}}var G1=new Map;function kN(e,n,r,a,l,p){let m=G1.get(n);m||(m=new Map,G1.set(n,m));let c=e.fillStyle;if(typeof c!="string")throw new Error(`Unexpected fillStyle type "${c}"`);let u=m.get(c);if(!u){let h=n[0].length,y=n.length,g=e.canvas.ownerDocument.createElement("canvas");g.width=h,g.height=y;let C=hn(g.getContext("2d")),T=new ImageData(h,y),A,x,d,v;if(c.startsWith("#"))A=parseInt(c.slice(1,3),16),x=parseInt(c.slice(3,5),16),d=parseInt(c.slice(5,7),16),v=c.length>7&&parseInt(c.slice(7,9),16)||1;else if(c.startsWith("rgba"))[A,x,d,v]=c.substring(5,c.length-1).split(",").map(f=>parseFloat(f));else throw new Error(`Unexpected fillStyle color format "${c}" when drawing pattern glyph`);for(let f=0;f<y;f++)for(let b=0;b<h;b++)T.data[(f*h+b)*4]=A,T.data[(f*h+b)*4+1]=x,T.data[(f*h+b)*4+2]=d,T.data[(f*h+b)*4+3]=n[f][b]*(v*255);C.putImageData(T,0,0),u=hn(e.createPattern(g,null)),m.set(c,u)}e.fillStyle=u,e.fillRect(r,a,l,p)}function RN(e,n,r,a,l,p,m){e.strokeStyle=e.fillStyle;for(let[c,u]of Object.entries(n)){e.beginPath(),e.lineWidth=m*Number.parseInt(c);let h;if(typeof u=="function"){let y=.15/p*l;h=u(.15,y)}else h=u;for(let y of h.split(" ")){let g=y[0],C=$C[g];if(!C){console.error(`Could not find drawing instructions for "${g}"`);continue}let T=y.substring(1).split(",");!T[0]||!T[1]||C(e,zC(T,l,p,r,a,!0,m))}e.stroke(),e.closePath()}}function LN(e,n,r,a,l,p,m,c){let u=new Path2D;u.rect(r,a,l,p),e.clip(u),e.beginPath();let h=m/12;e.lineWidth=c*h;for(let y of n.d.split(" ")){let g=y[0],C=$C[g];if(!C){console.error(`Could not find drawing instructions for "${g}"`);continue}let T=y.substring(1).split(",");!T[0]||!T[1]||C(e,zC(T,l,p,r,a,!1,c,(n.leftPadding??0)*(h/2),(n.rightPadding??0)*(h/2)))}n.type===1?(e.strokeStyle=e.fillStyle,e.stroke()):e.fill(),e.closePath()}function K1(e,n,r=0){return Math.max(Math.min(e,n),r)}var $C={C:(e,n)=>e.bezierCurveTo(n[0],n[1],n[2],n[3],n[4],n[5]),L:(e,n)=>e.lineTo(n[0],n[1]),M:(e,n)=>e.moveTo(n[0],n[1])};function zC(e,n,r,a,l,p,m,c=0,u=0){let h=e.map(y=>parseFloat(y)||parseInt(y));if(h.length<2)throw new Error("Too few arguments for instruction");for(let y=0;y<h.length;y+=2)h[y]*=n-c*m-u*m,p&&h[y]!==0&&(h[y]=K1(Math.round(h[y]+.5)-.5,n,0)),h[y]+=a+c*m;for(let y=1;y<h.length;y+=2)h[y]*=r,p&&h[y]!==0&&(h[y]=K1(Math.round(h[y]+.5)-.5,r,0)),h[y]+=l;return h}var V1=class{constructor(){this._data={}}set(e,n,r){this._data[e]||(this._data[e]={}),this._data[e][n]=r}get(e,n){return this._data[e]?this._data[e][n]:void 0}clear(){this._data={}}},Y1=class{constructor(){this._data=new V1}set(e,n,r,a,l){this._data.get(e,n)||this._data.set(e,n,new V1),this._data.get(e,n).set(r,a,l)}get(e,n,r,a){return this._data.get(e,n)?.get(r,a)}clear(){this._data.clear()}},PC=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),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(e){this._idleCallback=void 0;let n=0,r=0,a=e.timeRemaining(),l=0;for(;this._i<this._tasks.length;){if(n=performance.now(),this._tasks[this._i]()||this._i++,n=Math.max(1,performance.now()-n),r=Math.max(n,r),l=e.timeRemaining(),r*1.5>l){a-n<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(a-n))}ms`),this._start();return}a=l}this.clear()}},MN=class extends PC{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let n=performance.now()+e;return{timeRemaining:()=>Math.max(0,n-performance.now())}}},DN=class extends PC{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},ON=!am&&"requestIdleCallback"in window?DN:MN,Ya=class HC{constructor(){this.fg=0,this.bg=0,this.extended=new UC}static toColorRGB(n){return[n>>>16&255,n>>>8&255,n&255]}static fromColorRGB(n){return(n[0]&255)<<16|(n[1]&255)<<8|n[2]&255}clone(){let n=new HC;return n.fg=this.fg,n.bg=this.bg,n.extended=this.extended.clone(),n}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},UC=class FC{constructor(n=0,r=0){this._ext=0,this._urlId=0,this._ext=n,this._urlId=r}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(n){this._ext=n}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(n){this._ext&=-469762049,this._ext|=n<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(n){this._ext&=-67108864,this._ext|=n&67108863}get urlId(){return this._urlId}set urlId(n){this._urlId=n}get underlineVariantOffset(){let n=(this._ext&3758096384)>>29;return n<0?n^4294967288:n}set underlineVariantOffset(n){this._ext&=536870911,this._ext|=n<<29&3758096384}clone(){return new FC(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},NN=globalThis.performance&&typeof globalThis.performance.now=="function",BN=class qC{static create(n){return new qC(n)}constructor(n){this._now=NN&&n===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},Nr;(e=>{e.None=()=>qi.None;function n(G,I){return g(G,()=>{},0,void 0,!0,void 0,I)}e.defer=n;function r(G){return(I,K=null,te)=>{let q=!1,W;return W=G(Y=>{if(!q)return W?W.dispose():q=!0,I.call(K,Y)},null,te),q&&W.dispose(),W}}e.once=r;function a(G,I,K){return h((te,q=null,W)=>G(Y=>te.call(q,I(Y)),null,W),K)}e.map=a;function l(G,I,K){return h((te,q=null,W)=>G(Y=>{I(Y),te.call(q,Y)},null,W),K)}e.forEach=l;function p(G,I,K){return h((te,q=null,W)=>G(Y=>I(Y)&&te.call(q,Y),null,W),K)}e.filter=p;function m(G){return G}e.signal=m;function c(...G){return(I,K=null,te)=>{let q=DC(...G.map(W=>W(Y=>I.call(K,Y))));return y(q,te)}}e.any=c;function u(G,I,K,te){let q=K;return a(G,W=>(q=I(q,W),q),te)}e.reduce=u;function h(G,I){let K,te={onWillAddFirstListener(){K=G(q.fire,q)},onDidRemoveLastListener(){K?.dispose()}},q=new Dt(te);return I?.add(q),q.event}function y(G,I){return I instanceof Array?I.push(G):I&&I.add(G),G}function g(G,I,K=100,te=!1,q=!1,W,Y){let B,$,N,P=0,Z,ae={leakWarningThreshold:W,onWillAddFirstListener(){B=G(_e=>{P++,$=I($,_e),te&&!N&&(ce.fire($),$=void 0),Z=()=>{let Q=$;$=void 0,N=void 0,(!te||P>1)&&ce.fire(Q),P=0},typeof K=="number"?(clearTimeout(N),N=setTimeout(Z,K)):N===void 0&&(N=0,queueMicrotask(Z))})},onWillRemoveListener(){q&&P>0&&Z?.()},onDidRemoveLastListener(){Z=void 0,B.dispose()}},ce=new Dt(ae);return Y?.add(ce),ce.event}e.debounce=g;function C(G,I=0,K){return e.debounce(G,(te,q)=>te?(te.push(q),te):[q],I,void 0,!0,void 0,K)}e.accumulate=C;function T(G,I=(te,q)=>te===q,K){let te=!0,q;return p(G,W=>{let Y=te||!I(W,q);return te=!1,q=W,Y},K)}e.latch=T;function A(G,I,K){return[e.filter(G,I,K),e.filter(G,te=>!I(te),K)]}e.split=A;function x(G,I=!1,K=[],te){let q=K.slice(),W=G($=>{q?q.push($):B.fire($)});te&&te.add(W);let Y=()=>{q?.forEach($=>B.fire($)),q=null},B=new Dt({onWillAddFirstListener(){W||(W=G($=>B.fire($)),te&&te.add(W))},onDidAddFirstListener(){q&&(I?setTimeout(Y):Y())},onDidRemoveLastListener(){W&&W.dispose(),W=null}});return te&&te.add(B),B.event}e.buffer=x;function d(G,I){return(K,te,q)=>{let W=I(new f);return G(function(Y){let B=W.evaluate(Y);B!==v&&K.call(te,B)},void 0,q)}}e.chain=d;let v=Symbol("HaltChainable");class f{constructor(){this.steps=[]}map(I){return this.steps.push(I),this}forEach(I){return this.steps.push(K=>(I(K),K)),this}filter(I){return this.steps.push(K=>I(K)?K:v),this}reduce(I,K){let te=K;return this.steps.push(q=>(te=I(te,q),te)),this}latch(I=(K,te)=>K===te){let K=!0,te;return this.steps.push(q=>{let W=K||!I(q,te);return K=!1,te=q,W?q:v}),this}evaluate(I){for(let K of this.steps)if(I=K(I),I===v)break;return I}}function b(G,I,K=te=>te){let te=(...B)=>Y.fire(K(...B)),q=()=>G.on(I,te),W=()=>G.removeListener(I,te),Y=new Dt({onWillAddFirstListener:q,onDidRemoveLastListener:W});return Y.event}e.fromNodeEventEmitter=b;function E(G,I,K=te=>te){let te=(...B)=>Y.fire(K(...B)),q=()=>G.addEventListener(I,te),W=()=>G.removeEventListener(I,te),Y=new Dt({onWillAddFirstListener:q,onDidRemoveLastListener:W});return Y.event}e.fromDOMEventEmitter=E;function L(G){return new Promise(I=>r(G)(I))}e.toPromise=L;function R(G){let I=new Dt;return G.then(K=>{I.fire(K)},()=>{I.fire(void 0)}).finally(()=>{I.dispose()}),I.event}e.fromPromise=R;function M(G,I){return G(K=>I.fire(K))}e.forward=M;function k(G,I,K){return I(K),G(te=>I(te))}e.runAndSubscribe=k;class O{constructor(I,K){this._observable=I,this._counter=0,this._hasChanged=!1;let te={onWillAddFirstListener:()=>{I.addObserver(this)},onDidRemoveLastListener:()=>{I.removeObserver(this)}};this.emitter=new Dt(te),K&&K.add(this.emitter)}beginUpdate(I){this._counter++}handlePossibleChange(I){}handleChange(I,K){this._hasChanged=!0}endUpdate(I){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function U(G,I){return new O(G,I).emitter.event}e.fromObservable=U;function F(G){return(I,K,te)=>{let q=0,W=!1,Y={beginUpdate(){q++},endUpdate(){q--,q===0&&(G.reportChanges(),W&&(W=!1,I.call(K)))},handlePossibleChange(){},handleChange(){W=!0}};G.addObserver(Y),G.reportChanges();let B={dispose(){G.removeObserver(Y)}};return te instanceof no?te.add(B):Array.isArray(te)&&te.push(B),B}}e.fromObservableLight=F})(Nr||={});var pg=class gg{constructor(n){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${n}_${gg._idPool++}`,gg.all.add(this)}start(n){this._stopWatch=new BN,this.listenerCount=n}stop(){if(this._stopWatch){let n=this._stopWatch.elapsed();this.durations.push(n),this.elapsedOverall+=n,this.invocationCount+=1,this._stopWatch=void 0}}};pg.all=new Set,pg._idPool=0;var IN=pg,jN=-1,WC=class GC{constructor(n,r,a=(GC._idPool++).toString(16).padStart(3,"0")){this._errorHandler=n,this.threshold=r,this.name=a,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(n,r){let a=this.threshold;if(a<=0||r<a)return;this._stacks||(this._stacks=new Map);let l=this._stacks.get(n.value)||0;if(this._stacks.set(n.value,l+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=a*.5;let[p,m]=this.getMostFrequentStack(),c=`[${this.name}] potential listener LEAK detected, having ${r} listeners already. MOST frequent listener (${m}):`;console.warn(c),console.warn(p);let u=new PN(c,p);this._errorHandler(u)}return()=>{let p=this._stacks.get(n.value)||0;this._stacks.set(n.value,p-1)}}getMostFrequentStack(){if(!this._stacks)return;let n,r=0;for(let[a,l]of this._stacks)(!n||r<l)&&(n=[a,l],r=l);return n}};WC._idPool=1;var $N=WC,zN=class KC{constructor(n){this.value=n}static create(){let n=new Error;return new KC(n.stack??"")}print(){console.warn(this.value.split(`
710
- `).slice(2).join(`
711
- `))}},PN=class extends Error{constructor(e,n){super(e),this.name="ListenerLeakError",this.stack=n}},HN=class extends Error{constructor(e,n){super(e),this.name="ListenerRefusalError",this.stack=n}},UN=0,np=class{constructor(e){this.value=e,this.id=UN++}},FN=2,qN,Dt=class{constructor(e){this._size=0,this._options=e,this._leakageMon=this._options?.leakWarningThreshold?new $N(e?.onListenerError??ep,this._options?.leakWarningThreshold??jN):void 0,this._perfMon=this._options?._profName?new IN(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,n,r)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let m=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(m);let c=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],u=new HN(`${m}. HINT: Stack shows most frequent listener (${c[1]}-times)`,c[0]);return(this._options?.onListenerError||ep)(u),qi.None}if(this._disposed)return qi.None;n&&(e=e.bind(n));let a=new np(e),l;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(a.stack=zN.create(),l=this._leakageMon.check(a.stack,this._size+1)),this._listeners?this._listeners instanceof np?(this._deliveryQueue??=new WN,this._listeners=[this._listeners,a]):this._listeners.push(a):(this._options?.onWillAddFirstListener?.(this),this._listeners=a,this._options?.onDidAddFirstListener?.(this)),this._size++;let p=Nn(()=>{l?.(),this._removeListener(a)});return r instanceof no?r.add(p):Array.isArray(r)&&r.push(p),p},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let n=this._listeners,r=n.indexOf(e);if(r===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,n[r]=void 0;let a=this._deliveryQueue.current===this;if(this._size*FN<=n.length){let l=0;for(let p=0;p<n.length;p++)n[p]?n[l++]=n[p]:a&&(this._deliveryQueue.end--,l<this._deliveryQueue.i&&this._deliveryQueue.i--);n.length=l}}_deliver(e,n){if(!e)return;let r=this._options?.onListenerError||ep;if(!r){e.value(n);return}try{e.value(n)}catch(a){r(a)}}_deliverQueue(e){let n=e.current._listeners;for(;e.i<e.end;)this._deliver(n[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof np)this._deliver(this._listeners,e);else{let n=this._deliveryQueue;n.enqueue(this,e,this._listeners.length),this._deliverQueue(n)}this._perfMon?.stop()}hasListeners(){return this._size>0}},WN=class{constructor(){this.i=-1,this.end=0}enqueue(e,n,r){this.i=0,this.end=r,this.current=e,this.value=n}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},X1={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}},bl=2,yl,ps=class Ga{constructor(n,r,a){this._document=n,this._config=r,this._unicodeService=a,this._didWarmUp=!1,this._cacheMap=new Y1,this._cacheMapCombined=new Y1,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new Ya,this._textureSize=512,this._onAddTextureAtlasCanvas=new Dt,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new Dt,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=VC(n,this._config.deviceCellWidth*4+bl*2,this._config.deviceCellHeight+bl*2),this._tmpCtx=hn(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}get pages(){return this._pages}dispose(){this._tmpCanvas.remove();for(let n of this.pages)n.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){let n=new ON;for(let r=33;r<126;r++)n.enqueue(()=>{if(!this._cacheMap.get(r,0,0,0)){let a=this._drawToCache(r,0,0,0,!1,void 0);this._cacheMap.set(r,0,0,0,a)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(!(this._pages[0].currentRow.x===0&&this._pages[0].currentRow.y===0)){for(let n of this._pages)n.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(Ga.maxAtlasPages&&this._pages.length>=Math.max(4,Ga.maxAtlasPages)){let r=this._pages.filter(h=>h.canvas.width*2<=(Ga.maxTextureSize||4096)).sort((h,y)=>y.canvas.width!==h.canvas.width?y.canvas.width-h.canvas.width:y.percentageUsed-h.percentageUsed),a=-1,l=0;for(let h=0;h<r.length;h++)if(r[h].canvas.width!==l)a=h,l=r[h].canvas.width;else if(h-a===3)break;let p=r.slice(a,a+4),m=p.map(h=>h.glyphs[0].texturePage).sort((h,y)=>h>y?1:-1),c=this.pages.length-p.length,u=this._mergePages(p,c);u.version++;for(let h=m.length-1;h>=0;h--)this._deletePage(m[h]);this.pages.push(u),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(u.canvas)}let n=new ip(this._document,this._textureSize);return this._pages.push(n),this._activePages.push(n),this._onAddTextureAtlasCanvas.fire(n.canvas),n}_mergePages(n,r){let a=n[0].canvas.width*2,l=new ip(this._document,a,n);for(let[p,m]of n.entries()){let c=p*m.canvas.width%a,u=Math.floor(p/2)*m.canvas.height;l.ctx.drawImage(m.canvas,c,u);for(let y of m.glyphs)y.texturePage=r,y.sizeClipSpace.x=y.size.x/a,y.sizeClipSpace.y=y.size.y/a,y.texturePosition.x+=c,y.texturePosition.y+=u,y.texturePositionClipSpace.x=y.texturePosition.x/a,y.texturePositionClipSpace.y=y.texturePosition.y/a;this._onRemoveTextureAtlasCanvas.fire(m.canvas);let h=this._activePages.indexOf(m);h!==-1&&this._activePages.splice(h,1)}return l}_deletePage(n){this._pages.splice(n,1);for(let r=n;r<this._pages.length;r++){let a=this._pages[r];for(let l of a.glyphs)l.texturePage--;a.version++}}getRasterizedGlyphCombinedChar(n,r,a,l,p,m){return this._getFromCacheMap(this._cacheMapCombined,n,r,a,l,p,m)}getRasterizedGlyph(n,r,a,l,p,m){return this._getFromCacheMap(this._cacheMap,n,r,a,l,p,m)}_getFromCacheMap(n,r,a,l,p,m,c){return yl=n.get(r,a,l,p),yl||(yl=this._drawToCache(r,a,l,p,m,c),n.set(r,a,l,p,yl)),yl}_getColorFromAnsiIndex(n){if(n>=this._config.colors.ansi.length)throw new Error("No color found for idx "+n);return this._config.colors.ansi[n]}_getBackgroundColor(n,r,a,l){if(this._config.allowTransparency)return Ei;let p;switch(n){case 16777216:case 33554432:p=this._getColorFromAnsiIndex(r);break;case 50331648:let m=Ya.toColorRGB(r);p=$n.toColor(m[0],m[1],m[2]);break;default:a?p=Tl.opaque(this._config.colors.foreground):p=this._config.colors.background;break}return this._config.allowTransparency||(p=Tl.opaque(p)),p}_getForegroundColor(n,r,a,l,p,m,c,u,h,y){let g=this._getMinimumContrastColor(n,r,a,l,p,m,c,h,u,y);if(g)return g;let C;switch(p){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&h&&m<8&&(m+=8),C=this._getColorFromAnsiIndex(m);break;case 50331648:let T=Ya.toColorRGB(m);C=$n.toColor(T[0],T[1],T[2]);break;default:c?C=this._config.colors.background:C=this._config.colors.foreground}return this._config.allowTransparency&&(C=Tl.opaque(C)),u&&(C=Tl.multiplyOpacity(C,wN)),C}_resolveBackgroundRgba(n,r,a){switch(n){case 16777216:case 33554432:return this._getColorFromAnsiIndex(r).rgba;case 50331648:return r<<8;default:return a?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(n,r,a,l){switch(n){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&l&&r<8&&(r+=8),this._getColorFromAnsiIndex(r).rgba;case 50331648:return r<<8;default:return a?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(n,r,a,l,p,m,c,u,h,y){if(this._config.minimumContrastRatio===1||y)return;let g=this._getContrastCache(h),C=g.getColor(n,l);if(C!==void 0)return C||void 0;let T=this._resolveBackgroundRgba(r,a,c),A=this._resolveForegroundRgba(p,m,c,u),x=Ys.ensureContrastRatio(T,A,this._config.minimumContrastRatio/(h?2:1));if(!x){g.setColor(n,l,null);return}let d=$n.toColor(x>>24&255,x>>16&255,x>>8&255);return g.setColor(n,l,d),d}_getContrastCache(n){return n?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(n,r,a,l,p,m){let c=typeof n=="number"?String.fromCharCode(n):n;m&&this._tmpCanvas.parentElement!==m&&(this._tmpCanvas.style.display="none",m.append(this._tmpCanvas));let u=Math.min(this._config.deviceCellWidth*Math.max(c.length,2)+bl*2,this._config.deviceMaxTextureSize);this._tmpCanvas.width<u&&(this._tmpCanvas.width=u);let h=Math.min(this._config.deviceCellHeight+bl*4,this._textureSize);if(this._tmpCanvas.height<h&&(this._tmpCanvas.height=h),this._tmpCtx.save(),this._workAttributeData.fg=a,this._workAttributeData.bg=r,this._workAttributeData.extended.ext=l,!!this._workAttributeData.isInvisible())return X1;let y=!!this._workAttributeData.isBold(),g=!!this._workAttributeData.isInverse(),C=!!this._workAttributeData.isDim(),T=!!this._workAttributeData.isItalic(),A=!!this._workAttributeData.isUnderline(),x=!!this._workAttributeData.isStrikethrough(),d=!!this._workAttributeData.isOverline(),v=this._workAttributeData.getFgColor(),f=this._workAttributeData.getFgColorMode(),b=this._workAttributeData.getBgColor(),E=this._workAttributeData.getBgColorMode();if(g){let $=v;v=b,b=$;let N=f;f=E,E=N}let L=this._getBackgroundColor(E,b,g,C);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=L.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";let R=y?this._config.fontWeightBold:this._config.fontWeight,M=T?"italic":"";this._tmpCtx.font=`${M} ${R} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=jC;let k=c.length===1&&om(c.charCodeAt(0)),O=c.length===1&&pN(c.charCodeAt(0)),U=this._getForegroundColor(r,E,b,a,f,v,g,C,y,IC(c.charCodeAt(0)));this._tmpCtx.fillStyle=U.css;let F=O?0:bl*2,G=!1;this._config.customGlyphs!==!1&&(G=TN(this._tmpCtx,c,F,F,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let I=!k,K;if(typeof n=="number"?K=this._unicodeService.wcwidth(n):K=this._unicodeService.getStringCellWidth(n),A){this._tmpCtx.save();let $=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),N=$%2===1?.5:0;if(this._tmpCtx.lineWidth=$,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())I=!1,this._tmpCtx.strokeStyle=`rgb(${Ya.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{I=!1;let Q=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&Q<8&&(Q+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(Q).css}this._tmpCtx.beginPath();let P=F,Z=Math.ceil(F+this._config.deviceCharHeight)-N-(p?$*2:0),ae=Z+$,ce=Z+$*2,_e=this._workAttributeData.getUnderlineVariantOffset();for(let Q=0;Q<K;Q++){this._tmpCtx.save();let z=P+Q*this._config.deviceCellWidth,oe=P+(Q+1)*this._config.deviceCellWidth,ge=z+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(z,Z),this._tmpCtx.lineTo(oe,Z),this._tmpCtx.moveTo(z,ce),this._tmpCtx.lineTo(oe,ce);break;case 3:let Se=$<=1?ce:Math.ceil(F+this._config.deviceCharHeight-$/2)-N,ye=$<=1?Z:Math.ceil(F+this._config.deviceCharHeight+$/2)-N,Pe=new Path2D;Pe.rect(z,Z,this._config.deviceCellWidth,ce-Z),this._tmpCtx.clip(Pe),this._tmpCtx.moveTo(z-this._config.deviceCellWidth/2,ae),this._tmpCtx.bezierCurveTo(z-this._config.deviceCellWidth/2,ye,z,ye,z,ae),this._tmpCtx.bezierCurveTo(z,Se,ge,Se,ge,ae),this._tmpCtx.bezierCurveTo(ge,ye,oe,ye,oe,ae),this._tmpCtx.bezierCurveTo(oe,Se,oe+this._config.deviceCellWidth/2,Se,oe+this._config.deviceCellWidth/2,ae);break;case 4:let qe=_e===0?0:_e>=$?$*2-_e:$-_e;_e>=$||qe===0?(this._tmpCtx.setLineDash([Math.round($),Math.round($)]),this._tmpCtx.moveTo(z+qe,Z),this._tmpCtx.lineTo(oe,Z)):(this._tmpCtx.setLineDash([Math.round($),Math.round($)]),this._tmpCtx.moveTo(z,Z),this._tmpCtx.lineTo(z+qe,Z),this._tmpCtx.moveTo(z+qe+$,Z),this._tmpCtx.lineTo(oe,Z)),_e=yN(oe-z,$,_e);break;case 5:let Xe=.6,xt=.3,Ne=oe-z,en=Math.floor(Xe*Ne),bn=Math.floor(xt*Ne),yn=Ne-en-bn;this._tmpCtx.setLineDash([en,bn,yn]),this._tmpCtx.moveTo(z,Z),this._tmpCtx.lineTo(oe,Z);break;default:this._tmpCtx.moveTo(z,Z),this._tmpCtx.lineTo(oe,Z);break}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!G&&this._config.fontSize>=12&&!this._config.allowTransparency&&c!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";let Q=this._tmpCtx.measureText(c);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in Q&&Q.actualBoundingBoxDescent>0){this._tmpCtx.save();let z=new Path2D;z.rect(P,Z-Math.ceil($/2),this._config.deviceCellWidth*K,ce-Z+Math.ceil($/2)),this._tmpCtx.clip(z),this._tmpCtx.lineWidth=this._config.devicePixelRatio*3,this._tmpCtx.strokeStyle=L.css,this._tmpCtx.strokeText(c,F,F+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(d){let $=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),N=$%2===1?.5:0;this._tmpCtx.lineWidth=$,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(F,F+N),this._tmpCtx.lineTo(F+this._config.deviceCharWidth*K,F+N),this._tmpCtx.stroke()}if(G||this._tmpCtx.fillText(c,F,F+this._config.deviceCharHeight),c==="_"&&!this._config.allowTransparency){let $=rp(this._tmpCtx.getImageData(F,F,this._config.deviceCellWidth,this._config.deviceCellHeight),L,U,I);if($)for(let N=1;N<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=L.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(c,F,F+this._config.deviceCharHeight-N),$=rp(this._tmpCtx.getImageData(F,F,this._config.deviceCellWidth,this._config.deviceCellHeight),L,U,I),!!$);N++);}if(x){let $=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),N=this._tmpCtx.lineWidth%2===1?.5:0;this._tmpCtx.lineWidth=$,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(F,F+Math.floor(this._config.deviceCharHeight/2)-N),this._tmpCtx.lineTo(F+this._config.deviceCharWidth*K,F+Math.floor(this._config.deviceCharHeight/2)-N),this._tmpCtx.stroke()}this._tmpCtx.restore();let te=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height),q;if(this._config.allowTransparency?q=GN(te):q=rp(te,L,U,I),q)return X1;let W=this._findGlyphBoundingBox(te,this._workBoundingBox,u,O,G,F),Y,B;for(;;){if(this._activePages.length===0){let $=this._createNewPage();Y=$,B=$.currentRow,B.height=W.size.y;break}Y=this._activePages[this._activePages.length-1],B=Y.currentRow;for(let $ of this._activePages)W.size.y<=$.currentRow.height&&(Y=$,B=$.currentRow);for(let $=this._activePages.length-1;$>=0;$--)for(let N of this._activePages[$].fixedRows)N.height<=B.height&&W.size.y<=N.height&&(Y=this._activePages[$],B=N);if(W.size.x>this._textureSize){this._overflowSizePage||(this._overflowSizePage=new ip(this._document,this._config.deviceMaxTextureSize),this.pages.push(this._overflowSizePage),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(this._overflowSizePage.canvas)),Y=this._overflowSizePage,B=this._overflowSizePage.currentRow,B.x+W.size.x>=Y.canvas.width&&(B.x=0,B.y+=B.height,B.height=0);break}if(B.y+W.size.y>=Y.canvas.height||B.height>W.size.y+2){let $=!1;if(Y.currentRow.y+Y.currentRow.height+W.size.y>=Y.canvas.height){let N;for(let P of this._activePages)if(P.currentRow.y+P.currentRow.height+W.size.y<P.canvas.height){N=P;break}if(N)Y=N;else if(Ga.maxAtlasPages&&this._pages.length>=Ga.maxAtlasPages&&B.y+W.size.y<=Y.canvas.height&&B.height>=W.size.y&&B.x+W.size.x<=Y.canvas.width)$=!0;else{let P=this._createNewPage();Y=P,B=P.currentRow,B.height=W.size.y,$=!0}}$||(Y.currentRow.height>0&&Y.fixedRows.push(Y.currentRow),B={x:0,y:Y.currentRow.y+Y.currentRow.height,height:W.size.y},Y.fixedRows.push(B),Y.currentRow={x:0,y:B.y+B.height,height:0})}if(B.x+W.size.x<=Y.canvas.width)break;B===Y.currentRow?(B.x=0,B.y+=B.height,B.height=0):Y.fixedRows.splice(Y.fixedRows.indexOf(B),1)}return W.texturePage=this._pages.indexOf(Y),W.texturePosition.x=B.x,W.texturePosition.y=B.y,W.texturePositionClipSpace.x=B.x/Y.canvas.width,W.texturePositionClipSpace.y=B.y/Y.canvas.height,W.sizeClipSpace.x/=Y.canvas.width,W.sizeClipSpace.y/=Y.canvas.height,B.height=Math.max(B.height,W.size.y),B.x+=W.size.x,Y.ctx.putImageData(te,W.texturePosition.x-this._workBoundingBox.left,W.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,W.size.x,W.size.y),Y.addGlyph(W),Y.version++,W}_findGlyphBoundingBox(n,r,a,l,p,m){r.top=0;let c=l?this._config.deviceCellHeight:this._tmpCanvas.height,u=l?this._config.deviceCellWidth:a,h=!1;for(let y=0;y<c;y++){for(let g=0;g<u;g++){let C=y*this._tmpCanvas.width*4+g*4+3;if(n.data[C]!==0){r.top=y,h=!0;break}}if(h)break}r.left=0,h=!1;for(let y=0;y<m+u;y++){for(let g=0;g<c;g++){let C=g*this._tmpCanvas.width*4+y*4+3;if(n.data[C]!==0){r.left=y,h=!0;break}}if(h)break}r.right=u,h=!1;for(let y=m+u-1;y>=m;y--){for(let g=0;g<c;g++){let C=g*this._tmpCanvas.width*4+y*4+3;if(n.data[C]!==0){r.right=y,h=!0;break}}if(h)break}r.bottom=c,h=!1;for(let y=c-1;y>=0;y--){for(let g=0;g<u;g++){let C=y*this._tmpCanvas.width*4+g*4+3;if(n.data[C]!==0){r.bottom=y,h=!0;break}}if(h)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:r.right-r.left+1,y:r.bottom-r.top+1},sizeClipSpace:{x:r.right-r.left+1,y:r.bottom-r.top+1},offset:{x:-r.left+m+(l||p?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-r.top+m+(l||p?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}},ip=class{constructor(e,n,r){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],r)for(let a of r)this._glyphs.push(...a.glyphs),this._usedPixels+=a._usedPixels;this.canvas=VC(e,n,n),this.ctx=hn(this.canvas.getContext("2d",{alpha:!0}))}get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(e){this._glyphs.push(e),this._usedPixels+=e.size.x*e.size.y}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}};function rp(e,n,r,a){let l=n.rgba>>>24,p=n.rgba>>>16&255,m=n.rgba>>>8&255,c=r.rgba>>>24,u=r.rgba>>>16&255,h=r.rgba>>>8&255,y=Math.floor((Math.abs(l-c)+Math.abs(p-u)+Math.abs(m-h))/12),g=!0;for(let C=0;C<e.data.length;C+=4)e.data[C]===l&&e.data[C+1]===p&&e.data[C+2]===m||a&&Math.abs(e.data[C]-l)+Math.abs(e.data[C+1]-p)+Math.abs(e.data[C+2]-m)<y?e.data[C+3]=0:g=!1;return g}function GN(e){for(let n=0;n<e.data.length;n+=4)if(e.data[n+3]>0)return!1;return!0}function VC(e,n,r){let a=e.createElement("canvas");return a.width=n,a.height=r,a}function KN(e,n,r,a,l,p,m,c){let u={foreground:p.foreground,background:p.background,cursor:Ei,cursorAccent:Ei,selectionForeground:Ei,selectionBackgroundTransparent:Ei,selectionBackgroundOpaque:Ei,selectionInactiveBackgroundTransparent:Ei,selectionInactiveBackgroundOpaque:Ei,overviewRulerBorder:Ei,scrollbarSliderBackground:Ei,scrollbarSliderHoverBackground:Ei,scrollbarSliderActiveBackground:Ei,ansi:p.ansi.slice(),contrastCache:p.contrastCache,halfContrastCache:p.halfContrastCache};return{customGlyphs:l.customGlyphs,devicePixelRatio:m,deviceMaxTextureSize:c,letterSpacing:l.letterSpacing,lineHeight:l.lineHeight,deviceCellWidth:e,deviceCellHeight:n,deviceCharWidth:r,deviceCharHeight:a,fontFamily:l.fontFamily,fontSize:l.fontSize,fontWeight:l.fontWeight,fontWeightBold:l.fontWeightBold,allowTransparency:l.allowTransparency,drawBoldTextInBrightColors:l.drawBoldTextInBrightColors,minimumContrastRatio:l.minimumContrastRatio,colors:u}}function Z1(e,n){for(let r=0;r<e.colors.ansi.length;r++)if(e.colors.ansi[r].rgba!==n.colors.ansi[r].rgba)return!1;return e.devicePixelRatio===n.devicePixelRatio&&e.customGlyphs===n.customGlyphs&&e.lineHeight===n.lineHeight&&e.letterSpacing===n.letterSpacing&&e.fontFamily===n.fontFamily&&e.fontSize===n.fontSize&&e.fontWeight===n.fontWeight&&e.fontWeightBold===n.fontWeightBold&&e.allowTransparency===n.allowTransparency&&e.deviceCharWidth===n.deviceCharWidth&&e.deviceCharHeight===n.deviceCharHeight&&e.drawBoldTextInBrightColors===n.drawBoldTextInBrightColors&&e.minimumContrastRatio===n.minimumContrastRatio&&e.colors.foreground.rgba===n.colors.foreground.rgba&&e.colors.background.rgba===n.colors.background.rgba}function VN(e){return(e&50331648)===16777216||(e&50331648)===33554432}var ki=[];function YC(e,n,r,a,l,p,m,c,u){let h=KN(a,l,p,m,n,r,c,u);for(let C=0;C<ki.length;C++){let T=ki[C],A=T.ownedBy.indexOf(e);if(A>=0){if(Z1(T.config,h))return T.atlas;T.ownedBy.length===1?(T.atlas.dispose(),ki.splice(C,1)):T.ownedBy.splice(A,1);break}}for(let C=0;C<ki.length;C++){let T=ki[C];if(Z1(T.config,h))return T.ownedBy.push(e),T.atlas}let y=e._core,g={atlas:new ps(document,h,y.unicodeService),config:h,ownedBy:[e]};return ki.push(g),g.atlas}function J1(e){for(let n=0;n<ki.length;n++){let r=ki[n].ownedBy.indexOf(e);if(r!==-1){ki[n].ownedBy.length===1?(ki[n].atlas.dispose(),ki.splice(n,1)):ki[n].ownedBy.splice(r,1);break}}}var Su=600,YN=class{constructor(e,n){this._renderCallback=e,this._coreBrowserService=n,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})))}_restartInterval(e=Su){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){let n=Su-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,n>0){this._restartInterval(n);return}}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){let n=Su-(Date.now()-this._animationTimeRestarted);this._animationTimeRestarted=void 0,this._restartInterval(n);return}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},Su)},e)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}};function Q1(e,n,r){let a=new n.ResizeObserver(l=>{let p=l.find(u=>u.target===e);if(!p)return;if(!("devicePixelContentBoxSize"in p)){a?.disconnect(),a=void 0;return}let m=p.devicePixelContentBoxSize[0].inlineSize,c=p.devicePixelContentBoxSize[0].blockSize;m>0&&c>0&&r(m,c)});try{a.observe(e,{box:["device-pixel-content-box"]})}catch{a.disconnect(),a=void 0}return Nn(()=>a?.disconnect())}function XN(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}var ey=class XC extends Ya{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new UC,this.combinedData=""}static fromCharData(n){let r=new XC;return r.setFromCharData(n),r}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?XN(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(n){this.fg=n[0],this.bg=0;let r=!1;if(n[1].length>2)r=!0;else if(n[1].length===2){let a=n[1].charCodeAt(0);if(55296<=a&&a<=56319){let l=n[1].charCodeAt(1);56320<=l&&l<=57343?this.content=(a-55296)*1024+l-56320+65536|n[2]<<22:r=!0}else r=!0}else this.content=n[1].charCodeAt(0)|n[2]<<22;r&&(this.combinedData=n[1],this.content=2097152|n[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},ZC=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]);function JC(e,n,r){let a=hn(e.createProgram());if(e.attachShader(a,hn(ty(e,e.VERTEX_SHADER,n))),e.attachShader(a,hn(ty(e,e.FRAGMENT_SHADER,r))),e.linkProgram(a),e.getProgramParameter(a,e.LINK_STATUS))return a;console.error(e.getProgramInfoLog(a)),e.deleteProgram(a)}function ty(e,n,r){let a=hn(e.createShader(n));if(e.shaderSource(a,r),e.compileShader(a),e.getShaderParameter(a,e.COMPILE_STATUS))return a;console.error(e.getShaderInfoLog(a)),e.deleteShader(a)}function ZN(e,n){let r=Math.min(e.length*2,n),a=new Float32Array(r);for(let l=0;l<e.length;l++)a[l]=e[l];return a}var JN=class{constructor(e){this.texture=e,this.version=-1}},QN=`#version 300 es
712
- layout (location = 0) in vec2 a_unitquad;
713
- layout (location = 1) in vec2 a_cellpos;
714
- layout (location = 2) in vec2 a_offset;
715
- layout (location = 3) in vec2 a_size;
716
- layout (location = 4) in float a_texpage;
717
- layout (location = 5) in vec2 a_texcoord;
718
- layout (location = 6) in vec2 a_texsize;
719
-
720
- uniform mat4 u_projection;
721
- uniform vec2 u_resolution;
722
-
723
- out vec2 v_texcoord;
724
- flat out int v_texpage;
725
-
726
- void main() {
727
- vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
728
- gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
729
- v_texpage = int(a_texpage);
730
- v_texcoord = a_texcoord + a_unitquad * a_texsize;
731
- }`;function e8(e){let n="";for(let r=1;r<e;r++)n+=` else if (v_texpage == ${r}) { outColor = texture(u_texture[${r}], v_texcoord); }`;return`#version 300 es
732
- precision lowp float;
733
-
734
- in vec2 v_texcoord;
735
- flat in int v_texpage;
736
-
737
- uniform sampler2D u_texture[${e}];
738
-
739
- out vec4 outColor;
740
-
741
- void main() {
742
- if (v_texpage == 0) {
743
- outColor = texture(u_texture[0], v_texcoord);
744
- } ${n}
745
- }`}var gs=11,Ua=gs*Float32Array.BYTES_PER_ELEMENT,t8=2,Wt=0,Mt,sp=0,Sl=0,n8=class extends qi{constructor(e,n,r,a){super(),this._terminal=e,this._gl=n,this._dimensions=r,this._optionsService=a,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};let l=this._gl;ps.maxAtlasPages===void 0&&(ps.maxAtlasPages=Math.min(32,hn(l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS))),ps.maxTextureSize=hn(l.getParameter(l.MAX_TEXTURE_SIZE))),this._program=hn(JC(l,QN,e8(ps.maxAtlasPages))),this._register(Nn(()=>l.deleteProgram(this._program))),this._projectionLocation=hn(l.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=hn(l.getUniformLocation(this._program,"u_resolution")),this._textureLocation=hn(l.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=l.createVertexArray(),l.bindVertexArray(this._vertexArrayObject);let p=new Float32Array([0,0,1,0,0,1,1,1]),m=l.createBuffer();this._register(Nn(()=>l.deleteBuffer(m))),l.bindBuffer(l.ARRAY_BUFFER,m),l.bufferData(l.ARRAY_BUFFER,p,l.STATIC_DRAW),l.enableVertexAttribArray(0),l.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);let c=new Uint8Array([0,1,2,3]),u=l.createBuffer();this._register(Nn(()=>l.deleteBuffer(u))),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,u),l.bufferData(l.ELEMENT_ARRAY_BUFFER,c,l.STATIC_DRAW),this._attributesBuffer=hn(l.createBuffer()),this._register(Nn(()=>l.deleteBuffer(this._attributesBuffer))),l.bindBuffer(l.ARRAY_BUFFER,this._attributesBuffer),l.enableVertexAttribArray(2),l.vertexAttribPointer(2,2,l.FLOAT,!1,Ua,0),l.vertexAttribDivisor(2,1),l.enableVertexAttribArray(3),l.vertexAttribPointer(3,2,l.FLOAT,!1,Ua,2*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(3,1),l.enableVertexAttribArray(4),l.vertexAttribPointer(4,1,l.FLOAT,!1,Ua,4*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(4,1),l.enableVertexAttribArray(5),l.vertexAttribPointer(5,2,l.FLOAT,!1,Ua,5*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(5,1),l.enableVertexAttribArray(6),l.vertexAttribPointer(6,2,l.FLOAT,!1,Ua,7*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(6,1),l.enableVertexAttribArray(1),l.vertexAttribPointer(1,2,l.FLOAT,!1,Ua,9*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(1,1),l.useProgram(this._program);let h=new Int32Array(ps.maxAtlasPages);for(let y=0;y<ps.maxAtlasPages;y++)h[y]=y;l.uniform1iv(this._textureLocation,h),l.uniformMatrix4fv(this._projectionLocation,!1,ZC),this._atlasTextures=[];for(let y=0;y<ps.maxAtlasPages;y++){let g=new JN(hn(l.createTexture()));this._register(Nn(()=>l.deleteTexture(g.texture))),l.activeTexture(l.TEXTURE0+y),l.bindTexture(l.TEXTURE_2D,g.texture),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE),l.texImage2D(l.TEXTURE_2D,0,l.RGBA,1,1,0,l.RGBA,l.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[y]=g}l.enable(l.BLEND),l.blendFunc(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return this._atlas?this._atlas.beginFrame():!0}updateCell(e,n,r,a,l,p,m,c,u){this._updateCell(this._vertices.attributes,e,n,r,a,l,p,m,c,u)}_updateCell(e,n,r,a,l,p,m,c,u,h){if(Wt=(r*this._terminal.cols+n)*gs,a===0||a===void 0){e.fill(0,Wt,Wt+gs-1-t8);return}this._atlas&&(c&&c.length>1?Mt=this._atlas.getRasterizedGlyphCombinedChar(c,l,p,m,!1,this._terminal.element):Mt=this._atlas.getRasterizedGlyph(a,l,p,m,!1,this._terminal.element),sp=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),l!==h&&Mt.offset.x>sp?(Sl=Mt.offset.x-sp,e[Wt]=-(Mt.offset.x-Sl)+this._dimensions.device.char.left,e[Wt+1]=-Mt.offset.y+this._dimensions.device.char.top,e[Wt+2]=(Mt.size.x-Sl)/this._dimensions.device.canvas.width,e[Wt+3]=Mt.size.y/this._dimensions.device.canvas.height,e[Wt+4]=Mt.texturePage,e[Wt+5]=Mt.texturePositionClipSpace.x+Sl/this._atlas.pages[Mt.texturePage].canvas.width,e[Wt+6]=Mt.texturePositionClipSpace.y,e[Wt+7]=Mt.sizeClipSpace.x-Sl/this._atlas.pages[Mt.texturePage].canvas.width,e[Wt+8]=Mt.sizeClipSpace.y):(e[Wt]=-Mt.offset.x+this._dimensions.device.char.left,e[Wt+1]=-Mt.offset.y+this._dimensions.device.char.top,e[Wt+2]=Mt.size.x/this._dimensions.device.canvas.width,e[Wt+3]=Mt.size.y/this._dimensions.device.canvas.height,e[Wt+4]=Mt.texturePage,e[Wt+5]=Mt.texturePositionClipSpace.x,e[Wt+6]=Mt.texturePositionClipSpace.y,e[Wt+7]=Mt.sizeClipSpace.x,e[Wt+8]=Mt.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&vN(a,u,Mt.size.x,this._dimensions.device.cell.width)&&(e[Wt+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width))}clear(){let e=this._terminal,n=e.cols*e.rows*gs;this._vertices.count!==n?this._vertices.attributes=new Float32Array(n):this._vertices.attributes.fill(0);let r=0;for(;r<this._vertices.attributesBuffers.length;r++)this._vertices.count!==n?this._vertices.attributesBuffers[r]=new Float32Array(n):this._vertices.attributesBuffers[r].fill(0);this._vertices.count=n,r=0;for(let a=0;a<e.rows;a++)for(let l=0;l<e.cols;l++)this._vertices.attributes[r+9]=l/e.cols,this._vertices.attributes[r+10]=a/e.rows,r+=gs}handleResize(){let e=this._gl;e.useProgram(this._program),e.viewport(0,0,e.canvas.width,e.canvas.height),e.uniform2f(this._resolutionLocation,e.canvas.width,e.canvas.height),this.clear()}render(e){if(!this._atlas)return;let n=this._gl;n.useProgram(this._program),n.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;let r=this._vertices.attributesBuffers[this._activeBuffer],a=0;for(let l=0;l<e.lineLengths.length;l++){let p=l*this._terminal.cols*gs,m=this._vertices.attributes.subarray(p,p+e.lineLengths[l]*gs);r.set(m,a),a+=m.length}n.bindBuffer(n.ARRAY_BUFFER,this._attributesBuffer),n.bufferData(n.ARRAY_BUFFER,r.subarray(0,a),n.STREAM_DRAW);for(let l=0;l<this._atlas.pages.length;l++)this._atlas.pages[l].version!==this._atlasTextures[l].version&&this._bindAtlasPageTexture(n,this._atlas,l);n.drawElementsInstanced(n.TRIANGLE_STRIP,4,n.UNSIGNED_BYTE,0,a/gs)}setAtlas(e){this._atlas=e;for(let n of this._atlasTextures)n.version=-1}_bindAtlasPageTexture(e,n,r){e.activeTexture(e.TEXTURE0+r),e.bindTexture(e.TEXTURE_2D,this._atlasTextures[r].texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n.pages[r].canvas),e.generateMipmap(e.TEXTURE_2D),this._atlasTextures[r].version=n.pages[r].version}setDimensions(e){this._dimensions=e}},i8=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,n,r,a=!1){if(this.selectionStart=n,this.selectionEnd=r,!n||!r||n[0]===r[0]&&n[1]===r[1]){this.clear();return}let l=e.buffers.active.ydisp,p=n[1]-l,m=r[1]-l,c=Math.max(p,0),u=Math.min(m,e.rows-1);if(c>=e.rows||u<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=a,this.viewportStartRow=p,this.viewportEndRow=m,this.viewportCappedStartRow=c,this.viewportCappedEndRow=u,this.startCol=n[0],this.endCol=r[0]}isCellSelected(e,n,r){return this.hasSelection?(r-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?n>=this.startCol&&r>=this.viewportCappedStartRow&&n<this.endCol&&r<=this.viewportCappedEndRow:n<this.startCol&&r>=this.viewportCappedStartRow&&n>=this.endCol&&r<=this.viewportCappedEndRow:r>this.viewportStartRow&&r<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&r===this.viewportStartRow&&n>=this.startCol&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&r===this.viewportEndRow&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&r===this.viewportStartRow&&n>=this.startCol):!1}};function r8(){return new i8}var Qu=4,Bu=1,Iu=2,ap=3,s8=2147483648,a8=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=r8()}resize(e,n){let r=e*n*Qu;r!==this.cells.length&&(this.cells=new Uint32Array(r),this.lineLengths=new Uint32Array(n))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}},o8=`#version 300 es
746
- layout (location = 0) in vec2 a_position;
747
- layout (location = 1) in vec2 a_size;
748
- layout (location = 2) in vec4 a_color;
749
- layout (location = 3) in vec2 a_unitquad;
750
-
751
- uniform mat4 u_projection;
752
-
753
- out vec4 v_color;
754
-
755
- void main() {
756
- vec2 zeroToOne = a_position + (a_unitquad * a_size);
757
- gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
758
- v_color = a_color;
759
- }`,l8=`#version 300 es
760
- precision lowp float;
761
-
762
- in vec4 v_color;
763
-
764
- out vec4 outColor;
765
-
766
- void main() {
767
- outColor = v_color;
768
- }`,Or=8,op=Or*Float32Array.BYTES_PER_ELEMENT,c8=20*Or,ny=class{constructor(){this.attributes=new Float32Array(c8),this.count=0}},Lr=0,iy=0,ry=0,sy=0,ay=0,oy=0,ly=0,u8=class extends qi{constructor(e,n,r,a){super(),this._terminal=e,this._gl=n,this._dimensions=r,this._themeService=a,this._vertices=new ny,this._verticesCursor=new ny;let l=this._gl;this._program=hn(JC(l,o8,l8)),this._register(Nn(()=>l.deleteProgram(this._program))),this._projectionLocation=hn(l.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=l.createVertexArray(),l.bindVertexArray(this._vertexArrayObject);let p=new Float32Array([0,0,1,0,0,1,1,1]),m=l.createBuffer();this._register(Nn(()=>l.deleteBuffer(m))),l.bindBuffer(l.ARRAY_BUFFER,m),l.bufferData(l.ARRAY_BUFFER,p,l.STATIC_DRAW),l.enableVertexAttribArray(3),l.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let c=new Uint8Array([0,1,2,3]),u=l.createBuffer();this._register(Nn(()=>l.deleteBuffer(u))),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,u),l.bufferData(l.ELEMENT_ARRAY_BUFFER,c,l.STATIC_DRAW),this._attributesBuffer=hn(l.createBuffer()),this._register(Nn(()=>l.deleteBuffer(this._attributesBuffer))),l.bindBuffer(l.ARRAY_BUFFER,this._attributesBuffer),l.enableVertexAttribArray(0),l.vertexAttribPointer(0,2,l.FLOAT,!1,op,0),l.vertexAttribDivisor(0,1),l.enableVertexAttribArray(1),l.vertexAttribPointer(1,2,l.FLOAT,!1,op,2*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(1,1),l.enableVertexAttribArray(2),l.vertexAttribPointer(2,4,l.FLOAT,!1,op,4*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(2,1),this._updateCachedColors(a.colors),this._register(this._themeService.onChangeColors(h=>{this._updateCachedColors(h),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(e){let n=this._gl;n.useProgram(this._program),n.bindVertexArray(this._vertexArrayObject),n.uniformMatrix4fv(this._projectionLocation,!1,ZC),n.bindBuffer(n.ARRAY_BUFFER,this._attributesBuffer),n.bufferData(n.ARRAY_BUFFER,e.attributes,n.DYNAMIC_DRAW),n.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,n.UNSIGNED_BYTE,0,e.count)}handleResize(){this._updateViewportRectangle()}setDimensions(e){this._dimensions=e}_updateCachedColors(e){this._bgFloat=this._colorToFloat32Array(e.background),this._cursorFloat=this._colorToFloat32Array(e.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(e){let n=this._terminal,r=this._vertices,a=1,l,p,m,c,u,h,y,g,C,T,A;for(l=0;l<n.rows;l++){for(m=-1,c=0,u=0,h=!1,p=0;p<n.cols;p++)y=(l*n.cols+p)*Qu,g=e.cells[y+Bu],C=e.cells[y+Iu],T=!!(C&67108864),(g!==c||C!==u&&(h||T))&&((c!==0||h&&u!==0)&&(A=a++*Or,this._updateRectangle(r,A,u,c,m,p,l)),m=p,c=g,u=C,h=T);(c!==0||h&&u!==0)&&(A=a++*Or,this._updateRectangle(r,A,u,c,m,n.cols,l))}r.count=a}updateCursor(e){let n=this._verticesCursor,r=e.cursor;if(!r||r.style==="block"){n.count=0;return}let a,l=0;(r.style==="bar"||r.style==="outline")&&(a=l++*Or,this._addRectangleFloat(n.attributes,a,r.x*this._dimensions.device.cell.width,r.y*this._dimensions.device.cell.height,r.style==="bar"?r.dpr*r.cursorWidth:r.dpr,this._dimensions.device.cell.height,this._cursorFloat)),(r.style==="underline"||r.style==="outline")&&(a=l++*Or,this._addRectangleFloat(n.attributes,a,r.x*this._dimensions.device.cell.width,(r.y+1)*this._dimensions.device.cell.height-r.dpr,r.width*this._dimensions.device.cell.width,r.dpr,this._cursorFloat)),r.style==="outline"&&(a=l++*Or,this._addRectangleFloat(n.attributes,a,r.x*this._dimensions.device.cell.width,r.y*this._dimensions.device.cell.height,r.width*this._dimensions.device.cell.width,r.dpr,this._cursorFloat),a=l++*Or,this._addRectangleFloat(n.attributes,a,(r.x+r.width)*this._dimensions.device.cell.width-r.dpr,r.y*this._dimensions.device.cell.height,r.dpr,this._dimensions.device.cell.height,this._cursorFloat)),n.count=l}_updateRectangle(e,n,r,a,l,p,m){if(r&67108864)switch(r&50331648){case 16777216:case 33554432:Lr=this._themeService.colors.ansi[r&255].rgba;break;case 50331648:Lr=(r&16777215)<<8;break;default:Lr=this._themeService.colors.foreground.rgba}else switch(a&50331648){case 16777216:case 33554432:Lr=this._themeService.colors.ansi[a&255].rgba;break;case 50331648:Lr=(a&16777215)<<8;break;default:Lr=this._themeService.colors.background.rgba}e.attributes.length<n+4&&(e.attributes=ZN(e.attributes,this._terminal.rows*this._terminal.cols*Or)),iy=l*this._dimensions.device.cell.width,ry=m*this._dimensions.device.cell.height,sy=(Lr>>24&255)/255,ay=(Lr>>16&255)/255,oy=(Lr>>8&255)/255,ly=1,this._addRectangle(e.attributes,n,iy,ry,(p-l)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,sy,ay,oy,ly)}_addRectangle(e,n,r,a,l,p,m,c,u,h){e[n]=r/this._dimensions.device.canvas.width,e[n+1]=a/this._dimensions.device.canvas.height,e[n+2]=l/this._dimensions.device.canvas.width,e[n+3]=p/this._dimensions.device.canvas.height,e[n+4]=m,e[n+5]=c,e[n+6]=u,e[n+7]=h}_addRectangleFloat(e,n,r,a,l,p,m){e[n]=r/this._dimensions.device.canvas.width,e[n+1]=a/this._dimensions.device.canvas.height,e[n+2]=l/this._dimensions.device.canvas.width,e[n+3]=p/this._dimensions.device.canvas.height,e[n+4]=m[0],e[n+5]=m[1],e[n+6]=m[2],e[n+7]=m[3]}_colorToFloat32Array(e){return new Float32Array([(e.rgba>>24&255)/255,(e.rgba>>16&255)/255,(e.rgba>>8&255)/255,(e.rgba&255)/255])}},h8=class extends qi{constructor(e,n,r,a,l,p,m,c){super(),this._container=n,this._alpha=l,this._coreBrowserService=p,this._optionsService=m,this._themeService=c,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${r}-layer`),this._canvas.style.zIndex=a.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(u=>{this._refreshCharAtlas(e,u),this.reset(e)})),this._register(Nn(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=hn(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(e){}handleFocus(e){}handleCursorMove(e){}handleGridChanged(e,n,r){}handleSelectionChanged(e,n,r,a=!1){}_setTransparency(e,n){if(n===this._alpha)return;let r=this._canvas;this._alpha=n,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,r),this._refreshCharAtlas(e,this._themeService.colors),this.handleGridChanged(e,0,e.rows-1)}_refreshCharAtlas(e,n){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=YC(e,this._optionsService.rawOptions,n,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(e,n){this._deviceCellWidth=n.device.cell.width,this._deviceCellHeight=n.device.cell.height,this._deviceCharWidth=n.device.char.width,this._deviceCharHeight=n.device.char.height,this._deviceCharLeft=n.device.char.left,this._deviceCharTop=n.device.char.top,this._canvas.width=n.device.canvas.width,this._canvas.height=n.device.canvas.height,this._canvas.style.width=`${n.css.canvas.width}px`,this._canvas.style.height=`${n.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(e,this._themeService.colors)}_fillBottomLineAtCells(e,n,r=1){this._ctx.fillRect(e*this._deviceCellWidth,(n+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,r*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(e,n,r,a){this._alpha?this._ctx.clearRect(e*this._deviceCellWidth,n*this._deviceCellHeight,r*this._deviceCellWidth,a*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(e*this._deviceCellWidth,n*this._deviceCellHeight,r*this._deviceCellWidth,a*this._deviceCellHeight))}_fillCharTrueColor(e,n,r,a){this._ctx.font=this._getFont(e,!1,!1),this._ctx.textBaseline=jC,this._clipCell(r,a,n.getWidth()),this._ctx.fillText(n.getChars(),r*this._deviceCellWidth+this._deviceCharLeft,a*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(e,n,r){this._ctx.beginPath(),this._ctx.rect(e*this._deviceCellWidth,n*this._deviceCellHeight,r*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(e,n,r){let a=n?e.options.fontWeightBold:e.options.fontWeight;return`${r?"italic":""} ${a} ${e.options.fontSize*this._coreBrowserService.dpr}px ${e.options.fontFamily}`}},d8=class extends h8{constructor(e,n,r,a,l,p,m){super(r,e,"link",n,!0,l,p,m),this._register(a.onShowLinkUnderline(c=>this._handleShowLinkUnderline(c))),this._register(a.onHideLinkUnderline(c=>this._handleHideLinkUnderline(c)))}resize(e,n){super.resize(e,n),this._state=void 0}reset(e){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let e=this._state.y2-this._state.y1-1;e>0&&this._clearCells(0,this._state.y1+1,this._state.cols,e),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(e){if(e.fg===257?this._ctx.fillStyle=this._themeService.colors.background.css:e.fg!==void 0&&VN(e.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[e.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,e.y1===e.y2)this._fillBottomLineAtCells(e.x1,e.y1,e.x2-e.x1);else{this._fillBottomLineAtCells(e.x1,e.y1,e.cols-e.x1);for(let n=e.y1+1;n<e.y2;n++)this._fillBottomLineAtCells(0,n,e.cols);this._fillBottomLineAtCells(0,e.y2,e.x2)}this._state=e}_handleHideLinkUnderline(e){this._clearCurrentLink()}},Ks=typeof window=="object"?window:globalThis,mg=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new Dt,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new Dt,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(n){return this.mapWindowIdToZoomLevel.get(this.getWindowId(n))??0}setZoomLevel(n,r){if(this.getZoomLevel(r)===n)return;let a=this.getWindowId(r);this.mapWindowIdToZoomLevel.set(a,n),this._onDidChangeZoomLevel.fire(a)}getZoomFactor(n){return this.mapWindowIdToZoomFactor.get(this.getWindowId(n))??1}setZoomFactor(n,r){this.mapWindowIdToZoomFactor.set(this.getWindowId(r),n)}setFullscreen(n,r){if(this.isFullscreen(r)===n)return;let a=this.getWindowId(r);this.mapWindowIdToFullScreen.set(a,n),this._onDidChangeFullscreen.fire(a)}isFullscreen(n){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(n))}getWindowId(n){return n.vscodeWindowId}};mg.INSTANCE=new mg;var QC=mg;function f8(e,n,r){typeof n=="string"&&(n=e.matchMedia(n)),n.addEventListener("change",r)}QC.INSTANCE.onDidChangeZoomLevel;QC.INSTANCE.onDidChangeFullscreen;var go=typeof navigator=="object"?navigator.userAgent:"";go.indexOf("Firefox")>=0;go.indexOf("AppleWebKit")>=0;var p8=go.indexOf("Chrome")>=0;!p8&&go.indexOf("Safari")>=0;go.indexOf("Electron/")>=0;go.indexOf("Android")>=0;var lp=!1;if(typeof Ks.matchMedia=="function"){let e=Ks.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),n=Ks.matchMedia("(display-mode: fullscreen)");lp=e.matches,f8(Ks,e,({matches:r})=>{lp&&n.matches||(lp=r)})}var Xa="en",cp=!1,ex=!1,wu,ju=Xa,cy=Xa,g8,Dr,Xs=globalThis,di;typeof Xs.vscode<"u"&&typeof Xs.vscode.process<"u"?di=Xs.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(di=process);var m8=typeof di?.versions?.electron=="string",_8=m8&&di?.type==="renderer";if(typeof di=="object"){di.platform,di.platform,cp=di.platform==="linux",cp&&di.env.SNAP&&di.env.SNAP_REVISION,di.env.CI||di.env.BUILD_ARTIFACTSTAGINGDIRECTORY,wu=Xa,ju=Xa;let e=di.env.VSCODE_NLS_CONFIG;if(e)try{let n=JSON.parse(e);wu=n.userLocale,cy=n.osLocale,ju=n.resolvedLanguage||Xa,g8=n.languagePack?.translationsConfigFile}catch{}ex=!0}else typeof navigator=="object"&&!_8?(Dr=navigator.userAgent,Dr.indexOf("Windows")>=0,Dr.indexOf("Macintosh")>=0,(Dr.indexOf("Macintosh")>=0||Dr.indexOf("iPad")>=0||Dr.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,cp=Dr.indexOf("Linux")>=0,Dr?.indexOf("Mobi")>=0,ju=globalThis._VSCODE_NLS_LANGUAGE||Xa,wu=navigator.language.toLowerCase(),cy=wu):console.error("Unable to resolve platform.");var uy=ex,nr=Dr,ds=ju,v8;(e=>{function n(){return ds}e.value=n;function r(){return ds.length===2?ds==="en":ds.length>=3?ds[0]==="e"&&ds[1]==="n"&&ds[2]==="-":!1}e.isDefaultVariant=r;function a(){return ds==="en"}e.isDefault=a})(v8||={});var b8=typeof Xs.postMessage=="function"&&!Xs.importScripts;(()=>{if(b8){let e=[];Xs.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let a=0,l=e.length;a<l;a++){let p=e[a];if(p.id===r.data.vscodeScheduleAsyncWork){e.splice(a,1),p.callback();return}}});let n=0;return r=>{let a=++n;e.push({id:a,callback:r}),Xs.postMessage({vscodeScheduleAsyncWork:a},"*")}}return e=>setTimeout(e)})();var y8=!!(nr&&nr.indexOf("Chrome")>=0);nr&&nr.indexOf("Firefox")>=0;!y8&&nr&&nr.indexOf("Safari")>=0;nr&&nr.indexOf("Edg/")>=0;nr&&nr.indexOf("Android")>=0;var Fa=typeof navigator=="object"?navigator:{};uy||document.queryCommandSupported&&document.queryCommandSupported("copy")||Fa&&Fa.clipboard&&Fa.clipboard.writeText,uy||Fa&&Fa.clipboard&&Fa.clipboard.readText;var lm=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,n){this._keyCodeToStr[e]=n,this._strToKeyCode[n.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},up=new lm,hy=new lm,dy=new lm;new Array(230);var S8;(e=>{function n(c){return up.keyCodeToStr(c)}e.toString=n;function r(c){return up.strToKeyCode(c)}e.fromString=r;function a(c){return hy.keyCodeToStr(c)}e.toUserSettingsUS=a;function l(c){return dy.keyCodeToStr(c)}e.toUserSettingsGeneral=l;function p(c){return hy.strToKeyCode(c)||dy.strToKeyCode(c)}e.fromUserSettings=p;function m(c){if(c>=98&&c<=113)return null;switch(c){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return up.keyCodeToStr(c)}e.toElectronAccelerator=m})(S8||={});var tx=Object.freeze(function(e,n){let r=setTimeout(e.bind(n),0);return{dispose(){clearTimeout(r)}}}),w8;(e=>{function n(r){return r===e.None||r===e.Cancelled||r instanceof C8?!0:!r||typeof r!="object"?!1:typeof r.isCancellationRequested=="boolean"&&typeof r.onCancellationRequested=="function"}e.isCancellationToken=n,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Nr.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:tx})})(w8||={});var C8=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?tx:(this._emitter||(this._emitter=new Dt),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},x8;(e=>{async function n(a){let l,p=await Promise.all(a.map(m=>m.then(c=>c,c=>{l||(l=c)})));if(typeof l<"u")throw l;return p}e.settled=n;function r(a){return new Promise(async(l,p)=>{try{await a(l,p)}catch(m){p(m)}})}e.withAsyncBody=r})(x8||={});var fy=class Ti{static fromArray(n){return new Ti(r=>{r.emitMany(n)})}static fromPromise(n){return new Ti(async r=>{r.emitMany(await n)})}static fromPromises(n){return new Ti(async r=>{await Promise.all(n.map(async a=>r.emitOne(await a)))})}static merge(n){return new Ti(async r=>{await Promise.all(n.map(async a=>{for await(let l of a)r.emitOne(l)}))})}constructor(n,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new Dt,queueMicrotask(async()=>{let a={emitOne:l=>this.emitOne(l),emitMany:l=>this.emitMany(l),reject:l=>this.reject(l)};try{await Promise.resolve(n(a)),this.resolve()}catch(l){this.reject(l)}finally{a.emitOne=void 0,a.emitMany=void 0,a.reject=void 0}})}[Symbol.asyncIterator](){let n=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(n<this._results.length)return{done:!1,value:this._results[n++]};if(this._state===1)return{done:!0,value:void 0};await Nr.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(n,r){return new Ti(async a=>{for await(let l of n)a.emitOne(r(l))})}map(n){return Ti.map(this,n)}static filter(n,r){return new Ti(async a=>{for await(let l of n)r(l)&&a.emitOne(l)})}filter(n){return Ti.filter(this,n)}static coalesce(n){return Ti.filter(n,r=>!!r)}coalesce(){return Ti.coalesce(this)}static async toPromise(n){let r=[];for await(let a of n)r.push(a);return r}toPromise(){return Ti.toPromise(this)}emitOne(n){this._state===0&&(this._results.push(n),this._onStateChanged.fire())}emitMany(n){this._state===0&&(this._results=this._results.concat(n),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(n){this._state===0&&(this._state=2,this._error=n,this._onStateChanged.fire())}};fy.EMPTY=fy.fromArray([]);var{getWindow:E8}=(function(){let e=new Map,n={window:Ks,disposables:new no};e.set(Ks.vscodeWindowId,n);let r=new Dt,a=new Dt,l=new Dt;function p(m,c){return(typeof m=="number"?e.get(m):void 0)??(c?n:void 0)}return{onDidRegisterWindow:r.event,onWillUnregisterWindow:l.event,onDidUnregisterWindow:a.event,registerWindow(m){if(e.has(m.vscodeWindowId))return qi.None;let c=new no,u={window:m,disposables:c.add(new no)};return e.set(m.vscodeWindowId,u),c.add(Nn(()=>{e.delete(m.vscodeWindowId),a.fire(m)})),c.add(_g(m,A8.BEFORE_UNLOAD,()=>{l.fire(m)})),r.fire(u),c},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(m){return m.vscodeWindowId},hasWindow(m){return e.has(m)},getWindowById:p,getWindow(m){let c=m;if(c?.ownerDocument?.defaultView)return c.ownerDocument.defaultView.window;let u=m;return u?.view?u.view.window:Ks},getDocument(m){return E8(m).document}}})(),T8=class{constructor(e,n,r,a){this._node=e,this._type=n,this._handler=r,this._options=a||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function _g(e,n,r,a){return new T8(e,n,r,a)}var A8={BEFORE_UNLOAD:"beforeunload"},k8=class extends qi{constructor(e,n,r,a,l,p,m,c,u){super(),this._terminal=e,this._characterJoinerService=n,this._charSizeService=r,this._coreBrowserService=a,this._coreService=l,this._decorationService=p,this._optionsService=m,this._themeService=c,this._cursorBlinkStateManager=new vl,this._charAtlasDisposable=this._register(new vl),this._observerDisposable=this._register(new vl),this._model=new a8,this._workCell=new ey,this._workCell2=new ey,this._rectangleRenderer=this._register(new vl),this._glyphRenderer=this._register(new vl),this._onChangeTextureAtlas=this._register(new Dt),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Dt),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Dt),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new Dt),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new Dt),this.onContextLoss=this._onContextLoss.event,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");let h={antialias:!1,depth:!1,preserveDrawingBuffer:u};if(this._gl=this._canvas.getContext("webgl2",h),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this._register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new SN(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new d8(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,m,this._themeService)],this.dimensions=bN(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(m.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(_g(this._canvas,"webglcontextlost",y=>{console.log("webglcontextlost event received"),y.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(y)},3e3)})),this._register(_g(this._canvas,"webglcontextrestored",y=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,J1(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=Q1(this._canvas,this._coreBrowserService.window,(y,g)=>this._setCanvasDevicePixelDimensions(y,g)),this._register(this._coreBrowserService.onWindowChange(y=>{this._observerDisposable.value=Q1(this._canvas,y,(g,C)=>this._setCanvasDevicePixelDimensions(g,C))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(Nn(()=>{for(let y of this._renderLayers)y.dispose();this._canvas.parentElement?.removeChild(this._canvas),J1(this._terminal)}))}get textureAtlas(){return this._charAtlas?.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(e,n){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(let r of this._renderLayers)r.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,this._rectangleRenderer.value?.setDimensions(this.dimensions),this._rectangleRenderer.value?.handleResize(),this._glyphRenderer.value?.setDimensions(this.dimensions),this._glyphRenderer.value?.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(let e of this._renderLayers)e.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(let e of this._renderLayers)e.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(e,n,r){for(let a of this._renderLayers)a.handleSelectionChanged(this._terminal,e,n,r);this._model.selection.update(this._core,e,n,r),this._requestRedrawViewport()}handleCursorMove(){for(let e of this._renderLayers)e.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new u8(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new n8(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0){this._isAttached=!1;return}let e=YC(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr,this._deviceMaxTextureSize);this._charAtlas!==e&&(this._onChangeTextureAtlas.fire(e.pages[0].canvas),this._charAtlasDisposable.value=DC(Nr.forward(e.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),Nr.forward(e.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=e,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(e){this._model.clear(),e&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(let e of this._renderLayers)e.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(e,n){if(!this._isAttached)if(this._core.screenElement?.isConnected&&this._charSizeService.width&&this._charSizeService.height)this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0;else return;for(let r of this._renderLayers)r.handleGridChanged(this._terminal,e,n);!this._glyphRenderer.value||!this._rectangleRenderer.value||(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(e,n),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible)&&this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._coreService.decPrivateModes.cursorBlink??this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new YN(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(e,n){let r=this._core,a=this._workCell,l,p,m,c,u,h,y=0,g=!0,C,T,A,x,d,v,f,b,E;e=py(e,r.rows-1,0),n=py(n,r.rows-1,0);let L=this._coreService.decPrivateModes.cursorStyle??r.options.cursorStyle??"block",R=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,M=R-r.buffer.ydisp,k=Math.min(this._terminal.buffer.active.cursorX,r.cols-1),O=-1,U=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let F=!1;for(p=e;p<=n;p++)for(m=p+r.buffer.ydisp,c=r.buffer.lines.get(m),this._model.lineLengths[p]=0,A=R===m,y=0,u=this._characterJoinerService.getJoinedCharacters(m),b=0;b<r.cols;b++){if(l=this._cellColorResolver.result.bg,c.loadCell(b,a),b===0&&(l=this._cellColorResolver.result.bg),h=!1,g=b>=y,C=b,u.length>0&&b===u[0][0]&&g){T=u.shift();let G=this._model.selection.isCellSelected(this._terminal,T[0],m);for(f=T[0]+1;f<T[1];f++)g&&=G===this._model.selection.isCellSelected(this._terminal,f,m);g&&=!A||k<T[0]||k>=T[1],g?(h=!0,a=new R8(a,c.translateToString(!0,T[0],T[1]),T[1]-T[0]),C=T[1]-1):y=T[1]}if(x=a.getChars(),d=a.getCode(),f=(p*r.cols+b)*Qu,this._cellColorResolver.resolve(a,b,m,this.dimensions.device.cell.width),U&&m===R&&(b===k&&(this._model.cursor={x:k,y:M,width:a.getWidth(),style:this._coreBrowserService.isFocused?L:r.options.cursorInactiveStyle,cursorWidth:r.options.cursorWidth,dpr:this._devicePixelRatio},O=k+a.getWidth()-1),b>=k&&b<=O&&(this._coreBrowserService.isFocused&&L==="block"||this._coreBrowserService.isFocused===!1&&r.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),d!==0&&(this._model.lineLengths[p]=b+1),!(this._model.cells[f]===d&&this._model.cells[f+Bu]===this._cellColorResolver.result.bg&&this._model.cells[f+Iu]===this._cellColorResolver.result.fg&&this._model.cells[f+ap]===this._cellColorResolver.result.ext)&&(F=!0,x.length>1&&(d|=s8),this._model.cells[f]=d,this._model.cells[f+Bu]=this._cellColorResolver.result.bg,this._model.cells[f+Iu]=this._cellColorResolver.result.fg,this._model.cells[f+ap]=this._cellColorResolver.result.ext,v=a.getWidth(),this._glyphRenderer.value.updateCell(b,p,d,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,x,v,l),h)){for(a=this._workCell,b++;b<=C;b++)E=(p*r.cols+b)*Qu,this._glyphRenderer.value.updateCell(b,p,0,0,0,0,dN,0,0),this._model.cells[E]=0,this._model.cells[E+Bu]=this._cellColorResolver.result.bg,this._model.cells[E+Iu]=this._cellColorResolver.result.fg,this._model.cells[E+ap]=this._cellColorResolver.result.ext;b--}}F&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){!this._charSizeService.width||!this._charSizeService.height||(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(e,n){this._canvas.width===e&&this._canvas.height===n||(this._canvas.width=e,this._canvas.height=n,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let e=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:e,end:e})}},R8=class extends Ya{constructor(e,n,r){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=n,this._width=r}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};function py(e,n,r=0){return Math.max(Math.min(e,n),r)}var gy="di$target",my="di$dependencies",hp=new Map;function sr(e){if(hp.has(e))return hp.get(e);let n=function(r,a,l){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");L8(n,r,l)};return n._id=e,hp.set(e,n),n}function L8(e,n,r){n[gy]===n?n[my].push({id:e,index:r}):(n[my]=[{id:e,index:r}],n[gy]=n)}sr("BufferService");sr("CoreMouseService");sr("CoreService");sr("CharsetService");sr("InstantiationService");sr("LogService");var M8=sr("OptionsService");sr("OscLinkService");sr("UnicodeService");sr("DecorationService");var D8={trace:0,debug:1,info:2,warn:3,error:4,off:5},O8="xterm.js: ",_y=class extends qi{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=D8[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let n=0;n<e.length;n++)typeof e[n]=="function"&&(e[n]=e[n]())}_log(e,n,r){this._evalLazyOptionalParams(r),e.call(console,(this._optionsService.options.logger?"":O8)+n,...r)}trace(e,...n){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,n)}debug(e,...n){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,n)}info(e,...n){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,n)}warn(e,...n){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,n)}error(e,...n){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,n)}};_y=eN([tN(0,M8)],_y);var N8=class extends qi{constructor(e){if(BC&&hN()<16){let n={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",n))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=e,this._onChangeTextureAtlas=this._register(new Dt),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Dt),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Dt),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new Dt),this.onContextLoss=this._onContextLoss.event}activate(e){let n=e._core;if(!e.element){this._register(n.onWillOpen(()=>this.activate(e)));return}this._terminal=e;let r=n.coreService,a=n.optionsService,l=n,p=l._renderService,m=l._characterJoinerService,c=l._charSizeService,u=l._coreBrowserService,h=l._decorationService;l._logService;let y=l._themeService;this._renderer=this._register(new k8(e,m,c,u,r,h,a,y,this._preserveDrawingBuffer)),this._register(Nr.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(Nr.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(Nr.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(Nr.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),p.setRenderer(this._renderer),this._register(Nn(()=>{if(this._terminal._core._store._isDisposed)return;let g=this._terminal._core._renderService;g.setRenderer(this._terminal._core._createRenderer()),g.handleResize(e.cols,e.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}},dp={exports:{}},vy;function B8(){return vy||(vy=1,(function(e,n){(function(r,a){e.exports=a()})(globalThis,(()=>(()=>{var r={4567:function(m,c,u){var h=this&&this.__decorate||function(f,b,E,L){var R,M=arguments.length,k=M<3?b:L===null?L=Object.getOwnPropertyDescriptor(b,E):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(f,b,E,L);else for(var O=f.length-1;O>=0;O--)(R=f[O])&&(k=(M<3?R(k):M>3?R(b,E,k):R(b,E))||k);return M>3&&k&&Object.defineProperty(b,E,k),k},y=this&&this.__param||function(f,b){return function(E,L){b(E,L,f)}};Object.defineProperty(c,"__esModule",{value:!0}),c.AccessibilityManager=void 0;const g=u(9042),C=u(9924),T=u(844),A=u(4725),x=u(2585),d=u(3656);let v=c.AccessibilityManager=class extends T.Disposable{constructor(f,b,E,L){super(),this._terminal=f,this._coreBrowserService=E,this._renderService=L,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let R=0;R<this._terminal.rows;R++)this._rowElements[R]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[R]);if(this._topBoundaryFocusListener=R=>this._handleBoundaryFocus(R,0),this._bottomBoundaryFocusListener=R=>this._handleBoundaryFocus(R,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=this._coreBrowserService.mainDocument.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((R=>this._handleResize(R.rows)))),this.register(this._terminal.onRender((R=>this._refreshRows(R.start,R.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((R=>this._handleChar(R)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
769
- `)))),this.register(this._terminal.onA11yTab((R=>this._handleTab(R)))),this.register(this._terminal.onKey((R=>this._handleKey(R.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,d.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,T.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(f){for(let b=0;b<f;b++)this._handleChar(" ")}_handleChar(f){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==f&&(this._charsToAnnounce+=f):this._charsToAnnounce+=f,f===`
770
- `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=g.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(f){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(f)||this._charsToConsume.push(f)}_refreshRows(f,b){this._liveRegionDebouncer.refresh(f,b,this._terminal.rows)}_renderRows(f,b){const E=this._terminal.buffer,L=E.lines.length.toString();for(let R=f;R<=b;R++){const M=E.lines.get(E.ydisp+R),k=[],O=M?.translateToString(!0,void 0,void 0,k)||"",U=(E.ydisp+R+1).toString(),F=this._rowElements[R];F&&(O.length===0?(F.innerText=" ",this._rowColumns.set(F,[0,1])):(F.textContent=O,this._rowColumns.set(F,k)),F.setAttribute("aria-posinset",U),F.setAttribute("aria-setsize",L))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(f,b){const E=f.target,L=this._rowElements[b===0?1:this._rowElements.length-2];if(E.getAttribute("aria-posinset")===(b===0?"1":`${this._terminal.buffer.lines.length}`)||f.relatedTarget!==L)return;let R,M;if(b===0?(R=E,M=this._rowElements.pop(),this._rowContainer.removeChild(M)):(R=this._rowElements.shift(),M=E,this._rowContainer.removeChild(R)),R.removeEventListener("focus",this._topBoundaryFocusListener),M.removeEventListener("focus",this._bottomBoundaryFocusListener),b===0){const k=this._createAccessibilityTreeNode();this._rowElements.unshift(k),this._rowContainer.insertAdjacentElement("afterbegin",k)}else{const k=this._createAccessibilityTreeNode();this._rowElements.push(k),this._rowContainer.appendChild(k)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(b===0?-1:1),this._rowElements[b===0?1:this._rowElements.length-2].focus(),f.preventDefault(),f.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;const f=document.getSelection();if(!f)return;if(f.isCollapsed)return void(this._rowContainer.contains(f.anchorNode)&&this._terminal.clearSelection());if(!f.anchorNode||!f.focusNode)return void console.error("anchorNode and/or focusNode are null");let b={node:f.anchorNode,offset:f.anchorOffset},E={node:f.focusNode,offset:f.focusOffset};if((b.node.compareDocumentPosition(E.node)&Node.DOCUMENT_POSITION_PRECEDING||b.node===E.node&&b.offset>E.offset)&&([b,E]=[E,b]),b.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(b={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(b.node))return;const L=this._rowElements.slice(-1)[0];if(E.node.compareDocumentPosition(L)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(E={node:L,offset:L.textContent?.length??0}),!this._rowContainer.contains(E.node))return;const R=({node:O,offset:U})=>{const F=O instanceof Text?O.parentNode:O;let G=parseInt(F?.getAttribute("aria-posinset"),10)-1;if(isNaN(G))return console.warn("row is invalid. Race condition?"),null;const I=this._rowColumns.get(F);if(!I)return console.warn("columns is null. Race condition?"),null;let K=U<I.length?I[U]:I.slice(-1)[0]+1;return K>=this._terminal.cols&&(++G,K=0),{row:G,column:K}},M=R(b),k=R(E);if(M&&k){if(M.row>k.row||M.row===k.row&&M.column>=k.column)throw new Error("invalid range");this._terminal.select(M.column,M.row,(k.row-M.row)*this._terminal.cols-M.column+k.column)}}_handleResize(f){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let b=this._rowContainer.children.length;b<this._terminal.rows;b++)this._rowElements[b]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[b]);for(;this._rowElements.length>f;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const f=this._coreBrowserService.mainDocument.createElement("div");return f.setAttribute("role","listitem"),f.tabIndex=-1,this._refreshRowDimensions(f),f}_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 f=0;f<this._terminal.rows;f++)this._refreshRowDimensions(this._rowElements[f])}}_refreshRowDimensions(f){f.style.height=`${this._renderService.dimensions.css.cell.height}px`}};c.AccessibilityManager=v=h([y(1,x.IInstantiationService),y(2,A.ICoreBrowserService),y(3,A.IRenderService)],v)},3614:(m,c)=>{function u(C){return C.replace(/\r?\n/g,"\r")}function h(C,T){return T?"\x1B[200~"+C+"\x1B[201~":C}function y(C,T,A,x){C=h(C=u(C),A.decPrivateModes.bracketedPasteMode&&x.rawOptions.ignoreBracketedPasteMode!==!0),A.triggerDataEvent(C,!0),T.value=""}function g(C,T,A){const x=A.getBoundingClientRect(),d=C.clientX-x.left-10,v=C.clientY-x.top-10;T.style.width="20px",T.style.height="20px",T.style.left=`${d}px`,T.style.top=`${v}px`,T.style.zIndex="1000",T.focus()}Object.defineProperty(c,"__esModule",{value:!0}),c.rightClickHandler=c.moveTextAreaUnderMouseCursor=c.paste=c.handlePasteEvent=c.copyHandler=c.bracketTextForPaste=c.prepareTextForTerminal=void 0,c.prepareTextForTerminal=u,c.bracketTextForPaste=h,c.copyHandler=function(C,T){C.clipboardData&&C.clipboardData.setData("text/plain",T.selectionText),C.preventDefault()},c.handlePasteEvent=function(C,T,A,x){C.stopPropagation(),C.clipboardData&&y(C.clipboardData.getData("text/plain"),T,A,x)},c.paste=y,c.moveTextAreaUnderMouseCursor=g,c.rightClickHandler=function(C,T,A,x,d){g(C,T,A),d&&x.rightClickSelect(C),T.value=x.selectionText,T.select()}},7239:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ColorContrastCache=void 0;const h=u(1505);c.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(y,g,C){this._css.set(y,g,C)}getCss(y,g){return this._css.get(y,g)}setColor(y,g,C){this._color.set(y,g,C)}getColor(y,g){return this._color.get(y,g)}clear(){this._color.clear(),this._css.clear()}}},3656:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.addDisposableDomListener=void 0,c.addDisposableDomListener=function(u,h,y,g){u.addEventListener(h,y,g);let C=!1;return{dispose:()=>{C||(C=!0,u.removeEventListener(h,y,g))}}}},3551:function(m,c,u){var h=this&&this.__decorate||function(v,f,b,E){var L,R=arguments.length,M=R<3?f:E===null?E=Object.getOwnPropertyDescriptor(f,b):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(v,f,b,E);else for(var k=v.length-1;k>=0;k--)(L=v[k])&&(M=(R<3?L(M):R>3?L(f,b,M):L(f,b))||M);return R>3&&M&&Object.defineProperty(f,b,M),M},y=this&&this.__param||function(v,f){return function(b,E){f(b,E,v)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Linkifier=void 0;const g=u(3656),C=u(8460),T=u(844),A=u(2585),x=u(4725);let d=c.Linkifier=class extends T.Disposable{get currentLink(){return this._currentLink}constructor(v,f,b,E,L){super(),this._element=v,this._mouseService=f,this._renderService=b,this._bufferService=E,this._linkProviderService=L,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new C.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new C.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,T.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,T.toDisposable)((()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,g.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,g.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,g.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,g.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(v){this._lastMouseEvent=v;const f=this._positionFromMouseEvent(v,this._element,this._mouseService);if(!f)return;this._isMouseOut=!1;const b=v.composedPath();for(let E=0;E<b.length;E++){const L=b[E];if(L.classList.contains("xterm"))break;if(L.classList.contains("xterm-hover"))return}this._lastBufferCell&&f.x===this._lastBufferCell.x&&f.y===this._lastBufferCell.y||(this._handleHover(f),this._lastBufferCell=f)}_handleHover(v){if(this._activeLine!==v.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(v,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,v)||(this._clearCurrentLink(),this._askForLink(v,!0))}_askForLink(v,f){this._activeProviderReplies&&f||(this._activeProviderReplies?.forEach((E=>{E?.forEach((L=>{L.link.dispose&&L.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=v.y);let b=!1;for(const[E,L]of this._linkProviderService.linkProviders.entries())f?this._activeProviderReplies?.get(E)&&(b=this._checkLinkProviderResult(E,v,b)):L.provideLinks(v.y,(R=>{if(this._isMouseOut)return;const M=R?.map((k=>({link:k})));this._activeProviderReplies?.set(E,M),b=this._checkLinkProviderResult(E,v,b),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(v.y,this._activeProviderReplies)}))}_removeIntersectingLinks(v,f){const b=new Set;for(let E=0;E<f.size;E++){const L=f.get(E);if(L)for(let R=0;R<L.length;R++){const M=L[R],k=M.link.range.start.y<v?0:M.link.range.start.x,O=M.link.range.end.y>v?this._bufferService.cols:M.link.range.end.x;for(let U=k;U<=O;U++){if(b.has(U)){L.splice(R--,1);break}b.add(U)}}}}_checkLinkProviderResult(v,f,b){if(!this._activeProviderReplies)return b;const E=this._activeProviderReplies.get(v);let L=!1;for(let R=0;R<v;R++)this._activeProviderReplies.has(R)&&!this._activeProviderReplies.get(R)||(L=!0);if(!L&&E){const R=E.find((M=>this._linkAtPosition(M.link,f)));R&&(b=!0,this._handleNewLink(R))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!b)for(let R=0;R<this._activeProviderReplies.size;R++){const M=this._activeProviderReplies.get(R)?.find((k=>this._linkAtPosition(k.link,f)));if(M){b=!0,this._handleNewLink(M);break}}return b}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(v){if(!this._currentLink)return;const f=this._positionFromMouseEvent(v,this._element,this._mouseService);f&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,f)&&this._currentLink.link.activate(v,this._currentLink.link.text)}_clearCurrentLink(v,f){this._currentLink&&this._lastMouseEvent&&(!v||!f||this._currentLink.link.range.start.y>=v&&this._currentLink.link.range.end.y<=f)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,T.disposeArray)(this._linkCacheDisposables))}_handleNewLink(v){if(!this._lastMouseEvent)return;const f=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);f&&this._linkAtPosition(v.link,f)&&(this._currentLink=v,this._currentLink.state={decorations:{underline:v.link.decorations===void 0||v.link.decorations.underline,pointerCursor:v.link.decorations===void 0||v.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,v.link,this._lastMouseEvent),v.link.decorations={},Object.defineProperties(v.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:b=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==b&&(this._currentLink.state.decorations.pointerCursor=b,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",b))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:b=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==b&&(this._currentLink.state.decorations.underline=b,this._currentLink.state.isHovered&&this._fireUnderlineEvent(v.link,b))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((b=>{if(!this._currentLink)return;const E=b.start===0?0:b.start+1+this._bufferService.buffer.ydisp,L=this._bufferService.buffer.ydisp+1+b.end;if(this._currentLink.link.range.start.y>=E&&this._currentLink.link.range.end.y<=L&&(this._clearCurrentLink(E,L),this._lastMouseEvent)){const R=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);R&&this._askForLink(R,!1)}}))))}_linkHover(v,f,b){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(f,!0),this._currentLink.state.decorations.pointerCursor&&v.classList.add("xterm-cursor-pointer")),f.hover&&f.hover(b,f.text)}_fireUnderlineEvent(v,f){const b=v.range,E=this._bufferService.buffer.ydisp,L=this._createLinkUnderlineEvent(b.start.x-1,b.start.y-E-1,b.end.x,b.end.y-E-1,void 0);(f?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(L)}_linkLeave(v,f,b){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(f,!1),this._currentLink.state.decorations.pointerCursor&&v.classList.remove("xterm-cursor-pointer")),f.leave&&f.leave(b,f.text)}_linkAtPosition(v,f){const b=v.range.start.y*this._bufferService.cols+v.range.start.x,E=v.range.end.y*this._bufferService.cols+v.range.end.x,L=f.y*this._bufferService.cols+f.x;return b<=L&&L<=E}_positionFromMouseEvent(v,f,b){const E=b.getCoords(v,f,this._bufferService.cols,this._bufferService.rows);if(E)return{x:E[0],y:E[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(v,f,b,E,L){return{x1:v,y1:f,x2:b,y2:E,cols:this._bufferService.cols,fg:L}}};c.Linkifier=d=h([y(1,x.IMouseService),y(2,x.IRenderService),y(3,A.IBufferService),y(4,x.ILinkProviderService)],d)},9042:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.tooMuchOutput=c.promptLabel=void 0,c.promptLabel="Terminal input",c.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(m,c,u){var h=this&&this.__decorate||function(x,d,v,f){var b,E=arguments.length,L=E<3?d:f===null?f=Object.getOwnPropertyDescriptor(d,v):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(x,d,v,f);else for(var R=x.length-1;R>=0;R--)(b=x[R])&&(L=(E<3?b(L):E>3?b(d,v,L):b(d,v))||L);return E>3&&L&&Object.defineProperty(d,v,L),L},y=this&&this.__param||function(x,d){return function(v,f){d(v,f,x)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OscLinkProvider=void 0;const g=u(511),C=u(2585);let T=c.OscLinkProvider=class{constructor(x,d,v){this._bufferService=x,this._optionsService=d,this._oscLinkService=v}provideLinks(x,d){const v=this._bufferService.buffer.lines.get(x-1);if(!v)return void d(void 0);const f=[],b=this._optionsService.rawOptions.linkHandler,E=new g.CellData,L=v.getTrimmedLength();let R=-1,M=-1,k=!1;for(let O=0;O<L;O++)if(M!==-1||v.hasContent(O)){if(v.loadCell(O,E),E.hasExtendedAttrs()&&E.extended.urlId){if(M===-1){M=O,R=E.extended.urlId;continue}k=E.extended.urlId!==R}else M!==-1&&(k=!0);if(k||M!==-1&&O===L-1){const U=this._oscLinkService.getLinkData(R)?.uri;if(U){const F={start:{x:M+1,y:x},end:{x:O+(k||O!==L-1?0:1),y:x}};let G=!1;if(!b?.allowNonHttpProtocols)try{const I=new URL(U);["http:","https:"].includes(I.protocol)||(G=!0)}catch{G=!0}G||f.push({text:U,range:F,activate:(I,K)=>b?b.activate(I,K,F):A(0,K),hover:(I,K)=>b?.hover?.(I,K,F),leave:(I,K)=>b?.leave?.(I,K,F)})}k=!1,E.hasExtendedAttrs()&&E.extended.urlId?(M=O,R=E.extended.urlId):(M=-1,R=-1)}}d(f)}};function A(x,d){if(confirm(`Do you want to navigate to ${d}?
771
-
772
- WARNING: This link could potentially be dangerous`)){const v=window.open();if(v){try{v.opener=null}catch{}v.location.href=d}else console.warn("Opening link blocked as opener could not be cleared")}}c.OscLinkProvider=T=h([y(0,C.IBufferService),y(1,C.IOptionsService),y(2,C.IOscLinkService)],T)},6193:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.RenderDebouncer=void 0,c.RenderDebouncer=class{constructor(u,h){this._renderCallback=u,this._coreBrowserService=h,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(u){return this._refreshCallbacks.push(u),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(u,h,y){this._rowCount=y,u=u!==void 0?u:0,h=h!==void 0?h: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,h):h,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.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),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,h),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const u of this._refreshCallbacks)u(0);this._refreshCallbacks=[]}}},3236:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Terminal=void 0;const h=u(3614),y=u(3656),g=u(3551),C=u(9042),T=u(3730),A=u(1680),x=u(3107),d=u(5744),v=u(2950),f=u(1296),b=u(428),E=u(4269),L=u(5114),R=u(8934),M=u(3230),k=u(9312),O=u(4725),U=u(6731),F=u(8055),G=u(8969),I=u(8460),K=u(844),te=u(6114),q=u(8437),W=u(2584),Y=u(7399),B=u(5941),$=u(9074),N=u(2585),P=u(5435),Z=u(4567),ae=u(779);class ce extends G.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(Q={}){super(Q),this.browser=te,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new K.MutableDisposable),this._onCursorMove=this.register(new I.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new I.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new I.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new I.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new I.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new I.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new I.EventEmitter),this._onBlur=this.register(new I.EventEmitter),this._onA11yCharEmitter=this.register(new I.EventEmitter),this._onA11yTabEmitter=this.register(new I.EventEmitter),this._onWillOpen=this.register(new I.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance($.DecorationService),this._instantiationService.setService(N.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ae.LinkProviderService),this._instantiationService.setService(O.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(T.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((z,oe)=>this.refresh(z,oe)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((z=>this._reportWindowsOptions(z)))),this.register(this._inputHandler.onColor((z=>this._handleColorEvent(z)))),this.register((0,I.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,I.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,I.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,I.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((z=>this._afterResize(z.cols,z.rows)))),this.register((0,K.toDisposable)((()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)})))}_handleColorEvent(Q){if(this._themeService)for(const z of Q){let oe,ge="";switch(z.index){case 256:oe="foreground",ge="10";break;case 257:oe="background",ge="11";break;case 258:oe="cursor",ge="12";break;default:oe="ansi",ge="4;"+z.index}switch(z.type){case 0:const Se=F.color.toColorRGB(oe==="ansi"?this._themeService.colors.ansi[z.index]:this._themeService.colors[oe]);this.coreService.triggerDataEvent(`${W.C0.ESC}]${ge};${(0,B.toRgbString)(Se)}${W.C1_ESCAPED.ST}`);break;case 1:if(oe==="ansi")this._themeService.modifyColors((ye=>ye.ansi[z.index]=F.channels.toColor(...z.color)));else{const ye=oe;this._themeService.modifyColors((Pe=>Pe[ye]=F.channels.toColor(...z.color)))}break;case 2:this._themeService.restoreColor(z.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(Q){Q?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Z.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(Q){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(W.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(W.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 Q=this.buffer.ybase+this.buffer.y,z=this.buffer.lines.get(Q);if(!z)return;const oe=Math.min(this.buffer.x,this.cols-1),ge=this._renderService.dimensions.css.cell.height,Se=z.getWidth(oe),ye=this._renderService.dimensions.css.cell.width*Se,Pe=this.buffer.y*this._renderService.dimensions.css.cell.height,qe=oe*this._renderService.dimensions.css.cell.width;this.textarea.style.left=qe+"px",this.textarea.style.top=Pe+"px",this.textarea.style.width=ye+"px",this.textarea.style.height=ge+"px",this.textarea.style.lineHeight=ge+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,y.addDisposableDomListener)(this.element,"copy",(z=>{this.hasSelection()&&(0,h.copyHandler)(z,this._selectionService)})));const Q=z=>(0,h.handlePasteEvent)(z,this.textarea,this.coreService,this.optionsService);this.register((0,y.addDisposableDomListener)(this.textarea,"paste",Q)),this.register((0,y.addDisposableDomListener)(this.element,"paste",Q)),te.isFirefox?this.register((0,y.addDisposableDomListener)(this.element,"mousedown",(z=>{z.button===2&&(0,h.rightClickHandler)(z,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,y.addDisposableDomListener)(this.element,"contextmenu",(z=>{(0,h.rightClickHandler)(z,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),te.isLinux&&this.register((0,y.addDisposableDomListener)(this.element,"auxclick",(z=>{z.button===1&&(0,h.moveTextAreaUnderMouseCursor)(z,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,y.addDisposableDomListener)(this.textarea,"keyup",(Q=>this._keyUp(Q)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keydown",(Q=>this._keyDown(Q)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keypress",(Q=>this._keyPress(Q)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionupdate",(Q=>this._compositionHelper.compositionupdate(Q)))),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,y.addDisposableDomListener)(this.textarea,"input",(Q=>this._inputEvent(Q)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(Q){if(!Q)throw new Error("Terminal requires a parent element.");if(Q.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=Q.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),Q.appendChild(this.element);const z=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),z.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,y.addDisposableDomListener)(this.screenElement,"mousemove",(oe=>this.updateCursorStyle(oe)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),z.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",C.promptLabel),te.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.register(this._instantiationService.createInstance(L.CoreBrowserService,this.textarea,Q.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(O.ICoreBrowserService,this._coreBrowserService),this.register((0,y.addDisposableDomListener)(this.textarea,"focus",(oe=>this._handleTextAreaFocus(oe)))),this.register((0,y.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(b.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(O.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(U.ThemeService),this._instantiationService.setService(O.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(E.CharacterJoinerService),this._instantiationService.setService(O.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(M.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(O.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((oe=>this._onRender.fire(oe)))),this.onResize((oe=>this._renderService.resize(oe.cols,oe.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(v.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(R.MouseService),this._instantiationService.setService(O.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(g.Linkifier,this.screenElement)),this.element.appendChild(z);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(A.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((oe=>this.scrollLines(oe.amount,oe.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(k.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(O.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((oe=>this.scrollLines(oe.amount,oe.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((oe=>this._renderService.handleSelectionChanged(oe.start,oe.end,oe.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((oe=>{this.textarea.value=oe,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((oe=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,y.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(x.BufferDecorationRenderer,this.screenElement)),this.register((0,y.addDisposableDomListener)(this.element,"mousedown",(oe=>this._selectionService.handleMouseDown(oe)))),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(Z.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(oe=>this._handleScreenReaderModeOptionChange(oe)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(d.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(oe=>{!this._overviewRulerRenderer&&oe&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(d.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(f.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const Q=this,z=this.element;function oe(ye){const Pe=Q._mouseService.getMouseReportCoords(ye,Q.screenElement);if(!Pe)return!1;let qe,Xe;switch(ye.overrideType||ye.type){case"mousemove":Xe=32,ye.buttons===void 0?(qe=3,ye.button!==void 0&&(qe=ye.button<3?ye.button:3)):qe=1&ye.buttons?0:4&ye.buttons?1:2&ye.buttons?2:3;break;case"mouseup":Xe=0,qe=ye.button<3?ye.button:3;break;case"mousedown":Xe=1,qe=ye.button<3?ye.button:3;break;case"wheel":if(Q._customWheelEventHandler&&Q._customWheelEventHandler(ye)===!1||Q.viewport.getLinesScrolled(ye)===0)return!1;Xe=ye.deltaY<0?0:1,qe=4;break;default:return!1}return!(Xe===void 0||qe===void 0||qe>4)&&Q.coreMouseService.triggerMouseEvent({col:Pe.col,row:Pe.row,x:Pe.x,y:Pe.y,button:qe,action:Xe,ctrl:ye.ctrlKey,alt:ye.altKey,shift:ye.shiftKey})}const ge={mouseup:null,wheel:null,mousedrag:null,mousemove:null},Se={mouseup:ye=>(oe(ye),ye.buttons||(this._document.removeEventListener("mouseup",ge.mouseup),ge.mousedrag&&this._document.removeEventListener("mousemove",ge.mousedrag)),this.cancel(ye)),wheel:ye=>(oe(ye),this.cancel(ye,!0)),mousedrag:ye=>{ye.buttons&&oe(ye)},mousemove:ye=>{ye.buttons||oe(ye)}};this.register(this.coreMouseService.onProtocolChange((ye=>{ye?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(ye)),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&ye?ge.mousemove||(z.addEventListener("mousemove",Se.mousemove),ge.mousemove=Se.mousemove):(z.removeEventListener("mousemove",ge.mousemove),ge.mousemove=null),16&ye?ge.wheel||(z.addEventListener("wheel",Se.wheel,{passive:!1}),ge.wheel=Se.wheel):(z.removeEventListener("wheel",ge.wheel),ge.wheel=null),2&ye?ge.mouseup||(ge.mouseup=Se.mouseup):(this._document.removeEventListener("mouseup",ge.mouseup),ge.mouseup=null),4&ye?ge.mousedrag||(ge.mousedrag=Se.mousedrag):(this._document.removeEventListener("mousemove",ge.mousedrag),ge.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,y.addDisposableDomListener)(z,"mousedown",(ye=>{if(ye.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(ye))return oe(ye),ge.mouseup&&this._document.addEventListener("mouseup",ge.mouseup),ge.mousedrag&&this._document.addEventListener("mousemove",ge.mousedrag),this.cancel(ye)}))),this.register((0,y.addDisposableDomListener)(z,"wheel",(ye=>{if(!ge.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(ye)===!1)return!1;if(!this.buffer.hasScrollback){const Pe=this.viewport.getLinesScrolled(ye);if(Pe===0)return;const qe=W.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(ye.deltaY<0?"A":"B");let Xe="";for(let xt=0;xt<Math.abs(Pe);xt++)Xe+=qe;return this.coreService.triggerDataEvent(Xe,!0),this.cancel(ye,!0)}return this.viewport.handleWheel(ye)?this.cancel(ye):void 0}}),{passive:!1})),this.register((0,y.addDisposableDomListener)(z,"touchstart",(ye=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(ye),this.cancel(ye)}),{passive:!0})),this.register((0,y.addDisposableDomListener)(z,"touchmove",(ye=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(ye)?void 0:this.cancel(ye)}),{passive:!1}))}refresh(Q,z){this._renderService?.refreshRows(Q,z)}updateCursorStyle(Q){this._selectionService?.shouldColumnSelect(Q)?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(Q,z,oe=0){oe===1?(super.scrollLines(Q,z,oe),this.refresh(0,this.rows-1)):this.viewport?.scrollLines(Q)}paste(Q){(0,h.paste)(Q,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(Q){this._customKeyEventHandler=Q}attachCustomWheelEventHandler(Q){this._customWheelEventHandler=Q}registerLinkProvider(Q){return this._linkProviderService.registerLinkProvider(Q)}registerCharacterJoiner(Q){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const z=this._characterJoinerService.register(Q);return this.refresh(0,this.rows-1),z}deregisterCharacterJoiner(Q){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(Q)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(Q){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+Q)}registerDecoration(Q){return this._decorationService.registerDecoration(Q)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(Q,z,oe){this._selectionService.setSelection(Q,z,oe)}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(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(Q,z){this._selectionService?.selectLines(Q,z)}_keyDown(Q){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(Q)===!1)return!1;const z=this.browser.isMac&&this.options.macOptionIsMeta&&Q.altKey;if(!z&&!this._compositionHelper.keydown(Q))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;z||Q.key!=="Dead"&&Q.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const oe=(0,Y.evaluateKeyboardEvent)(Q,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(Q),oe.type===3||oe.type===2){const ge=this.rows-1;return this.scrollLines(oe.type===2?-ge:ge),this.cancel(Q,!0)}return oe.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,Q)||(oe.cancel&&this.cancel(Q,!0),!oe.key||!!(Q.key&&!Q.ctrlKey&&!Q.altKey&&!Q.metaKey&&Q.key.length===1&&Q.key.charCodeAt(0)>=65&&Q.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(oe.key!==W.C0.ETX&&oe.key!==W.C0.CR||(this.textarea.value=""),this._onKey.fire({key:oe.key,domEvent:Q}),this._showCursor(),this.coreService.triggerDataEvent(oe.key,!0),!this.optionsService.rawOptions.screenReaderMode||Q.altKey||Q.ctrlKey?this.cancel(Q,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(Q,z){const oe=Q.isMac&&!this.options.macOptionIsMeta&&z.altKey&&!z.ctrlKey&&!z.metaKey||Q.isWindows&&z.altKey&&z.ctrlKey&&!z.metaKey||Q.isWindows&&z.getModifierState("AltGraph");return z.type==="keypress"?oe:oe&&(!z.keyCode||z.keyCode>47)}_keyUp(Q){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(Q)===!1||((function(z){return z.keyCode===16||z.keyCode===17||z.keyCode===18})(Q)||this.focus(),this.updateCursorStyle(Q),this._keyPressHandled=!1)}_keyPress(Q){let z;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(Q)===!1)return!1;if(this.cancel(Q),Q.charCode)z=Q.charCode;else if(Q.which===null||Q.which===void 0)z=Q.keyCode;else{if(Q.which===0||Q.charCode===0)return!1;z=Q.which}return!(!z||(Q.altKey||Q.ctrlKey||Q.metaKey)&&!this._isThirdLevelShift(this.browser,Q)||(z=String.fromCharCode(z),this._onKey.fire({key:z,domEvent:Q}),this._showCursor(),this.coreService.triggerDataEvent(z,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(Q){if(Q.data&&Q.inputType==="insertText"&&(!Q.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const z=Q.data;return this.coreService.triggerDataEvent(z,!0),this.cancel(Q),!0}return!1}resize(Q,z){Q!==this.cols||z!==this.rows?super.resize(Q,z):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(Q,z){this._charSizeService?.measure(),this.viewport?.syncScrollArea(!0)}clear(){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 Q=1;Q<this.rows;Q++)this.buffer.lines.push(this.buffer.getBlankLine(q.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),this.viewport?.reset(),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;const Q=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this.viewport?.reset(),this._customKeyEventHandler=Q,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(W.C0.ESC+"[I"):this.coreService.triggerDataEvent(W.C0.ESC+"[O")}_reportWindowsOptions(Q){if(this._renderService)switch(Q){case P.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const z=this._renderService.dimensions.css.canvas.width.toFixed(0),oe=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${W.C0.ESC}[4;${oe};${z}t`);break;case P.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ge=this._renderService.dimensions.css.cell.width.toFixed(0),Se=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${W.C0.ESC}[6;${Se};${ge}t`)}}cancel(Q,z){if(this.options.cancelEvents||z)return Q.preventDefault(),Q.stopPropagation(),!1}}c.Terminal=ce},9924:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.TimeBasedDebouncer=void 0,c.TimeBasedDebouncer=class{constructor(u,h=1e3){this._renderCallback=u,this._debounceThresholdMS=h,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(u,h,y){this._rowCount=y,u=u!==void 0?u:0,h=h!==void 0?h: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,h):h;const g=Date.now();if(g-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=g,this._innerRefresh();else if(!this._additionalRefreshRequested){const C=g-this._lastRefreshMs,T=this._debounceThresholdMS-C;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),T)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const u=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,h)}}},1680:function(m,c,u){var h=this&&this.__decorate||function(v,f,b,E){var L,R=arguments.length,M=R<3?f:E===null?E=Object.getOwnPropertyDescriptor(f,b):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(v,f,b,E);else for(var k=v.length-1;k>=0;k--)(L=v[k])&&(M=(R<3?L(M):R>3?L(f,b,M):L(f,b))||M);return R>3&&M&&Object.defineProperty(f,b,M),M},y=this&&this.__param||function(v,f){return function(b,E){f(b,E,v)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Viewport=void 0;const g=u(3656),C=u(4725),T=u(8460),A=u(844),x=u(2585);let d=c.Viewport=class extends A.Disposable{constructor(v,f,b,E,L,R,M,k){super(),this._viewportElement=v,this._scrollArea=f,this._bufferService=b,this._optionsService=E,this._charSizeService=L,this._renderService=R,this._coreBrowserService=M,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 T.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,g.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((O=>this._activeBuffer=O.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((O=>this._renderDimensions=O))),this._handleThemeChange(k.colors),this.register(k.onChangeColors((O=>this._handleThemeChange(O)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(v){this._viewportElement.style.backgroundColor=v.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(v){if(v)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._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const f=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==f&&(this._lastRecordedBufferHeight=f,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const v=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==v&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=v),this._refreshAnimationFrame=null}syncScrollArea(v=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(v);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(v)}_handleScroll(v){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 f=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:f,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const v=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(v*(this._smoothScrollState.target-this._smoothScrollState.origin)),v<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(v,f){const b=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(f<0&&this._viewportElement.scrollTop!==0||f>0&&b<this._lastRecordedBufferHeight)||(v.cancelable&&v.preventDefault(),!1)}handleWheel(v){const f=this._getPixelsScrolled(v);return f!==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+f:this._smoothScrollState.target+=f,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=f,this._bubbleScroll(v,f))}scrollLines(v){if(v!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const f=v*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+f,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:v,suppressScrollEvent:!1})}_getPixelsScrolled(v){if(v.deltaY===0||v.shiftKey)return 0;let f=this._applyScrollModifier(v.deltaY,v);return v.deltaMode===WheelEvent.DOM_DELTA_LINE?f*=this._currentRowHeight:v.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(f*=this._currentRowHeight*this._bufferService.rows),f}getBufferElements(v,f){let b,E="";const L=[],R=f??this._bufferService.buffer.lines.length,M=this._bufferService.buffer.lines;for(let k=v;k<R;k++){const O=M.get(k);if(!O)continue;const U=M.get(k+1)?.isWrapped;if(E+=O.translateToString(!U),!U||k===M.length-1){const F=document.createElement("div");F.textContent=E,L.push(F),E.length>0&&(b=F),E=""}}return{bufferElements:L,cursorElement:b}}getLinesScrolled(v){if(v.deltaY===0||v.shiftKey)return 0;let f=this._applyScrollModifier(v.deltaY,v);return v.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(f/=this._currentRowHeight+0,this._wheelPartialScroll+=f,f=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):v.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(f*=this._bufferService.rows),f}_applyScrollModifier(v,f){const b=this._optionsService.rawOptions.fastScrollModifier;return b==="alt"&&f.altKey||b==="ctrl"&&f.ctrlKey||b==="shift"&&f.shiftKey?v*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:v*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(v){this._lastTouchY=v.touches[0].pageY}handleTouchMove(v){const f=this._lastTouchY-v.touches[0].pageY;return this._lastTouchY=v.touches[0].pageY,f!==0&&(this._viewportElement.scrollTop+=f,this._bubbleScroll(v,f))}};c.Viewport=d=h([y(2,x.IBufferService),y(3,x.IOptionsService),y(4,C.ICharSizeService),y(5,C.IRenderService),y(6,C.ICoreBrowserService),y(7,C.IThemeService)],d)},3107:function(m,c,u){var h=this&&this.__decorate||function(x,d,v,f){var b,E=arguments.length,L=E<3?d:f===null?f=Object.getOwnPropertyDescriptor(d,v):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(x,d,v,f);else for(var R=x.length-1;R>=0;R--)(b=x[R])&&(L=(E<3?b(L):E>3?b(d,v,L):b(d,v))||L);return E>3&&L&&Object.defineProperty(d,v,L),L},y=this&&this.__param||function(x,d){return function(v,f){d(v,f,x)}};Object.defineProperty(c,"__esModule",{value:!0}),c.BufferDecorationRenderer=void 0;const g=u(4725),C=u(844),T=u(2585);let A=c.BufferDecorationRenderer=class extends C.Disposable{constructor(x,d,v,f,b){super(),this._screenElement=x,this._bufferService=d,this._coreBrowserService=v,this._decorationService=f,this._renderService=b,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(this._coreBrowserService.onDprChange((()=>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((E=>this._removeDecoration(E)))),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 x of this._decorationService.decorations)this._renderDecoration(x);this._dimensionsChanged=!1}_renderDecoration(x){this._refreshStyle(x),this._dimensionsChanged&&this._refreshXPosition(x)}_createElement(x){const d=this._coreBrowserService.mainDocument.createElement("div");d.classList.add("xterm-decoration"),d.classList.toggle("xterm-decoration-top-layer",x?.options?.layer==="top"),d.style.width=`${Math.round((x.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,d.style.height=(x.options.height||1)*this._renderService.dimensions.css.cell.height+"px",d.style.top=(x.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",d.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const v=x.options.x??0;return v&&v>this._bufferService.cols&&(d.style.display="none"),this._refreshXPosition(x,d),d}_refreshStyle(x){const d=x.marker.line-this._bufferService.buffers.active.ydisp;if(d<0||d>=this._bufferService.rows)x.element&&(x.element.style.display="none",x.onRenderEmitter.fire(x.element));else{let v=this._decorationElements.get(x);v||(v=this._createElement(x),x.element=v,this._decorationElements.set(x,v),this._container.appendChild(v),x.onDispose((()=>{this._decorationElements.delete(x),v.remove()}))),v.style.top=d*this._renderService.dimensions.css.cell.height+"px",v.style.display=this._altBufferIsActive?"none":"block",x.onRenderEmitter.fire(v)}}_refreshXPosition(x,d=x.element){if(!d)return;const v=x.options.x??0;(x.options.anchor||"left")==="right"?d.style.right=v?v*this._renderService.dimensions.css.cell.width+"px":"":d.style.left=v?v*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(x){this._decorationElements.get(x)?.remove(),this._decorationElements.delete(x),x.dispose()}};c.BufferDecorationRenderer=A=h([y(1,T.IBufferService),y(2,g.ICoreBrowserService),y(3,T.IDecorationService),y(4,g.IRenderService)],A)},5871:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ColorZoneStore=void 0,c.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 h of this._zones)if(h.color===u.options.overviewRulerOptions.color&&h.position===u.options.overviewRulerOptions.position){if(this._lineIntersectsZone(h,u.marker.line))return;if(this._lineAdjacentToZone(h,u.marker.line,u.options.overviewRulerOptions.position))return void this._addLineToZone(h,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,h){return h>=u.startBufferLine&&h<=u.endBufferLine}_lineAdjacentToZone(u,h,y){return h>=u.startBufferLine-this._linePadding[y||"full"]&&h<=u.endBufferLine+this._linePadding[y||"full"]}_addLineToZone(u,h){u.startBufferLine=Math.min(u.startBufferLine,h),u.endBufferLine=Math.max(u.endBufferLine,h)}}},5744:function(m,c,u){var h=this&&this.__decorate||function(b,E,L,R){var M,k=arguments.length,O=k<3?E:R===null?R=Object.getOwnPropertyDescriptor(E,L):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(b,E,L,R);else for(var U=b.length-1;U>=0;U--)(M=b[U])&&(O=(k<3?M(O):k>3?M(E,L,O):M(E,L))||O);return k>3&&O&&Object.defineProperty(E,L,O),O},y=this&&this.__param||function(b,E){return function(L,R){E(L,R,b)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OverviewRulerRenderer=void 0;const g=u(5871),C=u(4725),T=u(844),A=u(2585),x={full:0,left:0,center:0,right:0},d={full:0,left:0,center:0,right:0},v={full:0,left:0,center:0,right:0};let f=c.OverviewRulerRenderer=class extends T.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(b,E,L,R,M,k,O){super(),this._viewportElement=b,this._screenElement=E,this._bufferService=L,this._decorationService=R,this._renderService=M,this._optionsService=k,this._coreBrowserService=O,this._colorZoneStore=new g.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement);const U=this._canvas.getContext("2d");if(!U)throw new Error("Ctx cannot be null");this._ctx=U,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,T.toDisposable)((()=>{this._canvas?.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(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const b=Math.floor(this._canvas.width/3),E=Math.ceil(this._canvas.width/3);d.full=this._canvas.width,d.left=b,d.center=E,d.right=b,this._refreshDrawHeightConstants(),v.full=0,v.left=0,v.center=d.left,v.right=d.left+d.center}_refreshDrawHeightConstants(){x.full=Math.round(2*this._coreBrowserService.dpr);const b=this._canvas.height/this._bufferService.buffer.lines.length,E=Math.round(Math.max(Math.min(b,12),6)*this._coreBrowserService.dpr);x.left=E,x.center=E,x.right=E}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.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._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.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 E of this._decorationService.decorations)this._colorZoneStore.addDecoration(E);this._ctx.lineWidth=1;const b=this._colorZoneStore.zones;for(const E of b)E.position!=="full"&&this._renderColorZone(E);for(const E of b)E.position==="full"&&this._renderColorZone(E);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(b){this._ctx.fillStyle=b.color,this._ctx.fillRect(v[b.position||"full"],Math.round((this._canvas.height-1)*(b.startBufferLine/this._bufferService.buffers.active.lines.length)-x[b.position||"full"]/2),d[b.position||"full"],Math.round((this._canvas.height-1)*((b.endBufferLine-b.startBufferLine)/this._bufferService.buffers.active.lines.length)+x[b.position||"full"]))}_queueRefresh(b,E){this._shouldUpdateDimensions=b||this._shouldUpdateDimensions,this._shouldUpdateAnchor=E||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};c.OverviewRulerRenderer=f=h([y(2,A.IBufferService),y(3,A.IDecorationService),y(4,C.IRenderService),y(5,A.IOptionsService),y(6,C.ICoreBrowserService)],f)},2950:function(m,c,u){var h=this&&this.__decorate||function(x,d,v,f){var b,E=arguments.length,L=E<3?d:f===null?f=Object.getOwnPropertyDescriptor(d,v):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(x,d,v,f);else for(var R=x.length-1;R>=0;R--)(b=x[R])&&(L=(E<3?b(L):E>3?b(d,v,L):b(d,v))||L);return E>3&&L&&Object.defineProperty(d,v,L),L},y=this&&this.__param||function(x,d){return function(v,f){d(v,f,x)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CompositionHelper=void 0;const g=u(4725),C=u(2585),T=u(2584);let A=c.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(x,d,v,f,b,E){this._textarea=x,this._compositionView=d,this._bufferService=v,this._optionsService=f,this._coreService=b,this._renderService=E,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(x){this._compositionView.textContent=x.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(x){if(this._isComposing||this._isSendingComposition){if(x.keyCode===229||x.keyCode===16||x.keyCode===17||x.keyCode===18)return!1;this._finalizeComposition(!1)}return x.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(x){if(this._compositionView.classList.remove("active"),this._isComposing=!1,x){const d={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let v;this._isSendingComposition=!1,d.start+=this._dataAlreadySent.length,v=this._isComposing?this._textarea.value.substring(d.start,d.end):this._textarea.value.substring(d.start),v.length>0&&this._coreService.triggerDataEvent(v,!0)}}),0)}else{this._isSendingComposition=!1;const d=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(d,!0)}}_handleAnyTextareaChanges(){const x=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const d=this._textarea.value,v=d.replace(x,"");this._dataAlreadySent=v,d.length>x.length?this._coreService.triggerDataEvent(v,!0):d.length<x.length?this._coreService.triggerDataEvent(`${T.C0.DEL}`,!0):d.length===x.length&&d!==x&&this._coreService.triggerDataEvent(d,!0)}}),0)}updateCompositionElements(x){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const d=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),v=this._renderService.dimensions.css.cell.height,f=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,b=d*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=b+"px",this._compositionView.style.top=f+"px",this._compositionView.style.height=v+"px",this._compositionView.style.lineHeight=v+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const E=this._compositionView.getBoundingClientRect();this._textarea.style.left=b+"px",this._textarea.style.top=f+"px",this._textarea.style.width=Math.max(E.width,1)+"px",this._textarea.style.height=Math.max(E.height,1)+"px",this._textarea.style.lineHeight=E.height+"px"}x||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};c.CompositionHelper=A=h([y(2,C.IBufferService),y(3,C.IOptionsService),y(4,C.ICoreService),y(5,g.IRenderService)],A)},9806:(m,c)=>{function u(h,y,g){const C=g.getBoundingClientRect(),T=h.getComputedStyle(g),A=parseInt(T.getPropertyValue("padding-left")),x=parseInt(T.getPropertyValue("padding-top"));return[y.clientX-C.left-A,y.clientY-C.top-x]}Object.defineProperty(c,"__esModule",{value:!0}),c.getCoords=c.getCoordsRelativeToElement=void 0,c.getCoordsRelativeToElement=u,c.getCoords=function(h,y,g,C,T,A,x,d,v){if(!A)return;const f=u(h,y,g);return f?(f[0]=Math.ceil((f[0]+(v?x/2:0))/x),f[1]=Math.ceil(f[1]/d),f[0]=Math.min(Math.max(f[0],1),C+(v?1:0)),f[1]=Math.min(Math.max(f[1],1),T),f):void 0}},9504:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.moveToCellSequence=void 0;const h=u(2584);function y(d,v,f,b){const E=d-g(d,f),L=v-g(v,f),R=Math.abs(E-L)-(function(M,k,O){let U=0;const F=M-g(M,O),G=k-g(k,O);for(let I=0;I<Math.abs(F-G);I++){const K=C(M,k)==="A"?-1:1;O.buffer.lines.get(F+K*I)?.isWrapped&&U++}return U})(d,v,f);return x(R,A(C(d,v),b))}function g(d,v){let f=0,b=v.buffer.lines.get(d),E=b?.isWrapped;for(;E&&d>=0&&d<v.rows;)f++,b=v.buffer.lines.get(--d),E=b?.isWrapped;return f}function C(d,v){return d>v?"A":"B"}function T(d,v,f,b,E,L){let R=d,M=v,k="";for(;R!==f||M!==b;)R+=E?1:-1,E&&R>L.cols-1?(k+=L.buffer.translateBufferLineToString(M,!1,d,R),R=0,d=0,M++):!E&&R<0&&(k+=L.buffer.translateBufferLineToString(M,!1,0,d+1),R=L.cols-1,d=R,M--);return k+L.buffer.translateBufferLineToString(M,!1,d,R)}function A(d,v){const f=v?"O":"[";return h.C0.ESC+f+d}function x(d,v){d=Math.floor(d);let f="";for(let b=0;b<d;b++)f+=v;return f}c.moveToCellSequence=function(d,v,f,b){const E=f.buffer.x,L=f.buffer.y;if(!f.buffer.hasScrollback)return(function(k,O,U,F,G,I){return y(O,F,G,I).length===0?"":x(T(k,O,k,O-g(O,G),!1,G).length,A("D",I))})(E,L,0,v,f,b)+y(L,v,f,b)+(function(k,O,U,F,G,I){let K;K=y(O,F,G,I).length>0?F-g(F,G):O;const te=F,q=(function(W,Y,B,$,N,P){let Z;return Z=y(B,$,N,P).length>0?$-g($,N):Y,W<B&&Z<=$||W>=B&&Z<$?"C":"D"})(k,O,U,F,G,I);return x(T(k,K,U,te,q==="C",G).length,A(q,I))})(E,L,d,v,f,b);let R;if(L===v)return R=E>d?"D":"C",x(Math.abs(E-d),A(R,b));R=L>v?"D":"C";const M=Math.abs(L-v);return x((function(k,O){return O.cols-k})(L>v?d:E,f)+(M-1)*f.cols+1+((L>v?E:d)-1),A(R,b))}},1296:function(m,c,u){var h=this&&this.__decorate||function(I,K,te,q){var W,Y=arguments.length,B=Y<3?K:q===null?q=Object.getOwnPropertyDescriptor(K,te):q;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(I,K,te,q);else for(var $=I.length-1;$>=0;$--)(W=I[$])&&(B=(Y<3?W(B):Y>3?W(K,te,B):W(K,te))||B);return Y>3&&B&&Object.defineProperty(K,te,B),B},y=this&&this.__param||function(I,K){return function(te,q){K(te,q,I)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRenderer=void 0;const g=u(3787),C=u(2550),T=u(2223),A=u(6171),x=u(6052),d=u(4725),v=u(8055),f=u(8460),b=u(844),E=u(2585),L="xterm-dom-renderer-owner-",R="xterm-rows",M="xterm-fg-",k="xterm-bg-",O="xterm-focus",U="xterm-selection";let F=1,G=c.DomRenderer=class extends b.Disposable{constructor(I,K,te,q,W,Y,B,$,N,P,Z,ae,ce){super(),this._terminal=I,this._document=K,this._element=te,this._screenElement=q,this._viewportElement=W,this._helperContainer=Y,this._linkifier2=B,this._charSizeService=N,this._optionsService=P,this._bufferService=Z,this._coreBrowserService=ae,this._themeService=ce,this._terminalClass=F++,this._rowElements=[],this._selectionRenderModel=(0,x.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new f.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(R),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(U),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,A.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((_e=>this._injectCss(_e)))),this._injectCss(this._themeService.colors),this._rowFactory=$.createInstance(g.DomRendererRowFactory,document),this._element.classList.add(L+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((_e=>this._handleLinkHover(_e)))),this.register(this._linkifier2.onHideLinkUnderline((_e=>this._handleLinkLeave(_e)))),this.register((0,b.toDisposable)((()=>{this._element.classList.remove(L+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new C.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const I=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*I,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*I),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/I),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/I),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 te of this._rowElements)te.style.width=`${this.dimensions.css.canvas.width}px`,te.style.height=`${this.dimensions.css.cell.height}px`,te.style.lineHeight=`${this.dimensions.css.cell.height}px`,te.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const K=`${this._terminalSelector} .${R} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=K,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(I){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let K=`${this._terminalSelector} .${R} { color: ${I.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;K+=`${this._terminalSelector} .${R} .xterm-dim { color: ${v.color.multiplyOpacity(I.foreground,.5).css};}`,K+=`${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;}`;const te=`blink_underline_${this._terminalClass}`,q=`blink_bar_${this._terminalClass}`,W=`blink_block_${this._terminalClass}`;K+=`@keyframes ${te} { 50% { border-bottom-style: hidden; }}`,K+=`@keyframes ${q} { 50% { box-shadow: none; }}`,K+=`@keyframes ${W} { 0% { background-color: ${I.cursor.css}; color: ${I.cursorAccent.css}; } 50% { background-color: inherit; color: ${I.cursor.css}; }}`,K+=`${this._terminalSelector} .${R}.${O} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${te} 1s step-end infinite;}${this._terminalSelector} .${R}.${O} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${q} 1s step-end infinite;}${this._terminalSelector} .${R}.${O} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${W} 1s step-end infinite;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block { background-color: ${I.cursor.css}; color: ${I.cursorAccent.css};}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${I.cursor.css} !important; color: ${I.cursorAccent.css} !important;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${I.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${I.cursor.css} inset;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${I.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,K+=`${this._terminalSelector} .${U} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${U} div { position: absolute; background-color: ${I.selectionBackgroundOpaque.css};}${this._terminalSelector} .${U} div { position: absolute; background-color: ${I.selectionInactiveBackgroundOpaque.css};}`;for(const[Y,B]of I.ansi.entries())K+=`${this._terminalSelector} .${M}${Y} { color: ${B.css}; }${this._terminalSelector} .${M}${Y}.xterm-dim { color: ${v.color.multiplyOpacity(B,.5).css}; }${this._terminalSelector} .${k}${Y} { background-color: ${B.css}; }`;K+=`${this._terminalSelector} .${M}${T.INVERTED_DEFAULT_COLOR} { color: ${v.color.opaque(I.background).css}; }${this._terminalSelector} .${M}${T.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${v.color.multiplyOpacity(v.color.opaque(I.background),.5).css}; }${this._terminalSelector} .${k}${T.INVERTED_DEFAULT_COLOR} { background-color: ${I.foreground.css}; }`,this._themeStyleElement.textContent=K}_setDefaultSpacing(){const I=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${I}px`,this._rowFactory.defaultSpacing=I}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(I,K){for(let te=this._rowElements.length;te<=K;te++){const q=this._document.createElement("div");this._rowContainer.appendChild(q),this._rowElements.push(q)}for(;this._rowElements.length>K;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(I,K){this._refreshRowElements(I,K),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(O),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(O),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(I,K,te){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(I,K,te),this.renderRows(0,this._bufferService.rows-1),!I||!K)return;this._selectionRenderModel.update(this._terminal,I,K,te);const q=this._selectionRenderModel.viewportStartRow,W=this._selectionRenderModel.viewportEndRow,Y=this._selectionRenderModel.viewportCappedStartRow,B=this._selectionRenderModel.viewportCappedEndRow;if(Y>=this._bufferService.rows||B<0)return;const $=this._document.createDocumentFragment();if(te){const N=I[0]>K[0];$.appendChild(this._createSelectionElement(Y,N?K[0]:I[0],N?I[0]:K[0],B-Y+1))}else{const N=q===Y?I[0]:0,P=Y===W?K[0]:this._bufferService.cols;$.appendChild(this._createSelectionElement(Y,N,P));const Z=B-Y-1;if($.appendChild(this._createSelectionElement(Y+1,0,this._bufferService.cols,Z)),Y!==B){const ae=W===B?K[0]:this._bufferService.cols;$.appendChild(this._createSelectionElement(B,0,ae))}}this._selectionContainer.appendChild($)}_createSelectionElement(I,K,te,q=1){const W=this._document.createElement("div"),Y=K*this.dimensions.css.cell.width;let B=this.dimensions.css.cell.width*(te-K);return Y+B>this.dimensions.css.canvas.width&&(B=this.dimensions.css.canvas.width-Y),W.style.height=q*this.dimensions.css.cell.height+"px",W.style.top=I*this.dimensions.css.cell.height+"px",W.style.left=`${Y}px`,W.style.width=`${B}px`,W}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const I of this._rowElements)I.replaceChildren()}renderRows(I,K){const te=this._bufferService.buffer,q=te.ybase+te.y,W=Math.min(te.x,this._bufferService.cols-1),Y=this._optionsService.rawOptions.cursorBlink,B=this._optionsService.rawOptions.cursorStyle,$=this._optionsService.rawOptions.cursorInactiveStyle;for(let N=I;N<=K;N++){const P=N+te.ydisp,Z=this._rowElements[N],ae=te.lines.get(P);if(!Z||!ae)break;Z.replaceChildren(...this._rowFactory.createRow(ae,P,P===q,B,$,W,Y,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${L}${this._terminalClass}`}_handleLinkHover(I){this._setCellUnderline(I.x1,I.x2,I.y1,I.y2,I.cols,!0)}_handleLinkLeave(I){this._setCellUnderline(I.x1,I.x2,I.y1,I.y2,I.cols,!1)}_setCellUnderline(I,K,te,q,W,Y){te<0&&(I=0),q<0&&(K=0);const B=this._bufferService.rows-1;te=Math.max(Math.min(te,B),0),q=Math.max(Math.min(q,B),0),W=Math.min(W,this._bufferService.cols);const $=this._bufferService.buffer,N=$.ybase+$.y,P=Math.min($.x,W-1),Z=this._optionsService.rawOptions.cursorBlink,ae=this._optionsService.rawOptions.cursorStyle,ce=this._optionsService.rawOptions.cursorInactiveStyle;for(let _e=te;_e<=q;++_e){const Q=_e+$.ydisp,z=this._rowElements[_e],oe=$.lines.get(Q);if(!z||!oe)break;z.replaceChildren(...this._rowFactory.createRow(oe,Q,Q===N,ae,ce,P,Z,this.dimensions.css.cell.width,this._widthCache,Y?_e===te?I:0:-1,Y?(_e===q?K:W)-1:-1))}}};c.DomRenderer=G=h([y(7,E.IInstantiationService),y(8,d.ICharSizeService),y(9,E.IOptionsService),y(10,E.IBufferService),y(11,d.ICoreBrowserService),y(12,d.IThemeService)],G)},3787:function(m,c,u){var h=this&&this.__decorate||function(R,M,k,O){var U,F=arguments.length,G=F<3?M:O===null?O=Object.getOwnPropertyDescriptor(M,k):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")G=Reflect.decorate(R,M,k,O);else for(var I=R.length-1;I>=0;I--)(U=R[I])&&(G=(F<3?U(G):F>3?U(M,k,G):U(M,k))||G);return F>3&&G&&Object.defineProperty(M,k,G),G},y=this&&this.__param||function(R,M){return function(k,O){M(k,O,R)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRendererRowFactory=void 0;const g=u(2223),C=u(643),T=u(511),A=u(2585),x=u(8055),d=u(4725),v=u(4269),f=u(6171),b=u(3734);let E=c.DomRendererRowFactory=class{constructor(R,M,k,O,U,F,G){this._document=R,this._characterJoinerService=M,this._optionsService=k,this._coreBrowserService=O,this._coreService=U,this._decorationService=F,this._themeService=G,this._workCell=new T.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(R,M,k){this._selectionStart=R,this._selectionEnd=M,this._columnSelectMode=k}createRow(R,M,k,O,U,F,G,I,K,te,q){const W=[],Y=this._characterJoinerService.getJoinedCharacters(M),B=this._themeService.colors;let $,N=R.getNoBgTrimmedLength();k&&N<F+1&&(N=F+1);let P=0,Z="",ae=0,ce=0,_e=0,Q=!1,z=0,oe=!1,ge=0;const Se=[],ye=te!==-1&&q!==-1;for(let Pe=0;Pe<N;Pe++){R.loadCell(Pe,this._workCell);let qe=this._workCell.getWidth();if(qe===0)continue;let Xe=!1,xt=Pe,Ne=this._workCell;if(Y.length>0&&Pe===Y[0][0]){Xe=!0;const dt=Y.shift();Ne=new v.JoinedCellData(this._workCell,R.translateToString(!0,dt[0],dt[1]),dt[1]-dt[0]),xt=dt[1]-1,qe=Ne.getWidth()}const en=this._isCellInSelection(Pe,M),bn=k&&Pe===F,yn=ye&&Pe>=te&&Pe<=q;let pi=!1;this._decorationService.forEachDecorationAtCell(Pe,M,void 0,(dt=>{pi=!0}));let Mi=Ne.getChars()||C.WHITESPACE_CELL_CHAR;if(Mi===" "&&(Ne.isUnderline()||Ne.isOverline())&&(Mi=" "),ge=qe*I-K.get(Mi,Ne.isBold(),Ne.isItalic()),$){if(P&&(en&&oe||!en&&!oe&&Ne.bg===ae)&&(en&&oe&&B.selectionForeground||Ne.fg===ce)&&Ne.extended.ext===_e&&yn===Q&&ge===z&&!bn&&!Xe&&!pi){Ne.isInvisible()?Z+=C.WHITESPACE_CELL_CHAR:Z+=Mi,P++;continue}P&&($.textContent=Z),$=this._document.createElement("span"),P=0,Z=""}else $=this._document.createElement("span");if(ae=Ne.bg,ce=Ne.fg,_e=Ne.extended.ext,Q=yn,z=ge,oe=en,Xe&&F>=Pe&&F<=xt&&(F=Pe),!this._coreService.isCursorHidden&&bn&&this._coreService.isCursorInitialized){if(Se.push("xterm-cursor"),this._coreBrowserService.isFocused)G&&Se.push("xterm-cursor-blink"),Se.push(O==="bar"?"xterm-cursor-bar":O==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(U)switch(U){case"outline":Se.push("xterm-cursor-outline");break;case"block":Se.push("xterm-cursor-block");break;case"bar":Se.push("xterm-cursor-bar");break;case"underline":Se.push("xterm-cursor-underline")}}if(Ne.isBold()&&Se.push("xterm-bold"),Ne.isItalic()&&Se.push("xterm-italic"),Ne.isDim()&&Se.push("xterm-dim"),Z=Ne.isInvisible()?C.WHITESPACE_CELL_CHAR:Ne.getChars()||C.WHITESPACE_CELL_CHAR,Ne.isUnderline()&&(Se.push(`xterm-underline-${Ne.extended.underlineStyle}`),Z===" "&&(Z=" "),!Ne.isUnderlineColorDefault()))if(Ne.isUnderlineColorRGB())$.style.textDecorationColor=`rgb(${b.AttributeData.toColorRGB(Ne.getUnderlineColor()).join(",")})`;else{let dt=Ne.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Ne.isBold()&&dt<8&&(dt+=8),$.style.textDecorationColor=B.ansi[dt].css}Ne.isOverline()&&(Se.push("xterm-overline"),Z===" "&&(Z=" ")),Ne.isStrikethrough()&&Se.push("xterm-strikethrough"),yn&&($.style.textDecoration="underline");let tn=Ne.getFgColor(),ut=Ne.getFgColorMode(),Vt=Ne.getBgColor(),$t=Ne.getBgColorMode();const zt=!!Ne.isInverse();if(zt){const dt=tn;tn=Vt,Vt=dt;const Hn=ut;ut=$t,$t=Hn}let nn,Di,Mn,ni=!1;switch(this._decorationService.forEachDecorationAtCell(Pe,M,void 0,(dt=>{dt.options.layer!=="top"&&ni||(dt.backgroundColorRGB&&($t=50331648,Vt=dt.backgroundColorRGB.rgba>>8&16777215,nn=dt.backgroundColorRGB),dt.foregroundColorRGB&&(ut=50331648,tn=dt.foregroundColorRGB.rgba>>8&16777215,Di=dt.foregroundColorRGB),ni=dt.options.layer==="top")})),!ni&&en&&(nn=this._coreBrowserService.isFocused?B.selectionBackgroundOpaque:B.selectionInactiveBackgroundOpaque,Vt=nn.rgba>>8&16777215,$t=50331648,ni=!0,B.selectionForeground&&(ut=50331648,tn=B.selectionForeground.rgba>>8&16777215,Di=B.selectionForeground)),ni&&Se.push("xterm-decoration-top"),$t){case 16777216:case 33554432:Mn=B.ansi[Vt],Se.push(`xterm-bg-${Vt}`);break;case 50331648:Mn=x.channels.toColor(Vt>>16,Vt>>8&255,255&Vt),this._addStyle($,`background-color:#${L((Vt>>>0).toString(16),"0",6)}`);break;default:zt?(Mn=B.foreground,Se.push(`xterm-bg-${g.INVERTED_DEFAULT_COLOR}`)):Mn=B.background}switch(nn||Ne.isDim()&&(nn=x.color.multiplyOpacity(Mn,.5)),ut){case 16777216:case 33554432:Ne.isBold()&&tn<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(tn+=8),this._applyMinimumContrast($,Mn,B.ansi[tn],Ne,nn,void 0)||Se.push(`xterm-fg-${tn}`);break;case 50331648:const dt=x.channels.toColor(tn>>16&255,tn>>8&255,255&tn);this._applyMinimumContrast($,Mn,dt,Ne,nn,Di)||this._addStyle($,`color:#${L(tn.toString(16),"0",6)}`);break;default:this._applyMinimumContrast($,Mn,B.foreground,Ne,nn,Di)||zt&&Se.push(`xterm-fg-${g.INVERTED_DEFAULT_COLOR}`)}Se.length&&($.className=Se.join(" "),Se.length=0),bn||Xe||pi?$.textContent=Z:P++,ge!==this.defaultSpacing&&($.style.letterSpacing=`${ge}px`),W.push($),Pe=xt}return $&&P&&($.textContent=Z),W}_applyMinimumContrast(R,M,k,O,U,F){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,f.treatGlyphAsBackgroundColor)(O.getCode()))return!1;const G=this._getContrastCache(O);let I;if(U||F||(I=G.getColor(M.rgba,k.rgba)),I===void 0){const K=this._optionsService.rawOptions.minimumContrastRatio/(O.isDim()?2:1);I=x.color.ensureContrastRatio(U||M,F||k,K),G.setColor((U||M).rgba,(F||k).rgba,I??null)}return!!I&&(this._addStyle(R,`color:${I.css}`),!0)}_getContrastCache(R){return R.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(R,M){R.setAttribute("style",`${R.getAttribute("style")||""}${M};`)}_isCellInSelection(R,M){const k=this._selectionStart,O=this._selectionEnd;return!(!k||!O)&&(this._columnSelectMode?k[0]<=O[0]?R>=k[0]&&M>=k[1]&&R<O[0]&&M<=O[1]:R<k[0]&&M>=k[1]&&R>=O[0]&&M<=O[1]:M>k[1]&&M<O[1]||k[1]===O[1]&&M===k[1]&&R>=k[0]&&R<O[0]||k[1]<O[1]&&M===O[1]&&R<O[0]||k[1]<O[1]&&M===k[1]&&R>=k[0])}};function L(R,M,k){for(;R.length<k;)R=M+R;return R}c.DomRendererRowFactory=E=h([y(1,d.ICharacterJoinerService),y(2,A.IOptionsService),y(3,d.ICoreBrowserService),y(4,A.ICoreService),y(5,A.IDecorationService),y(6,d.IThemeService)],E)},2550:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.WidthCache=void 0,c.WidthCache=class{constructor(u,h){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.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const y=u.createElement("span");y.classList.add("xterm-char-measure-element");const g=u.createElement("span");g.classList.add("xterm-char-measure-element"),g.style.fontWeight="bold";const C=u.createElement("span");C.classList.add("xterm-char-measure-element"),C.style.fontStyle="italic";const T=u.createElement("span");T.classList.add("xterm-char-measure-element"),T.style.fontWeight="bold",T.style.fontStyle="italic",this._measureElements=[y,g,C,T],this._container.appendChild(y),this._container.appendChild(g),this._container.appendChild(C),this._container.appendChild(T),h.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,h,y,g){u===this._font&&h===this._fontSize&&y===this._weight&&g===this._weightBold||(this._font=u,this._fontSize=h,this._weight=y,this._weightBold=g,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${y}`,this._measureElements[1].style.fontWeight=`${g}`,this._measureElements[2].style.fontWeight=`${y}`,this._measureElements[3].style.fontWeight=`${g}`,this.clear())}get(u,h,y){let g=0;if(!h&&!y&&u.length===1&&(g=u.charCodeAt(0))<256){if(this._flat[g]!==-9999)return this._flat[g];const A=this._measure(u,0);return A>0&&(this._flat[g]=A),A}let C=u;h&&(C+="B"),y&&(C+="I");let T=this._holey.get(C);if(T===void 0){let A=0;h&&(A|=1),y&&(A|=2),T=this._measure(u,A),T>0&&this._holey.set(C,T)}return T}_measure(u,h){const y=this._measureElements[h];return y.textContent=u.repeat(32),y.offsetWidth/32}}},2223:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.TEXT_BASELINE=c.DIM_OPACITY=c.INVERTED_DEFAULT_COLOR=void 0;const h=u(6114);c.INVERTED_DEFAULT_COLOR=257,c.DIM_OPACITY=.5,c.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},6171:(m,c)=>{function u(y){return 57508<=y&&y<=57558}function h(y){return y>=128512&&y<=128591||y>=127744&&y<=128511||y>=128640&&y<=128767||y>=9728&&y<=9983||y>=9984&&y<=10175||y>=65024&&y<=65039||y>=129280&&y<=129535||y>=127462&&y<=127487}Object.defineProperty(c,"__esModule",{value:!0}),c.computeNextVariantOffset=c.createRenderDimensions=c.treatGlyphAsBackgroundColor=c.allowRescaling=c.isEmoji=c.isRestrictedPowerlineGlyph=c.isPowerlineGlyph=c.throwIfFalsy=void 0,c.throwIfFalsy=function(y){if(!y)throw new Error("value must not be falsy");return y},c.isPowerlineGlyph=u,c.isRestrictedPowerlineGlyph=function(y){return 57520<=y&&y<=57527},c.isEmoji=h,c.allowRescaling=function(y,g,C,T){return g===1&&C>Math.ceil(1.5*T)&&y!==void 0&&y>255&&!h(y)&&!u(y)&&!(function(A){return 57344<=A&&A<=63743})(y)},c.treatGlyphAsBackgroundColor=function(y){return u(y)||(function(g){return 9472<=g&&g<=9631})(y)},c.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}}}},c.computeNextVariantOffset=function(y,g,C=0){return(y-(2*Math.round(g)-C))%(2*Math.round(g))}},6052:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.createSelectionRenderModel=void 0;class u{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(y,g,C,T=!1){if(this.selectionStart=g,this.selectionEnd=C,!g||!C||g[0]===C[0]&&g[1]===C[1])return void this.clear();const A=y.buffers.active.ydisp,x=g[1]-A,d=C[1]-A,v=Math.max(x,0),f=Math.min(d,y.rows-1);v>=y.rows||f<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=T,this.viewportStartRow=x,this.viewportEndRow=d,this.viewportCappedStartRow=v,this.viewportCappedEndRow=f,this.startCol=g[0],this.endCol=C[0])}isCellSelected(y,g,C){return!!this.hasSelection&&(C-=y.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?g>=this.startCol&&C>=this.viewportCappedStartRow&&g<this.endCol&&C<=this.viewportCappedEndRow:g<this.startCol&&C>=this.viewportCappedStartRow&&g>=this.endCol&&C<=this.viewportCappedEndRow:C>this.viewportStartRow&&C<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&C===this.viewportStartRow&&g>=this.startCol&&g<this.endCol||this.viewportStartRow<this.viewportEndRow&&C===this.viewportEndRow&&g<this.endCol||this.viewportStartRow<this.viewportEndRow&&C===this.viewportStartRow&&g>=this.startCol)}}c.createSelectionRenderModel=function(){return new u}},456:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.SelectionModel=void 0,c.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,h=this.selectionEnd;return!(!u||!h)&&(u[1]>h[1]||u[1]===h[1]&&u[0]>h[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(m,c,u){var h=this&&this.__decorate||function(f,b,E,L){var R,M=arguments.length,k=M<3?b:L===null?L=Object.getOwnPropertyDescriptor(b,E):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(f,b,E,L);else for(var O=f.length-1;O>=0;O--)(R=f[O])&&(k=(M<3?R(k):M>3?R(b,E,k):R(b,E))||k);return M>3&&k&&Object.defineProperty(b,E,k),k},y=this&&this.__param||function(f,b){return function(E,L){b(E,L,f)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CharSizeService=void 0;const g=u(2585),C=u(8460),T=u(844);let A=c.CharSizeService=class extends T.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(f,b,E){super(),this._optionsService=E,this.width=0,this.height=0,this._onCharSizeChange=this.register(new C.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new v(this._optionsService))}catch{this._measureStrategy=this.register(new d(f,b,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const f=this._measureStrategy.measure();f.width===this.width&&f.height===this.height||(this.width=f.width,this.height=f.height,this._onCharSizeChange.fire())}};c.CharSizeService=A=h([y(2,g.IOptionsService)],A);class x extends T.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(b,E){b!==void 0&&b>0&&E!==void 0&&E>0&&(this._result.width=b,this._result.height=E)}}class d extends x{constructor(b,E,L){super(),this._document=b,this._parentElement=E,this._optionsService=L,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(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class v extends x{constructor(b){super(),this._optionsService=b,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const E=this._ctx.measureText("W");if(!("width"in E&&"fontBoundingBoxAscent"in E&&"fontBoundingBoxDescent"in E))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const b=this._ctx.measureText("W");return this._validateAndSet(b.width,b.fontBoundingBoxAscent+b.fontBoundingBoxDescent),this._result}}},4269:function(m,c,u){var h=this&&this.__decorate||function(v,f,b,E){var L,R=arguments.length,M=R<3?f:E===null?E=Object.getOwnPropertyDescriptor(f,b):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(v,f,b,E);else for(var k=v.length-1;k>=0;k--)(L=v[k])&&(M=(R<3?L(M):R>3?L(f,b,M):L(f,b))||M);return R>3&&M&&Object.defineProperty(f,b,M),M},y=this&&this.__param||function(v,f){return function(b,E){f(b,E,v)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CharacterJoinerService=c.JoinedCellData=void 0;const g=u(3734),C=u(643),T=u(511),A=u(2585);class x extends g.AttributeData{constructor(f,b,E){super(),this.content=0,this.combinedData="",this.fg=f.fg,this.bg=f.bg,this.combinedData=b,this._width=E}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(f){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}c.JoinedCellData=x;let d=c.CharacterJoinerService=class nx{constructor(f){this._bufferService=f,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new T.CellData}register(f){const b={id:this._nextCharacterJoinerId++,handler:f};return this._characterJoiners.push(b),b.id}deregister(f){for(let b=0;b<this._characterJoiners.length;b++)if(this._characterJoiners[b].id===f)return this._characterJoiners.splice(b,1),!0;return!1}getJoinedCharacters(f){if(this._characterJoiners.length===0)return[];const b=this._bufferService.buffer.lines.get(f);if(!b||b.length===0)return[];const E=[],L=b.translateToString(!0);let R=0,M=0,k=0,O=b.getFg(0),U=b.getBg(0);for(let F=0;F<b.getTrimmedLength();F++)if(b.loadCell(F,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==O||this._workCell.bg!==U){if(F-R>1){const G=this._getJoinedRanges(L,k,M,b,R);for(let I=0;I<G.length;I++)E.push(G[I])}R=F,k=M,O=this._workCell.fg,U=this._workCell.bg}M+=this._workCell.getChars().length||C.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-R>1){const F=this._getJoinedRanges(L,k,M,b,R);for(let G=0;G<F.length;G++)E.push(F[G])}return E}_getJoinedRanges(f,b,E,L,R){const M=f.substring(b,E);let k=[];try{k=this._characterJoiners[0].handler(M)}catch(O){console.error(O)}for(let O=1;O<this._characterJoiners.length;O++)try{const U=this._characterJoiners[O].handler(M);for(let F=0;F<U.length;F++)nx._mergeRanges(k,U[F])}catch(U){console.error(U)}return this._stringRangesToCellRanges(k,L,R),k}_stringRangesToCellRanges(f,b,E){let L=0,R=!1,M=0,k=f[L];if(k){for(let O=E;O<this._bufferService.cols;O++){const U=b.getWidth(O),F=b.getString(O).length||C.WHITESPACE_CELL_CHAR.length;if(U!==0){if(!R&&k[0]<=M&&(k[0]=O,R=!0),k[1]<=M){if(k[1]=O,k=f[++L],!k)break;k[0]<=M?(k[0]=O,R=!0):R=!1}M+=F}}k&&(k[1]=this._bufferService.cols)}}static _mergeRanges(f,b){let E=!1;for(let L=0;L<f.length;L++){const R=f[L];if(E){if(b[1]<=R[0])return f[L-1][1]=b[1],f;if(b[1]<=R[1])return f[L-1][1]=Math.max(b[1],R[1]),f.splice(L,1),f;f.splice(L,1),L--}else{if(b[1]<=R[0])return f.splice(L,0,b),f;if(b[1]<=R[1])return R[0]=Math.min(b[0],R[0]),f;b[0]<R[1]&&(R[0]=Math.min(b[0],R[0]),E=!0)}}return E?f[f.length-1][1]=b[1]:f.push(b),f}};c.CharacterJoinerService=d=h([y(0,A.IBufferService)],d)},5114:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CoreBrowserService=void 0;const h=u(844),y=u(8460),g=u(3656);class C extends h.Disposable{constructor(x,d,v){super(),this._textarea=x,this._window=d,this.mainDocument=v,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new T(this._window),this._onDprChange=this.register(new y.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new y.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((f=>this._screenDprMonitor.setWindow(f)))),this.register((0,y.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(x){this._window!==x&&(this._window=x,this._onWindowChange.fire(this._window))}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}}c.CoreBrowserService=C;class T extends h.Disposable{constructor(x){super(),this._parentWindow=x,this._windowResizeListener=this.register(new h.MutableDisposable),this._onDprChange=this.register(new y.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,h.toDisposable)((()=>this.clearListener())))}setWindow(x){this._parentWindow=x,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,g.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.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._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.LinkProviderService=void 0;const h=u(844);class y extends h.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,h.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(C){return this.linkProviders.push(C),{dispose:()=>{const T=this.linkProviders.indexOf(C);T!==-1&&this.linkProviders.splice(T,1)}}}}c.LinkProviderService=y},8934:function(m,c,u){var h=this&&this.__decorate||function(A,x,d,v){var f,b=arguments.length,E=b<3?x:v===null?v=Object.getOwnPropertyDescriptor(x,d):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(A,x,d,v);else for(var L=A.length-1;L>=0;L--)(f=A[L])&&(E=(b<3?f(E):b>3?f(x,d,E):f(x,d))||E);return b>3&&E&&Object.defineProperty(x,d,E),E},y=this&&this.__param||function(A,x){return function(d,v){x(d,v,A)}};Object.defineProperty(c,"__esModule",{value:!0}),c.MouseService=void 0;const g=u(4725),C=u(9806);let T=c.MouseService=class{constructor(A,x){this._renderService=A,this._charSizeService=x}getCoords(A,x,d,v,f){return(0,C.getCoords)(window,A,x,d,v,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,f)}getMouseReportCoords(A,x){const d=(0,C.getCoordsRelativeToElement)(window,A,x);if(this._charSizeService.hasValidSize)return d[0]=Math.min(Math.max(d[0],0),this._renderService.dimensions.css.canvas.width-1),d[1]=Math.min(Math.max(d[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(d[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(d[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(d[0]),y:Math.floor(d[1])}}};c.MouseService=T=h([y(0,g.IRenderService),y(1,g.ICharSizeService)],T)},3230:function(m,c,u){var h=this&&this.__decorate||function(f,b,E,L){var R,M=arguments.length,k=M<3?b:L===null?L=Object.getOwnPropertyDescriptor(b,E):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(f,b,E,L);else for(var O=f.length-1;O>=0;O--)(R=f[O])&&(k=(M<3?R(k):M>3?R(b,E,k):R(b,E))||k);return M>3&&k&&Object.defineProperty(b,E,k),k},y=this&&this.__param||function(f,b){return function(E,L){b(E,L,f)}};Object.defineProperty(c,"__esModule",{value:!0}),c.RenderService=void 0;const g=u(6193),C=u(4725),T=u(8460),A=u(844),x=u(7226),d=u(2585);let v=c.RenderService=class extends A.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(f,b,E,L,R,M,k,O){super(),this._rowCount=f,this._charSizeService=L,this._renderer=this.register(new A.MutableDisposable),this._pausedResizeTask=new x.DebouncedIdleTask,this._observerDisposable=this.register(new A.MutableDisposable),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 T.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new T.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new T.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new T.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new g.RenderDebouncer(((U,F)=>this._renderRows(U,F)),k),this.register(this._renderDebouncer),this.register(k.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(M.onResize((()=>this._fullRefresh()))),this.register(M.buffers.onBufferActivate((()=>this._renderer.value?.clear()))),this.register(E.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(R.onDecorationRegistered((()=>this._fullRefresh()))),this.register(R.onDecorationRemoved((()=>this._fullRefresh()))),this.register(E.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(M.cols,M.rows),this._fullRefresh()}))),this.register(E.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(M.buffer.y,M.buffer.y,!0)))),this.register(O.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(k.window,b),this.register(k.onWindowChange((U=>this._registerIntersectionObserver(U,b))))}_registerIntersectionObserver(f,b){if("IntersectionObserver"in f){const E=new f.IntersectionObserver((L=>this._handleIntersectionChange(L[L.length-1])),{threshold:0});E.observe(b),this._observerDisposable.value=(0,A.toDisposable)((()=>E.disconnect()))}}_handleIntersectionChange(f){this._isPaused=f.isIntersecting===void 0?f.intersectionRatio===0:!f.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(f,b,E=!1){this._isPaused?this._needsFullRefresh=!0:(E||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(f,b,this._rowCount))}_renderRows(f,b){this._renderer.value&&(f=Math.min(f,this._rowCount-1),b=Math.min(b,this._rowCount-1),this._renderer.value.renderRows(f,b),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:f,end:b}),this._onRender.fire({start:f,end:b}),this._isNextRenderRedrawOnly=!0)}resize(f,b){this._rowCount=b,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(f){this._renderer.value=f,this._renderer.value&&(this._renderer.value.onRequestRedraw((b=>this.refreshRows(b.start,b.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(f){return this._renderDebouncer.addRefreshCallback(f)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(f,b){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value?.handleResize(f,b))):this._renderer.value.handleResize(f,b),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(f,b,E){this._selectionState.start=f,this._selectionState.end=b,this._selectionState.columnSelectMode=E,this._renderer.value?.handleSelectionChanged(f,b,E)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};c.RenderService=v=h([y(2,d.IOptionsService),y(3,C.ICharSizeService),y(4,d.IDecorationService),y(5,d.IBufferService),y(6,C.ICoreBrowserService),y(7,C.IThemeService)],v)},9312:function(m,c,u){var h=this&&this.__decorate||function(k,O,U,F){var G,I=arguments.length,K=I<3?O:F===null?F=Object.getOwnPropertyDescriptor(O,U):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")K=Reflect.decorate(k,O,U,F);else for(var te=k.length-1;te>=0;te--)(G=k[te])&&(K=(I<3?G(K):I>3?G(O,U,K):G(O,U))||K);return I>3&&K&&Object.defineProperty(O,U,K),K},y=this&&this.__param||function(k,O){return function(U,F){O(U,F,k)}};Object.defineProperty(c,"__esModule",{value:!0}),c.SelectionService=void 0;const g=u(9806),C=u(9504),T=u(456),A=u(4725),x=u(8460),d=u(844),v=u(6114),f=u(4841),b=u(511),E=u(2585),L=" ",R=new RegExp(L,"g");let M=c.SelectionService=class extends d.Disposable{constructor(k,O,U,F,G,I,K,te,q){super(),this._element=k,this._screenElement=O,this._linkifier=U,this._bufferService=F,this._coreService=G,this._mouseService=I,this._optionsService=K,this._renderService=te,this._coreBrowserService=q,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new b.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new x.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new x.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new x.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new x.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=W=>this._handleMouseMove(W),this._mouseUpListener=W=>this._handleMouseUp(W),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((W=>this._handleTrim(W))),this.register(this._bufferService.buffers.onBufferActivate((W=>this._handleBufferActivate(W)))),this.enable(),this._model=new T.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,d.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 k=this._model.finalSelectionStart,O=this._model.finalSelectionEnd;return!(!k||!O||k[0]===O[0]&&k[1]===O[1])}get selectionText(){const k=this._model.finalSelectionStart,O=this._model.finalSelectionEnd;if(!k||!O)return"";const U=this._bufferService.buffer,F=[];if(this._activeSelectionMode===3){if(k[0]===O[0])return"";const G=k[0]<O[0]?k[0]:O[0],I=k[0]<O[0]?O[0]:k[0];for(let K=k[1];K<=O[1];K++){const te=U.translateBufferLineToString(K,!0,G,I);F.push(te)}}else{const G=k[1]===O[1]?O[0]:void 0;F.push(U.translateBufferLineToString(k[1],!0,k[0],G));for(let I=k[1]+1;I<=O[1]-1;I++){const K=U.lines.get(I),te=U.translateBufferLineToString(I,!0);K?.isWrapped?F[F.length-1]+=te:F.push(te)}if(k[1]!==O[1]){const I=U.lines.get(O[1]),K=U.translateBufferLineToString(O[1],!0,0,O[0]);I&&I.isWrapped?F[F.length-1]+=K:F.push(K)}}return F.map((G=>G.replace(R," "))).join(v.isWindows?`\r
773
- `:`
774
- `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(k){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),v.isLinux&&k&&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(k){const O=this._getMouseBufferCoords(k),U=this._model.finalSelectionStart,F=this._model.finalSelectionEnd;return!!(U&&F&&O)&&this._areCoordsInSelection(O,U,F)}isCellInSelection(k,O){const U=this._model.finalSelectionStart,F=this._model.finalSelectionEnd;return!(!U||!F)&&this._areCoordsInSelection([k,O],U,F)}_areCoordsInSelection(k,O,U){return k[1]>O[1]&&k[1]<U[1]||O[1]===U[1]&&k[1]===O[1]&&k[0]>=O[0]&&k[0]<U[0]||O[1]<U[1]&&k[1]===U[1]&&k[0]<U[0]||O[1]<U[1]&&k[1]===O[1]&&k[0]>=O[0]}_selectWordAtCursor(k,O){const U=this._linkifier.currentLink?.link?.range;if(U)return this._model.selectionStart=[U.start.x-1,U.start.y-1],this._model.selectionStartLength=(0,f.getRangeLength)(U,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const F=this._getMouseBufferCoords(k);return!!F&&(this._selectWordAt(F,O),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(k,O){this._model.clearSelection(),k=Math.max(k,0),O=Math.min(O,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,k],this._model.selectionEnd=[this._bufferService.cols,O],this.refresh(),this._onSelectionChange.fire()}_handleTrim(k){this._model.handleTrim(k)&&this.refresh()}_getMouseBufferCoords(k){const O=this._mouseService.getCoords(k,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(O)return O[0]--,O[1]--,O[1]+=this._bufferService.buffer.ydisp,O}_getMouseEventScrollAmount(k){let O=(0,g.getCoordsRelativeToElement)(this._coreBrowserService.window,k,this._screenElement)[1];const U=this._renderService.dimensions.css.canvas.height;return O>=0&&O<=U?0:(O>U&&(O-=U),O=Math.min(Math.max(O,-50),50),O/=50,O/Math.abs(O)+Math.round(14*O))}shouldForceSelection(k){return v.isMac?k.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:k.shiftKey}handleMouseDown(k){if(this._mouseDownTimeStamp=k.timeStamp,(k.button!==2||!this.hasSelection)&&k.button===0){if(!this._enabled){if(!this.shouldForceSelection(k))return;k.stopPropagation()}k.preventDefault(),this._dragScrollAmount=0,this._enabled&&k.shiftKey?this._handleIncrementalClick(k):k.detail===1?this._handleSingleClick(k):k.detail===2?this._handleDoubleClick(k):k.detail===3&&this._handleTripleClick(k),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(k){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(k))}_handleSingleClick(k){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(k)?3:0,this._model.selectionStart=this._getMouseBufferCoords(k),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const O=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);O&&O.length!==this._model.selectionStart[0]&&O.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(k){this._selectWordAtCursor(k,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(k){const O=this._getMouseBufferCoords(k);O&&(this._activeSelectionMode=2,this._selectLineAt(O[1]))}shouldColumnSelect(k){return k.altKey&&!(v.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(k){if(k.stopImmediatePropagation(),!this._model.selectionStart)return;const O=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(k),!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(k),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const U=this._bufferService.buffer;if(this._model.selectionEnd[1]<U.lines.length){const F=U.lines.get(this._model.selectionEnd[1]);F&&F.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}O&&O[0]===this._model.selectionEnd[0]&&O[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 k=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(k.ydisp+this._bufferService.rows,k.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=k.ydisp),this.refresh()}}_handleMouseUp(k){const O=k.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&O<500&&k.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const U=this._mouseService.getCoords(k,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(U&&U[0]!==void 0&&U[1]!==void 0){const F=(0,C.moveToCellSequence)(U[0]-1,U[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(F,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const k=this._model.finalSelectionStart,O=this._model.finalSelectionEnd,U=!(!k||!O||k[0]===O[0]&&k[1]===O[1]);U?k&&O&&(this._oldSelectionStart&&this._oldSelectionEnd&&k[0]===this._oldSelectionStart[0]&&k[1]===this._oldSelectionStart[1]&&O[0]===this._oldSelectionEnd[0]&&O[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(k,O,U)):this._oldHasSelection&&this._fireOnSelectionChange(k,O,U)}_fireOnSelectionChange(k,O,U){this._oldSelectionStart=k,this._oldSelectionEnd=O,this._oldHasSelection=U,this._onSelectionChange.fire()}_handleBufferActivate(k){this.clearSelection(),this._trimListener.dispose(),this._trimListener=k.activeBuffer.lines.onTrim((O=>this._handleTrim(O)))}_convertViewportColToCharacterIndex(k,O){let U=O;for(let F=0;O>=F;F++){const G=k.loadCell(F,this._workCell).getChars().length;this._workCell.getWidth()===0?U--:G>1&&O!==F&&(U+=G-1)}return U}setSelection(k,O,U){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[k,O],this._model.selectionStartLength=U,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(k){this._isClickInSelection(k)||(this._selectWordAtCursor(k,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(k,O,U=!0,F=!0){if(k[0]>=this._bufferService.cols)return;const G=this._bufferService.buffer,I=G.lines.get(k[1]);if(!I)return;const K=G.translateBufferLineToString(k[1],!1);let te=this._convertViewportColToCharacterIndex(I,k[0]),q=te;const W=k[0]-te;let Y=0,B=0,$=0,N=0;if(K.charAt(te)===" "){for(;te>0&&K.charAt(te-1)===" ";)te--;for(;q<K.length&&K.charAt(q+1)===" ";)q++}else{let ae=k[0],ce=k[0];I.getWidth(ae)===0&&(Y++,ae--),I.getWidth(ce)===2&&(B++,ce++);const _e=I.getString(ce).length;for(_e>1&&(N+=_e-1,q+=_e-1);ae>0&&te>0&&!this._isCharWordSeparator(I.loadCell(ae-1,this._workCell));){I.loadCell(ae-1,this._workCell);const Q=this._workCell.getChars().length;this._workCell.getWidth()===0?(Y++,ae--):Q>1&&($+=Q-1,te-=Q-1),te--,ae--}for(;ce<I.length&&q+1<K.length&&!this._isCharWordSeparator(I.loadCell(ce+1,this._workCell));){I.loadCell(ce+1,this._workCell);const Q=this._workCell.getChars().length;this._workCell.getWidth()===2?(B++,ce++):Q>1&&(N+=Q-1,q+=Q-1),q++,ce++}}q++;let P=te+W-Y+$,Z=Math.min(this._bufferService.cols,q-te+Y+B-$-N);if(O||K.slice(te,q).trim()!==""){if(U&&P===0&&I.getCodePoint(0)!==32){const ae=G.lines.get(k[1]-1);if(ae&&I.isWrapped&&ae.getCodePoint(this._bufferService.cols-1)!==32){const ce=this._getWordAt([this._bufferService.cols-1,k[1]-1],!1,!0,!1);if(ce){const _e=this._bufferService.cols-ce.start;P-=_e,Z+=_e}}}if(F&&P+Z===this._bufferService.cols&&I.getCodePoint(this._bufferService.cols-1)!==32){const ae=G.lines.get(k[1]+1);if(ae?.isWrapped&&ae.getCodePoint(0)!==32){const ce=this._getWordAt([0,k[1]+1],!1,!1,!0);ce&&(Z+=ce.length)}}return{start:P,length:Z}}}_selectWordAt(k,O){const U=this._getWordAt(k,O);if(U){for(;U.start<0;)U.start+=this._bufferService.cols,k[1]--;this._model.selectionStart=[U.start,k[1]],this._model.selectionStartLength=U.length}}_selectToWordAt(k){const O=this._getWordAt(k,!0);if(O){let U=k[1];for(;O.start<0;)O.start+=this._bufferService.cols,U--;if(!this._model.areSelectionValuesReversed())for(;O.start+O.length>this._bufferService.cols;)O.length-=this._bufferService.cols,U++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?O.start:O.start+O.length,U]}}_isCharWordSeparator(k){return k.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(k.getChars())>=0}_selectLineAt(k){const O=this._bufferService.buffer.getWrappedRangeForLine(k),U={start:{x:0,y:O.first},end:{x:this._bufferService.cols-1,y:O.last}};this._model.selectionStart=[0,O.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,f.getRangeLength)(U,this._bufferService.cols)}};c.SelectionService=M=h([y(3,E.IBufferService),y(4,E.ICoreService),y(5,A.IMouseService),y(6,E.IOptionsService),y(7,A.IRenderService),y(8,A.ICoreBrowserService)],M)},4725:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ILinkProviderService=c.IThemeService=c.ICharacterJoinerService=c.ISelectionService=c.IRenderService=c.IMouseService=c.ICoreBrowserService=c.ICharSizeService=void 0;const h=u(8343);c.ICharSizeService=(0,h.createDecorator)("CharSizeService"),c.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),c.IMouseService=(0,h.createDecorator)("MouseService"),c.IRenderService=(0,h.createDecorator)("RenderService"),c.ISelectionService=(0,h.createDecorator)("SelectionService"),c.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),c.IThemeService=(0,h.createDecorator)("ThemeService"),c.ILinkProviderService=(0,h.createDecorator)("LinkProviderService")},6731:function(m,c,u){var h=this&&this.__decorate||function(M,k,O,U){var F,G=arguments.length,I=G<3?k:U===null?U=Object.getOwnPropertyDescriptor(k,O):U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(M,k,O,U);else for(var K=M.length-1;K>=0;K--)(F=M[K])&&(I=(G<3?F(I):G>3?F(k,O,I):F(k,O))||I);return G>3&&I&&Object.defineProperty(k,O,I),I},y=this&&this.__param||function(M,k){return function(O,U){k(O,U,M)}};Object.defineProperty(c,"__esModule",{value:!0}),c.ThemeService=c.DEFAULT_ANSI_COLORS=void 0;const g=u(7239),C=u(8055),T=u(8460),A=u(844),x=u(2585),d=C.css.toColor("#ffffff"),v=C.css.toColor("#000000"),f=C.css.toColor("#ffffff"),b=C.css.toColor("#000000"),E={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};c.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const M=[C.css.toColor("#2e3436"),C.css.toColor("#cc0000"),C.css.toColor("#4e9a06"),C.css.toColor("#c4a000"),C.css.toColor("#3465a4"),C.css.toColor("#75507b"),C.css.toColor("#06989a"),C.css.toColor("#d3d7cf"),C.css.toColor("#555753"),C.css.toColor("#ef2929"),C.css.toColor("#8ae234"),C.css.toColor("#fce94f"),C.css.toColor("#729fcf"),C.css.toColor("#ad7fa8"),C.css.toColor("#34e2e2"),C.css.toColor("#eeeeec")],k=[0,95,135,175,215,255];for(let O=0;O<216;O++){const U=k[O/36%6|0],F=k[O/6%6|0],G=k[O%6];M.push({css:C.channels.toCss(U,F,G),rgba:C.channels.toRgba(U,F,G)})}for(let O=0;O<24;O++){const U=8+10*O;M.push({css:C.channels.toCss(U,U,U),rgba:C.channels.toRgba(U,U,U)})}return M})());let L=c.ThemeService=class extends A.Disposable{get colors(){return this._colors}constructor(M){super(),this._optionsService=M,this._contrastCache=new g.ColorContrastCache,this._halfContrastCache=new g.ColorContrastCache,this._onChangeColors=this.register(new T.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:d,background:v,cursor:f,cursorAccent:b,selectionForeground:void 0,selectionBackgroundTransparent:E,selectionBackgroundOpaque:C.color.blend(v,E),selectionInactiveBackgroundTransparent:E,selectionInactiveBackgroundOpaque:C.color.blend(v,E),ansi:c.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(M={}){const k=this._colors;if(k.foreground=R(M.foreground,d),k.background=R(M.background,v),k.cursor=R(M.cursor,f),k.cursorAccent=R(M.cursorAccent,b),k.selectionBackgroundTransparent=R(M.selectionBackground,E),k.selectionBackgroundOpaque=C.color.blend(k.background,k.selectionBackgroundTransparent),k.selectionInactiveBackgroundTransparent=R(M.selectionInactiveBackground,k.selectionBackgroundTransparent),k.selectionInactiveBackgroundOpaque=C.color.blend(k.background,k.selectionInactiveBackgroundTransparent),k.selectionForeground=M.selectionForeground?R(M.selectionForeground,C.NULL_COLOR):void 0,k.selectionForeground===C.NULL_COLOR&&(k.selectionForeground=void 0),C.color.isOpaque(k.selectionBackgroundTransparent)&&(k.selectionBackgroundTransparent=C.color.opacity(k.selectionBackgroundTransparent,.3)),C.color.isOpaque(k.selectionInactiveBackgroundTransparent)&&(k.selectionInactiveBackgroundTransparent=C.color.opacity(k.selectionInactiveBackgroundTransparent,.3)),k.ansi=c.DEFAULT_ANSI_COLORS.slice(),k.ansi[0]=R(M.black,c.DEFAULT_ANSI_COLORS[0]),k.ansi[1]=R(M.red,c.DEFAULT_ANSI_COLORS[1]),k.ansi[2]=R(M.green,c.DEFAULT_ANSI_COLORS[2]),k.ansi[3]=R(M.yellow,c.DEFAULT_ANSI_COLORS[3]),k.ansi[4]=R(M.blue,c.DEFAULT_ANSI_COLORS[4]),k.ansi[5]=R(M.magenta,c.DEFAULT_ANSI_COLORS[5]),k.ansi[6]=R(M.cyan,c.DEFAULT_ANSI_COLORS[6]),k.ansi[7]=R(M.white,c.DEFAULT_ANSI_COLORS[7]),k.ansi[8]=R(M.brightBlack,c.DEFAULT_ANSI_COLORS[8]),k.ansi[9]=R(M.brightRed,c.DEFAULT_ANSI_COLORS[9]),k.ansi[10]=R(M.brightGreen,c.DEFAULT_ANSI_COLORS[10]),k.ansi[11]=R(M.brightYellow,c.DEFAULT_ANSI_COLORS[11]),k.ansi[12]=R(M.brightBlue,c.DEFAULT_ANSI_COLORS[12]),k.ansi[13]=R(M.brightMagenta,c.DEFAULT_ANSI_COLORS[13]),k.ansi[14]=R(M.brightCyan,c.DEFAULT_ANSI_COLORS[14]),k.ansi[15]=R(M.brightWhite,c.DEFAULT_ANSI_COLORS[15]),M.extendedAnsi){const O=Math.min(k.ansi.length-16,M.extendedAnsi.length);for(let U=0;U<O;U++)k.ansi[U+16]=R(M.extendedAnsi[U],c.DEFAULT_ANSI_COLORS[U+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(M){this._restoreColor(M),this._onChangeColors.fire(this.colors)}_restoreColor(M){if(M!==void 0)switch(M){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[M]=this._restoreColors.ansi[M]}else for(let k=0;k<this._restoreColors.ansi.length;++k)this._colors.ansi[k]=this._restoreColors.ansi[k]}modifyColors(M){M(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 R(M,k){if(M!==void 0)try{return C.css.toColor(M)}catch{}return k}c.ThemeService=L=h([y(0,x.IOptionsService)],L)},6349:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CircularList=void 0;const h=u(8460),y=u(844);class g extends y.Disposable{constructor(T){super(),this._maxLength=T,this.onDeleteEmitter=this.register(new h.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new h.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new h.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(T){if(this._maxLength===T)return;const A=new Array(T);for(let x=0;x<Math.min(T,this.length);x++)A[x]=this._array[this._getCyclicIndex(x)];this._array=A,this._maxLength=T,this._startIndex=0}get length(){return this._length}set length(T){if(T>this._length)for(let A=this._length;A<T;A++)this._array[A]=void 0;this._length=T}get(T){return this._array[this._getCyclicIndex(T)]}set(T,A){this._array[this._getCyclicIndex(T)]=A}push(T){this._array[this._getCyclicIndex(this._length)]=T,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(T,A,...x){if(A){for(let d=T;d<this._length-A;d++)this._array[this._getCyclicIndex(d)]=this._array[this._getCyclicIndex(d+A)];this._length-=A,this.onDeleteEmitter.fire({index:T,amount:A})}for(let d=this._length-1;d>=T;d--)this._array[this._getCyclicIndex(d+x.length)]=this._array[this._getCyclicIndex(d)];for(let d=0;d<x.length;d++)this._array[this._getCyclicIndex(T+d)]=x[d];if(x.length&&this.onInsertEmitter.fire({index:T,amount:x.length}),this._length+x.length>this._maxLength){const d=this._length+x.length-this._maxLength;this._startIndex+=d,this._length=this._maxLength,this.onTrimEmitter.fire(d)}else this._length+=x.length}trimStart(T){T>this._length&&(T=this._length),this._startIndex+=T,this._length-=T,this.onTrimEmitter.fire(T)}shiftElements(T,A,x){if(!(A<=0)){if(T<0||T>=this._length)throw new Error("start argument out of range");if(T+x<0)throw new Error("Cannot shift elements in list beyond index 0");if(x>0){for(let v=A-1;v>=0;v--)this.set(T+v+x,this.get(T+v));const d=T+A+x-this._length;if(d>0)for(this._length+=d;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let d=0;d<A;d++)this.set(T+d+x,this.get(T+d))}}_getCyclicIndex(T){return(this._startIndex+T)%this._maxLength}}c.CircularList=g},1439:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.clone=void 0,c.clone=function u(h,y=5){if(typeof h!="object")return h;const g=Array.isArray(h)?[]:{};for(const C in h)g[C]=y<=1?h[C]:h[C]&&u(h[C],y-1);return g}},8055:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.contrastRatio=c.toPaddedHex=c.rgba=c.rgb=c.css=c.color=c.channels=c.NULL_COLOR=void 0;let u=0,h=0,y=0,g=0;var C,T,A,x,d;function v(b){const E=b.toString(16);return E.length<2?"0"+E:E}function f(b,E){return b<E?(E+.05)/(b+.05):(b+.05)/(E+.05)}c.NULL_COLOR={css:"#00000000",rgba:0},(function(b){b.toCss=function(E,L,R,M){return M!==void 0?`#${v(E)}${v(L)}${v(R)}${v(M)}`:`#${v(E)}${v(L)}${v(R)}`},b.toRgba=function(E,L,R,M=255){return(E<<24|L<<16|R<<8|M)>>>0},b.toColor=function(E,L,R,M){return{css:b.toCss(E,L,R,M),rgba:b.toRgba(E,L,R,M)}}})(C||(c.channels=C={})),(function(b){function E(L,R){return g=Math.round(255*R),[u,h,y]=d.toChannels(L.rgba),{css:C.toCss(u,h,y,g),rgba:C.toRgba(u,h,y,g)}}b.blend=function(L,R){if(g=(255&R.rgba)/255,g===1)return{css:R.css,rgba:R.rgba};const M=R.rgba>>24&255,k=R.rgba>>16&255,O=R.rgba>>8&255,U=L.rgba>>24&255,F=L.rgba>>16&255,G=L.rgba>>8&255;return u=U+Math.round((M-U)*g),h=F+Math.round((k-F)*g),y=G+Math.round((O-G)*g),{css:C.toCss(u,h,y),rgba:C.toRgba(u,h,y)}},b.isOpaque=function(L){return(255&L.rgba)==255},b.ensureContrastRatio=function(L,R,M){const k=d.ensureContrastRatio(L.rgba,R.rgba,M);if(k)return C.toColor(k>>24&255,k>>16&255,k>>8&255)},b.opaque=function(L){const R=(255|L.rgba)>>>0;return[u,h,y]=d.toChannels(R),{css:C.toCss(u,h,y),rgba:R}},b.opacity=E,b.multiplyOpacity=function(L,R){return g=255&L.rgba,E(L,g*R/255)},b.toColorRGB=function(L){return[L.rgba>>24&255,L.rgba>>16&255,L.rgba>>8&255]}})(T||(c.color=T={})),(function(b){let E,L;try{const R=document.createElement("canvas");R.width=1,R.height=1;const M=R.getContext("2d",{willReadFrequently:!0});M&&(E=M,E.globalCompositeOperation="copy",L=E.createLinearGradient(0,0,1,1))}catch{}b.toColor=function(R){if(R.match(/#[\da-f]{3,8}/i))switch(R.length){case 4:return u=parseInt(R.slice(1,2).repeat(2),16),h=parseInt(R.slice(2,3).repeat(2),16),y=parseInt(R.slice(3,4).repeat(2),16),C.toColor(u,h,y);case 5:return u=parseInt(R.slice(1,2).repeat(2),16),h=parseInt(R.slice(2,3).repeat(2),16),y=parseInt(R.slice(3,4).repeat(2),16),g=parseInt(R.slice(4,5).repeat(2),16),C.toColor(u,h,y,g);case 7:return{css:R,rgba:(parseInt(R.slice(1),16)<<8|255)>>>0};case 9:return{css:R,rgba:parseInt(R.slice(1),16)>>>0}}const M=R.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(M)return u=parseInt(M[1]),h=parseInt(M[2]),y=parseInt(M[3]),g=Math.round(255*(M[5]===void 0?1:parseFloat(M[5]))),C.toColor(u,h,y,g);if(!E||!L)throw new Error("css.toColor: Unsupported css format");if(E.fillStyle=L,E.fillStyle=R,typeof E.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(E.fillRect(0,0,1,1),[u,h,y,g]=E.getImageData(0,0,1,1).data,g!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:C.toRgba(u,h,y,g),css:R}}})(A||(c.css=A={})),(function(b){function E(L,R,M){const k=L/255,O=R/255,U=M/255;return .2126*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.7152*(O<=.03928?O/12.92:Math.pow((O+.055)/1.055,2.4))+.0722*(U<=.03928?U/12.92:Math.pow((U+.055)/1.055,2.4))}b.relativeLuminance=function(L){return E(L>>16&255,L>>8&255,255&L)},b.relativeLuminance2=E})(x||(c.rgb=x={})),(function(b){function E(R,M,k){const O=R>>24&255,U=R>>16&255,F=R>>8&255;let G=M>>24&255,I=M>>16&255,K=M>>8&255,te=f(x.relativeLuminance2(G,I,K),x.relativeLuminance2(O,U,F));for(;te<k&&(G>0||I>0||K>0);)G-=Math.max(0,Math.ceil(.1*G)),I-=Math.max(0,Math.ceil(.1*I)),K-=Math.max(0,Math.ceil(.1*K)),te=f(x.relativeLuminance2(G,I,K),x.relativeLuminance2(O,U,F));return(G<<24|I<<16|K<<8|255)>>>0}function L(R,M,k){const O=R>>24&255,U=R>>16&255,F=R>>8&255;let G=M>>24&255,I=M>>16&255,K=M>>8&255,te=f(x.relativeLuminance2(G,I,K),x.relativeLuminance2(O,U,F));for(;te<k&&(G<255||I<255||K<255);)G=Math.min(255,G+Math.ceil(.1*(255-G))),I=Math.min(255,I+Math.ceil(.1*(255-I))),K=Math.min(255,K+Math.ceil(.1*(255-K))),te=f(x.relativeLuminance2(G,I,K),x.relativeLuminance2(O,U,F));return(G<<24|I<<16|K<<8|255)>>>0}b.blend=function(R,M){if(g=(255&M)/255,g===1)return M;const k=M>>24&255,O=M>>16&255,U=M>>8&255,F=R>>24&255,G=R>>16&255,I=R>>8&255;return u=F+Math.round((k-F)*g),h=G+Math.round((O-G)*g),y=I+Math.round((U-I)*g),C.toRgba(u,h,y)},b.ensureContrastRatio=function(R,M,k){const O=x.relativeLuminance(R>>8),U=x.relativeLuminance(M>>8);if(f(O,U)<k){if(U<O){const I=E(R,M,k),K=f(O,x.relativeLuminance(I>>8));if(K<k){const te=L(R,M,k);return K>f(O,x.relativeLuminance(te>>8))?I:te}return I}const F=L(R,M,k),G=f(O,x.relativeLuminance(F>>8));if(G<k){const I=E(R,M,k);return G>f(O,x.relativeLuminance(I>>8))?F:I}return F}},b.reduceLuminance=E,b.increaseLuminance=L,b.toChannels=function(R){return[R>>24&255,R>>16&255,R>>8&255,255&R]}})(d||(c.rgba=d={})),c.toPaddedHex=v,c.contrastRatio=f},8969:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CoreTerminal=void 0;const h=u(844),y=u(2585),g=u(4348),C=u(7866),T=u(744),A=u(7302),x=u(6975),d=u(8460),v=u(1753),f=u(1480),b=u(7994),E=u(9282),L=u(5435),R=u(5981),M=u(2660);let k=!1;class O extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new d.EventEmitter),this._onScroll.event((F=>{this._onScrollApi?.fire(F.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(F){for(const G in F)this.optionsService.options[G]=F[G]}constructor(F){super(),this._windowsWrappingHeuristics=this.register(new h.MutableDisposable),this._onBinary=this.register(new d.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new d.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new d.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new d.EventEmitter),this._instantiationService=new g.InstantiationService,this.optionsService=this.register(new A.OptionsService(F)),this._instantiationService.setService(y.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(T.BufferService)),this._instantiationService.setService(y.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(C.LogService)),this._instantiationService.setService(y.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(x.CoreService)),this._instantiationService.setService(y.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(v.CoreMouseService)),this._instantiationService.setService(y.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(f.UnicodeService)),this._instantiationService.setService(y.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(b.CharsetService),this._instantiationService.setService(y.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(M.OscLinkService),this._instantiationService.setService(y.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new L.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,d.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,d.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,d.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,d.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((G=>{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((G=>{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 R.WriteBuffer(((G,I)=>this._inputHandler.parse(G,I)))),this.register((0,d.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(F,G){this._writeBuffer.write(F,G)}writeSync(F,G){this._logService.logLevel<=y.LogLevelEnum.WARN&&!k&&(this._logService.warn("writeSync is unreliable and will be removed soon."),k=!0),this._writeBuffer.writeSync(F,G)}input(F,G=!0){this.coreService.triggerDataEvent(F,G)}resize(F,G){isNaN(F)||isNaN(G)||(F=Math.max(F,T.MINIMUM_COLS),G=Math.max(G,T.MINIMUM_ROWS),this._bufferService.resize(F,G))}scroll(F,G=!1){this._bufferService.scroll(F,G)}scrollLines(F,G,I){this._bufferService.scrollLines(F,G,I)}scrollPages(F){this.scrollLines(F*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(F){const G=F-this._bufferService.buffer.ydisp;G!==0&&this.scrollLines(G)}registerEscHandler(F,G){return this._inputHandler.registerEscHandler(F,G)}registerDcsHandler(F,G){return this._inputHandler.registerDcsHandler(F,G)}registerCsiHandler(F,G){return this._inputHandler.registerCsiHandler(F,G)}registerOscHandler(F,G){return this._inputHandler.registerOscHandler(F,G)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let F=!1;const G=this.optionsService.rawOptions.windowsPty;G&&G.buildNumber!==void 0&&G.buildNumber!==void 0?F=G.backend==="conpty"&&G.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(F=!0),F?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const F=[];F.push(this.onLineFeed(E.updateWindowsModeWrappedState.bind(null,this._bufferService))),F.push(this.registerCsiHandler({final:"H"},(()=>((0,E.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)((()=>{for(const G of F)G.dispose()}))}}}c.CoreTerminal=O},8460:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.runAndSubscribe=c.forwardEvent=c.EventEmitter=void 0,c.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 h=0;h<this._listeners.length;h++)if(this._listeners[h]===u)return void this._listeners.splice(h,1)}}})),this._event}fire(u,h){const y=[];for(let g=0;g<this._listeners.length;g++)y.push(this._listeners[g]);for(let g=0;g<y.length;g++)y[g].call(void 0,u,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},c.forwardEvent=function(u,h){return u((y=>h.fire(y)))},c.runAndSubscribe=function(u,h){return h(void 0),u((y=>h(y)))}},5435:function(m,c,u){var h=this&&this.__decorate||function(Y,B,$,N){var P,Z=arguments.length,ae=Z<3?B:N===null?N=Object.getOwnPropertyDescriptor(B,$):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ae=Reflect.decorate(Y,B,$,N);else for(var ce=Y.length-1;ce>=0;ce--)(P=Y[ce])&&(ae=(Z<3?P(ae):Z>3?P(B,$,ae):P(B,$))||ae);return Z>3&&ae&&Object.defineProperty(B,$,ae),ae},y=this&&this.__param||function(Y,B){return function($,N){B($,N,Y)}};Object.defineProperty(c,"__esModule",{value:!0}),c.InputHandler=c.WindowsOptionsReportType=void 0;const g=u(2584),C=u(7116),T=u(2015),A=u(844),x=u(482),d=u(8437),v=u(8460),f=u(643),b=u(511),E=u(3734),L=u(2585),R=u(1480),M=u(6242),k=u(6351),O=u(5941),U={"(":0,")":1,"*":2,"+":3,"-":1,".":2},F=131072;function G(Y,B){if(Y>24)return B.setWinLines||!1;switch(Y){case 1:return!!B.restoreWin;case 2:return!!B.minimizeWin;case 3:return!!B.setWinPosition;case 4:return!!B.setWinSizePixels;case 5:return!!B.raiseWin;case 6:return!!B.lowerWin;case 7:return!!B.refreshWin;case 8:return!!B.setWinSizeChars;case 9:return!!B.maximizeWin;case 10:return!!B.fullscreenWin;case 11:return!!B.getWinState;case 13:return!!B.getWinPosition;case 14:return!!B.getWinSizePixels;case 15:return!!B.getScreenSizePixels;case 16:return!!B.getCellSizePixels;case 18:return!!B.getWinSizeChars;case 19:return!!B.getScreenSizeChars;case 20:return!!B.getIconTitle;case 21:return!!B.getWinTitle;case 22:return!!B.pushTitle;case 23:return!!B.popTitle;case 24:return!!B.setWinLines}return!1}var I;(function(Y){Y[Y.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",Y[Y.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(I||(c.WindowsOptionsReportType=I={}));let K=0;class te extends A.Disposable{getAttrData(){return this._curAttrData}constructor(B,$,N,P,Z,ae,ce,_e,Q=new T.EscapeSequenceParser){super(),this._bufferService=B,this._charsetService=$,this._coreService=N,this._logService=P,this._optionsService=Z,this._oscLinkService=ae,this._coreMouseService=ce,this._unicodeService=_e,this._parser=Q,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new x.StringToUtf32,this._utf8Decoder=new x.Utf8ToUtf32,this._workCell=new b.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=d.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=d.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new v.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new v.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new v.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new v.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new v.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new v.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new v.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new v.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new v.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new v.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new v.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new v.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new v.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 q(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((z=>this._activeBuffer=z.activeBuffer))),this._parser.setCsiHandlerFallback(((z,oe)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(z),params:oe.toArray()})})),this._parser.setEscHandlerFallback((z=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(z)})})),this._parser.setExecuteHandlerFallback((z=>{this._logService.debug("Unknown EXECUTE code: ",{code:z})})),this._parser.setOscHandlerFallback(((z,oe,ge)=>{this._logService.debug("Unknown OSC code: ",{identifier:z,action:oe,data:ge})})),this._parser.setDcsHandlerFallback(((z,oe,ge)=>{oe==="HOOK"&&(ge=ge.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(z),action:oe,payload:ge})})),this._parser.setPrintHandler(((z,oe,ge)=>this.print(z,oe,ge))),this._parser.registerCsiHandler({final:"@"},(z=>this.insertChars(z))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(z=>this.scrollLeft(z))),this._parser.registerCsiHandler({final:"A"},(z=>this.cursorUp(z))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(z=>this.scrollRight(z))),this._parser.registerCsiHandler({final:"B"},(z=>this.cursorDown(z))),this._parser.registerCsiHandler({final:"C"},(z=>this.cursorForward(z))),this._parser.registerCsiHandler({final:"D"},(z=>this.cursorBackward(z))),this._parser.registerCsiHandler({final:"E"},(z=>this.cursorNextLine(z))),this._parser.registerCsiHandler({final:"F"},(z=>this.cursorPrecedingLine(z))),this._parser.registerCsiHandler({final:"G"},(z=>this.cursorCharAbsolute(z))),this._parser.registerCsiHandler({final:"H"},(z=>this.cursorPosition(z))),this._parser.registerCsiHandler({final:"I"},(z=>this.cursorForwardTab(z))),this._parser.registerCsiHandler({final:"J"},(z=>this.eraseInDisplay(z,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(z=>this.eraseInDisplay(z,!0))),this._parser.registerCsiHandler({final:"K"},(z=>this.eraseInLine(z,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(z=>this.eraseInLine(z,!0))),this._parser.registerCsiHandler({final:"L"},(z=>this.insertLines(z))),this._parser.registerCsiHandler({final:"M"},(z=>this.deleteLines(z))),this._parser.registerCsiHandler({final:"P"},(z=>this.deleteChars(z))),this._parser.registerCsiHandler({final:"S"},(z=>this.scrollUp(z))),this._parser.registerCsiHandler({final:"T"},(z=>this.scrollDown(z))),this._parser.registerCsiHandler({final:"X"},(z=>this.eraseChars(z))),this._parser.registerCsiHandler({final:"Z"},(z=>this.cursorBackwardTab(z))),this._parser.registerCsiHandler({final:"`"},(z=>this.charPosAbsolute(z))),this._parser.registerCsiHandler({final:"a"},(z=>this.hPositionRelative(z))),this._parser.registerCsiHandler({final:"b"},(z=>this.repeatPrecedingCharacter(z))),this._parser.registerCsiHandler({final:"c"},(z=>this.sendDeviceAttributesPrimary(z))),this._parser.registerCsiHandler({prefix:">",final:"c"},(z=>this.sendDeviceAttributesSecondary(z))),this._parser.registerCsiHandler({final:"d"},(z=>this.linePosAbsolute(z))),this._parser.registerCsiHandler({final:"e"},(z=>this.vPositionRelative(z))),this._parser.registerCsiHandler({final:"f"},(z=>this.hVPosition(z))),this._parser.registerCsiHandler({final:"g"},(z=>this.tabClear(z))),this._parser.registerCsiHandler({final:"h"},(z=>this.setMode(z))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(z=>this.setModePrivate(z))),this._parser.registerCsiHandler({final:"l"},(z=>this.resetMode(z))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(z=>this.resetModePrivate(z))),this._parser.registerCsiHandler({final:"m"},(z=>this.charAttributes(z))),this._parser.registerCsiHandler({final:"n"},(z=>this.deviceStatus(z))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(z=>this.deviceStatusPrivate(z))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(z=>this.softReset(z))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(z=>this.setCursorStyle(z))),this._parser.registerCsiHandler({final:"r"},(z=>this.setScrollRegion(z))),this._parser.registerCsiHandler({final:"s"},(z=>this.saveCursor(z))),this._parser.registerCsiHandler({final:"t"},(z=>this.windowOptions(z))),this._parser.registerCsiHandler({final:"u"},(z=>this.restoreCursor(z))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(z=>this.insertColumns(z))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(z=>this.deleteColumns(z))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(z=>this.selectProtected(z))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(z=>this.requestMode(z,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(z=>this.requestMode(z,!1))),this._parser.setExecuteHandler(g.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(g.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(g.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(g.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(g.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(g.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(g.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(g.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(g.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(g.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(g.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(g.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new M.OscHandler((z=>(this.setTitle(z),this.setIconName(z),!0)))),this._parser.registerOscHandler(1,new M.OscHandler((z=>this.setIconName(z)))),this._parser.registerOscHandler(2,new M.OscHandler((z=>this.setTitle(z)))),this._parser.registerOscHandler(4,new M.OscHandler((z=>this.setOrReportIndexedColor(z)))),this._parser.registerOscHandler(8,new M.OscHandler((z=>this.setHyperlink(z)))),this._parser.registerOscHandler(10,new M.OscHandler((z=>this.setOrReportFgColor(z)))),this._parser.registerOscHandler(11,new M.OscHandler((z=>this.setOrReportBgColor(z)))),this._parser.registerOscHandler(12,new M.OscHandler((z=>this.setOrReportCursorColor(z)))),this._parser.registerOscHandler(104,new M.OscHandler((z=>this.restoreIndexedColor(z)))),this._parser.registerOscHandler(110,new M.OscHandler((z=>this.restoreFgColor(z)))),this._parser.registerOscHandler(111,new M.OscHandler((z=>this.restoreBgColor(z)))),this._parser.registerOscHandler(112,new M.OscHandler((z=>this.restoreCursorColor(z)))),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 z in C.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:z},(()=>this.selectCharset("("+z))),this._parser.registerEscHandler({intermediates:")",final:z},(()=>this.selectCharset(")"+z))),this._parser.registerEscHandler({intermediates:"*",final:z},(()=>this.selectCharset("*"+z))),this._parser.registerEscHandler({intermediates:"+",final:z},(()=>this.selectCharset("+"+z))),this._parser.registerEscHandler({intermediates:"-",final:z},(()=>this.selectCharset("-"+z))),this._parser.registerEscHandler({intermediates:".",final:z},(()=>this.selectCharset("."+z))),this._parser.registerEscHandler({intermediates:"/",final:z},(()=>this.selectCharset("/"+z)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((z=>(this._logService.error("Parsing error: ",z),z))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new k.DcsHandler(((z,oe)=>this.requestStatusString(z,oe))))}_preserveStack(B,$,N,P){this._parseStack.paused=!0,this._parseStack.cursorStartX=B,this._parseStack.cursorStartY=$,this._parseStack.decodedLength=N,this._parseStack.position=P}_logSlowResolvingAsync(B){this._logService.logLevel<=L.LogLevelEnum.WARN&&Promise.race([B,new Promise((($,N)=>setTimeout((()=>N("#SLOW_TIMEOUT")),5e3)))]).catch(($=>{if($!=="#SLOW_TIMEOUT")throw $;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(B,$){let N,P=this._activeBuffer.x,Z=this._activeBuffer.y,ae=0;const ce=this._parseStack.paused;if(ce){if(N=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,$))return this._logSlowResolvingAsync(N),N;P=this._parseStack.cursorStartX,Z=this._parseStack.cursorStartY,this._parseStack.paused=!1,B.length>F&&(ae=this._parseStack.position+F)}if(this._logService.logLevel<=L.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof B=="string"?` "${B}"`:` "${Array.prototype.map.call(B,(z=>String.fromCharCode(z))).join("")}"`),typeof B=="string"?B.split("").map((z=>z.charCodeAt(0))):B),this._parseBuffer.length<B.length&&this._parseBuffer.length<F&&(this._parseBuffer=new Uint32Array(Math.min(B.length,F))),ce||this._dirtyRowTracker.clearRange(),B.length>F)for(let z=ae;z<B.length;z+=F){const oe=z+F<B.length?z+F:B.length,ge=typeof B=="string"?this._stringDecoder.decode(B.substring(z,oe),this._parseBuffer):this._utf8Decoder.decode(B.subarray(z,oe),this._parseBuffer);if(N=this._parser.parse(this._parseBuffer,ge))return this._preserveStack(P,Z,ge,z),this._logSlowResolvingAsync(N),N}else if(!ce){const z=typeof B=="string"?this._stringDecoder.decode(B,this._parseBuffer):this._utf8Decoder.decode(B,this._parseBuffer);if(N=this._parser.parse(this._parseBuffer,z))return this._preserveStack(P,Z,z,0),this._logSlowResolvingAsync(N),N}this._activeBuffer.x===P&&this._activeBuffer.y===Z||this._onCursorMove.fire();const _e=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),Q=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);Q<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(Q,this._bufferService.rows-1),Math.min(_e,this._bufferService.rows-1))}print(B,$,N){let P,Z;const ae=this._charsetService.charset,ce=this._optionsService.rawOptions.screenReaderMode,_e=this._bufferService.cols,Q=this._coreService.decPrivateModes.wraparound,z=this._coreService.modes.insertMode,oe=this._curAttrData;let ge=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&N-$>0&&ge.getWidth(this._activeBuffer.x-1)===2&&ge.setCellFromCodepoint(this._activeBuffer.x-1,0,1,oe);let Se=this._parser.precedingJoinState;for(let ye=$;ye<N;++ye){if(P=B[ye],P<127&&ae){const xt=ae[String.fromCharCode(P)];xt&&(P=xt.charCodeAt(0))}const Pe=this._unicodeService.charProperties(P,Se);Z=R.UnicodeService.extractWidth(Pe);const qe=R.UnicodeService.extractShouldJoin(Pe),Xe=qe?R.UnicodeService.extractWidth(Se):0;if(Se=Pe,ce&&this._onA11yChar.fire((0,x.stringFromCodePoint)(P)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+Z-Xe>_e){if(Q){const xt=ge;let Ne=this._activeBuffer.x-Xe;for(this._activeBuffer.x=Xe,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),ge=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Xe>0&&ge instanceof d.BufferLine&&ge.copyCellsFrom(xt,Ne,0,Xe,!1);Ne<_e;)xt.setCellFromCodepoint(Ne++,0,1,oe)}else if(this._activeBuffer.x=_e-1,Z===2)continue}if(qe&&this._activeBuffer.x){const xt=ge.getWidth(this._activeBuffer.x-1)?1:2;ge.addCodepointToCell(this._activeBuffer.x-xt,P,Z);for(let Ne=Z-Xe;--Ne>=0;)ge.setCellFromCodepoint(this._activeBuffer.x++,0,0,oe)}else if(z&&(ge.insertCells(this._activeBuffer.x,Z-Xe,this._activeBuffer.getNullCell(oe)),ge.getWidth(_e-1)===2&&ge.setCellFromCodepoint(_e-1,f.NULL_CELL_CODE,f.NULL_CELL_WIDTH,oe)),ge.setCellFromCodepoint(this._activeBuffer.x++,P,Z,oe),Z>0)for(;--Z;)ge.setCellFromCodepoint(this._activeBuffer.x++,0,0,oe)}this._parser.precedingJoinState=Se,this._activeBuffer.x<_e&&N-$>0&&ge.getWidth(this._activeBuffer.x)===0&&!ge.hasContent(this._activeBuffer.x)&&ge.setCellFromCodepoint(this._activeBuffer.x,0,1,oe),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(B,$){return B.final!=="t"||B.prefix||B.intermediates?this._parser.registerCsiHandler(B,$):this._parser.registerCsiHandler(B,(N=>!G(N.params[0],this._optionsService.rawOptions.windowOptions)||$(N)))}registerDcsHandler(B,$){return this._parser.registerDcsHandler(B,new k.DcsHandler($))}registerEscHandler(B,$){return this._parser.registerEscHandler(B,$)}registerOscHandler(B,$){return this._parser.registerOscHandler(B,new M.OscHandler($))}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(){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&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);B.hasWidth(this._activeBuffer.x)&&!B.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const B=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-B),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(B=this._bufferService.cols-1){this._activeBuffer.x=Math.min(B,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(B,$){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=B,this._activeBuffer.y=this._activeBuffer.scrollTop+$):(this._activeBuffer.x=B,this._activeBuffer.y=$),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(B,$){this._restrictCursor(),this._setCursor(this._activeBuffer.x+B,this._activeBuffer.y+$)}cursorUp(B){const $=this._activeBuffer.y-this._activeBuffer.scrollTop;return $>=0?this._moveCursor(0,-Math.min($,B.params[0]||1)):this._moveCursor(0,-(B.params[0]||1)),!0}cursorDown(B){const $=this._activeBuffer.scrollBottom-this._activeBuffer.y;return $>=0?this._moveCursor(0,Math.min($,B.params[0]||1)):this._moveCursor(0,B.params[0]||1),!0}cursorForward(B){return this._moveCursor(B.params[0]||1,0),!0}cursorBackward(B){return this._moveCursor(-(B.params[0]||1),0),!0}cursorNextLine(B){return this.cursorDown(B),this._activeBuffer.x=0,!0}cursorPrecedingLine(B){return this.cursorUp(B),this._activeBuffer.x=0,!0}cursorCharAbsolute(B){return this._setCursor((B.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(B){return this._setCursor(B.length>=2?(B.params[1]||1)-1:0,(B.params[0]||1)-1),!0}charPosAbsolute(B){return this._setCursor((B.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(B){return this._moveCursor(B.params[0]||1,0),!0}linePosAbsolute(B){return this._setCursor(this._activeBuffer.x,(B.params[0]||1)-1),!0}vPositionRelative(B){return this._moveCursor(0,B.params[0]||1),!0}hVPosition(B){return this.cursorPosition(B),!0}tabClear(B){const $=B.params[0];return $===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:$===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(B){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let $=B.params[0]||1;for(;$--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(B){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let $=B.params[0]||1;for(;$--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(B){const $=B.params[0];return $===1&&(this._curAttrData.bg|=536870912),$!==2&&$!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(B,$,N,P=!1,Z=!1){const ae=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);ae.replaceCells($,N,this._activeBuffer.getNullCell(this._eraseAttrData()),Z),P&&(ae.isWrapped=!1)}_resetBufferLine(B,$=!1){const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);N&&(N.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),$),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+B),N.isWrapped=!1)}eraseInDisplay(B,$=!1){let N;switch(this._restrictCursor(this._bufferService.cols),B.params[0]){case 0:for(N=this._activeBuffer.y,this._dirtyRowTracker.markDirty(N),this._eraseInBufferLine(N++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,$);N<this._bufferService.rows;N++)this._resetBufferLine(N,$);this._dirtyRowTracker.markDirty(N);break;case 1:for(N=this._activeBuffer.y,this._dirtyRowTracker.markDirty(N),this._eraseInBufferLine(N,0,this._activeBuffer.x+1,!0,$),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(N+1).isWrapped=!1);N--;)this._resetBufferLine(N,$);this._dirtyRowTracker.markDirty(0);break;case 2:for(N=this._bufferService.rows,this._dirtyRowTracker.markDirty(N-1);N--;)this._resetBufferLine(N,$);this._dirtyRowTracker.markDirty(0);break;case 3:const P=this._activeBuffer.lines.length-this._bufferService.rows;P>0&&(this._activeBuffer.lines.trimStart(P),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-P,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-P,0),this._onScroll.fire(0))}return!0}eraseInLine(B,$=!1){switch(this._restrictCursor(this._bufferService.cols),B.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,$);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,$);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,$)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(B){this._restrictCursor();let $=B.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=this._activeBuffer.ybase+this._activeBuffer.y,P=this._bufferService.rows-1-this._activeBuffer.scrollBottom,Z=this._bufferService.rows-1+this._activeBuffer.ybase-P+1;for(;$--;)this._activeBuffer.lines.splice(Z-1,1),this._activeBuffer.lines.splice(N,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(B){this._restrictCursor();let $=B.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=this._activeBuffer.ybase+this._activeBuffer.y;let P;for(P=this._bufferService.rows-1-this._activeBuffer.scrollBottom,P=this._bufferService.rows-1+this._activeBuffer.ybase-P;$--;)this._activeBuffer.lines.splice(N,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}insertChars(B){this._restrictCursor();const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return $&&($.insertCells(this._activeBuffer.x,B.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(B){this._restrictCursor();const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return $&&($.deleteCells(this._activeBuffer.x,B.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(B){let $=B.params[0]||1;for(;$--;)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(B){let $=B.params[0]||1;for(;$--;)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(d.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(B){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const $=B.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);P.deleteCells(0,$,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(B){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const $=B.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);P.insertCells(0,$,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(B){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const $=B.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);P.insertCells(this._activeBuffer.x,$,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(B){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const $=B.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);P.deleteCells(this._activeBuffer.x,$,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(B){this._restrictCursor();const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return $&&($.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(B.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(B){const $=this._parser.precedingJoinState;if(!$)return!0;const N=B.params[0]||1,P=R.UnicodeService.extractWidth($),Z=this._activeBuffer.x-P,ae=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(Z),ce=new Uint32Array(ae.length*N);let _e=0;for(let z=0;z<ae.length;){const oe=ae.codePointAt(z)||0;ce[_e++]=oe,z+=oe>65535?2:1}let Q=_e;for(let z=1;z<N;++z)ce.copyWithin(Q,0,_e),Q+=_e;return this.print(ce,0,Q),!0}sendDeviceAttributesPrimary(B){return B.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(g.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(g.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(B){return B.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(g.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(g.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(B.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(g.C0.ESC+"[>83;40003;0c")),!0}_is(B){return(this._optionsService.rawOptions.termName+"").indexOf(B)===0}setMode(B){for(let $=0;$<B.length;$++)switch(B.params[$]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(B){for(let $=0;$<B.length;$++)switch(B.params[$]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,C.DEFAULT_CHARSET),this._charsetService.setgCharset(1,C.DEFAULT_CHARSET),this._charsetService.setgCharset(2,C.DEFAULT_CHARSET),this._charsetService.setgCharset(3,C.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(B){for(let $=0;$<B.length;$++)switch(B.params[$]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(B){for(let $=0;$<B.length;$++)switch(B.params[$]){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(),B.params[$]===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(B,$){const N=this._coreService.decPrivateModes,{activeProtocol:P,activeEncoding:Z}=this._coreMouseService,ae=this._coreService,{buffers:ce,cols:_e}=this._bufferService,{active:Q,alt:z}=ce,oe=this._optionsService.rawOptions,ge=qe=>qe?1:2,Se=B.params[0];return ye=Se,Pe=$?Se===2?4:Se===4?ge(ae.modes.insertMode):Se===12?3:Se===20?ge(oe.convertEol):0:Se===1?ge(N.applicationCursorKeys):Se===3?oe.windowOptions.setWinLines?_e===80?2:_e===132?1:0:0:Se===6?ge(N.origin):Se===7?ge(N.wraparound):Se===8?3:Se===9?ge(P==="X10"):Se===12?ge(oe.cursorBlink):Se===25?ge(!ae.isCursorHidden):Se===45?ge(N.reverseWraparound):Se===66?ge(N.applicationKeypad):Se===67?4:Se===1e3?ge(P==="VT200"):Se===1002?ge(P==="DRAG"):Se===1003?ge(P==="ANY"):Se===1004?ge(N.sendFocus):Se===1005?4:Se===1006?ge(Z==="SGR"):Se===1015?4:Se===1016?ge(Z==="SGR_PIXELS"):Se===1048?1:Se===47||Se===1047||Se===1049?ge(Q===z):Se===2004?ge(N.bracketedPasteMode):0,ae.triggerDataEvent(`${g.C0.ESC}[${$?"":"?"}${ye};${Pe}$y`),!0;var ye,Pe}_updateAttrColor(B,$,N,P,Z){return $===2?(B|=50331648,B&=-16777216,B|=E.AttributeData.fromColorRGB([N,P,Z])):$===5&&(B&=-50331904,B|=33554432|255&N),B}_extractColor(B,$,N){const P=[0,0,-1,0,0,0];let Z=0,ae=0;do{if(P[ae+Z]=B.params[$+ae],B.hasSubParams($+ae)){const ce=B.getSubParams($+ae);let _e=0;do P[1]===5&&(Z=1),P[ae+_e+1+Z]=ce[_e];while(++_e<ce.length&&_e+ae+1+Z<P.length);break}if(P[1]===5&&ae+Z>=2||P[1]===2&&ae+Z>=5)break;P[1]&&(Z=1)}while(++ae+$<B.length&&ae+Z<P.length);for(let ce=2;ce<P.length;++ce)P[ce]===-1&&(P[ce]=0);switch(P[0]){case 38:N.fg=this._updateAttrColor(N.fg,P[1],P[3],P[4],P[5]);break;case 48:N.bg=this._updateAttrColor(N.bg,P[1],P[3],P[4],P[5]);break;case 58:N.extended=N.extended.clone(),N.extended.underlineColor=this._updateAttrColor(N.extended.underlineColor,P[1],P[3],P[4],P[5])}return ae}_processUnderline(B,$){$.extended=$.extended.clone(),(!~B||B>5)&&(B=1),$.extended.underlineStyle=B,$.fg|=268435456,B===0&&($.fg&=-268435457),$.updateExtended()}_processSGR0(B){B.fg=d.DEFAULT_ATTR_DATA.fg,B.bg=d.DEFAULT_ATTR_DATA.bg,B.extended=B.extended.clone(),B.extended.underlineStyle=0,B.extended.underlineColor&=-67108864,B.updateExtended()}charAttributes(B){if(B.length===1&&B.params[0]===0)return this._processSGR0(this._curAttrData),!0;const $=B.length;let N;const P=this._curAttrData;for(let Z=0;Z<$;Z++)N=B.params[Z],N>=30&&N<=37?(P.fg&=-50331904,P.fg|=16777216|N-30):N>=40&&N<=47?(P.bg&=-50331904,P.bg|=16777216|N-40):N>=90&&N<=97?(P.fg&=-50331904,P.fg|=16777224|N-90):N>=100&&N<=107?(P.bg&=-50331904,P.bg|=16777224|N-100):N===0?this._processSGR0(P):N===1?P.fg|=134217728:N===3?P.bg|=67108864:N===4?(P.fg|=268435456,this._processUnderline(B.hasSubParams(Z)?B.getSubParams(Z)[0]:1,P)):N===5?P.fg|=536870912:N===7?P.fg|=67108864:N===8?P.fg|=1073741824:N===9?P.fg|=2147483648:N===2?P.bg|=134217728:N===21?this._processUnderline(2,P):N===22?(P.fg&=-134217729,P.bg&=-134217729):N===23?P.bg&=-67108865:N===24?(P.fg&=-268435457,this._processUnderline(0,P)):N===25?P.fg&=-536870913:N===27?P.fg&=-67108865:N===28?P.fg&=-1073741825:N===29?P.fg&=2147483647:N===39?(P.fg&=-67108864,P.fg|=16777215&d.DEFAULT_ATTR_DATA.fg):N===49?(P.bg&=-67108864,P.bg|=16777215&d.DEFAULT_ATTR_DATA.bg):N===38||N===48||N===58?Z+=this._extractColor(B,Z,P):N===53?P.bg|=1073741824:N===55?P.bg&=-1073741825:N===59?(P.extended=P.extended.clone(),P.extended.underlineColor=-1,P.updateExtended()):N===100?(P.fg&=-67108864,P.fg|=16777215&d.DEFAULT_ATTR_DATA.fg,P.bg&=-67108864,P.bg|=16777215&d.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",N);return!0}deviceStatus(B){switch(B.params[0]){case 5:this._coreService.triggerDataEvent(`${g.C0.ESC}[0n`);break;case 6:const $=this._activeBuffer.y+1,N=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${g.C0.ESC}[${$};${N}R`)}return!0}deviceStatusPrivate(B){if(B.params[0]===6){const $=this._activeBuffer.y+1,N=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${g.C0.ESC}[?${$};${N}R`)}return!0}softReset(B){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=d.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(B){const $=B.params[0]||1;switch($){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 N=$%2==1;return this._optionsService.options.cursorBlink=N,!0}setScrollRegion(B){const $=B.params[0]||1;let N;return(B.length<2||(N=B.params[1])>this._bufferService.rows||N===0)&&(N=this._bufferService.rows),N>$&&(this._activeBuffer.scrollTop=$-1,this._activeBuffer.scrollBottom=N-1,this._setCursor(0,0)),!0}windowOptions(B){if(!G(B.params[0],this._optionsService.rawOptions.windowOptions))return!0;const $=B.length>1?B.params[1]:0;switch(B.params[0]){case 14:$!==2&&this._onRequestWindowsOptionsReport.fire(I.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(I.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${g.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:$!==0&&$!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),$!==0&&$!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:$!==0&&$!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),$!==0&&$!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(B){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(B){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(B){return this._windowTitle=B,this._onTitleChange.fire(B),!0}setIconName(B){return this._iconName=B,!0}setOrReportIndexedColor(B){const $=[],N=B.split(";");for(;N.length>1;){const P=N.shift(),Z=N.shift();if(/^\d+$/.exec(P)){const ae=parseInt(P);if(W(ae))if(Z==="?")$.push({type:0,index:ae});else{const ce=(0,O.parseColor)(Z);ce&&$.push({type:1,index:ae,color:ce})}}}return $.length&&this._onColor.fire($),!0}setHyperlink(B){const $=B.split(";");return!($.length<2)&&($[1]?this._createHyperlink($[0],$[1]):!$[0]&&this._finishHyperlink())}_createHyperlink(B,$){this._getCurrentLinkId()&&this._finishHyperlink();const N=B.split(":");let P;const Z=N.findIndex((ae=>ae.startsWith("id=")));return Z!==-1&&(P=N[Z].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:P,uri:$}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(B,$){const N=B.split(";");for(let P=0;P<N.length&&!($>=this._specialColors.length);++P,++$)if(N[P]==="?")this._onColor.fire([{type:0,index:this._specialColors[$]}]);else{const Z=(0,O.parseColor)(N[P]);Z&&this._onColor.fire([{type:1,index:this._specialColors[$],color:Z}])}return!0}setOrReportFgColor(B){return this._setOrReportSpecialColor(B,0)}setOrReportBgColor(B){return this._setOrReportSpecialColor(B,1)}setOrReportCursorColor(B){return this._setOrReportSpecialColor(B,2)}restoreIndexedColor(B){if(!B)return this._onColor.fire([{type:2}]),!0;const $=[],N=B.split(";");for(let P=0;P<N.length;++P)if(/^\d+$/.exec(N[P])){const Z=parseInt(N[P]);W(Z)&&$.push({type:2,index:Z})}return $.length&&this._onColor.fire($),!0}restoreFgColor(B){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(B){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(B){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,C.DEFAULT_CHARSET),!0}selectCharset(B){return B.length!==2?(this.selectDefaultCharset(),!0):(B[0]==="/"||this._charsetService.setgCharset(U[B[0]],C.CHARSETS[B[1]]||C.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 B=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,B,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=d.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=d.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(B){return this._charsetService.setgLevel(B),!0}screenAlignmentPattern(){const B=new b.CellData;B.content=4194373,B.fg=this._curAttrData.fg,B.bg=this._curAttrData.bg,this._setCursor(0,0);for(let $=0;$<this._bufferService.rows;++$){const N=this._activeBuffer.ybase+this._activeBuffer.y+$,P=this._activeBuffer.lines.get(N);P&&(P.fill(B),P.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(B,$){const N=this._bufferService.buffer,P=this._optionsService.rawOptions;return(Z=>(this._coreService.triggerDataEvent(`${g.C0.ESC}${Z}${g.C0.ESC}\\`),!0))(B==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:B==='"p'?'P1$r61;1"p':B==="r"?`P1$r${N.scrollTop+1};${N.scrollBottom+1}r`:B==="m"?"P1$r0m":B===" q"?`P1$r${{block:2,underline:4,bar:6}[P.cursorStyle]-(P.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(B,$){this._dirtyRowTracker.markRangeDirty(B,$)}}c.InputHandler=te;let q=class{constructor(Y){this._bufferService=Y,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(Y){Y<this.start?this.start=Y:Y>this.end&&(this.end=Y)}markRangeDirty(Y,B){Y>B&&(K=Y,Y=B,B=K),Y<this.start&&(this.start=Y),B>this.end&&(this.end=B)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function W(Y){return 0<=Y&&Y<256}q=h([y(0,L.IBufferService)],q)},844:(m,c)=>{function u(h){for(const y of h)y.dispose();h.length=0}Object.defineProperty(c,"__esModule",{value:!0}),c.getDisposeArrayDisposable=c.disposeArray=c.toDisposable=c.MutableDisposable=c.Disposable=void 0,c.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const h of this._disposables)h.dispose();this._disposables.length=0}register(h){return this._disposables.push(h),h}unregister(h){const y=this._disposables.indexOf(h);y!==-1&&this._disposables.splice(y,1)}},c.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){this._isDisposed||h===this._value||(this._value?.dispose(),this._value=h)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},c.toDisposable=function(h){return{dispose:h}},c.disposeArray=u,c.getDisposeArrayDisposable=function(h){return{dispose:()=>u(h)}}},1505:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.FourKeyMap=c.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(y,g,C){this._data[y]||(this._data[y]={}),this._data[y][g]=C}get(y,g){return this._data[y]?this._data[y][g]:void 0}clear(){this._data={}}}c.TwoKeyMap=u,c.FourKeyMap=class{constructor(){this._data=new u}set(h,y,g,C,T){this._data.get(h,y)||this._data.set(h,y,new u),this._data.get(h,y).set(g,C,T)}get(h,y,g,C){return this._data.get(h,y)?.get(g,C)}clear(){this._data.clear()}}},6114:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.isChromeOS=c.isLinux=c.isWindows=c.isIphone=c.isIpad=c.isMac=c.getSafariVersion=c.isSafari=c.isLegacyEdge=c.isFirefox=c.isNode=void 0,c.isNode=typeof process<"u"&&"title"in process;const u=c.isNode?"node":navigator.userAgent,h=c.isNode?"node":navigator.platform;c.isFirefox=u.includes("Firefox"),c.isLegacyEdge=u.includes("Edge"),c.isSafari=/^((?!chrome|android).)*safari/i.test(u),c.getSafariVersion=function(){if(!c.isSafari)return 0;const y=u.match(/Version\/(\d+)/);return y===null||y.length<2?0:parseInt(y[1])},c.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),c.isIpad=h==="iPad",c.isIphone=h==="iPhone",c.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),c.isLinux=h.indexOf("Linux")>=0,c.isChromeOS=/\bCrOS\b/.test(u)},6106:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.SortedList=void 0;let u=0;c.SortedList=class{constructor(h){this._getKey=h,this._array=[]}clear(){this._array.length=0}insert(h){this._array.length!==0?(u=this._search(this._getKey(h)),this._array.splice(u,0,h)):this._array.push(h)}delete(h){if(this._array.length===0)return!1;const y=this._getKey(h);if(y===void 0||(u=this._search(y),u===-1)||this._getKey(this._array[u])!==y)return!1;do if(this._array[u]===h)return this._array.splice(u,1),!0;while(++u<this._array.length&&this._getKey(this._array[u])===y);return!1}*getKeyIterator(h){if(this._array.length!==0&&(u=this._search(h),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===h))do yield this._array[u];while(++u<this._array.length&&this._getKey(this._array[u])===h)}forEachByKey(h,y){if(this._array.length!==0&&(u=this._search(h),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===h))do y(this._array[u]);while(++u<this._array.length&&this._getKey(this._array[u])===h)}values(){return[...this._array].values()}_search(h){let y=0,g=this._array.length-1;for(;g>=y;){let C=y+g>>1;const T=this._getKey(this._array[C]);if(T>h)g=C-1;else{if(!(T<h)){for(;C>0&&this._getKey(this._array[C-1])===h;)C--;return C}y=C+1}}return y}}},7226:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DebouncedIdleTask=c.IdleTaskQueue=c.PriorityTaskQueue=void 0;const h=u(6114);class y{constructor(){this._tasks=[],this._i=0}enqueue(T){this._tasks.push(T),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(T){this._idleCallback=void 0;let A=0,x=0,d=T.timeRemaining(),v=0;for(;this._i<this._tasks.length;){if(A=Date.now(),this._tasks[this._i]()||this._i++,A=Math.max(1,Date.now()-A),x=Math.max(A,x),v=T.timeRemaining(),1.5*x>v)return d-A<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(d-A))}ms`),void this._start();d=v}this.clear()}}class g extends y{_requestCallback(T){return setTimeout((()=>T(this._createDeadline(16))))}_cancelCallback(T){clearTimeout(T)}_createDeadline(T){const A=Date.now()+T;return{timeRemaining:()=>Math.max(0,A-Date.now())}}}c.PriorityTaskQueue=g,c.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends y{_requestCallback(C){return requestIdleCallback(C)}_cancelCallback(C){cancelIdleCallback(C)}}:g,c.DebouncedIdleTask=class{constructor(){this._queue=new c.IdleTaskQueue}set(C){this._queue.clear(),this._queue.enqueue(C)}flush(){this._queue.flush()}}},9282:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.updateWindowsModeWrappedState=void 0;const h=u(643);c.updateWindowsModeWrappedState=function(y){const g=y.buffer.lines.get(y.buffer.ybase+y.buffer.y-1),C=g?.get(y.cols-1),T=y.buffer.lines.get(y.buffer.ybase+y.buffer.y);T&&C&&(T.isWrapped=C[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&C[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ExtendedAttrs=c.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new h}static toColorRGB(g){return[g>>>16&255,g>>>8&255,255&g]}static fromColorRGB(g){return(255&g[0])<<16|(255&g[1])<<8|255&g[2]}clone(){const g=new u;return g.fg=this.fg,g.bg=this.bg,g.extended=this.extended.clone(),g}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}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}c.AttributeData=u;class h{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(g){this._ext=g}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(g){this._ext&=-469762049,this._ext|=g<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(g){this._ext&=-67108864,this._ext|=67108863&g}get urlId(){return this._urlId}set urlId(g){this._urlId=g}get underlineVariantOffset(){const g=(3758096384&this._ext)>>29;return g<0?4294967288^g:g}set underlineVariantOffset(g){this._ext&=536870911,this._ext|=g<<29&3758096384}constructor(g=0,C=0){this._ext=0,this._urlId=0,this._ext=g,this._urlId=C}clone(){return new h(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}c.ExtendedAttrs=h},9092:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Buffer=c.MAX_BUFFER_SIZE=void 0;const h=u(6349),y=u(7226),g=u(3734),C=u(8437),T=u(4634),A=u(511),x=u(643),d=u(4863),v=u(7116);c.MAX_BUFFER_SIZE=4294967295,c.Buffer=class{constructor(f,b,E){this._hasScrollback=f,this._optionsService=b,this._bufferService=E,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=C.DEFAULT_ATTR_DATA.clone(),this.savedCharset=v.DEFAULT_CHARSET,this.markers=[],this._nullCell=A.CellData.fromCharData([0,x.NULL_CELL_CHAR,x.NULL_CELL_WIDTH,x.NULL_CELL_CODE]),this._whitespaceCell=A.CellData.fromCharData([0,x.WHITESPACE_CELL_CHAR,x.WHITESPACE_CELL_WIDTH,x.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new y.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(f){return f?(this._nullCell.fg=f.fg,this._nullCell.bg=f.bg,this._nullCell.extended=f.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new g.ExtendedAttrs),this._nullCell}getWhitespaceCell(f){return f?(this._whitespaceCell.fg=f.fg,this._whitespaceCell.bg=f.bg,this._whitespaceCell.extended=f.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new g.ExtendedAttrs),this._whitespaceCell}getBlankLine(f,b){return new C.BufferLine(this._bufferService.cols,this.getNullCell(f),b)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const f=this.ybase+this.y-this.ydisp;return f>=0&&f<this._rows}_getCorrectBufferLength(f){if(!this._hasScrollback)return f;const b=f+this._optionsService.rawOptions.scrollback;return b>c.MAX_BUFFER_SIZE?c.MAX_BUFFER_SIZE:b}fillViewportRows(f){if(this.lines.length===0){f===void 0&&(f=C.DEFAULT_ATTR_DATA);let b=this._rows;for(;b--;)this.lines.push(this.getBlankLine(f))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(f,b){const E=this.getNullCell(C.DEFAULT_ATTR_DATA);let L=0;const R=this._getCorrectBufferLength(b);if(R>this.lines.maxLength&&(this.lines.maxLength=R),this.lines.length>0){if(this._cols<f)for(let k=0;k<this.lines.length;k++)L+=+this.lines.get(k).resize(f,E);let M=0;if(this._rows<b)for(let k=this._rows;k<b;k++)this.lines.length<b+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new C.BufferLine(f,E)):this.ybase>0&&this.lines.length<=this.ybase+this.y+M+1?(this.ybase--,M++,this.ydisp>0&&this.ydisp--):this.lines.push(new C.BufferLine(f,E)));else for(let k=this._rows;k>b;k--)this.lines.length>b+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(R<this.lines.maxLength){const k=this.lines.length-R;k>0&&(this.lines.trimStart(k),this.ybase=Math.max(this.ybase-k,0),this.ydisp=Math.max(this.ydisp-k,0),this.savedY=Math.max(this.savedY-k,0)),this.lines.maxLength=R}this.x=Math.min(this.x,f-1),this.y=Math.min(this.y,b-1),M&&(this.y+=M),this.savedX=Math.min(this.savedX,f-1),this.scrollTop=0}if(this.scrollBottom=b-1,this._isReflowEnabled&&(this._reflow(f,b),this._cols>f))for(let M=0;M<this.lines.length;M++)L+=+this.lines.get(M).resize(f,E);this._cols=f,this._rows=b,this._memoryCleanupQueue.clear(),L>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let f=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,f=!1);let b=0;for(;this._memoryCleanupPosition<this.lines.length;)if(b+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),b>100)return!0;return f}get _isReflowEnabled(){const f=this._optionsService.rawOptions.windowsPty;return f&&f.buildNumber?this._hasScrollback&&f.backend==="conpty"&&f.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(f,b){this._cols!==f&&(f>this._cols?this._reflowLarger(f,b):this._reflowSmaller(f,b))}_reflowLarger(f,b){const E=(0,T.reflowLargerGetLinesToRemove)(this.lines,this._cols,f,this.ybase+this.y,this.getNullCell(C.DEFAULT_ATTR_DATA));if(E.length>0){const L=(0,T.reflowLargerCreateNewLayout)(this.lines,E);(0,T.reflowLargerApplyNewLayout)(this.lines,L.layout),this._reflowLargerAdjustViewport(f,b,L.countRemoved)}}_reflowLargerAdjustViewport(f,b,E){const L=this.getNullCell(C.DEFAULT_ATTR_DATA);let R=E;for(;R-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<b&&this.lines.push(new C.BufferLine(f,L))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-E,0)}_reflowSmaller(f,b){const E=this.getNullCell(C.DEFAULT_ATTR_DATA),L=[];let R=0;for(let M=this.lines.length-1;M>=0;M--){let k=this.lines.get(M);if(!k||!k.isWrapped&&k.getTrimmedLength()<=f)continue;const O=[k];for(;k.isWrapped&&M>0;)k=this.lines.get(--M),O.unshift(k);const U=this.ybase+this.y;if(U>=M&&U<M+O.length)continue;const F=O[O.length-1].getTrimmedLength(),G=(0,T.reflowSmallerGetNewLineLengths)(O,this._cols,f),I=G.length-O.length;let K;K=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+I):Math.max(0,this.lines.length-this.lines.maxLength+I);const te=[];for(let N=0;N<I;N++){const P=this.getBlankLine(C.DEFAULT_ATTR_DATA,!0);te.push(P)}te.length>0&&(L.push({start:M+O.length+R,newLines:te}),R+=te.length),O.push(...te);let q=G.length-1,W=G[q];W===0&&(q--,W=G[q]);let Y=O.length-I-1,B=F;for(;Y>=0;){const N=Math.min(B,W);if(O[q]===void 0)break;if(O[q].copyCellsFrom(O[Y],B-N,W-N,N,!0),W-=N,W===0&&(q--,W=G[q]),B-=N,B===0){Y--;const P=Math.max(Y,0);B=(0,T.getWrappedLineTrimmedLength)(O,P,this._cols)}}for(let N=0;N<O.length;N++)G[N]<f&&O[N].setCell(G[N],E);let $=I-K;for(;$-- >0;)this.ybase===0?this.y<b-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+R)-b&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+I,this.ybase+b-1)}if(L.length>0){const M=[],k=[];for(let q=0;q<this.lines.length;q++)k.push(this.lines.get(q));const O=this.lines.length;let U=O-1,F=0,G=L[F];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+R);let I=0;for(let q=Math.min(this.lines.maxLength-1,O+R-1);q>=0;q--)if(G&&G.start>U+I){for(let W=G.newLines.length-1;W>=0;W--)this.lines.set(q--,G.newLines[W]);q++,M.push({index:U+1,amount:G.newLines.length}),I+=G.newLines.length,G=L[++F]}else this.lines.set(q,k[U--]);let K=0;for(let q=M.length-1;q>=0;q--)M[q].index+=K,this.lines.onInsertEmitter.fire(M[q]),K+=M[q].amount;const te=Math.max(0,O+R-this.lines.maxLength);te>0&&this.lines.onTrimEmitter.fire(te)}}translateBufferLineToString(f,b,E=0,L){const R=this.lines.get(f);return R?R.translateToString(b,E,L):""}getWrappedRangeForLine(f){let b=f,E=f;for(;b>0&&this.lines.get(b).isWrapped;)b--;for(;E+1<this.lines.length&&this.lines.get(E+1).isWrapped;)E++;return{first:b,last:E}}setupTabStops(f){for(f!=null?this.tabs[f]||(f=this.prevStop(f)):(this.tabs={},f=0);f<this._cols;f+=this._optionsService.rawOptions.tabStopWidth)this.tabs[f]=!0}prevStop(f){for(f==null&&(f=this.x);!this.tabs[--f]&&f>0;);return f>=this._cols?this._cols-1:f<0?0:f}nextStop(f){for(f==null&&(f=this.x);!this.tabs[++f]&&f<this._cols;);return f>=this._cols?this._cols-1:f<0?0:f}clearMarkers(f){this._isClearing=!0;for(let b=0;b<this.markers.length;b++)this.markers[b].line===f&&(this.markers[b].dispose(),this.markers.splice(b--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let f=0;f<this.markers.length;f++)this.markers[f].dispose(),this.markers.splice(f--,1);this._isClearing=!1}addMarker(f){const b=new d.Marker(f);return this.markers.push(b),b.register(this.lines.onTrim((E=>{b.line-=E,b.line<0&&b.dispose()}))),b.register(this.lines.onInsert((E=>{b.line>=E.index&&(b.line+=E.amount)}))),b.register(this.lines.onDelete((E=>{b.line>=E.index&&b.line<E.index+E.amount&&b.dispose(),b.line>E.index&&(b.line-=E.amount)}))),b.register(b.onDispose((()=>this._removeMarker(b)))),b}_removeMarker(f){this._isClearing||this.markers.splice(this.markers.indexOf(f),1)}}},8437:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferLine=c.DEFAULT_ATTR_DATA=void 0;const h=u(3734),y=u(511),g=u(643),C=u(482);c.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let T=0;class A{constructor(d,v,f=!1){this.isWrapped=f,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*d);const b=v||y.CellData.fromCharData([0,g.NULL_CELL_CHAR,g.NULL_CELL_WIDTH,g.NULL_CELL_CODE]);for(let E=0;E<d;++E)this.setCell(E,b);this.length=d}get(d){const v=this._data[3*d+0],f=2097151&v;return[this._data[3*d+1],2097152&v?this._combined[d]:f?(0,C.stringFromCodePoint)(f):"",v>>22,2097152&v?this._combined[d].charCodeAt(this._combined[d].length-1):f]}set(d,v){this._data[3*d+1]=v[g.CHAR_DATA_ATTR_INDEX],v[g.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[d]=v[1],this._data[3*d+0]=2097152|d|v[g.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*d+0]=v[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|v[g.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(d){return this._data[3*d+0]>>22}hasWidth(d){return 12582912&this._data[3*d+0]}getFg(d){return this._data[3*d+1]}getBg(d){return this._data[3*d+2]}hasContent(d){return 4194303&this._data[3*d+0]}getCodePoint(d){const v=this._data[3*d+0];return 2097152&v?this._combined[d].charCodeAt(this._combined[d].length-1):2097151&v}isCombined(d){return 2097152&this._data[3*d+0]}getString(d){const v=this._data[3*d+0];return 2097152&v?this._combined[d]:2097151&v?(0,C.stringFromCodePoint)(2097151&v):""}isProtected(d){return 536870912&this._data[3*d+2]}loadCell(d,v){return T=3*d,v.content=this._data[T+0],v.fg=this._data[T+1],v.bg=this._data[T+2],2097152&v.content&&(v.combinedData=this._combined[d]),268435456&v.bg&&(v.extended=this._extendedAttrs[d]),v}setCell(d,v){2097152&v.content&&(this._combined[d]=v.combinedData),268435456&v.bg&&(this._extendedAttrs[d]=v.extended),this._data[3*d+0]=v.content,this._data[3*d+1]=v.fg,this._data[3*d+2]=v.bg}setCellFromCodepoint(d,v,f,b){268435456&b.bg&&(this._extendedAttrs[d]=b.extended),this._data[3*d+0]=v|f<<22,this._data[3*d+1]=b.fg,this._data[3*d+2]=b.bg}addCodepointToCell(d,v,f){let b=this._data[3*d+0];2097152&b?this._combined[d]+=(0,C.stringFromCodePoint)(v):2097151&b?(this._combined[d]=(0,C.stringFromCodePoint)(2097151&b)+(0,C.stringFromCodePoint)(v),b&=-2097152,b|=2097152):b=v|4194304,f&&(b&=-12582913,b|=f<<22),this._data[3*d+0]=b}insertCells(d,v,f){if((d%=this.length)&&this.getWidth(d-1)===2&&this.setCellFromCodepoint(d-1,0,1,f),v<this.length-d){const b=new y.CellData;for(let E=this.length-d-v-1;E>=0;--E)this.setCell(d+v+E,this.loadCell(d+E,b));for(let E=0;E<v;++E)this.setCell(d+E,f)}else for(let b=d;b<this.length;++b)this.setCell(b,f);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,f)}deleteCells(d,v,f){if(d%=this.length,v<this.length-d){const b=new y.CellData;for(let E=0;E<this.length-d-v;++E)this.setCell(d+E,this.loadCell(d+v+E,b));for(let E=this.length-v;E<this.length;++E)this.setCell(E,f)}else for(let b=d;b<this.length;++b)this.setCell(b,f);d&&this.getWidth(d-1)===2&&this.setCellFromCodepoint(d-1,0,1,f),this.getWidth(d)!==0||this.hasContent(d)||this.setCellFromCodepoint(d,0,1,f)}replaceCells(d,v,f,b=!1){if(b)for(d&&this.getWidth(d-1)===2&&!this.isProtected(d-1)&&this.setCellFromCodepoint(d-1,0,1,f),v<this.length&&this.getWidth(v-1)===2&&!this.isProtected(v)&&this.setCellFromCodepoint(v,0,1,f);d<v&&d<this.length;)this.isProtected(d)||this.setCell(d,f),d++;else for(d&&this.getWidth(d-1)===2&&this.setCellFromCodepoint(d-1,0,1,f),v<this.length&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v,0,1,f);d<v&&d<this.length;)this.setCell(d++,f)}resize(d,v){if(d===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const f=3*d;if(d>this.length){if(this._data.buffer.byteLength>=4*f)this._data=new Uint32Array(this._data.buffer,0,f);else{const b=new Uint32Array(f);b.set(this._data),this._data=b}for(let b=this.length;b<d;++b)this.setCell(b,v)}else{this._data=this._data.subarray(0,f);const b=Object.keys(this._combined);for(let L=0;L<b.length;L++){const R=parseInt(b[L],10);R>=d&&delete this._combined[R]}const E=Object.keys(this._extendedAttrs);for(let L=0;L<E.length;L++){const R=parseInt(E[L],10);R>=d&&delete this._extendedAttrs[R]}}return this.length=d,4*f*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const d=new Uint32Array(this._data.length);return d.set(this._data),this._data=d,1}return 0}fill(d,v=!1){if(v)for(let f=0;f<this.length;++f)this.isProtected(f)||this.setCell(f,d);else{this._combined={},this._extendedAttrs={};for(let f=0;f<this.length;++f)this.setCell(f,d)}}copyFrom(d){this.length!==d.length?this._data=new Uint32Array(d._data):this._data.set(d._data),this.length=d.length,this._combined={};for(const v in d._combined)this._combined[v]=d._combined[v];this._extendedAttrs={};for(const v in d._extendedAttrs)this._extendedAttrs[v]=d._extendedAttrs[v];this.isWrapped=d.isWrapped}clone(){const d=new A(0);d._data=new Uint32Array(this._data),d.length=this.length;for(const v in this._combined)d._combined[v]=this._combined[v];for(const v in this._extendedAttrs)d._extendedAttrs[v]=this._extendedAttrs[v];return d.isWrapped=this.isWrapped,d}getTrimmedLength(){for(let d=this.length-1;d>=0;--d)if(4194303&this._data[3*d+0])return d+(this._data[3*d+0]>>22);return 0}getNoBgTrimmedLength(){for(let d=this.length-1;d>=0;--d)if(4194303&this._data[3*d+0]||50331648&this._data[3*d+2])return d+(this._data[3*d+0]>>22);return 0}copyCellsFrom(d,v,f,b,E){const L=d._data;if(E)for(let M=b-1;M>=0;M--){for(let k=0;k<3;k++)this._data[3*(f+M)+k]=L[3*(v+M)+k];268435456&L[3*(v+M)+2]&&(this._extendedAttrs[f+M]=d._extendedAttrs[v+M])}else for(let M=0;M<b;M++){for(let k=0;k<3;k++)this._data[3*(f+M)+k]=L[3*(v+M)+k];268435456&L[3*(v+M)+2]&&(this._extendedAttrs[f+M]=d._extendedAttrs[v+M])}const R=Object.keys(d._combined);for(let M=0;M<R.length;M++){const k=parseInt(R[M],10);k>=v&&(this._combined[k-v+f]=d._combined[k])}}translateToString(d,v,f,b){v=v??0,f=f??this.length,d&&(f=Math.min(f,this.getTrimmedLength())),b&&(b.length=0);let E="";for(;v<f;){const L=this._data[3*v+0],R=2097151&L,M=2097152&L?this._combined[v]:R?(0,C.stringFromCodePoint)(R):g.WHITESPACE_CELL_CHAR;if(E+=M,b)for(let k=0;k<M.length;++k)b.push(v);v+=L>>22||1}return b&&b.push(v),E}}c.BufferLine=A},4841:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.getRangeLength=void 0,c.getRangeLength=function(u,h){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 h*(u.end.y-u.start.y)+(u.end.x-u.start.x+1)}},4634:(m,c)=>{function u(h,y,g){if(y===h.length-1)return h[y].getTrimmedLength();const C=!h[y].hasContent(g-1)&&h[y].getWidth(g-1)===1,T=h[y+1].getWidth(0)===2;return C&&T?g-1:g}Object.defineProperty(c,"__esModule",{value:!0}),c.getWrappedLineTrimmedLength=c.reflowSmallerGetNewLineLengths=c.reflowLargerApplyNewLayout=c.reflowLargerCreateNewLayout=c.reflowLargerGetLinesToRemove=void 0,c.reflowLargerGetLinesToRemove=function(h,y,g,C,T){const A=[];for(let x=0;x<h.length-1;x++){let d=x,v=h.get(++d);if(!v.isWrapped)continue;const f=[h.get(x)];for(;d<h.length&&v.isWrapped;)f.push(v),v=h.get(++d);if(C>=x&&C<d){x+=f.length-1;continue}let b=0,E=u(f,b,y),L=1,R=0;for(;L<f.length;){const k=u(f,L,y),O=k-R,U=g-E,F=Math.min(O,U);f[b].copyCellsFrom(f[L],R,E,F,!1),E+=F,E===g&&(b++,E=0),R+=F,R===k&&(L++,R=0),E===0&&b!==0&&f[b-1].getWidth(g-1)===2&&(f[b].copyCellsFrom(f[b-1],g-1,E++,1,!1),f[b-1].setCell(g-1,T))}f[b].replaceCells(E,g,T);let M=0;for(let k=f.length-1;k>0&&(k>b||f[k].getTrimmedLength()===0);k--)M++;M>0&&(A.push(x+f.length-M),A.push(M)),x+=f.length-1}return A},c.reflowLargerCreateNewLayout=function(h,y){const g=[];let C=0,T=y[C],A=0;for(let x=0;x<h.length;x++)if(T===x){const d=y[++C];h.onDeleteEmitter.fire({index:x-A,amount:d}),x+=d-1,A+=d,T=y[++C]}else g.push(x);return{layout:g,countRemoved:A}},c.reflowLargerApplyNewLayout=function(h,y){const g=[];for(let C=0;C<y.length;C++)g.push(h.get(y[C]));for(let C=0;C<g.length;C++)h.set(C,g[C]);h.length=y.length},c.reflowSmallerGetNewLineLengths=function(h,y,g){const C=[],T=h.map(((v,f)=>u(h,f,y))).reduce(((v,f)=>v+f));let A=0,x=0,d=0;for(;d<T;){if(T-d<g){C.push(T-d);break}A+=g;const v=u(h,x,y);A>v&&(A-=v,x++);const f=h[x].getWidth(A-1)===2;f&&A--;const b=f?g-1:g;C.push(b),d+=b}return C},c.getWrappedLineTrimmedLength=u},5295:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferSet=void 0;const h=u(8460),y=u(844),g=u(9092);class C extends y.Disposable{constructor(A,x){super(),this._optionsService=A,this._bufferService=x,this._onBufferActivate=this.register(new h.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 g.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new g.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(A){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(A),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(A,x){this._normal.resize(A,x),this._alt.resize(A,x),this.setupTabStops(A)}setupTabStops(A){this._normal.setupTabStops(A),this._alt.setupTabStops(A)}}c.BufferSet=C},511:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CellData=void 0;const h=u(482),y=u(643),g=u(3734);class C extends g.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new g.ExtendedAttrs,this.combinedData=""}static fromCharData(A){const x=new C;return x.setFromCharData(A),x}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,h.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(A){this.fg=A[y.CHAR_DATA_ATTR_INDEX],this.bg=0;let x=!1;if(A[y.CHAR_DATA_CHAR_INDEX].length>2)x=!0;else if(A[y.CHAR_DATA_CHAR_INDEX].length===2){const d=A[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=d&&d<=56319){const v=A[y.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=v&&v<=57343?this.content=1024*(d-55296)+v-56320+65536|A[y.CHAR_DATA_WIDTH_INDEX]<<22:x=!0}else x=!0}else this.content=A[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|A[y.CHAR_DATA_WIDTH_INDEX]<<22;x&&(this.combinedData=A[y.CHAR_DATA_CHAR_INDEX],this.content=2097152|A[y.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}c.CellData=C},643:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.WHITESPACE_CELL_CODE=c.WHITESPACE_CELL_WIDTH=c.WHITESPACE_CELL_CHAR=c.NULL_CELL_CODE=c.NULL_CELL_WIDTH=c.NULL_CELL_CHAR=c.CHAR_DATA_CODE_INDEX=c.CHAR_DATA_WIDTH_INDEX=c.CHAR_DATA_CHAR_INDEX=c.CHAR_DATA_ATTR_INDEX=c.DEFAULT_EXT=c.DEFAULT_ATTR=c.DEFAULT_COLOR=void 0,c.DEFAULT_COLOR=0,c.DEFAULT_ATTR=256|c.DEFAULT_COLOR<<9,c.DEFAULT_EXT=0,c.CHAR_DATA_ATTR_INDEX=0,c.CHAR_DATA_CHAR_INDEX=1,c.CHAR_DATA_WIDTH_INDEX=2,c.CHAR_DATA_CODE_INDEX=3,c.NULL_CELL_CHAR="",c.NULL_CELL_WIDTH=1,c.NULL_CELL_CODE=0,c.WHITESPACE_CELL_CHAR=" ",c.WHITESPACE_CELL_WIDTH=1,c.WHITESPACE_CELL_CODE=32},4863:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Marker=void 0;const h=u(8460),y=u(844);class g{get id(){return this._id}constructor(T){this.line=T,this.isDisposed=!1,this._disposables=[],this._id=g._nextId++,this._onDispose=this.register(new h.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,y.disposeArray)(this._disposables),this._disposables.length=0)}register(T){return this._disposables.push(T),T}}c.Marker=g,g._nextId=1},7116:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DEFAULT_CHARSET=c.CHARSETS=void 0,c.CHARSETS={},c.DEFAULT_CHARSET=c.CHARSETS.B,c.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:"≥","{":"π","|":"≠","}":"£","~":"·"},c.CHARSETS.A={"#":"£"},c.CHARSETS.B=void 0,c.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},c.CHARSETS.C=c.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},c.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},c.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},c.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},c.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},c.CHARSETS.E=c.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},c.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},c.CHARSETS.H=c.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},c.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(m,c)=>{var u,h,y;Object.defineProperty(c,"__esModule",{value:!0}),c.C1_ESCAPED=c.C1=c.C0=void 0,(function(g){g.NUL="\0",g.SOH="",g.STX="",g.ETX="",g.EOT="",g.ENQ="",g.ACK="",g.BEL="\x07",g.BS="\b",g.HT=" ",g.LF=`
775
- `,g.VT="\v",g.FF="\f",g.CR="\r",g.SO="",g.SI="",g.DLE="",g.DC1="",g.DC2="",g.DC3="",g.DC4="",g.NAK="",g.SYN="",g.ETB="",g.CAN="",g.EM="",g.SUB="",g.ESC="\x1B",g.FS="",g.GS="",g.RS="",g.US="",g.SP=" ",g.DEL=""})(u||(c.C0=u={})),(function(g){g.PAD="€",g.HOP="",g.BPH="‚",g.NBH="ƒ",g.IND="„",g.NEL="…",g.SSA="†",g.ESA="‡",g.HTS="ˆ",g.HTJ="‰",g.VTS="Š",g.PLD="‹",g.PLU="Œ",g.RI="",g.SS2="Ž",g.SS3="",g.DCS="",g.PU1="‘",g.PU2="’",g.STS="“",g.CCH="”",g.MW="•",g.SPA="–",g.EPA="—",g.SOS="˜",g.SGCI="™",g.SCI="š",g.CSI="›",g.ST="œ",g.OSC="",g.PM="ž",g.APC="Ÿ"})(h||(c.C1=h={})),(function(g){g.ST=`${u.ESC}\\`})(y||(c.C1_ESCAPED=y={}))},7399:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.evaluateKeyboardEvent=void 0;const h=u(2584),y={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:["'",'"']};c.evaluateKeyboardEvent=function(g,C,T,A){const x={type:0,cancel:!1,key:void 0},d=(g.shiftKey?1:0)|(g.altKey?2:0)|(g.ctrlKey?4:0)|(g.metaKey?8:0);switch(g.keyCode){case 0:g.key==="UIKeyInputUpArrow"?x.key=C?h.C0.ESC+"OA":h.C0.ESC+"[A":g.key==="UIKeyInputLeftArrow"?x.key=C?h.C0.ESC+"OD":h.C0.ESC+"[D":g.key==="UIKeyInputRightArrow"?x.key=C?h.C0.ESC+"OC":h.C0.ESC+"[C":g.key==="UIKeyInputDownArrow"&&(x.key=C?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:x.key=g.ctrlKey?"\b":h.C0.DEL,g.altKey&&(x.key=h.C0.ESC+x.key);break;case 9:if(g.shiftKey){x.key=h.C0.ESC+"[Z";break}x.key=h.C0.HT,x.cancel=!0;break;case 13:x.key=g.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,x.cancel=!0;break;case 27:x.key=h.C0.ESC,g.altKey&&(x.key=h.C0.ESC+h.C0.ESC),x.cancel=!0;break;case 37:if(g.metaKey)break;d?(x.key=h.C0.ESC+"[1;"+(d+1)+"D",x.key===h.C0.ESC+"[1;3D"&&(x.key=h.C0.ESC+(T?"b":"[1;5D"))):x.key=C?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(g.metaKey)break;d?(x.key=h.C0.ESC+"[1;"+(d+1)+"C",x.key===h.C0.ESC+"[1;3C"&&(x.key=h.C0.ESC+(T?"f":"[1;5C"))):x.key=C?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(g.metaKey)break;d?(x.key=h.C0.ESC+"[1;"+(d+1)+"A",T||x.key!==h.C0.ESC+"[1;3A"||(x.key=h.C0.ESC+"[1;5A")):x.key=C?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(g.metaKey)break;d?(x.key=h.C0.ESC+"[1;"+(d+1)+"B",T||x.key!==h.C0.ESC+"[1;3B"||(x.key=h.C0.ESC+"[1;5B")):x.key=C?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:g.shiftKey||g.ctrlKey||(x.key=h.C0.ESC+"[2~");break;case 46:x.key=d?h.C0.ESC+"[3;"+(d+1)+"~":h.C0.ESC+"[3~";break;case 36:x.key=d?h.C0.ESC+"[1;"+(d+1)+"H":C?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:x.key=d?h.C0.ESC+"[1;"+(d+1)+"F":C?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:g.shiftKey?x.type=2:g.ctrlKey?x.key=h.C0.ESC+"[5;"+(d+1)+"~":x.key=h.C0.ESC+"[5~";break;case 34:g.shiftKey?x.type=3:g.ctrlKey?x.key=h.C0.ESC+"[6;"+(d+1)+"~":x.key=h.C0.ESC+"[6~";break;case 112:x.key=d?h.C0.ESC+"[1;"+(d+1)+"P":h.C0.ESC+"OP";break;case 113:x.key=d?h.C0.ESC+"[1;"+(d+1)+"Q":h.C0.ESC+"OQ";break;case 114:x.key=d?h.C0.ESC+"[1;"+(d+1)+"R":h.C0.ESC+"OR";break;case 115:x.key=d?h.C0.ESC+"[1;"+(d+1)+"S":h.C0.ESC+"OS";break;case 116:x.key=d?h.C0.ESC+"[15;"+(d+1)+"~":h.C0.ESC+"[15~";break;case 117:x.key=d?h.C0.ESC+"[17;"+(d+1)+"~":h.C0.ESC+"[17~";break;case 118:x.key=d?h.C0.ESC+"[18;"+(d+1)+"~":h.C0.ESC+"[18~";break;case 119:x.key=d?h.C0.ESC+"[19;"+(d+1)+"~":h.C0.ESC+"[19~";break;case 120:x.key=d?h.C0.ESC+"[20;"+(d+1)+"~":h.C0.ESC+"[20~";break;case 121:x.key=d?h.C0.ESC+"[21;"+(d+1)+"~":h.C0.ESC+"[21~";break;case 122:x.key=d?h.C0.ESC+"[23;"+(d+1)+"~":h.C0.ESC+"[23~";break;case 123:x.key=d?h.C0.ESC+"[24;"+(d+1)+"~":h.C0.ESC+"[24~";break;default:if(!g.ctrlKey||g.shiftKey||g.altKey||g.metaKey)if(T&&!A||!g.altKey||g.metaKey)!T||g.altKey||g.ctrlKey||g.shiftKey||!g.metaKey?g.key&&!g.ctrlKey&&!g.altKey&&!g.metaKey&&g.keyCode>=48&&g.key.length===1?x.key=g.key:g.key&&g.ctrlKey&&(g.key==="_"&&(x.key=h.C0.US),g.key==="@"&&(x.key=h.C0.NUL)):g.keyCode===65&&(x.type=1);else{const v=y[g.keyCode],f=v?.[g.shiftKey?1:0];if(f)x.key=h.C0.ESC+f;else if(g.keyCode>=65&&g.keyCode<=90){const b=g.ctrlKey?g.keyCode-64:g.keyCode+32;let E=String.fromCharCode(b);g.shiftKey&&(E=E.toUpperCase()),x.key=h.C0.ESC+E}else if(g.keyCode===32)x.key=h.C0.ESC+(g.ctrlKey?h.C0.NUL:" ");else if(g.key==="Dead"&&g.code.startsWith("Key")){let b=g.code.slice(3,4);g.shiftKey||(b=b.toLowerCase()),x.key=h.C0.ESC+b,x.cancel=!0}}else g.keyCode>=65&&g.keyCode<=90?x.key=String.fromCharCode(g.keyCode-64):g.keyCode===32?x.key=h.C0.NUL:g.keyCode>=51&&g.keyCode<=55?x.key=String.fromCharCode(g.keyCode-51+27):g.keyCode===56?x.key=h.C0.DEL:g.keyCode===219?x.key=h.C0.ESC:g.keyCode===220?x.key=h.C0.FS:g.keyCode===221&&(x.key=h.C0.GS)}return x}},482:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Utf8ToUtf32=c.StringToUtf32=c.utf32ToString=c.stringFromCodePoint=void 0,c.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},c.utf32ToString=function(u,h=0,y=u.length){let g="";for(let C=h;C<y;++C){let T=u[C];T>65535?(T-=65536,g+=String.fromCharCode(55296+(T>>10))+String.fromCharCode(T%1024+56320)):g+=String.fromCharCode(T)}return g},c.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,h){const y=u.length;if(!y)return 0;let g=0,C=0;if(this._interim){const T=u.charCodeAt(C++);56320<=T&&T<=57343?h[g++]=1024*(this._interim-55296)+T-56320+65536:(h[g++]=this._interim,h[g++]=T),this._interim=0}for(let T=C;T<y;++T){const A=u.charCodeAt(T);if(55296<=A&&A<=56319){if(++T>=y)return this._interim=A,g;const x=u.charCodeAt(T);56320<=x&&x<=57343?h[g++]=1024*(A-55296)+x-56320+65536:(h[g++]=A,h[g++]=x)}else A!==65279&&(h[g++]=A)}return g}},c.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,h){const y=u.length;if(!y)return 0;let g,C,T,A,x=0,d=0,v=0;if(this.interim[0]){let E=!1,L=this.interim[0];L&=(224&L)==192?31:(240&L)==224?15:7;let R,M=0;for(;(R=63&this.interim[++M])&&M<4;)L<<=6,L|=R;const k=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,O=k-M;for(;v<O;){if(v>=y)return 0;if(R=u[v++],(192&R)!=128){v--,E=!0;break}this.interim[M++]=R,L<<=6,L|=63&R}E||(k===2?L<128?v--:h[x++]=L:k===3?L<2048||L>=55296&&L<=57343||L===65279||(h[x++]=L):L<65536||L>1114111||(h[x++]=L)),this.interim.fill(0)}const f=y-4;let b=v;for(;b<y;){for(;!(!(b<f)||128&(g=u[b])||128&(C=u[b+1])||128&(T=u[b+2])||128&(A=u[b+3]));)h[x++]=g,h[x++]=C,h[x++]=T,h[x++]=A,b+=4;if(g=u[b++],g<128)h[x++]=g;else if((224&g)==192){if(b>=y)return this.interim[0]=g,x;if(C=u[b++],(192&C)!=128){b--;continue}if(d=(31&g)<<6|63&C,d<128){b--;continue}h[x++]=d}else if((240&g)==224){if(b>=y)return this.interim[0]=g,x;if(C=u[b++],(192&C)!=128){b--;continue}if(b>=y)return this.interim[0]=g,this.interim[1]=C,x;if(T=u[b++],(192&T)!=128){b--;continue}if(d=(15&g)<<12|(63&C)<<6|63&T,d<2048||d>=55296&&d<=57343||d===65279)continue;h[x++]=d}else if((248&g)==240){if(b>=y)return this.interim[0]=g,x;if(C=u[b++],(192&C)!=128){b--;continue}if(b>=y)return this.interim[0]=g,this.interim[1]=C,x;if(T=u[b++],(192&T)!=128){b--;continue}if(b>=y)return this.interim[0]=g,this.interim[1]=C,this.interim[2]=T,x;if(A=u[b++],(192&A)!=128){b--;continue}if(d=(7&g)<<18|(63&C)<<12|(63&T)<<6|63&A,d<65536||d>1114111)continue;h[x++]=d}}return x}}},225:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeV6=void 0;const h=u(1480),y=[[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]],g=[[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 C;c.UnicodeV6=class{constructor(){if(this.version="6",!C){C=new Uint8Array(65536),C.fill(1),C[0]=0,C.fill(0,1,32),C.fill(0,127,160),C.fill(2,4352,4448),C[9001]=2,C[9002]=2,C.fill(2,11904,42192),C[12351]=1,C.fill(2,44032,55204),C.fill(2,63744,64256),C.fill(2,65040,65050),C.fill(2,65072,65136),C.fill(2,65280,65377),C.fill(2,65504,65511);for(let T=0;T<y.length;++T)C.fill(0,y[T][0],y[T][1]+1)}}wcwidth(T){return T<32?0:T<127?1:T<65536?C[T]:(function(A,x){let d,v=0,f=x.length-1;if(A<x[0][0]||A>x[f][1])return!1;for(;f>=v;)if(d=v+f>>1,A>x[d][1])v=d+1;else{if(!(A<x[d][0]))return!0;f=d-1}return!1})(T,g)?0:T>=131072&&T<=196605||T>=196608&&T<=262141?2:1}charProperties(T,A){let x=this.wcwidth(T),d=x===0&&A!==0;if(d){const v=h.UnicodeService.extractWidth(A);v===0?d=!1:v>x&&(x=v)}return h.UnicodeService.createPropertyValue(0,x,d)}}},5981:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.WriteBuffer=void 0;const h=u(8460),y=u(844);class g extends y.Disposable{constructor(T){super(),this._action=T,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(T,A){if(A!==void 0&&this._syncCalls>A)return void(this._syncCalls=0);if(this._pendingData+=T.length,this._writeBuffer.push(T),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let x;for(this._isSyncWriting=!0;x=this._writeBuffer.shift();){this._action(x);const d=this._callbacks.shift();d&&d()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(T,A){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+=T.length,this._writeBuffer.push(T),this._callbacks.push(A),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=T.length,this._writeBuffer.push(T),this._callbacks.push(A)}_innerWrite(T=0,A=!0){const x=T||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const d=this._writeBuffer[this._bufferOffset],v=this._action(d,A);if(v){const b=E=>Date.now()-x>=12?setTimeout((()=>this._innerWrite(0,E))):this._innerWrite(x,E);return void v.catch((E=>(queueMicrotask((()=>{throw E})),Promise.resolve(!1)))).then(b)}const f=this._callbacks[this._bufferOffset];if(f&&f(),this._bufferOffset++,this._pendingData-=d.length,Date.now()-x>=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()}}c.WriteBuffer=g},5941:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.toRgbString=c.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})$/,h=/^[\da-f]+$/;function y(g,C){const T=g.toString(16),A=T.length<2?"0"+T:T;switch(C){case 4:return T[0];case 8:return A;case 12:return(A+A).slice(0,3);default:return A+A}}c.parseColor=function(g){if(!g)return;let C=g.toLowerCase();if(C.indexOf("rgb:")===0){C=C.slice(4);const T=u.exec(C);if(T){const A=T[1]?15:T[4]?255:T[7]?4095:65535;return[Math.round(parseInt(T[1]||T[4]||T[7]||T[10],16)/A*255),Math.round(parseInt(T[2]||T[5]||T[8]||T[11],16)/A*255),Math.round(parseInt(T[3]||T[6]||T[9]||T[12],16)/A*255)]}}else if(C.indexOf("#")===0&&(C=C.slice(1),h.exec(C)&&[3,6,9,12].includes(C.length))){const T=C.length/3,A=[0,0,0];for(let x=0;x<3;++x){const d=parseInt(C.slice(T*x,T*x+T),16);A[x]=T===1?d<<4:T===2?d:T===3?d>>4:d>>8}return A}},c.toRgbString=function(g,C=16){const[T,A,x]=g;return`rgb:${y(T,C)}/${y(A,C)}/${y(x,C)}`}},5770:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.PAYLOAD_LIMIT=void 0,c.PAYLOAD_LIMIT=1e7},6351:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DcsHandler=c.DcsParser=void 0;const h=u(482),y=u(8742),g=u(5770),C=[];c.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=C,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=C}registerHandler(A,x){this._handlers[A]===void 0&&(this._handlers[A]=[]);const d=this._handlers[A];return d.push(x),{dispose:()=>{const v=d.indexOf(x);v!==-1&&d.splice(v,1)}}}clearHandler(A){this._handlers[A]&&delete this._handlers[A]}setHandlerFallback(A){this._handlerFb=A}reset(){if(this._active.length)for(let A=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;A>=0;--A)this._active[A].unhook(!1);this._stack.paused=!1,this._active=C,this._ident=0}hook(A,x){if(this.reset(),this._ident=A,this._active=this._handlers[A]||C,this._active.length)for(let d=this._active.length-1;d>=0;d--)this._active[d].hook(x);else this._handlerFb(this._ident,"HOOK",x)}put(A,x,d){if(this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].put(A,x,d);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(A,x,d))}unhook(A,x=!0){if(this._active.length){let d=!1,v=this._active.length-1,f=!1;if(this._stack.paused&&(v=this._stack.loopPosition-1,d=x,f=this._stack.fallThrough,this._stack.paused=!1),!f&&d===!1){for(;v>=0&&(d=this._active[v].unhook(A),d!==!0);v--)if(d instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!1,d;v--}for(;v>=0;v--)if(d=this._active[v].unhook(!1),d instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!0,d}else this._handlerFb(this._ident,"UNHOOK",A);this._active=C,this._ident=0}};const T=new y.Params;T.addParam(0),c.DcsHandler=class{constructor(A){this._handler=A,this._data="",this._params=T,this._hitLimit=!1}hook(A){this._params=A.length>1||A.params[0]?A.clone():T,this._data="",this._hitLimit=!1}put(A,x,d){this._hitLimit||(this._data+=(0,h.utf32ToString)(A,x,d),this._data.length>g.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(A){let x=!1;if(this._hitLimit)x=!1;else if(A&&(x=this._handler(this._data,this._params),x instanceof Promise))return x.then((d=>(this._params=T,this._data="",this._hitLimit=!1,d)));return this._params=T,this._data="",this._hitLimit=!1,x}}},2015:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.EscapeSequenceParser=c.VT500_TRANSITION_TABLE=c.TransitionTable=void 0;const h=u(844),y=u(8742),g=u(6242),C=u(6351);class T{constructor(v){this.table=new Uint8Array(v)}setDefault(v,f){this.table.fill(v<<4|f)}add(v,f,b,E){this.table[f<<8|v]=b<<4|E}addMany(v,f,b,E){for(let L=0;L<v.length;L++)this.table[f<<8|v[L]]=b<<4|E}}c.TransitionTable=T;const A=160;c.VT500_TRANSITION_TABLE=(function(){const d=new T(4095),v=Array.apply(null,Array(256)).map(((M,k)=>k)),f=(M,k)=>v.slice(M,k),b=f(32,127),E=f(0,24);E.push(25),E.push.apply(E,f(28,32));const L=f(0,14);let R;for(R in d.setDefault(1,0),d.addMany(b,0,2,0),L)d.addMany([24,26,153,154],R,3,0),d.addMany(f(128,144),R,3,0),d.addMany(f(144,152),R,3,0),d.add(156,R,0,0),d.add(27,R,11,1),d.add(157,R,4,8),d.addMany([152,158,159],R,0,7),d.add(155,R,11,3),d.add(144,R,11,9);return d.addMany(E,0,3,0),d.addMany(E,1,3,1),d.add(127,1,0,1),d.addMany(E,8,0,8),d.addMany(E,3,3,3),d.add(127,3,0,3),d.addMany(E,4,3,4),d.add(127,4,0,4),d.addMany(E,6,3,6),d.addMany(E,5,3,5),d.add(127,5,0,5),d.addMany(E,2,3,2),d.add(127,2,0,2),d.add(93,1,4,8),d.addMany(b,8,5,8),d.add(127,8,5,8),d.addMany([156,27,24,26,7],8,6,0),d.addMany(f(28,32),8,0,8),d.addMany([88,94,95],1,0,7),d.addMany(b,7,0,7),d.addMany(E,7,0,7),d.add(156,7,0,0),d.add(127,7,0,7),d.add(91,1,11,3),d.addMany(f(64,127),3,7,0),d.addMany(f(48,60),3,8,4),d.addMany([60,61,62,63],3,9,4),d.addMany(f(48,60),4,8,4),d.addMany(f(64,127),4,7,0),d.addMany([60,61,62,63],4,0,6),d.addMany(f(32,64),6,0,6),d.add(127,6,0,6),d.addMany(f(64,127),6,0,0),d.addMany(f(32,48),3,9,5),d.addMany(f(32,48),5,9,5),d.addMany(f(48,64),5,0,6),d.addMany(f(64,127),5,7,0),d.addMany(f(32,48),4,9,5),d.addMany(f(32,48),1,9,2),d.addMany(f(32,48),2,9,2),d.addMany(f(48,127),2,10,0),d.addMany(f(48,80),1,10,0),d.addMany(f(81,88),1,10,0),d.addMany([89,90,92],1,10,0),d.addMany(f(96,127),1,10,0),d.add(80,1,11,9),d.addMany(E,9,0,9),d.add(127,9,0,9),d.addMany(f(28,32),9,0,9),d.addMany(f(32,48),9,9,12),d.addMany(f(48,60),9,8,10),d.addMany([60,61,62,63],9,9,10),d.addMany(E,11,0,11),d.addMany(f(32,128),11,0,11),d.addMany(f(28,32),11,0,11),d.addMany(E,10,0,10),d.add(127,10,0,10),d.addMany(f(28,32),10,0,10),d.addMany(f(48,60),10,8,10),d.addMany([60,61,62,63],10,0,11),d.addMany(f(32,48),10,9,12),d.addMany(E,12,0,12),d.add(127,12,0,12),d.addMany(f(28,32),12,0,12),d.addMany(f(32,48),12,9,12),d.addMany(f(48,64),12,0,11),d.addMany(f(64,127),12,12,13),d.addMany(f(64,127),10,12,13),d.addMany(f(64,127),9,12,13),d.addMany(E,13,13,13),d.addMany(b,13,13,13),d.add(127,13,0,13),d.addMany([27,156,24,26],13,14,0),d.add(A,0,2,0),d.add(A,8,5,8),d.add(A,6,0,6),d.add(A,11,0,11),d.add(A,13,13,13),d})();class x extends h.Disposable{constructor(v=c.VT500_TRANSITION_TABLE){super(),this._transitions=v,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new y.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(f,b,E)=>{},this._executeHandlerFb=f=>{},this._csiHandlerFb=(f,b)=>{},this._escHandlerFb=f=>{},this._errorHandlerFb=f=>f,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,h.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new g.OscParser),this._dcsParser=this.register(new C.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(v,f=[64,126]){let b=0;if(v.prefix){if(v.prefix.length>1)throw new Error("only one byte as prefix supported");if(b=v.prefix.charCodeAt(0),b&&60>b||b>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(v.intermediates){if(v.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let L=0;L<v.intermediates.length;++L){const R=v.intermediates.charCodeAt(L);if(32>R||R>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");b<<=8,b|=R}}if(v.final.length!==1)throw new Error("final must be a single byte");const E=v.final.charCodeAt(0);if(f[0]>E||E>f[1])throw new Error(`final must be in range ${f[0]} .. ${f[1]}`);return b<<=8,b|=E,b}identToString(v){const f=[];for(;v;)f.push(String.fromCharCode(255&v)),v>>=8;return f.reverse().join("")}setPrintHandler(v){this._printHandler=v}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(v,f){const b=this._identifier(v,[48,126]);this._escHandlers[b]===void 0&&(this._escHandlers[b]=[]);const E=this._escHandlers[b];return E.push(f),{dispose:()=>{const L=E.indexOf(f);L!==-1&&E.splice(L,1)}}}clearEscHandler(v){this._escHandlers[this._identifier(v,[48,126])]&&delete this._escHandlers[this._identifier(v,[48,126])]}setEscHandlerFallback(v){this._escHandlerFb=v}setExecuteHandler(v,f){this._executeHandlers[v.charCodeAt(0)]=f}clearExecuteHandler(v){this._executeHandlers[v.charCodeAt(0)]&&delete this._executeHandlers[v.charCodeAt(0)]}setExecuteHandlerFallback(v){this._executeHandlerFb=v}registerCsiHandler(v,f){const b=this._identifier(v);this._csiHandlers[b]===void 0&&(this._csiHandlers[b]=[]);const E=this._csiHandlers[b];return E.push(f),{dispose:()=>{const L=E.indexOf(f);L!==-1&&E.splice(L,1)}}}clearCsiHandler(v){this._csiHandlers[this._identifier(v)]&&delete this._csiHandlers[this._identifier(v)]}setCsiHandlerFallback(v){this._csiHandlerFb=v}registerDcsHandler(v,f){return this._dcsParser.registerHandler(this._identifier(v),f)}clearDcsHandler(v){this._dcsParser.clearHandler(this._identifier(v))}setDcsHandlerFallback(v){this._dcsParser.setHandlerFallback(v)}registerOscHandler(v,f){return this._oscParser.registerHandler(v,f)}clearOscHandler(v){this._oscParser.clearHandler(v)}setOscHandlerFallback(v){this._oscParser.setHandlerFallback(v)}setErrorHandler(v){this._errorHandler=v}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.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(v,f,b,E,L){this._parseStack.state=v,this._parseStack.handlers=f,this._parseStack.handlerPos=b,this._parseStack.transition=E,this._parseStack.chunkPos=L}parse(v,f,b){let E,L=0,R=0,M=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,M=this._parseStack.chunkPos+1;else{if(b===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const k=this._parseStack.handlers;let O=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(b===!1&&O>-1){for(;O>=0&&(E=k[O](this._params),E!==!0);O--)if(E instanceof Promise)return this._parseStack.handlerPos=O,E}this._parseStack.handlers=[];break;case 4:if(b===!1&&O>-1){for(;O>=0&&(E=k[O](),E!==!0);O--)if(E instanceof Promise)return this._parseStack.handlerPos=O,E}this._parseStack.handlers=[];break;case 6:if(L=v[this._parseStack.chunkPos],E=this._dcsParser.unhook(L!==24&&L!==26,b),E)return E;L===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(L=v[this._parseStack.chunkPos],E=this._oscParser.end(L!==24&&L!==26,b),E)return E;L===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,M=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let k=M;k<f;++k){switch(L=v[k],R=this._transitions.table[this.currentState<<8|(L<160?L:A)],R>>4){case 2:for(let I=k+1;;++I){if(I>=f||(L=v[I])<32||L>126&&L<A){this._printHandler(v,k,I),k=I-1;break}if(++I>=f||(L=v[I])<32||L>126&&L<A){this._printHandler(v,k,I),k=I-1;break}if(++I>=f||(L=v[I])<32||L>126&&L<A){this._printHandler(v,k,I),k=I-1;break}if(++I>=f||(L=v[I])<32||L>126&&L<A){this._printHandler(v,k,I),k=I-1;break}}break;case 3:this._executeHandlers[L]?this._executeHandlers[L]():this._executeHandlerFb(L),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:k,code:L,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const O=this._csiHandlers[this._collect<<8|L];let U=O?O.length-1:-1;for(;U>=0&&(E=O[U](this._params),E!==!0);U--)if(E instanceof Promise)return this._preserveStack(3,O,U,R,k),E;U<0&&this._csiHandlerFb(this._collect<<8|L,this._params),this.precedingJoinState=0;break;case 8:do switch(L){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(L-48)}while(++k<f&&(L=v[k])>47&&L<60);k--;break;case 9:this._collect<<=8,this._collect|=L;break;case 10:const F=this._escHandlers[this._collect<<8|L];let G=F?F.length-1:-1;for(;G>=0&&(E=F[G](),E!==!0);G--)if(E instanceof Promise)return this._preserveStack(4,F,G,R,k),E;G<0&&this._escHandlerFb(this._collect<<8|L),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|L,this._params);break;case 13:for(let I=k+1;;++I)if(I>=f||(L=v[I])===24||L===26||L===27||L>127&&L<A){this._dcsParser.put(v,k,I),k=I-1;break}break;case 14:if(E=this._dcsParser.unhook(L!==24&&L!==26),E)return this._preserveStack(6,[],0,R,k),E;L===27&&(R|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let I=k+1;;I++)if(I>=f||(L=v[I])<32||L>127&&L<A){this._oscParser.put(v,k,I),k=I-1;break}break;case 6:if(E=this._oscParser.end(L!==24&&L!==26),E)return this._preserveStack(5,[],0,R,k),E;L===27&&(R|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&R}}}c.EscapeSequenceParser=x},6242:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.OscHandler=c.OscParser=void 0;const h=u(5770),y=u(482),g=[];c.OscParser=class{constructor(){this._state=0,this._active=g,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(C,T){this._handlers[C]===void 0&&(this._handlers[C]=[]);const A=this._handlers[C];return A.push(T),{dispose:()=>{const x=A.indexOf(T);x!==-1&&A.splice(x,1)}}}clearHandler(C){this._handlers[C]&&delete this._handlers[C]}setHandlerFallback(C){this._handlerFb=C}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=g}reset(){if(this._state===2)for(let C=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;C>=0;--C)this._active[C].end(!1);this._stack.paused=!1,this._active=g,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||g,this._active.length)for(let C=this._active.length-1;C>=0;C--)this._active[C].start();else this._handlerFb(this._id,"START")}_put(C,T,A){if(this._active.length)for(let x=this._active.length-1;x>=0;x--)this._active[x].put(C,T,A);else this._handlerFb(this._id,"PUT",(0,y.utf32ToString)(C,T,A))}start(){this.reset(),this._state=1}put(C,T,A){if(this._state!==3){if(this._state===1)for(;T<A;){const x=C[T++];if(x===59){this._state=2,this._start();break}if(x<48||57<x)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+x-48}this._state===2&&A-T>0&&this._put(C,T,A)}}end(C,T=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let A=!1,x=this._active.length-1,d=!1;if(this._stack.paused&&(x=this._stack.loopPosition-1,A=T,d=this._stack.fallThrough,this._stack.paused=!1),!d&&A===!1){for(;x>=0&&(A=this._active[x].end(C),A!==!0);x--)if(A instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=x,this._stack.fallThrough=!1,A;x--}for(;x>=0;x--)if(A=this._active[x].end(!1),A instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=x,this._stack.fallThrough=!0,A}else this._handlerFb(this._id,"END",C);this._active=g,this._id=-1,this._state=0}}},c.OscHandler=class{constructor(C){this._handler=C,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(C,T,A){this._hitLimit||(this._data+=(0,y.utf32ToString)(C,T,A),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(C){let T=!1;if(this._hitLimit)T=!1;else if(C&&(T=this._handler(this._data),T instanceof Promise))return T.then((A=>(this._data="",this._hitLimit=!1,A)));return this._data="",this._hitLimit=!1,T}}},8742:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Params=void 0;const u=2147483647;class h{static fromArray(g){const C=new h;if(!g.length)return C;for(let T=Array.isArray(g[0])?1:0;T<g.length;++T){const A=g[T];if(Array.isArray(A))for(let x=0;x<A.length;++x)C.addSubParam(A[x]);else C.addParam(A)}return C}constructor(g=32,C=32){if(this.maxLength=g,this.maxSubParamsLength=C,C>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(g),this.length=0,this._subParams=new Int32Array(C),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(g),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const g=new h(this.maxLength,this.maxSubParamsLength);return g.params.set(this.params),g.length=this.length,g._subParams.set(this._subParams),g._subParamsLength=this._subParamsLength,g._subParamsIdx.set(this._subParamsIdx),g._rejectDigits=this._rejectDigits,g._rejectSubDigits=this._rejectSubDigits,g._digitIsSub=this._digitIsSub,g}toArray(){const g=[];for(let C=0;C<this.length;++C){g.push(this.params[C]);const T=this._subParamsIdx[C]>>8,A=255&this._subParamsIdx[C];A-T>0&&g.push(Array.prototype.slice.call(this._subParams,T,A))}return g}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(g){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(g<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=g>u?u:g}}addSubParam(g){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(g<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=g>u?u:g,this._subParamsIdx[this.length-1]++}}hasSubParams(g){return(255&this._subParamsIdx[g])-(this._subParamsIdx[g]>>8)>0}getSubParams(g){const C=this._subParamsIdx[g]>>8,T=255&this._subParamsIdx[g];return T-C>0?this._subParams.subarray(C,T):null}getSubParamsAll(){const g={};for(let C=0;C<this.length;++C){const T=this._subParamsIdx[C]>>8,A=255&this._subParamsIdx[C];A-T>0&&(g[C]=this._subParams.slice(T,A))}return g}addDigit(g){let C;if(this._rejectDigits||!(C=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const T=this._digitIsSub?this._subParams:this.params,A=T[C-1];T[C-1]=~A?Math.min(10*A+g,u):g}}c.Params=h},5741:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.AddonManager=void 0,c.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let u=this._addons.length-1;u>=0;u--)this._addons[u].instance.dispose()}loadAddon(u,h){const y={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(y),h.dispose=()=>this._wrappedAddonDispose(y),h.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let h=-1;for(let y=0;y<this._addons.length;y++)if(this._addons[y]===u){h=y;break}if(h===-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(h,1)}}},8771:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferApiView=void 0;const h=u(3785),y=u(511);c.BufferApiView=class{constructor(g,C){this._buffer=g,this.type=C}init(g){return this._buffer=g,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(g){const C=this._buffer.lines.get(g);if(C)return new h.BufferLineApiView(C)}getNullCell(){return new y.CellData}}},3785:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferLineApiView=void 0;const h=u(511);c.BufferLineApiView=class{constructor(y){this._line=y}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(y,g){if(!(y<0||y>=this._line.length))return g?(this._line.loadCell(y,g),g):this._line.loadCell(y,new h.CellData)}translateToString(y,g,C){return this._line.translateToString(y,g,C)}}},8285:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferNamespaceApi=void 0;const h=u(8771),y=u(8460),g=u(844);class C extends g.Disposable{constructor(A){super(),this._core=A,this._onBufferChange=this.register(new y.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new h.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new h.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)}}c.BufferNamespaceApi=C},7975:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ParserApi=void 0,c.ParserApi=class{constructor(u){this._core=u}registerCsiHandler(u,h){return this._core.registerCsiHandler(u,(y=>h(y.toArray())))}addCsiHandler(u,h){return this.registerCsiHandler(u,h)}registerDcsHandler(u,h){return this._core.registerDcsHandler(u,((y,g)=>h(y,g.toArray())))}addDcsHandler(u,h){return this.registerDcsHandler(u,h)}registerEscHandler(u,h){return this._core.registerEscHandler(u,h)}addEscHandler(u,h){return this.registerEscHandler(u,h)}registerOscHandler(u,h){return this._core.registerOscHandler(u,h)}addOscHandler(u,h){return this.registerOscHandler(u,h)}}},7090:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeApi=void 0,c.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(m,c,u){var h=this&&this.__decorate||function(d,v,f,b){var E,L=arguments.length,R=L<3?v:b===null?b=Object.getOwnPropertyDescriptor(v,f):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(d,v,f,b);else for(var M=d.length-1;M>=0;M--)(E=d[M])&&(R=(L<3?E(R):L>3?E(v,f,R):E(v,f))||R);return L>3&&R&&Object.defineProperty(v,f,R),R},y=this&&this.__param||function(d,v){return function(f,b){v(f,b,d)}};Object.defineProperty(c,"__esModule",{value:!0}),c.BufferService=c.MINIMUM_ROWS=c.MINIMUM_COLS=void 0;const g=u(8460),C=u(844),T=u(5295),A=u(2585);c.MINIMUM_COLS=2,c.MINIMUM_ROWS=1;let x=c.BufferService=class extends C.Disposable{get buffer(){return this.buffers.active}constructor(d){super(),this.isUserScrolling=!1,this._onResize=this.register(new g.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new g.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(d.rawOptions.cols||0,c.MINIMUM_COLS),this.rows=Math.max(d.rawOptions.rows||0,c.MINIMUM_ROWS),this.buffers=this.register(new T.BufferSet(d,this))}resize(d,v){this.cols=d,this.rows=v,this.buffers.resize(d,v),this._onResize.fire({cols:d,rows:v})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(d,v=!1){const f=this.buffer;let b;b=this._cachedBlankLine,b&&b.length===this.cols&&b.getFg(0)===d.fg&&b.getBg(0)===d.bg||(b=f.getBlankLine(d,v),this._cachedBlankLine=b),b.isWrapped=v;const E=f.ybase+f.scrollTop,L=f.ybase+f.scrollBottom;if(f.scrollTop===0){const R=f.lines.isFull;L===f.lines.length-1?R?f.lines.recycle().copyFrom(b):f.lines.push(b.clone()):f.lines.splice(L+1,0,b.clone()),R?this.isUserScrolling&&(f.ydisp=Math.max(f.ydisp-1,0)):(f.ybase++,this.isUserScrolling||f.ydisp++)}else{const R=L-E+1;f.lines.shiftElements(E+1,R-1,-1),f.lines.set(L,b.clone())}this.isUserScrolling||(f.ydisp=f.ybase),this._onScroll.fire(f.ydisp)}scrollLines(d,v,f){const b=this.buffer;if(d<0){if(b.ydisp===0)return;this.isUserScrolling=!0}else d+b.ydisp>=b.ybase&&(this.isUserScrolling=!1);const E=b.ydisp;b.ydisp=Math.max(Math.min(b.ydisp+d,b.ybase),0),E!==b.ydisp&&(v||this._onScroll.fire(b.ydisp))}};c.BufferService=x=h([y(0,A.IOptionsService)],x)},7994:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CharsetService=void 0,c.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,h){this._charsets[u]=h,this.glevel===u&&(this.charset=h)}}},1753:function(m,c,u){var h=this&&this.__decorate||function(b,E,L,R){var M,k=arguments.length,O=k<3?E:R===null?R=Object.getOwnPropertyDescriptor(E,L):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(b,E,L,R);else for(var U=b.length-1;U>=0;U--)(M=b[U])&&(O=(k<3?M(O):k>3?M(E,L,O):M(E,L))||O);return k>3&&O&&Object.defineProperty(E,L,O),O},y=this&&this.__param||function(b,E){return function(L,R){E(L,R,b)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreMouseService=void 0;const g=u(2585),C=u(8460),T=u(844),A={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:b=>b.button!==4&&b.action===1&&(b.ctrl=!1,b.alt=!1,b.shift=!1,!0)},VT200:{events:19,restrict:b=>b.action!==32},DRAG:{events:23,restrict:b=>b.action!==32||b.button!==3},ANY:{events:31,restrict:b=>!0}};function x(b,E){let L=(b.ctrl?16:0)|(b.shift?4:0)|(b.alt?8:0);return b.button===4?(L|=64,L|=b.action):(L|=3&b.button,4&b.button&&(L|=64),8&b.button&&(L|=128),b.action===32?L|=32:b.action!==0||E||(L|=3)),L}const d=String.fromCharCode,v={DEFAULT:b=>{const E=[x(b,!1)+32,b.col+32,b.row+32];return E[0]>255||E[1]>255||E[2]>255?"":`\x1B[M${d(E[0])}${d(E[1])}${d(E[2])}`},SGR:b=>{const E=b.action===0&&b.button!==4?"m":"M";return`\x1B[<${x(b,!0)};${b.col};${b.row}${E}`},SGR_PIXELS:b=>{const E=b.action===0&&b.button!==4?"m":"M";return`\x1B[<${x(b,!0)};${b.x};${b.y}${E}`}};let f=c.CoreMouseService=class extends T.Disposable{constructor(b,E){super(),this._bufferService=b,this._coreService=E,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new C.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const L of Object.keys(A))this.addProtocol(L,A[L]);for(const L of Object.keys(v))this.addEncoding(L,v[L]);this.reset()}addProtocol(b,E){this._protocols[b]=E}addEncoding(b,E){this._encodings[b]=E}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(b){if(!this._protocols[b])throw new Error(`unknown protocol "${b}"`);this._activeProtocol=b,this._onProtocolChange.fire(this._protocols[b].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(b){if(!this._encodings[b])throw new Error(`unknown encoding "${b}"`);this._activeEncoding=b}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(b){if(b.col<0||b.col>=this._bufferService.cols||b.row<0||b.row>=this._bufferService.rows||b.button===4&&b.action===32||b.button===3&&b.action!==32||b.button!==4&&(b.action===2||b.action===3)||(b.col++,b.row++,b.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,b,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(b))return!1;const E=this._encodings[this._activeEncoding](b);return E&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(E):this._coreService.triggerDataEvent(E,!0)),this._lastEvent=b,!0}explainEvents(b){return{down:!!(1&b),up:!!(2&b),drag:!!(4&b),move:!!(8&b),wheel:!!(16&b)}}_equalEvents(b,E,L){if(L){if(b.x!==E.x||b.y!==E.y)return!1}else if(b.col!==E.col||b.row!==E.row)return!1;return b.button===E.button&&b.action===E.action&&b.ctrl===E.ctrl&&b.alt===E.alt&&b.shift===E.shift}};c.CoreMouseService=f=h([y(0,g.IBufferService),y(1,g.ICoreService)],f)},6975:function(m,c,u){var h=this&&this.__decorate||function(f,b,E,L){var R,M=arguments.length,k=M<3?b:L===null?L=Object.getOwnPropertyDescriptor(b,E):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(f,b,E,L);else for(var O=f.length-1;O>=0;O--)(R=f[O])&&(k=(M<3?R(k):M>3?R(b,E,k):R(b,E))||k);return M>3&&k&&Object.defineProperty(b,E,k),k},y=this&&this.__param||function(f,b){return function(E,L){b(E,L,f)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreService=void 0;const g=u(1439),C=u(8460),T=u(844),A=u(2585),x=Object.freeze({insertMode:!1}),d=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let v=c.CoreService=class extends T.Disposable{constructor(f,b,E){super(),this._bufferService=f,this._logService=b,this._optionsService=E,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new C.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new C.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new C.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new C.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,g.clone)(x),this.decPrivateModes=(0,g.clone)(d)}reset(){this.modes=(0,g.clone)(x),this.decPrivateModes=(0,g.clone)(d)}triggerDataEvent(f,b=!1){if(this._optionsService.rawOptions.disableStdin)return;const E=this._bufferService.buffer;b&&this._optionsService.rawOptions.scrollOnUserInput&&E.ybase!==E.ydisp&&this._onRequestScrollToBottom.fire(),b&&this._onUserInput.fire(),this._logService.debug(`sending data "${f}"`,(()=>f.split("").map((L=>L.charCodeAt(0))))),this._onData.fire(f)}triggerBinaryEvent(f){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${f}"`,(()=>f.split("").map((b=>b.charCodeAt(0))))),this._onBinary.fire(f))}};c.CoreService=v=h([y(0,A.IBufferService),y(1,A.ILogService),y(2,A.IOptionsService)],v)},9074:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DecorationService=void 0;const h=u(8055),y=u(8460),g=u(844),C=u(6106);let T=0,A=0;class x extends g.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new C.SortedList((f=>f?.marker.line)),this._onDecorationRegistered=this.register(new y.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new y.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,g.toDisposable)((()=>this.reset())))}registerDecoration(f){if(f.marker.isDisposed)return;const b=new d(f);if(b){const E=b.marker.onDispose((()=>b.dispose()));b.onDispose((()=>{b&&(this._decorations.delete(b)&&this._onDecorationRemoved.fire(b),E.dispose())})),this._decorations.insert(b),this._onDecorationRegistered.fire(b)}return b}reset(){for(const f of this._decorations.values())f.dispose();this._decorations.clear()}*getDecorationsAtCell(f,b,E){let L=0,R=0;for(const M of this._decorations.getKeyIterator(b))L=M.options.x??0,R=L+(M.options.width??1),f>=L&&f<R&&(!E||(M.options.layer??"bottom")===E)&&(yield M)}forEachDecorationAtCell(f,b,E,L){this._decorations.forEachByKey(b,(R=>{T=R.options.x??0,A=T+(R.options.width??1),f>=T&&f<A&&(!E||(R.options.layer??"bottom")===E)&&L(R)}))}}c.DecorationService=x;class d extends g.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=h.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=h.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(f){super(),this.options=f,this.onRenderEmitter=this.register(new y.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new y.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=f.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.InstantiationService=c.ServiceCollection=void 0;const h=u(2585),y=u(8343);class g{constructor(...T){this._entries=new Map;for(const[A,x]of T)this.set(A,x)}set(T,A){const x=this._entries.get(T);return this._entries.set(T,A),x}forEach(T){for(const[A,x]of this._entries.entries())T(A,x)}has(T){return this._entries.has(T)}get(T){return this._entries.get(T)}}c.ServiceCollection=g,c.InstantiationService=class{constructor(){this._services=new g,this._services.set(h.IInstantiationService,this)}setService(C,T){this._services.set(C,T)}getService(C){return this._services.get(C)}createInstance(C,...T){const A=(0,y.getServiceDependencies)(C).sort(((v,f)=>v.index-f.index)),x=[];for(const v of A){const f=this._services.get(v.id);if(!f)throw new Error(`[createInstance] ${C.name} depends on UNKNOWN service ${v.id}.`);x.push(f)}const d=A.length>0?A[0].index:T.length;if(T.length!==d)throw new Error(`[createInstance] First service dependency of ${C.name} at position ${d+1} conflicts with ${T.length} static arguments`);return new C(...T,...x)}}},7866:function(m,c,u){var h=this&&this.__decorate||function(d,v,f,b){var E,L=arguments.length,R=L<3?v:b===null?b=Object.getOwnPropertyDescriptor(v,f):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(d,v,f,b);else for(var M=d.length-1;M>=0;M--)(E=d[M])&&(R=(L<3?E(R):L>3?E(v,f,R):E(v,f))||R);return L>3&&R&&Object.defineProperty(v,f,R),R},y=this&&this.__param||function(d,v){return function(f,b){v(f,b,d)}};Object.defineProperty(c,"__esModule",{value:!0}),c.traceCall=c.setTraceLogger=c.LogService=void 0;const g=u(844),C=u(2585),T={trace:C.LogLevelEnum.TRACE,debug:C.LogLevelEnum.DEBUG,info:C.LogLevelEnum.INFO,warn:C.LogLevelEnum.WARN,error:C.LogLevelEnum.ERROR,off:C.LogLevelEnum.OFF};let A,x=c.LogService=class extends g.Disposable{get logLevel(){return this._logLevel}constructor(d){super(),this._optionsService=d,this._logLevel=C.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),A=this}_updateLogLevel(){this._logLevel=T[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(d){for(let v=0;v<d.length;v++)typeof d[v]=="function"&&(d[v]=d[v]())}_log(d,v,f){this._evalLazyOptionalParams(f),d.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+v,...f)}trace(d,...v){this._logLevel<=C.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,d,v)}debug(d,...v){this._logLevel<=C.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,d,v)}info(d,...v){this._logLevel<=C.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,d,v)}warn(d,...v){this._logLevel<=C.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,d,v)}error(d,...v){this._logLevel<=C.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,d,v)}};c.LogService=x=h([y(0,C.IOptionsService)],x),c.setTraceLogger=function(d){A=d},c.traceCall=function(d,v,f){if(typeof f.value!="function")throw new Error("not supported");const b=f.value;f.value=function(...E){if(A.logLevel!==C.LogLevelEnum.TRACE)return b.apply(this,E);A.trace(`GlyphRenderer#${b.name}(${E.map((R=>JSON.stringify(R))).join(", ")})`);const L=b.apply(this,E);return A.trace(`GlyphRenderer#${b.name} return`,L),L}}},7302:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.OptionsService=c.DEFAULT_OPTIONS=void 0;const h=u(8460),y=u(844),g=u(6114);c.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,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:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:g.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const C=["normal","bold","100","200","300","400","500","600","700","800","900"];class T extends y.Disposable{constructor(x){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const d={...c.DEFAULT_OPTIONS};for(const v in x)if(v in d)try{const f=x[v];d[v]=this._sanitizeAndValidateOption(v,f)}catch(f){console.error(f)}this.rawOptions=d,this.options={...d},this._setupOptions(),this.register((0,y.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(x,d){return this.onOptionChange((v=>{v===x&&d(this.rawOptions[x])}))}onMultipleOptionChange(x,d){return this.onOptionChange((v=>{x.indexOf(v)!==-1&&d()}))}_setupOptions(){const x=v=>{if(!(v in c.DEFAULT_OPTIONS))throw new Error(`No option with key "${v}"`);return this.rawOptions[v]},d=(v,f)=>{if(!(v in c.DEFAULT_OPTIONS))throw new Error(`No option with key "${v}"`);f=this._sanitizeAndValidateOption(v,f),this.rawOptions[v]!==f&&(this.rawOptions[v]=f,this._onOptionChange.fire(v))};for(const v in this.rawOptions){const f={get:x.bind(this,v),set:d.bind(this,v)};Object.defineProperty(this.options,v,f)}}_sanitizeAndValidateOption(x,d){switch(x){case"cursorStyle":if(d||(d=c.DEFAULT_OPTIONS[x]),!(function(v){return v==="block"||v==="underline"||v==="bar"})(d))throw new Error(`"${d}" is not a valid value for ${x}`);break;case"wordSeparator":d||(d=c.DEFAULT_OPTIONS[x]);break;case"fontWeight":case"fontWeightBold":if(typeof d=="number"&&1<=d&&d<=1e3)break;d=C.includes(d)?d:c.DEFAULT_OPTIONS[x];break;case"cursorWidth":d=Math.floor(d);case"lineHeight":case"tabStopWidth":if(d<1)throw new Error(`${x} cannot be less than 1, value: ${d}`);break;case"minimumContrastRatio":d=Math.max(1,Math.min(21,Math.round(10*d)/10));break;case"scrollback":if((d=Math.min(d,4294967295))<0)throw new Error(`${x} cannot be less than 0, value: ${d}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(d<=0)throw new Error(`${x} cannot be less than or equal to 0, value: ${d}`);break;case"rows":case"cols":if(!d&&d!==0)throw new Error(`${x} must be numeric, value: ${d}`);break;case"windowsPty":d=d??{}}return d}}c.OptionsService=T},2660:function(m,c,u){var h=this&&this.__decorate||function(T,A,x,d){var v,f=arguments.length,b=f<3?A:d===null?d=Object.getOwnPropertyDescriptor(A,x):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(T,A,x,d);else for(var E=T.length-1;E>=0;E--)(v=T[E])&&(b=(f<3?v(b):f>3?v(A,x,b):v(A,x))||b);return f>3&&b&&Object.defineProperty(A,x,b),b},y=this&&this.__param||function(T,A){return function(x,d){A(x,d,T)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OscLinkService=void 0;const g=u(2585);let C=c.OscLinkService=class{constructor(T){this._bufferService=T,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(T){const A=this._bufferService.buffer;if(T.id===void 0){const E=A.addMarker(A.ybase+A.y),L={data:T,id:this._nextId++,lines:[E]};return E.onDispose((()=>this._removeMarkerFromLink(L,E))),this._dataByLinkId.set(L.id,L),L.id}const x=T,d=this._getEntryIdKey(x),v=this._entriesWithId.get(d);if(v)return this.addLineToLink(v.id,A.ybase+A.y),v.id;const f=A.addMarker(A.ybase+A.y),b={id:this._nextId++,key:this._getEntryIdKey(x),data:x,lines:[f]};return f.onDispose((()=>this._removeMarkerFromLink(b,f))),this._entriesWithId.set(b.key,b),this._dataByLinkId.set(b.id,b),b.id}addLineToLink(T,A){const x=this._dataByLinkId.get(T);if(x&&x.lines.every((d=>d.line!==A))){const d=this._bufferService.buffer.addMarker(A);x.lines.push(d),d.onDispose((()=>this._removeMarkerFromLink(x,d)))}}getLinkData(T){return this._dataByLinkId.get(T)?.data}_getEntryIdKey(T){return`${T.id};;${T.uri}`}_removeMarkerFromLink(T,A){const x=T.lines.indexOf(A);x!==-1&&(T.lines.splice(x,1),T.lines.length===0&&(T.data.id!==void 0&&this._entriesWithId.delete(T.key),this._dataByLinkId.delete(T.id)))}};c.OscLinkService=C=h([y(0,g.IBufferService)],C)},8343:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.createDecorator=c.getServiceDependencies=c.serviceRegistry=void 0;const u="di$target",h="di$dependencies";c.serviceRegistry=new Map,c.getServiceDependencies=function(y){return y[h]||[]},c.createDecorator=function(y){if(c.serviceRegistry.has(y))return c.serviceRegistry.get(y);const g=function(C,T,A){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(x,d,v){d[u]===d?d[h].push({id:x,index:v}):(d[h]=[{id:x,index:v}],d[u]=d)})(g,C,A)};return g.toString=()=>y,c.serviceRegistry.set(y,g),g}},2585:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.IDecorationService=c.IUnicodeService=c.IOscLinkService=c.IOptionsService=c.ILogService=c.LogLevelEnum=c.IInstantiationService=c.ICharsetService=c.ICoreService=c.ICoreMouseService=c.IBufferService=void 0;const h=u(8343);var y;c.IBufferService=(0,h.createDecorator)("BufferService"),c.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),c.ICoreService=(0,h.createDecorator)("CoreService"),c.ICharsetService=(0,h.createDecorator)("CharsetService"),c.IInstantiationService=(0,h.createDecorator)("InstantiationService"),(function(g){g[g.TRACE=0]="TRACE",g[g.DEBUG=1]="DEBUG",g[g.INFO=2]="INFO",g[g.WARN=3]="WARN",g[g.ERROR=4]="ERROR",g[g.OFF=5]="OFF"})(y||(c.LogLevelEnum=y={})),c.ILogService=(0,h.createDecorator)("LogService"),c.IOptionsService=(0,h.createDecorator)("OptionsService"),c.IOscLinkService=(0,h.createDecorator)("OscLinkService"),c.IUnicodeService=(0,h.createDecorator)("UnicodeService"),c.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeService=void 0;const h=u(8460),y=u(225);class g{static extractShouldJoin(T){return(1&T)!=0}static extractWidth(T){return T>>1&3}static extractCharKind(T){return T>>3}static createPropertyValue(T,A,x=!1){return(16777215&T)<<3|(3&A)<<1|(x?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const T=new y.UnicodeV6;this.register(T),this._active=T.version,this._activeProvider=T}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(T){if(!this._providers[T])throw new Error(`unknown Unicode version "${T}"`);this._active=T,this._activeProvider=this._providers[T],this._onChange.fire(T)}register(T){this._providers[T.version]=T}wcwidth(T){return this._activeProvider.wcwidth(T)}getStringCellWidth(T){let A=0,x=0;const d=T.length;for(let v=0;v<d;++v){let f=T.charCodeAt(v);if(55296<=f&&f<=56319){if(++v>=d)return A+this.wcwidth(f);const L=T.charCodeAt(v);56320<=L&&L<=57343?f=1024*(f-55296)+L-56320+65536:A+=this.wcwidth(L)}const b=this.charProperties(f,x);let E=g.extractWidth(b);g.extractShouldJoin(b)&&(E-=g.extractWidth(x)),A+=E,x=b}return A}charProperties(T,A){return this._activeProvider.charProperties(T,A)}}c.UnicodeService=g}},a={};function l(m){var c=a[m];if(c!==void 0)return c.exports;var u=a[m]={exports:{}};return r[m].call(u.exports,u,u.exports,l),u.exports}var p={};return(()=>{var m=p;Object.defineProperty(m,"__esModule",{value:!0}),m.Terminal=void 0;const c=l(9042),u=l(3236),h=l(844),y=l(5741),g=l(8285),C=l(7975),T=l(7090),A=["cols","rows"];class x extends h.Disposable{constructor(v){super(),this._core=this.register(new u.Terminal(v)),this._addonManager=this.register(new y.AddonManager),this._publicOptions={...this._core.options};const f=E=>this._core.options[E],b=(E,L)=>{this._checkReadonlyOptions(E),this._core.options[E]=L};for(const E in this._core.options){const L={get:f.bind(this,E),set:b.bind(this,E)};Object.defineProperty(this._publicOptions,E,L)}}_checkReadonlyOptions(v){if(A.includes(v))throw new Error(`Option "${v}" 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 C.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new T.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 g.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const v=this._core.coreService.decPrivateModes;let f="none";switch(this._core.coreMouseService.activeProtocol){case"X10":f="x10";break;case"VT200":f="vt200";break;case"DRAG":f="drag";break;case"ANY":f="any"}return{applicationCursorKeysMode:v.applicationCursorKeys,applicationKeypadMode:v.applicationKeypad,bracketedPasteMode:v.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:f,originMode:v.origin,reverseWraparoundMode:v.reverseWraparound,sendFocusMode:v.sendFocus,wraparoundMode:v.wraparound}}get options(){return this._publicOptions}set options(v){for(const f in v)this._publicOptions[f]=v[f]}blur(){this._core.blur()}focus(){this._core.focus()}input(v,f=!0){this._core.input(v,f)}resize(v,f){this._verifyIntegers(v,f),this._core.resize(v,f)}open(v){this._core.open(v)}attachCustomKeyEventHandler(v){this._core.attachCustomKeyEventHandler(v)}attachCustomWheelEventHandler(v){this._core.attachCustomWheelEventHandler(v)}registerLinkProvider(v){return this._core.registerLinkProvider(v)}registerCharacterJoiner(v){return this._checkProposedApi(),this._core.registerCharacterJoiner(v)}deregisterCharacterJoiner(v){this._checkProposedApi(),this._core.deregisterCharacterJoiner(v)}registerMarker(v=0){return this._verifyIntegers(v),this._core.registerMarker(v)}registerDecoration(v){return this._checkProposedApi(),this._verifyPositiveIntegers(v.x??0,v.width??0,v.height??0),this._core.registerDecoration(v)}hasSelection(){return this._core.hasSelection()}select(v,f,b){this._verifyIntegers(v,f,b),this._core.select(v,f,b)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(v,f){this._verifyIntegers(v,f),this._core.selectLines(v,f)}dispose(){super.dispose()}scrollLines(v){this._verifyIntegers(v),this._core.scrollLines(v)}scrollPages(v){this._verifyIntegers(v),this._core.scrollPages(v)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(v){this._verifyIntegers(v),this._core.scrollToLine(v)}clear(){this._core.clear()}write(v,f){this._core.write(v,f)}writeln(v,f){this._core.write(v),this._core.write(`\r
776
- `,f)}paste(v){this._core.paste(v)}refresh(v,f){this._verifyIntegers(v,f),this._core.refresh(v,f)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(v){this._addonManager.loadAddon(this,v)}static get strings(){return c}_verifyIntegers(...v){for(const f of v)if(f===1/0||isNaN(f)||f%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...v){for(const f of v)if(f&&(f===1/0||isNaN(f)||f%1!=0||f<0))throw new Error("This API only accepts positive integers")}}m.Terminal=x})(),p})()))})(dp)),dp.exports}var I8=B8();const by=250,j8=5e3,yy=1,$8=4e3,z8=4001;function P8(e){const n=new AbortController,r=new TextEncoder;let a=by,l=null,p=null,m=null,c=!1;const u=()=>{p?.dispose(),p=null},h=(C,T)=>{m={cols:C,rows:T},l?.readyState===yy&&l.send(JSON.stringify({type:"resize",cols:C,rows:T}))},y=async()=>{for(;!n.signal.aborted;){e.onStatus?.("connecting");try{const C=e.fetchTicket??tA,{ticket:T}=await C(e.sessionId,{kind:e.kind,theaterId:e.theaterId,signal:n.signal});if(n.signal.aborted)return;await g(H8(T,e.location),e),a=by}catch(C){if(n.signal.aborted)return;e.onStatus?.("connecting",C instanceof Error?C.message:String(C))}await F8(a,n.signal),a=Math.min(a*2,j8)}},g=async(C,T)=>{await new Promise((A,x)=>{const d=(T.webSocketFactory??U8)(C);l=d,d.binaryType="arraybuffer",d.onopen=()=>{T.onStatus?.("live"),u(),p=T.terminal.onData(v=>{d.readyState===yy&&d.send(r.encode(v))}),m&&h(m.cols,m.rows)},d.onmessage=v=>{v.data instanceof ArrayBuffer&&T.terminal.write(new Uint8Array(v.data))},d.onerror=()=>{x(new Error("Terminal WebSocket error"))},d.onclose=v=>{u(),l===d&&(l=null);const f=v?.code;f===$8?n.abort():f===z8&&(n.abort(),T.onExit?.()),A()}})};return{start:()=>{c||(c=!0,y())},resize:h,dispose:()=>{n.abort(),u(),e.onStatus?.("closed"),l?.close(),l=null}}}function H8(e,n=window.location){return`${n.protocol==="https:"?"wss":"ws"}://${n.host}/terminal/ws?ticket=${encodeURIComponent(e)}`}function U8(e){return new WebSocket(e)}async function F8(e,n){await new Promise(r=>{const a=()=>{clearTimeout(l),n.removeEventListener("abort",a),r()},l=setTimeout(a,e);n.addEventListener("abort",a)})}const ix=14,q8={allowProposedApi:!0,convertEol:!0,cursorBlink:!0,cursorStyle:"block",fontFamily:'"Cascadia Code", "Cascadia Mono", "JetBrains Mono Variable", ui-monospace, "SF Mono", Menlo, monospace',fontSize:ix,lineHeight:1.2},W8=80,G8=120,K8={background:"oklch(23% 0.03 248)",foreground:"oklch(86% 0.018 90)",cursor:"oklch(82% 0.13 195)",selectionBackground:"oklch(78% 0.13 75 / 28%)",black:"oklch(18% 0.045 248)",brightBlack:"oklch(48% 0.03 248)",red:"oklch(72% 0.17 25)",green:"oklch(82% 0.13 195)",yellow:"oklch(86% 0.16 78)",blue:"oklch(70% 0.08 248)",magenta:"oklch(75% 0.11 320)",cyan:"oklch(82% 0.13 195)",white:"oklch(82% 0.018 90)",brightRed:"oklch(78% 0.18 25)",brightGreen:"oklch(88% 0.14 195)",brightYellow:"oklch(90% 0.16 78)",brightBlue:"oklch(78% 0.09 248)",brightMagenta:"oklch(82% 0.12 320)",brightCyan:"oklch(88% 0.14 195)",brightWhite:"oklch(96% 0.012 88)"},V8={background:"oklch(19% 0.008 252)",foreground:"oklch(85% 0.005 250)",cursor:"oklch(80% 0.105 205)",selectionBackground:"oklch(76% 0.115 62 / 28%)",black:"oklch(16% 0.008 252)",brightBlack:"oklch(46% 0.006 250)",red:"oklch(72% 0.17 25)",green:"oklch(80% 0.11 205)",yellow:"oklch(84% 0.14 64)",blue:"oklch(68% 0.05 250)",magenta:"oklch(75% 0.11 320)",cyan:"oklch(80% 0.11 205)",white:"oklch(81% 0.005 250)",brightRed:"oklch(78% 0.18 25)",brightGreen:"oklch(86% 0.13 205)",brightYellow:"oklch(88% 0.15 66)",brightBlue:"oklch(74% 0.06 250)",brightMagenta:"oklch(82% 0.12 320)",brightCyan:"oklch(86% 0.13 205)",brightWhite:"oklch(95% 0.003 250)"};function rx({sessionId:e,kind:n,theaterId:r,onExit:a,active:l,zoom:p=1}){const{activeTheme:m,terminalRenderer:c}=ql(),u=H.useRef(null),h=H.useRef(null),y=H.useRef(null),g=H.useRef(null),C=H.useRef(null),[T,A]=H.useState(p),x=H.useRef(a);x.current=a;const d=H.useRef(l);d.current=l;const[v,f]=H.useState("connecting");H.useEffect(()=>{const L=u.current;if(!L)return;let R=!1;const M=new I8.Terminal({...q8,theme:Sy(m)});h.current=M;const k=new XO.FitAddon;C.current=k,M.loadAddon(k),M.open(L),M.loadAddon(new QO.Unicode11Addon),M.unicode.activeVersion="11",M.attachCustomKeyEventHandler(q=>q.key==="Enter"&&q.shiftKey?(q.type==="keydown"&&M.input(`
777
- `),!1):!0);const O=P8({sessionId:e,kind:n,theaterId:r,terminal:M,onExit:()=>x.current?.(),onStatus:(q,W)=>{f(W?`${q}: ${W}`:q)}});y.current=O;let U=null;const F=()=>{k.fit(),O.resize(M.cols,M.rows)},G=()=>{F(),M.refresh(0,M.rows-1)},I=()=>{U&&clearTimeout(U),U=setTimeout(()=>{U=null,R||G()},W8)},K=async()=>{await document.fonts?.ready,!R&&(F(),O.start(),d.current!==!1&&M.focus())},te=new ResizeObserver(I);return te.observe(L),K(),()=>{R=!0,te.disconnect(),U&&clearTimeout(U),O.dispose(),h.current=null,y.current=null,C.current=null;try{M.dispose()}catch{}}},[n,e,r]),H.useEffect(()=>{l&&h.current?.focus()},[l]),H.useEffect(()=>{const L=h.current;if(!L)return;let R=!1;if(c==="webgl")try{const M=new N8;g.current=M,M.onContextLoss(()=>{if(!R){try{M.dispose()}catch{}g.current===M&&(g.current=null)}}),L.loadAddon(M)}catch{try{g.current?.dispose()}catch{}g.current=null}return()=>{R=!0;const M=g.current;if(M){g.current=null;try{M.dispose()}catch{}}}},[c,n,e]),H.useEffect(()=>{const L=h.current;L&&(L.options.theme=Sy(m))},[m]),H.useEffect(()=>{if(p===T)return;const L=setTimeout(()=>A(p),G8);return()=>clearTimeout(L)},[p,T]),H.useEffect(()=>{const L=h.current,R=C.current;!L||!R||(L.options.fontSize=ix*T,R.fit(),L.refresh(0,L.rows-1))},[T]);const b=v.startsWith("live"),E=T===1?void 0:{width:`${T*100}%`,height:`${T*100}%`,transform:`scale(${1/T})`,transformOrigin:"0 0"};return S.jsx("section",{className:"terminal-stage","aria-label":n==="shell"?"Shell terminal":"Fleet terminal",children:S.jsxs("div",{className:"terminal-shell",children:[b?null:S.jsxs("div",{className:"terminal-status","aria-live":"polite",children:[S.jsx("span",{className:"terminal-status-dot","aria-hidden":"true"}),v]}),S.jsx("div",{className:"terminal-viewport",children:S.jsx("div",{className:"terminal-canvas",ref:u,style:E})})]})})}function Sy(e){return e==="carbon"?V8:K8}const Y8=["n","ne","e","se","s","sw","w","nw"],fp=320,pp=200;function sx({geometry:e,zoom:n,onResize:r}){const a=H.useRef(null),l=(c,u)=>{u.preventDefault(),u.stopPropagation(),a.current={direction:c,pointerId:u.pointerId,startX:u.clientX,startY:u.clientY,geometry:e},u.currentTarget.setPointerCapture(u.pointerId)},p=c=>{const u=a.current;if(!u||u.pointerId!==c.pointerId)return;c.preventDefault(),c.stopPropagation();const h=(c.clientX-u.startX)/n,y=(c.clientY-u.startY)/n;r(X8(u.geometry,u.direction,h,y))},m=c=>{a.current?.pointerId===c.pointerId&&(c.preventDefault(),c.stopPropagation(),a.current=null,c.currentTarget.releasePointerCapture(c.pointerId))};return S.jsx(S.Fragment,{children:Y8.map(c=>S.jsx("div",{className:`canvas-panel-resize canvas-panel-resize--${c}`,onPointerDown:u=>l(c,u),onPointerMove:p,onPointerUp:m,onPointerCancel:m,"data-canvas-blocker":!0,"aria-hidden":"true"},c))})}function X8(e,n,r,a){let{x:l,y:p,width:m,height:c}=e;return n.includes("e")&&(m+=r),n.includes("s")&&(c+=a),n.includes("w")&&(l+=r,m-=r),n.includes("n")&&(p+=a,c-=a),m<fp&&(n.includes("w")&&(l-=fp-m),m=fp),c<pp&&(n.includes("n")&&(p-=pp-c),c=pp),{...e,x:l,y:p,width:m,height:c}}function Z8({state:e,session:n,geometry:r,viewport:a,active:l}){const p=H.useRef(null),[m,c]=H.useState(!1),[u,h]=H.useState(""),y=H.useRef(null),g=H.useRef(!1),C=H.useRef(!1),A=KS(e,n).filter(({job:W})=>!Mg(W.status)).map(({job:W})=>W),x=A.length,d=n.status==="dormant",v=Fl(n),f=e.operationNotifications[n.sessionId]?.kind==="input-waiting",b=d?null:f?"awaiting":x>0?"live":n.turnState==="running"?"turn":null,E=()=>{Pi(n.sessionId),kl(n.sessionId,r)},L=W=>{l||Pi(n.sessionId),WS(W)},R=W=>{W.button===0&&(W.preventDefault(),W.stopPropagation(),E(),p.current={pointerId:W.pointerId,startX:W.clientX,startY:W.clientY,geometry:r},W.currentTarget.setPointerCapture(W.pointerId))},M=W=>{const Y=p.current;!Y||Y.pointerId!==W.pointerId||(W.preventDefault(),W.stopPropagation(),kl(n.sessionId,{...Y.geometry,x:Y.geometry.x+(W.clientX-Y.startX)/a.zoom,y:Y.geometry.y+(W.clientY-Y.startY)/a.zoom}))},k=W=>{p.current?.pointerId===W.pointerId&&(W.preventDefault(),W.stopPropagation(),p.current=null,W.currentTarget.releasePointerCapture(W.pointerId))},O=W=>{W.stopPropagation()};H.useEffect(()=>{m&&(y.current?.focus(),y.current?.select())},[m]);const U=()=>{E(),C.current=!1,h(v),c(!0)},F=()=>{C.current=!0,c(!1),h("")},G=async()=>{if(!g.current){g.current=!0;try{ah(await QT(n.sessionId,u))}catch(W){uk(W instanceof Error?W.message:String(W))}finally{g.current=!1,C.current=!0,c(!1)}}},I=W=>{if(W.key==="Enter"){W.preventDefault(),G();return}W.key==="Escape"&&(W.preventDefault(),F())},K=W=>{W.stopPropagation(),E()},te=W=>{W.stopPropagation(),E()},q=W=>{W.stopPropagation()};return S.jsxs(S.Fragment,{children:[S.jsxs("article",{className:`canvas-panel ${l?"is-active":""} ${b?`is-running is-running--${b}`:""}`,style:{left:r.x,top:r.y,width:r.width,height:r.height,zIndex:r.zIndex},onPointerDown:E,"data-canvas-panel":!0,"aria-label":`Operation ${v}`,children:[S.jsxs("div",{className:"canvas-panel-titlebar",onPointerDown:R,onPointerMove:M,onPointerUp:k,onPointerCancel:k,"data-canvas-blocker":!0,children:[S.jsx("span",{className:xS(n,x),"aria-hidden":"true"}),m?S.jsx("input",{ref:y,className:"canvas-panel-rename-input",value:u,"aria-label":`${v} 이름 변경`,onPointerDown:W=>W.stopPropagation(),onChange:W=>h(W.target.value),onKeyDown:I,onBlur:()=>{if(C.current){C.current=!1;return}G()}}):S.jsx("span",{className:"canvas-panel-title",onPointerDown:K,onDoubleClick:U,title:"Double-click to rename",children:v}),S.jsx("span",{className:"canvas-panel-cli",children:n.cliLabel??n.cliId??"CLI"}),x>0?S.jsx("span",{className:"canvas-panel-job-count",children:x}):null,S.jsx("button",{type:"button",className:"canvas-panel-icon-button",onPointerDown:O,onClick:()=>{oT(n.sessionId)},"aria-label":`Minimize operation ${v}`,title:"Minimize panel",children:S.jsx(e7,{})}),S.jsx("button",{type:"button",className:"canvas-panel-icon-button",onPointerDown:O,onClick:()=>{Q8(n.sessionId)},"aria-label":`${d?"Forget":"Terminate"} operation ${v}`,title:d?"Forget operation":"Terminate operation",children:S.jsx(t7,{})})]}),S.jsx("div",{className:"canvas-panel-terminal",onPointerDown:te,onWheel:q,"data-canvas-blocker":!0,children:d?S.jsxs("button",{type:"button",className:"canvas-panel-dormant",onClick:()=>{J8(n.sessionId)},children:[S.jsx("span",{className:"canvas-panel-dormant-status",children:"Dormant"}),S.jsx("span",{className:"canvas-panel-dormant-action",children:"Resume"})]}):S.jsx(rx,{sessionId:n.sessionId,active:l,zoom:a.zoom,onExit:()=>qS(n.sessionId)})}),S.jsx(sx,{geometry:r,zoom:a.zoom,onResize:W=>kl(n.sessionId,W)})]}),A.length>0?S.jsx("div",{className:"canvas-panel-jobdock",style:{left:r.x,top:r.y+r.height,width:r.width,zIndex:r.zIndex},"data-canvas-blocker":!0,"aria-label":`Active carrier jobs for ${v}`,children:S.jsx(KO,{jobs:A,selectedJobId:e.selectedJobId,onSelect:L})}):null]})}async function J8(e){try{const n=await _S(e);ah(n),Pi(n.sessionId)}catch(n){FS(n instanceof Error?n.message:String(n))}}async function Q8(e){try{await mS(e)}catch(n){US(n instanceof Error?n.message:String(n));return}qS(e)}function e7(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M3.5 11.5h9",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function t7(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M4.6 4.6 11.4 11.4M11.4 4.6 4.6 11.4",fill:"none",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round"})})}const n7={overflow:!1,atStart:!1,atEnd:!0,page:1,pages:1};function i7({state:e,sessions:n,minimized:r}){const a=sT(),l=H.useRef(null),p=H.useRef(!0),[m,c]=H.useState(n7),u=new Map(n.map(v=>[v.sessionId,v])),h=r.map(v=>u.get(v)).filter(v=>!!v).map(v=>{const f=KS(e,v).filter(({job:E})=>!Mg(E.status)).length,b=v.status==="dormant"?null:f>0?"live":v.turnState==="running"?"turn":null;return{session:v,activeJobCount:f,underway:b,active:e.activeTerminalSessionId===v.sessionId}}),y=h.map(v=>v.session.sessionId).join(","),g=h.map(v=>`${Fl(v.session)}${v.session.cliLabel??v.session.cliId??""}${v.activeJobCount}`).join(""),C=H.useCallback(()=>{const v=l.current;if(!v)return;const{scrollLeft:f,clientWidth:b,clientHeight:E,scrollWidth:L}=v,R=Math.max(0,L-b),M=b>0&&E>0&&R>1,k=M?Math.max(1,Math.ceil(L/b)):1,O=f>=R-1,U=M?O?1:Math.min(k,Math.ceil((R-f)/b)+1):1;c({overflow:M,atStart:f<=1,atEnd:O,page:U,pages:k})},[]);if(H.useEffect(()=>{const v=l.current;if(!v)return;p.current=!0,a&&(v.scrollLeft=v.scrollWidth),C();const f=typeof ResizeObserver<"u"?new ResizeObserver(()=>{p.current&&(v.scrollLeft=v.scrollWidth),C()}):null;f?.observe(v);const b=()=>{const E=Math.max(0,v.scrollWidth-v.clientWidth);p.current=v.scrollLeft>=E-1,C()};return v.addEventListener("scroll",b,{passive:!0}),()=>{f?.disconnect(),v.removeEventListener("scroll",b)}},[a,y,C]),H.useEffect(()=>{const v=l.current;!v||!a||(p.current&&(v.scrollLeft=v.scrollWidth),C())},[a,g,C]),h.length===0)return null;const T=h.some(v=>v.underway==="live")?"live":h.some(v=>v.underway==="turn")?"turn":null,A=["canvas-dock-toggle",T?`canvas-dock-toggle--attention-${T}`:""].filter(Boolean).join(" "),x=a&&m.overflow,d=v=>{const f=l.current;if(!f)return;const b=typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;f.scrollBy({left:v*f.clientWidth,behavior:b?"auto":"smooth"})};return S.jsxs("div",{className:`canvas-dock ${a?"is-expanded":""}`,"data-canvas-blocker":!0,children:[S.jsxs("button",{type:"button",className:A,onClick:_T,"aria-expanded":a,"aria-label":a?"Collapse minimized panels":"Expand minimized panels",title:a?"Collapse":"Expand",children:[S.jsx("span",{className:"canvas-dock-toggle-beacon","aria-hidden":"true"}),S.jsx("span",{className:"canvas-dock-toggle-chevron","aria-hidden":"true",children:S.jsx(s7,{})}),S.jsx("span",{className:"canvas-dock-toggle-count",children:h.length})]}),S.jsxs("div",{className:"canvas-dock-rail",role:"toolbar","aria-label":"Minimized operations","aria-hidden":!a,inert:!a,children:[x?S.jsx("button",{type:"button",className:"canvas-dock-pager canvas-dock-pager--prev",onClick:()=>d(-1),disabled:m.atStart,"aria-label":"Show older minimized operations",title:"Older",children:S.jsx(wy,{direction:"prev"})}):null,S.jsx("div",{className:"canvas-dock-chips",ref:l,children:h.map((v,f)=>S.jsx(r7,{entry:v,index:f},v.session.sessionId))}),x?S.jsx("button",{type:"button",className:"canvas-dock-pager canvas-dock-pager--next",onClick:()=>d(1),disabled:m.atEnd,"aria-label":"Show newer minimized operations",title:"Newer",children:S.jsx(wy,{direction:"next"})}):null,x?S.jsxs("span",{className:"canvas-dock-page","aria-label":`Page ${m.page} of ${m.pages}`,children:[m.page,"/",m.pages]}):null]})]})}function r7({entry:e,index:n}){const{session:r,activeJobCount:a,underway:l,active:p}=e,m=Fl(r),c=()=>{lT(r.sessionId),Pi(r.sessionId)},u=["canvas-dock-chip",p?"canvas-dock-chip--active":"",l?`canvas-dock-chip--underway canvas-dock-chip--underway-${l}`:""].filter(Boolean).join(" ");return S.jsxs("div",{className:u,role:"button",tabIndex:0,"aria-label":`Restore operation ${m}`,title:"Click to restore",style:{"--i":n},onClick:c,onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),c())},children:[S.jsx("span",{className:xS(r,a),"aria-hidden":"true"}),S.jsx("span",{className:"canvas-dock-chip-name",children:m}),S.jsx("span",{className:"canvas-dock-chip-cli",children:r.cliLabel??r.cliId??"CLI"}),a>0?S.jsx("span",{className:"canvas-dock-chip-count",children:a}):null]})}function s7(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M4 10l4-4 4 4",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function wy({direction:e}){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:e==="prev"?"M10 3.5 5.5 8 10 12.5":"M6 3.5 10.5 8 6 12.5",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}const a7="is-animation-paused";function o7({viewport:e,backgroundAnimationEnabled:n}){const[r,a]=H.useState(()=>document.hidden);return H.useEffect(()=>{function l(){a(document.hidden)}return document.addEventListener("visibilitychange",l),()=>{document.removeEventListener("visibilitychange",l)}},[]),S.jsxs("div",{className:"operations-canvas-background","aria-hidden":"true",children:[S.jsx("div",{className:"operations-canvas-sea"}),S.jsx("div",{className:"operations-canvas-grid",style:{backgroundPosition:`${e.x}px ${e.y}px`,backgroundSize:`${48*e.zoom}px ${48*e.zoom}px, ${12*e.zoom}px ${12*e.zoom}px`}}),n?S.jsxs("div",{className:`operations-radar${r?` ${a7}`:""}`,children:[S.jsx("span",{className:"operations-radar-ring operations-radar-ring--outer"}),S.jsx("span",{className:"operations-radar-ring operations-radar-ring--middle"}),S.jsx("span",{className:"operations-radar-ring operations-radar-ring--inner"}),S.jsx("span",{className:"operations-radar-sweep"})]}):null]})}const ax="fleet-console.map.shortcutsCollapsed",Cy=aw.find(e=>e.title==="Map")??null;function l7(){const[e,n]=H.useState(c7);if(!Cy)return null;const r=()=>{n(a=>{const l=!a;return u7(l),l})};return e?S.jsx("button",{type:"button",className:"map-shortcuts-fab","data-canvas-blocker":!0,onClick:r,"aria-label":"맵 단축키 보기",title:"Map shortcuts",children:S.jsx(h7,{})}):S.jsxs("aside",{className:"map-shortcuts","data-canvas-blocker":!0,"aria-label":"Map shortcuts",children:[S.jsxs("div",{className:"map-shortcuts-head",children:[S.jsx("span",{className:"map-shortcuts-label",children:"Shortcuts"}),S.jsx("button",{type:"button",className:"map-shortcuts-toggle",onClick:r,"aria-label":"맵 단축키 접기",title:"Collapse",children:S.jsx(d7,{})})]}),S.jsx("dl",{className:"map-shortcuts-list",children:Cy.entries.map(a=>S.jsxs("div",{className:"map-shortcuts-entry",children:[S.jsx("dt",{className:"map-shortcuts-combos",children:a.combos.map((l,p)=>S.jsxs("span",{className:"map-shortcuts-combo",children:[p>0?S.jsx("span",{className:"map-shortcuts-or",children:"or"}):null,S.jsx("span",{className:"map-shortcuts-keyset",children:l.map(m=>S.jsx("kbd",{children:m},m))})]},l.join("+")))}),S.jsx("dd",{children:a.description})]},a.description))})]})}function c7(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(ax)==="true"}catch{return!1}}function u7(e){if(!(typeof window>"u"))try{window.localStorage.setItem(ax,String(e))}catch{}}function h7(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("circle",{cx:"8",cy:"8",r:"6",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),S.jsx("path",{d:"M6.3 6.1a1.8 1.8 0 1 1 2.5 1.7c-.5.3-.8.6-.8 1.2v.3",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"}),S.jsx("circle",{cx:"8",cy:"11.4",r:".8",fill:"currentColor"})]})}function d7(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M10.5 4.5 5.5 8l5 3.5M11 8H5.5",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function f7(e,n){return{x:e.x*n.zoom+n.x,y:e.y*n.zoom+n.y}}function eh(e,n){return{x:(e.x-n.x)/n.zoom,y:(e.y-n.y)/n.zoom}}function p7(e,n){return{...f7(e,n),width:e.width*n.zoom,height:e.height*n.zoom}}function g7({rect:e,viewport:n}){const r=p7(e,n);return S.jsx("div",{className:"canvas-rubber-band",style:{left:r.x,top:r.y,width:r.width,height:r.height},"aria-hidden":"true"})}function m7({id:e,theaterId:n,geometry:r,viewport:a,active:l}){const p=H.useRef(null),m=()=>{Pi(null),Pu(e),kf(e,{...r,zIndex:co()})},c=A=>{A.button===0&&(A.preventDefault(),A.stopPropagation(),m(),p.current={pointerId:A.pointerId,startX:A.clientX,startY:A.clientY,geometry:r},A.currentTarget.setPointerCapture(A.pointerId))},u=A=>{const x=p.current;!x||x.pointerId!==A.pointerId||(A.preventDefault(),A.stopPropagation(),kf(e,{...x.geometry,x:x.geometry.x+(A.clientX-x.startX)/a.zoom,y:x.geometry.y+(A.clientY-x.startY)/a.zoom}))},h=A=>{p.current?.pointerId===A.pointerId&&(A.preventDefault(),A.stopPropagation(),p.current=null,A.currentTarget.releasePointerCapture(A.pointerId))},y=A=>{A.stopPropagation()},g=A=>{A.stopPropagation(),m()},C=A=>{A.stopPropagation()},T=()=>{wb(e),mS(e).catch(A=>{US(A instanceof Error?A.message:String(A))})};return S.jsxs("article",{className:`canvas-panel canvas-panel--shell ${l?"is-active":""}`,style:{left:r.x,top:r.y,width:r.width,height:r.height,zIndex:r.zIndex},onPointerDown:m,"data-canvas-panel":!0,"aria-label":"Shell panel",children:[S.jsxs("div",{className:"canvas-panel-titlebar",onPointerDown:c,onPointerMove:u,onPointerUp:h,onPointerCancel:h,"data-canvas-blocker":!0,children:[S.jsx("span",{className:"tenant-beacon is-live","aria-hidden":"true"}),S.jsx("span",{className:"canvas-panel-title",children:"Shell"}),S.jsx("span",{className:"canvas-panel-cli",children:"shell"}),S.jsx("button",{type:"button",className:"canvas-panel-icon-button",onPointerDown:y,onClick:T,"aria-label":"Close shell panel",title:"Close shell",children:S.jsx(_7,{})})]}),S.jsx("div",{className:"canvas-panel-terminal",onPointerDown:g,onWheel:C,"data-canvas-blocker":!0,children:S.jsx(rx,{sessionId:e,kind:"shell",theaterId:n,active:l,zoom:a.zoom,onExit:()=>wb(e)})}),S.jsx(sx,{geometry:r,zoom:a.zoom,onResize:A=>kf(e,A)})]})}function _7(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M4.6 4.6 11.4 11.4M11.4 4.6 4.6 11.4",fill:"none",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round"})})}const v7=.25,b7=2,y7=200,S7=150,xy=5,w7=.0018;function C7({viewport:e,disabled:n=!1,consumePointerDown:r=!1,onViewportChange:a,onZoom:l,onCreate:p,onConsumePointerDown:m,onClick:c}){const u=H.useRef(null),h=H.useRef(e),[y,g]=H.useState(null),[C,T]=H.useState(!1),[A,x]=H.useState(!1);H.useEffect(()=>{h.current=e},[e]),H.useEffect(()=>{const R=k=>{k.key==="Shift"&&x(!0),!x7(k.target)&&k.code==="Space"&&(k.preventDefault(),T(!0))},M=k=>{k.key==="Shift"&&x(!1),k.code==="Space"&&T(!1)};return window.addEventListener("keydown",R),window.addEventListener("keyup",M),()=>{window.removeEventListener("keydown",R),window.removeEventListener("keyup",M)}},[]);const d=R=>{if(n||Ey(R.target)||R.button!==0&&R.button!==1)return;if(R.preventDefault(),r){m?.();return}const M=mp(R),k=R.shiftKey&&R.button===0&&!C?"create":"pan";u.current={pointerId:R.pointerId,mode:k,startScreen:M,currentScreen:M,startViewport:h.current},R.currentTarget.setPointerCapture(R.pointerId),k==="create"&&g(gp(M,M,h.current))},v=R=>{const M=u.current;if(!M||M.pointerId!==R.pointerId)return;R.preventDefault();const k=mp(R);if(u.current={...M,currentScreen:k},M.mode==="pan"){a({...M.startViewport,x:M.startViewport.x+k.x-M.startScreen.x,y:M.startViewport.y+k.y-M.startScreen.y});return}g(gp(M.startScreen,k,h.current))},f=R=>{L(R,!0)},b=R=>{L(R,!1)},E=R=>{if(n||Ey(R.target))return;R.preventDefault();const M=mp(R),k=h.current,O=E7(k.zoom*Math.exp(-R.deltaY*w7),v7,b7),U=eh(M,k);l({x:M.x-U.x*O,y:M.y-U.y*O,zoom:O})},L=(R,M)=>{const k=u.current;if(!k||k.pointerId!==R.pointerId||(u.current=null,R.currentTarget.releasePointerCapture(R.pointerId),g(null),!M))return;const O=Math.abs(k.currentScreen.x-k.startScreen.x),U=Math.abs(k.currentScreen.y-k.startScreen.y);if(O<xy&&U<xy){c?.();return}if(k.mode!=="create")return;const F=gp(k.startScreen,k.currentScreen,h.current),G={x:F.x,y:F.y,width:Math.max(F.width,y7),height:Math.max(F.height,S7)};p(G,k.currentScreen)};return{rubberBand:y,spaceActive:C,shiftActive:A,onPointerDown:d,onPointerMove:v,onPointerUp:f,onPointerCancel:b,onWheel:E}}function gp(e,n,r){const a=eh(e,r),l=eh(n,r),p=Math.min(a.x,l.x),m=Math.min(a.y,l.y);return{x:p,y:m,width:Math.abs(a.x-l.x),height:Math.abs(a.y-l.y)}}function mp(e){const n=e.currentTarget.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}function Ey(e){return e instanceof Element&&!!e.closest("[data-canvas-blocker], [data-canvas-panel]")}function x7(e){return e instanceof HTMLElement&&!!e.closest("input, textarea, select, [contenteditable='true']")}function E7(e,n,r){return Math.min(r,Math.max(n,e))}const T7="Shift-drag to create an Operation. Right-click for actions. Drag to pan; scroll to zoom.",A7=640,k7=400,R7=560,L7=360,M7={x:0,y:0,zoom:1};function D7({state:e}){const n=H.useRef(null),r=nT(),a=iT(),l=Qy(),p=rT(),m=NA(),c=BA(),u=mk(e),[h,y]=H.useState(null),[g,C]=H.useState(null),[T,A]=H.useState({width:0,height:0}),x=!e.activeTheaterId||e.agentClis.length===0||e.creatingTerminalSession||e.addingTheater;H.useEffect(()=>{const O=n.current;if(!O||typeof ResizeObserver>"u")return;const U=()=>A({width:O.clientWidth,height:O.clientHeight});U();const F=new ResizeObserver(U);return F.observe(O),()=>F.disconnect()},[]),H.useEffect(()=>{e.activeTerminalSessionId!==null&&Pu(null)},[e.activeTerminalSessionId]),H.useEffect(()=>{e.activeTerminalSessionId!==null&&p.includes(e.activeTerminalSessionId)&&Pi(null)},[e.activeTerminalSessionId,p]);const d=C7({viewport:r.viewport,disabled:x,onViewportChange:Au,onZoom:aT,onCreate:(O,U)=>{C(null),y({rect:O,anchor:U})},consumePointerDown:h!==null||g!==null,onConsumePointerDown:()=>{y(null),C(null)},onClick:I7}),v=async O=>{if(!(!e.activeTheaterId||!h)){kb();try{const U=await pb(e.activeTheaterId,O.id);kl(U.sessionId,j7(h.rect)),Rb(U),Pi(U.sessionId),y(null)}catch(U){Lb(U instanceof Error?U.message:String(U))}}},f=async O=>{const U=g?.canvasPoint;if(C(null),!(!e.activeTheaterId||!U)){kb();try{const F=await pb(e.activeTheaterId,O.id);kl(F.sessionId,Ay(U,A7,k7)),Rb(F),Pi(F.sessionId)}catch(F){Lb(F instanceof Error?F.message:String(F))}}},b=()=>{const O=g?.canvasPoint;if(C(null),!e.activeTheaterId||!O)return;Pi(null);const U=IA(e.activeTheaterId,{...Ay(O,R7,L7),zIndex:co()});Pu(U)},E=()=>{C(null),Au({...M7})},L=O=>{if(O.target instanceof Element&&O.target.closest("[data-canvas-blocker], [data-canvas-panel]"))return;O.preventDefault();const U=n.current?.getBoundingClientRect();if(!U)return;const F={x:O.clientX-U.left,y:O.clientY-U.top};y(null),C({anchor:F,canvasPoint:eh(F,r.viewport)})},R=new Set(p),M=Object.fromEntries(Object.entries(r.panels).filter(([O])=>!R.has(O))),k=u.length>0||Object.keys(m).length>0;return S.jsxs("main",{className:`operations-canvas ${d.spaceActive?"is-panning":""} ${d.shiftActive?"is-creating":""}`,onPointerDown:d.onPointerDown,onPointerMove:d.onPointerMove,onPointerUp:d.onPointerUp,onPointerCancel:d.onPointerCancel,onWheel:d.onWheel,onContextMenu:L,ref:n,children:[S.jsx(o7,{viewport:r.viewport,backgroundAnimationEnabled:a}),S.jsx("button",{type:"button",className:`canvas-background-toggle canvas-maximize-toggle ${l?"is-active":""}`,onClick:gT,"data-canvas-blocker":!0,"aria-label":l?"맵 최대화 해제":"맵 최대화","aria-pressed":l,title:l?"Exit fullscreen":"Maximize map",children:l?S.jsx(B7,{}):S.jsx(N7,{})}),S.jsx("button",{type:"button",className:`canvas-background-toggle ${a?"is-active":""}`,onClick:pT,"data-canvas-blocker":!0,"aria-label":a?"배경 애니메이션 끄기":"배경 애니메이션 켜기",title:a?"Background animation: on":"Background animation: off",children:S.jsx(O7,{})}),S.jsxs("div",{className:"operations-canvas-world",style:{transform:`translate(${r.viewport.x}px, ${r.viewport.y}px) scale(${r.viewport.zoom})`},children:[u.map(O=>{const U=r.panels[O.sessionId];return!U||R.has(O.sessionId)?null:S.jsx(Z8,{state:e,session:O,geometry:U,viewport:r.viewport,active:e.activeTerminalSessionId===O.sessionId},O.sessionId)}),Object.entries(m).map(([O,U])=>S.jsx(m7,{id:O,theaterId:U.theaterId,geometry:U.geometry,viewport:r.viewport,active:c===O},O))]}),k?null:S.jsxs("div",{className:"operations-canvas-empty","data-canvas-blocker":!0,children:[S.jsx("span",{className:"operations-canvas-empty-mark","aria-hidden":"true"}),S.jsx("p",{children:e.activeTheaterId?T7:"Add a Theater from the top bar to start operations."}),e.terminalSessionError?S.jsx("p",{className:"operations-canvas-error",children:e.terminalSessionError}):null]}),d.rubberBand?S.jsx(g7,{rect:d.rubberBand,viewport:r.viewport}):null,h?S.jsx(kO,{state:e,mode:"menu",anchor:h.anchor,viewportBounds:Ty(n.current),onSelect:v,onClose:()=>y(null)},`${h.anchor.x}:${h.anchor.y}`):null,g?S.jsx($O,{state:e,anchor:g.anchor,viewportBounds:Ty(n.current),onLaunchCli:O=>{f(O)},onOpenShell:b,onResetView:E,onClose:()=>C(null)},`${g.anchor.x}:${g.anchor.y}`):null,S.jsx(UO,{panels:M,shellPanels:m,viewport:r.viewport,canvasSize:T,onJump:O=>Au({x:T.width/2-O.x*r.viewport.zoom,y:T.height/2-O.y*r.viewport.zoom,zoom:r.viewport.zoom})}),k?S.jsx(l7,{}):null,S.jsx(i7,{state:e,sessions:u,minimized:p})]})}function O7(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("circle",{cx:"8",cy:"8",r:"5.2",fill:"none",stroke:"currentColor",strokeWidth:"1.1",strokeDasharray:"2 2"}),S.jsx("circle",{cx:"8",cy:"8",r:"2.6",fill:"none",stroke:"currentColor",strokeWidth:"1.1",opacity:"0.72"}),S.jsx("path",{d:"M8 8 12.2 5.8",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"}),S.jsx("circle",{cx:"8",cy:"8",r:".9",fill:"currentColor"})]})}function N7(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M3 6.4V3h3.4M13 6.4V3H9.6M3 9.6V13h3.4M13 9.6V13H9.6",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function B7(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M6.4 3v3.4H3M9.6 3v3.4H13M6.4 13V9.6H3M9.6 13V9.6H13",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ty(e){if(!e)return;const n=e.getBoundingClientRect();return{width:n.width,height:n.height}}function I7(){if(typeof document<"u"){const e=document.activeElement;e instanceof HTMLElement&&e.blur()}Pi(null),Pu(null)}function j7(e){return{x:e.x,y:e.y,width:e.width,height:e.height,zIndex:0}}function Ay(e,n,r){return{x:e.x,y:e.y,width:n,height:r,zIndex:0}}const $7=56;function z7(e,n){const r=H.useRef(null),a=H.useRef(!0),[l,p]=H.useState(!0),m=H.useCallback(u=>{a.current!==u&&(a.current=u,p(u))},[]);H.useEffect(()=>{const u=r.current;if(!u)return;const h=()=>{const y=u.scrollHeight-u.scrollTop-u.clientHeight;m(y<=$7)};return u.addEventListener("scroll",h,{passive:!0}),()=>u.removeEventListener("scroll",h)},[m]),H.useLayoutEffect(()=>{m(!0);const u=r.current;u&&(u.scrollTop=u.scrollHeight)},[e,m]),H.useLayoutEffect(()=>{const u=r.current;!u||!a.current||(u.scrollTop=u.scrollHeight)},[n]);const c=H.useCallback(()=>{const u=r.current;u&&(u.scrollTop=u.scrollHeight,u.focus({preventScroll:!0}),m(!0))},[m]);return{containerRef:r,pinned:l,jumpToLatest:c}}const ky=400,P7=["text","fallbackText","fallbackThought"],H7=H.memo(function({events:n}){return S.jsxs("ol",{className:"timeline","aria-label":"Raw event timeline",children:[n.length===0?S.jsx("li",{className:"timeline-empty",children:"No events observed."}):null,n.map((r,a)=>{const l=n[n.length-1-a];return l?S.jsx(U7,{event:l},l.id):null})]})}),U7=H.memo(function({event:n}){return S.jsxs("li",{className:"timeline-row",children:[S.jsx("time",{className:"timeline-time",children:CS(n.at)}),S.jsx("span",{className:"timeline-type",children:n.type}),S.jsx("code",{className:"timeline-payload",children:F7(n.event)})]})});function F7(e){const n={...e};delete n.type;for(const a of P7){const l=n[a];typeof l=="string"&&(n[a]=l.length>60?`${l.slice(0,60)}… (${l.length} chars)`:l)}const r=JSON.stringify(n);return r.length>ky?`${r.slice(0,ky)}…`:r}const q7=H.memo(function({track:n}){const r=sh(n.status),a=n.status==="stream",l=n.sentTextLength>n.text.length||n.sentThoughtLength>n.thought.length,p=n.sentTextLength+n.sentThoughtLength;return S.jsxs("article",{className:`track-card track-card--${r}`,children:[S.jsxs("header",{className:"track-head",children:[S.jsx("span",{className:`status-dot status-dot--${r}`,"aria-hidden":"true"}),S.jsx("h3",{className:"track-name",children:n.displayName}),n.displayCli?S.jsx("span",{className:"track-tag",children:n.displayCli}):null,n.model?S.jsx("span",{className:"track-tag track-tag--dim",children:n.model}):null,n.effort?S.jsx("span",{className:"track-tag track-tag--dim",children:n.effort}):null,S.jsx("span",{className:`track-status track-status--${r}`,children:CA(n.status)})]}),n.subtitle?S.jsx("p",{className:"track-subtitle",children:n.subtitle}):null,n.requestPreview?S.jsx(W7,{preview:n.requestPreview}):null,n.thought?S.jsx(G7,{thought:n.thought,streaming:a&&!n.text}):null,S.jsx(K7,{track:n}),n.text?S.jsx("div",{className:"track-output","data-streaming":a||void 0,children:S.jsxs("pre",{className:"track-text",children:[n.text,a?S.jsx("span",{className:"stream-caret","aria-hidden":"true"}):null]})}):a||n.status==="conn"||n.status==="queued"?S.jsxs("p",{className:"track-waiting",children:[S.jsx("span",{className:"stream-caret","aria-hidden":"true"})," awaiting output"]}):null,l?S.jsxs("p",{className:"track-notice",children:["Output partially retained — ",p.toLocaleString()," chars emitted in total."]}):null,n.error?S.jsx("p",{className:"track-error",children:n.error}):null]})});function W7({preview:e}){return S.jsxs("p",{className:"track-request",title:e,children:[S.jsx("span",{className:"track-request-mark","aria-hidden":"true",children:"▸"}),e]})}function G7({thought:e,streaming:n}){const[r,a]=H.useState(!1);return S.jsxs("div",{className:`thought-fold ${r?"is-open":""}`,children:[S.jsxs("button",{type:"button",className:"thought-toggle",onClick:()=>a(l=>!l),"aria-expanded":r,children:[S.jsx("span",{className:"thought-chevron","aria-hidden":"true",children:r?"▾":"▸"}),"reasoning",n?S.jsx("span",{className:"stream-caret stream-caret--dim","aria-hidden":"true"}):null]}),r?S.jsx("pre",{className:"thought-text",children:e}):null]})}function K7({track:e}){return e.tools.length===0?null:S.jsx("ul",{className:"tool-rail","aria-label":"Tool calls",children:e.tools.map(n=>S.jsxs("li",{className:`tool-chip tool-chip--${V7(n.status)}`,children:[S.jsx("span",{className:"tool-chip-glyph","aria-hidden":"true",children:"⚙"}),S.jsx("span",{className:"tool-chip-title",children:n.title}),n.status?S.jsx("span",{className:"tool-chip-status",children:n.status}):null]},n.key))})}function V7(e){const n=e.toLowerCase();return n.includes("error")||n.includes("fail")?"bad":n.includes("done")||n.includes("ok")||n.includes("complete")?"ok":n.includes("run")||n.includes("progress")||n.includes("stream")?"live":"idle"}function Y7({job:e,timelineOpen:n}){const{containerRef:r,pinned:a,jumpToLatest:l}=z7(e?.jobId??"none",e?.lastEventId??0);return e?S.jsxs("main",{className:"stage",children:[S.jsx(X7,{job:e}),S.jsxs("div",{className:"stage-stream",children:[S.jsx("div",{className:"stage-scroll",ref:r,tabIndex:-1,children:S.jsxs("div",{className:"stage-content",children:[e.trackOrder.length===0?S.jsxs("p",{className:"stage-waiting",children:[S.jsx("span",{className:"stream-caret","aria-hidden":"true"})," waiting for track registration"]}):e.trackOrder.map(p=>{const m=e.tracks[p];return m?S.jsx(q7,{track:m},`${e.jobId}:${p}`):null}),e.summary?S.jsx(Z7,{summary:e.summary,status:e.status,error:e.error}):null]})}),a?null:S.jsx("button",{type:"button",className:"follow-button",onClick:l,children:"↓ Follow stream"})]}),S.jsxs("section",{className:`timeline-dock ${n?"is-open":""}`,children:[S.jsxs("button",{type:"button",className:"timeline-toggle",onClick:ok,"aria-expanded":n,children:[S.jsx("span",{className:"timeline-chevron","aria-hidden":"true",children:n?"▾":"▴"}),"Event timeline",S.jsx("span",{className:"timeline-count",children:e.recentEvents.length})]}),n?S.jsx(H7,{events:e.recentEvents}):null]})]}):S.jsx("main",{className:"stage",children:S.jsxs("div",{className:"stage-idle",children:[S.jsx("p",{className:"stage-idle-mark","aria-hidden":"true",children:"▵"}),S.jsx("h2",{children:"Standing by"}),S.jsx("p",{children:"Select a job from the left rail, or dispatch carriers from a Fleet session."})]})})}const X7=H.memo(function({job:n}){const r=sh(n.status),a=n.startedAt?SA(n.startedAt,n.finishedAt??n.updatedAt):null;return S.jsxs("header",{className:"job-head",children:[S.jsxs("div",{className:"job-head-id",children:[S.jsx("span",{className:`status-dot status-dot--${r} status-dot--lg`,"aria-hidden":"true"}),S.jsxs("div",{children:[S.jsx("h2",{className:"job-title",children:n.label??Mp(n.jobId)}),S.jsxs("p",{className:"job-meta",children:[S.jsx("span",{className:`job-status job-status--${r}`,children:Dp(n.status)}),n.ownerCarrierId?S.jsxs("span",{children:["· ",n.ownerCarrierId]}):null,n.kind?S.jsxs("span",{children:["· ",n.kind]}):null,a?S.jsxs("span",{children:["· ",a]}):null,n.startedAt?S.jsxs("span",{children:["· started ",CS(n.startedAt)]}):null]})]})]}),S.jsx("code",{className:"job-id",title:n.jobId,children:Mp(n.jobId)})]})});function Z7({summary:e,status:n,error:r}){return S.jsxs("aside",{className:`job-summary job-summary--${sh(n)}`,children:[S.jsx("p",{className:"job-summary-eyebrow",children:n==="error"?"Finalized with error":"Finalized"}),S.jsx("p",{className:"job-summary-text",children:e}),r?S.jsx("p",{className:"job-summary-error",children:r}):null]})}function J7({state:e}){const n=pk(e);return H.useEffect(()=>{const r=a=>{a.key==="Escape"&&Nf()};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[]),n?S.jsxs("div",{className:"job-overlay",role:"dialog","aria-modal":"true","aria-label":"Carrier job stream",children:[S.jsx("button",{type:"button",className:"job-overlay-scrim",onClick:Nf,"aria-label":"Close job stream"}),S.jsxs("div",{className:"job-overlay-card",children:[S.jsx("button",{type:"button",className:"job-overlay-close",onClick:Nf,"aria-label":"Close job stream",children:"×"}),S.jsx(Y7,{job:n,timelineOpen:e.timelineOpen})]})]}):null}function Q7({state:e}){return S.jsx("div",{className:"floating-job-overlay","data-canvas-blocker":!0,children:S.jsx(J7,{state:e})})}function eB({state:e}){const n=H.useRef(null),r=H.useMemo(()=>Hu(e),[e.sessions,e.sessionOrder,e.activeTheaterId]),a=H.useRef(e);return a.current=e,H.useEffect(()=>{dT(e.activeTheaterId),jA(e.activeTheaterId)},[e.activeTheaterId]),H.useEffect(()=>{const l=p=>{if(!p.altKey||p.metaKey||p.ctrlKey||p.key!=="ArrowLeft"&&p.key!=="ArrowRight")return;const m=document.activeElement;if(m instanceof HTMLElement&&m.matches("input, textarea, [contenteditable='true']")&&!m.closest(".xterm"))return;const c=Hu(a.current);if(c.length===0)return;p.preventDefault(),p.stopImmediatePropagation();const u=tk(c,a.current.activeTerminalSessionId,p.key==="ArrowRight"?1:-1);u&&Ng(u)};return window.addEventListener("keydown",l,!0),()=>window.removeEventListener("keydown",l,!0)},[]),H.useEffect(()=>{for(const l of r)uT(l);e.terminalSessionsHydrated&&hT(r)},[r,e.terminalSessionsHydrated]),H.useEffect(()=>{const l=e.pendingOperationFocus;if(l===null)return;let p=!1;return(async()=>{let c=l;if(e.sessions[l]?.status==="dormant")try{const y=await _S(l);if(p)return;ah(y),Pi(y.sessionId),c=y.sessionId}catch(y){p||FS(y instanceof Error?y.message:String(y)),Ab();return}if(p)return;const h=tB(n.current);h&&fT(c,h),Ab()})(),()=>{p=!0}},[e.pendingOperationFocus]),S.jsxs("div",{className:"console-body is-canvas",ref:n,children:[S.jsx(D7,{state:e}),S.jsx(Q7,{state:e})]})}function tB(e){if(!e)return null;const n=e.getBoundingClientRect();return{width:n.width,height:n.height}}const nB=6e3;function iB(){const e=ql(),n=Li(),r=n.pathname,a=lo(),l=Qy(),p=PT(),m=UT(),c=lS(),u=r.startsWith("/codex"),h=H.useRef(n),y=H.useRef(!u),g=l&&r.startsWith("/operations"),C=u&&p!=="route"&&(y.current||m),T=C?p:"route",A=u&&T==="side",x=y.current?h.current:{pathname:"/operations",search:"",hash:"",state:null,key:"codex-fallback"},d=C?x:n,v=d.pathname.startsWith("/operations");H.useEffect(()=>ZR(),[]),H.useEffect(()=>{u||(h.current=n,y.current=!0)},[u,n]),H.useEffect(()=>{GA(v)},[v]),H.useEffect(()=>{const{body:E}=document;return A?(E.dataset.codexSide="true",E.style.setProperty("--codex-side-width",`${c}px`)):(delete E.dataset.codexSide,E.style.removeProperty("--codex-side-width")),()=>{delete E.dataset.codexSide,E.style.removeProperty("--codex-side-width")}},[A,c]),H.useEffect(()=>{const E=document.querySelector(".topbar");if(!E)return;const L=()=>{document.documentElement.style.setProperty("--console-topbar-offset",`${Math.round(E.getBoundingClientRect().bottom)}px`)};L();const R=new ResizeObserver(L);return R.observe(E),window.addEventListener("resize",L),()=>{R.disconnect(),window.removeEventListener("resize",L)}},[]),H.useEffect(()=>{const E=new AbortController;dS(E.signal).then(M=>{zS(M),Db()}).catch(M=>{E.signal.aborted||(ze({theaterError:M instanceof Error?M.message:String(M)}),Db())}),eA(E.signal).then(JA).catch(M=>{E.signal.aborted||ze({terminalSessionError:M instanceof Error?M.message:String(M)})}),BS(),fS({signal:E.signal}).then(IS).catch(M=>{E.signal.aborted||jS(M instanceof Error?M.message:String(M))});const L=()=>{YT(e.activeTheaterId,E.signal).then(ZA).catch(()=>{})};L();const R=window.setTimeout(L,nB);return()=>{window.clearTimeout(R),E.abort()}},[]),H.useEffect(()=>{const E=L=>{window.location.pathname.includes("/codex")||(L.metaKey||L.ctrlKey)&&L.key.toLowerCase()==="k"&&(L.preventDefault(),L.stopImmediatePropagation(),nk())};return window.addEventListener("keydown",E,!0),()=>window.removeEventListener("keydown",E,!0)},[]);const f=()=>{const E=h.current;y.current?a({pathname:E.pathname,search:E.search,hash:E.hash},{state:E.state}):a("/operations")},b=()=>{a("/codex"),HT("side")};return S.jsxs("div",{className:`console-shell ${g?"is-maximized":""}`,children:[S.jsx(_R,{state:e}),S.jsxs(m5,{location:d,children:[S.jsx(qs,{path:"/",element:S.jsx(tb,{to:"/operations",replace:!0})}),S.jsx(qs,{path:"/operations",element:S.jsx(eB,{state:e})}),S.jsx(qs,{path:"/carrier-settings",element:S.jsx(A3,{})}),S.jsx(qs,{path:"/settings",element:S.jsx(yO,{})}),S.jsx(qs,{path:"/codex/*",element:null}),S.jsx(qs,{path:"*",element:S.jsx(tb,{to:"/operations",replace:!0})})]}),u?S.jsx(kD,{state:e,mode:T,onClose:f}):null,u?null:S.jsx(rB,{onOpen:b}),S.jsx(rR,{state:e}),S.jsx(eR,{state:e}),S.jsx(HR,{state:e}),S.jsx(Pk,{state:e}),S.jsx(uR,{open:e.connectionError!==null,tone:"error",title:"Console link interrupted",message:e.connectionError??void 0}),S.jsx(Fk,{})]})}function rB({onOpen:e}){return S.jsxs("button",{type:"button",className:"codex-edge-handle",onClick:e,"aria-label":"Open Codex side panel",title:"Codex (Side)",children:[S.jsx("span",{className:"codex-edge-handle-chevron","aria-hidden":"true",children:S.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:S.jsx("path",{d:"M9.5 4 5.5 8l4 4"})})}),S.jsx("span",{className:"codex-edge-handle-label",children:"Codex"})]})}KA();const Ry=document.querySelector("#app");Ry&&vE.createRoot(Ry).render(S.jsx(H.StrictMode,{children:S.jsx(P5,{basename:"/console",children:S.jsx(iB,{})})}));export{C6 as _,sB as a,cE as g,St as k,Ml as p};