@dotobokuri/fleet-console 1.7.1 → 1.8.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.
- package/AGENTS.md +3 -2
- package/dist/cli-bin.mjs +3689 -3480
- package/dist/cli.d.ts +2 -0
- package/dist/cli.mjs +3689 -3480
- package/dist/client/assets/{_baseUniq-CEicxaGA.js → _baseUniq-BvJBBAyx.js} +1 -1
- package/dist/client/assets/{arc-CWwZK8jZ.js → arc-_In9IKSA.js} +1 -1
- package/dist/client/assets/{architectureDiagram-Q4EWVU46-DFoizZcx.js → architectureDiagram-Q4EWVU46-Ch4p9PP9.js} +1 -1
- package/dist/client/assets/{blockDiagram-DXYQGD6D-D79ULj8O.js → blockDiagram-DXYQGD6D-dV3nM6N6.js} +1 -1
- package/dist/client/assets/{c4Diagram-AHTNJAMY-BuQECLg_.js → c4Diagram-AHTNJAMY-Cd4rkDvb.js} +1 -1
- package/dist/client/assets/channel-F-hXrSqZ.js +1 -0
- package/dist/client/assets/{chunk-4BX2VUAB-CKrtpE9R.js → chunk-4BX2VUAB-BdFP7-t8.js} +1 -1
- package/dist/client/assets/{chunk-4TB4RGXK-b9qDffil.js → chunk-4TB4RGXK-CwZmzqqH.js} +1 -1
- package/dist/client/assets/{chunk-55IACEB6-mOQubskJ.js → chunk-55IACEB6-jonfKM4s.js} +1 -1
- package/dist/client/assets/{chunk-EDXVE4YY-Di_0HRJL.js → chunk-EDXVE4YY-Di2ByMxa.js} +1 -1
- package/dist/client/assets/{chunk-FMBD7UC4-B7i4RzXP.js → chunk-FMBD7UC4-DXLnCQWV.js} +1 -1
- package/dist/client/assets/{chunk-OYMX7WX6-BNWTeYIk.js → chunk-OYMX7WX6-DpgtrxyA.js} +1 -1
- package/dist/client/assets/{chunk-QZHKN3VN-L6OyqXrX.js → chunk-QZHKN3VN-BdkOO2d4.js} +1 -1
- package/dist/client/assets/{chunk-YZCP3GAM-BlJeD9wl.js → chunk-YZCP3GAM-Hfgm6DyM.js} +1 -1
- package/dist/client/assets/classDiagram-6PBFFD2Q-DqXQgyK4.js +1 -0
- package/dist/client/assets/classDiagram-v2-HSJHXN6E-DqXQgyK4.js +1 -0
- package/dist/client/assets/clone-kL599Cyi.js +1 -0
- package/dist/client/assets/{cose-bilkent-S5V4N54A-Mwp3SQ01.js → cose-bilkent-S5V4N54A-DqClnVsA.js} +1 -1
- package/dist/client/assets/{dagre-KV5264BT-DjEflIQ4.js → dagre-KV5264BT-DlVHx9hg.js} +1 -1
- package/dist/client/assets/{diagram-5BDNPKRD-s7OUgAtU.js → diagram-5BDNPKRD-DJVcbz8w.js} +1 -1
- package/dist/client/assets/{diagram-G4DWMVQ6-69UDh2S0.js → diagram-G4DWMVQ6-ZCER6PqU.js} +1 -1
- package/dist/client/assets/{diagram-MMDJMWI5-CSz3He9G.js → diagram-MMDJMWI5-DFt5a-B8.js} +1 -1
- package/dist/client/assets/{diagram-TYMM5635-BxcH7Y4_.js → diagram-TYMM5635-DXPsYs4b.js} +1 -1
- package/dist/client/assets/{erDiagram-SMLLAGMA-B5ueKIOd.js → erDiagram-SMLLAGMA-BEiMZzzV.js} +1 -1
- package/dist/client/assets/{flowDiagram-DWJPFMVM-CjvGe6Gd.js → flowDiagram-DWJPFMVM-DTBFF-X2.js} +1 -1
- package/dist/client/assets/{ganttDiagram-T4ZO3ILL-Dpbfyidy.js → ganttDiagram-T4ZO3ILL-nE9kklkz.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-UUTBAWPF-CtlfijiM.js → gitGraphDiagram-UUTBAWPF-VD6J4jc_.js} +1 -1
- package/dist/client/assets/{graph-DSPCKtzE.js → graph-CuZGH1eI.js} +1 -1
- package/dist/client/assets/index-ClU0e8Rv.js +734 -0
- package/dist/client/assets/index-VeebE_4d.css +1 -0
- package/dist/client/assets/{infoDiagram-42DDH7IO-xmMHYo6d.js → infoDiagram-42DDH7IO-BdxLeDgE.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-UXIWVN3A-DNTxZaTX.js → ishikawaDiagram-UXIWVN3A-OG_S8qjo.js} +1 -1
- package/dist/client/assets/{journeyDiagram-VCZTEJTY-CKi0c9Qq.js → journeyDiagram-VCZTEJTY-CvZPwJCs.js} +1 -1
- package/dist/client/assets/{kanban-definition-6JOO6SKY-Ci21zMm8.js → kanban-definition-6JOO6SKY-4hgVjEGs.js} +1 -1
- package/dist/client/assets/{layout-C2Me86rf.js → layout-BHDLAxp5.js} +1 -1
- package/dist/client/assets/{linear-ByUNb5CC.js → linear-WT8NWS1o.js} +1 -1
- package/dist/client/assets/{mermaid.core-BoWZkfpL.js → mermaid.core-UWKHwZrH.js} +4 -4
- package/dist/client/assets/{min-B8IRUA1j.js → min-CkGW0p-k.js} +1 -1
- package/dist/client/assets/{mindmap-definition-QFDTVHPH-3mewX-qM.js → mindmap-definition-QFDTVHPH-BxjJxQqR.js} +1 -1
- package/dist/client/assets/{pieDiagram-DEJITSTG-BlriRvJU.js → pieDiagram-DEJITSTG-BTjPSbyX.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-34T5L4WZ-CSUKPLtY.js → quadrantDiagram-34T5L4WZ-D2fCxzGw.js} +1 -1
- package/dist/client/assets/{requirementDiagram-MS252O5E-DFzn-e8C.js → requirementDiagram-MS252O5E-CtElLmk8.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-XADWPNL6-CwBXMPIr.js → sankeyDiagram-XADWPNL6-DGqMKAC2.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-FGHM5R23-CU1OfDeP.js → sequenceDiagram-FGHM5R23-B8Yva4cR.js} +1 -1
- package/dist/client/assets/{stateDiagram-FHFEXIEX-OXatcKBx.js → stateDiagram-FHFEXIEX-BxBGow-_.js} +1 -1
- package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-COhEt-rs.js +1 -0
- package/dist/client/assets/{timeline-definition-GMOUNBTQ-XRolMK2B.js → timeline-definition-GMOUNBTQ-CUcV7Qpm.js} +1 -1
- package/dist/client/assets/{vennDiagram-DHZGUBPP-BUS74Ldc.js → vennDiagram-DHZGUBPP-DS0hFmpX.js} +1 -1
- package/dist/client/assets/{wardley-RL74JXVD-ByVYsbPe.js → wardley-RL74JXVD-Dhd3kp0H.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-NUSXRM2D-C_toYeEZ.js → wardleyDiagram-NUSXRM2D-B6QDK0rE.js} +1 -1
- package/dist/client/assets/{xychartDiagram-5P7HB3ND-1BjG0WNn.js → xychartDiagram-5P7HB3ND-tiuCrAL_.js} +1 -1
- package/dist/client/index.html +2 -2
- package/package.json +1 -1
- package/dist/client/assets/channel-Cn_SBpql.js +0 -1
- package/dist/client/assets/classDiagram-6PBFFD2Q-Upd_UEcv.js +0 -1
- package/dist/client/assets/classDiagram-v2-HSJHXN6E-Upd_UEcv.js +0 -1
- package/dist/client/assets/clone-EvNJ1MeH.js +0 -1
- package/dist/client/assets/index-C_fsPgQB.css +0 -1
- package/dist/client/assets/index-Cktz8vZi.js +0 -734
- package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-DikGMI8K.js +0 -1
|
@@ -0,0 +1,734 @@
|
|
|
1
|
+
(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))a(o);new MutationObserver(o=>{for(const _ of o)if(_.type==="childList")for(const m of _.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&a(m)}).observe(document,{childList:!0,subtree:!0});function r(o){const _={};return o.integrity&&(_.integrity=o.integrity),o.referrerPolicy&&(_.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?_.credentials="include":o.crossOrigin==="anonymous"?_.credentials="omit":_.credentials="same-origin",_}function a(o){if(o.ep)return;o.ep=!0;const _=r(o);fetch(o.href,_)}})();function v2(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function k8(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var i=e.default;if(typeof i=="function"){var r=function a(){var o=!1;try{o=this instanceof a}catch{}return o?Reflect.construct(i,arguments,this.constructor):i.apply(this,arguments)};r.prototype=i.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(a){var o=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(r,a,o.get?o:{enumerable:!0,get:function(){return e[a]}})}),r}var wf={exports:{}},rl={};var B0;function b2(){if(B0)return rl;B0=1;var e=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function r(a,o,_){var m=null;if(_!==void 0&&(m=""+_),o.key!==void 0&&(m=""+o.key),"key"in o){_={};for(var c in o)c!=="key"&&(_[c]=o[c])}else _=o;return o=_.ref,{$$typeof:e,type:a,key:m,ref:o!==void 0?o:null,props:_}}return rl.Fragment=i,rl.jsx=r,rl.jsxs=r,rl}var I0;function y2(){return I0||(I0=1,wf.exports=b2()),wf.exports}var S=y2(),Cf={exports:{}},Ue={};var j0;function S2(){if(j0)return Ue;j0=1;var e=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),_=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"),b=Symbol.for("react.lazy"),f=Symbol.for("react.activity"),C=Symbol.iterator;function E(O){return O===null||typeof O!="object"?null:(O=C&&O[C]||O["@@iterator"],typeof O=="function"?O:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,p={};function y(O,H,Z){this.props=O,this.context=H,this.refs=p,this.updater=Z||A}y.prototype.isReactComponent={},y.prototype.setState=function(O,H){if(typeof O!="object"&&typeof O!="function"&&O!=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,O,H,"setState")},y.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function d(){}d.prototype=y.prototype;function v(O,H,Z){this.props=O,this.context=H,this.refs=p,this.updater=Z||A}var T=v.prototype=new d;T.constructor=v,x(T,y.prototype),T.isPureReactComponent=!0;var R=Array.isArray;function L(){}var M={H:null,A:null,T:null,S:null},k=Object.prototype.hasOwnProperty;function B(O,H,Z){var ae=Z.ref;return{$$typeof:e,type:O,key:H,ref:ae!==void 0?ae:null,props:Z}}function W(O,H){return B(O.type,H,O.props)}function F(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function q(O){var H={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(Z){return H[Z]})}var I=/\/+/g;function G(O,H){return typeof O=="object"&&O!==null&&O.key!=null?q(""+O.key):H.toString(36)}function te(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(L,L):(O.status="pending",O.then(function(H){O.status==="pending"&&(O.status="fulfilled",O.value=H)},function(H){O.status==="pending"&&(O.status="rejected",O.reason=H)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function P(O,H,Z,ae,ce){var _e=typeof O;(_e==="undefined"||_e==="boolean")&&(O=null);var Q=!1;if(O===null)Q=!0;else switch(_e){case"bigint":case"string":case"number":Q=!0;break;case"object":switch(O.$$typeof){case e:case i:Q=!0;break;case b:return Q=O._init,P(Q(O._payload),H,Z,ae,ce)}}if(Q)return ce=ce(O),Q=ae===""?"."+G(O,0):ae,R(ce)?(Z="",Q!=null&&(Z=Q.replace(I,"$&/")+"/"),P(ce,H,Z,"",function(ge){return ge})):ce!=null&&(F(ce)&&(ce=W(ce,Z+(ce.key==null||O&&O.key===ce.key?"":(""+ce.key).replace(I,"$&/")+"/")+Q)),H.push(ce)),1;Q=0;var $=ae===""?".":ae+":";if(R(O))for(var oe=0;oe<O.length;oe++)ae=O[oe],_e=$+G(ae,oe),Q+=P(ae,H,Z,_e,ce);else if(oe=E(O),typeof oe=="function")for(O=oe.call(O),oe=0;!(ae=O.next()).done;)ae=ae.value,_e=$+G(ae,oe++),Q+=P(ae,H,Z,_e,ce);else if(_e==="object"){if(typeof O.then=="function")return P(te(O),H,Z,ae,ce);throw H=String(O),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.")}return Q}function V(O,H,Z){if(O==null)return O;var ae=[],ce=0;return P(O,ae,"","",function(_e){return H.call(Z,_e,ce++)}),ae}function X(O){if(O._status===-1){var H=O._result;H=H(),H.then(function(Z){(O._status===0||O._status===-1)&&(O._status=1,O._result=Z)},function(Z){(O._status===0||O._status===-1)&&(O._status=2,O._result=Z)}),O._status===-1&&(O._status=0,O._result=H)}if(O._status===1)return O._result.default;throw O._result}var N=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var H=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(H))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},z={map:V,forEach:function(O,H,Z){V(O,function(){H.apply(this,arguments)},Z)},count:function(O){var H=0;return V(O,function(){H++}),H},toArray:function(O){return V(O,function(H){return H})||[]},only:function(O){if(!F(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return Ue.Activity=f,Ue.Children=z,Ue.Component=y,Ue.Fragment=r,Ue.Profiler=o,Ue.PureComponent=v,Ue.StrictMode=a,Ue.Suspense=u,Ue.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,Ue.__COMPILER_RUNTIME={__proto__:null,c:function(O){return M.H.useMemoCache(O)}},Ue.cache=function(O){return function(){return O.apply(null,arguments)}},Ue.cacheSignal=function(){return null},Ue.cloneElement=function(O,H,Z){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var ae=x({},O.props),ce=O.key;if(H!=null)for(_e in H.key!==void 0&&(ce=""+H.key),H)!k.call(H,_e)||_e==="key"||_e==="__self"||_e==="__source"||_e==="ref"&&H.ref===void 0||(ae[_e]=H[_e]);var _e=arguments.length-2;if(_e===1)ae.children=Z;else if(1<_e){for(var Q=Array(_e),$=0;$<_e;$++)Q[$]=arguments[$+2];ae.children=Q}return B(O.type,ce,ae)},Ue.createContext=function(O){return O={$$typeof:m,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:_,_context:O},O},Ue.createElement=function(O,H,Z){var ae,ce={},_e=null;if(H!=null)for(ae in H.key!==void 0&&(_e=""+H.key),H)k.call(H,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(ce[ae]=H[ae]);var Q=arguments.length-2;if(Q===1)ce.children=Z;else if(1<Q){for(var $=Array(Q),oe=0;oe<Q;oe++)$[oe]=arguments[oe+2];ce.children=$}if(O&&O.defaultProps)for(ae in Q=O.defaultProps,Q)ce[ae]===void 0&&(ce[ae]=Q[ae]);return B(O,_e,ce)},Ue.createRef=function(){return{current:null}},Ue.forwardRef=function(O){return{$$typeof:c,render:O}},Ue.isValidElement=F,Ue.lazy=function(O){return{$$typeof:b,_payload:{_status:-1,_result:O},_init:X}},Ue.memo=function(O,H){return{$$typeof:h,type:O,compare:H===void 0?null:H}},Ue.startTransition=function(O){var H=M.T,Z={};M.T=Z;try{var ae=O(),ce=M.S;ce!==null&&ce(Z,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(L,N)}catch(_e){N(_e)}finally{H!==null&&Z.types!==null&&(H.types=Z.types),M.T=H}},Ue.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},Ue.use=function(O){return M.H.use(O)},Ue.useActionState=function(O,H,Z){return M.H.useActionState(O,H,Z)},Ue.useCallback=function(O,H){return M.H.useCallback(O,H)},Ue.useContext=function(O){return M.H.useContext(O)},Ue.useDebugValue=function(){},Ue.useDeferredValue=function(O,H){return M.H.useDeferredValue(O,H)},Ue.useEffect=function(O,H){return M.H.useEffect(O,H)},Ue.useEffectEvent=function(O){return M.H.useEffectEvent(O)},Ue.useId=function(){return M.H.useId()},Ue.useImperativeHandle=function(O,H,Z){return M.H.useImperativeHandle(O,H,Z)},Ue.useInsertionEffect=function(O,H){return M.H.useInsertionEffect(O,H)},Ue.useLayoutEffect=function(O,H){return M.H.useLayoutEffect(O,H)},Ue.useMemo=function(O,H){return M.H.useMemo(O,H)},Ue.useOptimistic=function(O,H){return M.H.useOptimistic(O,H)},Ue.useReducer=function(O,H,Z){return M.H.useReducer(O,H,Z)},Ue.useRef=function(O){return M.H.useRef(O)},Ue.useState=function(O){return M.H.useState(O)},Ue.useSyncExternalStore=function(O,H,Z){return M.H.useSyncExternalStore(O,H,Z)},Ue.useTransition=function(){return M.H.useTransition()},Ue.version="19.2.7",Ue}var z0;function dg(){return z0||(z0=1,Cf.exports=S2()),Cf.exports}var U=dg(),xf={exports:{}},sl={},Ef={exports:{}},Tf={};var $0;function w2(){return $0||($0=1,(function(e){function i(P,V){var X=P.length;P.push(V);e:for(;0<X;){var N=X-1>>>1,z=P[N];if(0<o(z,V))P[N]=V,P[X]=z,X=N;else break e}}function r(P){return P.length===0?null:P[0]}function a(P){if(P.length===0)return null;var V=P[0],X=P.pop();if(X!==V){P[0]=X;e:for(var N=0,z=P.length,O=z>>>1;N<O;){var H=2*(N+1)-1,Z=P[H],ae=H+1,ce=P[ae];if(0>o(Z,X))ae<z&&0>o(ce,Z)?(P[N]=ce,P[ae]=X,N=ae):(P[N]=Z,P[H]=X,N=H);else if(ae<z&&0>o(ce,X))P[N]=ce,P[ae]=X,N=ae;else break e}}return V}function o(P,V){var X=P.sortIndex-V.sortIndex;return X!==0?X:P.id-V.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var _=performance;e.unstable_now=function(){return _.now()}}else{var m=Date,c=m.now();e.unstable_now=function(){return m.now()-c}}var u=[],h=[],b=1,f=null,C=3,E=!1,A=!1,x=!1,p=!1,y=typeof setTimeout=="function"?setTimeout:null,d=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;function T(P){for(var V=r(h);V!==null;){if(V.callback===null)a(h);else if(V.startTime<=P)a(h),V.sortIndex=V.expirationTime,i(u,V);else break;V=r(h)}}function R(P){if(x=!1,T(P),!A)if(r(u)!==null)A=!0,L||(L=!0,q());else{var V=r(h);V!==null&&te(R,V.startTime-P)}}var L=!1,M=-1,k=5,B=-1;function W(){return p?!0:!(e.unstable_now()-B<k)}function F(){if(p=!1,L){var P=e.unstable_now();B=P;var V=!0;try{e:{A=!1,x&&(x=!1,d(M),M=-1),E=!0;var X=C;try{t:{for(T(P),f=r(u);f!==null&&!(f.expirationTime>P&&W());){var N=f.callback;if(typeof N=="function"){f.callback=null,C=f.priorityLevel;var z=N(f.expirationTime<=P);if(P=e.unstable_now(),typeof z=="function"){f.callback=z,T(P),V=!0;break t}f===r(u)&&a(u),T(P)}else a(u);f=r(u)}if(f!==null)V=!0;else{var O=r(h);O!==null&&te(R,O.startTime-P),V=!1}}break e}finally{f=null,C=X,E=!1}V=void 0}}finally{V?q():L=!1}}}var q;if(typeof v=="function")q=function(){v(F)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,G=I.port2;I.port1.onmessage=F,q=function(){G.postMessage(null)}}else q=function(){y(F,0)};function te(P,V){M=y(function(){P(e.unstable_now())},V)}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(P){P.callback=null},e.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return C},e.unstable_next=function(P){switch(C){case 1:case 2:case 3:var V=3;break;default:V=C}var X=C;C=V;try{return P()}finally{C=X}},e.unstable_requestPaint=function(){p=!0},e.unstable_runWithPriority=function(P,V){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var X=C;C=P;try{return V()}finally{C=X}},e.unstable_scheduleCallback=function(P,V,X){var N=e.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?N+X:N):X=N,P){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=X+z,P={id:b++,callback:V,priorityLevel:P,startTime:X,expirationTime:z,sortIndex:-1},X>N?(P.sortIndex=X,i(h,P),r(u)===null&&P===r(h)&&(x?(d(M),M=-1):x=!0,te(R,X-N))):(P.sortIndex=z,i(u,P),A||E||(A=!0,L||(L=!0,q()))),P},e.unstable_shouldYield=W,e.unstable_wrapCallback=function(P){var V=C;return function(){var X=C;C=V;try{return P.apply(this,arguments)}finally{C=X}}}})(Tf)),Tf}var H0;function C2(){return H0||(H0=1,Ef.exports=w2()),Ef.exports}var Af={exports:{}},Mi={};var P0;function x2(){if(P0)return Mi;P0=1;var e=dg();function i(u){var h="https://react.dev/errors/"+u;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)h+="&args[]="+encodeURIComponent(arguments[b])}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(i(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for("react.portal");function _(u,h,b){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:f==null?null:""+f,children:u,containerInfo:h,implementation:b}}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 Mi.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Mi.createPortal=function(u,h){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(i(299));return _(u,h,null,b)},Mi.flushSync=function(u){var h=m.T,b=a.p;try{if(m.T=null,a.p=2,u)return u()}finally{m.T=h,a.p=b,a.d.f()}},Mi.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))},Mi.prefetchDNS=function(u){typeof u=="string"&&a.d.D(u)},Mi.preinit=function(u,h){if(typeof u=="string"&&h&&typeof h.as=="string"){var b=h.as,f=c(b,h.crossOrigin),C=typeof h.integrity=="string"?h.integrity:void 0,E=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;b==="style"?a.d.S(u,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:f,integrity:C,fetchPriority:E}):b==="script"&&a.d.X(u,{crossOrigin:f,integrity:C,fetchPriority:E,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Mi.preinitModule=function(u,h){if(typeof u=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var b=c(h.as,h.crossOrigin);a.d.M(u,{crossOrigin:b,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)},Mi.preload=function(u,h){if(typeof u=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var b=h.as,f=c(b,h.crossOrigin);a.d.L(u,b,{crossOrigin:f,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})}},Mi.preloadModule=function(u,h){if(typeof u=="string")if(h){var b=c(h.as,h.crossOrigin);a.d.m(u,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:b,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else a.d.m(u)},Mi.requestFormReset=function(u){a.d.r(u)},Mi.unstable_batchedUpdates=function(u,h){return u(h)},Mi.useFormState=function(u,h,b){return m.H.useFormState(u,h,b)},Mi.useFormStatus=function(){return m.H.useHostTransitionStatus()},Mi.version="19.2.7",Mi}var U0;function dy(){if(U0)return Af.exports;U0=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(i){console.error(i)}}return e(),Af.exports=x2(),Af.exports}var F0;function E2(){if(F0)return sl;F0=1;var e=C2(),i=dg(),r=dy();function a(t){var n="https://react.dev/errors/"+t;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)n+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function _(t){var n=t,s=t;if(t.alternate)for(;n.return;)n=n.return;else{t=n;do n=t,(n.flags&4098)!==0&&(s=n.return),t=n.return;while(t)}return n.tag===3?s:null}function m(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function c(t){if(t.tag===31){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function u(t){if(_(t)!==t)throw Error(a(188))}function h(t){var n=t.alternate;if(!n){if(n=_(t),n===null)throw Error(a(188));return n!==t?null:t}for(var s=t,l=n;;){var g=s.return;if(g===null)break;var w=g.alternate;if(w===null){if(l=g.return,l!==null){s=l;continue}break}if(g.child===w.child){for(w=g.child;w;){if(w===s)return u(g),t;if(w===l)return u(g),n;w=w.sibling}throw Error(a(188))}if(s.return!==l.return)s=g,l=w;else{for(var D=!1,j=g.child;j;){if(j===s){D=!0,s=g,l=w;break}if(j===l){D=!0,l=g,s=w;break}j=j.sibling}if(!D){for(j=w.child;j;){if(j===s){D=!0,s=w,l=g;break}if(j===l){D=!0,l=w,s=g;break}j=j.sibling}if(!D)throw Error(a(189))}}if(s.alternate!==l)throw Error(a(190))}if(s.tag!==3)throw Error(a(188));return s.stateNode.current===s?t:n}function b(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t;for(t=t.child;t!==null;){if(n=b(t),n!==null)return n;t=t.sibling}return null}var f=Object.assign,C=Symbol.for("react.element"),E=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),v=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),W=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function q(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 G(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 y:return"Profiler";case p:return"StrictMode";case R:return"Suspense";case L:return"SuspenseList";case B:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case A:return"Portal";case v:return t.displayName||"Context";case d:return(t._context.displayName||"Context")+".Consumer";case T:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case M:return n=t.displayName||null,n!==null?n:G(t.type)||"Memo";case k:n=t._payload,t=t._init;try{return G(t(n))}catch{}}return null}var te=Array.isArray,P=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X={pending:!1,data:null,method:null,action:null},N=[],z=-1;function O(t){return{current:t}}function H(t){0>z||(t.current=N[z],N[z]=null,z--)}function Z(t,n){z++,N[z]=t.current,t.current=n}var ae=O(null),ce=O(null),_e=O(null),Q=O(null);function $(t,n){switch(Z(_e,n),Z(ce,t),Z(ae,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?r0(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=r0(n),t=s0(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}H(ae),Z(ae,t)}function oe(){H(ae),H(ce),H(_e)}function ge(t){t.memoizedState!==null&&Z(Q,t);var n=ae.current,s=s0(n,t.type);n!==s&&(Z(ce,t),Z(ae,s))}function Se(t){ce.current===t&&(H(ae),H(ce)),Q.current===t&&(H(Q),el._currentValue=X)}var ye,$e;function Fe(t){if(ye===void 0)try{throw Error()}catch(s){var n=s.stack.trim().match(/\n( *(at )?)/);ye=n&&n[1]||"",$e=-1<s.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+ye+t+$e}var Ve=!1;function Ct(t,n){if(!t||Ve)return"";Ve=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(n){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]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var g=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");g&&g.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=l.DetermineComponentFrameRoot(),D=w[0],j=w[1];if(D&&j){var Y=D.split(`
|
|
4
|
+
`),re=j.split(`
|
|
5
|
+
`);for(g=l=0;l<Y.length&&!Y[l].includes("DetermineComponentFrameRoot");)l++;for(;g<re.length&&!re[g].includes("DetermineComponentFrameRoot");)g++;if(l===Y.length||g===re.length)for(l=Y.length-1,g=re.length-1;1<=l&&0<=g&&Y[l]!==re[g];)g--;for(;1<=l&&0<=g;l--,g--)if(Y[l]!==re[g]){if(l!==1||g!==1)do if(l--,g--,0>g||Y[l]!==re[g]){var ue=`
|
|
6
|
+
`+Y[l].replace(" at new "," at ");return t.displayName&&ue.includes("<anonymous>")&&(ue=ue.replace("<anonymous>",t.displayName)),ue}while(1<=l&&0<=g);break}}}finally{Ve=!1,Error.prepareStackTrace=s}return(s=t?t.displayName||t.name:"")?Fe(s):""}function Ne(t,n){switch(t.tag){case 26:case 27:case 5:return Fe(t.type);case 16:return Fe("Lazy");case 13:return t.child!==n&&n!==null?Fe("Suspense Fallback"):Fe("Suspense");case 19:return Fe("SuspenseList");case 0:case 15:return Ct(t.type,!1);case 11:return Ct(t.type.render,!1);case 1:return Ct(t.type,!0);case 31:return Fe("Activity");default:return""}}function Qt(t){try{var n="",s=null;do n+=Ne(t,s),s=t,t=t.return;while(t);return n}catch(l){return`
|
|
7
|
+
Error generating stack: `+l.message+`
|
|
8
|
+
`+l.stack}}var _i=Object.prototype.hasOwnProperty,vi=e.unstable_scheduleCallback,fn=e.unstable_cancelCallback,Mn=e.unstable_shouldYield,ei=e.unstable_requestPaint,ut=e.unstable_now,Kt=e.unstable_getCurrentPriorityLevel,jt=e.unstable_ImmediatePriority,zt=e.unstable_UserBlockingPriority,ti=e.unstable_NormalPriority,Dn=e.unstable_LowPriority,Ri=e.unstable_IdlePriority,en=e.log,dt=e.unstable_setDisableYieldValue,Hi=null,Vt=null;function Yt(t){if(typeof en=="function"&&dt(t),Vt&&typeof Vt.setStrictMode=="function")try{Vt.setStrictMode(Hi,t)}catch{}}var $t=Math.clz32?Math.clz32:aa,Ss=Math.log,ar=Math.LN2;function aa(t){return t>>>=0,t===0?32:31-(Ss(t)/ar|0)|0}var On=256,Wn=262144,or=4194304;function ii(t){var n=t&42;if(n!==0)return n;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,n,s){var l=t.pendingLanes;if(l===0)return 0;var g=0,w=t.suspendedLanes,D=t.pingedLanes;t=t.warmLanes;var j=l&134217727;return j!==0?(l=j&~w,l!==0?g=ii(l):(D&=j,D!==0?g=ii(D):s||(s=j&~t,s!==0&&(g=ii(s))))):(j=l&~w,j!==0?g=ii(j):D!==0?g=ii(D):s||(s=l&~t,s!==0&&(g=ii(s)))),g===0?0:n!==0&&n!==g&&(n&w)===0&&(w=g&-g,s=n&-n,w>=s||w===32&&(s&4194048)!==0)?n:g}function he(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function ve(t,n){switch(t){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 St(t){for(var n=[],s=0;31>s;s++)n.push(t);return n}function ft(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Ee(t,n,s,l,g,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,Y=t.expirationTimes,re=t.hiddenUpdates;for(s=D&~s;0<s;){var ue=31-$t(s),fe=1<<ue;j[ue]=0,Y[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}l!==0&&Ce(t,l,0),w!==0&&g===0&&t.tag!==0&&(t.suspendedLanes|=w&~(D&~n))}function Ce(t,n,s){t.pendingLanes|=n,t.suspendedLanes&=~n;var l=31-$t(n);t.entangledLanes|=n,t.entanglements[l]=t.entanglements[l]|1073741824|s&261930}function je(t,n){var s=t.entangledLanes|=n;for(t=t.entanglements;s;){var l=31-$t(s),g=1<<l;g&n|t[l]&n&&(t[l]|=n),s&=~g}}function Bt(t,n){var s=n&-n;return s=(s&42)!==0?1:Qe(s),(s&(t.suspendedLanes|n))!==0?0:s}function Qe(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 bi(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function lr(){var t=V.p;return t!==0?t:(t=window.event,t===void 0?32:k0(t.type))}function cr(t,n){var s=V.p;try{return V.p=t,n()}finally{V.p=s}}var Pi=Math.random().toString(36).slice(2),Tt="__reactFiber$"+Pi,xt="__reactProps$"+Pi,Nn="__reactContainer$"+Pi,jr="__reactEvents$"+Pi,oa="__reactListeners$"+Pi,ur="__reactHandles$"+Pi,ws="__reactResources$"+Pi,Gn="__reactMarker$"+Pi;function De(t){delete t[Tt],delete t[xt],delete t[jr],delete t[oa],delete t[ur]}function K(t){var n=t[Tt];if(n)return n;for(var s=t.parentNode;s;){if(n=s[Nn]||s[Tt]){if(s=n.alternate,n.child!==null||s!==null&&s.child!==null)for(t=d0(t);t!==null;){if(s=t[Tt])return s;t=d0(t)}return n}t=s,s=t.parentNode}return null}function pe(t){if(t=t[Tt]||t[Nn]){var n=t.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return t}return null}function xe(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t.stateNode;throw Error(a(33))}function nt(t){var n=t[ws];return n||(n=t[ws]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Ye(t){t[Gn]=!0}var At=new Set,Ht={};function Pt(t,n){me(t,n),me(t+"Capture",n)}function me(t,n){for(Ht[t]=n,t=0;t<n.length;t++)At.add(n[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={},st={};function Dt(t){return _i.call(st,t)?!0:_i.call(Oe,t)?!1:Me.test(t)?st[t]=!0:(Oe[t]=!0,!1)}function Li(t,n,s){if(Dt(n))if(s===null)t.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":t.removeAttribute(n);return;case"boolean":var l=n.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){t.removeAttribute(n);return}}t.setAttribute(n,""+s)}}function tn(t,n,s){if(s===null)t.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttribute(n,""+s)}}function Ui(t,n,s,l){if(l===null)t.removeAttribute(s);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(s);return}t.setAttributeNS(n,s,""+l)}}function Et(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function nn(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Gl(t,n,s){var l=Object.getOwnPropertyDescriptor(t.constructor.prototype,n);if(!t.hasOwnProperty(n)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var g=l.get,w=l.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return g.call(this)},set:function(D){s=""+D,w.call(this,D)}}),Object.defineProperty(t,n,{enumerable:l.enumerable}),{getValue:function(){return s},setValue:function(D){s=""+D},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function la(t){if(!t._valueTracker){var n=nn(t)?"checked":"value";t._valueTracker=Gl(t,n,""+t[n])}}function fo(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var s=n.getValue(),l="";return t&&(l=nn(t)?t.checked?"true":"false":t.value),t=l,t!==s?(n.setValue(t),!0):!1}function ca(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 yh=/[\n"\\]/g;function Fi(t){return t.replace(yh,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function po(t,n,s,l,g,w,D,j){t.name="",D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?t.type=D:t.removeAttribute("type"),n!=null?D==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+Et(n)):t.value!==""+Et(n)&&(t.value=""+Et(n)):D!=="submit"&&D!=="reset"||t.removeAttribute("value"),n!=null?ua(t,D,Et(n)):s!=null?ua(t,D,Et(s)):l!=null&&t.removeAttribute("value"),g==null&&w!=null&&(t.defaultChecked=!!w),g!=null&&(t.checked=g&&typeof g!="function"&&typeof g!="symbol"),j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?t.name=""+Et(j):t.removeAttribute("name")}function Cs(t,n,s,l,g,w,D,j){if(w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(t.type=w),n!=null||s!=null){if(!(w!=="submit"&&w!=="reset"||n!=null)){la(t);return}s=s!=null?""+Et(s):"",n=n!=null?""+Et(n):s,j||n===t.value||(t.value=n),t.defaultValue=n}l=l??g,l=typeof l!="function"&&typeof l!="symbol"&&!!l,t.checked=j?t.checked:!!l,t.defaultChecked=!!l,D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"&&(t.name=D),la(t)}function ua(t,n,s){n==="number"&&ca(t.ownerDocument)===t||t.defaultValue===""+s||(t.defaultValue=""+s)}function yi(t,n,s,l){if(t=t.options,n){n={};for(var g=0;g<s.length;g++)n["$"+s[g]]=!0;for(s=0;s<t.length;s++)g=n.hasOwnProperty("$"+t[s].value),t[s].selected!==g&&(t[s].selected=g),g&&l&&(t[s].defaultSelected=!0)}else{for(s=""+Et(s),n=null,g=0;g<t.length;g++){if(t[g].value===s){t[g].selected=!0,l&&(t[g].defaultSelected=!0);return}n!==null||t[g].disabled||(n=t[g])}n!==null&&(n.selected=!0)}}function Kl(t,n,s){if(n!=null&&(n=""+Et(n),n!==t.value&&(t.value=n),s==null)){t.defaultValue!==n&&(t.defaultValue=n);return}t.defaultValue=s!=null?""+Et(s):""}function ha(t,n,s,l){if(n==null){if(l!=null){if(s!=null)throw Error(a(92));if(te(l)){if(1<l.length)throw Error(a(93));l=l[0]}s=l}s==null&&(s=""),n=s}s=Et(n),t.defaultValue=s,l=t.textContent,l===s&&l!==""&&l!==null&&(t.value=l),la(t)}function He(t,n){if(n){var s=t.firstChild;if(s&&s===t.lastChild&&s.nodeType===3){s.nodeValue=n;return}}t.textContent=n}var Vl=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 ni(t,n,s){var l=n.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?l?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="":l?t.setProperty(n,s):typeof s!="number"||s===0||Vl.has(n)?n==="float"?t.cssFloat=s:t[n]=(""+s).trim():t[n]=s+"px"}function pt(t,n,s){if(n!=null&&typeof n!="object")throw Error(a(62));if(t=t.style,s!=null){for(var l in s)!s.hasOwnProperty(l)||n!=null&&n.hasOwnProperty(l)||(l.indexOf("--")===0?t.setProperty(l,""):l==="float"?t.cssFloat="":t[l]="");for(var g in n)l=n[g],n.hasOwnProperty(g)&&s[g]!==l&&ni(t,g,l)}else for(var w in n)n.hasOwnProperty(w)&&ni(t,w,n[w])}function zr(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"]]),go=/^[\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 $r(t){return go.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function we(){}var Re=null;function qe(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var et=null,It=null;function pn(t){var n=pe(t);if(n&&(t=n.stateNode)){var s=t[xt]||null;e:switch(t=n.stateNode,n.type){case"input":if(po(t,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),n=s.name,s.type==="radio"&&n!=null){for(s=t;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+Fi(""+n)+'"][type="radio"]'),n=0;n<s.length;n++){var l=s[n];if(l!==t&&l.form===t.form){var g=l[xt]||null;if(!g)throw Error(a(90));po(l,g.value,g.defaultValue,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name)}}for(n=0;n<s.length;n++)l=s[n],l.form===t.form&&fo(l)}break e;case"textarea":Kl(t,s.value,s.defaultValue);break e;case"select":n=s.value,n!=null&&yi(t,!!s.multiple,n,!1)}}}var mo=!1;function Yl(t,n,s){if(mo)return t(n,s);mo=!0;try{var l=t(n);return l}finally{if(mo=!1,(et!==null||It!==null)&&(Ic(),et&&(n=et,t=It,It=et=null,pn(n),t)))for(n=0;n<t.length;n++)pn(t[n])}}function _o(t,n){var s=t.stateNode;if(s===null)return null;var l=s[xt]||null;if(l===null)return null;s=l[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(t=t.type,l=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!l;break e;default:t=!1}if(t)return null;if(s&&typeof s!="function")throw Error(a(231,n,typeof s));return s}var dr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Sh=!1;if(dr)try{var vo={};Object.defineProperty(vo,"passive",{get:function(){Sh=!0}}),window.addEventListener("test",vo,vo),window.removeEventListener("test",vo,vo)}catch{Sh=!1}var Hr=null,wh=null,Xl=null;function sm(){if(Xl)return Xl;var t,n=wh,s=n.length,l,g="value"in Hr?Hr.value:Hr.textContent,w=g.length;for(t=0;t<s&&n[t]===g[t];t++);var D=s-t;for(l=1;l<=D&&n[s-l]===g[w-l];l++);return Xl=g.slice(t,1<l?1-l:void 0)}function Zl(t){var n=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&n===13&&(t=13)):t=n,t===10&&(t=13),32<=t||t===13?t:0}function Jl(){return!0}function am(){return!1}function qi(t){function n(s,l,g,w,D){this._reactName=s,this._targetInst=g,this.type=l,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)?Jl:am,this.isPropagationStopped=am,this}return f(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Jl)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Jl)},persist:function(){},isPersistent:Jl}),n}var xs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ql=qi(xs),bo=f({},xs,{view:0,detail:0}),mC=qi(bo),Ch,xh,yo,ec=f({},bo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Th,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!==yo&&(yo&&t.type==="mousemove"?(Ch=t.screenX-yo.screenX,xh=t.screenY-yo.screenY):xh=Ch=0,yo=t),Ch)},movementY:function(t){return"movementY"in t?t.movementY:xh}}),om=qi(ec),_C=f({},ec,{dataTransfer:0}),vC=qi(_C),bC=f({},bo,{relatedTarget:0}),Eh=qi(bC),yC=f({},xs,{animationName:0,elapsedTime:0,pseudoElement:0}),SC=qi(yC),wC=f({},xs,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),CC=qi(wC),xC=f({},xs,{data:0}),lm=qi(xC),EC={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},TC={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"},AC={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function kC(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=AC[t])?!!n[t]:!1}function Th(){return kC}var RC=f({},bo,{key:function(t){if(t.key){var n=EC[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=Zl(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?TC[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Th,charCode:function(t){return t.type==="keypress"?Zl(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Zl(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),LC=qi(RC),MC=f({},ec,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),cm=qi(MC),DC=f({},bo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Th}),OC=qi(DC),NC=f({},xs,{propertyName:0,elapsedTime:0,pseudoElement:0}),BC=qi(NC),IC=f({},ec,{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}),jC=qi(IC),zC=f({},xs,{newState:0,oldState:0}),$C=qi(zC),HC=[9,13,27,32],Ah=dr&&"CompositionEvent"in window,So=null;dr&&"documentMode"in document&&(So=document.documentMode);var PC=dr&&"TextEvent"in window&&!So,um=dr&&(!Ah||So&&8<So&&11>=So),hm=" ",dm=!1;function fm(t,n){switch(t){case"keyup":return HC.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function pm(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var da=!1;function UC(t,n){switch(t){case"compositionend":return pm(n);case"keypress":return n.which!==32?null:(dm=!0,hm);case"textInput":return t=n.data,t===hm&&dm?null:t;default:return null}}function FC(t,n){if(da)return t==="compositionend"||!Ah&&fm(t,n)?(t=sm(),Xl=wh=Hr=null,da=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return um&&n.locale!=="ko"?null:n.data;default:return null}}var qC={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 gm(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!qC[t.type]:n==="textarea"}function mm(t,n,s,l){et?It?It.push(l):It=[l]:et=l,n=Fc(n,"onChange"),0<n.length&&(s=new Ql("onChange","change",null,s,l),t.push({event:s,listeners:n}))}var wo=null,Co=null;function WC(t){Jv(t,0)}function tc(t){var n=xe(t);if(fo(n))return t}function _m(t,n){if(t==="change")return n}var vm=!1;if(dr){var kh;if(dr){var Rh="oninput"in document;if(!Rh){var bm=document.createElement("div");bm.setAttribute("oninput","return;"),Rh=typeof bm.oninput=="function"}kh=Rh}else kh=!1;vm=kh&&(!document.documentMode||9<document.documentMode)}function ym(){wo&&(wo.detachEvent("onpropertychange",Sm),Co=wo=null)}function Sm(t){if(t.propertyName==="value"&&tc(Co)){var n=[];mm(n,Co,t,qe(t)),Yl(WC,n)}}function GC(t,n,s){t==="focusin"?(ym(),wo=n,Co=s,wo.attachEvent("onpropertychange",Sm)):t==="focusout"&&ym()}function KC(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return tc(Co)}function VC(t,n){if(t==="click")return tc(n)}function YC(t,n){if(t==="input"||t==="change")return tc(n)}function XC(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var rn=typeof Object.is=="function"?Object.is:XC;function xo(t,n){if(rn(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var s=Object.keys(t),l=Object.keys(n);if(s.length!==l.length)return!1;for(l=0;l<s.length;l++){var g=s[l];if(!_i.call(n,g)||!rn(t[g],n[g]))return!1}return!0}function wm(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Cm(t,n){var s=wm(t);t=0;for(var l;s;){if(s.nodeType===3){if(l=t+s.textContent.length,t<=n&&l>=n)return{node:s,offset:n-t};t=l}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=wm(s)}}function xm(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?xm(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function Em(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=ca(t.document);n instanceof t.HTMLIFrameElement;){try{var s=typeof n.contentWindow.location.href=="string"}catch{s=!1}if(s)t=n.contentWindow;else break;n=ca(t.document)}return n}function Lh(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}var ZC=dr&&"documentMode"in document&&11>=document.documentMode,fa=null,Mh=null,Eo=null,Dh=!1;function Tm(t,n,s){var l=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Dh||fa==null||fa!==ca(l)||(l=fa,"selectionStart"in l&&Lh(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Eo&&xo(Eo,l)||(Eo=l,l=Fc(Mh,"onSelect"),0<l.length&&(n=new Ql("onSelect","select",null,n,s),t.push({event:n,listeners:l}),n.target=fa)))}function Es(t,n){var s={};return s[t.toLowerCase()]=n.toLowerCase(),s["Webkit"+t]="webkit"+n,s["Moz"+t]="moz"+n,s}var pa={animationend:Es("Animation","AnimationEnd"),animationiteration:Es("Animation","AnimationIteration"),animationstart:Es("Animation","AnimationStart"),transitionrun:Es("Transition","TransitionRun"),transitionstart:Es("Transition","TransitionStart"),transitioncancel:Es("Transition","TransitionCancel"),transitionend:Es("Transition","TransitionEnd")},Oh={},Am={};dr&&(Am=document.createElement("div").style,"AnimationEvent"in window||(delete pa.animationend.animation,delete pa.animationiteration.animation,delete pa.animationstart.animation),"TransitionEvent"in window||delete pa.transitionend.transition);function Ts(t){if(Oh[t])return Oh[t];if(!pa[t])return t;var n=pa[t],s;for(s in n)if(n.hasOwnProperty(s)&&s in Am)return Oh[t]=n[s];return t}var km=Ts("animationend"),Rm=Ts("animationiteration"),Lm=Ts("animationstart"),JC=Ts("transitionrun"),QC=Ts("transitionstart"),ex=Ts("transitioncancel"),Mm=Ts("transitionend"),Dm=new Map,Nh="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(" ");Nh.push("scrollEnd");function Bn(t,n){Dm.set(t,n),Pt(n,[t])}var ic=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=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(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},gn=[],ga=0,Bh=0;function nc(){for(var t=ga,n=Bh=ga=0;n<t;){var s=gn[n];gn[n++]=null;var l=gn[n];gn[n++]=null;var g=gn[n];gn[n++]=null;var w=gn[n];if(gn[n++]=null,l!==null&&g!==null){var D=l.pending;D===null?g.next=g:(g.next=D.next,D.next=g),l.pending=g}w!==0&&Om(s,g,w)}}function rc(t,n,s,l){gn[ga++]=t,gn[ga++]=n,gn[ga++]=s,gn[ga++]=l,Bh|=l,t.lanes|=l,t=t.alternate,t!==null&&(t.lanes|=l)}function Ih(t,n,s,l){return rc(t,n,s,l),sc(t)}function As(t,n){return rc(t,null,null,n),sc(t)}function Om(t,n,s){t.lanes|=s;var l=t.alternate;l!==null&&(l.lanes|=s);for(var g=!1,w=t.return;w!==null;)w.childLanes|=s,l=w.alternate,l!==null&&(l.childLanes|=s),w.tag===22&&(t=w.stateNode,t===null||t._visibility&1||(g=!0)),t=w,w=w.return;return t.tag===3?(w=t.stateNode,g&&n!==null&&(g=31-$t(s),t=w.hiddenUpdates,l=t[g],l===null?t[g]=[n]:l.push(n),n.lane=s|536870912),w):null}function sc(t){if(50<Ko)throw Ko=0,Wd=null,Error(a(185));for(var n=t.return;n!==null;)t=n,n=t.return;return t.tag===3?t.stateNode:null}var ma={};function tx(t,n,s,l){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=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function sn(t,n,s,l){return new tx(t,n,s,l)}function jh(t){return t=t.prototype,!(!t||!t.isReactComponent)}function fr(t,n){var s=t.alternate;return s===null?(s=sn(t.tag,n,t.key,t.mode),s.elementType=t.elementType,s.type=t.type,s.stateNode=t.stateNode,s.alternate=t,t.alternate=s):(s.pendingProps=n,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,n=t.dependencies,s.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},s.sibling=t.sibling,s.index=t.index,s.ref=t.ref,s.refCleanup=t.refCleanup,s}function Nm(t,n){t.flags&=65011714;var s=t.alternate;return s===null?(t.childLanes=0,t.lanes=n,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,n=s.dependencies,t.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t}function ac(t,n,s,l,g,w){var D=0;if(l=t,typeof t=="function")jh(t)&&(D=1);else if(typeof t=="string")D=a2(t,s,ae.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case B:return t=sn(31,s,n,g),t.elementType=B,t.lanes=w,t;case x:return ks(s.children,g,w,n);case p:D=8,g|=24;break;case y:return t=sn(12,s,n,g|2),t.elementType=y,t.lanes=w,t;case R:return t=sn(13,s,n,g),t.elementType=R,t.lanes=w,t;case L:return t=sn(19,s,n,g),t.elementType=L,t.lanes=w,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case v:D=10;break e;case d:D=9;break e;case T:D=11;break e;case M:D=14;break e;case k:D=16,l=null;break e}D=29,s=Error(a(130,t===null?"null":typeof t,"")),l=null}return n=sn(D,s,n,g),n.elementType=t,n.type=l,n.lanes=w,n}function ks(t,n,s,l){return t=sn(7,t,l,n),t.lanes=s,t}function zh(t,n,s){return t=sn(6,t,null,n),t.lanes=s,t}function Bm(t){var n=sn(18,null,null,0);return n.stateNode=t,n}function $h(t,n,s){return n=sn(4,t.children!==null?t.children:[],t.key,n),n.lanes=s,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}var Im=new WeakMap;function mn(t,n){if(typeof t=="object"&&t!==null){var s=Im.get(t);return s!==void 0?s:(n={value:t,source:n,stack:Qt(n)},Im.set(t,n),n)}return{value:t,source:n,stack:Qt(n)}}var _a=[],va=0,oc=null,To=0,_n=[],vn=0,Pr=null,Kn=1,Vn="";function pr(t,n){_a[va++]=To,_a[va++]=oc,oc=t,To=n}function jm(t,n,s){_n[vn++]=Kn,_n[vn++]=Vn,_n[vn++]=Pr,Pr=t;var l=Kn;t=Vn;var g=32-$t(l)-1;l&=~(1<<g),s+=1;var w=32-$t(n)+g;if(30<w){var D=g-g%5;w=(l&(1<<D)-1).toString(32),l>>=D,g-=D,Kn=1<<32-$t(n)+g|s<<g|l,Vn=w+t}else Kn=1<<w|s<<g|l,Vn=t}function Hh(t){t.return!==null&&(pr(t,1),jm(t,1,0))}function Ph(t){for(;t===oc;)oc=_a[--va],_a[va]=null,To=_a[--va],_a[va]=null;for(;t===Pr;)Pr=_n[--vn],_n[vn]=null,Vn=_n[--vn],_n[vn]=null,Kn=_n[--vn],_n[vn]=null}function zm(t,n){_n[vn++]=Kn,_n[vn++]=Vn,_n[vn++]=Pr,Kn=n.id,Vn=n.overflow,Pr=t}var Si=null,kt=null,rt=!1,Ur=null,bn=!1,Uh=Error(a(519));function Fr(t){var n=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ao(mn(n,t)),Uh}function $m(t){var n=t.stateNode,s=t.type,l=t.memoizedProps;switch(n[Tt]=t,n[xt]=l,s){case"dialog":Ze("cancel",n),Ze("close",n);break;case"iframe":case"object":case"embed":Ze("load",n);break;case"video":case"audio":for(s=0;s<Yo.length;s++)Ze(Yo[s],n);break;case"source":Ze("error",n);break;case"img":case"image":case"link":Ze("error",n),Ze("load",n);break;case"details":Ze("toggle",n);break;case"input":Ze("invalid",n),Cs(n,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Ze("invalid",n);break;case"textarea":Ze("invalid",n),ha(n,l.value,l.defaultValue,l.children)}s=l.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||n.textContent===""+s||l.suppressHydrationWarning===!0||i0(n.textContent,s)?(l.popover!=null&&(Ze("beforetoggle",n),Ze("toggle",n)),l.onScroll!=null&&Ze("scroll",n),l.onScrollEnd!=null&&Ze("scrollend",n),l.onClick!=null&&(n.onclick=we),n=!0):n=!1,n||Fr(t,!0)}function Hm(t){for(Si=t.return;Si;)switch(Si.tag){case 5:case 31:case 13:bn=!1;return;case 27:case 3:bn=!0;return;default:Si=Si.return}}function ba(t){if(t!==Si)return!1;if(!rt)return Hm(t),rt=!0,!1;var n=t.tag,s;if((s=n!==3&&n!==27)&&((s=n===5)&&(s=t.type,s=!(s!=="form"&&s!=="button")||of(t.type,t.memoizedProps)),s=!s),s&&kt&&Fr(t),Hm(t),n===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));kt=h0(t)}else if(n===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));kt=h0(t)}else n===27?(n=kt,ns(t.type)?(t=df,df=null,kt=t):kt=n):kt=Si?Sn(t.stateNode.nextSibling):null;return!0}function Rs(){kt=Si=null,rt=!1}function Fh(){var t=Ur;return t!==null&&(Vi===null?Vi=t:Vi.push.apply(Vi,t),Ur=null),t}function Ao(t){Ur===null?Ur=[t]:Ur.push(t)}var qh=O(null),Ls=null,gr=null;function qr(t,n,s){Z(qh,n._currentValue),n._currentValue=s}function mr(t){t._currentValue=qh.current,H(qh)}function Wh(t,n,s){for(;t!==null;){var l=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,l!==null&&(l.childLanes|=n)):l!==null&&(l.childLanes&n)!==n&&(l.childLanes|=n),t===s)break;t=t.return}}function Gh(t,n,s,l){var g=t.child;for(g!==null&&(g.return=t);g!==null;){var w=g.dependencies;if(w!==null){var D=g.child;w=w.firstContext;e:for(;w!==null;){var j=w;w=g;for(var Y=0;Y<n.length;Y++)if(j.context===n[Y]){w.lanes|=s,j=w.alternate,j!==null&&(j.lanes|=s),Wh(w.return,s,t),l||(D=null);break e}w=j.next}}else if(g.tag===18){if(D=g.return,D===null)throw Error(a(341));D.lanes|=s,w=D.alternate,w!==null&&(w.lanes|=s),Wh(D,s,t),D=null}else D=g.child;if(D!==null)D.return=g;else for(D=g;D!==null;){if(D===t){D=null;break}if(g=D.sibling,g!==null){g.return=D.return,D=g;break}D=D.return}g=D}}function ya(t,n,s,l){t=null;for(var g=n,w=!1;g!==null;){if(!w){if((g.flags&524288)!==0)w=!0;else if((g.flags&262144)!==0)break}if(g.tag===10){var D=g.alternate;if(D===null)throw Error(a(387));if(D=D.memoizedProps,D!==null){var j=g.type;rn(g.pendingProps.value,D.value)||(t!==null?t.push(j):t=[j])}}else if(g===Q.current){if(D=g.alternate,D===null)throw Error(a(387));D.memoizedState.memoizedState!==g.memoizedState.memoizedState&&(t!==null?t.push(el):t=[el])}g=g.return}t!==null&&Gh(n,t,s,l),n.flags|=262144}function lc(t){for(t=t.firstContext;t!==null;){if(!rn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Ms(t){Ls=t,gr=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function wi(t){return Pm(Ls,t)}function cc(t,n){return Ls===null&&Ms(t),Pm(t,n)}function Pm(t,n){var s=n._currentValue;if(n={context:n,memoizedValue:s,next:null},gr===null){if(t===null)throw Error(a(308));gr=n,t.dependencies={lanes:0,firstContext:n},t.flags|=524288}else gr=gr.next=n;return s}var ix=typeof AbortController<"u"?AbortController:function(){var t=[],n=this.signal={aborted:!1,addEventListener:function(s,l){t.push(l)}};this.abort=function(){n.aborted=!0,t.forEach(function(s){return s()})}},nx=e.unstable_scheduleCallback,rx=e.unstable_NormalPriority,ri={$$typeof:v,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Kh(){return{controller:new ix,data:new Map,refCount:0}}function ko(t){t.refCount--,t.refCount===0&&nx(rx,function(){t.controller.abort()})}var Ro=null,Vh=0,Sa=0,wa=null;function sx(t,n){if(Ro===null){var s=Ro=[];Vh=0,Sa=Zd(),wa={status:"pending",value:void 0,then:function(l){s.push(l)}}}return Vh++,n.then(Um,Um),n}function Um(){if(--Vh===0&&Ro!==null){wa!==null&&(wa.status="fulfilled");var t=Ro;Ro=null,Sa=0,wa=null;for(var n=0;n<t.length;n++)(0,t[n])()}}function ax(t,n){var s=[],l={status:"pending",value:null,reason:null,then:function(g){s.push(g)}};return t.then(function(){l.status="fulfilled",l.value=n;for(var g=0;g<s.length;g++)(0,s[g])(n)},function(g){for(l.status="rejected",l.reason=g,g=0;g<s.length;g++)(0,s[g])(void 0)}),l}var Fm=P.S;P.S=function(t,n){Tv=ut(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&sx(t,n),Fm!==null&&Fm(t,n)};var Ds=O(null);function Yh(){var t=Ds.current;return t!==null?t:wt.pooledCache}function uc(t,n){n===null?Z(Ds,Ds.current):Z(Ds,n.pool)}function qm(){var t=Yh();return t===null?null:{parent:ri._currentValue,pool:t}}var Ca=Error(a(460)),Xh=Error(a(474)),hc=Error(a(542)),dc={then:function(){}};function Wm(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Gm(t,n,s){switch(s=t[s],s===void 0?t.push(n):s!==n&&(n.then(we,we),n=s),n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,Vm(t),t;default:if(typeof n.status=="string")n.then(we,we);else{if(t=wt,t!==null&&100<t.shellSuspendCounter)throw Error(a(482));t=n,t.status="pending",t.then(function(l){if(n.status==="pending"){var g=n;g.status="fulfilled",g.value=l}},function(l){if(n.status==="pending"){var g=n;g.status="rejected",g.reason=l}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,Vm(t),t}throw Ns=n,Ca}}function Os(t){try{var n=t._init;return n(t._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Ns=s,Ca):s}}var Ns=null;function Km(){if(Ns===null)throw Error(a(459));var t=Ns;return Ns=null,t}function Vm(t){if(t===Ca||t===hc)throw Error(a(483))}var xa=null,Lo=0;function fc(t){var n=Lo;return Lo+=1,xa===null&&(xa=[]),Gm(xa,t,n)}function Mo(t,n){n=n.props.ref,t.ref=n!==void 0?n:null}function pc(t,n){throw n.$$typeof===C?Error(a(525)):(t=Object.prototype.toString.call(n),Error(a(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)))}function Ym(t){function n(ie,ee){if(t){var ne=ie.deletions;ne===null?(ie.deletions=[ee],ie.flags|=16):ne.push(ee)}}function s(ie,ee){if(!t)return null;for(;ee!==null;)n(ie,ee),ee=ee.sibling;return null}function l(ie){for(var ee=new Map;ie!==null;)ie.key!==null?ee.set(ie.key,ie):ee.set(ie.index,ie),ie=ie.sibling;return ee}function g(ie,ee){return ie=fr(ie,ee),ie.index=0,ie.sibling=null,ie}function w(ie,ee,ne){return ie.index=ne,t?(ne=ie.alternate,ne!==null?(ne=ne.index,ne<ee?(ie.flags|=67108866,ee):ne):(ie.flags|=67108866,ee)):(ie.flags|=1048576,ee)}function D(ie){return t&&ie.alternate===null&&(ie.flags|=67108866),ie}function j(ie,ee,ne,de){return ee===null||ee.tag!==6?(ee=zh(ne,ie.mode,de),ee.return=ie,ee):(ee=g(ee,ne),ee.return=ie,ee)}function Y(ie,ee,ne,de){var Be=ne.type;return Be===x?ue(ie,ee,ne.props.children,de,ne.key):ee!==null&&(ee.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===k&&Os(Be)===ee.type)?(ee=g(ee,ne.props),Mo(ee,ne),ee.return=ie,ee):(ee=ac(ne.type,ne.key,ne.props,null,ie.mode,de),Mo(ee,ne),ee.return=ie,ee)}function re(ie,ee,ne,de){return ee===null||ee.tag!==4||ee.stateNode.containerInfo!==ne.containerInfo||ee.stateNode.implementation!==ne.implementation?(ee=$h(ne,ie.mode,de),ee.return=ie,ee):(ee=g(ee,ne.children||[]),ee.return=ie,ee)}function ue(ie,ee,ne,de,Be){return ee===null||ee.tag!==7?(ee=ks(ne,ie.mode,de,Be),ee.return=ie,ee):(ee=g(ee,ne),ee.return=ie,ee)}function fe(ie,ee,ne){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return ee=zh(""+ee,ie.mode,ne),ee.return=ie,ee;if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case E:return ne=ac(ee.type,ee.key,ee.props,null,ie.mode,ne),Mo(ne,ee),ne.return=ie,ne;case A:return ee=$h(ee,ie.mode,ne),ee.return=ie,ee;case k:return ee=Os(ee),fe(ie,ee,ne)}if(te(ee)||q(ee))return ee=ks(ee,ie.mode,ne,null),ee.return=ie,ee;if(typeof ee.then=="function")return fe(ie,fc(ee),ne);if(ee.$$typeof===v)return fe(ie,cc(ie,ee),ne);pc(ie,ee)}return null}function se(ie,ee,ne,de){var Be=ee!==null?ee.key:null;if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return Be!==null?null:j(ie,ee,""+ne,de);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case E:return ne.key===Be?Y(ie,ee,ne,de):null;case A:return ne.key===Be?re(ie,ee,ne,de):null;case k:return ne=Os(ne),se(ie,ee,ne,de)}if(te(ne)||q(ne))return Be!==null?null:ue(ie,ee,ne,de,null);if(typeof ne.then=="function")return se(ie,ee,fc(ne),de);if(ne.$$typeof===v)return se(ie,ee,cc(ie,ne),de);pc(ie,ne)}return null}function le(ie,ee,ne,de,Be){if(typeof de=="string"&&de!==""||typeof de=="number"||typeof de=="bigint")return ie=ie.get(ne)||null,j(ee,ie,""+de,Be);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case E:return ie=ie.get(de.key===null?ne:de.key)||null,Y(ee,ie,de,Be);case A:return ie=ie.get(de.key===null?ne:de.key)||null,re(ee,ie,de,Be);case k:return de=Os(de),le(ie,ee,ne,de,Be)}if(te(de)||q(de))return ie=ie.get(ne)||null,ue(ee,ie,de,Be,null);if(typeof de.then=="function")return le(ie,ee,ne,fc(de),Be);if(de.$$typeof===v)return le(ie,ee,ne,cc(ee,de),Be);pc(ee,de)}return null}function Te(ie,ee,ne,de){for(var Be=null,at=null,Le=ee,Ge=ee=0,it=null;Le!==null&&Ge<ne.length;Ge++){Le.index>Ge?(it=Le,Le=null):it=Le.sibling;var ot=se(ie,Le,ne[Ge],de);if(ot===null){Le===null&&(Le=it);break}t&&Le&&ot.alternate===null&&n(ie,Le),ee=w(ot,ee,Ge),at===null?Be=ot:at.sibling=ot,at=ot,Le=it}if(Ge===ne.length)return s(ie,Le),rt&&pr(ie,Ge),Be;if(Le===null){for(;Ge<ne.length;Ge++)Le=fe(ie,ne[Ge],de),Le!==null&&(ee=w(Le,ee,Ge),at===null?Be=Le:at.sibling=Le,at=Le);return rt&&pr(ie,Ge),Be}for(Le=l(Le);Ge<ne.length;Ge++)it=le(Le,ie,Ge,ne[Ge],de),it!==null&&(t&&it.alternate!==null&&Le.delete(it.key===null?Ge:it.key),ee=w(it,ee,Ge),at===null?Be=it:at.sibling=it,at=it);return t&&Le.forEach(function(ls){return n(ie,ls)}),rt&&pr(ie,Ge),Be}function ze(ie,ee,ne,de){if(ne==null)throw Error(a(151));for(var Be=null,at=null,Le=ee,Ge=ee=0,it=null,ot=ne.next();Le!==null&&!ot.done;Ge++,ot=ne.next()){Le.index>Ge?(it=Le,Le=null):it=Le.sibling;var ls=se(ie,Le,ot.value,de);if(ls===null){Le===null&&(Le=it);break}t&&Le&&ls.alternate===null&&n(ie,Le),ee=w(ls,ee,Ge),at===null?Be=ls:at.sibling=ls,at=ls,Le=it}if(ot.done)return s(ie,Le),rt&&pr(ie,Ge),Be;if(Le===null){for(;!ot.done;Ge++,ot=ne.next())ot=fe(ie,ot.value,de),ot!==null&&(ee=w(ot,ee,Ge),at===null?Be=ot:at.sibling=ot,at=ot);return rt&&pr(ie,Ge),Be}for(Le=l(Le);!ot.done;Ge++,ot=ne.next())ot=le(Le,ie,Ge,ot.value,de),ot!==null&&(t&&ot.alternate!==null&&Le.delete(ot.key===null?Ge:ot.key),ee=w(ot,ee,Ge),at===null?Be=ot:at.sibling=ot,at=ot);return t&&Le.forEach(function(_2){return n(ie,_2)}),rt&&pr(ie,Ge),Be}function bt(ie,ee,ne,de){if(typeof ne=="object"&&ne!==null&&ne.type===x&&ne.key===null&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case E:e:{for(var Be=ne.key;ee!==null;){if(ee.key===Be){if(Be=ne.type,Be===x){if(ee.tag===7){s(ie,ee.sibling),de=g(ee,ne.props.children),de.return=ie,ie=de;break e}}else if(ee.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===k&&Os(Be)===ee.type){s(ie,ee.sibling),de=g(ee,ne.props),Mo(de,ne),de.return=ie,ie=de;break e}s(ie,ee);break}else n(ie,ee);ee=ee.sibling}ne.type===x?(de=ks(ne.props.children,ie.mode,de,ne.key),de.return=ie,ie=de):(de=ac(ne.type,ne.key,ne.props,null,ie.mode,de),Mo(de,ne),de.return=ie,ie=de)}return D(ie);case A:e:{for(Be=ne.key;ee!==null;){if(ee.key===Be)if(ee.tag===4&&ee.stateNode.containerInfo===ne.containerInfo&&ee.stateNode.implementation===ne.implementation){s(ie,ee.sibling),de=g(ee,ne.children||[]),de.return=ie,ie=de;break e}else{s(ie,ee);break}else n(ie,ee);ee=ee.sibling}de=$h(ne,ie.mode,de),de.return=ie,ie=de}return D(ie);case k:return ne=Os(ne),bt(ie,ee,ne,de)}if(te(ne))return Te(ie,ee,ne,de);if(q(ne)){if(Be=q(ne),typeof Be!="function")throw Error(a(150));return ne=Be.call(ne),ze(ie,ee,ne,de)}if(typeof ne.then=="function")return bt(ie,ee,fc(ne),de);if(ne.$$typeof===v)return bt(ie,ee,cc(ie,ne),de);pc(ie,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint"?(ne=""+ne,ee!==null&&ee.tag===6?(s(ie,ee.sibling),de=g(ee,ne),de.return=ie,ie=de):(s(ie,ee),de=zh(ne,ie.mode,de),de.return=ie,ie=de),D(ie)):s(ie,ee)}return function(ie,ee,ne,de){try{Lo=0;var Be=bt(ie,ee,ne,de);return xa=null,Be}catch(Le){if(Le===Ca||Le===hc)throw Le;var at=sn(29,Le,null,ie.mode);return at.lanes=de,at.return=ie,at}}}var Bs=Ym(!0),Xm=Ym(!1),Wr=!1;function Zh(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Jh(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Gr(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Kr(t,n,s){var l=t.updateQueue;if(l===null)return null;if(l=l.shared,(ht&2)!==0){var g=l.pending;return g===null?n.next=n:(n.next=g.next,g.next=n),l.pending=n,n=sc(t),Om(t,null,s),n}return rc(t,l,n,s),sc(t)}function Do(t,n,s){if(n=n.updateQueue,n!==null&&(n=n.shared,(s&4194048)!==0)){var l=n.lanes;l&=t.pendingLanes,s|=l,n.lanes=s,je(t,s)}}function Qh(t,n){var s=t.updateQueue,l=t.alternate;if(l!==null&&(l=l.updateQueue,s===l)){var g=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?g=w=D:w=w.next=D,s=s.next}while(s!==null);w===null?g=w=n:w=w.next=n}else g=w=n;s={baseState:l.baseState,firstBaseUpdate:g,lastBaseUpdate:w,shared:l.shared,callbacks:l.callbacks},t.updateQueue=s;return}t=s.lastBaseUpdate,t===null?s.firstBaseUpdate=n:t.next=n,s.lastBaseUpdate=n}var ed=!1;function Oo(){if(ed){var t=wa;if(t!==null)throw t}}function No(t,n,s,l){ed=!1;var g=t.updateQueue;Wr=!1;var w=g.firstBaseUpdate,D=g.lastBaseUpdate,j=g.shared.pending;if(j!==null){g.shared.pending=null;var Y=j,re=Y.next;Y.next=null,D===null?w=re:D.next=re,D=Y;var ue=t.alternate;ue!==null&&(ue=ue.updateQueue,j=ue.lastBaseUpdate,j!==D&&(j===null?ue.firstBaseUpdate=re:j.next=re,ue.lastBaseUpdate=Y))}if(w!==null){var fe=g.baseState;D=0,ue=re=Y=null,j=w;do{var se=j.lane&-536870913,le=se!==j.lane;if(le?(tt&se)===se:(l&se)===se){se!==0&&se===Sa&&(ed=!0),ue!==null&&(ue=ue.next={lane:0,tag:j.tag,payload:j.payload,callback:null,next:null});e:{var Te=t,ze=j;se=n;var bt=s;switch(ze.tag){case 1:if(Te=ze.payload,typeof Te=="function"){fe=Te.call(bt,fe,se);break e}fe=Te;break e;case 3:Te.flags=Te.flags&-65537|128;case 0:if(Te=ze.payload,se=typeof Te=="function"?Te.call(bt,fe,se):Te,se==null)break e;fe=f({},fe,se);break e;case 2:Wr=!0}}se=j.callback,se!==null&&(t.flags|=64,le&&(t.flags|=8192),le=g.callbacks,le===null?g.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,Y=fe):ue=ue.next=le,D|=se;if(j=j.next,j===null){if(j=g.shared.pending,j===null)break;le=j,j=le.next,le.next=null,g.lastBaseUpdate=le,g.shared.pending=null}}while(!0);ue===null&&(Y=fe),g.baseState=Y,g.firstBaseUpdate=re,g.lastBaseUpdate=ue,w===null&&(g.shared.lanes=0),Jr|=D,t.lanes=D,t.memoizedState=fe}}function Zm(t,n){if(typeof t!="function")throw Error(a(191,t));t.call(n)}function Jm(t,n){var s=t.callbacks;if(s!==null)for(t.callbacks=null,t=0;t<s.length;t++)Zm(s[t],n)}var Ea=O(null),gc=O(0);function Qm(t,n){t=Er,Z(gc,t),Z(Ea,n),Er=t|n.baseLanes}function td(){Z(gc,Er),Z(Ea,Ea.current)}function id(){Er=gc.current,H(Ea),H(gc)}var an=O(null),yn=null;function Vr(t){var n=t.alternate;Z(Xt,Xt.current&1),Z(an,t),yn===null&&(n===null||Ea.current!==null||n.memoizedState!==null)&&(yn=t)}function nd(t){Z(Xt,Xt.current),Z(an,t),yn===null&&(yn=t)}function e_(t){t.tag===22?(Z(Xt,Xt.current),Z(an,t),yn===null&&(yn=t)):Yr()}function Yr(){Z(Xt,Xt.current),Z(an,an.current)}function on(t){H(an),yn===t&&(yn=null),H(Xt)}var Xt=O(0);function mc(t){for(var n=t;n!==null;){if(n.tag===13){var s=n.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||uf(s)||hf(s)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var _r=0,We=null,_t=null,si=null,_c=!1,Ta=!1,Is=!1,vc=0,Bo=0,Aa=null,ox=0;function Ut(){throw Error(a(321))}function rd(t,n){if(n===null)return!1;for(var s=0;s<n.length&&s<t.length;s++)if(!rn(t[s],n[s]))return!1;return!0}function sd(t,n,s,l,g,w){return _r=w,We=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,P.H=t===null||t.memoizedState===null?j_:yd,Is=!1,w=s(l,g),Is=!1,Ta&&(w=i_(n,s,l,g)),t_(t),w}function t_(t){P.H=zo;var n=_t!==null&&_t.next!==null;if(_r=0,si=_t=We=null,_c=!1,Bo=0,Aa=null,n)throw Error(a(300));t===null||ai||(t=t.dependencies,t!==null&&lc(t)&&(ai=!0))}function i_(t,n,s,l){We=t;var g=0;do{if(Ta&&(Aa=null),Bo=0,Ta=!1,25<=g)throw Error(a(301));if(g+=1,si=_t=null,t.updateQueue!=null){var w=t.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}P.H=z_,w=n(s,l)}while(Ta);return w}function lx(){var t=P.H,n=t.useState()[0];return n=typeof n.then=="function"?Io(n):n,t=t.useState()[0],(_t!==null?_t.memoizedState:null)!==t&&(We.flags|=1024),n}function ad(){var t=vc!==0;return vc=0,t}function od(t,n,s){n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~s}function ld(t){if(_c){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}_c=!1}_r=0,si=_t=We=null,Ta=!1,Bo=vc=0,Aa=null}function Ni(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return si===null?We.memoizedState=si=t:si=si.next=t,si}function Zt(){if(_t===null){var t=We.alternate;t=t!==null?t.memoizedState:null}else t=_t.next;var n=si===null?We.memoizedState:si.next;if(n!==null)si=n,_t=t;else{if(t===null)throw We.alternate===null?Error(a(467)):Error(a(310));_t=t,t={memoizedState:_t.memoizedState,baseState:_t.baseState,baseQueue:_t.baseQueue,queue:_t.queue,next:null},si===null?We.memoizedState=si=t:si=si.next=t}return si}function bc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Io(t){var n=Bo;return Bo+=1,Aa===null&&(Aa=[]),t=Gm(Aa,t,n),n=We,(si===null?n.memoizedState:si.next)===null&&(n=n.alternate,P.H=n===null||n.memoizedState===null?j_:yd),t}function yc(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Io(t);if(t.$$typeof===v)return wi(t)}throw Error(a(438,String(t)))}function cd(t){var n=null,s=We.updateQueue;if(s!==null&&(n=s.memoCache),n==null){var l=We.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(n={data:l.data.map(function(g){return g.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),s===null&&(s=bc(),We.updateQueue=s),s.memoCache=n,s=n.data[n.index],s===void 0)for(s=n.data[n.index]=Array(t),l=0;l<t;l++)s[l]=W;return n.index++,s}function vr(t,n){return typeof n=="function"?n(t):n}function Sc(t){var n=Zt();return ud(n,_t,t)}function ud(t,n,s){var l=t.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=s;var g=t.baseQueue,w=l.pending;if(w!==null){if(g!==null){var D=g.next;g.next=w.next,w.next=D}n.baseQueue=g=w,l.pending=null}if(w=t.baseState,g===null)t.memoizedState=w;else{n=g.next;var j=D=null,Y=null,re=n,ue=!1;do{var fe=re.lane&-536870913;if(fe!==re.lane?(tt&fe)===fe:(_r&fe)===fe){var se=re.revertLane;if(se===0)Y!==null&&(Y=Y.next={lane:0,revertLane:0,gesture:null,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null}),fe===Sa&&(ue=!0);else if((_r&se)===se){re=re.next,se===Sa&&(ue=!0);continue}else fe={lane:0,revertLane:re.revertLane,gesture:null,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},Y===null?(j=Y=fe,D=w):Y=Y.next=fe,We.lanes|=se,Jr|=se;fe=re.action,Is&&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},Y===null?(j=Y=se,D=w):Y=Y.next=se,We.lanes|=fe,Jr|=fe;re=re.next}while(re!==null&&re!==n);if(Y===null?D=w:Y.next=j,!rn(w,t.memoizedState)&&(ai=!0,ue&&(s=wa,s!==null)))throw s;t.memoizedState=w,t.baseState=D,t.baseQueue=Y,l.lastRenderedState=w}return g===null&&(l.lanes=0),[t.memoizedState,l.dispatch]}function hd(t){var n=Zt(),s=n.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=t;var l=s.dispatch,g=s.pending,w=n.memoizedState;if(g!==null){s.pending=null;var D=g=g.next;do w=t(w,D.action),D=D.next;while(D!==g);rn(w,n.memoizedState)||(ai=!0),n.memoizedState=w,n.baseQueue===null&&(n.baseState=w),s.lastRenderedState=w}return[w,l]}function n_(t,n,s){var l=We,g=Zt(),w=rt;if(w){if(s===void 0)throw Error(a(407));s=s()}else s=n();var D=!rn((_t||g).memoizedState,s);if(D&&(g.memoizedState=s,ai=!0),g=g.queue,pd(a_.bind(null,l,g,t),[t]),g.getSnapshot!==n||D||si!==null&&si.memoizedState.tag&1){if(l.flags|=2048,ka(9,{destroy:void 0},s_.bind(null,l,g,s,n),null),wt===null)throw Error(a(349));w||(_r&127)!==0||r_(l,n,s)}return s}function r_(t,n,s){t.flags|=16384,t={getSnapshot:n,value:s},n=We.updateQueue,n===null?(n=bc(),We.updateQueue=n,n.stores=[t]):(s=n.stores,s===null?n.stores=[t]:s.push(t))}function s_(t,n,s,l){n.value=s,n.getSnapshot=l,o_(n)&&l_(t)}function a_(t,n,s){return s(function(){o_(n)&&l_(t)})}function o_(t){var n=t.getSnapshot;t=t.value;try{var s=n();return!rn(t,s)}catch{return!0}}function l_(t){var n=As(t,2);n!==null&&Yi(n,t,2)}function dd(t){var n=Ni();if(typeof t=="function"){var s=t;if(t=s(),Is){Yt(!0);try{s()}finally{Yt(!1)}}}return n.memoizedState=n.baseState=t,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vr,lastRenderedState:t},n}function c_(t,n,s,l){return t.baseState=s,ud(t,_t,typeof l=="function"?l:vr)}function cx(t,n,s,l,g){if(xc(t))throw Error(a(485));if(t=n.action,t!==null){var w={payload:g,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(D){w.listeners.push(D)}};P.T!==null?s(!0):w.isTransition=!1,l(w),s=n.pending,s===null?(w.next=n.pending=w,u_(n,w)):(w.next=s.next,n.pending=s.next=w)}}function u_(t,n){var s=n.action,l=n.payload,g=t.state;if(n.isTransition){var w=P.T,D={};P.T=D;try{var j=s(g,l),Y=P.S;Y!==null&&Y(D,j),h_(t,n,j)}catch(re){fd(t,n,re)}finally{w!==null&&D.types!==null&&(w.types=D.types),P.T=w}}else try{w=s(g,l),h_(t,n,w)}catch(re){fd(t,n,re)}}function h_(t,n,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(l){d_(t,n,l)},function(l){return fd(t,n,l)}):d_(t,n,s)}function d_(t,n,s){n.status="fulfilled",n.value=s,f_(n),t.state=s,n=t.pending,n!==null&&(s=n.next,s===n?t.pending=null:(s=s.next,n.next=s,u_(t,s)))}function fd(t,n,s){var l=t.pending;if(t.pending=null,l!==null){l=l.next;do n.status="rejected",n.reason=s,f_(n),n=n.next;while(n!==l)}t.action=null}function f_(t){t=t.listeners;for(var n=0;n<t.length;n++)(0,t[n])()}function p_(t,n){return n}function g_(t,n){if(rt){var s=wt.formState;if(s!==null){e:{var l=We;if(rt){if(kt){t:{for(var g=kt,w=bn;g.nodeType!==8;){if(!w){g=null;break t}if(g=Sn(g.nextSibling),g===null){g=null;break t}}w=g.data,g=w==="F!"||w==="F"?g:null}if(g){kt=Sn(g.nextSibling),l=g.data==="F!";break e}}Fr(l)}l=!1}l&&(n=s[0])}}return s=Ni(),s.memoizedState=s.baseState=n,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:p_,lastRenderedState:n},s.queue=l,s=N_.bind(null,We,l),l.dispatch=s,l=dd(!1),w=bd.bind(null,We,!1,l.queue),l=Ni(),g={state:n,dispatch:null,action:t,pending:null},l.queue=g,s=cx.bind(null,We,g,w,s),g.dispatch=s,l.memoizedState=t,[n,s,!1]}function m_(t){var n=Zt();return __(n,_t,t)}function __(t,n,s){if(n=ud(t,n,p_)[0],t=Sc(vr)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var l=Io(n)}catch(D){throw D===Ca?hc:D}else l=n;n=Zt();var g=n.queue,w=g.dispatch;return s!==n.memoizedState&&(We.flags|=2048,ka(9,{destroy:void 0},ux.bind(null,g,s),null)),[l,w,t]}function ux(t,n){t.action=n}function v_(t){var n=Zt(),s=_t;if(s!==null)return __(n,s,t);Zt(),n=n.memoizedState,s=Zt();var l=s.queue.dispatch;return s.memoizedState=t,[n,l,!1]}function ka(t,n,s,l){return t={tag:t,create:s,deps:l,inst:n,next:null},n=We.updateQueue,n===null&&(n=bc(),We.updateQueue=n),s=n.lastEffect,s===null?n.lastEffect=t.next=t:(l=s.next,s.next=t,t.next=l,n.lastEffect=t),t}function b_(){return Zt().memoizedState}function wc(t,n,s,l){var g=Ni();We.flags|=t,g.memoizedState=ka(1|n,{destroy:void 0},s,l===void 0?null:l)}function Cc(t,n,s,l){var g=Zt();l=l===void 0?null:l;var w=g.memoizedState.inst;_t!==null&&l!==null&&rd(l,_t.memoizedState.deps)?g.memoizedState=ka(n,w,s,l):(We.flags|=t,g.memoizedState=ka(1|n,w,s,l))}function y_(t,n){wc(8390656,8,t,n)}function pd(t,n){Cc(2048,8,t,n)}function hx(t){We.flags|=4;var n=We.updateQueue;if(n===null)n=bc(),We.updateQueue=n,n.events=[t];else{var s=n.events;s===null?n.events=[t]:s.push(t)}}function S_(t){var n=Zt().memoizedState;return hx({ref:n,nextImpl:t}),function(){if((ht&2)!==0)throw Error(a(440));return n.impl.apply(void 0,arguments)}}function w_(t,n){return Cc(4,2,t,n)}function C_(t,n){return Cc(4,4,t,n)}function x_(t,n){if(typeof n=="function"){t=t();var s=n(t);return function(){typeof s=="function"?s():n(null)}}if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function E_(t,n,s){s=s!=null?s.concat([t]):null,Cc(4,4,x_.bind(null,n,t),s)}function gd(){}function T_(t,n){var s=Zt();n=n===void 0?null:n;var l=s.memoizedState;return n!==null&&rd(n,l[1])?l[0]:(s.memoizedState=[t,n],t)}function A_(t,n){var s=Zt();n=n===void 0?null:n;var l=s.memoizedState;if(n!==null&&rd(n,l[1]))return l[0];if(l=t(),Is){Yt(!0);try{t()}finally{Yt(!1)}}return s.memoizedState=[l,n],l}function md(t,n,s){return s===void 0||(_r&1073741824)!==0&&(tt&261930)===0?t.memoizedState=n:(t.memoizedState=s,t=kv(),We.lanes|=t,Jr|=t,s)}function k_(t,n,s,l){return rn(s,n)?s:Ea.current!==null?(t=md(t,s,l),rn(t,n)||(ai=!0),t):(_r&42)===0||(_r&1073741824)!==0&&(tt&261930)===0?(ai=!0,t.memoizedState=s):(t=kv(),We.lanes|=t,Jr|=t,n)}function R_(t,n,s,l,g){var w=V.p;V.p=w!==0&&8>w?w:8;var D=P.T,j={};P.T=j,bd(t,!1,n,s);try{var Y=g(),re=P.S;if(re!==null&&re(j,Y),Y!==null&&typeof Y=="object"&&typeof Y.then=="function"){var ue=ax(Y,l);jo(t,n,ue,un(t))}else jo(t,n,l,un(t))}catch(fe){jo(t,n,{then:function(){},status:"rejected",reason:fe},un())}finally{V.p=w,D!==null&&j.types!==null&&(D.types=j.types),P.T=D}}function dx(){}function _d(t,n,s,l){if(t.tag!==5)throw Error(a(476));var g=L_(t).queue;R_(t,g,n,X,s===null?dx:function(){return M_(t),s(l)})}function L_(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:X,baseState:X,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vr,lastRenderedState:X},next:null};var s={};return n.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vr,lastRenderedState:s},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function M_(t){var n=L_(t);n.next===null&&(n=t.alternate.memoizedState),jo(t,n.next.queue,{},un())}function vd(){return wi(el)}function D_(){return Zt().memoizedState}function O_(){return Zt().memoizedState}function fx(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var s=un();t=Gr(s);var l=Kr(n,t,s);l!==null&&(Yi(l,n,s),Do(l,n,s)),n={cache:Kh()},t.payload=n;return}n=n.return}}function px(t,n,s){var l=un();s={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},xc(t)?B_(n,s):(s=Ih(t,n,s,l),s!==null&&(Yi(s,t,l),I_(s,n,l)))}function N_(t,n,s){var l=un();jo(t,n,s,l)}function jo(t,n,s,l){var g={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(xc(t))B_(n,g);else{var w=t.alternate;if(t.lanes===0&&(w===null||w.lanes===0)&&(w=n.lastRenderedReducer,w!==null))try{var D=n.lastRenderedState,j=w(D,s);if(g.hasEagerState=!0,g.eagerState=j,rn(j,D))return rc(t,n,g,0),wt===null&&nc(),!1}catch{}if(s=Ih(t,n,g,l),s!==null)return Yi(s,t,l),I_(s,n,l),!0}return!1}function bd(t,n,s,l){if(l={lane:2,revertLane:Zd(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},xc(t)){if(n)throw Error(a(479))}else n=Ih(t,s,l,2),n!==null&&Yi(n,t,2)}function xc(t){var n=t.alternate;return t===We||n!==null&&n===We}function B_(t,n){Ta=_c=!0;var s=t.pending;s===null?n.next=n:(n.next=s.next,s.next=n),t.pending=n}function I_(t,n,s){if((s&4194048)!==0){var l=n.lanes;l&=t.pendingLanes,s|=l,n.lanes=s,je(t,s)}}var zo={readContext:wi,use:yc,useCallback:Ut,useContext:Ut,useEffect:Ut,useImperativeHandle:Ut,useLayoutEffect:Ut,useInsertionEffect:Ut,useMemo:Ut,useReducer:Ut,useRef:Ut,useState:Ut,useDebugValue:Ut,useDeferredValue:Ut,useTransition:Ut,useSyncExternalStore:Ut,useId:Ut,useHostTransitionStatus:Ut,useFormState:Ut,useActionState:Ut,useOptimistic:Ut,useMemoCache:Ut,useCacheRefresh:Ut};zo.useEffectEvent=Ut;var j_={readContext:wi,use:yc,useCallback:function(t,n){return Ni().memoizedState=[t,n===void 0?null:n],t},useContext:wi,useEffect:y_,useImperativeHandle:function(t,n,s){s=s!=null?s.concat([t]):null,wc(4194308,4,x_.bind(null,n,t),s)},useLayoutEffect:function(t,n){return wc(4194308,4,t,n)},useInsertionEffect:function(t,n){wc(4,2,t,n)},useMemo:function(t,n){var s=Ni();n=n===void 0?null:n;var l=t();if(Is){Yt(!0);try{t()}finally{Yt(!1)}}return s.memoizedState=[l,n],l},useReducer:function(t,n,s){var l=Ni();if(s!==void 0){var g=s(n);if(Is){Yt(!0);try{s(n)}finally{Yt(!1)}}}else g=n;return l.memoizedState=l.baseState=g,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:g},l.queue=t,t=t.dispatch=px.bind(null,We,t),[l.memoizedState,t]},useRef:function(t){var n=Ni();return t={current:t},n.memoizedState=t},useState:function(t){t=dd(t);var n=t.queue,s=N_.bind(null,We,n);return n.dispatch=s,[t.memoizedState,s]},useDebugValue:gd,useDeferredValue:function(t,n){var s=Ni();return md(s,t,n)},useTransition:function(){var t=dd(!1);return t=R_.bind(null,We,t.queue,!0,!1),Ni().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,s){var l=We,g=Ni();if(rt){if(s===void 0)throw Error(a(407));s=s()}else{if(s=n(),wt===null)throw Error(a(349));(tt&127)!==0||r_(l,n,s)}g.memoizedState=s;var w={value:s,getSnapshot:n};return g.queue=w,y_(a_.bind(null,l,w,t),[t]),l.flags|=2048,ka(9,{destroy:void 0},s_.bind(null,l,w,s,n),null),s},useId:function(){var t=Ni(),n=wt.identifierPrefix;if(rt){var s=Vn,l=Kn;s=(l&~(1<<32-$t(l)-1)).toString(32)+s,n="_"+n+"R_"+s,s=vc++,0<s&&(n+="H"+s.toString(32)),n+="_"}else s=ox++,n="_"+n+"r_"+s.toString(32)+"_";return t.memoizedState=n},useHostTransitionStatus:vd,useFormState:g_,useActionState:g_,useOptimistic:function(t){var n=Ni();n.memoizedState=n.baseState=t;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=s,n=bd.bind(null,We,!0,s),s.dispatch=n,[t,n]},useMemoCache:cd,useCacheRefresh:function(){return Ni().memoizedState=fx.bind(null,We)},useEffectEvent:function(t){var n=Ni(),s={impl:t};return n.memoizedState=s,function(){if((ht&2)!==0)throw Error(a(440));return s.impl.apply(void 0,arguments)}}},yd={readContext:wi,use:yc,useCallback:T_,useContext:wi,useEffect:pd,useImperativeHandle:E_,useInsertionEffect:w_,useLayoutEffect:C_,useMemo:A_,useReducer:Sc,useRef:b_,useState:function(){return Sc(vr)},useDebugValue:gd,useDeferredValue:function(t,n){var s=Zt();return k_(s,_t.memoizedState,t,n)},useTransition:function(){var t=Sc(vr)[0],n=Zt().memoizedState;return[typeof t=="boolean"?t:Io(t),n]},useSyncExternalStore:n_,useId:D_,useHostTransitionStatus:vd,useFormState:m_,useActionState:m_,useOptimistic:function(t,n){var s=Zt();return c_(s,_t,t,n)},useMemoCache:cd,useCacheRefresh:O_};yd.useEffectEvent=S_;var z_={readContext:wi,use:yc,useCallback:T_,useContext:wi,useEffect:pd,useImperativeHandle:E_,useInsertionEffect:w_,useLayoutEffect:C_,useMemo:A_,useReducer:hd,useRef:b_,useState:function(){return hd(vr)},useDebugValue:gd,useDeferredValue:function(t,n){var s=Zt();return _t===null?md(s,t,n):k_(s,_t.memoizedState,t,n)},useTransition:function(){var t=hd(vr)[0],n=Zt().memoizedState;return[typeof t=="boolean"?t:Io(t),n]},useSyncExternalStore:n_,useId:D_,useHostTransitionStatus:vd,useFormState:v_,useActionState:v_,useOptimistic:function(t,n){var s=Zt();return _t!==null?c_(s,_t,t,n):(s.baseState=t,[t,s.queue.dispatch])},useMemoCache:cd,useCacheRefresh:O_};z_.useEffectEvent=S_;function Sd(t,n,s,l){n=t.memoizedState,s=s(l,n),s=s==null?n:f({},n,s),t.memoizedState=s,t.lanes===0&&(t.updateQueue.baseState=s)}var wd={enqueueSetState:function(t,n,s){t=t._reactInternals;var l=un(),g=Gr(l);g.payload=n,s!=null&&(g.callback=s),n=Kr(t,g,l),n!==null&&(Yi(n,t,l),Do(n,t,l))},enqueueReplaceState:function(t,n,s){t=t._reactInternals;var l=un(),g=Gr(l);g.tag=1,g.payload=n,s!=null&&(g.callback=s),n=Kr(t,g,l),n!==null&&(Yi(n,t,l),Do(n,t,l))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var s=un(),l=Gr(s);l.tag=2,n!=null&&(l.callback=n),n=Kr(t,l,s),n!==null&&(Yi(n,t,s),Do(n,t,s))}};function $_(t,n,s,l,g,w,D){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(l,w,D):n.prototype&&n.prototype.isPureReactComponent?!xo(s,l)||!xo(g,w):!0}function H_(t,n,s,l){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(s,l),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(s,l),n.state!==t&&wd.enqueueReplaceState(n,n.state,null)}function js(t,n){var s=n;if("ref"in n){s={};for(var l in n)l!=="ref"&&(s[l]=n[l])}if(t=t.defaultProps){s===n&&(s=f({},s));for(var g in t)s[g]===void 0&&(s[g]=t[g])}return s}function P_(t){ic(t)}function U_(t){console.error(t)}function F_(t){ic(t)}function Ec(t,n){try{var s=t.onUncaughtError;s(n.value,{componentStack:n.stack})}catch(l){setTimeout(function(){throw l})}}function q_(t,n,s){try{var l=t.onCaughtError;l(s.value,{componentStack:s.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(g){setTimeout(function(){throw g})}}function Cd(t,n,s){return s=Gr(s),s.tag=3,s.payload={element:null},s.callback=function(){Ec(t,n)},s}function W_(t){return t=Gr(t),t.tag=3,t}function G_(t,n,s,l){var g=s.type.getDerivedStateFromError;if(typeof g=="function"){var w=l.value;t.payload=function(){return g(w)},t.callback=function(){q_(n,s,l)}}var D=s.stateNode;D!==null&&typeof D.componentDidCatch=="function"&&(t.callback=function(){q_(n,s,l),typeof g!="function"&&(Qr===null?Qr=new Set([this]):Qr.add(this));var j=l.stack;this.componentDidCatch(l.value,{componentStack:j!==null?j:""})})}function gx(t,n,s,l,g){if(s.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(n=s.alternate,n!==null&&ya(n,s,g,!0),s=an.current,s!==null){switch(s.tag){case 31:case 13:return yn===null?jc():s.alternate===null&&Ft===0&&(Ft=3),s.flags&=-257,s.flags|=65536,s.lanes=g,l===dc?s.flags|=16384:(n=s.updateQueue,n===null?s.updateQueue=new Set([l]):n.add(l),Vd(t,l,g)),!1;case 22:return s.flags|=65536,l===dc?s.flags|=16384:(n=s.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([l])},s.updateQueue=n):(s=n.retryQueue,s===null?n.retryQueue=new Set([l]):s.add(l)),Vd(t,l,g)),!1}throw Error(a(435,s.tag))}return Vd(t,l,g),jc(),!1}if(rt)return n=an.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=g,l!==Uh&&(t=Error(a(422),{cause:l}),Ao(mn(t,s)))):(l!==Uh&&(n=Error(a(423),{cause:l}),Ao(mn(n,s))),t=t.current.alternate,t.flags|=65536,g&=-g,t.lanes|=g,l=mn(l,s),g=Cd(t.stateNode,l,g),Qh(t,g),Ft!==4&&(Ft=2)),!1;var w=Error(a(520),{cause:l});if(w=mn(w,s),Go===null?Go=[w]:Go.push(w),Ft!==4&&(Ft=2),n===null)return!0;l=mn(l,s),s=n;do{switch(s.tag){case 3:return s.flags|=65536,t=g&-g,s.lanes|=t,t=Cd(s.stateNode,l,t),Qh(s,t),!1;case 1:if(n=s.type,w=s.stateNode,(s.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Qr===null||!Qr.has(w))))return s.flags|=65536,g&=-g,s.lanes|=g,g=W_(g),G_(g,t,s,l),Qh(s,g),!1}s=s.return}while(s!==null);return!1}var xd=Error(a(461)),ai=!1;function Ci(t,n,s,l){n.child=t===null?Xm(n,null,s,l):Bs(n,t.child,s,l)}function K_(t,n,s,l,g){s=s.render;var w=n.ref;if("ref"in l){var D={};for(var j in l)j!=="ref"&&(D[j]=l[j])}else D=l;return Ms(n),l=sd(t,n,s,D,w,g),j=ad(),t!==null&&!ai?(od(t,n,g),br(t,n,g)):(rt&&j&&Hh(n),n.flags|=1,Ci(t,n,l,g),n.child)}function V_(t,n,s,l,g){if(t===null){var w=s.type;return typeof w=="function"&&!jh(w)&&w.defaultProps===void 0&&s.compare===null?(n.tag=15,n.type=w,Y_(t,n,w,l,g)):(t=ac(s.type,null,l,n,n.mode,g),t.ref=n.ref,t.return=n,n.child=t)}if(w=t.child,!Dd(t,g)){var D=w.memoizedProps;if(s=s.compare,s=s!==null?s:xo,s(D,l)&&t.ref===n.ref)return br(t,n,g)}return n.flags|=1,t=fr(w,l),t.ref=n.ref,t.return=n,n.child=t}function Y_(t,n,s,l,g){if(t!==null){var w=t.memoizedProps;if(xo(w,l)&&t.ref===n.ref)if(ai=!1,n.pendingProps=l=w,Dd(t,g))(t.flags&131072)!==0&&(ai=!0);else return n.lanes=t.lanes,br(t,n,g)}return Ed(t,n,s,l,g)}function X_(t,n,s,l){var g=l.children,w=t!==null?t.memoizedState:null;if(t===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((n.flags&128)!==0){if(w=w!==null?w.baseLanes|s:s,t!==null){for(l=n.child=t.child,g=0;l!==null;)g=g|l.lanes|l.childLanes,l=l.sibling;l=g&~w}else l=0,n.child=null;return Z_(t,n,w,s,l)}if((s&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},t!==null&&uc(n,w!==null?w.cachePool:null),w!==null?Qm(n,w):td(),e_(n);else return l=n.lanes=536870912,Z_(t,n,w!==null?w.baseLanes|s:s,s,l)}else w!==null?(uc(n,w.cachePool),Qm(n,w),Yr(),n.memoizedState=null):(t!==null&&uc(n,null),td(),Yr());return Ci(t,n,g,s),n.child}function $o(t,n){return t!==null&&t.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function Z_(t,n,s,l,g){var w=Yh();return w=w===null?null:{parent:ri._currentValue,pool:w},n.memoizedState={baseLanes:s,cachePool:w},t!==null&&uc(n,null),td(),e_(n),t!==null&&ya(t,n,l,!0),n.childLanes=g,null}function Tc(t,n){return n=kc({mode:n.mode,children:n.children},t.mode),n.ref=t.ref,t.child=n,n.return=t,n}function J_(t,n,s){return Bs(n,t.child,null,s),t=Tc(n,n.pendingProps),t.flags|=2,on(n),n.memoizedState=null,t}function mx(t,n,s){var l=n.pendingProps,g=(n.flags&128)!==0;if(n.flags&=-129,t===null){if(rt){if(l.mode==="hidden")return t=Tc(n,l),n.lanes=536870912,$o(null,t);if(nd(n),(t=kt)?(t=u0(t,bn),t=t!==null&&t.data==="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Pr!==null?{id:Kn,overflow:Vn}:null,retryLane:536870912,hydrationErrors:null},s=Bm(t),s.return=n,n.child=s,Si=n,kt=null)):t=null,t===null)throw Fr(n);return n.lanes=536870912,null}return Tc(n,l)}var w=t.memoizedState;if(w!==null){var D=w.dehydrated;if(nd(n),g)if(n.flags&256)n.flags&=-257,n=J_(t,n,s);else if(n.memoizedState!==null)n.child=t.child,n.flags|=128,n=null;else throw Error(a(558));else if(ai||ya(t,n,s,!1),g=(s&t.childLanes)!==0,ai||g){if(l=wt,l!==null&&(D=Bt(l,s),D!==0&&D!==w.retryLane))throw w.retryLane=D,As(t,D),Yi(l,t,D),xd;jc(),n=J_(t,n,s)}else t=w.treeContext,kt=Sn(D.nextSibling),Si=n,rt=!0,Ur=null,bn=!1,t!==null&&zm(n,t),n=Tc(n,l),n.flags|=4096;return n}return t=fr(t.child,{mode:l.mode,children:l.children}),t.ref=n.ref,n.child=t,t.return=n,t}function Ac(t,n){var s=n.ref;if(s===null)t!==null&&t.ref!==null&&(n.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(a(284));(t===null||t.ref!==s)&&(n.flags|=4194816)}}function Ed(t,n,s,l,g){return Ms(n),s=sd(t,n,s,l,void 0,g),l=ad(),t!==null&&!ai?(od(t,n,g),br(t,n,g)):(rt&&l&&Hh(n),n.flags|=1,Ci(t,n,s,g),n.child)}function Q_(t,n,s,l,g,w){return Ms(n),n.updateQueue=null,s=i_(n,l,s,g),t_(t),l=ad(),t!==null&&!ai?(od(t,n,w),br(t,n,w)):(rt&&l&&Hh(n),n.flags|=1,Ci(t,n,s,w),n.child)}function ev(t,n,s,l,g){if(Ms(n),n.stateNode===null){var w=ma,D=s.contextType;typeof D=="object"&&D!==null&&(w=wi(D)),w=new s(l,w),n.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=wd,n.stateNode=w,w._reactInternals=n,w=n.stateNode,w.props=l,w.state=n.memoizedState,w.refs={},Zh(n),D=s.contextType,w.context=typeof D=="object"&&D!==null?wi(D):ma,w.state=n.memoizedState,D=s.getDerivedStateFromProps,typeof D=="function"&&(Sd(n,s,D,l),w.state=n.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&&wd.enqueueReplaceState(w,w.state,null),No(n,l,w,g),Oo(),w.state=n.memoizedState),typeof w.componentDidMount=="function"&&(n.flags|=4194308),l=!0}else if(t===null){w=n.stateNode;var j=n.memoizedProps,Y=js(s,j);w.props=Y;var re=w.context,ue=s.contextType;D=ma,typeof ue=="object"&&ue!==null&&(D=wi(ue));var fe=s.getDerivedStateFromProps;ue=typeof fe=="function"||typeof w.getSnapshotBeforeUpdate=="function",j=n.pendingProps!==j,ue||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(j||re!==D)&&H_(n,w,l,D),Wr=!1;var se=n.memoizedState;w.state=se,No(n,l,w,g),Oo(),re=n.memoizedState,j||se!==re||Wr?(typeof fe=="function"&&(Sd(n,s,fe,l),re=n.memoizedState),(Y=Wr||$_(n,s,Y,l,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"&&(n.flags|=4194308)):(typeof w.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=l,n.memoizedState=re),w.props=l,w.state=re,w.context=D,l=Y):(typeof w.componentDidMount=="function"&&(n.flags|=4194308),l=!1)}else{w=n.stateNode,Jh(t,n),D=n.memoizedProps,ue=js(s,D),w.props=ue,fe=n.pendingProps,se=w.context,re=s.contextType,Y=ma,typeof re=="object"&&re!==null&&(Y=wi(re)),j=s.getDerivedStateFromProps,(re=typeof j=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(D!==fe||se!==Y)&&H_(n,w,l,Y),Wr=!1,se=n.memoizedState,w.state=se,No(n,l,w,g),Oo();var le=n.memoizedState;D!==fe||se!==le||Wr||t!==null&&t.dependencies!==null&&lc(t.dependencies)?(typeof j=="function"&&(Sd(n,s,j,l),le=n.memoizedState),(ue=Wr||$_(n,s,ue,l,se,le,Y)||t!==null&&t.dependencies!==null&&lc(t.dependencies))?(re||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(l,le,Y),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(l,le,Y)),typeof w.componentDidUpdate=="function"&&(n.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof w.componentDidUpdate!="function"||D===t.memoizedProps&&se===t.memoizedState||(n.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||D===t.memoizedProps&&se===t.memoizedState||(n.flags|=1024),n.memoizedProps=l,n.memoizedState=le),w.props=l,w.state=le,w.context=Y,l=ue):(typeof w.componentDidUpdate!="function"||D===t.memoizedProps&&se===t.memoizedState||(n.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||D===t.memoizedProps&&se===t.memoizedState||(n.flags|=1024),l=!1)}return w=l,Ac(t,n),l=(n.flags&128)!==0,w||l?(w=n.stateNode,s=l&&typeof s.getDerivedStateFromError!="function"?null:w.render(),n.flags|=1,t!==null&&l?(n.child=Bs(n,t.child,null,g),n.child=Bs(n,null,s,g)):Ci(t,n,s,g),n.memoizedState=w.state,t=n.child):t=br(t,n,g),t}function tv(t,n,s,l){return Rs(),n.flags|=256,Ci(t,n,s,l),n.child}var Td={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ad(t){return{baseLanes:t,cachePool:qm()}}function kd(t,n,s){return t=t!==null?t.childLanes&~s:0,n&&(t|=cn),t}function iv(t,n,s){var l=n.pendingProps,g=!1,w=(n.flags&128)!==0,D;if((D=w)||(D=t!==null&&t.memoizedState===null?!1:(Xt.current&2)!==0),D&&(g=!0,n.flags&=-129),D=(n.flags&32)!==0,n.flags&=-33,t===null){if(rt){if(g?Vr(n):Yr(),(t=kt)?(t=u0(t,bn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Pr!==null?{id:Kn,overflow:Vn}:null,retryLane:536870912,hydrationErrors:null},s=Bm(t),s.return=n,n.child=s,Si=n,kt=null)):t=null,t===null)throw Fr(n);return hf(t)?n.lanes=32:n.lanes=536870912,null}var j=l.children;return l=l.fallback,g?(Yr(),g=n.mode,j=kc({mode:"hidden",children:j},g),l=ks(l,g,s,null),j.return=n,l.return=n,j.sibling=l,n.child=j,l=n.child,l.memoizedState=Ad(s),l.childLanes=kd(t,D,s),n.memoizedState=Td,$o(null,l)):(Vr(n),Rd(n,j))}var Y=t.memoizedState;if(Y!==null&&(j=Y.dehydrated,j!==null)){if(w)n.flags&256?(Vr(n),n.flags&=-257,n=Ld(t,n,s)):n.memoizedState!==null?(Yr(),n.child=t.child,n.flags|=128,n=null):(Yr(),j=l.fallback,g=n.mode,l=kc({mode:"visible",children:l.children},g),j=ks(j,g,s,null),j.flags|=2,l.return=n,j.return=n,l.sibling=j,n.child=l,Bs(n,t.child,null,s),l=n.child,l.memoizedState=Ad(s),l.childLanes=kd(t,D,s),n.memoizedState=Td,n=$o(null,l));else if(Vr(n),hf(j)){if(D=j.nextSibling&&j.nextSibling.dataset,D)var re=D.dgst;D=re,l=Error(a(419)),l.stack="",l.digest=D,Ao({value:l,source:null,stack:null}),n=Ld(t,n,s)}else if(ai||ya(t,n,s,!1),D=(s&t.childLanes)!==0,ai||D){if(D=wt,D!==null&&(l=Bt(D,s),l!==0&&l!==Y.retryLane))throw Y.retryLane=l,As(t,l),Yi(D,t,l),xd;uf(j)||jc(),n=Ld(t,n,s)}else uf(j)?(n.flags|=192,n.child=t.child,n=null):(t=Y.treeContext,kt=Sn(j.nextSibling),Si=n,rt=!0,Ur=null,bn=!1,t!==null&&zm(n,t),n=Rd(n,l.children),n.flags|=4096);return n}return g?(Yr(),j=l.fallback,g=n.mode,Y=t.child,re=Y.sibling,l=fr(Y,{mode:"hidden",children:l.children}),l.subtreeFlags=Y.subtreeFlags&65011712,re!==null?j=fr(re,j):(j=ks(j,g,s,null),j.flags|=2),j.return=n,l.return=n,l.sibling=j,n.child=l,$o(null,l),l=n.child,j=t.child.memoizedState,j===null?j=Ad(s):(g=j.cachePool,g!==null?(Y=ri._currentValue,g=g.parent!==Y?{parent:Y,pool:Y}:g):g=qm(),j={baseLanes:j.baseLanes|s,cachePool:g}),l.memoizedState=j,l.childLanes=kd(t,D,s),n.memoizedState=Td,$o(t.child,l)):(Vr(n),s=t.child,t=s.sibling,s=fr(s,{mode:"visible",children:l.children}),s.return=n,s.sibling=null,t!==null&&(D=n.deletions,D===null?(n.deletions=[t],n.flags|=16):D.push(t)),n.child=s,n.memoizedState=null,s)}function Rd(t,n){return n=kc({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function kc(t,n){return t=sn(22,t,null,n),t.lanes=0,t}function Ld(t,n,s){return Bs(n,t.child,null,s),t=Rd(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function nv(t,n,s){t.lanes|=n;var l=t.alternate;l!==null&&(l.lanes|=n),Wh(t.return,n,s)}function Md(t,n,s,l,g,w){var D=t.memoizedState;D===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:l,tail:s,tailMode:g,treeForkCount:w}:(D.isBackwards=n,D.rendering=null,D.renderingStartTime=0,D.last=l,D.tail=s,D.tailMode=g,D.treeForkCount=w)}function rv(t,n,s){var l=n.pendingProps,g=l.revealOrder,w=l.tail;l=l.children;var D=Xt.current,j=(D&2)!==0;if(j?(D=D&1|2,n.flags|=128):D&=1,Z(Xt,D),Ci(t,n,l,s),l=rt?To:0,!j&&t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&nv(t,s,n);else if(t.tag===19)nv(t,s,n);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break e;for(;t.sibling===null;){if(t.return===null||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(g){case"forwards":for(s=n.child,g=null;s!==null;)t=s.alternate,t!==null&&mc(t)===null&&(g=s),s=s.sibling;s=g,s===null?(g=n.child,n.child=null):(g=s.sibling,s.sibling=null),Md(n,!1,g,s,w,l);break;case"backwards":case"unstable_legacy-backwards":for(s=null,g=n.child,n.child=null;g!==null;){if(t=g.alternate,t!==null&&mc(t)===null){n.child=g;break}t=g.sibling,g.sibling=s,s=g,g=t}Md(n,!0,s,null,w,l);break;case"together":Md(n,!1,null,null,void 0,l);break;default:n.memoizedState=null}return n.child}function br(t,n,s){if(t!==null&&(n.dependencies=t.dependencies),Jr|=n.lanes,(s&n.childLanes)===0)if(t!==null){if(ya(t,n,s,!1),(s&n.childLanes)===0)return null}else return null;if(t!==null&&n.child!==t.child)throw Error(a(153));if(n.child!==null){for(t=n.child,s=fr(t,t.pendingProps),n.child=s,s.return=n;t.sibling!==null;)t=t.sibling,s=s.sibling=fr(t,t.pendingProps),s.return=n;s.sibling=null}return n.child}function Dd(t,n){return(t.lanes&n)!==0?!0:(t=t.dependencies,!!(t!==null&&lc(t)))}function _x(t,n,s){switch(n.tag){case 3:$(n,n.stateNode.containerInfo),qr(n,ri,t.memoizedState.cache),Rs();break;case 27:case 5:ge(n);break;case 4:$(n,n.stateNode.containerInfo);break;case 10:qr(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,nd(n),null;break;case 13:var l=n.memoizedState;if(l!==null)return l.dehydrated!==null?(Vr(n),n.flags|=128,null):(s&n.child.childLanes)!==0?iv(t,n,s):(Vr(n),t=br(t,n,s),t!==null?t.sibling:null);Vr(n);break;case 19:var g=(t.flags&128)!==0;if(l=(s&n.childLanes)!==0,l||(ya(t,n,s,!1),l=(s&n.childLanes)!==0),g){if(l)return rv(t,n,s);n.flags|=128}if(g=n.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),Z(Xt,Xt.current),l)break;return null;case 22:return n.lanes=0,X_(t,n,s,n.pendingProps);case 24:qr(n,ri,t.memoizedState.cache)}return br(t,n,s)}function sv(t,n,s){if(t!==null)if(t.memoizedProps!==n.pendingProps)ai=!0;else{if(!Dd(t,s)&&(n.flags&128)===0)return ai=!1,_x(t,n,s);ai=(t.flags&131072)!==0}else ai=!1,rt&&(n.flags&1048576)!==0&&jm(n,To,n.index);switch(n.lanes=0,n.tag){case 16:e:{var l=n.pendingProps;if(t=Os(n.elementType),n.type=t,typeof t=="function")jh(t)?(l=js(t,l),n.tag=1,n=ev(null,n,t,l,s)):(n.tag=0,n=Ed(null,n,t,l,s));else{if(t!=null){var g=t.$$typeof;if(g===T){n.tag=11,n=K_(null,n,t,l,s);break e}else if(g===M){n.tag=14,n=V_(null,n,t,l,s);break e}}throw n=G(t)||t,Error(a(306,n,""))}}return n;case 0:return Ed(t,n,n.type,n.pendingProps,s);case 1:return l=n.type,g=js(l,n.pendingProps),ev(t,n,l,g,s);case 3:e:{if($(n,n.stateNode.containerInfo),t===null)throw Error(a(387));l=n.pendingProps;var w=n.memoizedState;g=w.element,Jh(t,n),No(n,l,null,s);var D=n.memoizedState;if(l=D.cache,qr(n,ri,l),l!==w.cache&&Gh(n,[ri],s,!0),Oo(),l=D.element,w.isDehydrated)if(w={element:l,isDehydrated:!1,cache:D.cache},n.updateQueue.baseState=w,n.memoizedState=w,n.flags&256){n=tv(t,n,l,s);break e}else if(l!==g){g=mn(Error(a(424)),n),Ao(g),n=tv(t,n,l,s);break e}else for(t=n.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,kt=Sn(t.firstChild),Si=n,rt=!0,Ur=null,bn=!0,s=Xm(n,null,l,s),n.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(Rs(),l===g){n=br(t,n,s);break e}Ci(t,n,l,s)}n=n.child}return n;case 26:return Ac(t,n),t===null?(s=m0(n.type,null,n.pendingProps,null))?n.memoizedState=s:rt||(s=n.type,t=n.pendingProps,l=qc(_e.current).createElement(s),l[Tt]=n,l[xt]=t,xi(l,s,t),Ye(l),n.stateNode=l):n.memoizedState=m0(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return ge(n),t===null&&rt&&(l=n.stateNode=f0(n.type,n.pendingProps,_e.current),Si=n,bn=!0,g=kt,ns(n.type)?(df=g,kt=Sn(l.firstChild)):kt=g),Ci(t,n,n.pendingProps.children,s),Ac(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&rt&&((g=l=kt)&&(l=Kx(l,n.type,n.pendingProps,bn),l!==null?(n.stateNode=l,Si=n,kt=Sn(l.firstChild),bn=!1,g=!0):g=!1),g||Fr(n)),ge(n),g=n.type,w=n.pendingProps,D=t!==null?t.memoizedProps:null,l=w.children,of(g,w)?l=null:D!==null&&of(g,D)&&(n.flags|=32),n.memoizedState!==null&&(g=sd(t,n,lx,null,null,s),el._currentValue=g),Ac(t,n),Ci(t,n,l,s),n.child;case 6:return t===null&&rt&&((t=s=kt)&&(s=Vx(s,n.pendingProps,bn),s!==null?(n.stateNode=s,Si=n,kt=null,t=!0):t=!1),t||Fr(n)),null;case 13:return iv(t,n,s);case 4:return $(n,n.stateNode.containerInfo),l=n.pendingProps,t===null?n.child=Bs(n,null,l,s):Ci(t,n,l,s),n.child;case 11:return K_(t,n,n.type,n.pendingProps,s);case 7:return Ci(t,n,n.pendingProps,s),n.child;case 8:return Ci(t,n,n.pendingProps.children,s),n.child;case 12:return Ci(t,n,n.pendingProps.children,s),n.child;case 10:return l=n.pendingProps,qr(n,n.type,l.value),Ci(t,n,l.children,s),n.child;case 9:return g=n.type._context,l=n.pendingProps.children,Ms(n),g=wi(g),l=l(g),n.flags|=1,Ci(t,n,l,s),n.child;case 14:return V_(t,n,n.type,n.pendingProps,s);case 15:return Y_(t,n,n.type,n.pendingProps,s);case 19:return rv(t,n,s);case 31:return mx(t,n,s);case 22:return X_(t,n,s,n.pendingProps);case 24:return Ms(n),l=wi(ri),t===null?(g=Yh(),g===null&&(g=wt,w=Kh(),g.pooledCache=w,w.refCount++,w!==null&&(g.pooledCacheLanes|=s),g=w),n.memoizedState={parent:l,cache:g},Zh(n),qr(n,ri,g)):((t.lanes&s)!==0&&(Jh(t,n),No(n,null,null,s),Oo()),g=t.memoizedState,w=n.memoizedState,g.parent!==l?(g={parent:l,cache:l},n.memoizedState=g,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=g),qr(n,ri,l)):(l=w.cache,qr(n,ri,l),l!==g.cache&&Gh(n,[ri],s,!0))),Ci(t,n,n.pendingProps.children,s),n.child;case 29:throw n.pendingProps}throw Error(a(156,n.tag))}function yr(t){t.flags|=4}function Od(t,n,s,l,g){if((n=(t.mode&32)!==0)&&(n=!1),n){if(t.flags|=16777216,(g&335544128)===g)if(t.stateNode.complete)t.flags|=8192;else if(Dv())t.flags|=8192;else throw Ns=dc,Xh}else t.flags&=-16777217}function av(t,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!S0(n))if(Dv())t.flags|=8192;else throw Ns=dc,Xh}function Rc(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?Ie():536870912,t.lanes|=n,Da|=n)}function Ho(t,n){if(!rt)switch(t.tailMode){case"hidden":n=t.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t.tail=null:s.sibling=null;break;case"collapsed":s=t.tail;for(var l=null;s!==null;)s.alternate!==null&&(l=s),s=s.sibling;l===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:l.sibling=null}}function Rt(t){var n=t.alternate!==null&&t.alternate.child===t.child,s=0,l=0;if(n)for(var g=t.child;g!==null;)s|=g.lanes|g.childLanes,l|=g.subtreeFlags&65011712,l|=g.flags&65011712,g.return=t,g=g.sibling;else for(g=t.child;g!==null;)s|=g.lanes|g.childLanes,l|=g.subtreeFlags,l|=g.flags,g.return=t,g=g.sibling;return t.subtreeFlags|=l,t.childLanes=s,n}function vx(t,n,s){var l=n.pendingProps;switch(Ph(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Rt(n),null;case 1:return Rt(n),null;case 3:return s=n.stateNode,l=null,t!==null&&(l=t.memoizedState.cache),n.memoizedState.cache!==l&&(n.flags|=2048),mr(ri),oe(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(t===null||t.child===null)&&(ba(n)?yr(n):t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Fh())),Rt(n),null;case 26:var g=n.type,w=n.memoizedState;return t===null?(yr(n),w!==null?(Rt(n),av(n,w)):(Rt(n),Od(n,g,null,l,s))):w?w!==t.memoizedState?(yr(n),Rt(n),av(n,w)):(Rt(n),n.flags&=-16777217):(t=t.memoizedProps,t!==l&&yr(n),Rt(n),Od(n,g,t,l,s)),null;case 27:if(Se(n),s=_e.current,g=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==l&&yr(n);else{if(!l){if(n.stateNode===null)throw Error(a(166));return Rt(n),null}t=ae.current,ba(n)?$m(n):(t=f0(g,l,s),n.stateNode=t,yr(n))}return Rt(n),null;case 5:if(Se(n),g=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==l&&yr(n);else{if(!l){if(n.stateNode===null)throw Error(a(166));return Rt(n),null}if(w=ae.current,ba(n))$m(n);else{var D=qc(_e.current);switch(w){case 1:w=D.createElementNS("http://www.w3.org/2000/svg",g);break;case 2:w=D.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;default:switch(g){case"svg":w=D.createElementNS("http://www.w3.org/2000/svg",g);break;case"math":w=D.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;case"script":w=D.createElement("div"),w.innerHTML="<script><\/script>",w=w.removeChild(w.firstChild);break;case"select":w=typeof l.is=="string"?D.createElement("select",{is:l.is}):D.createElement("select"),l.multiple?w.multiple=!0:l.size&&(w.size=l.size);break;default:w=typeof l.is=="string"?D.createElement(g,{is:l.is}):D.createElement(g)}}w[Tt]=n,w[xt]=l;e:for(D=n.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===n)break e;for(;D.sibling===null;){if(D.return===null||D.return===n)break e;D=D.return}D.sibling.return=D.return,D=D.sibling}n.stateNode=w;e:switch(xi(w,g,l),g){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&yr(n)}}return Rt(n),Od(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,s),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==l&&yr(n);else{if(typeof l!="string"&&n.stateNode===null)throw Error(a(166));if(t=_e.current,ba(n)){if(t=n.stateNode,s=n.memoizedProps,l=null,g=Si,g!==null)switch(g.tag){case 27:case 5:l=g.memoizedProps}t[Tt]=n,t=!!(t.nodeValue===s||l!==null&&l.suppressHydrationWarning===!0||i0(t.nodeValue,s)),t||Fr(n,!0)}else t=qc(t).createTextNode(l),t[Tt]=n,n.stateNode=t}return Rt(n),null;case 31:if(s=n.memoizedState,t===null||t.memoizedState!==null){if(l=ba(n),s!==null){if(t===null){if(!l)throw Error(a(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(557));t[Tt]=n}else Rs(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Rt(n),t=!1}else s=Fh(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=s),t=!0;if(!t)return n.flags&256?(on(n),n):(on(n),null);if((n.flags&128)!==0)throw Error(a(558))}return Rt(n),null;case 13:if(l=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(g=ba(n),l!==null&&l.dehydrated!==null){if(t===null){if(!g)throw Error(a(318));if(g=n.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(a(317));g[Tt]=n}else Rs(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Rt(n),g=!1}else g=Fh(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=g),g=!0;if(!g)return n.flags&256?(on(n),n):(on(n),null)}return on(n),(n.flags&128)!==0?(n.lanes=s,n):(s=l!==null,t=t!==null&&t.memoizedState!==null,s&&(l=n.child,g=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(g=l.alternate.memoizedState.cachePool.pool),w=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(w=l.memoizedState.cachePool.pool),w!==g&&(l.flags|=2048)),s!==t&&s&&(n.child.flags|=8192),Rc(n,n.updateQueue),Rt(n),null);case 4:return oe(),t===null&&tf(n.stateNode.containerInfo),Rt(n),null;case 10:return mr(n.type),Rt(n),null;case 19:if(H(Xt),l=n.memoizedState,l===null)return Rt(n),null;if(g=(n.flags&128)!==0,w=l.rendering,w===null)if(g)Ho(l,!1);else{if(Ft!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(w=mc(t),w!==null){for(n.flags|=128,Ho(l,!1),t=w.updateQueue,n.updateQueue=t,Rc(n,t),n.subtreeFlags=0,t=s,s=n.child;s!==null;)Nm(s,t),s=s.sibling;return Z(Xt,Xt.current&1|2),rt&&pr(n,l.treeForkCount),n.child}t=t.sibling}l.tail!==null&&ut()>Nc&&(n.flags|=128,g=!0,Ho(l,!1),n.lanes=4194304)}else{if(!g)if(t=mc(w),t!==null){if(n.flags|=128,g=!0,t=t.updateQueue,n.updateQueue=t,Rc(n,t),Ho(l,!0),l.tail===null&&l.tailMode==="hidden"&&!w.alternate&&!rt)return Rt(n),null}else 2*ut()-l.renderingStartTime>Nc&&s!==536870912&&(n.flags|=128,g=!0,Ho(l,!1),n.lanes=4194304);l.isBackwards?(w.sibling=n.child,n.child=w):(t=l.last,t!==null?t.sibling=w:n.child=w,l.last=w)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=ut(),t.sibling=null,s=Xt.current,Z(Xt,g?s&1|2:s&1),rt&&pr(n,l.treeForkCount),t):(Rt(n),null);case 22:case 23:return on(n),id(),l=n.memoizedState!==null,t!==null?t.memoizedState!==null!==l&&(n.flags|=8192):l&&(n.flags|=8192),l?(s&536870912)!==0&&(n.flags&128)===0&&(Rt(n),n.subtreeFlags&6&&(n.flags|=8192)):Rt(n),s=n.updateQueue,s!==null&&Rc(n,s.retryQueue),s=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),l=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),l!==s&&(n.flags|=2048),t!==null&&H(Ds),null;case 24:return s=null,t!==null&&(s=t.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),mr(ri),Rt(n),null;case 25:return null;case 30:return null}throw Error(a(156,n.tag))}function bx(t,n){switch(Ph(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return mr(ri),oe(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return Se(n),null;case 31:if(n.memoizedState!==null){if(on(n),n.alternate===null)throw Error(a(340));Rs()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(on(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(a(340));Rs()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return H(Xt),null;case 4:return oe(),null;case 10:return mr(n.type),null;case 22:case 23:return on(n),id(),t!==null&&H(Ds),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return mr(ri),null;case 25:return null;default:return null}}function ov(t,n){switch(Ph(n),n.tag){case 3:mr(ri),oe();break;case 26:case 27:case 5:Se(n);break;case 4:oe();break;case 31:n.memoizedState!==null&&on(n);break;case 13:on(n);break;case 19:H(Xt);break;case 10:mr(n.type);break;case 22:case 23:on(n),id(),t!==null&&H(Ds);break;case 24:mr(ri)}}function Po(t,n){try{var s=n.updateQueue,l=s!==null?s.lastEffect:null;if(l!==null){var g=l.next;s=g;do{if((s.tag&t)===t){l=void 0;var w=s.create,D=s.inst;l=w(),D.destroy=l}s=s.next}while(s!==g)}}catch(j){mt(n,n.return,j)}}function Xr(t,n,s){try{var l=n.updateQueue,g=l!==null?l.lastEffect:null;if(g!==null){var w=g.next;l=w;do{if((l.tag&t)===t){var D=l.inst,j=D.destroy;if(j!==void 0){D.destroy=void 0,g=n;var Y=s,re=j;try{re()}catch(ue){mt(g,Y,ue)}}}l=l.next}while(l!==w)}}catch(ue){mt(n,n.return,ue)}}function lv(t){var n=t.updateQueue;if(n!==null){var s=t.stateNode;try{Jm(n,s)}catch(l){mt(t,t.return,l)}}}function cv(t,n,s){s.props=js(t.type,t.memoizedProps),s.state=t.memoizedState;try{s.componentWillUnmount()}catch(l){mt(t,n,l)}}function Uo(t,n){try{var s=t.ref;if(s!==null){switch(t.tag){case 26:case 27:case 5:var l=t.stateNode;break;case 30:l=t.stateNode;break;default:l=t.stateNode}typeof s=="function"?t.refCleanup=s(l):s.current=l}}catch(g){mt(t,n,g)}}function Yn(t,n){var s=t.ref,l=t.refCleanup;if(s!==null)if(typeof l=="function")try{l()}catch(g){mt(t,n,g)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(g){mt(t,n,g)}else s.current=null}function uv(t){var n=t.type,s=t.memoizedProps,l=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":s.autoFocus&&l.focus();break e;case"img":s.src?l.src=s.src:s.srcSet&&(l.srcset=s.srcSet)}}catch(g){mt(t,t.return,g)}}function Nd(t,n,s){try{var l=t.stateNode;Px(l,t.type,s,n),l[xt]=n}catch(g){mt(t,t.return,g)}}function hv(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&ns(t.type)||t.tag===4}function Bd(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||hv(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&&ns(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 Id(t,n,s){var l=t.tag;if(l===5||l===6)t=t.stateNode,n?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(t,n):(n=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,n.appendChild(t),s=s._reactRootContainer,s!=null||n.onclick!==null||(n.onclick=we));else if(l!==4&&(l===27&&ns(t.type)&&(s=t.stateNode,n=null),t=t.child,t!==null))for(Id(t,n,s),t=t.sibling;t!==null;)Id(t,n,s),t=t.sibling}function Lc(t,n,s){var l=t.tag;if(l===5||l===6)t=t.stateNode,n?s.insertBefore(t,n):s.appendChild(t);else if(l!==4&&(l===27&&ns(t.type)&&(s=t.stateNode),t=t.child,t!==null))for(Lc(t,n,s),t=t.sibling;t!==null;)Lc(t,n,s),t=t.sibling}function dv(t){var n=t.stateNode,s=t.memoizedProps;try{for(var l=t.type,g=n.attributes;g.length;)n.removeAttributeNode(g[0]);xi(n,l,s),n[Tt]=t,n[xt]=s}catch(w){mt(t,t.return,w)}}var Sr=!1,oi=!1,jd=!1,fv=typeof WeakSet=="function"?WeakSet:Set,di=null;function yx(t,n){if(t=t.containerInfo,sf=Zc,t=Em(t),Lh(t)){if("selectionStart"in t)var s={start:t.selectionStart,end:t.selectionEnd};else e:{s=(s=t.ownerDocument)&&s.defaultView||window;var l=s.getSelection&&s.getSelection();if(l&&l.rangeCount!==0){s=l.anchorNode;var g=l.anchorOffset,w=l.focusNode;l=l.focusOffset;try{s.nodeType,w.nodeType}catch{s=null;break e}var D=0,j=-1,Y=-1,re=0,ue=0,fe=t,se=null;t:for(;;){for(var le;fe!==s||g!==0&&fe.nodeType!==3||(j=D+g),fe!==w||l!==0&&fe.nodeType!==3||(Y=D+l),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===g&&(j=D),se===w&&++ue===l&&(Y=D),(le=fe.nextSibling)!==null)break;fe=se,se=fe.parentNode}fe=le}s=j===-1||Y===-1?null:{start:j,end:Y}}else s=null}s=s||{start:0,end:0}}else s=null;for(af={focusedElem:t,selectionRange:s},Zc=!1,di=n;di!==null;)if(n=di,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,di=t;else for(;di!==null;){switch(n=di,w=n.alternate,t=n.flags,n.tag){case 0:if((t&4)!==0&&(t=n.updateQueue,t=t!==null?t.events:null,t!==null))for(s=0;s<t.length;s++)g=t[s],g.ref.impl=g.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&w!==null){t=void 0,s=n,g=w.memoizedProps,w=w.memoizedState,l=s.stateNode;try{var Te=js(s.type,g);t=l.getSnapshotBeforeUpdate(Te,w),l.__reactInternalSnapshotBeforeUpdate=t}catch(ze){mt(s,s.return,ze)}}break;case 3:if((t&1024)!==0){if(t=n.stateNode.containerInfo,s=t.nodeType,s===9)cf(t);else if(s===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":cf(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=n.sibling,t!==null){t.return=n.return,di=t;break}di=n.return}}function pv(t,n,s){var l=s.flags;switch(s.tag){case 0:case 11:case 15:Cr(t,s),l&4&&Po(5,s);break;case 1:if(Cr(t,s),l&4)if(t=s.stateNode,n===null)try{t.componentDidMount()}catch(D){mt(s,s.return,D)}else{var g=js(s.type,n.memoizedProps);n=n.memoizedState;try{t.componentDidUpdate(g,n,t.__reactInternalSnapshotBeforeUpdate)}catch(D){mt(s,s.return,D)}}l&64&&lv(s),l&512&&Uo(s,s.return);break;case 3:if(Cr(t,s),l&64&&(t=s.updateQueue,t!==null)){if(n=null,s.child!==null)switch(s.child.tag){case 27:case 5:n=s.child.stateNode;break;case 1:n=s.child.stateNode}try{Jm(t,n)}catch(D){mt(s,s.return,D)}}break;case 27:n===null&&l&4&&dv(s);case 26:case 5:Cr(t,s),n===null&&l&4&&uv(s),l&512&&Uo(s,s.return);break;case 12:Cr(t,s);break;case 31:Cr(t,s),l&4&&_v(t,s);break;case 13:Cr(t,s),l&4&&vv(t,s),l&64&&(t=s.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(s=Rx.bind(null,s),Yx(t,s))));break;case 22:if(l=s.memoizedState!==null||Sr,!l){n=n!==null&&n.memoizedState!==null||oi,g=Sr;var w=oi;Sr=l,(oi=n)&&!w?xr(t,s,(s.subtreeFlags&8772)!==0):Cr(t,s),Sr=g,oi=w}break;case 30:break;default:Cr(t,s)}}function gv(t){var n=t.alternate;n!==null&&(t.alternate=null,gv(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&De(n)),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 Ot=null,Wi=!1;function wr(t,n,s){for(s=s.child;s!==null;)mv(t,n,s),s=s.sibling}function mv(t,n,s){if(Vt&&typeof Vt.onCommitFiberUnmount=="function")try{Vt.onCommitFiberUnmount(Hi,s)}catch{}switch(s.tag){case 26:oi||Yn(s,n),wr(t,n,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:oi||Yn(s,n);var l=Ot,g=Wi;ns(s.type)&&(Ot=s.stateNode,Wi=!1),wr(t,n,s),Zo(s.stateNode),Ot=l,Wi=g;break;case 5:oi||Yn(s,n);case 6:if(l=Ot,g=Wi,Ot=null,wr(t,n,s),Ot=l,Wi=g,Ot!==null)if(Wi)try{(Ot.nodeType===9?Ot.body:Ot.nodeName==="HTML"?Ot.ownerDocument.body:Ot).removeChild(s.stateNode)}catch(w){mt(s,n,w)}else try{Ot.removeChild(s.stateNode)}catch(w){mt(s,n,w)}break;case 18:Ot!==null&&(Wi?(t=Ot,l0(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,s.stateNode),Ha(t)):l0(Ot,s.stateNode));break;case 4:l=Ot,g=Wi,Ot=s.stateNode.containerInfo,Wi=!0,wr(t,n,s),Ot=l,Wi=g;break;case 0:case 11:case 14:case 15:Xr(2,s,n),oi||Xr(4,s,n),wr(t,n,s);break;case 1:oi||(Yn(s,n),l=s.stateNode,typeof l.componentWillUnmount=="function"&&cv(s,n,l)),wr(t,n,s);break;case 21:wr(t,n,s);break;case 22:oi=(l=oi)||s.memoizedState!==null,wr(t,n,s),oi=l;break;default:wr(t,n,s)}}function _v(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Ha(t)}catch(s){mt(n,n.return,s)}}}function vv(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Ha(t)}catch(s){mt(n,n.return,s)}}function Sx(t){switch(t.tag){case 31:case 13:case 19:var n=t.stateNode;return n===null&&(n=t.stateNode=new fv),n;case 22:return t=t.stateNode,n=t._retryCache,n===null&&(n=t._retryCache=new fv),n;default:throw Error(a(435,t.tag))}}function Mc(t,n){var s=Sx(t);n.forEach(function(l){if(!s.has(l)){s.add(l);var g=Lx.bind(null,t,l);l.then(g,g)}})}function Gi(t,n){var s=n.deletions;if(s!==null)for(var l=0;l<s.length;l++){var g=s[l],w=t,D=n,j=D;e:for(;j!==null;){switch(j.tag){case 27:if(ns(j.type)){Ot=j.stateNode,Wi=!1;break e}break;case 5:Ot=j.stateNode,Wi=!1;break e;case 3:case 4:Ot=j.stateNode.containerInfo,Wi=!0;break e}j=j.return}if(Ot===null)throw Error(a(160));mv(w,D,g),Ot=null,Wi=!1,w=g.alternate,w!==null&&(w.return=null),g.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)bv(n,t),n=n.sibling}var In=null;function bv(t,n){var s=t.alternate,l=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Gi(n,t),Ki(t),l&4&&(Xr(3,t,t.return),Po(3,t),Xr(5,t,t.return));break;case 1:Gi(n,t),Ki(t),l&512&&(oi||s===null||Yn(s,s.return)),l&64&&Sr&&(t=t.updateQueue,t!==null&&(l=t.callbacks,l!==null&&(s=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=s===null?l:s.concat(l))));break;case 26:var g=In;if(Gi(n,t),Ki(t),l&512&&(oi||s===null||Yn(s,s.return)),l&4){var w=s!==null?s.memoizedState:null;if(l=t.memoizedState,s===null)if(l===null)if(t.stateNode===null){e:{l=t.type,s=t.memoizedProps,g=g.ownerDocument||g;t:switch(l){case"title":w=g.getElementsByTagName("title")[0],(!w||w[Gn]||w[Tt]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=g.createElement(l),g.head.insertBefore(w,g.querySelector("head > title"))),xi(w,l,s),w[Tt]=t,Ye(w),l=w;break e;case"link":var D=b0("link","href",g).get(l+(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=g.createElement(l),xi(w,l,s),g.head.appendChild(w);break;case"meta":if(D=b0("meta","content",g).get(l+(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=g.createElement(l),xi(w,l,s),g.head.appendChild(w);break;default:throw Error(a(468,l))}w[Tt]=t,Ye(w),l=w}t.stateNode=l}else y0(g,t.type,t.stateNode);else t.stateNode=v0(g,l,t.memoizedProps);else w!==l?(w===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):w.count--,l===null?y0(g,t.type,t.stateNode):v0(g,l,t.memoizedProps)):l===null&&t.stateNode!==null&&Nd(t,t.memoizedProps,s.memoizedProps)}break;case 27:Gi(n,t),Ki(t),l&512&&(oi||s===null||Yn(s,s.return)),s!==null&&l&4&&Nd(t,t.memoizedProps,s.memoizedProps);break;case 5:if(Gi(n,t),Ki(t),l&512&&(oi||s===null||Yn(s,s.return)),t.flags&32){g=t.stateNode;try{He(g,"")}catch(Te){mt(t,t.return,Te)}}l&4&&t.stateNode!=null&&(g=t.memoizedProps,Nd(t,g,s!==null?s.memoizedProps:g)),l&1024&&(jd=!0);break;case 6:if(Gi(n,t),Ki(t),l&4){if(t.stateNode===null)throw Error(a(162));l=t.memoizedProps,s=t.stateNode;try{s.nodeValue=l}catch(Te){mt(t,t.return,Te)}}break;case 3:if(Kc=null,g=In,In=Wc(n.containerInfo),Gi(n,t),In=g,Ki(t),l&4&&s!==null&&s.memoizedState.isDehydrated)try{Ha(n.containerInfo)}catch(Te){mt(t,t.return,Te)}jd&&(jd=!1,yv(t));break;case 4:l=In,In=Wc(t.stateNode.containerInfo),Gi(n,t),Ki(t),In=l;break;case 12:Gi(n,t),Ki(t);break;case 31:Gi(n,t),Ki(t),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,Mc(t,l)));break;case 13:Gi(n,t),Ki(t),t.child.flags&8192&&t.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Oc=ut()),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,Mc(t,l)));break;case 22:g=t.memoizedState!==null;var Y=s!==null&&s.memoizedState!==null,re=Sr,ue=oi;if(Sr=re||g,oi=ue||Y,Gi(n,t),oi=ue,Sr=re,Ki(t),l&8192)e:for(n=t.stateNode,n._visibility=g?n._visibility&-2:n._visibility|1,g&&(s===null||Y||Sr||oi||zs(t)),s=null,n=t;;){if(n.tag===5||n.tag===26){if(s===null){Y=s=n;try{if(w=Y.stateNode,g)D=w.style,typeof D.setProperty=="function"?D.setProperty("display","none","important"):D.display="none";else{j=Y.stateNode;var fe=Y.memoizedProps.style,se=fe!=null&&fe.hasOwnProperty("display")?fe.display:null;j.style.display=se==null||typeof se=="boolean"?"":(""+se).trim()}}catch(Te){mt(Y,Y.return,Te)}}}else if(n.tag===6){if(s===null){Y=n;try{Y.stateNode.nodeValue=g?"":Y.memoizedProps}catch(Te){mt(Y,Y.return,Te)}}}else if(n.tag===18){if(s===null){Y=n;try{var le=Y.stateNode;g?c0(le,!0):c0(Y.stateNode,!1)}catch(Te){mt(Y,Y.return,Te)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===t)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break e;for(;n.sibling===null;){if(n.return===null||n.return===t)break e;s===n&&(s=null),n=n.return}s===n&&(s=null),n.sibling.return=n.return,n=n.sibling}l&4&&(l=t.updateQueue,l!==null&&(s=l.retryQueue,s!==null&&(l.retryQueue=null,Mc(t,s))));break;case 19:Gi(n,t),Ki(t),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,Mc(t,l)));break;case 30:break;case 21:break;default:Gi(n,t),Ki(t)}}function Ki(t){var n=t.flags;if(n&2){try{for(var s,l=t.return;l!==null;){if(hv(l)){s=l;break}l=l.return}if(s==null)throw Error(a(160));switch(s.tag){case 27:var g=s.stateNode,w=Bd(t);Lc(t,w,g);break;case 5:var D=s.stateNode;s.flags&32&&(He(D,""),s.flags&=-33);var j=Bd(t);Lc(t,j,D);break;case 3:case 4:var Y=s.stateNode.containerInfo,re=Bd(t);Id(t,re,Y);break;default:throw Error(a(161))}}catch(ue){mt(t,t.return,ue)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function yv(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var n=t;yv(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),t=t.sibling}}function Cr(t,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)pv(t,n.alternate,n),n=n.sibling}function zs(t){for(t=t.child;t!==null;){var n=t;switch(n.tag){case 0:case 11:case 14:case 15:Xr(4,n,n.return),zs(n);break;case 1:Yn(n,n.return);var s=n.stateNode;typeof s.componentWillUnmount=="function"&&cv(n,n.return,s),zs(n);break;case 27:Zo(n.stateNode);case 26:case 5:Yn(n,n.return),zs(n);break;case 22:n.memoizedState===null&&zs(n);break;case 30:zs(n);break;default:zs(n)}t=t.sibling}}function xr(t,n,s){for(s=s&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var l=n.alternate,g=t,w=n,D=w.flags;switch(w.tag){case 0:case 11:case 15:xr(g,w,s),Po(4,w);break;case 1:if(xr(g,w,s),l=w,g=l.stateNode,typeof g.componentDidMount=="function")try{g.componentDidMount()}catch(re){mt(l,l.return,re)}if(l=w,g=l.updateQueue,g!==null){var j=l.stateNode;try{var Y=g.shared.hiddenCallbacks;if(Y!==null)for(g.shared.hiddenCallbacks=null,g=0;g<Y.length;g++)Zm(Y[g],j)}catch(re){mt(l,l.return,re)}}s&&D&64&&lv(w),Uo(w,w.return);break;case 27:dv(w);case 26:case 5:xr(g,w,s),s&&l===null&&D&4&&uv(w),Uo(w,w.return);break;case 12:xr(g,w,s);break;case 31:xr(g,w,s),s&&D&4&&_v(g,w);break;case 13:xr(g,w,s),s&&D&4&&vv(g,w);break;case 22:w.memoizedState===null&&xr(g,w,s),Uo(w,w.return);break;case 30:break;default:xr(g,w,s)}n=n.sibling}}function zd(t,n){var s=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),t=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(t=n.memoizedState.cachePool.pool),t!==s&&(t!=null&&t.refCount++,s!=null&&ko(s))}function $d(t,n){t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&ko(t))}function jn(t,n,s,l){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Sv(t,n,s,l),n=n.sibling}function Sv(t,n,s,l){var g=n.flags;switch(n.tag){case 0:case 11:case 15:jn(t,n,s,l),g&2048&&Po(9,n);break;case 1:jn(t,n,s,l);break;case 3:jn(t,n,s,l),g&2048&&(t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&ko(t)));break;case 12:if(g&2048){jn(t,n,s,l),t=n.stateNode;try{var w=n.memoizedProps,D=w.id,j=w.onPostCommit;typeof j=="function"&&j(D,n.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(Y){mt(n,n.return,Y)}}else jn(t,n,s,l);break;case 31:jn(t,n,s,l);break;case 13:jn(t,n,s,l);break;case 23:break;case 22:w=n.stateNode,D=n.alternate,n.memoizedState!==null?w._visibility&2?jn(t,n,s,l):Fo(t,n):w._visibility&2?jn(t,n,s,l):(w._visibility|=2,Ra(t,n,s,l,(n.subtreeFlags&10256)!==0||!1)),g&2048&&zd(D,n);break;case 24:jn(t,n,s,l),g&2048&&$d(n.alternate,n);break;default:jn(t,n,s,l)}}function Ra(t,n,s,l,g){for(g=g&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var w=t,D=n,j=s,Y=l,re=D.flags;switch(D.tag){case 0:case 11:case 15:Ra(w,D,j,Y,g),Po(8,D);break;case 23:break;case 22:var ue=D.stateNode;D.memoizedState!==null?ue._visibility&2?Ra(w,D,j,Y,g):Fo(w,D):(ue._visibility|=2,Ra(w,D,j,Y,g)),g&&re&2048&&zd(D.alternate,D);break;case 24:Ra(w,D,j,Y,g),g&&re&2048&&$d(D.alternate,D);break;default:Ra(w,D,j,Y,g)}n=n.sibling}}function Fo(t,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var s=t,l=n,g=l.flags;switch(l.tag){case 22:Fo(s,l),g&2048&&zd(l.alternate,l);break;case 24:Fo(s,l),g&2048&&$d(l.alternate,l);break;default:Fo(s,l)}n=n.sibling}}var qo=8192;function La(t,n,s){if(t.subtreeFlags&qo)for(t=t.child;t!==null;)wv(t,n,s),t=t.sibling}function wv(t,n,s){switch(t.tag){case 26:La(t,n,s),t.flags&qo&&t.memoizedState!==null&&o2(s,In,t.memoizedState,t.memoizedProps);break;case 5:La(t,n,s);break;case 3:case 4:var l=In;In=Wc(t.stateNode.containerInfo),La(t,n,s),In=l;break;case 22:t.memoizedState===null&&(l=t.alternate,l!==null&&l.memoizedState!==null?(l=qo,qo=16777216,La(t,n,s),qo=l):La(t,n,s));break;default:La(t,n,s)}}function Cv(t){var n=t.alternate;if(n!==null&&(t=n.child,t!==null)){n.child=null;do n=t.sibling,t.sibling=null,t=n;while(t!==null)}}function Wo(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var s=0;s<n.length;s++){var l=n[s];di=l,Ev(l,t)}Cv(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)xv(t),t=t.sibling}function xv(t){switch(t.tag){case 0:case 11:case 15:Wo(t),t.flags&2048&&Xr(9,t,t.return);break;case 3:Wo(t);break;case 12:Wo(t);break;case 22:var n=t.stateNode;t.memoizedState!==null&&n._visibility&2&&(t.return===null||t.return.tag!==13)?(n._visibility&=-3,Dc(t)):Wo(t);break;default:Wo(t)}}function Dc(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var s=0;s<n.length;s++){var l=n[s];di=l,Ev(l,t)}Cv(t)}for(t=t.child;t!==null;){switch(n=t,n.tag){case 0:case 11:case 15:Xr(8,n,n.return),Dc(n);break;case 22:s=n.stateNode,s._visibility&2&&(s._visibility&=-3,Dc(n));break;default:Dc(n)}t=t.sibling}}function Ev(t,n){for(;di!==null;){var s=di;switch(s.tag){case 0:case 11:case 15:Xr(8,s,n);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var l=s.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:ko(s.memoizedState.cache)}if(l=s.child,l!==null)l.return=s,di=l;else e:for(s=t;di!==null;){l=di;var g=l.sibling,w=l.return;if(gv(l),l===s){di=null;break e}if(g!==null){g.return=w,di=g;break e}di=w}}}var wx={getCacheForType:function(t){var n=wi(ri),s=n.data.get(t);return s===void 0&&(s=t(),n.data.set(t,s)),s},cacheSignal:function(){return wi(ri).controller.signal}},Cx=typeof WeakMap=="function"?WeakMap:Map,ht=0,wt=null,Xe=null,tt=0,gt=0,ln=null,Zr=!1,Ma=!1,Hd=!1,Er=0,Ft=0,Jr=0,$s=0,Pd=0,cn=0,Da=0,Go=null,Vi=null,Ud=!1,Oc=0,Tv=0,Nc=1/0,Bc=null,Qr=null,hi=0,es=null,Oa=null,Tr=0,Fd=0,qd=null,Av=null,Ko=0,Wd=null;function un(){return(ht&2)!==0&&tt!==0?tt&-tt:P.T!==null?Zd():lr()}function kv(){if(cn===0)if((tt&536870912)===0||rt){var t=Wn;Wn<<=1,(Wn&3932160)===0&&(Wn=262144),cn=t}else cn=536870912;return t=an.current,t!==null&&(t.flags|=32),cn}function Yi(t,n,s){(t===wt&&(gt===2||gt===9)||t.cancelPendingCommit!==null)&&(Na(t,0),ts(t,tt,cn,!1)),ft(t,s),((ht&2)===0||t!==wt)&&(t===wt&&((ht&2)===0&&($s|=s),Ft===4&&ts(t,tt,cn,!1)),Xn(t))}function Rv(t,n,s){if((ht&6)!==0)throw Error(a(327));var l=!s&&(n&127)===0&&(n&t.expiredLanes)===0||he(t,n),g=l?Tx(t,n):Kd(t,n,!0),w=l;do{if(g===0){Ma&&!l&&ts(t,n,0,!1);break}else{if(s=t.current.alternate,w&&!xx(s)){g=Kd(t,n,!1),w=!1;continue}if(g===2){if(w=n,t.errorRecoveryDisabledLanes&w)var D=0;else D=t.pendingLanes&-536870913,D=D!==0?D:D&536870912?536870912:0;if(D!==0){n=D;e:{var j=t;g=Go;var Y=j.current.memoizedState.isDehydrated;if(Y&&(Na(j,D).flags|=256),D=Kd(j,D,!1),D!==2){if(Hd&&!Y){j.errorRecoveryDisabledLanes|=w,$s|=w,g=4;break e}w=Vi,Vi=g,w!==null&&(Vi===null?Vi=w:Vi.push.apply(Vi,w))}g=D}if(w=!1,g!==2)continue}}if(g===1){Na(t,0),ts(t,n,0,!0);break}e:{switch(l=t,w=g,w){case 0:case 1:throw Error(a(345));case 4:if((n&4194048)!==n)break;case 6:ts(l,n,cn,!Zr);break e;case 2:Vi=null;break;case 3:case 5:break;default:throw Error(a(329))}if((n&62914560)===n&&(g=Oc+300-ut(),10<g)){if(ts(l,n,cn,!Zr),J(l,0,!0)!==0)break e;Tr=n,l.timeoutHandle=a0(Lv.bind(null,l,s,Vi,Bc,Ud,n,cn,$s,Da,Zr,w,"Throttled",-0,0),g);break e}Lv(l,s,Vi,Bc,Ud,n,cn,$s,Da,Zr,w,null,-0,0)}}break}while(!0);Xn(t)}function Lv(t,n,s,l,g,w,D,j,Y,re,ue,fe,se,le){if(t.timeoutHandle=-1,fe=n.subtreeFlags,fe&8192||(fe&16785408)===16785408){fe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:we},wv(n,w,fe);var Te=(w&62914560)===w?Oc-ut():(w&4194048)===w?Tv-ut():0;if(Te=l2(fe,Te),Te!==null){Tr=w,t.cancelPendingCommit=Te(zv.bind(null,t,n,w,s,l,g,D,j,Y,ue,fe,null,se,le)),ts(t,w,D,!re);return}}zv(t,n,w,s,l,g,D,j,Y)}function xx(t){for(var n=t;;){var s=n.tag;if((s===0||s===11||s===15)&&n.flags&16384&&(s=n.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var l=0;l<s.length;l++){var g=s[l],w=g.getSnapshot;g=g.value;try{if(!rn(w(),g))return!1}catch{return!1}}if(s=n.child,n.subtreeFlags&16384&&s!==null)s.return=n,n=s;else{if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function ts(t,n,s,l){n&=~Pd,n&=~$s,t.suspendedLanes|=n,t.pingedLanes&=~n,l&&(t.warmLanes|=n),l=t.expirationTimes;for(var g=n;0<g;){var w=31-$t(g),D=1<<w;l[w]=-1,g&=~D}s!==0&&Ce(t,s,n)}function Ic(){return(ht&6)===0?(Vo(0),!1):!0}function Gd(){if(Xe!==null){if(gt===0)var t=Xe.return;else t=Xe,gr=Ls=null,ld(t),xa=null,Lo=0,t=Xe;for(;t!==null;)ov(t.alternate,t),t=t.return;Xe=null}}function Na(t,n){var s=t.timeoutHandle;s!==-1&&(t.timeoutHandle=-1,qx(s)),s=t.cancelPendingCommit,s!==null&&(t.cancelPendingCommit=null,s()),Tr=0,Gd(),wt=t,Xe=s=fr(t.current,null),tt=n,gt=0,ln=null,Zr=!1,Ma=he(t,n),Hd=!1,Da=cn=Pd=$s=Jr=Ft=0,Vi=Go=null,Ud=!1,(n&8)!==0&&(n|=n&32);var l=t.entangledLanes;if(l!==0)for(t=t.entanglements,l&=n;0<l;){var g=31-$t(l),w=1<<g;n|=t[g],l&=~w}return Er=n,nc(),s}function Mv(t,n){We=null,P.H=zo,n===Ca||n===hc?(n=Km(),gt=3):n===Xh?(n=Km(),gt=4):gt=n===xd?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,ln=n,Xe===null&&(Ft=1,Ec(t,mn(n,t.current)))}function Dv(){var t=an.current;return t===null?!0:(tt&4194048)===tt?yn===null:(tt&62914560)===tt||(tt&536870912)!==0?t===yn:!1}function Ov(){var t=P.H;return P.H=zo,t===null?zo:t}function Nv(){var t=P.A;return P.A=wx,t}function jc(){Ft=4,Zr||(tt&4194048)!==tt&&an.current!==null||(Ma=!0),(Jr&134217727)===0&&($s&134217727)===0||wt===null||ts(wt,tt,cn,!1)}function Kd(t,n,s){var l=ht;ht|=2;var g=Ov(),w=Nv();(wt!==t||tt!==n)&&(Bc=null,Na(t,n)),n=!1;var D=Ft;e:do try{if(gt!==0&&Xe!==null){var j=Xe,Y=ln;switch(gt){case 8:Gd(),D=6;break e;case 3:case 2:case 9:case 6:an.current===null&&(n=!0);var re=gt;if(gt=0,ln=null,Ba(t,j,Y,re),s&&Ma){D=0;break e}break;default:re=gt,gt=0,ln=null,Ba(t,j,Y,re)}}Ex(),D=Ft;break}catch(ue){Mv(t,ue)}while(!0);return n&&t.shellSuspendCounter++,gr=Ls=null,ht=l,P.H=g,P.A=w,Xe===null&&(wt=null,tt=0,nc()),D}function Ex(){for(;Xe!==null;)Bv(Xe)}function Tx(t,n){var s=ht;ht|=2;var l=Ov(),g=Nv();wt!==t||tt!==n?(Bc=null,Nc=ut()+500,Na(t,n)):Ma=he(t,n);e:do try{if(gt!==0&&Xe!==null){n=Xe;var w=ln;t:switch(gt){case 1:gt=0,ln=null,Ba(t,n,w,1);break;case 2:case 9:if(Wm(w)){gt=0,ln=null,Iv(n);break}n=function(){gt!==2&>!==9||wt!==t||(gt=7),Xn(t)},w.then(n,n);break e;case 3:gt=7;break e;case 4:gt=5;break e;case 7:Wm(w)?(gt=0,ln=null,Iv(n)):(gt=0,ln=null,Ba(t,n,w,7));break;case 5:var D=null;switch(Xe.tag){case 26:D=Xe.memoizedState;case 5:case 27:var j=Xe;if(D?S0(D):j.stateNode.complete){gt=0,ln=null;var Y=j.sibling;if(Y!==null)Xe=Y;else{var re=j.return;re!==null?(Xe=re,zc(re)):Xe=null}break t}}gt=0,ln=null,Ba(t,n,w,5);break;case 6:gt=0,ln=null,Ba(t,n,w,6);break;case 8:Gd(),Ft=6;break e;default:throw Error(a(462))}}Ax();break}catch(ue){Mv(t,ue)}while(!0);return gr=Ls=null,P.H=l,P.A=g,ht=s,Xe!==null?0:(wt=null,tt=0,nc(),Ft)}function Ax(){for(;Xe!==null&&!Mn();)Bv(Xe)}function Bv(t){var n=sv(t.alternate,t,Er);t.memoizedProps=t.pendingProps,n===null?zc(t):Xe=n}function Iv(t){var n=t,s=n.alternate;switch(n.tag){case 15:case 0:n=Q_(s,n,n.pendingProps,n.type,void 0,tt);break;case 11:n=Q_(s,n,n.pendingProps,n.type.render,n.ref,tt);break;case 5:ld(n);default:ov(s,n),n=Xe=Nm(n,Er),n=sv(s,n,Er)}t.memoizedProps=t.pendingProps,n===null?zc(t):Xe=n}function Ba(t,n,s,l){gr=Ls=null,ld(n),xa=null,Lo=0;var g=n.return;try{if(gx(t,g,n,s,tt)){Ft=1,Ec(t,mn(s,t.current)),Xe=null;return}}catch(w){if(g!==null)throw Xe=g,w;Ft=1,Ec(t,mn(s,t.current)),Xe=null;return}n.flags&32768?(rt||l===1?t=!0:Ma||(tt&536870912)!==0?t=!1:(Zr=t=!0,(l===2||l===9||l===3||l===6)&&(l=an.current,l!==null&&l.tag===13&&(l.flags|=16384))),jv(n,t)):zc(n)}function zc(t){var n=t;do{if((n.flags&32768)!==0){jv(n,Zr);return}t=n.return;var s=vx(n.alternate,n,Er);if(s!==null){Xe=s;return}if(n=n.sibling,n!==null){Xe=n;return}Xe=n=t}while(n!==null);Ft===0&&(Ft=5)}function jv(t,n){do{var s=bx(t.alternate,t);if(s!==null){s.flags&=32767,Xe=s;return}if(s=t.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!n&&(t=t.sibling,t!==null)){Xe=t;return}Xe=t=s}while(t!==null);Ft=6,Xe=null}function zv(t,n,s,l,g,w,D,j,Y){t.cancelPendingCommit=null;do $c();while(hi!==0);if((ht&6)!==0)throw Error(a(327));if(n!==null){if(n===t.current)throw Error(a(177));if(w=n.lanes|n.childLanes,w|=Bh,Ee(t,s,w,D,j,Y),t===wt&&(Xe=wt=null,tt=0),Oa=n,es=t,Tr=s,Fd=w,qd=g,Av=l,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,Mx(ti,function(){return Fv(),null})):(t.callbackNode=null,t.callbackPriority=0),l=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||l){l=P.T,P.T=null,g=V.p,V.p=2,D=ht,ht|=4;try{yx(t,n,s)}finally{ht=D,V.p=g,P.T=l}}hi=1,$v(),Hv(),Pv()}}function $v(){if(hi===1){hi=0;var t=es,n=Oa,s=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||s){s=P.T,P.T=null;var l=V.p;V.p=2;var g=ht;ht|=4;try{bv(n,t);var w=af,D=Em(t.containerInfo),j=w.focusedElem,Y=w.selectionRange;if(D!==j&&j&&j.ownerDocument&&xm(j.ownerDocument.documentElement,j)){if(Y!==null&&Lh(j)){var re=Y.start,ue=Y.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(),Te=j.textContent.length,ze=Math.min(Y.start,Te),bt=Y.end===void 0?ze:Math.min(Y.end,Te);!le.extend&&ze>bt&&(D=bt,bt=ze,ze=D);var ie=Cm(j,ze),ee=Cm(j,bt);if(ie&&ee&&(le.rangeCount!==1||le.anchorNode!==ie.node||le.anchorOffset!==ie.offset||le.focusNode!==ee.node||le.focusOffset!==ee.offset)){var ne=fe.createRange();ne.setStart(ie.node,ie.offset),le.removeAllRanges(),ze>bt?(le.addRange(ne),le.extend(ee.node,ee.offset)):(ne.setEnd(ee.node,ee.offset),le.addRange(ne))}}}}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}}Zc=!!sf,af=sf=null}finally{ht=g,V.p=l,P.T=s}}t.current=n,hi=2}}function Hv(){if(hi===2){hi=0;var t=es,n=Oa,s=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||s){s=P.T,P.T=null;var l=V.p;V.p=2;var g=ht;ht|=4;try{pv(t,n.alternate,n)}finally{ht=g,V.p=l,P.T=s}}hi=3}}function Pv(){if(hi===4||hi===3){hi=0,ei();var t=es,n=Oa,s=Tr,l=Av;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?hi=5:(hi=0,Oa=es=null,Uv(t,t.pendingLanes));var g=t.pendingLanes;if(g===0&&(Qr=null),bi(s),n=n.stateNode,Vt&&typeof Vt.onCommitFiberRoot=="function")try{Vt.onCommitFiberRoot(Hi,n,void 0,(n.current.flags&128)===128)}catch{}if(l!==null){n=P.T,g=V.p,V.p=2,P.T=null;try{for(var w=t.onRecoverableError,D=0;D<l.length;D++){var j=l[D];w(j.value,{componentStack:j.stack})}}finally{P.T=n,V.p=g}}(Tr&3)!==0&&$c(),Xn(t),g=t.pendingLanes,(s&261930)!==0&&(g&42)!==0?t===Wd?Ko++:(Ko=0,Wd=t):Ko=0,Vo(0)}}function Uv(t,n){(t.pooledCacheLanes&=n)===0&&(n=t.pooledCache,n!=null&&(t.pooledCache=null,ko(n)))}function $c(){return $v(),Hv(),Pv(),Fv()}function Fv(){if(hi!==5)return!1;var t=es,n=Fd;Fd=0;var s=bi(Tr),l=P.T,g=V.p;try{V.p=32>s?32:s,P.T=null,s=qd,qd=null;var w=es,D=Tr;if(hi=0,Oa=es=null,Tr=0,(ht&6)!==0)throw Error(a(331));var j=ht;if(ht|=4,xv(w.current),Sv(w,w.current,D,s),ht=j,Vo(0,!1),Vt&&typeof Vt.onPostCommitFiberRoot=="function")try{Vt.onPostCommitFiberRoot(Hi,w)}catch{}return!0}finally{V.p=g,P.T=l,Uv(t,n)}}function qv(t,n,s){n=mn(s,n),n=Cd(t.stateNode,n,2),t=Kr(t,n,2),t!==null&&(ft(t,2),Xn(t))}function mt(t,n,s){if(t.tag===3)qv(t,t,s);else for(;n!==null;){if(n.tag===3){qv(n,t,s);break}else if(n.tag===1){var l=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Qr===null||!Qr.has(l))){t=mn(s,t),s=W_(2),l=Kr(n,s,2),l!==null&&(G_(s,l,n,t),ft(l,2),Xn(l));break}}n=n.return}}function Vd(t,n,s){var l=t.pingCache;if(l===null){l=t.pingCache=new Cx;var g=new Set;l.set(n,g)}else g=l.get(n),g===void 0&&(g=new Set,l.set(n,g));g.has(s)||(Hd=!0,g.add(s),t=kx.bind(null,t,n,s),n.then(t,t))}function kx(t,n,s){var l=t.pingCache;l!==null&&l.delete(n),t.pingedLanes|=t.suspendedLanes&s,t.warmLanes&=~s,wt===t&&(tt&s)===s&&(Ft===4||Ft===3&&(tt&62914560)===tt&&300>ut()-Oc?(ht&2)===0&&Na(t,0):Pd|=s,Da===tt&&(Da=0)),Xn(t)}function Wv(t,n){n===0&&(n=Ie()),t=As(t,n),t!==null&&(ft(t,n),Xn(t))}function Rx(t){var n=t.memoizedState,s=0;n!==null&&(s=n.retryLane),Wv(t,s)}function Lx(t,n){var s=0;switch(t.tag){case 31:case 13:var l=t.stateNode,g=t.memoizedState;g!==null&&(s=g.retryLane);break;case 19:l=t.stateNode;break;case 22:l=t.stateNode._retryCache;break;default:throw Error(a(314))}l!==null&&l.delete(n),Wv(t,s)}function Mx(t,n){return vi(t,n)}var Hc=null,Ia=null,Yd=!1,Pc=!1,Xd=!1,is=0;function Xn(t){t!==Ia&&t.next===null&&(Ia===null?Hc=Ia=t:Ia=Ia.next=t),Pc=!0,Yd||(Yd=!0,Ox())}function Vo(t,n){if(!Xd&&Pc){Xd=!0;do for(var s=!1,l=Hc;l!==null;){if(t!==0){var g=l.pendingLanes;if(g===0)var w=0;else{var D=l.suspendedLanes,j=l.pingedLanes;w=(1<<31-$t(42|t)+1)-1,w&=g&~(D&~j),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(s=!0,Yv(l,w))}else w=tt,w=J(l,l===wt?w:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(w&3)===0||he(l,w)||(s=!0,Yv(l,w));l=l.next}while(s);Xd=!1}}function Dx(){Gv()}function Gv(){Pc=Yd=!1;var t=0;is!==0&&Fx()&&(t=is);for(var n=ut(),s=null,l=Hc;l!==null;){var g=l.next,w=Kv(l,n);w===0?(l.next=null,s===null?Hc=g:s.next=g,g===null&&(Ia=s)):(s=l,(t!==0||(w&3)!==0)&&(Pc=!0)),l=g}hi!==0&&hi!==5||Vo(t),is!==0&&(is=0)}function Kv(t,n){for(var s=t.suspendedLanes,l=t.pingedLanes,g=t.expirationTimes,w=t.pendingLanes&-62914561;0<w;){var D=31-$t(w),j=1<<D,Y=g[D];Y===-1?((j&s)===0||(j&l)!==0)&&(g[D]=ve(j,n)):Y<=n&&(t.expiredLanes|=j),w&=~j}if(n=wt,s=tt,s=J(t,t===n?s:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l=t.callbackNode,s===0||t===n&&(gt===2||gt===9)||t.cancelPendingCommit!==null)return l!==null&&l!==null&&fn(l),t.callbackNode=null,t.callbackPriority=0;if((s&3)===0||he(t,s)){if(n=s&-s,n===t.callbackPriority)return n;switch(l!==null&&fn(l),bi(s)){case 2:case 8:s=zt;break;case 32:s=ti;break;case 268435456:s=Ri;break;default:s=ti}return l=Vv.bind(null,t),s=vi(s,l),t.callbackPriority=n,t.callbackNode=s,n}return l!==null&&l!==null&&fn(l),t.callbackPriority=2,t.callbackNode=null,2}function Vv(t,n){if(hi!==0&&hi!==5)return t.callbackNode=null,t.callbackPriority=0,null;var s=t.callbackNode;if($c()&&t.callbackNode!==s)return null;var l=tt;return l=J(t,t===wt?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l===0?null:(Rv(t,l,n),Kv(t,ut()),t.callbackNode!=null&&t.callbackNode===s?Vv.bind(null,t):null)}function Yv(t,n){if($c())return null;Rv(t,n,!0)}function Ox(){Wx(function(){(ht&6)!==0?vi(jt,Dx):Gv()})}function Zd(){if(is===0){var t=Sa;t===0&&(t=On,On<<=1,(On&261888)===0&&(On=256)),is=t}return is}function Xv(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:$r(""+t)}function Zv(t,n){var s=n.ownerDocument.createElement("input");return s.name=n.name,s.value=n.value,t.id&&s.setAttribute("form",t.id),n.parentNode.insertBefore(s,n),t=new FormData(t),s.parentNode.removeChild(s),t}function Nx(t,n,s,l,g){if(n==="submit"&&s&&s.stateNode===g){var w=Xv((g[xt]||null).action),D=l.submitter;D&&(n=(n=D[xt]||null)?Xv(n.formAction):D.getAttribute("formAction"),n!==null&&(w=n,D=null));var j=new Ql("action","action",null,l,g);t.push({event:j,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(is!==0){var Y=D?Zv(g,D):new FormData(g);_d(s,{pending:!0,data:Y,method:g.method,action:w},null,Y)}}else typeof w=="function"&&(j.preventDefault(),Y=D?Zv(g,D):new FormData(g),_d(s,{pending:!0,data:Y,method:g.method,action:w},w,Y))},currentTarget:g}]})}}for(var Jd=0;Jd<Nh.length;Jd++){var Qd=Nh[Jd],Bx=Qd.toLowerCase(),Ix=Qd[0].toUpperCase()+Qd.slice(1);Bn(Bx,"on"+Ix)}Bn(km,"onAnimationEnd"),Bn(Rm,"onAnimationIteration"),Bn(Lm,"onAnimationStart"),Bn("dblclick","onDoubleClick"),Bn("focusin","onFocus"),Bn("focusout","onBlur"),Bn(JC,"onTransitionRun"),Bn(QC,"onTransitionStart"),Bn(ex,"onTransitionCancel"),Bn(Mm,"onTransitionEnd"),me("onMouseEnter",["mouseout","mouseover"]),me("onMouseLeave",["mouseout","mouseover"]),me("onPointerEnter",["pointerout","pointerover"]),me("onPointerLeave",["pointerout","pointerover"]),Pt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Pt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Pt("onBeforeInput",["compositionend","keypress","textInput","paste"]),Pt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Pt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Pt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Yo="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(" "),jx=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Yo));function Jv(t,n){n=(n&4)!==0;for(var s=0;s<t.length;s++){var l=t[s],g=l.event;l=l.listeners;e:{var w=void 0;if(n)for(var D=l.length-1;0<=D;D--){var j=l[D],Y=j.instance,re=j.currentTarget;if(j=j.listener,Y!==w&&g.isPropagationStopped())break e;w=j,g.currentTarget=re;try{w(g)}catch(ue){ic(ue)}g.currentTarget=null,w=Y}else for(D=0;D<l.length;D++){if(j=l[D],Y=j.instance,re=j.currentTarget,j=j.listener,Y!==w&&g.isPropagationStopped())break e;w=j,g.currentTarget=re;try{w(g)}catch(ue){ic(ue)}g.currentTarget=null,w=Y}}}}function Ze(t,n){var s=n[jr];s===void 0&&(s=n[jr]=new Set);var l=t+"__bubble";s.has(l)||(Qv(n,t,2,!1),s.add(l))}function ef(t,n,s){var l=0;n&&(l|=4),Qv(s,t,l,n)}var Uc="_reactListening"+Math.random().toString(36).slice(2);function tf(t){if(!t[Uc]){t[Uc]=!0,At.forEach(function(s){s!=="selectionchange"&&(jx.has(s)||ef(s,!1,t),ef(s,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[Uc]||(n[Uc]=!0,ef("selectionchange",!1,n))}}function Qv(t,n,s,l){switch(k0(n)){case 2:var g=h2;break;case 8:g=d2;break;default:g=_f}s=g.bind(null,n,s,t),g=void 0,!Sh||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(g=!0),l?g!==void 0?t.addEventListener(n,s,{capture:!0,passive:g}):t.addEventListener(n,s,!0):g!==void 0?t.addEventListener(n,s,{passive:g}):t.addEventListener(n,s,!1)}function nf(t,n,s,l,g){var w=l;if((n&1)===0&&(n&2)===0&&l!==null)e:for(;;){if(l===null)return;var D=l.tag;if(D===3||D===4){var j=l.stateNode.containerInfo;if(j===g)break;if(D===4)for(D=l.return;D!==null;){var Y=D.tag;if((Y===3||Y===4)&&D.stateNode.containerInfo===g)return;D=D.return}for(;j!==null;){if(D=K(j),D===null)return;if(Y=D.tag,Y===5||Y===6||Y===26||Y===27){l=w=D;continue e}j=j.parentNode}}l=l.return}Yl(function(){var re=w,ue=qe(s),fe=[];e:{var se=Dm.get(t);if(se!==void 0){var le=Ql,Te=t;switch(t){case"keypress":if(Zl(s)===0)break e;case"keydown":case"keyup":le=LC;break;case"focusin":Te="focus",le=Eh;break;case"focusout":Te="blur",le=Eh;break;case"beforeblur":case"afterblur":le=Eh;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=om;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":le=vC;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":le=OC;break;case km:case Rm:case Lm:le=SC;break;case Mm:le=BC;break;case"scroll":case"scrollend":le=mC;break;case"wheel":le=jC;break;case"copy":case"cut":case"paste":le=CC;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":le=cm;break;case"toggle":case"beforetoggle":le=$C}var ze=(n&4)!==0,bt=!ze&&(t==="scroll"||t==="scrollend"),ie=ze?se!==null?se+"Capture":null:se;ze=[];for(var ee=re,ne;ee!==null;){var de=ee;if(ne=de.stateNode,de=de.tag,de!==5&&de!==26&&de!==27||ne===null||ie===null||(de=_o(ee,ie),de!=null&&ze.push(Xo(ee,de,ne))),bt)break;ee=ee.return}0<ze.length&&(se=new le(se,Te,null,s,ue),fe.push({event:se,listeners:ze}))}}if((n&7)===0){e:{if(se=t==="mouseover"||t==="pointerover",le=t==="mouseout"||t==="pointerout",se&&s!==Re&&(Te=s.relatedTarget||s.fromElement)&&(K(Te)||Te[Nn]))break e;if((le||se)&&(se=ue.window===ue?ue:(se=ue.ownerDocument)?se.defaultView||se.parentWindow:window,le?(Te=s.relatedTarget||s.toElement,le=re,Te=Te?K(Te):null,Te!==null&&(bt=_(Te),ze=Te.tag,Te!==bt||ze!==5&&ze!==27&&ze!==6)&&(Te=null)):(le=null,Te=re),le!==Te)){if(ze=om,de="onMouseLeave",ie="onMouseEnter",ee="mouse",(t==="pointerout"||t==="pointerover")&&(ze=cm,de="onPointerLeave",ie="onPointerEnter",ee="pointer"),bt=le==null?se:xe(le),ne=Te==null?se:xe(Te),se=new ze(de,ee+"leave",le,s,ue),se.target=bt,se.relatedTarget=ne,de=null,K(ue)===re&&(ze=new ze(ie,ee+"enter",Te,s,ue),ze.target=ne,ze.relatedTarget=bt,de=ze),bt=de,le&&Te)t:{for(ze=zx,ie=le,ee=Te,ne=0,de=ie;de;de=ze(de))ne++;de=0;for(var Be=ee;Be;Be=ze(Be))de++;for(;0<ne-de;)ie=ze(ie),ne--;for(;0<de-ne;)ee=ze(ee),de--;for(;ne--;){if(ie===ee||ee!==null&&ie===ee.alternate){ze=ie;break t}ie=ze(ie),ee=ze(ee)}ze=null}else ze=null;le!==null&&e0(fe,se,le,ze,!1),Te!==null&&bt!==null&&e0(fe,bt,Te,ze,!0)}}e:{if(se=re?xe(re):window,le=se.nodeName&&se.nodeName.toLowerCase(),le==="select"||le==="input"&&se.type==="file")var at=_m;else if(gm(se))if(vm)at=YC;else{at=KC;var Le=GC}else le=se.nodeName,!le||le.toLowerCase()!=="input"||se.type!=="checkbox"&&se.type!=="radio"?re&&zr(re.elementType)&&(at=_m):at=VC;if(at&&(at=at(t,re))){mm(fe,at,s,ue);break e}Le&&Le(t,se,re),t==="focusout"&&re&&se.type==="number"&&re.memoizedProps.value!=null&&ua(se,"number",se.value)}switch(Le=re?xe(re):window,t){case"focusin":(gm(Le)||Le.contentEditable==="true")&&(fa=Le,Mh=re,Eo=null);break;case"focusout":Eo=Mh=fa=null;break;case"mousedown":Dh=!0;break;case"contextmenu":case"mouseup":case"dragend":Dh=!1,Tm(fe,s,ue);break;case"selectionchange":if(ZC)break;case"keydown":case"keyup":Tm(fe,s,ue)}var Ge;if(Ah)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 da?fm(t,s)&&(it="onCompositionEnd"):t==="keydown"&&s.keyCode===229&&(it="onCompositionStart");it&&(um&&s.locale!=="ko"&&(da||it!=="onCompositionStart"?it==="onCompositionEnd"&&da&&(Ge=sm()):(Hr=ue,wh="value"in Hr?Hr.value:Hr.textContent,da=!0)),Le=Fc(re,it),0<Le.length&&(it=new lm(it,t,null,s,ue),fe.push({event:it,listeners:Le}),Ge?it.data=Ge:(Ge=pm(s),Ge!==null&&(it.data=Ge)))),(Ge=PC?UC(t,s):FC(t,s))&&(it=Fc(re,"onBeforeInput"),0<it.length&&(Le=new lm("onBeforeInput","beforeinput",null,s,ue),fe.push({event:Le,listeners:it}),Le.data=Ge)),Nx(fe,t,re,s,ue)}Jv(fe,n)})}function Xo(t,n,s){return{instance:t,listener:n,currentTarget:s}}function Fc(t,n){for(var s=n+"Capture",l=[];t!==null;){var g=t,w=g.stateNode;if(g=g.tag,g!==5&&g!==26&&g!==27||w===null||(g=_o(t,s),g!=null&&l.unshift(Xo(t,g,w)),g=_o(t,n),g!=null&&l.push(Xo(t,g,w))),t.tag===3)return l;t=t.return}return[]}function zx(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function e0(t,n,s,l,g){for(var w=n._reactName,D=[];s!==null&&s!==l;){var j=s,Y=j.alternate,re=j.stateNode;if(j=j.tag,Y!==null&&Y===l)break;j!==5&&j!==26&&j!==27||re===null||(Y=re,g?(re=_o(s,w),re!=null&&D.unshift(Xo(s,re,Y))):g||(re=_o(s,w),re!=null&&D.push(Xo(s,re,Y)))),s=s.return}D.length!==0&&t.push({event:n,listeners:D})}var $x=/\r\n?/g,Hx=/\u0000|\uFFFD/g;function t0(t){return(typeof t=="string"?t:""+t).replace($x,`
|
|
9
|
+
`).replace(Hx,"")}function i0(t,n){return n=t0(n),t0(t)===n}function vt(t,n,s,l,g,w){switch(s){case"children":typeof l=="string"?n==="body"||n==="textarea"&&l===""||He(t,l):(typeof l=="number"||typeof l=="bigint")&&n!=="body"&&He(t,""+l);break;case"className":tn(t,"class",l);break;case"tabIndex":tn(t,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":tn(t,s,l);break;case"style":pt(t,l,w);break;case"data":if(n!=="object"){tn(t,"data",l);break}case"src":case"href":if(l===""&&(n!=="a"||s!=="href")){t.removeAttribute(s);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(s);break}l=$r(""+l),t.setAttribute(s,l);break;case"action":case"formAction":if(typeof l=="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"?(n!=="input"&&vt(t,n,"name",g.name,g,null),vt(t,n,"formEncType",g.formEncType,g,null),vt(t,n,"formMethod",g.formMethod,g,null),vt(t,n,"formTarget",g.formTarget,g,null)):(vt(t,n,"encType",g.encType,g,null),vt(t,n,"method",g.method,g,null),vt(t,n,"target",g.target,g,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(s);break}l=$r(""+l),t.setAttribute(s,l);break;case"onClick":l!=null&&(t.onclick=we);break;case"onScroll":l!=null&&Ze("scroll",t);break;case"onScrollEnd":l!=null&&Ze("scrollend",t);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(a(61));if(s=l.__html,s!=null){if(g.children!=null)throw Error(a(60));t.innerHTML=s}}break;case"multiple":t.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":t.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){t.removeAttribute("xlink:href");break}s=$r(""+l),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":l!=null&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(s,""+l):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":l&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(s,""):t.removeAttribute(s);break;case"capture":case"download":l===!0?t.setAttribute(s,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(s,l):t.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?t.setAttribute(s,l):t.removeAttribute(s);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?t.removeAttribute(s):t.setAttribute(s,l);break;case"popover":Ze("beforetoggle",t),Ze("toggle",t),Li(t,"popover",l);break;case"xlinkActuate":Ui(t,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Ui(t,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Ui(t,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Ui(t,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Ui(t,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Ui(t,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Ui(t,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Ui(t,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Ui(t,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Li(t,"is",l);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,Li(t,s,l))}}function rf(t,n,s,l,g,w){switch(s){case"style":pt(t,l,w);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(a(61));if(s=l.__html,s!=null){if(g.children!=null)throw Error(a(60));t.innerHTML=s}}break;case"children":typeof l=="string"?He(t,l):(typeof l=="number"||typeof l=="bigint")&&He(t,""+l);break;case"onScroll":l!=null&&Ze("scroll",t);break;case"onScrollEnd":l!=null&&Ze("scrollend",t);break;case"onClick":l!=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"&&(g=s.endsWith("Capture"),n=s.slice(2,g?s.length-7:void 0),w=t[xt]||null,w=w!=null?w[s]:null,typeof w=="function"&&t.removeEventListener(n,w,g),typeof l=="function")){typeof w!="function"&&w!==null&&(s in t?t[s]=null:t.hasAttribute(s)&&t.removeAttribute(s)),t.addEventListener(n,l,g);break e}s in t?t[s]=l:l===!0?t.setAttribute(s,""):Li(t,s,l)}}}function xi(t,n,s){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ze("error",t),Ze("load",t);var l=!1,g=!1,w;for(w in s)if(s.hasOwnProperty(w)){var D=s[w];if(D!=null)switch(w){case"src":l=!0;break;case"srcSet":g=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,n));default:vt(t,n,w,D,s,null)}}g&&vt(t,n,"srcSet",s.srcSet,s,null),l&&vt(t,n,"src",s.src,s,null);return;case"input":Ze("invalid",t);var j=w=D=g=null,Y=null,re=null;for(l in s)if(s.hasOwnProperty(l)){var ue=s[l];if(ue!=null)switch(l){case"name":g=ue;break;case"type":D=ue;break;case"checked":Y=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,n));break;default:vt(t,n,l,ue,s,null)}}Cs(t,w,j,Y,re,D,g,!1);return;case"select":Ze("invalid",t),l=D=w=null;for(g in s)if(s.hasOwnProperty(g)&&(j=s[g],j!=null))switch(g){case"value":w=j;break;case"defaultValue":D=j;break;case"multiple":l=j;default:vt(t,n,g,j,s,null)}n=w,s=D,t.multiple=!!l,n!=null?yi(t,!!l,n,!1):s!=null&&yi(t,!!l,s,!0);return;case"textarea":Ze("invalid",t),w=g=l=null;for(D in s)if(s.hasOwnProperty(D)&&(j=s[D],j!=null))switch(D){case"value":l=j;break;case"defaultValue":g=j;break;case"children":w=j;break;case"dangerouslySetInnerHTML":if(j!=null)throw Error(a(91));break;default:vt(t,n,D,j,s,null)}ha(t,l,g,w);return;case"option":for(Y in s)s.hasOwnProperty(Y)&&(l=s[Y],l!=null)&&(Y==="selected"?t.selected=l&&typeof l!="function"&&typeof l!="symbol":vt(t,n,Y,l,s,null));return;case"dialog":Ze("beforetoggle",t),Ze("toggle",t),Ze("cancel",t),Ze("close",t);break;case"iframe":case"object":Ze("load",t);break;case"video":case"audio":for(l=0;l<Yo.length;l++)Ze(Yo[l],t);break;case"image":Ze("error",t),Ze("load",t);break;case"details":Ze("toggle",t);break;case"embed":case"source":case"link":Ze("error",t),Ze("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)&&(l=s[re],l!=null))switch(re){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,n));default:vt(t,n,re,l,s,null)}return;default:if(zr(n)){for(ue in s)s.hasOwnProperty(ue)&&(l=s[ue],l!==void 0&&rf(t,n,ue,l,s,void 0));return}}for(j in s)s.hasOwnProperty(j)&&(l=s[j],l!=null&&vt(t,n,j,l,s,null))}function Px(t,n,s,l){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var g=null,w=null,D=null,j=null,Y=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":Y=fe;default:l.hasOwnProperty(le)||vt(t,n,le,null,l,fe)}}for(var se in l){var le=l[se];if(fe=s[se],l.hasOwnProperty(se)&&(le!=null||fe!=null))switch(se){case"type":w=le;break;case"name":g=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,n));break;default:le!==fe&&vt(t,n,se,le,l,fe)}}po(t,D,j,Y,re,ue,w,g);return;case"select":le=D=j=se=null;for(w in s)if(Y=s[w],s.hasOwnProperty(w)&&Y!=null)switch(w){case"value":break;case"multiple":le=Y;default:l.hasOwnProperty(w)||vt(t,n,w,null,l,Y)}for(g in l)if(w=l[g],Y=s[g],l.hasOwnProperty(g)&&(w!=null||Y!=null))switch(g){case"value":se=w;break;case"defaultValue":j=w;break;case"multiple":D=w;default:w!==Y&&vt(t,n,g,w,l,Y)}n=j,s=D,l=le,se!=null?yi(t,!!s,se,!1):!!l!=!!s&&(n!=null?yi(t,!!s,n,!0):yi(t,!!s,s?[]:"",!1));return;case"textarea":le=se=null;for(j in s)if(g=s[j],s.hasOwnProperty(j)&&g!=null&&!l.hasOwnProperty(j))switch(j){case"value":break;case"children":break;default:vt(t,n,j,null,l,g)}for(D in l)if(g=l[D],w=s[D],l.hasOwnProperty(D)&&(g!=null||w!=null))switch(D){case"value":se=g;break;case"defaultValue":le=g;break;case"children":break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(a(91));break;default:g!==w&&vt(t,n,D,g,l,w)}Kl(t,se,le);return;case"option":for(var Te in s)se=s[Te],s.hasOwnProperty(Te)&&se!=null&&!l.hasOwnProperty(Te)&&(Te==="selected"?t.selected=!1:vt(t,n,Te,null,l,se));for(Y in l)se=l[Y],le=s[Y],l.hasOwnProperty(Y)&&se!==le&&(se!=null||le!=null)&&(Y==="selected"?t.selected=se&&typeof se!="function"&&typeof se!="symbol":vt(t,n,Y,se,l,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 ze in s)se=s[ze],s.hasOwnProperty(ze)&&se!=null&&!l.hasOwnProperty(ze)&&vt(t,n,ze,null,l,se);for(re in l)if(se=l[re],le=s[re],l.hasOwnProperty(re)&&se!==le&&(se!=null||le!=null))switch(re){case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(a(137,n));break;default:vt(t,n,re,se,l,le)}return;default:if(zr(n)){for(var bt in s)se=s[bt],s.hasOwnProperty(bt)&&se!==void 0&&!l.hasOwnProperty(bt)&&rf(t,n,bt,void 0,l,se);for(ue in l)se=l[ue],le=s[ue],!l.hasOwnProperty(ue)||se===le||se===void 0&&le===void 0||rf(t,n,ue,se,l,le);return}}for(var ie in s)se=s[ie],s.hasOwnProperty(ie)&&se!=null&&!l.hasOwnProperty(ie)&&vt(t,n,ie,null,l,se);for(fe in l)se=l[fe],le=s[fe],!l.hasOwnProperty(fe)||se===le||se==null&&le==null||vt(t,n,fe,se,l,le)}function n0(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Ux(){if(typeof performance.getEntriesByType=="function"){for(var t=0,n=0,s=performance.getEntriesByType("resource"),l=0;l<s.length;l++){var g=s[l],w=g.transferSize,D=g.initiatorType,j=g.duration;if(w&&j&&n0(D)){for(D=0,j=g.responseEnd,l+=1;l<s.length;l++){var Y=s[l],re=Y.startTime;if(re>j)break;var ue=Y.transferSize,fe=Y.initiatorType;ue&&n0(fe)&&(Y=Y.responseEnd,D+=ue*(Y<j?1:(j-re)/(Y-re)))}if(--l,n+=8*(w+D)/(g.duration/1e3),t++,10<t)break}}if(0<t)return n/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var sf=null,af=null;function qc(t){return t.nodeType===9?t:t.ownerDocument}function r0(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 s0(t,n){if(t===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&n==="foreignObject"?0:t}function of(t,n){return t==="textarea"||t==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var lf=null;function Fx(){var t=window.event;return t&&t.type==="popstate"?t===lf?!1:(lf=t,!0):(lf=null,!1)}var a0=typeof setTimeout=="function"?setTimeout:void 0,qx=typeof clearTimeout=="function"?clearTimeout:void 0,o0=typeof Promise=="function"?Promise:void 0,Wx=typeof queueMicrotask=="function"?queueMicrotask:typeof o0<"u"?function(t){return o0.resolve(null).then(t).catch(Gx)}:a0;function Gx(t){setTimeout(function(){throw t})}function ns(t){return t==="head"}function l0(t,n){var s=n,l=0;do{var g=s.nextSibling;if(t.removeChild(s),g&&g.nodeType===8)if(s=g.data,s==="/$"||s==="/&"){if(l===0){t.removeChild(g),Ha(n);return}l--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")l++;else if(s==="html")Zo(t.ownerDocument.documentElement);else if(s==="head"){s=t.ownerDocument.head,Zo(s);for(var w=s.firstChild;w;){var D=w.nextSibling,j=w.nodeName;w[Gn]||j==="SCRIPT"||j==="STYLE"||j==="LINK"&&w.rel.toLowerCase()==="stylesheet"||s.removeChild(w),w=D}}else s==="body"&&Zo(t.ownerDocument.body);s=g}while(s);Ha(n)}function c0(t,n){var s=t;t=0;do{var l=s.nextSibling;if(s.nodeType===1?n?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(n?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),l&&l.nodeType===8)if(s=l.data,s==="/$"){if(t===0)break;t--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||t++;s=l}while(s)}function cf(t){var n=t.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var s=n;switch(n=n.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":cf(s),De(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}t.removeChild(s)}}function Kx(t,n,s,l){for(;t.nodeType===1;){var g=s;if(t.nodeName.toLowerCase()!==n.toLowerCase()){if(!l&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(l){if(!t[Gn])switch(n){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!==g.rel||t.getAttribute("href")!==(g.href==null||g.href===""?null:g.href)||t.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin)||t.getAttribute("title")!==(g.title==null?null:g.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(w=t.getAttribute("src"),(w!==(g.src==null?null:g.src)||t.getAttribute("type")!==(g.type==null?null:g.type)||t.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin))&&w&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(n==="input"&&t.type==="hidden"){var w=g.name==null?null:""+g.name;if(g.type==="hidden"&&t.getAttribute("name")===w)return t}else return t;if(t=Sn(t.nextSibling),t===null)break}return null}function Vx(t,n,s){if(n==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!s||(t=Sn(t.nextSibling),t===null))return null;return t}function u0(t,n){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=Sn(t.nextSibling),t===null))return null;return t}function uf(t){return t.data==="$?"||t.data==="$~"}function hf(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function Yx(t,n){var s=t.ownerDocument;if(t.data==="$~")t._reactRetry=n;else if(t.data!=="$?"||s.readyState!=="loading")n();else{var l=function(){n(),s.removeEventListener("DOMContentLoaded",l)};s.addEventListener("DOMContentLoaded",l),t._reactRetry=l}}function Sn(t){for(;t!=null;t=t.nextSibling){var n=t.nodeType;if(n===1||n===3)break;if(n===8){if(n=t.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return t}var df=null;function h0(t){t=t.nextSibling;for(var n=0;t;){if(t.nodeType===8){var s=t.data;if(s==="/$"||s==="/&"){if(n===0)return Sn(t.nextSibling);n--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||n++}t=t.nextSibling}return null}function d0(t){t=t.previousSibling;for(var n=0;t;){if(t.nodeType===8){var s=t.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(n===0)return t;n--}else s!=="/$"&&s!=="/&"||n++}t=t.previousSibling}return null}function f0(t,n,s){switch(n=qc(s),t){case"html":if(t=n.documentElement,!t)throw Error(a(452));return t;case"head":if(t=n.head,!t)throw Error(a(453));return t;case"body":if(t=n.body,!t)throw Error(a(454));return t;default:throw Error(a(451))}}function Zo(t){for(var n=t.attributes;n.length;)t.removeAttributeNode(n[0]);De(t)}var wn=new Map,p0=new Set;function Wc(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Ar=V.d;V.d={f:Xx,r:Zx,D:Jx,C:Qx,L:e2,m:t2,X:n2,S:i2,M:r2};function Xx(){var t=Ar.f(),n=Ic();return t||n}function Zx(t){var n=pe(t);n!==null&&n.tag===5&&n.type==="form"?M_(n):Ar.r(t)}var ja=typeof document>"u"?null:document;function g0(t,n,s){var l=ja;if(l&&typeof n=="string"&&n){var g=Fi(n);g='link[rel="'+t+'"][href="'+g+'"]',typeof s=="string"&&(g+='[crossorigin="'+s+'"]'),p0.has(g)||(p0.add(g),t={rel:t,crossOrigin:s,href:n},l.querySelector(g)===null&&(n=l.createElement("link"),xi(n,"link",t),Ye(n),l.head.appendChild(n)))}}function Jx(t){Ar.D(t),g0("dns-prefetch",t,null)}function Qx(t,n){Ar.C(t,n),g0("preconnect",t,n)}function e2(t,n,s){Ar.L(t,n,s);var l=ja;if(l&&t&&n){var g='link[rel="preload"][as="'+Fi(n)+'"]';n==="image"&&s&&s.imageSrcSet?(g+='[imagesrcset="'+Fi(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(g+='[imagesizes="'+Fi(s.imageSizes)+'"]')):g+='[href="'+Fi(t)+'"]';var w=g;switch(n){case"style":w=za(t);break;case"script":w=$a(t)}wn.has(w)||(t=f({rel:"preload",href:n==="image"&&s&&s.imageSrcSet?void 0:t,as:n},s),wn.set(w,t),l.querySelector(g)!==null||n==="style"&&l.querySelector(Jo(w))||n==="script"&&l.querySelector(Qo(w))||(n=l.createElement("link"),xi(n,"link",t),Ye(n),l.head.appendChild(n)))}}function t2(t,n){Ar.m(t,n);var s=ja;if(s&&t){var l=n&&typeof n.as=="string"?n.as:"script",g='link[rel="modulepreload"][as="'+Fi(l)+'"][href="'+Fi(t)+'"]',w=g;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=$a(t)}if(!wn.has(w)&&(t=f({rel:"modulepreload",href:t},n),wn.set(w,t),s.querySelector(g)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Qo(w)))return}l=s.createElement("link"),xi(l,"link",t),Ye(l),s.head.appendChild(l)}}}function i2(t,n,s){Ar.S(t,n,s);var l=ja;if(l&&t){var g=nt(l).hoistableStyles,w=za(t);n=n||"default";var D=g.get(w);if(!D){var j={loading:0,preload:null};if(D=l.querySelector(Jo(w)))j.loading=5;else{t=f({rel:"stylesheet",href:t,"data-precedence":n},s),(s=wn.get(w))&&ff(t,s);var Y=D=l.createElement("link");Ye(Y),xi(Y,"link",t),Y._p=new Promise(function(re,ue){Y.onload=re,Y.onerror=ue}),Y.addEventListener("load",function(){j.loading|=1}),Y.addEventListener("error",function(){j.loading|=2}),j.loading|=4,Gc(D,n,l)}D={type:"stylesheet",instance:D,count:1,state:j},g.set(w,D)}}}function n2(t,n){Ar.X(t,n);var s=ja;if(s&&t){var l=nt(s).hoistableScripts,g=$a(t),w=l.get(g);w||(w=s.querySelector(Qo(g)),w||(t=f({src:t,async:!0},n),(n=wn.get(g))&&pf(t,n),w=s.createElement("script"),Ye(w),xi(w,"link",t),s.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},l.set(g,w))}}function r2(t,n){Ar.M(t,n);var s=ja;if(s&&t){var l=nt(s).hoistableScripts,g=$a(t),w=l.get(g);w||(w=s.querySelector(Qo(g)),w||(t=f({src:t,async:!0,type:"module"},n),(n=wn.get(g))&&pf(t,n),w=s.createElement("script"),Ye(w),xi(w,"link",t),s.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},l.set(g,w))}}function m0(t,n,s,l){var g=(g=_e.current)?Wc(g):null;if(!g)throw Error(a(446));switch(t){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(n=za(s.href),s=nt(g).hoistableStyles,l=s.get(n),l||(l={type:"style",instance:null,count:0,state:null},s.set(n,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){t=za(s.href);var w=nt(g).hoistableStyles,D=w.get(t);if(D||(g=g.ownerDocument||g,D={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(t,D),(w=g.querySelector(Jo(t)))&&!w._p&&(D.instance=w,D.state.loading=5),wn.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},wn.set(t,s),w||s2(g,t,s,D.state))),n&&l===null)throw Error(a(528,""));return D}if(n&&l!==null)throw Error(a(529,""));return null;case"script":return n=s.async,s=s.src,typeof s=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=$a(s),s=nt(g).hoistableScripts,l=s.get(n),l||(l={type:"script",instance:null,count:0,state:null},s.set(n,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,t))}}function za(t){return'href="'+Fi(t)+'"'}function Jo(t){return'link[rel="stylesheet"]['+t+"]"}function _0(t){return f({},t,{"data-precedence":t.precedence,precedence:null})}function s2(t,n,s,l){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?l.loading=1:(n=t.createElement("link"),l.preload=n,n.addEventListener("load",function(){return l.loading|=1}),n.addEventListener("error",function(){return l.loading|=2}),xi(n,"link",s),Ye(n),t.head.appendChild(n))}function $a(t){return'[src="'+Fi(t)+'"]'}function Qo(t){return"script[async]"+t}function v0(t,n,s){if(n.count++,n.instance===null)switch(n.type){case"style":var l=t.querySelector('style[data-href~="'+Fi(s.href)+'"]');if(l)return n.instance=l,Ye(l),l;var g=f({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return l=(t.ownerDocument||t).createElement("style"),Ye(l),xi(l,"style",g),Gc(l,s.precedence,t),n.instance=l;case"stylesheet":g=za(s.href);var w=t.querySelector(Jo(g));if(w)return n.state.loading|=4,n.instance=w,Ye(w),w;l=_0(s),(g=wn.get(g))&&ff(l,g),w=(t.ownerDocument||t).createElement("link"),Ye(w);var D=w;return D._p=new Promise(function(j,Y){D.onload=j,D.onerror=Y}),xi(w,"link",l),n.state.loading|=4,Gc(w,s.precedence,t),n.instance=w;case"script":return w=$a(s.src),(g=t.querySelector(Qo(w)))?(n.instance=g,Ye(g),g):(l=s,(g=wn.get(w))&&(l=f({},s),pf(l,g)),t=t.ownerDocument||t,g=t.createElement("script"),Ye(g),xi(g,"link",l),t.head.appendChild(g),n.instance=g);case"void":return null;default:throw Error(a(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(l=n.instance,n.state.loading|=4,Gc(l,s.precedence,t));return n.instance}function Gc(t,n,s){for(var l=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),g=l.length?l[l.length-1]:null,w=g,D=0;D<l.length;D++){var j=l[D];if(j.dataset.precedence===n)w=j;else if(w!==g)break}w?w.parentNode.insertBefore(t,w.nextSibling):(n=s.nodeType===9?s.head:s,n.insertBefore(t,n.firstChild))}function ff(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.title==null&&(t.title=n.title)}function pf(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.integrity==null&&(t.integrity=n.integrity)}var Kc=null;function b0(t,n,s){if(Kc===null){var l=new Map,g=Kc=new Map;g.set(s,l)}else g=Kc,l=g.get(s),l||(l=new Map,g.set(s,l));if(l.has(t))return l;for(l.set(t,null),s=s.getElementsByTagName(t),g=0;g<s.length;g++){var w=s[g];if(!(w[Gn]||w[Tt]||t==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var D=w.getAttribute(n)||"";D=t+D;var j=l.get(D);j?j.push(w):l.set(D,[w])}}return l}function y0(t,n,s){t=t.ownerDocument||t,t.head.insertBefore(s,n==="title"?t.querySelector("head > title"):null)}function a2(t,n,s){if(s===1||n.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;return n.rel==="stylesheet"?(t=n.disabled,typeof n.precedence=="string"&&t==null):!0;case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function S0(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function o2(t,n,s,l){if(s.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var g=za(l.href),w=n.querySelector(Jo(g));if(w){n=w._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=Vc.bind(t),n.then(t,t)),s.state.loading|=4,s.instance=w,Ye(w);return}w=n.ownerDocument||n,l=_0(l),(g=wn.get(g))&&ff(l,g),w=w.createElement("link"),Ye(w);var D=w;D._p=new Promise(function(j,Y){D.onload=j,D.onerror=Y}),xi(w,"link",l),s.instance=w}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(s,n),(n=s.state.preload)&&(s.state.loading&3)===0&&(t.count++,s=Vc.bind(t),n.addEventListener("load",s),n.addEventListener("error",s))}}var gf=0;function l2(t,n){return t.stylesheets&&t.count===0&&Xc(t,t.stylesheets),0<t.count||0<t.imgCount?function(s){var l=setTimeout(function(){if(t.stylesheets&&Xc(t,t.stylesheets),t.unsuspend){var w=t.unsuspend;t.unsuspend=null,w()}},6e4+n);0<t.imgBytes&&gf===0&&(gf=62500*Ux());var g=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Xc(t,t.stylesheets),t.unsuspend)){var w=t.unsuspend;t.unsuspend=null,w()}},(t.imgBytes>gf?50:800)+n);return t.unsuspend=s,function(){t.unsuspend=null,clearTimeout(l),clearTimeout(g)}}:null}function Vc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Yc=null;function Xc(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Yc=new Map,n.forEach(c2,t),Yc=null,Vc.call(t))}function c2(t,n){if(!(n.state.loading&4)){var s=Yc.get(t);if(s)var l=s.get(null);else{s=new Map,Yc.set(t,s);for(var g=t.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<g.length;w++){var D=g[w];(D.nodeName==="LINK"||D.getAttribute("media")!=="not all")&&(s.set(D.dataset.precedence,D),l=D)}l&&s.set(null,l)}g=n.instance,D=g.getAttribute("data-precedence"),w=s.get(D)||l,w===l&&s.set(null,g),s.set(D,g),this.count++,l=Vc.bind(this),g.addEventListener("load",l),g.addEventListener("error",l),w?w.parentNode.insertBefore(g,w.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(g,t.firstChild)),n.state.loading|=4}}var el={$$typeof:v,Provider:null,Consumer:null,_currentValue:X,_currentValue2:X,_threadCount:0};function u2(t,n,s,l,g,w,D,j,Y){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=St(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=St(0),this.hiddenUpdates=St(null),this.identifierPrefix=l,this.onUncaughtError=g,this.onCaughtError=w,this.onRecoverableError=D,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Y,this.incompleteTransitions=new Map}function w0(t,n,s,l,g,w,D,j,Y,re,ue,fe){return t=new u2(t,n,s,D,Y,re,ue,fe,j),n=1,w===!0&&(n|=24),w=sn(3,null,null,n),t.current=w,w.stateNode=t,n=Kh(),n.refCount++,t.pooledCache=n,n.refCount++,w.memoizedState={element:l,isDehydrated:s,cache:n},Zh(w),t}function C0(t){return t?(t=ma,t):ma}function x0(t,n,s,l,g,w){g=C0(g),l.context===null?l.context=g:l.pendingContext=g,l=Gr(n),l.payload={element:s},w=w===void 0?null:w,w!==null&&(l.callback=w),s=Kr(t,l,n),s!==null&&(Yi(s,t,n),Do(s,t,n))}function E0(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var s=t.retryLane;t.retryLane=s!==0&&s<n?s:n}}function mf(t,n){E0(t,n),(t=t.alternate)&&E0(t,n)}function T0(t){if(t.tag===13||t.tag===31){var n=As(t,67108864);n!==null&&Yi(n,t,67108864),mf(t,67108864)}}function A0(t){if(t.tag===13||t.tag===31){var n=un();n=Qe(n);var s=As(t,n);s!==null&&Yi(s,t,n),mf(t,n)}}var Zc=!0;function h2(t,n,s,l){var g=P.T;P.T=null;var w=V.p;try{V.p=2,_f(t,n,s,l)}finally{V.p=w,P.T=g}}function d2(t,n,s,l){var g=P.T;P.T=null;var w=V.p;try{V.p=8,_f(t,n,s,l)}finally{V.p=w,P.T=g}}function _f(t,n,s,l){if(Zc){var g=vf(l);if(g===null)nf(t,n,l,Jc,s),R0(t,l);else if(p2(g,t,n,s,l))l.stopPropagation();else if(R0(t,l),n&4&&-1<f2.indexOf(t)){for(;g!==null;){var w=pe(g);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var D=ii(w.pendingLanes);if(D!==0){var j=w;for(j.pendingLanes|=2,j.entangledLanes|=2;D;){var Y=1<<31-$t(D);j.entanglements[1]|=Y,D&=~Y}Xn(w),(ht&6)===0&&(Nc=ut()+500,Vo(0))}}break;case 31:case 13:j=As(w,2),j!==null&&Yi(j,w,2),Ic(),mf(w,2)}if(w=vf(l),w===null&&nf(t,n,l,Jc,s),w===g)break;g=w}g!==null&&l.stopPropagation()}else nf(t,n,l,null,s)}}function vf(t){return t=qe(t),bf(t)}var Jc=null;function bf(t){if(Jc=null,t=K(t),t!==null){var n=_(t);if(n===null)t=null;else{var s=n.tag;if(s===13){if(t=m(n),t!==null)return t;t=null}else if(s===31){if(t=c(n),t!==null)return t;t=null}else if(s===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;t=null}else n!==t&&(t=null)}}return Jc=t,null}function k0(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(Kt()){case jt:return 2;case zt:return 8;case ti:case Dn:return 32;case Ri:return 268435456;default:return 32}default:return 32}}var yf=!1,rs=null,ss=null,as=null,tl=new Map,il=new Map,os=[],f2="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 R0(t,n){switch(t){case"focusin":case"focusout":rs=null;break;case"dragenter":case"dragleave":ss=null;break;case"mouseover":case"mouseout":as=null;break;case"pointerover":case"pointerout":tl.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":il.delete(n.pointerId)}}function nl(t,n,s,l,g,w){return t===null||t.nativeEvent!==w?(t={blockedOn:n,domEventName:s,eventSystemFlags:l,nativeEvent:w,targetContainers:[g]},n!==null&&(n=pe(n),n!==null&&T0(n)),t):(t.eventSystemFlags|=l,n=t.targetContainers,g!==null&&n.indexOf(g)===-1&&n.push(g),t)}function p2(t,n,s,l,g){switch(n){case"focusin":return rs=nl(rs,t,n,s,l,g),!0;case"dragenter":return ss=nl(ss,t,n,s,l,g),!0;case"mouseover":return as=nl(as,t,n,s,l,g),!0;case"pointerover":var w=g.pointerId;return tl.set(w,nl(tl.get(w)||null,t,n,s,l,g)),!0;case"gotpointercapture":return w=g.pointerId,il.set(w,nl(il.get(w)||null,t,n,s,l,g)),!0}return!1}function L0(t){var n=K(t.target);if(n!==null){var s=_(n);if(s!==null){if(n=s.tag,n===13){if(n=m(s),n!==null){t.blockedOn=n,cr(t.priority,function(){A0(s)});return}}else if(n===31){if(n=c(s),n!==null){t.blockedOn=n,cr(t.priority,function(){A0(s)});return}}else if(n===3&&s.stateNode.current.memoizedState.isDehydrated){t.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Qc(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var s=vf(t.nativeEvent);if(s===null){s=t.nativeEvent;var l=new s.constructor(s.type,s);Re=l,s.target.dispatchEvent(l),Re=null}else return n=pe(s),n!==null&&T0(n),t.blockedOn=s,!1;n.shift()}return!0}function M0(t,n,s){Qc(t)&&s.delete(n)}function g2(){yf=!1,rs!==null&&Qc(rs)&&(rs=null),ss!==null&&Qc(ss)&&(ss=null),as!==null&&Qc(as)&&(as=null),tl.forEach(M0),il.forEach(M0)}function eu(t,n){t.blockedOn===n&&(t.blockedOn=null,yf||(yf=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,g2)))}var tu=null;function D0(t){tu!==t&&(tu=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){tu===t&&(tu=null);for(var n=0;n<t.length;n+=3){var s=t[n],l=t[n+1],g=t[n+2];if(typeof l!="function"){if(bf(l||s)===null)continue;break}var w=pe(s);w!==null&&(t.splice(n,3),n-=3,_d(w,{pending:!0,data:g,method:s.method,action:l},l,g))}}))}function Ha(t){function n(Y){return eu(Y,t)}rs!==null&&eu(rs,t),ss!==null&&eu(ss,t),as!==null&&eu(as,t),tl.forEach(n),il.forEach(n);for(var s=0;s<os.length;s++){var l=os[s];l.blockedOn===t&&(l.blockedOn=null)}for(;0<os.length&&(s=os[0],s.blockedOn===null);)L0(s),s.blockedOn===null&&os.shift();if(s=(t.ownerDocument||t).$$reactFormReplay,s!=null)for(l=0;l<s.length;l+=3){var g=s[l],w=s[l+1],D=g[xt]||null;if(typeof w=="function")D||D0(s);else if(D){var j=null;if(w&&w.hasAttribute("formAction")){if(g=w,D=w[xt]||null)j=D.formAction;else if(bf(g)!==null)continue}else j=D.action;typeof j=="function"?s[l+1]=j:(s.splice(l,3),l-=3),D0(s)}}}function O0(){function t(w){w.canIntercept&&w.info==="react-transition"&&w.intercept({handler:function(){return new Promise(function(D){return g=D})},focusReset:"manual",scroll:"manual"})}function n(){g!==null&&(g(),g=null),l||setTimeout(s,20)}function s(){if(!l&&!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 l=!1,g=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(s,100),function(){l=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),g!==null&&(g(),g=null)}}}function Sf(t){this._internalRoot=t}iu.prototype.render=Sf.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(a(409));var s=n.current,l=un();x0(s,l,t,n,null,null)},iu.prototype.unmount=Sf.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;x0(t.current,2,null,t,null,null),Ic(),n[Nn]=null}};function iu(t){this._internalRoot=t}iu.prototype.unstable_scheduleHydration=function(t){if(t){var n=lr();t={blockedOn:null,target:t,priority:n};for(var s=0;s<os.length&&n!==0&&n<os[s].priority;s++);os.splice(s,0,t),s===0&&L0(t)}};var N0=i.version;if(N0!=="19.2.7")throw Error(a(527,N0,"19.2.7"));V.findDOMNode=function(t){var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error(a(188)):(t=Object.keys(t).join(","),Error(a(268,t)));return t=h(n),t=t!==null?b(t):null,t=t===null?null:t.stateNode,t};var m2={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:P,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var nu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!nu.isDisabled&&nu.supportsFiber)try{Hi=nu.inject(m2),Vt=nu}catch{}}return sl.createRoot=function(t,n){if(!o(t))throw Error(a(299));var s=!1,l="",g=P_,w=U_,D=F_;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onUncaughtError!==void 0&&(g=n.onUncaughtError),n.onCaughtError!==void 0&&(w=n.onCaughtError),n.onRecoverableError!==void 0&&(D=n.onRecoverableError)),n=w0(t,1,!1,null,null,s,l,null,g,w,D,O0),t[Nn]=n.current,tf(t),new Sf(n)},sl.hydrateRoot=function(t,n,s){if(!o(t))throw Error(a(299));var l=!1,g="",w=P_,D=U_,j=F_,Y=null;return s!=null&&(s.unstable_strictMode===!0&&(l=!0),s.identifierPrefix!==void 0&&(g=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&&(Y=s.formState)),n=w0(t,1,!0,n,s??null,l,g,Y,w,D,j,O0),n.context=C0(null),s=n.current,l=un(),l=Qe(l),g=Gr(l),g.callback=null,Kr(s,g,l),s=l,n.current.lanes=s,ft(n,s),Xn(n),t[Nn]=n.current,tf(t),new iu(n)},sl.version="19.2.7",sl}var q0;function T2(){if(q0)return xf.exports;q0=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(i){console.error(i)}}return e(),xf.exports=E2(),xf.exports}var A2=T2();var W0="popstate";function G0(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function k2(e={}){function i(a,o){let _=o.state?.masked,{pathname:m,search:c,hash:u}=_||a.location;return wp("",{pathname:m,search:c,hash:u},o.state&&o.state.usr||null,o.state&&o.state.key||"default",_?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function r(a,o){return typeof o=="string"?o:Rl(o)}return L2(i,r,null,e)}function Nt(e,i){if(e===!1||e===null||typeof e>"u")throw new Error(i)}function Fn(e,i){if(!e){typeof console<"u"&&console.warn(i);try{throw new Error(i)}catch{}}}function R2(){return Math.random().toString(36).substring(2,10)}function K0(e,i){return{usr:e.state,key:e.key,idx:i,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function wp(e,i,r=null,a,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof i=="string"?ro(i):i,state:r,key:i&&i.key||a||R2(),mask:o}}function Rl({pathname:e="/",search:i="",hash:r=""}){return i&&i!=="?"&&(e+=i.charAt(0)==="?"?i:"?"+i),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function ro(e){let i={};if(e){let r=e.indexOf("#");r>=0&&(i.hash=e.substring(r),e=e.substring(0,r));let a=e.indexOf("?");a>=0&&(i.search=e.substring(a),e=e.substring(0,a)),e&&(i.pathname=e)}return i}function L2(e,i,r,a={}){let{window:o=document.defaultView,v5Compat:_=!1}=a,m=o.history,c="POP",u=null,h=b();h==null&&(h=0,m.replaceState({...m.state,idx:h},""));function b(){return(m.state||{idx:null}).idx}function f(){c="POP";let p=b(),y=p==null?null:p-h;h=p,u&&u({action:c,location:x.location,delta:y})}function C(p,y){c="PUSH";let d=G0(p)?p:wp(x.location,p,y);h=b()+1;let v=K0(d,h),T=x.createHref(d.mask||d);try{m.pushState(v,"",T)}catch(R){if(R instanceof DOMException&&R.name==="DataCloneError")throw R;o.location.assign(T)}_&&u&&u({action:c,location:x.location,delta:1})}function E(p,y){c="REPLACE";let d=G0(p)?p:wp(x.location,p,y);h=b();let v=K0(d,h),T=x.createHref(d.mask||d);m.replaceState(v,"",T),_&&u&&u({action:c,location:x.location,delta:0})}function A(p){return M2(o,p)}let x={get action(){return c},get location(){return e(o,m)},listen(p){if(u)throw new Error("A history only accepts one active listener");return o.addEventListener(W0,f),u=p,()=>{o.removeEventListener(W0,f),u=null}},createHref(p){return i(o,p)},createURL:A,encodeLocation(p){let y=A(p);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:C,replace:E,go(p){return m.go(p)}};return x}function M2(e,i,r=!1){let a="http://localhost";e&&(a=e.location.origin!=="null"?e.location.origin:e.location.href),Nt(a,"No window.location.(origin|href) available to create URL");let o=typeof i=="string"?i:Rl(i);return o=o.replace(/ $/,"%20"),!r&&o.startsWith("//")&&(o=a+o),new URL(o,a)}function fy(e,i,r="/"){return D2(e,i,r,!1)}function D2(e,i,r,a,o){let _=typeof i=="string"?ro(i):i,m=Br(_.pathname||"/",r);if(m==null)return null;let c=O2(e),u=null,h=W2(m);for(let b=0;u==null&&b<c.length;++b)u=F2(c[b],h,a);return u}function O2(e){let i=py(e);return N2(i),i}function py(e,i=[],r=[],a="",o=!1){let _=(m,c,u=o,h)=>{let b={relativePath:h===void 0?m.path||"":h,caseSensitive:m.caseSensitive===!0,childrenIndex:c,route:m};if(b.relativePath.startsWith("/")){if(!b.relativePath.startsWith(a)&&u)return;Nt(b.relativePath.startsWith(a),`Absolute route path "${b.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),b.relativePath=b.relativePath.slice(a.length)}let f=Pn([a,b.relativePath]),C=r.concat(b);m.children&&m.children.length>0&&(Nt(m.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${f}".`),py(m.children,i,C,f,u)),!(m.path==null&&!m.index)&&i.push({path:f,score:P2(f,m.index),routesMeta:C})};return e.forEach((m,c)=>{if(m.path===""||!m.path?.includes("?"))_(m,c);else for(let u of gy(m.path))_(m,c,!0,u)}),i}function gy(e){let i=e.split("/");if(i.length===0)return[];let[r,...a]=i,o=r.endsWith("?"),_=r.replace(/\?$/,"");if(a.length===0)return o?[_,""]:[_];let m=gy(a.join("/")),c=[];return c.push(...m.map(u=>u===""?_:[_,u].join("/"))),o&&c.push(...m),c.map(u=>e.startsWith("/")&&u===""?"/":u)}function N2(e){e.sort((i,r)=>i.score!==r.score?r.score-i.score:U2(i.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var B2=/^:[\w-]+$/,I2=3,j2=2,z2=1,$2=10,H2=-2,V0=e=>e==="*";function P2(e,i){let r=e.split("/"),a=r.length;return r.some(V0)&&(a+=H2),i&&(a+=j2),r.filter(o=>!V0(o)).reduce((o,_)=>o+(B2.test(_)?I2:_===""?z2:$2),a)}function U2(e,i){return e.length===i.length&&e.slice(0,-1).every((a,o)=>a===i[o])?e[e.length-1]-i[i.length-1]:0}function F2(e,i,r=!1){let{routesMeta:a}=e,o={},_="/",m=[];for(let c=0;c<a.length;++c){let u=a[c],h=c===a.length-1,b=_==="/"?i:i.slice(_.length)||"/",f=Iu({path:u.relativePath,caseSensitive:u.caseSensitive,end:h},b),C=u.route;if(!f&&h&&r&&!a[a.length-1].route.index&&(f=Iu({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},b)),!f)return null;Object.assign(o,f.params),m.push({params:o,pathname:Pn([_,f.pathname]),pathnameBase:Y2(Pn([_,f.pathnameBase])),route:C}),f.pathnameBase!=="/"&&(_=Pn([_,f.pathnameBase]))}return m}function Iu(e,i){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=q2(e.path,e.caseSensitive,e.end),o=i.match(r);if(!o)return null;let _=o[0],m=_.replace(/(.)\/+$/,"$1"),c=o.slice(1);return{params:a.reduce((h,{paramName:b,isOptional:f},C)=>{if(b==="*"){let A=c[C]||"";m=_.slice(0,_.length-A.length).replace(/(.)\/+$/,"$1")}const E=c[C];return f&&!E?h[b]=void 0:h[b]=(E||"").replace(/%2F/g,"/"),h},{}),pathname:_,pathnameBase:m,pattern:e}}function q2(e,i=!1,r=!0){Fn(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=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,c,u,h,b)=>{if(a.push({paramName:c,isOptional:u!=null}),u){let f=b.charAt(h+m.length);return f&&f!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,i?void 0:"i"),a]}function W2(e){try{return e.split("/").map(i=>decodeURIComponent(i).replace(/\//g,"%2F")).join("/")}catch(i){return Fn(!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 (${i}).`),e}}function Br(e,i){if(i==="/")return e;if(!e.toLowerCase().startsWith(i.toLowerCase()))return null;let r=i.endsWith("/")?i.length-1:i.length,a=e.charAt(r);return a&&a!=="/"?null:e.slice(r)||"/"}var G2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function K2(e,i="/"){let{pathname:r,search:a="",hash:o=""}=typeof e=="string"?ro(e):e,_;return r?(r=my(r),r.startsWith("/")?_=Y0(r.substring(1),"/"):_=Y0(r,i)):_=i,{pathname:_,search:X2(a),hash:Z2(o)}}function Y0(e,i){let r=ju(i).split("/");return e.split("/").forEach(o=>{o===".."?r.length>1&&r.pop():o!=="."&&r.push(o)}),r.length>1?r.join("/"):"/"}function kf(e,i,r,a){return`Cannot include a '${e}' character in a manually specified \`to.${i}\` 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 V2(e){return e.filter((i,r)=>r===0||i.route.path&&i.route.path.length>0)}function fg(e){let i=V2(e);return i.map((r,a)=>a===i.length-1?r.pathname:r.pathnameBase)}function ih(e,i,r,a=!1){let o;typeof e=="string"?o=ro(e):(o={...e},Nt(!o.pathname||!o.pathname.includes("?"),kf("?","pathname","search",o)),Nt(!o.pathname||!o.pathname.includes("#"),kf("#","pathname","hash",o)),Nt(!o.search||!o.search.includes("#"),kf("#","search","hash",o)));let _=e===""||o.pathname==="",m=_?"/":o.pathname,c;if(m==null)c=r;else{let f=i.length-1;if(!a&&m.startsWith("..")){let C=m.split("/");for(;C[0]==="..";)C.shift(),f-=1;o.pathname=C.join("/")}c=f>=0?i[f]:"/"}let u=K2(o,c),h=m&&m!=="/"&&m.endsWith("/"),b=(_||m===".")&&r.endsWith("/");return!u.pathname.endsWith("/")&&(h||b)&&(u.pathname+="/"),u}var my=e=>e.replace(/\/\/+/g,"/"),Pn=e=>my(e.join("/")),ju=e=>e.replace(/\/+$/,""),Y2=e=>ju(e).replace(/^\/*/,"/"),X2=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Z2=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,J2=class{constructor(e,i,r,a=!1){this.status=e,this.statusText=i||"",this.internal=a,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function Q2(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function eE(e){let i=e.map(r=>r.route.path).filter(Boolean);return Pn(i)||"/"}var _y=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function vy(e,i){let r=e;if(typeof r!="string"||!G2.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let a=r,o=!1;if(_y)try{let _=new URL(window.location.href),m=r.startsWith("//")?new URL(_.protocol+r):new URL(r),c=Br(m.pathname,i);m.origin===_.origin&&c!=null?r=c+m.search+m.hash:o=!0}catch{Fn(!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:o,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var by=["POST","PUT","PATCH","DELETE"];new Set(by);var tE=["GET",...by];new Set(tE);var so=U.createContext(null);so.displayName="DataRouter";var nh=U.createContext(null);nh.displayName="DataRouterState";var yy=U.createContext(!1);function iE(){return U.useContext(yy)}var Sy=U.createContext({isTransitioning:!1});Sy.displayName="ViewTransition";var nE=U.createContext(new Map);nE.displayName="Fetchers";var rE=U.createContext(null);rE.displayName="Await";var dn=U.createContext(null);dn.displayName="Navigation";var zl=U.createContext(null);zl.displayName="Location";var nr=U.createContext({outlet:null,matches:[],isDataRoute:!1});nr.displayName="Route";var pg=U.createContext(null);pg.displayName="RouteError";var wy="REACT_ROUTER_ERROR",sE="REDIRECT",aE="ROUTE_ERROR_RESPONSE";function oE(e){if(e.startsWith(`${wy}:${sE}:{`))try{let i=JSON.parse(e.slice(28));if(typeof i=="object"&&i&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.location=="string"&&typeof i.reloadDocument=="boolean"&&typeof i.replace=="boolean")return i}catch{}}function lE(e){if(e.startsWith(`${wy}:${aE}:{`))try{let i=JSON.parse(e.slice(40));if(typeof i=="object"&&i&&typeof i.status=="number"&&typeof i.statusText=="string")return new J2(i.status,i.statusText,i.data)}catch{}}function cE(e,{relative:i}={}){Nt(ao(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=U.useContext(dn),{hash:o,pathname:_,search:m}=Hl(e,{relative:i}),c=_;return r!=="/"&&(c=_==="/"?r:Pn([r,_])),a.createHref({pathname:c,search:m,hash:o})}function ao(){return U.useContext(zl)!=null}function Ln(){return Nt(ao(),"useLocation() may be used only in the context of a <Router> component."),U.useContext(zl).location}var Cy="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function xy(e){U.useContext(dn).static||U.useLayoutEffect(e)}function $l(){let{isDataRoute:e}=U.useContext(nr);return e?wE():uE()}function uE(){Nt(ao(),"useNavigate() may be used only in the context of a <Router> component.");let e=U.useContext(so),{basename:i,navigator:r}=U.useContext(dn),{matches:a}=U.useContext(nr),{pathname:o}=Ln(),_=JSON.stringify(fg(a)),m=U.useRef(!1);return xy(()=>{m.current=!0}),U.useCallback((u,h={})=>{if(Fn(m.current,Cy),!m.current)return;if(typeof u=="number"){r.go(u);return}let b=ih(u,JSON.parse(_),o,h.relative==="path");e==null&&i!=="/"&&(b.pathname=b.pathname==="/"?i:Pn([i,b.pathname])),(h.replace?r.replace:r.push)(b,h.state,h)},[i,r,_,o,e])}U.createContext(null);function Hl(e,{relative:i}={}){let{matches:r}=U.useContext(nr),{pathname:a}=Ln(),o=JSON.stringify(fg(r));return U.useMemo(()=>ih(e,JSON.parse(o),a,i==="path"),[e,o,a,i])}function hE(e,i){return Ey(e,i)}function Ey(e,i,r){Nt(ao(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=U.useContext(dn),{matches:o}=U.useContext(nr),_=o[o.length-1],m=_?_.params:{},c=_?_.pathname:"/",u=_?_.pathnameBase:"/",h=_&&_.route;{let p=h&&h.path||"";Ay(c,!h||p.endsWith("*")||p.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${p}">) 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="${p}"> to <Route path="${p==="/"?"*":`${p}/*`}">.`)}let b=Ln(),f;if(i){let p=typeof i=="string"?ro(i):i;Nt(u==="/"||p.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 "${p.pathname}" was given in the \`location\` prop.`),f=p}else f=b;let C=f.pathname||"/",E=C;if(u!=="/"){let p=u.replace(/^\//,"").split("/");E="/"+C.replace(/^\//,"").split("/").slice(p.length).join("/")}let A=r&&r.state.matches.length?r.state.matches.map(p=>Object.assign(p,{route:r.manifest[p.route.id]||p.route})):fy(e,{pathname:E});Fn(h||A!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),Fn(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 "${f.pathname}${f.search}${f.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=mE(A&&A.map(p=>Object.assign({},p,{params:Object.assign({},m,p.params),pathname:Pn([u,a.encodeLocation?a.encodeLocation(p.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:p.pathname]),pathnameBase:p.pathnameBase==="/"?u:Pn([u,a.encodeLocation?a.encodeLocation(p.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:p.pathnameBase])})),o,r);return i&&x?U.createElement(zl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...f},navigationType:"POP"}},x):x}function dE(){let e=SE(),i=Q2(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)",o={padding:"0.5rem",backgroundColor:a},_={padding:"2px 4px",backgroundColor:a},m=null;return console.error("Error handled by React Router default ErrorBoundary:",e),m=U.createElement(U.Fragment,null,U.createElement("p",null,"💿 Hey developer 👋"),U.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",U.createElement("code",{style:_},"ErrorBoundary")," or"," ",U.createElement("code",{style:_},"errorElement")," prop on your route.")),U.createElement(U.Fragment,null,U.createElement("h2",null,"Unexpected Application Error!"),U.createElement("h3",{style:{fontStyle:"italic"}},i),r?U.createElement("pre",{style:o},r):null,m)}var fE=U.createElement(dE,null),Ty=class extends U.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,i){return i.location!==e.location||i.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:i.error,location:i.location,revalidation:e.revalidation||i.revalidation}}componentDidCatch(e,i){this.props.onError?this.props.onError(e,i):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=lE(e.digest);r&&(e=r)}let i=e!==void 0?U.createElement(nr.Provider,{value:this.props.routeContext},U.createElement(pg.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?U.createElement(pE,{error:e},i):i}};Ty.contextType=yy;var Rf=new WeakMap;function pE({children:e,error:i}){let{basename:r}=U.useContext(dn);if(typeof i=="object"&&i&&"digest"in i&&typeof i.digest=="string"){let a=oE(i.digest);if(a){let o=Rf.get(i);if(o)throw o;let _=vy(a.location,r);if(_y&&!Rf.get(i))if(_.isExternal||a.reloadDocument)window.location.href=_.absoluteURL||_.to;else{const m=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(_.to,{replace:a.replace}));throw Rf.set(i,m),m}return U.createElement("meta",{httpEquiv:"refresh",content:`0;url=${_.absoluteURL||_.to}`})}}return e}function gE({routeContext:e,match:i,children:r}){let a=U.useContext(so);return a&&a.static&&a.staticContext&&(i.route.errorElement||i.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=i.route.id),U.createElement(nr.Provider,{value:e},r)}function mE(e,i=[],r){let a=r?.state;if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(i.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let o=e,_=a?.errors;if(_!=null){let b=o.findIndex(f=>f.route.id&&_?.[f.route.id]!==void 0);Nt(b>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(_).join(",")}`),o=o.slice(0,Math.min(o.length,b+1))}let m=!1,c=-1;if(r&&a){m=a.renderFallback;for(let b=0;b<o.length;b++){let f=o[b];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(c=b),f.route.id){let{loaderData:C,errors:E}=a,A=f.route.loader&&!C.hasOwnProperty(f.route.id)&&(!E||E[f.route.id]===void 0);if(f.route.lazy||A){r.isStatic&&(m=!0),c>=0?o=o.slice(0,c+1):o=[o[0]];break}}}}let u=r?.onError,h=a&&u?(b,f)=>{u(b,{location:a.location,params:a.matches?.[0]?.params??{},pattern:eE(a.matches),errorInfo:f})}:void 0;return o.reduceRight((b,f,C)=>{let E,A=!1,x=null,p=null;a&&(E=_&&f.route.id?_[f.route.id]:void 0,x=f.route.errorElement||fE,m&&(c<0&&C===0?(Ay("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),A=!0,p=null):c===C&&(A=!0,p=f.route.hydrateFallbackElement||null)));let y=i.concat(o.slice(0,C+1)),d=()=>{let v;return E?v=x:A?v=p:f.route.Component?v=U.createElement(f.route.Component,null):f.route.element?v=f.route.element:v=b,U.createElement(gE,{match:f,routeContext:{outlet:b,matches:y,isDataRoute:a!=null},children:v})};return a&&(f.route.ErrorBoundary||f.route.errorElement||C===0)?U.createElement(Ty,{location:a.location,revalidation:a.revalidation,component:x,error:E,children:d(),routeContext:{outlet:null,matches:y,isDataRoute:!0},onError:h}):d()},null)}function gg(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function _E(e){let i=U.useContext(so);return Nt(i,gg(e)),i}function vE(e){let i=U.useContext(nh);return Nt(i,gg(e)),i}function bE(e){let i=U.useContext(nr);return Nt(i,gg(e)),i}function mg(e){let i=bE(e),r=i.matches[i.matches.length-1];return Nt(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function yE(){return mg("useRouteId")}function SE(){let e=U.useContext(pg),i=vE("useRouteError"),r=mg("useRouteError");return e!==void 0?e:i.errors?.[r]}function wE(){let{router:e}=_E("useNavigate"),i=mg("useNavigate"),r=U.useRef(!1);return xy(()=>{r.current=!0}),U.useCallback(async(o,_={})=>{Fn(r.current,Cy),r.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:i,..._}))},[e,i])}var X0={};function Ay(e,i,r){!i&&!X0[e]&&(X0[e]=!0,Fn(!1,r))}U.memo(CE);function CE({routes:e,manifest:i,future:r,state:a,isStatic:o,onError:_}){return Ey(e,void 0,{manifest:i,state:a,isStatic:o,onError:_})}function xE({to:e,replace:i,state:r,relative:a}){Nt(ao(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=U.useContext(dn);Fn(!o,"<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:_}=U.useContext(nr),{pathname:m}=Ln(),c=$l(),u=ih(e,fg(_),m,a==="path"),h=JSON.stringify(u);return U.useEffect(()=>{c(JSON.parse(h),{replace:i,state:r,relative:a})},[c,h,a,i,r]),null}function Fs(e){Nt(!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 EE({basename:e="/",children:i=null,location:r,navigationType:a="POP",navigator:o,static:_=!1,useTransitions:m}){Nt(!ao(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),u=U.useMemo(()=>({basename:c,navigator:o,static:_,useTransitions:m,future:{}}),[c,o,_,m]);typeof r=="string"&&(r=ro(r));let{pathname:h="/",search:b="",hash:f="",state:C=null,key:E="default",mask:A}=r,x=U.useMemo(()=>{let p=Br(h,c);return p==null?null:{location:{pathname:p,search:b,hash:f,state:C,key:E,mask:A},navigationType:a}},[c,h,b,f,C,E,a,A]);return Fn(x!=null,`<Router basename="${c}"> is not able to match the URL "${h}${b}${f}" because it does not start with the basename, so the <Router> won't render anything.`),x==null?null:U.createElement(dn.Provider,{value:u},U.createElement(zl.Provider,{children:i,value:x}))}function TE({children:e,location:i}){return hE(Cp(e),i)}function Cp(e,i=[]){let r=[];return U.Children.forEach(e,(a,o)=>{if(!U.isValidElement(a))return;let _=[...i,o];if(a.type===U.Fragment){r.push.apply(r,Cp(a.props.children,_));return}Nt(a.type===Fs,`[${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>`),Nt(!a.props.index||!a.props.children,"An index route cannot have child routes.");let m={id:a.props.id||_.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=Cp(a.props.children,_)),r.push(m)}),r}var wu="get",Cu="application/x-www-form-urlencoded";function rh(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function AE(e){return rh(e)&&e.tagName.toLowerCase()==="button"}function kE(e){return rh(e)&&e.tagName.toLowerCase()==="form"}function RE(e){return rh(e)&&e.tagName.toLowerCase()==="input"}function LE(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ME(e,i){return e.button===0&&(!i||i==="_self")&&!LE(e)}var ru=null;function DE(){if(ru===null)try{new FormData(document.createElement("form"),0),ru=!1}catch{ru=!0}return ru}var OE=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Lf(e){return e!=null&&!OE.has(e)?(Fn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Cu}"`),null):e}function NE(e,i){let r,a,o,_,m;if(kE(e)){let c=e.getAttribute("action");a=c?Br(c,i):null,r=e.getAttribute("method")||wu,o=Lf(e.getAttribute("enctype"))||Cu,_=new FormData(e)}else if(AE(e)||RE(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?Br(u,i):null,r=e.getAttribute("formmethod")||c.getAttribute("method")||wu,o=Lf(e.getAttribute("formenctype"))||Lf(c.getAttribute("enctype"))||Cu,_=new FormData(c,e),!DE()){let{name:h,type:b,value:f}=e;if(b==="image"){let C=h?`${h}.`:"";_.append(`${C}x`,"0"),_.append(`${C}y`,"0")}else h&&_.append(h,f)}}else{if(rh(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=wu,a=null,o=Cu,m=e}return _&&o==="text/plain"&&(m=_,_=void 0),{action:a,method:r.toLowerCase(),encType:o,formData:_,body:m}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function _g(e,i){if(e===!1||e===null||typeof e>"u")throw new Error(i)}function ky(e,i,r,a){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${a}`:o.pathname=`${o.pathname}.${a}`:o.pathname==="/"?o.pathname=`_root.${a}`:i&&Br(o.pathname,i)==="/"?o.pathname=`${ju(i)}/_root.${a}`:o.pathname=`${ju(o.pathname)}.${a}`,o}async function BE(e,i){if(e.id in i)return i[e.id];try{let r=await import(e.module);return i[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 IE(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 jE(e,i,r){let a=await Promise.all(e.map(async o=>{let _=i.routes[o.route.id];if(_){let m=await BE(_,r);return m.links?m.links():[]}return[]}));return PE(a.flat(1).filter(IE).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function Z0(e,i,r,a,o,_){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 _==="assets"?i.filter((u,h)=>m(u,h)||c(u,h)):_==="data"?i.filter((u,h)=>{let b=a.routes[u.route.id];if(!b||!b.hasLoader)return!1;if(m(u,h)||c(u,h))return!0;if(u.route.shouldRevalidate){let f=u.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof f=="boolean")return f}return!0}):[]}function zE(e,i,{includeHydrateFallback:r}={}){return $E(e.map(a=>{let o=i.routes[a.route.id];if(!o)return[];let _=[o.module];return o.clientActionModule&&(_=_.concat(o.clientActionModule)),o.clientLoaderModule&&(_=_.concat(o.clientLoaderModule)),r&&o.hydrateFallbackModule&&(_=_.concat(o.hydrateFallbackModule)),o.imports&&(_=_.concat(o.imports)),_}).flat(1))}function $E(e){return[...new Set(e)]}function HE(e){let i={},r=Object.keys(e).sort();for(let a of r)i[a]=e[a];return i}function PE(e,i){let r=new Set;return new Set(i),e.reduce((a,o)=>{let _=JSON.stringify(HE(o));return r.has(_)||(r.add(_),a.push({key:_,link:o})),a},[])}function vg(){let e=U.useContext(so);return _g(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function UE(){let e=U.useContext(nh);return _g(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var bg=U.createContext(void 0);bg.displayName="FrameworkContext";function yg(){let e=U.useContext(bg);return _g(e,"You must render this element inside a <HydratedRouter> element"),e}function FE(e,i){let r=U.useContext(bg),[a,o]=U.useState(!1),[_,m]=U.useState(!1),{onFocus:c,onBlur:u,onMouseEnter:h,onMouseLeave:b,onTouchStart:f}=i,C=U.useRef(null);U.useEffect(()=>{if(e==="render"&&m(!0),e==="viewport"){let x=y=>{y.forEach(d=>{m(d.isIntersecting)})},p=new IntersectionObserver(x,{threshold:.5});return C.current&&p.observe(C.current),()=>{p.disconnect()}}},[e]),U.useEffect(()=>{if(a){let x=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout(x)}}},[a]);let E=()=>{o(!0)},A=()=>{o(!1),m(!1)};return r?e!=="intent"?[_,C,{}]:[_,C,{onFocus:al(c,E),onBlur:al(u,A),onMouseEnter:al(h,E),onMouseLeave:al(b,A),onTouchStart:al(f,E)}]:[!1,C,{}]}function al(e,i){return r=>{e&&e(r),r.defaultPrevented||i(r)}}function qE({page:e,...i}){let r=iE(),{router:a}=vg(),o=U.useMemo(()=>fy(a.routes,e,a.basename),[a.routes,e,a.basename]);return o?r?U.createElement(GE,{page:e,matches:o,...i}):U.createElement(KE,{page:e,matches:o,...i}):null}function WE(e){let{manifest:i,routeModules:r}=yg(),[a,o]=U.useState([]);return U.useEffect(()=>{let _=!1;return jE(e,i,r).then(m=>{_||o(m)}),()=>{_=!0}},[e,i,r]),a}function GE({page:e,matches:i,...r}){let a=Ln(),{future:o}=yg(),{basename:_}=vg(),m=U.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let c=ky(e,_,o.v8_trailingSlashAwareDataRequests,"rsc"),u=!1,h=[];for(let b of i)typeof b.route.shouldRevalidate=="function"?u=!0:h.push(b.route.id);return u&&h.length>0&&c.searchParams.set("_routes",h.join(",")),[c.pathname+c.search]},[_,o.v8_trailingSlashAwareDataRequests,e,a,i]);return U.createElement(U.Fragment,null,m.map(c=>U.createElement("link",{key:c,rel:"prefetch",as:"fetch",href:c,...r})))}function KE({page:e,matches:i,...r}){let a=Ln(),{future:o,manifest:_,routeModules:m}=yg(),{basename:c}=vg(),{loaderData:u,matches:h}=UE(),b=U.useMemo(()=>Z0(e,i,h,_,a,"data"),[e,i,h,_,a]),f=U.useMemo(()=>Z0(e,i,h,_,a,"assets"),[e,i,h,_,a]),C=U.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let x=new Set,p=!1;if(i.forEach(d=>{let v=_.routes[d.route.id];!v||!v.hasLoader||(!b.some(T=>T.route.id===d.route.id)&&d.route.id in u&&m[d.route.id]?.shouldRevalidate||v.hasClientLoader?p=!0:x.add(d.route.id))}),x.size===0)return[];let y=ky(e,c,o.v8_trailingSlashAwareDataRequests,"data");return p&&x.size>0&&y.searchParams.set("_routes",i.filter(d=>x.has(d.route.id)).map(d=>d.route.id).join(",")),[y.pathname+y.search]},[c,o.v8_trailingSlashAwareDataRequests,u,a,_,b,i,e,m]),E=U.useMemo(()=>zE(f,_),[f,_]),A=WE(f);return U.createElement(U.Fragment,null,C.map(x=>U.createElement("link",{key:x,rel:"prefetch",as:"fetch",href:x,...r})),E.map(x=>U.createElement("link",{key:x,rel:"modulepreload",href:x,...r})),A.map(({key:x,link:p})=>U.createElement("link",{key:x,nonce:r.nonce,...p,crossOrigin:p.crossOrigin??r.crossOrigin})))}function VE(...e){return i=>{e.forEach(r=>{typeof r=="function"?r(i):r!=null&&(r.current=i)})}}var YE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{YE&&(window.__reactRouterVersion="7.17.0")}catch{}function XE({basename:e,children:i,useTransitions:r,window:a}){let o=U.useRef();o.current==null&&(o.current=k2({window:a,v5Compat:!0}));let _=o.current,[m,c]=U.useState({action:_.action,location:_.location}),u=U.useCallback(h=>{r===!1?c(h):U.startTransition(()=>c(h))},[r]);return U.useLayoutEffect(()=>_.listen(u),[_,u]),U.createElement(EE,{basename:e,children:i,location:m.location,navigationType:m.action,navigator:_,useTransitions:r})}var Ry=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ll=U.forwardRef(function({onClick:i,discover:r="render",prefetch:a="none",relative:o,reloadDocument:_,replace:m,mask:c,state:u,target:h,to:b,preventScrollReset:f,viewTransition:C,defaultShouldRevalidate:E,...A},x){let{basename:p,navigator:y,useTransitions:d}=U.useContext(dn),v=typeof b=="string"&&Ry.test(b),T=vy(b,p);b=T.to;let R=cE(b,{relative:o}),L=Ln(),M=null;if(c){let te=ih(c,[],L.mask?L.mask.pathname:"/",!0);p!=="/"&&(te.pathname=te.pathname==="/"?p:Pn([p,te.pathname])),M=y.createHref(te)}let[k,B,W]=FE(a,A),F=QE(b,{replace:m,mask:c,state:u,target:h,preventScrollReset:f,relative:o,viewTransition:C,defaultShouldRevalidate:E,useTransitions:d});function q(te){i&&i(te),te.defaultPrevented||F(te)}let I=!(T.isExternal||_),G=U.createElement("a",{...A,...W,href:(I?M:void 0)||T.absoluteURL||R,onClick:I?q:i,ref:VE(x,B),target:h,"data-discover":!v&&r==="render"?"true":void 0});return k&&!v?U.createElement(U.Fragment,null,G,U.createElement(qE,{page:R})):G});Ll.displayName="Link";var xu=U.forwardRef(function({"aria-current":i="page",caseSensitive:r=!1,className:a="",end:o=!1,style:_,to:m,viewTransition:c,children:u,...h},b){let f=Hl(m,{relative:h.relative}),C=Ln(),E=U.useContext(nh),{navigator:A,basename:x}=U.useContext(dn),p=E!=null&&r5(f)&&c===!0,y=A.encodeLocation?A.encodeLocation(f).pathname:f.pathname,d=C.pathname,v=E&&E.navigation&&E.navigation.location?E.navigation.location.pathname:null;r||(d=d.toLowerCase(),v=v?v.toLowerCase():null,y=y.toLowerCase()),v&&x&&(v=Br(v,x)||v);const T=y!=="/"&&y.endsWith("/")?y.length-1:y.length;let R=d===y||!o&&d.startsWith(y)&&d.charAt(T)==="/",L=v!=null&&(v===y||!o&&v.startsWith(y)&&v.charAt(y.length)==="/"),M={isActive:R,isPending:L,isTransitioning:p},k=R?i:void 0,B;typeof a=="function"?B=a(M):B=[a,R?"active":null,L?"pending":null,p?"transitioning":null].filter(Boolean).join(" ");let W=typeof _=="function"?_(M):_;return U.createElement(Ll,{...h,"aria-current":k,className:B,ref:b,style:W,to:m,viewTransition:c},typeof u=="function"?u(M):u)});xu.displayName="NavLink";var ZE=U.forwardRef(({discover:e="render",fetcherKey:i,navigate:r,reloadDocument:a,replace:o,state:_,method:m=wu,action:c,onSubmit:u,relative:h,preventScrollReset:b,viewTransition:f,defaultShouldRevalidate:C,...E},A)=>{let{useTransitions:x}=U.useContext(dn),p=i5(),y=n5(c,{relative:h}),d=m.toLowerCase()==="get"?"get":"post",v=typeof c=="string"&&Ry.test(c),T=R=>{if(u&&u(R),R.defaultPrevented)return;R.preventDefault();let L=R.nativeEvent.submitter,M=L?.getAttribute("formmethod")||m,k=()=>p(L||R.currentTarget,{fetcherKey:i,method:M,navigate:r,replace:o,state:_,relative:h,preventScrollReset:b,viewTransition:f,defaultShouldRevalidate:C});x&&r!==!1?U.startTransition(()=>k()):k()};return U.createElement("form",{ref:A,method:d,action:y,onSubmit:a?u:T,...E,"data-discover":!v&&e==="render"?"true":void 0})});ZE.displayName="Form";function JE(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ly(e){let i=U.useContext(so);return Nt(i,JE(e)),i}function QE(e,{target:i,replace:r,mask:a,state:o,preventScrollReset:_,relative:m,viewTransition:c,defaultShouldRevalidate:u,useTransitions:h}={}){let b=$l(),f=Ln(),C=Hl(e,{relative:m});return U.useCallback(E=>{if(ME(E,i)){E.preventDefault();let A=r!==void 0?r:Rl(f)===Rl(C),x=()=>b(e,{replace:A,mask:a,state:o,preventScrollReset:_,relative:m,viewTransition:c,defaultShouldRevalidate:u});h?U.startTransition(()=>x()):x()}},[f,b,C,r,a,o,i,e,_,m,c,u,h])}var e5=0,t5=()=>`__${String(++e5)}__`;function i5(){let{router:e}=Ly("useSubmit"),{basename:i}=U.useContext(dn),r=yE(),a=e.fetch,o=e.navigate;return U.useCallback(async(_,m={})=>{let{action:c,method:u,encType:h,formData:b,body:f}=NE(_,i);if(m.navigate===!1){let C=m.fetcherKey||t5();await a(C,r,m.action||c,{defaultShouldRevalidate:m.defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:b,body:f,formMethod:m.method||u,formEncType:m.encType||h,flushSync:m.flushSync})}else await o(m.action||c,{defaultShouldRevalidate:m.defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:b,body:f,formMethod:m.method||u,formEncType:m.encType||h,replace:m.replace,state:m.state,fromRouteId:r,flushSync:m.flushSync,viewTransition:m.viewTransition})},[a,o,i,r])}function n5(e,{relative:i}={}){let{basename:r}=U.useContext(dn),a=U.useContext(nr);Nt(a,"useFormAction must be used inside a RouteContext");let[o]=a.matches.slice(-1),_={...Hl(e||".",{relative:i})},m=Ln();if(e==null){_.search=m.search;let c=new URLSearchParams(_.search),u=c.getAll("index");if(u.some(b=>b==="")){c.delete("index"),u.filter(f=>f).forEach(f=>c.append("index",f));let b=c.toString();_.search=b?`?${b}`:""}}return(!e||e===".")&&o.route.index&&(_.search=_.search?_.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(_.pathname=_.pathname==="/"?r:Pn([r,_.pathname])),Rl(_)}function r5(e,{relative:i}={}){let r=U.useContext(Sy);Nt(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=Ly("useViewTransitionState"),o=Hl(e,{relative:i});if(!r.isTransitioning)return!1;let _=Br(r.currentLocation.pathname,a)||r.currentLocation.pathname,m=Br(r.nextLocation.pathname,a)||r.nextLocation.pathname;return Iu(o.pathname,m)!=null||Iu(o.pathname,_)!=null}var s5=dy();const a5="fleet-console.canvas.",My="fleet-console.canvas.backgroundAnimation",Dy="fleet-console.canvas.maximized",o5=400,xp=640,Ep=400,J0=40,Q0=96,l5=.25,c5=1,Mf=.2,eb=.5,u5=.001,Va={x:0,y:0,zoom:1},Ja={viewport:Va,panels:{}},Tp=new Set,Ap=new Set,kp=new Set;let Ml=null,_s=null,Ai=Ja,Eu=R5(),xl=M5(),ms=Va,Ks=null,zu=0;function h5(e){return Tp.add(e),()=>{Tp.delete(e)}}function tb(){return Ai}function d5(){return U.useSyncExternalStore(h5,tb,tb)}function f5(){return U.useSyncExternalStore(y5,ib,ib)}function Sg(){return U.useSyncExternalStore(w5,nb,nb)}function Zs(e){Ai={viewport:e.viewport??Ai.viewport,panels:e.panels??Ai.panels},E5(),By()}function Tu(e){wg();const i=Cg(e);ms=i,Zs({viewport:i})}function p5(e){const i=Cg(e);if(typeof window>"u"||typeof window.requestAnimationFrame!="function"||x5()){Tu(i);return}ms=i,Ks===null&&(Ks=window.requestAnimationFrame(Iy))}function El(e,i){const r=Pl();Zs({panels:{...Ai.panels,[e]:{...xg(i,r),zIndex:r}}})}function Pl(){return zu+=1,zu}function Oy(e){const i=Ai.panels[e];if(i)return i;const r=Object.keys(Ai.panels).length,a={x:r*J0,y:r*J0,width:xp,height:Ep,zIndex:Pl()};return Zs({panels:{...Ai.panels,[e]:a}}),a}function g5(e){const i=new Set(e),r={};let a=!1;for(const[o,_]of Object.entries(Ai.panels))i.has(o)?r[o]=_:a=!0;a&&Zs({panels:r})}function m5(e){T5(),wg(),Ml=e,Ai=e?k5(e):Ja,ms=Ai.viewport,zu=Math.max(zu,$y(Ai.panels)),By()}function Ny(e,i){const r=Ai.panels[e];if(!r)return;const a=Math.max(l5,Math.min(c5,Math.min((i.width-Q0)/r.width,(i.height-Q0)/r.height))),o={x:i.width/2-(r.x+r.width/2)*a,y:i.height/2-(r.y+r.height/2)*a,zoom:a};wg(),ms=o;const _=Pl();Zs({viewport:o,panels:{...Ai.panels,[e]:{...xg(r,_),zIndex:_}}})}function _5(){Eu=!Eu,L5(Eu),S5()}function v5(){b5(!xl)}function b5(e){xl!==e&&(xl=e,D5(xl),C5())}function y5(e){return Ap.add(e),()=>{Ap.delete(e)}}function ib(){return Eu}function By(){for(const e of Tp)e()}function S5(){for(const e of Ap)e()}function w5(e){return kp.add(e),()=>{kp.delete(e)}}function nb(){return xl}function C5(){for(const e of kp)e()}function Iy(){const e=Ai.viewport,i=ms.x-e.x,r=ms.y-e.y,a=ms.zoom-e.zoom;if(Math.abs(i)<eb&&Math.abs(r)<eb&&Math.abs(a)<u5){Ks=null,Zs({viewport:ms});return}Zs({viewport:{x:e.x+i*Mf,y:e.y+r*Mf,zoom:e.zoom+a*Mf}}),Ks=typeof window<"u"?window.requestAnimationFrame(Iy):null}function wg(){Ks===null||typeof window>"u"||(window.cancelAnimationFrame(Ks),Ks=null)}function x5(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function E5(){!Ml||typeof window>"u"||(A5(),_s=window.setTimeout(()=>{_s=null,jy(Ml,Ai)},o5))}function T5(){!_s||!Ml||typeof window>"u"||(window.clearTimeout(_s),_s=null,jy(Ml,Ai))}function A5(){!_s||typeof window>"u"||(window.clearTimeout(_s),_s=null)}function k5(e){if(typeof window>"u")return Ja;try{const i=window.localStorage.getItem(zy(e));if(!i)return Ja;const r=JSON.parse(i);return O5(r)}catch{return Ja}}function jy(e,i){if(!(!e||typeof window>"u"))try{window.localStorage.setItem(zy(e),JSON.stringify(i))}catch{}}function R5(){if(typeof window>"u")return!0;try{const e=window.localStorage.getItem(My);return e===null?!0:e==="true"}catch{return!0}}function L5(e){if(!(typeof window>"u"))try{window.localStorage.setItem(My,String(e))}catch{}}function M5(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(Dy)==="true"}catch{return!1}}function D5(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Dy,String(e))}catch{}}function zy(e){return`${a5}${e}`}function O5(e){return Dl(e)?{viewport:Cg(e.viewport),panels:N5(e.panels)}:Ja}function Cg(e){if(!Dl(e))return Va;const i=Tl(e.x,Va.x),r=Tl(e.y,Va.y),a=Rp(e.zoom,Va.zoom);return{x:i,y:r,zoom:a}}function N5(e){if(!Dl(e))return{};const i={};for(const[r,a]of Object.entries(e))Dl(a)&&(i[r]=xg(a,B5(i)));return i}function xg(e,i){return Dl(e)?{x:Tl(e.x,0),y:Tl(e.y,0),width:Rp(e.width,xp),height:Rp(e.height,Ep),zIndex:Tl(e.zIndex,i)}:{x:0,y:0,width:xp,height:Ep,zIndex:i}}function B5(e){return $y(e)+1}function $y(e){return Math.max(0,...Object.values(e).map(i=>i.zIndex))}function Tl(e,i){return typeof e=="number"&&Number.isFinite(e)?e:i}function Rp(e,i){return typeof e=="number"&&Number.isFinite(e)&&e>0?e:i}function Dl(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Hy="fleet-console.operations.mode",Df="canvas",Lp=new Set;let Mp=z5();function Eg(){return U.useSyncExternalStore(I5,sb,sb)}function rb(e){Mp!==e&&(Mp=e,$5(e),j5())}function I5(e){return Lp.add(e),()=>{Lp.delete(e)}}function sb(){return Mp}function j5(){for(const e of Lp)e()}function z5(){if(typeof window>"u")return Df;try{const e=window.localStorage.getItem(Hy);return e==="classic"||e==="canvas"?e:Df}catch{return Df}}function $5(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Hy,e)}catch{}}const Py="fleet-console.codex.view-mode",Uy="fleet-console.codex.side-width",Of="route",vl=460,H5=120,Dp=new Set;let Op=G5(),Np=K5(),Fy=!1;function P5(){return U.useSyncExternalStore(Tg,ab,ab)}function U5(e){if(Fy=!0,Op===e){Bp();return}Op=e,Wy(Py,e),Bp()}function F5(){return U.useSyncExternalStore(Tg,lb,lb)}function q5(){return U.useSyncExternalStore(Tg,ob,ob)}function W5(e){const i=qy(e);Np!==i&&(Np=i,Wy(Uy,String(i)),Bp())}function Tg(e){return Dp.add(e),()=>{Dp.delete(e)}}function ab(){return Op}function ob(){return Np}function lb(){return Fy}function Bp(){for(const e of Dp)e()}function qy(e){return Number.isFinite(e)?Math.max(H5,Math.round(e)):vl}function G5(){if(typeof window>"u")return Of;try{const e=window.localStorage.getItem(Py);return e==="route"||e==="side"?e:Of}catch{return Of}}function K5(){if(typeof window>"u")return vl;try{const e=window.localStorage.getItem(Uy);if(e===null)return vl;const i=Number.parseInt(e,10);return Number.isNaN(i)?vl:qy(i)}catch{return vl}}function Wy(e,i){if(!(typeof window>"u"))try{window.localStorage.setItem(e,i)}catch{}}const V5=["canonicalCwd","cwd","providerSession","ticket","token","transcriptPath"];class lt extends Error{status;constructor(i,r){super(r),this.name="ApiError",this.status=i}}async function Gy(e){const i=await fetch("/observer/tenants",{signal:e});await Oi(i);const r=await i.json();if(!Array.isArray(r.tenants))throw new lt(i.status,"Invalid tenants response");return r.tenants.map(a=>oT(a,i.status))}async function Y5(e){const i=await fetch("/observer/jobs",{signal:e});return await Oi(i),(await i.json()).tenants}async function X5(e){const i=await fetch("/observer/events",{signal:e});if(await Oi(i),!i.body)throw new lt(i.status,"Observer stream unavailable");return i.body.getReader()}async function Z5(e){const i=await fetch("/observer/theaters",{signal:e});await Oi(i);const r=await i.json();if(!Array.isArray(r.theaters))throw new lt(i.status,"Invalid Theater response");const a=Array.isArray(r.agentClis)?r.agentClis.map(o=>aT(o,i.status)):[];return{theaters:r.theaters.map(o=>Zy(o,i.status)),agentClis:a}}async function Ky(e,i){const r=e?`?theaterId=${encodeURIComponent(e)}`:"",a=await fetch(`/observer/status${r}`,{signal:i});return await Oi(a),lT(await a.json(),a.status)}async function J5(e){const i=await fetch("/observer/carriers",{signal:e});await Oi(i);const r=await i.json();if(!Array.isArray(r.carriers))throw new lt(i.status,"Invalid carrier readiness response");return r.carriers.map(a=>cT(a,i.status))}async function Vy(e,i){const r=await fetch("/observer/theaters",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({folderGrantId:e}),signal:i});await Oi(r);const a=await r.json();return Zy(a,r.status)}async function $u(e,i,r){const a=await fetch(`/observer/theaters/${encodeURIComponent(e)}/sessions`,{method:"POST",...i?{headers:{"Content-Type":"application/json"},body:JSON.stringify({cliId:i})}:{},signal:r});return await Oi(a),oh(await a.json(),a.status)}async function Q5(e,i){const r=await fetch("/terminal/folders/list",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e}),signal:i});return await Oi(r),rT(await r.json(),r.status)}async function Yy(e,i){const r=await fetch("/terminal/folders/grants",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e}),signal:i});await Oi(r);const a=await r.json();if(typeof a.folderGrantId!="string")throw new lt(r.status,"Invalid folder grant response");return a.folderGrantId}async function sh(e,i){const r=await fetch(`/terminal/sessions/${encodeURIComponent(e)}`,{method:"DELETE",signal:i});await Oi(r)}async function ah(e,i){const r=await fetch(`/terminal/sessions/${encodeURIComponent(e)}/resume`,{method:"POST",signal:i});return await Oi(r),oh(await r.json(),r.status)}async function eT(e,i){const r=await fetch(`/observer/theaters/${encodeURIComponent(e)}`,{method:"DELETE",signal:i});await Oi(r)}async function Ag(e,i){const r=await fetch(`/terminal/sessions/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({label:i})});return await Oi(r),oh(await r.json(),r.status)}async function tT(e){const i=await fetch("/terminal/sessions",{signal:e});await Oi(i);const r=await i.json();if(!Array.isArray(r.sessions))throw new lt(i.status,"Invalid terminal sessions response");return r.sessions.map(a=>oh(a,i.status))}async function iT(e,i){const r=nT(i),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 Oi(a);const o=await a.json();if(typeof o.ticket!="string"||typeof o.ttlMs!="number")throw new lt(a.status,"Invalid terminal ticket response");return{ticket:o.ticket,ttlMs:o.ttlMs}}function nT(e){return e?e instanceof AbortSignal?{signal:e}:e:{}}function oh(e,i){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"||Xy(r))throw new lt(i,"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 rT(e,i){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 lt(i,"Invalid folder list response");return{path:r.path,parentPath:r.parentPath,roots:r.roots,entries:r.entries.map(a=>sT(a,i)),...r.truncated===!0?{truncated:!0}:{}}}function sT(e,i){const r=e;if(!r||typeof r.name!="string"||typeof r.path!="string"||r.kind!=="dir"||typeof r.accessible!="boolean")throw new lt(i,"Invalid folder list response");return{name:r.name,path:r.path,kind:"dir",accessible:r.accessible}}function aT(e,i){const r=e;if(!r||typeof r.id!="string"||typeof r.label!="string")throw new lt(i,"Invalid Agent CLI metadata response");return{id:r.id,label:r.label}}function oT(e,i){const r=e;if(!r||typeof r.tenantId!="string"||typeof r.tenantLabel!="string"||typeof r.createdAt!="number"||typeof r.sessions!="number"||Xy(r))throw new lt(i,"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 Xy(e){return V5.some(i=>i in e)}function lT(e,i){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 lt(i,"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 cT(e,i){const r=e;if(!r||typeof r.carrierId!="string"||typeof r.displayName!="string"||r.role!==null&&typeof r.role!="string"||typeof r.model!="string"||r.effort!==null&&typeof r.effort!="string"||typeof r.taskForceBackendCount!="number"||typeof r.subagentMode!="boolean"||r.category!==void 0&&r.category!=="strategy"&&r.category!=="planning"&&r.category!=="operations"||typeof r.slot!="number"||typeof r.cliType!="string"||"token"in r||"key"in r||"credential"in r||"cwd"in r||"path"in r||"persona"in r||"prompt"in r||"toolAllowlist"in r||"allowedExecutorTools"in r)throw new lt(i,"Invalid carrier readiness response");return{carrierId:r.carrierId,displayName:r.displayName,role:r.role,model:r.model,effort:r.effort,taskForceBackendCount:r.taskForceBackendCount,subagentMode:r.subagentMode,...r.category?{category:r.category}:{},slot:r.slot,cliType:r.cliType}}function Zy(e,i){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 lt(i,"Invalid Theater response");return{id:r.id,label:r.label,createdAt:r.createdAt,lastOpenedAt:r.lastOpenedAt,hasWiki:r.hasWiki,activeAdmiralCount:r.activeAdmiralCount}}async function Oi(e){if(e.ok)return;let i=e.statusText;try{i=(await e.json()).error??i}catch{}throw new lt(e.status,i||`HTTP ${e.status}`)}const cb=120,uT="active",Ip=new Set(["done","error","aborted"]);function hT(e,i){let r=Qy(e,i.jobId,i.updatedAt);for(const a of i.events)r=Jy(r,a);return Ip.has(i.status)&&!Ip.has(r.status)&&(r={...r,status:i.status}),r}function Jy(e,i){if(i.id<=e.lastEventId)return e;const r=i.event,a={...e,updatedAt:i.at,lastEventId:i.id,recentEvents:pT(e.recentEvents,i)};switch(i.type){case"job:registered":return dT(a,r);case"job:finalized":return{...a,status:li(r.status)??"done",finishedAt:hs(r.finishedAt)??i.at,summary:li(r.summary),error:li(r.error)};case"track:begin":return Pa(a,r,o=>({...o,startedAt:hs(r.startedAt)??i.at,requestPreview:li(r.requestPreview)}));case"track:status":return Pa(a,r,o=>({...o,status:li(r.status)??o.status}));case"track:text":return Pa(a,r,o=>({...o,status:"stream",text:o.text+(li(r.text)??""),sentTextLength:o.sentTextLength+(hs(r.textLength)??li(r.text)?.length??0)}));case"track:thought":return Pa(a,r,o=>({...o,thought:o.thought+(li(r.text)??""),sentThoughtLength:o.sentThoughtLength+(hs(r.textLength)??li(r.text)?.length??0)}));case"track:tool":return Pa(a,r,o=>({...o,status:"stream",tools:fT(o.tools,r)}));case"track:finalized":return Pa(a,r,o=>{const _=ub(o.text,o.sentTextLength,li(r.fallbackText),hs(r.fallbackTextLength)),m=ub(o.thought,o.sentThoughtLength,li(r.fallbackThought),hs(r.fallbackThoughtLength));return{...o,status:li(r.status)??"done",finishedAt:hs(r.finishedAt)??i.at,error:li(r.error),text:_.text,sentTextLength:_.sentLength,thought:m.text,sentThoughtLength:m.sentLength}});default:return a}}function Qy(e,i,r){return{jobId:i,tenantId:e,status:uT,updatedAt:r,trackOrder:[],tracks:{},lastEventId:0,recentEvents:[]}}function Qn(e){return Ip.has(e)}function dT(e,i){const r=Array.isArray(i.tracks)?i.tracks:[];let a=e.trackOrder,o=e.tracks;for(const _ of r){if(!_.trackId)continue;const m=o[_.trackId],c={...m??eS(_.trackId),displayName:_.displayName??m?.displayName??_.trackId,displayCli:_.displayCli??m?.displayCli,model:_.model??m?.model,effort:_.effort??m?.effort,subtitle:_.subtitle??m?.subtitle,kind:_.kind??m?.kind,startedAt:_.startedAt??m?.startedAt};m||(a=[...a,_.trackId]),o={...o,[_.trackId]:c}}return{...e,label:li(i.label)??e.label,ownerCarrierId:li(i.ownerCarrierId)??e.ownerCarrierId,kind:li(i.kind)??e.kind,startedAt:hs(i.startedAt)??e.startedAt,trackOrder:a,tracks:o}}function Pa(e,i,r){const a=li(i.trackId);if(!a)return e;const o=e.tracks[a],_=r(o??eS(a));return{...e,trackOrder:o?e.trackOrder:[...e.trackOrder,a],tracks:{...e.tracks,[a]:_}}}function eS(e){return{trackId:e,displayName:e,status:"queued",text:"",thought:"",sentTextLength:0,sentThoughtLength:0,tools:[]}}function ub(e,i,r,a){const o=a??r?.length??0;return r!==void 0&&o>e.length?{text:r,sentLength:Math.max(o,i)}:{text:e,sentLength:Math.max(i,o)}}function fT(e,i){const r=li(i.title)??"tool",a=li(i.status)??"",o=li(i.toolCallId),_=o??`${r}#${e.length}`;if(o){const m=e.findIndex(c=>c.key===o);if(m>=0){const c=[...e];return c[m]={key:o,title:r,status:a},c}}return[...e,{key:_,title:r,status:a}]}function pT(e,i){const r=[...e,i];return r.length>cb?r.slice(-cb):r}function li(e){return typeof e=="string"?e:void 0}function hs(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function tS(e){return new Date(e).toLocaleTimeString([],{hour12:!1})}function oo(e){return e.label?.trim()||`#${e.sequence} Operation`}function gT(e,i){const r=Math.max(0,Math.round((i-e)/1e3)),a=Math.floor(r/60),o=r%60;return a===0?`${o}s`:a<60?`${a}m ${String(o).padStart(2,"0")}s`:`${Math.floor(a/60)}h ${String(a%60).padStart(2,"0")}m`}function Ol(e){return e.length<=14?e:`${e.slice(0,6)}…${e.slice(-6)}`}function kg(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function Js(e){switch(e){case"active":return"running";case"done":return"done";case"error":return"error";case"aborted":return"aborted";default:return e}}function mT(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 Nl(e,i){return e.status==="dormant"?"tenant-beacon is-dormant":i>0?"tenant-beacon is-live":e.turnState==="running"?"tenant-beacon is-turn-running":e.turnState==="ended"?"tenant-beacon is-turn-ended":"tenant-beacon"}function bs(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 _T(e){if(e.status!=="active")return null;const i=e.trackOrder.map(o=>e.tracks[o]).filter(o=>!!o),r=i.filter(o=>o.status==="stream"||o.status==="conn"),a=r.length>0?r:i;for(let o=a.length-1;o>=0;o--){const _=a[o],m=_?vT(_):null;if(m)return m}return null}function vT(e){return hb(e.text)??hb(e.thought)??e.tools[e.tools.length-1]?.title??null}function hb(e){if(!e)return null;const i=e.split(`
|
|
12
|
+
`);for(let r=i.length-1;r>=0;r--){const a=i[r]?.trim();if(a)return a}return null}const bT="__unassigned__";function yT(e){const i=new Map(e.theaters.map(a=>[a.id,a])),r=[];for(const a of e.sessionOrder){const o=e.sessions[a];o&&o.theaterId&&r.push(CT(o,i.get(o.theaterId)))}return r}function ST(e,i){const r=iS(i);return r.length===0?e:e.filter(a=>{const o=xT(a);return r.every(_=>o.includes(_))})}function wT(e){const i=[],r=new Map;for(const a of e){const o=a.theaterId??bT,_=r.get(o);if(_!==void 0){const m=i[_];m&&(i[_]={...m,entries:[...m.entries,a]});continue}r.set(o,i.length),i.push({theaterId:a.theaterId,theaterLabel:a.theaterLabel,entries:[a]})}return i}function iS(e){return e.trim().toLocaleLowerCase().split(/\s+/).filter(Boolean)}function CT(e,i){return{sessionId:e.sessionId,theaterId:e.theaterId??null,theaterLabel:i?.label??e.theaterId??"",operationName:oo(e),cliLabel:e.cliLabel,status:e.status}}function xT(e){return[e.operationName,e.theaterLabel,e.cliLabel??""].join(" ").toLocaleLowerCase()}const jp=200,zp="fleet-console.activeTheaterId",nS="fleet-console.activeTheme",rS="fleet-console.terminalRenderer",sS="fleet-console.expandedSessions",aS="fleet-console.commissioningSeen",Nf="maritime",Bf="webgl",db="shell",$p=new Set;let be={connection:"connecting",connectionError:null,activeTheme:gS(),terminalRenderer:MT(),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,shellOpen:!1,operationSearchOpen:!1,shortcutsOpen:!1,onboardingOpen:!1,bootstrapped:!1,pendingOperationFocus:null,selectedJobId:null,expandedSessionIds:eA(),operationToasts:[]};const ET=1e4;let fb=0;function pb(){return be}function TT(e){return $p.add(e),()=>{$p.delete(e)}}function Pe(e){be={...be,...e},mS()}function AT(e){be.operationsViewActive!==e&&Pe({operationsViewActive:e})}function kT(){oS(gS())}function RT(e){iA(e),oS(e),Pe({activeTheme:e})}function LT(e){nA(e),Pe({terminalRenderer:e})}function MT(){if(typeof window>"u")return Bf;try{const e=window.localStorage.getItem(rS);return e==="webgl"||e==="dom"?e:Bf}catch{return Bf}}function DT(e){Pe({updateAvailable:e.updateAvailable,latestVersion:e.latestVersion??null})}function oS(e){if(!(typeof document>"u")){if(e==="maritime"){document.documentElement.removeAttribute("data-theme");return}document.documentElement.setAttribute("data-theme",e)}}function OT(e){const i={};for(const o of e)i[o.sessionId]=dh(o);const r=[...e].sort((o,_)=>_.createdAt-o.createdAt).map(o=>o.sessionId),a=fS(i,be.tenants);Pe({sessions:a,sessionOrder:r,activeTerminalSessionId:ys(be.activeTheaterId,a,r,be.activeTerminalSessionId)})}function NT(e){const i=pS(e.theaters,be.activeTheaterId);Pe({theaters:e.theaters,agentClis:e.agentClis,activeTheaterId:i,activeTerminalSessionId:ys(i,be.sessions,be.sessionOrder,be.activeTerminalSessionId),selectedJobId:null})}function BT(e){fh(e),Pe({activeTheaterId:e,activeTerminalSessionId:ys(e,be.sessions,be.sessionOrder,null),selectedJobId:null})}function lS(){Pe({addingTheater:!0,theaterError:null})}function cS(e){const i=[e,...be.theaters.filter(r=>r.id!==e.id)];fh(e.id),Pe({theaters:i,activeTheaterId:e.id,addingTheater:!1,theaterError:null,activeTerminalSessionId:ys(e.id,be.sessions,be.sessionOrder,null),selectedJobId:null})}function IT(){Pe({addingTheater:!1,theaterError:null})}function Hp(e){Pe({addingTheater:!1,theaterError:e})}function kn(e){Pe({activeTerminalSessionId:e,selectedJobId:null})}function Rg(e){const i=be.sessions[e];i&&(fh(i.theaterId??null),Pe({activeTheaterId:i.theaterId??null,activeTerminalSessionId:e,selectedJobId:null,pendingOperationFocus:e}))}function If(){be.pendingOperationFocus!==null&&Pe({pendingOperationFocus:null})}function jT(e,i,r){if(e.length===0)return null;const a=i?e.indexOf(i):-1,o=a===-1?r>0?0:e.length-1:(a+r+e.length)%e.length;return e[o]??null}function jf(){Pe({operationSearchOpen:!1})}function zT(){Pe({operationSearchOpen:!be.operationSearchOpen})}function Hu(){Pe({creatingTerminalSession:!0,terminalSessionError:null})}function Pu(e){const i=dh(e);Pe({sessions:{...be.sessions,[i.sessionId]:i},sessionOrder:[i.sessionId,...be.sessionOrder.filter(r=>r!==i.sessionId)],activeTerminalSessionId:!be.activeTheaterId||Fu(i,be.activeTheaterId)?i.sessionId:be.activeTerminalSessionId,creatingTerminalSession:!1,terminalSessionError:null,selectedJobId:null})}function vs(e){const i=be.sessions[e.sessionId],r=dh({...i??{},...e}),a=!!i,o={...be.sessions,[r.sessionId]:r},_=a?be.sessionOrder:[r.sessionId,...be.sessionOrder.filter(c=>c!==r.sessionId)],m=i?JT(i,r):[];Pe({sessions:o,sessionOrder:_,activeTerminalSessionId:ys(be.activeTheaterId,o,_,be.activeTerminalSessionId),operationToasts:m.length>0?[...be.operationToasts,...m]:be.operationToasts})}function $T(e){const i=be.sessions[e.sessionId]??dh(e);be.operationsViewActive&&Mg(i)||be.operationToasts.some(r=>r.kind==="input-waiting"&&r.sessionId===e.sessionId)||Pe({operationToasts:[...be.operationToasts,Dg("input-waiting",i)]})}function zf(e){Pe({operationToasts:be.operationToasts.filter(i=>i.id!==e)})}function Uu(e){Pe({creatingTerminalSession:!1,terminalSessionError:e})}function HT(){Pe({timelineOpen:!be.timelineOpen})}function uS(){if(be.shellOpen){bl();return}Pe({shellOpen:!0})}function bl(){be.shellOpen&&Pe({shellOpen:!1})}function PT(){be.shortcutsOpen||Pe({shortcutsOpen:!0})}function $f(){be.shortcutsOpen&&Pe({shortcutsOpen:!1})}function gb(){be.onboardingOpen||Pe({onboardingOpen:!0})}function ol(){rA(!0),be.onboardingOpen&&Pe({onboardingOpen:!1})}function mb(){if(be.bootstrapped)return;const e=be.theaters.length===0&&!tA();Pe({bootstrapped:!0,onboardingOpen:e?!0:be.onboardingOpen})}function UT(e){const i=be.expandedSessionIds.includes(e)?be.expandedSessionIds.filter(r=>r!==e):[...be.expandedSessionIds,e];Og(i),Pe({expandedSessionIds:i})}function lh(e){Pe({terminalSessionError:e})}function ch(e){Pe({terminalSessionError:e})}function Lg(e){Pe({terminalSessionError:e})}function _b(e){const i=be.theaters.filter(m=>m.id!==e),r={},a=[];for(const m of be.sessionOrder){const c=be.sessions[m];!c||c.theaterId===e||(r[m]=c,a.push(m))}const o=pS(i,be.activeTheaterId===e?null:be.activeTheaterId),_=be.expandedSessionIds.filter(m=>r[m]);fh(o),Og(_),Pe({theaters:i,sessions:r,sessionOrder:a,activeTheaterId:o,activeTerminalSessionId:ys(o,r,a,be.activeTerminalSessionId),selectedJobId:null,expandedSessionIds:_})}function Ul(e){if(!be.sessions[e])return;const i={...be.sessions};delete i[e];const r=be.sessionOrder.filter(_=>_!==e),a=be.expandedSessionIds.filter(_=>_!==e),o=be.activeTerminalSessionId===e;Og(a),Pe({sessions:i,sessionOrder:r,activeTerminalSessionId:o?ys(be.activeTheaterId,i,r,null):be.activeTerminalSessionId,selectedJobId:o?null:be.selectedJobId,expandedSessionIds:a})}function uh(e){Pe({selectedJobId:be.selectedJobId===e?null:e})}function Hf(){Pe({selectedJobId:null})}function hS(e){const i=new Set(e.map(o=>o.tenantId)),r=fS(be.sessions,e),a=[...e.map(o=>o.tenantId),...be.tenantOrder.filter(o=>!i.has(o)&&be.tenantJobs[o])];Pe({tenants:e,sessions:r,tenantOrder:a,activeTerminalSessionId:ys(be.activeTheaterId,r,be.sessionOrder,be.activeTerminalSessionId)})}function FT(e){const i={},r=[];for(const o of e){const _={};for(const c of o.jobs)_[c.jobId]=hT(o.tenantId,c);const m=Object.values(_).sort((c,u)=>(c.startedAt??c.updatedAt)-(u.startedAt??u.updatedAt)).map(c=>c.jobId);i[o.tenantId]={tenantId:o.tenantId,tenantLabel:o.tenantLabel,jobOrder:m,jobs:_,truncation:o.truncation},r.push(o.tenantId)}const a=[...be.tenantOrder.filter(o=>i[o]),...r.filter(o=>!be.tenantOrder.includes(o))];Pe({tenantJobs:i,tenantOrder:a.length>0?a:r})}function qT(e,i){const r=be.tenantJobs[e.tenantId],a=!r&&!be.tenants.some(u=>u.tenantId===e.tenantId),o=r??{tenantId:e.tenantId,tenantLabel:i,jobOrder:[],jobs:{},truncation:{droppedCount:0}};let _=i&&o.tenantLabel!==i?{...o,tenantLabel:i}:o,m=null;if(e.jobId){const u=_.jobs[e.jobId];if(!u&&Date.now()-e.at<ET){const f=be.sessions[e.tenantId];f&&!Mg(f)&&(m=Dg("carrier-call",f))}const h=Jy(u??Qy(e.tenantId,e.jobId,e.at),e),b=u?_.jobOrder:[..._.jobOrder,e.jobId];_={..._,jobs:sA({..._.jobs,[e.jobId]:h},b),jobOrder:b.slice(-jp)}}const c={...be.tenantJobs,[e.tenantId]:_};return be={...be,connection:"live",connectionError:null,tenantJobs:c,tenantOrder:be.tenantOrder.includes(e.tenantId)?be.tenantOrder:[...be.tenantOrder,e.tenantId],operationToasts:m?[...be.operationToasts,m]:be.operationToasts},mS(),{unknownTenant:a}}function WT(e,i,r){const a=be.tenantJobs[e]??{tenantId:e,tenantLabel:i,jobOrder:[],jobs:{},truncation:{droppedCount:0}};Pe({tenantJobs:{...be.tenantJobs,[e]:{...a,truncation:r}},tenantOrder:be.tenantOrder.includes(e)?be.tenantOrder:[...be.tenantOrder,e]})}function GT(e){if(!e.selectedJobId||e.activeTheaterId&&e.activeTerminalSessionId&&!Qs(e).includes(e.activeTerminalSessionId))return null;const i=KT(e);return i?e.tenantJobs[i]?.jobs[e.selectedJobId]??null:null}function KT(e){return e.activeTerminalSessionId?dS(e.sessions[e.activeTerminalSessionId]):null}function VT(e){return Qs(e).map(i=>e.sessions[i]).filter(i=>!!i)}function Qs(e){return e.activeTheaterId?e.sessionOrder.filter(i=>Fu(e.sessions[i],e.activeTheaterId)):[]}function YT(e){return yT(e)}function hh(e,i){const r=dS(i);if(!r)return[];const a=e.tenantJobs[r];if(!a)return[];const o=[];for(const _ of a.jobOrder){const m=a.jobs[_];m&&o.push({job:m,tenant:a})}return o}function XT(e,i){return i?e.expandedSessionIds.includes(i):!1}function dS(e){return e?.tenantId??e?.sessionId??null}function dh(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 Mg(e){return be.activeTheaterId===(e.theaterId??null)&&be.activeTerminalSessionId===e.sessionId}function ZT(e){return e?be.theaters.find(i=>i.id===e)?.label??e:"—"}function Dg(e,i){return fb+=1,{id:fb,kind:e,sessionId:i.sessionId,theaterLabel:ZT(i.theaterId),operationLabel:oo(i)}}function JT(e,i){return Mg(i)?[]:e.turnState!=="ended"&&i.turnState==="ended"?[Dg("ended",i)]:[]}function fS(e,i){const r={...e};for(const a of i){if(!a.terminalSessionId)continue;const o=r[a.terminalSessionId];o&&(r[a.terminalSessionId]={...o,status:a.status==="closed"?"closed":a.status==="dormant"?"dormant":"registered",tenantId:a.tenantId,registrationId:a.registrationId,theaterId:a.theaterId??o.theaterId})}return r}function pS(e,i){const r=new Set(e.map(o=>o.id)),a=QT();return a&&r.has(a)?a:i&&r.has(i)?i:e[0]?.id??null}function ys(e,i,r,a){return e?a&&Fu(i[a],e)&&su(i[a])?a:r.find(o=>Fu(i[o],e)&&su(i[o]))??null:a&&i[a]&&su(i[a])?a:r.find(o=>su(i[o]))??null}function Fu(e,i){return!e||!i?!1:e.theaterId===i}function su(e){return!!(e&&e.status!=="dormant")}function QT(){if(typeof window>"u")return null;try{return window.localStorage.getItem(zp)}catch{return null}}function fh(e){if(!(typeof window>"u"))try{e?window.localStorage.setItem(zp,e):window.localStorage.removeItem(zp)}catch{}}function gS(){if(typeof window>"u")return Nf;try{const e=window.localStorage.getItem(nS);return e==="maritime"||e==="carbon"?e:Nf}catch{return Nf}}function eA(){if(typeof window>"u")return[];try{const e=window.localStorage.getItem(sS);if(!e)return[];const i=JSON.parse(e);return Array.isArray(i)?i.filter(r=>typeof r=="string"):[]}catch{return[]}}function tA(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(aS)==="1"}catch{return!1}}function iA(e){if(!(typeof window>"u"))try{window.localStorage.setItem(nS,e)}catch{}}function nA(e){if(!(typeof window>"u"))try{window.localStorage.setItem(rS,e)}catch{}}function Og(e){if(!(typeof window>"u"))try{window.localStorage.setItem(sS,JSON.stringify(e))}catch{}}function rA(e){if(!(typeof window>"u"))try{window.localStorage.setItem(aS,e?"1":"0")}catch{}}function sA(e,i){if(i.length<=jp)return e;const r=new Set(i.slice(-jp)),a={};for(const o of Object.keys(e))r.has(o)&&(a[o]=e[o]);return a}function mS(){for(const e of $p)e()}const au="directory-browser-sectors";function _S({open:e,onCancel:i,onConfirm:r}){const[a,o]=U.useState(null),[_,m]=U.useState(null),[c,u]=U.useState(null),[h,b]=U.useState(""),[f,C]=U.useState(0),E=U.useRef(null),A=U.useRef(null),x=async(B,W)=>{m(B),u(null),b(""),C(0);try{const F=await Q5(B,W);o(F)}catch(F){if(F instanceof DOMException&&F.name==="AbortError")return;u(F instanceof lt?F.message:String(F))}finally{m(null)}};U.useEffect(()=>{if(!e)return;const B=new AbortController;return x(null,B.signal),()=>B.abort()},[e]),U.useEffect(()=>{e&&E.current?.focus()},[e,a?.path]);const p=a?.entries??[],y=U.useMemo(()=>{const B=h.trim().toLowerCase();return B===""?p:p.filter(W=>W.name.toLowerCase().includes(B))},[p,h]),d=U.useMemo(()=>a?aA(a):[],[a]),v=y.length===0?-1:Math.min(f,y.length-1);if(U.useEffect(()=>{if(v<0)return;A.current?.querySelector(`[data-index="${v}"]`)?.scrollIntoView({block:"nearest"})},[v,a?.path]),!e)return null;const T=B=>{B.accessible&&_===null&&x(B.path)},R=()=>{a?.parentPath!=null&&_===null&&x(a.parentPath)},L=a?.path??null,M=v>=0?`${au}-${v}`:void 0,k=B=>{switch(B.key){case"Escape":h!==""?b(""):i();return;case"ArrowDown":B.preventDefault(),C(W=>Math.min(W+1,Math.max(y.length-1,0)));return;case"ArrowUp":B.preventDefault(),C(W=>Math.max(W-1,0));return;case"Enter":{B.preventDefault();const W=y[v];W&&T(W);return}case"Backspace":h===""&&(B.preventDefault(),R());return;default:return}};return s5.createPortal(S.jsxs("div",{className:"directory-browser-overlay",role:"presentation",children:[S.jsx("button",{type:"button",className:"directory-browser-scrim","aria-label":"Close",onClick:i}),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(lA,{})}),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:i,"aria-label":"Close",children:"×"})]}),S.jsx("nav",{className:"directory-browser-course","aria-label":"Path",children:d.map((B,W)=>{const F=W===d.length-1;return S.jsxs("span",{className:"directory-browser-course-seg",children:[W>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||_!==null,title:B.path,onClick:()=>{x(B.path)},children:B.label})]},B.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(uA,{})}),S.jsx("input",{ref:E,type:"text",className:"directory-browser-filter-input",placeholder:"Filter sectors…","aria-label":"Filter folders","aria-controls":au,value:h,spellCheck:!1,autoComplete:"off",onChange:B=>{b(B.target.value),C(0)}})]}),S.jsxs("button",{type:"button",className:"directory-browser-up",disabled:a?.parentPath==null||_!==null,title:"Up one sector (Backspace)",onClick:R,children:[S.jsx(hA,{}),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:au,role:"listbox","aria-label":"Folders","aria-busy":_!==null,"aria-activedescendant":M,ref:A,children:_!==null?S.jsxs("p",{className:"directory-browser-state is-live",children:[S.jsx("span",{className:"directory-browser-scan-dot","aria-hidden":"true"}),"Scouting…"]}):y.length===0?S.jsx("p",{className:"directory-browser-state",children:h!==""?"No sectors match the filter.":"No sectors to advance into."}):y.map((B,W)=>S.jsxs("div",{id:`${au}-${W}`,"data-index":W,role:"option","aria-selected":W===v,"aria-disabled":!B.accessible,className:`directory-browser-sector ${W===v?"is-active":""} ${B.accessible?"":"is-locked"}`,title:B.path,onClick:()=>{C(W),T(B)},children:[S.jsx("span",{className:"directory-browser-sector-glyph","aria-hidden":"true",children:S.jsx(cA,{})}),S.jsx("span",{className:"directory-browser-sector-name",children:B.name}),B.accessible?S.jsx("span",{className:"directory-browser-sector-advance","aria-hidden":"true",children:"›"}):S.jsxs("span",{className:"directory-browser-sector-lock",children:[S.jsx(dA,{})," Locked"]})]},B.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:L??"",children:L??"Scouting…"})]}),S.jsxs("div",{className:"directory-browser-buttons",children:[S.jsx("button",{type:"button",className:"directory-browser-button",onClick:i,children:"Cancel"}),S.jsx("button",{type:"button",className:"directory-browser-button is-primary",disabled:L===null||_!==null,onClick:()=>L&&r(L),children:"Establish Theater"})]})]})]})]}),document.body)}function aA(e){if(oA(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:\\",o=[{label:a,path:a}];let _=a.replace(/\\$/,"");for(const m of e.path.slice(a.length).split("\\").filter(Boolean))_+=`\\${m}`,o.push({label:m,path:_});return o}function oA(e){return e.roots.some(i=>/^[A-Za-z]:\\$/.test(i))||/^[A-Za-z]:\\/.test(e.path)?"\\":"/"}function lA(){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 cA(){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 uA(){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 hA(){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 dA(){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 fA=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function pA({state:e}){const[i,r]=U.useState(!1),a=U.useRef(null),o=U.useRef(null),_=U.useRef(null),m=e.theaters.length>0;if(U.useEffect(()=>{if(e.onboardingOpen)return a.current=document.activeElement,o.current?.focus(),()=>{const b=a.current;a.current=null,b?.focus?.()}},[e.onboardingOpen]),U.useEffect(()=>{if(!e.onboardingOpen)return;const b=f=>{i||(f.key==="Escape"?(f.preventDefault(),ol()):f.key==="Tab"&&gA(f,_.current),f.stopImmediatePropagation())};return window.addEventListener("keydown",b,!0),()=>window.removeEventListener("keydown",b,!0)},[i,e.onboardingOpen]),!e.onboardingOpen)return null;const c=()=>{r(!0)},u=()=>{r(!1)},h=async b=>{r(!1),lS();try{const f=await Yy(b),C=await Vy(f);cS(C)}catch(f){Hp(f instanceof Error?f.message:String(f))}};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:ol,"aria-label":"Close Commissioning guide"}),S.jsxs("section",{className:"commissioning-card",ref:_,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(Ll,{ref:b=>{o.current=b},className:"commissioning-primary-action",to:"/operations",onClick:ol,children:"Go to Operations →"}):S.jsx("button",{ref:b=>{o.current=b},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(Ll,{className:"commissioning-secondary-link",to:"/operations",onClick:ol,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:ol,children:"Skip for now"})]})]}),S.jsx(_S,{open:i,onCancel:u,onConfirm:h})]})}function gA(e,i){if(!i)return;const r=Array.from(i.querySelectorAll(fA)),a=r[0],o=r[r.length-1];!a||!o||(e.shiftKey&&document.activeElement===a?(e.preventDefault(),o.focus()):!e.shiftKey&&document.activeElement===o&&(e.preventDefault(),a.focus()))}const vS=[{title:"Console",entries:[{combos:[["Mod","K"]],description:"Search Operations across Theaters"},{combos:[["Mod","`"]],description:"Toggle the local shell"},{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 (also in Helm)"},{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"}]}],mA=/mac|iphone|ipad|ipod/i,_A=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function vA({state:e}){const i=U.useRef(null),r=U.useRef(null),a=U.useRef(null);if(e.shortcutsOpen&&i.current===null&&(i.current=document.activeElement),U.useEffect(()=>{if(!e.shortcutsOpen)return;const _=m=>{m.key==="Escape"?($f(),m.preventDefault()):m.key==="Tab"&&yA(m,a.current),m.stopImmediatePropagation()};return r.current?.focus(),window.addEventListener("keydown",_,!0),()=>{window.removeEventListener("keydown",_,!0);const m=i.current;i.current=null,m?.focus?.()}},[e.shortcutsOpen]),!e.shortcutsOpen)return null;const o=bA();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:$f,"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:$f,"aria-label":"Close keyboard shortcuts",children:"×"}),S.jsx("div",{className:"shortcuts-overlay-groups",children:vS.map(_=>S.jsxs("section",{className:"shortcuts-group","aria-labelledby":`shortcuts-${_.title.toLowerCase()}`,children:[S.jsx("h3",{id:`shortcuts-${_.title.toLowerCase()}`,children:_.title}),S.jsx("dl",{className:"shortcuts-list",children:_.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"?o:h},h))})]},`${m.description}:${c.join("+")}`))}),S.jsx("dd",{children:m.description})]},`${_.title}:${m.description}`))})]},_.title))})]})]})}function bA(){const i=navigator.userAgentData?.platform??navigator.platform;return mA.test(i)?"⌘":"Ctrl"}function yA(e,i){if(!i)return;const r=Array.from(i.querySelectorAll(_A)),a=r[0],o=r[r.length-1];!a||!o||(e.shiftKey&&document.activeElement===a?(e.preventDefault(),o.focus()):!e.shiftKey&&document.activeElement===o&&(e.preventDefault(),a.focus()))}var Pf={exports:{}},vb;function SA(){return vb||(vb=1,(function(e,i){(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(o){this._terminal=o}dispose(){}fit(){const o=this.proposeDimensions();if(!o||!this._terminal||isNaN(o.cols)||isNaN(o.rows))return;const _=this._terminal._core;this._terminal.rows===o.rows&&this._terminal.cols===o.cols||(_._renderService.clear(),this._terminal.resize(o.cols,o.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const o=this._terminal._core,_=o._renderService.dimensions;if(_.css.cell.width===0||_.css.cell.height===0)return;const m=this._terminal.options.scrollback===0?0:o.viewport.scrollBarWidth,c=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(c.getPropertyValue("height")),h=Math.max(0,parseInt(c.getPropertyValue("width"))),b=window.getComputedStyle(this._terminal.element),f=u-(parseInt(b.getPropertyValue("padding-top"))+parseInt(b.getPropertyValue("padding-bottom"))),C=h-(parseInt(b.getPropertyValue("padding-right"))+parseInt(b.getPropertyValue("padding-left")))-m;return{cols:Math.max(2,Math.floor(C/_.css.cell.width)),rows:Math.max(1,Math.floor(f/_.css.cell.height))}}}})(),r})()))})(Pf)),Pf.exports}var wA=SA(),Au={exports:{}},CA=Au.exports,bb;function xA(){return bb||(bb=1,(function(e,i){(function(r,a){e.exports=a()})(CA,(()=>(()=>{var r={433:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeV11=void 0;const h=u(938),b=[[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]],f=[[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]],E=[[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(p,y){let d,v=0,T=y.length-1;if(p<y[0][0]||p>y[T][1])return!1;for(;T>=v;)if(d=v+T>>1,p>y[d][1])v=d+1;else{if(!(p<y[d][0]))return!0;T=d-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 p=0;p<b.length;++p)A.fill(0,b[p][0],b[p][1]+1);for(let p=0;p<C.length;++p)A.fill(2,C[p][0],C[p][1]+1)}}wcwidth(p){return p<32?0:p<127?1:p<65536?A[p]:x(p,f)?0:x(p,E)?2:1}charProperties(p,y){let d=this.wcwidth(p),v=d===0&&y!==0;if(v){const T=h.UnicodeService.extractWidth(y);T===0?v=!1:T>d&&(d=T)}return h.UnicodeService.createPropertyValue(0,d,v)}}},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 b=[];for(let f=0;f<this._listeners.length;f++)b.push(this._listeners[f]);for(let f=0;f<b.length;f++)b[f].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((b=>h.fire(b)))},c.runAndSubscribe=function(u,h){return h(void 0),u((b=>h(b)))}},490:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeV6=void 0;const h=u(938),b=[[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]],f=[[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 E=0;E<b.length;++E)C.fill(0,b[E][0],b[E][1]+1)}}wcwidth(E){return E<32?0:E<127?1:E<65536?C[E]:(function(A,x){let p,y=0,d=x.length-1;if(A<x[0][0]||A>x[d][1])return!1;for(;d>=y;)if(p=y+d>>1,A>x[p][1])y=p+1;else{if(!(A<x[p][0]))return!0;d=p-1}return!1})(E,f)?0:E>=131072&&E<=196605||E>=196608&&E<=262141?2:1}charProperties(E,A){let x=this.wcwidth(E),p=x===0&&A!==0;if(p){const y=h.UnicodeService.extractWidth(A);y===0?p=!1:y>x&&(x=y)}return h.UnicodeService.createPropertyValue(0,x,p)}}},938:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeService=void 0;const h=u(345),b=u(490);class f{static extractShouldJoin(E){return(1&E)!=0}static extractWidth(E){return E>>1&3}static extractCharKind(E){return E>>3}static createPropertyValue(E,A,x=!1){return(16777215&E)<<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 E=new b.UnicodeV6;this.register(E),this._active=E.version,this._activeProvider=E}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(E){if(!this._providers[E])throw new Error(`unknown Unicode version "${E}"`);this._active=E,this._activeProvider=this._providers[E],this._onChange.fire(E)}register(E){this._providers[E.version]=E}wcwidth(E){return this._activeProvider.wcwidth(E)}getStringCellWidth(E){let A=0,x=0;const p=E.length;for(let y=0;y<p;++y){let d=E.charCodeAt(y);if(55296<=d&&d<=56319){if(++y>=p)return A+this.wcwidth(d);const R=E.charCodeAt(y);56320<=R&&R<=57343?d=1024*(d-55296)+R-56320+65536:A+=this.wcwidth(R)}const v=this.charProperties(d,x);let T=f.extractWidth(v);f.extractShouldJoin(v)&&(T-=f.extractWidth(x)),A+=T,x=v}return A}charProperties(E,A){return this._activeProvider.charProperties(E,A)}}c.UnicodeService=f}},a={};function o(m){var c=a[m];if(c!==void 0)return c.exports;var u=a[m]={exports:{}};return r[m](u,u.exports,o),u.exports}var _={};return(()=>{var m=_;Object.defineProperty(m,"__esModule",{value:!0}),m.Unicode11Addon=void 0;const c=o(433);m.Unicode11Addon=class{activate(u){u.unicode.register(new c.UnicodeV11)}dispose(){}}})(),_})()))})(Au)),Au.exports}var EA=xA();var TA=(e,i,r,a)=>{for(var o=i,_=e.length-1,m;_>=0;_--)(m=e[_])&&(o=m(o)||o);return o},AA=(e,i)=>(r,a)=>i(r,a,e),kA=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?yb.isErrorNoTelemetry(e)?new yb(e.message+`
|
|
13
|
+
|
|
14
|
+
`+e.stack):new Error(e.message+`
|
|
15
|
+
|
|
16
|
+
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(i=>{i(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)}},RA=new kA;function Uf(e){LA(e)||RA.onUnexpectedError(e)}var Pp="Canceled";function LA(e){return e instanceof MA?!0:e instanceof Error&&e.name===Pp&&e.message===Pp}var MA=class extends Error{constructor(){super(Pp),this.name=this.message}},yb=class Up extends Error{constructor(i){super(i),this.name="CodeExpectedError"}static fromError(i){if(i instanceof Up)return i;let r=new Up;return r.message=i.message,r.stack=i.stack,r}static isErrorNoTelemetry(i){return i.name==="CodeExpectedError"}},DA;(e=>{function i(_){return _<0}e.isLessThan=i;function r(_){return _<=0}e.isLessThanOrEqual=r;function a(_){return _>0}e.isGreaterThan=a;function o(_){return _===0}e.isNeitherLessOrGreaterThan=o,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(DA||={});function OA(e,i){let r=this,a=!1,o;return function(){return a||(a=!0,i||(o=e.apply(r,arguments))),o}}var bS;(e=>{function i(T){return T&&typeof T=="object"&&typeof T[Symbol.iterator]=="function"}e.is=i;let r=Object.freeze([]);function a(){return r}e.empty=a;function*o(T){yield T}e.single=o;function _(T){return i(T)?T:o(T)}e.wrap=_;function m(T){return T||r}e.from=m;function*c(T){for(let R=T.length-1;R>=0;R--)yield T[R]}e.reverse=c;function u(T){return!T||T[Symbol.iterator]().next().done===!0}e.isEmpty=u;function h(T){return T[Symbol.iterator]().next().value}e.first=h;function b(T,R){let L=0;for(let M of T)if(R(M,L++))return!0;return!1}e.some=b;function f(T,R){for(let L of T)if(R(L))return L}e.find=f;function*C(T,R){for(let L of T)R(L)&&(yield L)}e.filter=C;function*E(T,R){let L=0;for(let M of T)yield R(M,L++)}e.map=E;function*A(T,R){let L=0;for(let M of T)yield*R(M,L++)}e.flatMap=A;function*x(...T){for(let R of T)yield*R}e.concat=x;function p(T,R,L){let M=L;for(let k of T)M=R(M,k);return M}e.reduce=p;function*y(T,R,L=T.length){for(R<0&&(R+=T.length),L<0?L+=T.length:L>T.length&&(L=T.length);R<L;R++)yield T[R]}e.slice=y;function d(T,R=Number.POSITIVE_INFINITY){let L=[];if(R===0)return[L,T];let M=T[Symbol.iterator]();for(let k=0;k<R;k++){let B=M.next();if(B.done)return[L,e.empty()];L.push(B.value)}return[L,{[Symbol.iterator](){return M}}]}e.consume=d;async function v(T){let R=[];for await(let L of T)R.push(L);return Promise.resolve(R)}e.asyncToArray=v})(bS||={});function yS(e){if(bS.is(e)){let i=[];for(let r of e)if(r)try{r.dispose()}catch(a){i.push(a)}if(i.length===1)throw i[0];if(i.length>1)throw new AggregateError(i,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function SS(...e){return Di(()=>yS(e))}function Di(e){return{dispose:OA(()=>{e()})}}var wS=class CS{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{yS(this._toDispose)}finally{this._toDispose.clear()}}add(i){if(!i)return i;if(i===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?CS.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(i),i}delete(i){if(i){if(i===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(i),i.dispose()}}deleteAndLeak(i){i&&this._toDispose.has(i)&&(this._toDispose.delete(i),void 0)}};wS.DISABLE_DISPOSED_WARNING=!1;var Qa=wS,qn=class{constructor(){this._store=new Qa,this._store}dispose(){this._store.dispose()}_register(i){if(i===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(i)}};qn.None=Object.freeze({dispose(){}});var ll=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(i){this._isDisposed||i===this._value||(this._value?.dispose(),this._value=i)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let i=this._value;return this._value=void 0,i}},Ng=typeof process<"u"&&"title"in process,ph=Ng?"node":navigator.userAgent,NA=Ng?"node":navigator.platform,BA=ph.includes("Firefox"),IA=ph.includes("Edge"),xS=/^((?!chrome|android).)*safari/i.test(ph);function jA(){if(!xS)return 0;let e=ph.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}NA.indexOf("Linux")>=0;var zA="",pi=0,gi=0,mi=0,Gt=0,xn={css:"#00000000",rgba:0},ji;(e=>{function i(o,_,m,c){return c!==void 0?`#${Hs(o)}${Hs(_)}${Hs(m)}${Hs(c)}`:`#${Hs(o)}${Hs(_)}${Hs(m)}`}e.toCss=i;function r(o,_,m,c=255){return(o<<24|_<<16|m<<8|c)>>>0}e.toRgba=r;function a(o,_,m,c){return{css:e.toCss(o,_,m,c),rgba:e.toRgba(o,_,m,c)}}e.toColor=a})(ji||={});var yl;(e=>{function i(u,h){if(Gt=(h.rgba&255)/255,Gt===1)return{css:h.css,rgba:h.rgba};let b=h.rgba>>24&255,f=h.rgba>>16&255,C=h.rgba>>8&255,E=u.rgba>>24&255,A=u.rgba>>16&255,x=u.rgba>>8&255;pi=E+Math.round((b-E)*Gt),gi=A+Math.round((f-A)*Gt),mi=x+Math.round((C-x)*Gt);let p=ji.toCss(pi,gi,mi),y=ji.toRgba(pi,gi,mi);return{css:p,rgba:y}}e.blend=i;function r(u){return(u.rgba&255)===255}e.isOpaque=r;function a(u,h,b){let f=Vs.ensureContrastRatio(u.rgba,h.rgba,b);if(f)return ji.toColor(f>>24&255,f>>16&255,f>>8&255)}e.ensureContrastRatio=a;function o(u){let h=(u.rgba|255)>>>0;return[pi,gi,mi]=Vs.toChannels(h),{css:ji.toCss(pi,gi,mi),rgba:h}}e.opaque=o;function _(u,h){return Gt=Math.round(h*255),[pi,gi,mi]=Vs.toChannels(u.rgba),{css:ji.toCss(pi,gi,mi,Gt),rgba:ji.toRgba(pi,gi,mi,Gt)}}e.opacity=_;function m(u,h){return Gt=u.rgba&255,_(u,Gt*h/255)}e.multiplyOpacity=m;function c(u){return[u.rgba>>24&255,u.rgba>>16&255,u.rgba>>8&255]}e.toColorRGB=c})(yl||={});var $A;(e=>{let i,r;try{let o=document.createElement("canvas");o.width=1,o.height=1;let _=o.getContext("2d",{willReadFrequently:!0});_&&(i=_,i.globalCompositeOperation="copy",r=i.createLinearGradient(0,0,1,1))}catch{}function a(o){if(o.match(/#[\da-f]{3,8}/i))switch(o.length){case 4:return pi=parseInt(o.slice(1,2).repeat(2),16),gi=parseInt(o.slice(2,3).repeat(2),16),mi=parseInt(o.slice(3,4).repeat(2),16),ji.toColor(pi,gi,mi);case 5:return pi=parseInt(o.slice(1,2).repeat(2),16),gi=parseInt(o.slice(2,3).repeat(2),16),mi=parseInt(o.slice(3,4).repeat(2),16),Gt=parseInt(o.slice(4,5).repeat(2),16),ji.toColor(pi,gi,mi,Gt);case 7:return{css:o,rgba:(parseInt(o.slice(1),16)<<8|255)>>>0};case 9:return{css:o,rgba:parseInt(o.slice(1),16)>>>0}}let _=o.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(_)return pi=parseInt(_[1]),gi=parseInt(_[2]),mi=parseInt(_[3]),Gt=Math.round((_[5]===void 0?1:parseFloat(_[5]))*255),ji.toColor(pi,gi,mi,Gt);if(!i||!r)throw new Error("css.toColor: Unsupported css format");if(i.fillStyle=r,i.fillStyle=o,typeof i.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(i.fillRect(0,0,1,1),[pi,gi,mi,Gt]=i.getImageData(0,0,1,1).data,Gt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:ji.toRgba(pi,gi,mi,Gt),css:o}}e.toColor=a})($A||={});var Bi;(e=>{function i(a){return r(a>>16&255,a>>8&255,a&255)}e.relativeLuminance=i;function r(a,o,_){let m=a/255,c=o/255,u=_/255,h=m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4),b=c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4),f=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4);return h*.2126+b*.7152+f*.0722}e.relativeLuminance2=r})(Bi||={});var Vs;(e=>{function i(m,c){if(Gt=(c&255)/255,Gt===1)return c;let u=c>>24&255,h=c>>16&255,b=c>>8&255,f=m>>24&255,C=m>>16&255,E=m>>8&255;return pi=f+Math.round((u-f)*Gt),gi=C+Math.round((h-C)*Gt),mi=E+Math.round((b-E)*Gt),ji.toRgba(pi,gi,mi)}e.blend=i;function r(m,c,u){let h=Bi.relativeLuminance(m>>8),b=Bi.relativeLuminance(c>>8);if(kr(h,b)<u){if(b<h){let E=a(m,c,u),A=kr(h,Bi.relativeLuminance(E>>8));if(A<u){let x=o(m,c,u),p=kr(h,Bi.relativeLuminance(x>>8));return A>p?E:x}return E}let f=o(m,c,u),C=kr(h,Bi.relativeLuminance(f>>8));if(C<u){let E=a(m,c,u),A=kr(h,Bi.relativeLuminance(E>>8));return C>A?f:E}return f}}e.ensureContrastRatio=r;function a(m,c,u){let h=m>>24&255,b=m>>16&255,f=m>>8&255,C=c>>24&255,E=c>>16&255,A=c>>8&255,x=kr(Bi.relativeLuminance2(C,E,A),Bi.relativeLuminance2(h,b,f));for(;x<u&&(C>0||E>0||A>0);)C-=Math.max(0,Math.ceil(C*.1)),E-=Math.max(0,Math.ceil(E*.1)),A-=Math.max(0,Math.ceil(A*.1)),x=kr(Bi.relativeLuminance2(C,E,A),Bi.relativeLuminance2(h,b,f));return(C<<24|E<<16|A<<8|255)>>>0}e.reduceLuminance=a;function o(m,c,u){let h=m>>24&255,b=m>>16&255,f=m>>8&255,C=c>>24&255,E=c>>16&255,A=c>>8&255,x=kr(Bi.relativeLuminance2(C,E,A),Bi.relativeLuminance2(h,b,f));for(;x<u&&(C<255||E<255||A<255);)C=Math.min(255,C+Math.ceil((255-C)*.1)),E=Math.min(255,E+Math.ceil((255-E)*.1)),A=Math.min(255,A+Math.ceil((255-A)*.1)),x=kr(Bi.relativeLuminance2(C,E,A),Bi.relativeLuminance2(h,b,f));return(C<<24|E<<16|A<<8|255)>>>0}e.increaseLuminance=o;function _(m){return[m>>24&255,m>>16&255,m>>8&255,m&255]}e.toChannels=_})(Vs||={});function Hs(e){let i=e.toString(16);return i.length<2?"0"+i:i}function kr(e,i){return e<i?(i+.05)/(e+.05):(e+.05)/(i+.05)}function ci(e){if(!e)throw new Error("value must not be falsy");return e}function Bg(e){return 57508<=e&&e<=57558}function HA(e){return 57520<=e&&e<=57527}function PA(e){return 57344<=e&&e<=63743}function UA(e){return 9472<=e&&e<=9631}function FA(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 qA(e,i,r,a){return i===1&&r>Math.ceil(a*1.5)&&e!==void 0&&e>255&&!FA(e)&&!Bg(e)&&!PA(e)}function ES(e){return Bg(e)||UA(e)}function WA(){return{css:{canvas:ou(),cell:ou()},device:{canvas:ou(),cell:ou(),char:{width:0,height:0,left:0,top:0}}}}function ou(){return{width:0,height:0}}function GA(e,i,r=0){return(e-(Math.round(i)*2-r))%(Math.round(i)*2)}var Ei=0,fi=0,Zn=!1,Rr=!1,lu=!1,Xi,Ff=0,KA=class{constructor(e,i,r,a,o,_){this._terminal=e,this._optionService=i,this._selectionRenderModel=r,this._decorationService=a,this._coreBrowserService=o,this._themeService=_,this.result={fg:0,bg:0,ext:0}}resolve(e,i,r,a){if(this.result.bg=e.bg,this.result.fg=e.fg,this.result.ext=e.bg&268435456?e.extended.ext:0,fi=0,Ei=0,Rr=!1,Zn=!1,lu=!1,Xi=this._themeService.colors,Ff=0,e.getCode()!==0&&e.extended.underlineStyle===4){let o=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));Ff=i*a%(Math.round(o)*2)}if(this._decorationService.forEachDecorationAtCell(i,r,"bottom",o=>{o.backgroundColorRGB&&(fi=o.backgroundColorRGB.rgba>>8&16777215,Rr=!0),o.foregroundColorRGB&&(Ei=o.foregroundColorRGB.rgba>>8&16777215,Zn=!0)}),lu=this._selectionRenderModel.isCellSelected(this._terminal,i,r),lu){if(this.result.fg&67108864||(this.result.bg&50331648)!==0){if(this.result.fg&67108864)switch(this.result.fg&50331648){case 16777216:case 33554432:fi=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:fi=(this.result.fg&16777215)<<8|255;break;default:fi=this._themeService.colors.foreground.rgba}else switch(this.result.bg&50331648){case 16777216:case 33554432:fi=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:fi=(this.result.bg&16777215)<<8|255;break}fi=Vs.blend(fi,(this._coreBrowserService.isFocused?Xi.selectionBackgroundOpaque:Xi.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}else fi=(this._coreBrowserService.isFocused?Xi.selectionBackgroundOpaque:Xi.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(Rr=!0,Xi.selectionForeground&&(Ei=Xi.selectionForeground.rgba>>8&16777215,Zn=!0),ES(e.getCode())){if(this.result.fg&67108864&&(this.result.bg&50331648)===0)Ei=(this._coreBrowserService.isFocused?Xi.selectionBackgroundOpaque:Xi.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(this.result.fg&67108864)switch(this.result.bg&50331648){case 16777216:case 33554432:Ei=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:Ei=(this.result.bg&16777215)<<8|255;break}else switch(this.result.fg&50331648){case 16777216:case 33554432:Ei=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:Ei=(this.result.fg&16777215)<<8|255;break;default:Ei=this._themeService.colors.foreground.rgba}Ei=Vs.blend(Ei,(this._coreBrowserService.isFocused?Xi.selectionBackgroundOpaque:Xi.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}Zn=!0}}this._decorationService.forEachDecorationAtCell(i,r,"top",o=>{o.backgroundColorRGB&&(fi=o.backgroundColorRGB.rgba>>8&16777215,Rr=!0),o.foregroundColorRGB&&(Ei=o.foregroundColorRGB.rgba>>8&16777215,Zn=!0)}),Rr&&(lu?fi=e.bg&-16777216&-134217729|fi|50331648:fi=e.bg&-16777216|fi|50331648),Zn&&(Ei=e.fg&-16777216&-67108865|Ei|50331648),this.result.fg&67108864&&(Rr&&!Zn&&((this.result.bg&50331648)===0?Ei=this.result.fg&-134217728|Xi.background.rgba>>8&16777215&16777215|50331648:Ei=this.result.fg&-134217728|this.result.bg&67108863,Zn=!0),!Rr&&Zn&&((this.result.fg&50331648)===0?fi=this.result.bg&-67108864|Xi.foreground.rgba>>8&16777215&16777215|50331648:fi=this.result.bg&-67108864|this.result.fg&67108863,Rr=!0)),Xi=void 0,this.result.bg=Rr?fi:this.result.bg,this.result.fg=Zn?Ei:this.result.fg,this.result.ext&=536870911,this.result.ext|=Ff<<29&3758096384}},VA=.5,TS=BA||IA?"bottom":"ideographic",YA={"▀":[{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}]},XA={"░":[[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]]},ZA={"─":{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,i)=>`M0,${.5-i} L1,${.5-i} M0,${.5+i} L1,${.5+i}`},"║":{1:(e,i)=>`M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╒":{1:(e,i)=>`M.5,1 L.5,${.5-i} L1,${.5-i} M.5,${.5+i} L1,${.5+i}`},"╓":{1:(e,i)=>`M${.5-e},1 L${.5-e},.5 L1,.5 M${.5+e},.5 L${.5+e},1`},"╔":{1:(e,i)=>`M1,${.5-i} L${.5-e},${.5-i} L${.5-e},1 M1,${.5+i} L${.5+e},${.5+i} L${.5+e},1`},"╕":{1:(e,i)=>`M0,${.5-i} L.5,${.5-i} L.5,1 M0,${.5+i} L.5,${.5+i}`},"╖":{1:(e,i)=>`M${.5+e},1 L${.5+e},.5 L0,.5 M${.5-e},.5 L${.5-e},1`},"╗":{1:(e,i)=>`M0,${.5+i} L${.5-e},${.5+i} L${.5-e},1 M0,${.5-i} L${.5+e},${.5-i} L${.5+e},1`},"╘":{1:(e,i)=>`M.5,0 L.5,${.5+i} L1,${.5+i} M.5,${.5-i} L1,${.5-i}`},"╙":{1:(e,i)=>`M1,.5 L${.5-e},.5 L${.5-e},0 M${.5+e},.5 L${.5+e},0`},"╚":{1:(e,i)=>`M1,${.5-i} L${.5+e},${.5-i} L${.5+e},0 M1,${.5+i} L${.5-e},${.5+i} L${.5-e},0`},"╛":{1:(e,i)=>`M0,${.5+i} L.5,${.5+i} L.5,0 M0,${.5-i} L.5,${.5-i}`},"╜":{1:(e,i)=>`M0,.5 L${.5+e},.5 L${.5+e},0 M${.5-e},.5 L${.5-e},0`},"╝":{1:(e,i)=>`M0,${.5-i} L${.5-e},${.5-i} L${.5-e},0 M0,${.5+i} L${.5+e},${.5+i} L${.5+e},0`},"╞":{1:(e,i)=>`M.5,0 L.5,1 M.5,${.5-i} L1,${.5-i} M.5,${.5+i} L1,${.5+i}`},"╟":{1:(e,i)=>`M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1 M${.5+e},.5 L1,.5`},"╠":{1:(e,i)=>`M${.5-e},0 L${.5-e},1 M1,${.5+i} L${.5+e},${.5+i} L${.5+e},1 M1,${.5-i} L${.5+e},${.5-i} L${.5+e},0`},"╡":{1:(e,i)=>`M.5,0 L.5,1 M0,${.5-i} L.5,${.5-i} M0,${.5+i} L.5,${.5+i}`},"╢":{1:(e,i)=>`M0,.5 L${.5-e},.5 M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╣":{1:(e,i)=>`M${.5+e},0 L${.5+e},1 M0,${.5+i} L${.5-e},${.5+i} L${.5-e},1 M0,${.5-i} L${.5-e},${.5-i} L${.5-e},0`},"╤":{1:(e,i)=>`M0,${.5-i} L1,${.5-i} M0,${.5+i} L1,${.5+i} M.5,${.5+i} L.5,1`},"╥":{1:(e,i)=>`M0,.5 L1,.5 M${.5-e},.5 L${.5-e},1 M${.5+e},.5 L${.5+e},1`},"╦":{1:(e,i)=>`M0,${.5-i} L1,${.5-i} M0,${.5+i} L${.5-e},${.5+i} L${.5-e},1 M1,${.5+i} L${.5+e},${.5+i} L${.5+e},1`},"╧":{1:(e,i)=>`M.5,0 L.5,${.5-i} M0,${.5-i} L1,${.5-i} M0,${.5+i} L1,${.5+i}`},"╨":{1:(e,i)=>`M0,.5 L1,.5 M${.5-e},.5 L${.5-e},0 M${.5+e},.5 L${.5+e},0`},"╩":{1:(e,i)=>`M0,${.5+i} L1,${.5+i} M0,${.5-i} L${.5-e},${.5-i} L${.5-e},0 M1,${.5-i} L${.5+e},${.5-i} L${.5+e},0`},"╪":{1:(e,i)=>`M.5,0 L.5,1 M0,${.5-i} L1,${.5-i} M0,${.5+i} L1,${.5+i}`},"╫":{1:(e,i)=>`M0,.5 L1,.5 M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╬":{1:(e,i)=>`M0,${.5+i} L${.5-e},${.5+i} L${.5-e},1 M1,${.5+i} L${.5+e},${.5+i} L${.5+e},1 M0,${.5-i} L${.5-e},${.5-i} L${.5-e},0 M1,${.5-i} L${.5+e},${.5-i} 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,i)=>`M.5,1 L.5,${.5+i/.15*.5} C.5,${.5+i/.15*.5},.5,.5,1,.5`},"╮":{1:(e,i)=>`M.5,1 L.5,${.5+i/.15*.5} C.5,${.5+i/.15*.5},.5,.5,0,.5`},"╯":{1:(e,i)=>`M.5,0 L.5,${.5-i/.15*.5} C.5,${.5-i/.15*.5},.5,.5,0,.5`},"╰":{1:(e,i)=>`M.5,0 L.5,${.5-i/.15*.5} C.5,${.5-i/.15*.5},.5,.5,1,.5`}},Bl={"":{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}};Bl[""]=Bl[""];Bl[""]=Bl[""];function JA(e,i,r,a,o,_,m,c){let u=YA[i];if(u)return QA(e,u,r,a,o,_),!0;let h=XA[i];if(h)return ek(e,h,r,a,o,_),!0;let b=ZA[i];if(b)return tk(e,b,r,a,o,_,c),!0;let f=Bl[i];return f?(ik(e,f,r,a,o,_,m,c),!0):!1}function QA(e,i,r,a,o,_){for(let m=0;m<i.length;m++){let c=i[m],u=o/8,h=_/8;e.fillRect(r+c.x*u,a+c.y*h,c.w*u,c.h*h)}}var Sb=new Map;function ek(e,i,r,a,o,_){let m=Sb.get(i);m||(m=new Map,Sb.set(i,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=i[0].length,b=i.length,f=e.canvas.ownerDocument.createElement("canvas");f.width=h,f.height=b;let C=ci(f.getContext("2d")),E=new ImageData(h,b),A,x,p,y;if(c.startsWith("#"))A=parseInt(c.slice(1,3),16),x=parseInt(c.slice(3,5),16),p=parseInt(c.slice(5,7),16),y=c.length>7&&parseInt(c.slice(7,9),16)||1;else if(c.startsWith("rgba"))[A,x,p,y]=c.substring(5,c.length-1).split(",").map(d=>parseFloat(d));else throw new Error(`Unexpected fillStyle color format "${c}" when drawing pattern glyph`);for(let d=0;d<b;d++)for(let v=0;v<h;v++)E.data[(d*h+v)*4]=A,E.data[(d*h+v)*4+1]=x,E.data[(d*h+v)*4+2]=p,E.data[(d*h+v)*4+3]=i[d][v]*(y*255);C.putImageData(E,0,0),u=ci(e.createPattern(f,null)),m.set(c,u)}e.fillStyle=u,e.fillRect(r,a,o,_)}function tk(e,i,r,a,o,_,m){e.strokeStyle=e.fillStyle;for(let[c,u]of Object.entries(i)){e.beginPath(),e.lineWidth=m*Number.parseInt(c);let h;if(typeof u=="function"){let b=.15/_*o;h=u(.15,b)}else h=u;for(let b of h.split(" ")){let f=b[0],C=AS[f];if(!C){console.error(`Could not find drawing instructions for "${f}"`);continue}let E=b.substring(1).split(",");!E[0]||!E[1]||C(e,kS(E,o,_,r,a,!0,m))}e.stroke(),e.closePath()}}function ik(e,i,r,a,o,_,m,c){let u=new Path2D;u.rect(r,a,o,_),e.clip(u),e.beginPath();let h=m/12;e.lineWidth=c*h;for(let b of i.d.split(" ")){let f=b[0],C=AS[f];if(!C){console.error(`Could not find drawing instructions for "${f}"`);continue}let E=b.substring(1).split(",");!E[0]||!E[1]||C(e,kS(E,o,_,r,a,!1,c,(i.leftPadding??0)*(h/2),(i.rightPadding??0)*(h/2)))}i.type===1?(e.strokeStyle=e.fillStyle,e.stroke()):e.fill(),e.closePath()}function wb(e,i,r=0){return Math.max(Math.min(e,i),r)}var AS={C:(e,i)=>e.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5]),L:(e,i)=>e.lineTo(i[0],i[1]),M:(e,i)=>e.moveTo(i[0],i[1])};function kS(e,i,r,a,o,_,m,c=0,u=0){let h=e.map(b=>parseFloat(b)||parseInt(b));if(h.length<2)throw new Error("Too few arguments for instruction");for(let b=0;b<h.length;b+=2)h[b]*=i-c*m-u*m,_&&h[b]!==0&&(h[b]=wb(Math.round(h[b]+.5)-.5,i,0)),h[b]+=a+c*m;for(let b=1;b<h.length;b+=2)h[b]*=r,_&&h[b]!==0&&(h[b]=wb(Math.round(h[b]+.5)-.5,r,0)),h[b]+=o;return h}var Cb=class{constructor(){this._data={}}set(e,i,r){this._data[e]||(this._data[e]={}),this._data[e][i]=r}get(e,i){return this._data[e]?this._data[e][i]:void 0}clear(){this._data={}}},xb=class{constructor(){this._data=new Cb}set(e,i,r,a,o){this._data.get(e,i)||this._data.set(e,i,new Cb),this._data.get(e,i).set(r,a,o)}get(e,i,r,a){return this._data.get(e,i)?.get(r,a)}clear(){this._data.clear()}},RS=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 i=0,r=0,a=e.timeRemaining(),o=0;for(;this._i<this._tasks.length;){if(i=performance.now(),this._tasks[this._i]()||this._i++,i=Math.max(1,performance.now()-i),r=Math.max(i,r),o=e.timeRemaining(),r*1.5>o){a-i<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(a-i))}ms`),this._start();return}a=o}this.clear()}},nk=class extends RS{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let i=performance.now()+e;return{timeRemaining:()=>Math.max(0,i-performance.now())}}},rk=class extends RS{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},sk=!Ng&&"requestIdleCallback"in window?rk:nk,Ya=class LS{constructor(){this.fg=0,this.bg=0,this.extended=new MS}static toColorRGB(i){return[i>>>16&255,i>>>8&255,i&255]}static fromColorRGB(i){return(i[0]&255)<<16|(i[1]&255)<<8|i[2]&255}clone(){let i=new LS;return i.fg=this.fg,i.bg=this.bg,i.extended=this.extended.clone(),i}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}},MS=class DS{constructor(i=0,r=0){this._ext=0,this._urlId=0,this._ext=i,this._urlId=r}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(i){this._ext=i}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(i){this._ext&=-469762049,this._ext|=i<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(i){this._ext&=-67108864,this._ext|=i&67108863}get urlId(){return this._urlId}set urlId(i){this._urlId=i}get underlineVariantOffset(){let i=(this._ext&3758096384)>>29;return i<0?i^4294967288:i}set underlineVariantOffset(i){this._ext&=536870911,this._ext|=i<<29&3758096384}clone(){return new DS(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},ak=globalThis.performance&&typeof globalThis.performance.now=="function",ok=class OS{static create(i){return new OS(i)}constructor(i){this._now=ak&&i===!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=()=>qn.None;function i(q,I){return f(q,()=>{},0,void 0,!0,void 0,I)}e.defer=i;function r(q){return(I,G=null,te)=>{let P=!1,V;return V=q(X=>{if(!P)return V?V.dispose():P=!0,I.call(G,X)},null,te),P&&V.dispose(),V}}e.once=r;function a(q,I,G){return h((te,P=null,V)=>q(X=>te.call(P,I(X)),null,V),G)}e.map=a;function o(q,I,G){return h((te,P=null,V)=>q(X=>{I(X),te.call(P,X)},null,V),G)}e.forEach=o;function _(q,I,G){return h((te,P=null,V)=>q(X=>I(X)&&te.call(P,X),null,V),G)}e.filter=_;function m(q){return q}e.signal=m;function c(...q){return(I,G=null,te)=>{let P=SS(...q.map(V=>V(X=>I.call(G,X))));return b(P,te)}}e.any=c;function u(q,I,G,te){let P=G;return a(q,V=>(P=I(P,V),P),te)}e.reduce=u;function h(q,I){let G,te={onWillAddFirstListener(){G=q(P.fire,P)},onDidRemoveLastListener(){G?.dispose()}},P=new Mt(te);return I?.add(P),P.event}function b(q,I){return I instanceof Array?I.push(q):I&&I.add(q),q}function f(q,I,G=100,te=!1,P=!1,V,X){let N,z,O,H=0,Z,ae={leakWarningThreshold:V,onWillAddFirstListener(){N=q(_e=>{H++,z=I(z,_e),te&&!O&&(ce.fire(z),z=void 0),Z=()=>{let Q=z;z=void 0,O=void 0,(!te||H>1)&&ce.fire(Q),H=0},typeof G=="number"?(clearTimeout(O),O=setTimeout(Z,G)):O===void 0&&(O=0,queueMicrotask(Z))})},onWillRemoveListener(){P&&H>0&&Z?.()},onDidRemoveLastListener(){Z=void 0,N.dispose()}},ce=new Mt(ae);return X?.add(ce),ce.event}e.debounce=f;function C(q,I=0,G){return e.debounce(q,(te,P)=>te?(te.push(P),te):[P],I,void 0,!0,void 0,G)}e.accumulate=C;function E(q,I=(te,P)=>te===P,G){let te=!0,P;return _(q,V=>{let X=te||!I(V,P);return te=!1,P=V,X},G)}e.latch=E;function A(q,I,G){return[e.filter(q,I,G),e.filter(q,te=>!I(te),G)]}e.split=A;function x(q,I=!1,G=[],te){let P=G.slice(),V=q(z=>{P?P.push(z):N.fire(z)});te&&te.add(V);let X=()=>{P?.forEach(z=>N.fire(z)),P=null},N=new Mt({onWillAddFirstListener(){V||(V=q(z=>N.fire(z)),te&&te.add(V))},onDidAddFirstListener(){P&&(I?setTimeout(X):X())},onDidRemoveLastListener(){V&&V.dispose(),V=null}});return te&&te.add(N),N.event}e.buffer=x;function p(q,I){return(G,te,P)=>{let V=I(new d);return q(function(X){let N=V.evaluate(X);N!==y&&G.call(te,N)},void 0,P)}}e.chain=p;let y=Symbol("HaltChainable");class d{constructor(){this.steps=[]}map(I){return this.steps.push(I),this}forEach(I){return this.steps.push(G=>(I(G),G)),this}filter(I){return this.steps.push(G=>I(G)?G:y),this}reduce(I,G){let te=G;return this.steps.push(P=>(te=I(te,P),te)),this}latch(I=(G,te)=>G===te){let G=!0,te;return this.steps.push(P=>{let V=G||!I(P,te);return G=!1,te=P,V?P:y}),this}evaluate(I){for(let G of this.steps)if(I=G(I),I===y)break;return I}}function v(q,I,G=te=>te){let te=(...N)=>X.fire(G(...N)),P=()=>q.on(I,te),V=()=>q.removeListener(I,te),X=new Mt({onWillAddFirstListener:P,onDidRemoveLastListener:V});return X.event}e.fromNodeEventEmitter=v;function T(q,I,G=te=>te){let te=(...N)=>X.fire(G(...N)),P=()=>q.addEventListener(I,te),V=()=>q.removeEventListener(I,te),X=new Mt({onWillAddFirstListener:P,onDidRemoveLastListener:V});return X.event}e.fromDOMEventEmitter=T;function R(q){return new Promise(I=>r(q)(I))}e.toPromise=R;function L(q){let I=new Mt;return q.then(G=>{I.fire(G)},()=>{I.fire(void 0)}).finally(()=>{I.dispose()}),I.event}e.fromPromise=L;function M(q,I){return q(G=>I.fire(G))}e.forward=M;function k(q,I,G){return I(G),q(te=>I(te))}e.runAndSubscribe=k;class B{constructor(I,G){this._observable=I,this._counter=0,this._hasChanged=!1;let te={onWillAddFirstListener:()=>{I.addObserver(this)},onDidRemoveLastListener:()=>{I.removeObserver(this)}};this.emitter=new Mt(te),G&&G.add(this.emitter)}beginUpdate(I){this._counter++}handlePossibleChange(I){}handleChange(I,G){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 W(q,I){return new B(q,I).emitter.event}e.fromObservable=W;function F(q){return(I,G,te)=>{let P=0,V=!1,X={beginUpdate(){P++},endUpdate(){P--,P===0&&(q.reportChanges(),V&&(V=!1,I.call(G)))},handlePossibleChange(){},handleChange(){V=!0}};q.addObserver(X),q.reportChanges();let N={dispose(){q.removeObserver(X)}};return te instanceof Qa?te.add(N):Array.isArray(te)&&te.push(N),N}}e.fromObservableLight=F})(Nr||={});var Fp=class qp{constructor(i){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${i}_${qp._idPool++}`,qp.all.add(this)}start(i){this._stopWatch=new ok,this.listenerCount=i}stop(){if(this._stopWatch){let i=this._stopWatch.elapsed();this.durations.push(i),this.elapsedOverall+=i,this.invocationCount+=1,this._stopWatch=void 0}}};Fp.all=new Set,Fp._idPool=0;var lk=Fp,ck=-1,NS=class BS{constructor(i,r,a=(BS._idPool++).toString(16).padStart(3,"0")){this._errorHandler=i,this.threshold=r,this.name=a,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(i,r){let a=this.threshold;if(a<=0||r<a)return;this._stacks||(this._stacks=new Map);let o=this._stacks.get(i.value)||0;if(this._stacks.set(i.value,o+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=a*.5;let[_,m]=this.getMostFrequentStack(),c=`[${this.name}] potential listener LEAK detected, having ${r} listeners already. MOST frequent listener (${m}):`;console.warn(c),console.warn(_);let u=new dk(c,_);this._errorHandler(u)}return()=>{let _=this._stacks.get(i.value)||0;this._stacks.set(i.value,_-1)}}getMostFrequentStack(){if(!this._stacks)return;let i,r=0;for(let[a,o]of this._stacks)(!i||r<o)&&(i=[a,o],r=o);return i}};NS._idPool=1;var uk=NS,hk=class IS{constructor(i){this.value=i}static create(){let i=new Error;return new IS(i.stack??"")}print(){console.warn(this.value.split(`
|
|
17
|
+
`).slice(2).join(`
|
|
18
|
+
`))}},dk=class extends Error{constructor(e,i){super(e),this.name="ListenerLeakError",this.stack=i}},fk=class extends Error{constructor(e,i){super(e),this.name="ListenerRefusalError",this.stack=i}},pk=0,qf=class{constructor(i){this.value=i,this.id=pk++}},gk=2,mk,Mt=class{constructor(i){this._size=0,this._options=i,this._leakageMon=this._options?.leakWarningThreshold?new uk(i?.onListenerError??Uf,this._options?.leakWarningThreshold??ck):void 0,this._perfMon=this._options?._profName?new lk(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??=(i,r,a)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let c=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(c);let u=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],h=new fk(`${c}. HINT: Stack shows most frequent listener (${u[1]}-times)`,u[0]);return(this._options?.onListenerError||Uf)(h),qn.None}if(this._disposed)return qn.None;r&&(i=i.bind(r));let o=new qf(i),_;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o.stack=hk.create(),_=this._leakageMon.check(o.stack,this._size+1)),this._listeners?this._listeners instanceof qf?(this._deliveryQueue??=new _k,this._listeners=[this._listeners,o]):this._listeners.push(o):(this._options?.onWillAddFirstListener?.(this),this._listeners=o,this._options?.onDidAddFirstListener?.(this)),this._size++;let m=Di(()=>{_?.(),this._removeListener(o)});return a instanceof Qa?a.add(m):Array.isArray(a)&&a.push(m),m},this._event}_removeListener(i){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 r=this._listeners,a=r.indexOf(i);if(a===-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--,r[a]=void 0;let o=this._deliveryQueue.current===this;if(this._size*gk<=r.length){let _=0;for(let m=0;m<r.length;m++)r[m]?r[_++]=r[m]:o&&(this._deliveryQueue.end--,_<this._deliveryQueue.i&&this._deliveryQueue.i--);r.length=_}}_deliver(i,r){if(!i)return;let a=this._options?.onListenerError||Uf;if(!a){i.value(r);return}try{i.value(r)}catch(o){a(o)}}_deliverQueue(i){let r=i.current._listeners;for(;i.i<i.end;)this._deliver(r[i.i++],i.value);i.reset()}fire(i){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof qf)this._deliver(this._listeners,i);else{let r=this._deliveryQueue;r.enqueue(this,i,this._listeners.length),this._deliverQueue(r)}this._perfMon?.stop()}hasListeners(){return this._size>0}},_k=class{constructor(){this.i=-1,this.end=0}enqueue(e,i,r){this.i=0,this.end=r,this.current=e,this.value=i}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Eb={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}},cl=2,ul,ds=class Wa{constructor(i,r,a){this._document=i,this._config=r,this._unicodeService=a,this._didWarmUp=!1,this._cacheMap=new xb,this._cacheMapCombined=new xb,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new Ya,this._textureSize=512,this._onAddTextureAtlasCanvas=new Mt,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new Mt,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=jS(i,this._config.deviceCellWidth*4+cl*2,this._config.deviceCellHeight+cl*2),this._tmpCtx=ci(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}get pages(){return this._pages}dispose(){this._tmpCanvas.remove();for(let i of this.pages)i.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){let i=new sk;for(let r=33;r<126;r++)i.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 i of this._pages)i.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(Wa.maxAtlasPages&&this._pages.length>=Math.max(4,Wa.maxAtlasPages)){let r=this._pages.filter(h=>h.canvas.width*2<=(Wa.maxTextureSize||4096)).sort((h,b)=>b.canvas.width!==h.canvas.width?b.canvas.width-h.canvas.width:b.percentageUsed-h.percentageUsed),a=-1,o=0;for(let h=0;h<r.length;h++)if(r[h].canvas.width!==o)a=h,o=r[h].canvas.width;else if(h-a===3)break;let _=r.slice(a,a+4),m=_.map(h=>h.glyphs[0].texturePage).sort((h,b)=>h>b?1:-1),c=this.pages.length-_.length,u=this._mergePages(_,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 i=new Wf(this._document,this._textureSize);return this._pages.push(i),this._activePages.push(i),this._onAddTextureAtlasCanvas.fire(i.canvas),i}_mergePages(i,r){let a=i[0].canvas.width*2,o=new Wf(this._document,a,i);for(let[_,m]of i.entries()){let c=_*m.canvas.width%a,u=Math.floor(_/2)*m.canvas.height;o.ctx.drawImage(m.canvas,c,u);for(let b of m.glyphs)b.texturePage=r,b.sizeClipSpace.x=b.size.x/a,b.sizeClipSpace.y=b.size.y/a,b.texturePosition.x+=c,b.texturePosition.y+=u,b.texturePositionClipSpace.x=b.texturePosition.x/a,b.texturePositionClipSpace.y=b.texturePosition.y/a;this._onRemoveTextureAtlasCanvas.fire(m.canvas);let h=this._activePages.indexOf(m);h!==-1&&this._activePages.splice(h,1)}return o}_deletePage(i){this._pages.splice(i,1);for(let r=i;r<this._pages.length;r++){let a=this._pages[r];for(let o of a.glyphs)o.texturePage--;a.version++}}getRasterizedGlyphCombinedChar(i,r,a,o,_,m){return this._getFromCacheMap(this._cacheMapCombined,i,r,a,o,_,m)}getRasterizedGlyph(i,r,a,o,_,m){return this._getFromCacheMap(this._cacheMap,i,r,a,o,_,m)}_getFromCacheMap(i,r,a,o,_,m,c){return ul=i.get(r,a,o,_),ul||(ul=this._drawToCache(r,a,o,_,m,c),i.set(r,a,o,_,ul)),ul}_getColorFromAnsiIndex(i){if(i>=this._config.colors.ansi.length)throw new Error("No color found for idx "+i);return this._config.colors.ansi[i]}_getBackgroundColor(i,r,a,o){if(this._config.allowTransparency)return xn;let _;switch(i){case 16777216:case 33554432:_=this._getColorFromAnsiIndex(r);break;case 50331648:let m=Ya.toColorRGB(r);_=ji.toColor(m[0],m[1],m[2]);break;default:a?_=yl.opaque(this._config.colors.foreground):_=this._config.colors.background;break}return this._config.allowTransparency||(_=yl.opaque(_)),_}_getForegroundColor(i,r,a,o,_,m,c,u,h,b){let f=this._getMinimumContrastColor(i,r,a,o,_,m,c,h,u,b);if(f)return f;let C;switch(_){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&h&&m<8&&(m+=8),C=this._getColorFromAnsiIndex(m);break;case 50331648:let E=Ya.toColorRGB(m);C=ji.toColor(E[0],E[1],E[2]);break;default:c?C=this._config.colors.background:C=this._config.colors.foreground}return this._config.allowTransparency&&(C=yl.opaque(C)),u&&(C=yl.multiplyOpacity(C,VA)),C}_resolveBackgroundRgba(i,r,a){switch(i){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(i,r,a,o){switch(i){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&o&&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(i,r,a,o,_,m,c,u,h,b){if(this._config.minimumContrastRatio===1||b)return;let f=this._getContrastCache(h),C=f.getColor(i,o);if(C!==void 0)return C||void 0;let E=this._resolveBackgroundRgba(r,a,c),A=this._resolveForegroundRgba(_,m,c,u),x=Vs.ensureContrastRatio(E,A,this._config.minimumContrastRatio/(h?2:1));if(!x){f.setColor(i,o,null);return}let p=ji.toColor(x>>24&255,x>>16&255,x>>8&255);return f.setColor(i,o,p),p}_getContrastCache(i){return i?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(i,r,a,o,_,m){let c=typeof i=="number"?String.fromCharCode(i):i;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)+cl*2,this._config.deviceMaxTextureSize);this._tmpCanvas.width<u&&(this._tmpCanvas.width=u);let h=Math.min(this._config.deviceCellHeight+cl*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=o,!!this._workAttributeData.isInvisible())return Eb;let b=!!this._workAttributeData.isBold(),f=!!this._workAttributeData.isInverse(),C=!!this._workAttributeData.isDim(),E=!!this._workAttributeData.isItalic(),A=!!this._workAttributeData.isUnderline(),x=!!this._workAttributeData.isStrikethrough(),p=!!this._workAttributeData.isOverline(),y=this._workAttributeData.getFgColor(),d=this._workAttributeData.getFgColorMode(),v=this._workAttributeData.getBgColor(),T=this._workAttributeData.getBgColorMode();if(f){let z=y;y=v,v=z;let O=d;d=T,T=O}let R=this._getBackgroundColor(T,v,f,C);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=R.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";let L=b?this._config.fontWeightBold:this._config.fontWeight,M=E?"italic":"";this._tmpCtx.font=`${M} ${L} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=TS;let k=c.length===1&&Bg(c.charCodeAt(0)),B=c.length===1&&HA(c.charCodeAt(0)),W=this._getForegroundColor(r,T,v,a,d,y,f,C,b,ES(c.charCodeAt(0)));this._tmpCtx.fillStyle=W.css;let F=B?0:cl*2,q=!1;this._config.customGlyphs!==!1&&(q=JA(this._tmpCtx,c,F,F,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let I=!k,G;if(typeof i=="number"?G=this._unicodeService.wcwidth(i):G=this._unicodeService.getStringCellWidth(i),A){this._tmpCtx.save();let z=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),O=z%2===1?.5:0;if(this._tmpCtx.lineWidth=z,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 H=F,Z=Math.ceil(F+this._config.deviceCharHeight)-O-(_?z*2:0),ae=Z+z,ce=Z+z*2,_e=this._workAttributeData.getUnderlineVariantOffset();for(let Q=0;Q<G;Q++){this._tmpCtx.save();let $=H+Q*this._config.deviceCellWidth,oe=H+(Q+1)*this._config.deviceCellWidth,ge=$+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo($,Z),this._tmpCtx.lineTo(oe,Z),this._tmpCtx.moveTo($,ce),this._tmpCtx.lineTo(oe,ce);break;case 3:let Se=z<=1?ce:Math.ceil(F+this._config.deviceCharHeight-z/2)-O,ye=z<=1?Z:Math.ceil(F+this._config.deviceCharHeight+z/2)-O,$e=new Path2D;$e.rect($,Z,this._config.deviceCellWidth,ce-Z),this._tmpCtx.clip($e),this._tmpCtx.moveTo($-this._config.deviceCellWidth/2,ae),this._tmpCtx.bezierCurveTo($-this._config.deviceCellWidth/2,ye,$,ye,$,ae),this._tmpCtx.bezierCurveTo($,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 Fe=_e===0?0:_e>=z?z*2-_e:z-_e;_e>=z||Fe===0?(this._tmpCtx.setLineDash([Math.round(z),Math.round(z)]),this._tmpCtx.moveTo($+Fe,Z),this._tmpCtx.lineTo(oe,Z)):(this._tmpCtx.setLineDash([Math.round(z),Math.round(z)]),this._tmpCtx.moveTo($,Z),this._tmpCtx.lineTo($+Fe,Z),this._tmpCtx.moveTo($+Fe+z,Z),this._tmpCtx.lineTo(oe,Z)),_e=GA(oe-$,z,_e);break;case 5:let Ve=.6,Ct=.3,Ne=oe-$,Qt=Math.floor(Ve*Ne),_i=Math.floor(Ct*Ne),vi=Ne-Qt-_i;this._tmpCtx.setLineDash([Qt,_i,vi]),this._tmpCtx.moveTo($,Z),this._tmpCtx.lineTo(oe,Z);break;default:this._tmpCtx.moveTo($,Z),this._tmpCtx.lineTo(oe,Z);break}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!q&&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 $=new Path2D;$.rect(H,Z-Math.ceil(z/2),this._config.deviceCellWidth*G,ce-Z+Math.ceil(z/2)),this._tmpCtx.clip($),this._tmpCtx.lineWidth=this._config.devicePixelRatio*3,this._tmpCtx.strokeStyle=R.css,this._tmpCtx.strokeText(c,F,F+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(p){let z=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),O=z%2===1?.5:0;this._tmpCtx.lineWidth=z,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(F,F+O),this._tmpCtx.lineTo(F+this._config.deviceCharWidth*G,F+O),this._tmpCtx.stroke()}if(q||this._tmpCtx.fillText(c,F,F+this._config.deviceCharHeight),c==="_"&&!this._config.allowTransparency){let z=Gf(this._tmpCtx.getImageData(F,F,this._config.deviceCellWidth,this._config.deviceCellHeight),R,W,I);if(z)for(let O=1;O<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=R.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(c,F,F+this._config.deviceCharHeight-O),z=Gf(this._tmpCtx.getImageData(F,F,this._config.deviceCellWidth,this._config.deviceCellHeight),R,W,I),!!z);O++);}if(x){let z=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),O=this._tmpCtx.lineWidth%2===1?.5:0;this._tmpCtx.lineWidth=z,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(F,F+Math.floor(this._config.deviceCharHeight/2)-O),this._tmpCtx.lineTo(F+this._config.deviceCharWidth*G,F+Math.floor(this._config.deviceCharHeight/2)-O),this._tmpCtx.stroke()}this._tmpCtx.restore();let te=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height),P;if(this._config.allowTransparency?P=vk(te):P=Gf(te,R,W,I),P)return Eb;let V=this._findGlyphBoundingBox(te,this._workBoundingBox,u,B,q,F),X,N;for(;;){if(this._activePages.length===0){let z=this._createNewPage();X=z,N=z.currentRow,N.height=V.size.y;break}X=this._activePages[this._activePages.length-1],N=X.currentRow;for(let z of this._activePages)V.size.y<=z.currentRow.height&&(X=z,N=z.currentRow);for(let z=this._activePages.length-1;z>=0;z--)for(let O of this._activePages[z].fixedRows)O.height<=N.height&&V.size.y<=O.height&&(X=this._activePages[z],N=O);if(V.size.x>this._textureSize){this._overflowSizePage||(this._overflowSizePage=new Wf(this._document,this._config.deviceMaxTextureSize),this.pages.push(this._overflowSizePage),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(this._overflowSizePage.canvas)),X=this._overflowSizePage,N=this._overflowSizePage.currentRow,N.x+V.size.x>=X.canvas.width&&(N.x=0,N.y+=N.height,N.height=0);break}if(N.y+V.size.y>=X.canvas.height||N.height>V.size.y+2){let z=!1;if(X.currentRow.y+X.currentRow.height+V.size.y>=X.canvas.height){let O;for(let H of this._activePages)if(H.currentRow.y+H.currentRow.height+V.size.y<H.canvas.height){O=H;break}if(O)X=O;else if(Wa.maxAtlasPages&&this._pages.length>=Wa.maxAtlasPages&&N.y+V.size.y<=X.canvas.height&&N.height>=V.size.y&&N.x+V.size.x<=X.canvas.width)z=!0;else{let H=this._createNewPage();X=H,N=H.currentRow,N.height=V.size.y,z=!0}}z||(X.currentRow.height>0&&X.fixedRows.push(X.currentRow),N={x:0,y:X.currentRow.y+X.currentRow.height,height:V.size.y},X.fixedRows.push(N),X.currentRow={x:0,y:N.y+N.height,height:0})}if(N.x+V.size.x<=X.canvas.width)break;N===X.currentRow?(N.x=0,N.y+=N.height,N.height=0):X.fixedRows.splice(X.fixedRows.indexOf(N),1)}return V.texturePage=this._pages.indexOf(X),V.texturePosition.x=N.x,V.texturePosition.y=N.y,V.texturePositionClipSpace.x=N.x/X.canvas.width,V.texturePositionClipSpace.y=N.y/X.canvas.height,V.sizeClipSpace.x/=X.canvas.width,V.sizeClipSpace.y/=X.canvas.height,N.height=Math.max(N.height,V.size.y),N.x+=V.size.x,X.ctx.putImageData(te,V.texturePosition.x-this._workBoundingBox.left,V.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,V.size.x,V.size.y),X.addGlyph(V),X.version++,V}_findGlyphBoundingBox(i,r,a,o,_,m){r.top=0;let c=o?this._config.deviceCellHeight:this._tmpCanvas.height,u=o?this._config.deviceCellWidth:a,h=!1;for(let b=0;b<c;b++){for(let f=0;f<u;f++){let C=b*this._tmpCanvas.width*4+f*4+3;if(i.data[C]!==0){r.top=b,h=!0;break}}if(h)break}r.left=0,h=!1;for(let b=0;b<m+u;b++){for(let f=0;f<c;f++){let C=f*this._tmpCanvas.width*4+b*4+3;if(i.data[C]!==0){r.left=b,h=!0;break}}if(h)break}r.right=u,h=!1;for(let b=m+u-1;b>=m;b--){for(let f=0;f<c;f++){let C=f*this._tmpCanvas.width*4+b*4+3;if(i.data[C]!==0){r.right=b,h=!0;break}}if(h)break}r.bottom=c,h=!1;for(let b=c-1;b>=0;b--){for(let f=0;f<u;f++){let C=b*this._tmpCanvas.width*4+f*4+3;if(i.data[C]!==0){r.bottom=b,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+(o||_?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-r.top+m+(o||_?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}},Wf=class{constructor(e,i,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=jS(e,i,i),this.ctx=ci(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 Gf(e,i,r,a){let o=i.rgba>>>24,_=i.rgba>>>16&255,m=i.rgba>>>8&255,c=r.rgba>>>24,u=r.rgba>>>16&255,h=r.rgba>>>8&255,b=Math.floor((Math.abs(o-c)+Math.abs(_-u)+Math.abs(m-h))/12),f=!0;for(let C=0;C<e.data.length;C+=4)e.data[C]===o&&e.data[C+1]===_&&e.data[C+2]===m||a&&Math.abs(e.data[C]-o)+Math.abs(e.data[C+1]-_)+Math.abs(e.data[C+2]-m)<b?e.data[C+3]=0:f=!1;return f}function vk(e){for(let i=0;i<e.data.length;i+=4)if(e.data[i+3]>0)return!1;return!0}function jS(e,i,r){let a=e.createElement("canvas");return a.width=i,a.height=r,a}function bk(e,i,r,a,o,_,m,c){let u={foreground:_.foreground,background:_.background,cursor:xn,cursorAccent:xn,selectionForeground:xn,selectionBackgroundTransparent:xn,selectionBackgroundOpaque:xn,selectionInactiveBackgroundTransparent:xn,selectionInactiveBackgroundOpaque:xn,overviewRulerBorder:xn,scrollbarSliderBackground:xn,scrollbarSliderHoverBackground:xn,scrollbarSliderActiveBackground:xn,ansi:_.ansi.slice(),contrastCache:_.contrastCache,halfContrastCache:_.halfContrastCache};return{customGlyphs:o.customGlyphs,devicePixelRatio:m,deviceMaxTextureSize:c,letterSpacing:o.letterSpacing,lineHeight:o.lineHeight,deviceCellWidth:e,deviceCellHeight:i,deviceCharWidth:r,deviceCharHeight:a,fontFamily:o.fontFamily,fontSize:o.fontSize,fontWeight:o.fontWeight,fontWeightBold:o.fontWeightBold,allowTransparency:o.allowTransparency,drawBoldTextInBrightColors:o.drawBoldTextInBrightColors,minimumContrastRatio:o.minimumContrastRatio,colors:u}}function Tb(e,i){for(let r=0;r<e.colors.ansi.length;r++)if(e.colors.ansi[r].rgba!==i.colors.ansi[r].rgba)return!1;return e.devicePixelRatio===i.devicePixelRatio&&e.customGlyphs===i.customGlyphs&&e.lineHeight===i.lineHeight&&e.letterSpacing===i.letterSpacing&&e.fontFamily===i.fontFamily&&e.fontSize===i.fontSize&&e.fontWeight===i.fontWeight&&e.fontWeightBold===i.fontWeightBold&&e.allowTransparency===i.allowTransparency&&e.deviceCharWidth===i.deviceCharWidth&&e.deviceCharHeight===i.deviceCharHeight&&e.drawBoldTextInBrightColors===i.drawBoldTextInBrightColors&&e.minimumContrastRatio===i.minimumContrastRatio&&e.colors.foreground.rgba===i.colors.foreground.rgba&&e.colors.background.rgba===i.colors.background.rgba}function yk(e){return(e&50331648)===16777216||(e&50331648)===33554432}var An=[];function zS(e,i,r,a,o,_,m,c,u){let h=bk(a,o,_,m,i,r,c,u);for(let C=0;C<An.length;C++){let E=An[C],A=E.ownedBy.indexOf(e);if(A>=0){if(Tb(E.config,h))return E.atlas;E.ownedBy.length===1?(E.atlas.dispose(),An.splice(C,1)):E.ownedBy.splice(A,1);break}}for(let C=0;C<An.length;C++){let E=An[C];if(Tb(E.config,h))return E.ownedBy.push(e),E.atlas}let b=e._core,f={atlas:new ds(document,h,b.unicodeService),config:h,ownedBy:[e]};return An.push(f),f.atlas}function Ab(e){for(let i=0;i<An.length;i++){let r=An[i].ownedBy.indexOf(e);if(r!==-1){An[i].ownedBy.length===1?(An[i].atlas.dispose(),An.splice(i,1)):An[i].ownedBy.splice(r,1);break}}}var cu=600,Sk=class{constructor(e,i){this._renderCallback=e,this._coreBrowserService=i,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=cu){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){let i=cu-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,i>0){this._restartInterval(i);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 i=cu-(Date.now()-this._animationTimeRestarted);this._animationTimeRestarted=void 0,this._restartInterval(i);return}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},cu)},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 kb(e,i,r){let a=new i.ResizeObserver(o=>{let _=o.find(u=>u.target===e);if(!_)return;if(!("devicePixelContentBoxSize"in _)){a?.disconnect(),a=void 0;return}let m=_.devicePixelContentBoxSize[0].inlineSize,c=_.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 Di(()=>a?.disconnect())}function wk(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}var Rb=class $S extends Ya{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new MS,this.combinedData=""}static fromCharData(i){let r=new $S;return r.setFromCharData(i),r}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?wk(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(i){this.fg=i[0],this.bg=0;let r=!1;if(i[1].length>2)r=!0;else if(i[1].length===2){let a=i[1].charCodeAt(0);if(55296<=a&&a<=56319){let o=i[1].charCodeAt(1);56320<=o&&o<=57343?this.content=(a-55296)*1024+o-56320+65536|i[2]<<22:r=!0}else r=!0}else this.content=i[1].charCodeAt(0)|i[2]<<22;r&&(this.combinedData=i[1],this.content=2097152|i[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},HS=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]);function PS(e,i,r){let a=ci(e.createProgram());if(e.attachShader(a,ci(Lb(e,e.VERTEX_SHADER,i))),e.attachShader(a,ci(Lb(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 Lb(e,i,r){let a=ci(e.createShader(i));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 Ck(e,i){let r=Math.min(e.length*2,i),a=new Float32Array(r);for(let o=0;o<e.length;o++)a[o]=e[o];return a}var xk=class{constructor(e){this.texture=e,this.version=-1}},Ek=`#version 300 es
|
|
19
|
+
layout (location = 0) in vec2 a_unitquad;
|
|
20
|
+
layout (location = 1) in vec2 a_cellpos;
|
|
21
|
+
layout (location = 2) in vec2 a_offset;
|
|
22
|
+
layout (location = 3) in vec2 a_size;
|
|
23
|
+
layout (location = 4) in float a_texpage;
|
|
24
|
+
layout (location = 5) in vec2 a_texcoord;
|
|
25
|
+
layout (location = 6) in vec2 a_texsize;
|
|
26
|
+
|
|
27
|
+
uniform mat4 u_projection;
|
|
28
|
+
uniform vec2 u_resolution;
|
|
29
|
+
|
|
30
|
+
out vec2 v_texcoord;
|
|
31
|
+
flat out int v_texpage;
|
|
32
|
+
|
|
33
|
+
void main() {
|
|
34
|
+
vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
|
|
35
|
+
gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
|
|
36
|
+
v_texpage = int(a_texpage);
|
|
37
|
+
v_texcoord = a_texcoord + a_unitquad * a_texsize;
|
|
38
|
+
}`;function Tk(e){let i="";for(let r=1;r<e;r++)i+=` else if (v_texpage == ${r}) { outColor = texture(u_texture[${r}], v_texcoord); }`;return`#version 300 es
|
|
39
|
+
precision lowp float;
|
|
40
|
+
|
|
41
|
+
in vec2 v_texcoord;
|
|
42
|
+
flat in int v_texpage;
|
|
43
|
+
|
|
44
|
+
uniform sampler2D u_texture[${e}];
|
|
45
|
+
|
|
46
|
+
out vec4 outColor;
|
|
47
|
+
|
|
48
|
+
void main() {
|
|
49
|
+
if (v_texpage == 0) {
|
|
50
|
+
outColor = texture(u_texture[0], v_texcoord);
|
|
51
|
+
} ${i}
|
|
52
|
+
}`}var fs=11,Ua=fs*Float32Array.BYTES_PER_ELEMENT,Ak=2,qt=0,Lt,Kf=0,hl=0,kk=class extends qn{constructor(e,i,r,a){super(),this._terminal=e,this._gl=i,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 o=this._gl;ds.maxAtlasPages===void 0&&(ds.maxAtlasPages=Math.min(32,ci(o.getParameter(o.MAX_TEXTURE_IMAGE_UNITS))),ds.maxTextureSize=ci(o.getParameter(o.MAX_TEXTURE_SIZE))),this._program=ci(PS(o,Ek,Tk(ds.maxAtlasPages))),this._register(Di(()=>o.deleteProgram(this._program))),this._projectionLocation=ci(o.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=ci(o.getUniformLocation(this._program,"u_resolution")),this._textureLocation=ci(o.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=o.createVertexArray(),o.bindVertexArray(this._vertexArrayObject);let _=new Float32Array([0,0,1,0,0,1,1,1]),m=o.createBuffer();this._register(Di(()=>o.deleteBuffer(m))),o.bindBuffer(o.ARRAY_BUFFER,m),o.bufferData(o.ARRAY_BUFFER,_,o.STATIC_DRAW),o.enableVertexAttribArray(0),o.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);let c=new Uint8Array([0,1,2,3]),u=o.createBuffer();this._register(Di(()=>o.deleteBuffer(u))),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,u),o.bufferData(o.ELEMENT_ARRAY_BUFFER,c,o.STATIC_DRAW),this._attributesBuffer=ci(o.createBuffer()),this._register(Di(()=>o.deleteBuffer(this._attributesBuffer))),o.bindBuffer(o.ARRAY_BUFFER,this._attributesBuffer),o.enableVertexAttribArray(2),o.vertexAttribPointer(2,2,o.FLOAT,!1,Ua,0),o.vertexAttribDivisor(2,1),o.enableVertexAttribArray(3),o.vertexAttribPointer(3,2,o.FLOAT,!1,Ua,2*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(3,1),o.enableVertexAttribArray(4),o.vertexAttribPointer(4,1,o.FLOAT,!1,Ua,4*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(4,1),o.enableVertexAttribArray(5),o.vertexAttribPointer(5,2,o.FLOAT,!1,Ua,5*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(5,1),o.enableVertexAttribArray(6),o.vertexAttribPointer(6,2,o.FLOAT,!1,Ua,7*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(6,1),o.enableVertexAttribArray(1),o.vertexAttribPointer(1,2,o.FLOAT,!1,Ua,9*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(1,1),o.useProgram(this._program);let h=new Int32Array(ds.maxAtlasPages);for(let b=0;b<ds.maxAtlasPages;b++)h[b]=b;o.uniform1iv(this._textureLocation,h),o.uniformMatrix4fv(this._projectionLocation,!1,HS),this._atlasTextures=[];for(let b=0;b<ds.maxAtlasPages;b++){let f=new xk(ci(o.createTexture()));this._register(Di(()=>o.deleteTexture(f.texture))),o.activeTexture(o.TEXTURE0+b),o.bindTexture(o.TEXTURE_2D,f.texture),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE),o.texImage2D(o.TEXTURE_2D,0,o.RGBA,1,1,0,o.RGBA,o.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[b]=f}o.enable(o.BLEND),o.blendFunc(o.SRC_ALPHA,o.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return this._atlas?this._atlas.beginFrame():!0}updateCell(e,i,r,a,o,_,m,c,u){this._updateCell(this._vertices.attributes,e,i,r,a,o,_,m,c,u)}_updateCell(e,i,r,a,o,_,m,c,u,h){if(qt=(r*this._terminal.cols+i)*fs,a===0||a===void 0){e.fill(0,qt,qt+fs-1-Ak);return}this._atlas&&(c&&c.length>1?Lt=this._atlas.getRasterizedGlyphCombinedChar(c,o,_,m,!1,this._terminal.element):Lt=this._atlas.getRasterizedGlyph(a,o,_,m,!1,this._terminal.element),Kf=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),o!==h&&Lt.offset.x>Kf?(hl=Lt.offset.x-Kf,e[qt]=-(Lt.offset.x-hl)+this._dimensions.device.char.left,e[qt+1]=-Lt.offset.y+this._dimensions.device.char.top,e[qt+2]=(Lt.size.x-hl)/this._dimensions.device.canvas.width,e[qt+3]=Lt.size.y/this._dimensions.device.canvas.height,e[qt+4]=Lt.texturePage,e[qt+5]=Lt.texturePositionClipSpace.x+hl/this._atlas.pages[Lt.texturePage].canvas.width,e[qt+6]=Lt.texturePositionClipSpace.y,e[qt+7]=Lt.sizeClipSpace.x-hl/this._atlas.pages[Lt.texturePage].canvas.width,e[qt+8]=Lt.sizeClipSpace.y):(e[qt]=-Lt.offset.x+this._dimensions.device.char.left,e[qt+1]=-Lt.offset.y+this._dimensions.device.char.top,e[qt+2]=Lt.size.x/this._dimensions.device.canvas.width,e[qt+3]=Lt.size.y/this._dimensions.device.canvas.height,e[qt+4]=Lt.texturePage,e[qt+5]=Lt.texturePositionClipSpace.x,e[qt+6]=Lt.texturePositionClipSpace.y,e[qt+7]=Lt.sizeClipSpace.x,e[qt+8]=Lt.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&qA(a,u,Lt.size.x,this._dimensions.device.cell.width)&&(e[qt+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width))}clear(){let e=this._terminal,i=e.cols*e.rows*fs;this._vertices.count!==i?this._vertices.attributes=new Float32Array(i):this._vertices.attributes.fill(0);let r=0;for(;r<this._vertices.attributesBuffers.length;r++)this._vertices.count!==i?this._vertices.attributesBuffers[r]=new Float32Array(i):this._vertices.attributesBuffers[r].fill(0);this._vertices.count=i,r=0;for(let a=0;a<e.rows;a++)for(let o=0;o<e.cols;o++)this._vertices.attributes[r+9]=o/e.cols,this._vertices.attributes[r+10]=a/e.rows,r+=fs}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 i=this._gl;i.useProgram(this._program),i.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;let r=this._vertices.attributesBuffers[this._activeBuffer],a=0;for(let o=0;o<e.lineLengths.length;o++){let _=o*this._terminal.cols*fs,m=this._vertices.attributes.subarray(_,_+e.lineLengths[o]*fs);r.set(m,a),a+=m.length}i.bindBuffer(i.ARRAY_BUFFER,this._attributesBuffer),i.bufferData(i.ARRAY_BUFFER,r.subarray(0,a),i.STREAM_DRAW);for(let o=0;o<this._atlas.pages.length;o++)this._atlas.pages[o].version!==this._atlasTextures[o].version&&this._bindAtlasPageTexture(i,this._atlas,o);i.drawElementsInstanced(i.TRIANGLE_STRIP,4,i.UNSIGNED_BYTE,0,a/fs)}setAtlas(e){this._atlas=e;for(let i of this._atlasTextures)i.version=-1}_bindAtlasPageTexture(e,i,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,i.pages[r].canvas),e.generateMipmap(e.TEXTURE_2D),this._atlasTextures[r].version=i.pages[r].version}setDimensions(e){this._dimensions=e}},Rk=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,i,r,a=!1){if(this.selectionStart=i,this.selectionEnd=r,!i||!r||i[0]===r[0]&&i[1]===r[1]){this.clear();return}let o=e.buffers.active.ydisp,_=i[1]-o,m=r[1]-o,c=Math.max(_,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=_,this.viewportEndRow=m,this.viewportCappedStartRow=c,this.viewportCappedEndRow=u,this.startCol=i[0],this.endCol=r[0]}isCellSelected(e,i,r){return this.hasSelection?(r-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?i>=this.startCol&&r>=this.viewportCappedStartRow&&i<this.endCol&&r<=this.viewportCappedEndRow:i<this.startCol&&r>=this.viewportCappedStartRow&&i>=this.endCol&&r<=this.viewportCappedEndRow:r>this.viewportStartRow&&r<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&r===this.viewportStartRow&&i>=this.startCol&&i<this.endCol||this.viewportStartRow<this.viewportEndRow&&r===this.viewportEndRow&&i<this.endCol||this.viewportStartRow<this.viewportEndRow&&r===this.viewportStartRow&&i>=this.startCol):!1}};function Lk(){return new Rk}var qu=4,ku=1,Ru=2,Vf=3,Mk=2147483648,Dk=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=Lk()}resize(e,i){let r=e*i*qu;r!==this.cells.length&&(this.cells=new Uint32Array(r),this.lineLengths=new Uint32Array(i))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}},Ok=`#version 300 es
|
|
53
|
+
layout (location = 0) in vec2 a_position;
|
|
54
|
+
layout (location = 1) in vec2 a_size;
|
|
55
|
+
layout (location = 2) in vec4 a_color;
|
|
56
|
+
layout (location = 3) in vec2 a_unitquad;
|
|
57
|
+
|
|
58
|
+
uniform mat4 u_projection;
|
|
59
|
+
|
|
60
|
+
out vec4 v_color;
|
|
61
|
+
|
|
62
|
+
void main() {
|
|
63
|
+
vec2 zeroToOne = a_position + (a_unitquad * a_size);
|
|
64
|
+
gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
|
|
65
|
+
v_color = a_color;
|
|
66
|
+
}`,Nk=`#version 300 es
|
|
67
|
+
precision lowp float;
|
|
68
|
+
|
|
69
|
+
in vec4 v_color;
|
|
70
|
+
|
|
71
|
+
out vec4 outColor;
|
|
72
|
+
|
|
73
|
+
void main() {
|
|
74
|
+
outColor = v_color;
|
|
75
|
+
}`,Or=8,Yf=Or*Float32Array.BYTES_PER_ELEMENT,Bk=20*Or,Mb=class{constructor(){this.attributes=new Float32Array(Bk),this.count=0}},Lr=0,Db=0,Ob=0,Nb=0,Bb=0,Ib=0,jb=0,Ik=class extends qn{constructor(e,i,r,a){super(),this._terminal=e,this._gl=i,this._dimensions=r,this._themeService=a,this._vertices=new Mb,this._verticesCursor=new Mb;let o=this._gl;this._program=ci(PS(o,Ok,Nk)),this._register(Di(()=>o.deleteProgram(this._program))),this._projectionLocation=ci(o.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=o.createVertexArray(),o.bindVertexArray(this._vertexArrayObject);let _=new Float32Array([0,0,1,0,0,1,1,1]),m=o.createBuffer();this._register(Di(()=>o.deleteBuffer(m))),o.bindBuffer(o.ARRAY_BUFFER,m),o.bufferData(o.ARRAY_BUFFER,_,o.STATIC_DRAW),o.enableVertexAttribArray(3),o.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let c=new Uint8Array([0,1,2,3]),u=o.createBuffer();this._register(Di(()=>o.deleteBuffer(u))),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,u),o.bufferData(o.ELEMENT_ARRAY_BUFFER,c,o.STATIC_DRAW),this._attributesBuffer=ci(o.createBuffer()),this._register(Di(()=>o.deleteBuffer(this._attributesBuffer))),o.bindBuffer(o.ARRAY_BUFFER,this._attributesBuffer),o.enableVertexAttribArray(0),o.vertexAttribPointer(0,2,o.FLOAT,!1,Yf,0),o.vertexAttribDivisor(0,1),o.enableVertexAttribArray(1),o.vertexAttribPointer(1,2,o.FLOAT,!1,Yf,2*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(1,1),o.enableVertexAttribArray(2),o.vertexAttribPointer(2,4,o.FLOAT,!1,Yf,4*Float32Array.BYTES_PER_ELEMENT),o.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 i=this._gl;i.useProgram(this._program),i.bindVertexArray(this._vertexArrayObject),i.uniformMatrix4fv(this._projectionLocation,!1,HS),i.bindBuffer(i.ARRAY_BUFFER,this._attributesBuffer),i.bufferData(i.ARRAY_BUFFER,e.attributes,i.DYNAMIC_DRAW),i.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,i.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 i=this._terminal,r=this._vertices,a=1,o,_,m,c,u,h,b,f,C,E,A;for(o=0;o<i.rows;o++){for(m=-1,c=0,u=0,h=!1,_=0;_<i.cols;_++)b=(o*i.cols+_)*qu,f=e.cells[b+ku],C=e.cells[b+Ru],E=!!(C&67108864),(f!==c||C!==u&&(h||E))&&((c!==0||h&&u!==0)&&(A=a++*Or,this._updateRectangle(r,A,u,c,m,_,o)),m=_,c=f,u=C,h=E);(c!==0||h&&u!==0)&&(A=a++*Or,this._updateRectangle(r,A,u,c,m,i.cols,o))}r.count=a}updateCursor(e){let i=this._verticesCursor,r=e.cursor;if(!r||r.style==="block"){i.count=0;return}let a,o=0;(r.style==="bar"||r.style==="outline")&&(a=o++*Or,this._addRectangleFloat(i.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=o++*Or,this._addRectangleFloat(i.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=o++*Or,this._addRectangleFloat(i.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=o++*Or,this._addRectangleFloat(i.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)),i.count=o}_updateRectangle(e,i,r,a,o,_,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<i+4&&(e.attributes=Ck(e.attributes,this._terminal.rows*this._terminal.cols*Or)),Db=o*this._dimensions.device.cell.width,Ob=m*this._dimensions.device.cell.height,Nb=(Lr>>24&255)/255,Bb=(Lr>>16&255)/255,Ib=(Lr>>8&255)/255,jb=1,this._addRectangle(e.attributes,i,Db,Ob,(_-o)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,Nb,Bb,Ib,jb)}_addRectangle(e,i,r,a,o,_,m,c,u,h){e[i]=r/this._dimensions.device.canvas.width,e[i+1]=a/this._dimensions.device.canvas.height,e[i+2]=o/this._dimensions.device.canvas.width,e[i+3]=_/this._dimensions.device.canvas.height,e[i+4]=m,e[i+5]=c,e[i+6]=u,e[i+7]=h}_addRectangleFloat(e,i,r,a,o,_,m){e[i]=r/this._dimensions.device.canvas.width,e[i+1]=a/this._dimensions.device.canvas.height,e[i+2]=o/this._dimensions.device.canvas.width,e[i+3]=_/this._dimensions.device.canvas.height,e[i+4]=m[0],e[i+5]=m[1],e[i+6]=m[2],e[i+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])}},jk=class extends qn{constructor(e,i,r,a,o,_,m,c){super(),this._container=i,this._alpha=o,this._coreBrowserService=_,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(Di(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=ci(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(e){}handleFocus(e){}handleCursorMove(e){}handleGridChanged(e,i,r){}handleSelectionChanged(e,i,r,a=!1){}_setTransparency(e,i){if(i===this._alpha)return;let r=this._canvas;this._alpha=i,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,i){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=zS(e,this._optionsService.rawOptions,i,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(e,i){this._deviceCellWidth=i.device.cell.width,this._deviceCellHeight=i.device.cell.height,this._deviceCharWidth=i.device.char.width,this._deviceCharHeight=i.device.char.height,this._deviceCharLeft=i.device.char.left,this._deviceCharTop=i.device.char.top,this._canvas.width=i.device.canvas.width,this._canvas.height=i.device.canvas.height,this._canvas.style.width=`${i.css.canvas.width}px`,this._canvas.style.height=`${i.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(e,this._themeService.colors)}_fillBottomLineAtCells(e,i,r=1){this._ctx.fillRect(e*this._deviceCellWidth,(i+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,i,r,a){this._alpha?this._ctx.clearRect(e*this._deviceCellWidth,i*this._deviceCellHeight,r*this._deviceCellWidth,a*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(e*this._deviceCellWidth,i*this._deviceCellHeight,r*this._deviceCellWidth,a*this._deviceCellHeight))}_fillCharTrueColor(e,i,r,a){this._ctx.font=this._getFont(e,!1,!1),this._ctx.textBaseline=TS,this._clipCell(r,a,i.getWidth()),this._ctx.fillText(i.getChars(),r*this._deviceCellWidth+this._deviceCharLeft,a*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(e,i,r){this._ctx.beginPath(),this._ctx.rect(e*this._deviceCellWidth,i*this._deviceCellHeight,r*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(e,i,r){let a=i?e.options.fontWeightBold:e.options.fontWeight;return`${r?"italic":""} ${a} ${e.options.fontSize*this._coreBrowserService.dpr}px ${e.options.fontFamily}`}},zk=class extends jk{constructor(e,i,r,a,o,_,m){super(r,e,"link",i,!0,o,_,m),this._register(a.onShowLinkUnderline(c=>this._handleShowLinkUnderline(c))),this._register(a.onHideLinkUnderline(c=>this._handleHideLinkUnderline(c)))}resize(e,i){super.resize(e,i),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&&yk(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 i=e.y1+1;i<e.y2;i++)this._fillBottomLineAtCells(0,i,e.cols);this._fillBottomLineAtCells(0,e.y2,e.x2)}this._state=e}_handleHideLinkUnderline(e){this._clearCurrentLink()}},Ws=typeof window=="object"?window:globalThis,Wp=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new Mt,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new Mt,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(i){return this.mapWindowIdToZoomLevel.get(this.getWindowId(i))??0}setZoomLevel(i,r){if(this.getZoomLevel(r)===i)return;let a=this.getWindowId(r);this.mapWindowIdToZoomLevel.set(a,i),this._onDidChangeZoomLevel.fire(a)}getZoomFactor(i){return this.mapWindowIdToZoomFactor.get(this.getWindowId(i))??1}setZoomFactor(i,r){this.mapWindowIdToZoomFactor.set(this.getWindowId(r),i)}setFullscreen(i,r){if(this.isFullscreen(r)===i)return;let a=this.getWindowId(r);this.mapWindowIdToFullScreen.set(a,i),this._onDidChangeFullscreen.fire(a)}isFullscreen(i){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(i))}getWindowId(i){return i.vscodeWindowId}};Wp.INSTANCE=new Wp;var US=Wp;function $k(e,i,r){typeof i=="string"&&(i=e.matchMedia(i)),i.addEventListener("change",r)}US.INSTANCE.onDidChangeZoomLevel;US.INSTANCE.onDidChangeFullscreen;var lo=typeof navigator=="object"?navigator.userAgent:"";lo.indexOf("Firefox")>=0;lo.indexOf("AppleWebKit")>=0;var Hk=lo.indexOf("Chrome")>=0;!Hk&&lo.indexOf("Safari")>=0;lo.indexOf("Electron/")>=0;lo.indexOf("Android")>=0;var Xf=!1;if(typeof Ws.matchMedia=="function"){let e=Ws.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),i=Ws.matchMedia("(display-mode: fullscreen)");Xf=e.matches,$k(Ws,e,({matches:r})=>{Xf&&i.matches||(Xf=r)})}var Xa="en",Zf=!1,FS=!1,uu,Lu=Xa,zb=Xa,Pk,Mr,Ys=globalThis,hn;typeof Ys.vscode<"u"&&typeof Ys.vscode.process<"u"?hn=Ys.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(hn=process);var Uk=typeof hn?.versions?.electron=="string",Fk=Uk&&hn?.type==="renderer";if(typeof hn=="object"){hn.platform,hn.platform,Zf=hn.platform==="linux",Zf&&hn.env.SNAP&&hn.env.SNAP_REVISION,hn.env.CI||hn.env.BUILD_ARTIFACTSTAGINGDIRECTORY,uu=Xa,Lu=Xa;let e=hn.env.VSCODE_NLS_CONFIG;if(e)try{let i=JSON.parse(e);uu=i.userLocale,zb=i.osLocale,Lu=i.resolvedLanguage||Xa,Pk=i.languagePack?.translationsConfigFile}catch{}FS=!0}else typeof navigator=="object"&&!Fk?(Mr=navigator.userAgent,Mr.indexOf("Windows")>=0,Mr.indexOf("Macintosh")>=0,(Mr.indexOf("Macintosh")>=0||Mr.indexOf("iPad")>=0||Mr.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Zf=Mr.indexOf("Linux")>=0,Mr?.indexOf("Mobi")>=0,Lu=globalThis._VSCODE_NLS_LANGUAGE||Xa,uu=navigator.language.toLowerCase(),zb=uu):console.error("Unable to resolve platform.");var $b=FS,tr=Mr,cs=Lu,qk;(e=>{function i(){return cs}e.value=i;function r(){return cs.length===2?cs==="en":cs.length>=3?cs[0]==="e"&&cs[1]==="n"&&cs[2]==="-":!1}e.isDefaultVariant=r;function a(){return cs==="en"}e.isDefault=a})(qk||={});var Wk=typeof Ys.postMessage=="function"&&!Ys.importScripts;(()=>{if(Wk){let e=[];Ys.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let a=0,o=e.length;a<o;a++){let _=e[a];if(_.id===r.data.vscodeScheduleAsyncWork){e.splice(a,1),_.callback();return}}});let i=0;return r=>{let a=++i;e.push({id:a,callback:r}),Ys.postMessage({vscodeScheduleAsyncWork:a},"*")}}return e=>setTimeout(e)})();var Gk=!!(tr&&tr.indexOf("Chrome")>=0);tr&&tr.indexOf("Firefox")>=0;!Gk&&tr&&tr.indexOf("Safari")>=0;tr&&tr.indexOf("Edg/")>=0;tr&&tr.indexOf("Android")>=0;var Fa=typeof navigator=="object"?navigator:{};$b||document.queryCommandSupported&&document.queryCommandSupported("copy")||Fa&&Fa.clipboard&&Fa.clipboard.writeText,$b||Fa&&Fa.clipboard&&Fa.clipboard.readText;var Ig=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,i){this._keyCodeToStr[e]=i,this._strToKeyCode[i.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},Jf=new Ig,Hb=new Ig,Pb=new Ig;new Array(230);var Kk;(e=>{function i(c){return Jf.keyCodeToStr(c)}e.toString=i;function r(c){return Jf.strToKeyCode(c)}e.fromString=r;function a(c){return Hb.keyCodeToStr(c)}e.toUserSettingsUS=a;function o(c){return Pb.keyCodeToStr(c)}e.toUserSettingsGeneral=o;function _(c){return Hb.strToKeyCode(c)||Pb.strToKeyCode(c)}e.fromUserSettings=_;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 Jf.keyCodeToStr(c)}e.toElectronAccelerator=m})(Kk||={});var qS=Object.freeze(function(e,i){let r=setTimeout(e.bind(i),0);return{dispose(){clearTimeout(r)}}}),Vk;(e=>{function i(r){return r===e.None||r===e.Cancelled||r instanceof Yk?!0:!r||typeof r!="object"?!1:typeof r.isCancellationRequested=="boolean"&&typeof r.onCancellationRequested=="function"}e.isCancellationToken=i,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Nr.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:qS})})(Vk||={});var Yk=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?qS:(this._emitter||(this._emitter=new Mt),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},Xk;(e=>{async function i(a){let o,_=await Promise.all(a.map(m=>m.then(c=>c,c=>{o||(o=c)})));if(typeof o<"u")throw o;return _}e.settled=i;function r(a){return new Promise(async(o,_)=>{try{await a(o,_)}catch(m){_(m)}})}e.withAsyncBody=r})(Xk||={});var Ub=class En{static fromArray(i){return new En(r=>{r.emitMany(i)})}static fromPromise(i){return new En(async r=>{r.emitMany(await i)})}static fromPromises(i){return new En(async r=>{await Promise.all(i.map(async a=>r.emitOne(await a)))})}static merge(i){return new En(async r=>{await Promise.all(i.map(async a=>{for await(let o of a)r.emitOne(o)}))})}constructor(i,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new Mt,queueMicrotask(async()=>{let a={emitOne:o=>this.emitOne(o),emitMany:o=>this.emitMany(o),reject:o=>this.reject(o)};try{await Promise.resolve(i(a)),this.resolve()}catch(o){this.reject(o)}finally{a.emitOne=void 0,a.emitMany=void 0,a.reject=void 0}})}[Symbol.asyncIterator](){let i=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(i<this._results.length)return{done:!1,value:this._results[i++]};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(i,r){return new En(async a=>{for await(let o of i)a.emitOne(r(o))})}map(i){return En.map(this,i)}static filter(i,r){return new En(async a=>{for await(let o of i)r(o)&&a.emitOne(o)})}filter(i){return En.filter(this,i)}static coalesce(i){return En.filter(i,r=>!!r)}coalesce(){return En.coalesce(this)}static async toPromise(i){let r=[];for await(let a of i)r.push(a);return r}toPromise(){return En.toPromise(this)}emitOne(i){this._state===0&&(this._results.push(i),this._onStateChanged.fire())}emitMany(i){this._state===0&&(this._results=this._results.concat(i),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(i){this._state===0&&(this._state=2,this._error=i,this._onStateChanged.fire())}};Ub.EMPTY=Ub.fromArray([]);var{getWindow:Zk}=(function(){let e=new Map,i={window:Ws,disposables:new Qa};e.set(Ws.vscodeWindowId,i);let r=new Mt,a=new Mt,o=new Mt;function _(m,c){return(typeof m=="number"?e.get(m):void 0)??(c?i:void 0)}return{onDidRegisterWindow:r.event,onWillUnregisterWindow:o.event,onDidUnregisterWindow:a.event,registerWindow(m){if(e.has(m.vscodeWindowId))return qn.None;let c=new Qa,u={window:m,disposables:c.add(new Qa)};return e.set(m.vscodeWindowId,u),c.add(Di(()=>{e.delete(m.vscodeWindowId),a.fire(m)})),c.add(Gp(m,Qk.BEFORE_UNLOAD,()=>{o.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:_,getWindow(m){let c=m;if(c?.ownerDocument?.defaultView)return c.ownerDocument.defaultView.window;let u=m;return u?.view?u.view.window:Ws},getDocument(m){return Zk(m).document}}})(),Jk=class{constructor(e,i,r,a){this._node=e,this._type=i,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 Gp(e,i,r,a){return new Jk(e,i,r,a)}var Qk={BEFORE_UNLOAD:"beforeunload"},e3=class extends qn{constructor(e,i,r,a,o,_,m,c,u){super(),this._terminal=e,this._characterJoinerService=i,this._charSizeService=r,this._coreBrowserService=a,this._coreService=o,this._decorationService=_,this._optionsService=m,this._themeService=c,this._cursorBlinkStateManager=new ll,this._charAtlasDisposable=this._register(new ll),this._observerDisposable=this._register(new ll),this._model=new Dk,this._workCell=new Rb,this._workCell2=new Rb,this._rectangleRenderer=this._register(new ll),this._glyphRenderer=this._register(new ll),this._onChangeTextureAtlas=this._register(new Mt),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Mt),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Mt),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new Mt),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new Mt),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 KA(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new zk(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,m,this._themeService)],this.dimensions=WA(),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(Gp(this._canvas,"webglcontextlost",b=>{console.log("webglcontextlost event received"),b.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(b)},3e3)})),this._register(Gp(this._canvas,"webglcontextrestored",b=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,Ab(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=kb(this._canvas,this._coreBrowserService.window,(b,f)=>this._setCanvasDevicePixelDimensions(b,f)),this._register(this._coreBrowserService.onWindowChange(b=>{this._observerDisposable.value=kb(this._canvas,b,(f,C)=>this._setCanvasDevicePixelDimensions(f,C))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(Di(()=>{for(let b of this._renderLayers)b.dispose();this._canvas.parentElement?.removeChild(this._canvas),Ab(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,i){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,i,r){for(let a of this._renderLayers)a.handleSelectionChanged(this._terminal,e,i,r);this._model.selection.update(this._core,e,i,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 Ik(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new kk(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=zS(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=SS(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,i){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,i);!this._glyphRenderer.value||!this._rectangleRenderer.value||(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(e,i),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 Sk(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(e,i){let r=this._core,a=this._workCell,o,_,m,c,u,h,b=0,f=!0,C,E,A,x,p,y,d,v,T;e=Fb(e,r.rows-1,0),i=Fb(i,r.rows-1,0);let R=this._coreService.decPrivateModes.cursorStyle??r.options.cursorStyle??"block",L=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,M=L-r.buffer.ydisp,k=Math.min(this._terminal.buffer.active.cursorX,r.cols-1),B=-1,W=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let F=!1;for(_=e;_<=i;_++)for(m=_+r.buffer.ydisp,c=r.buffer.lines.get(m),this._model.lineLengths[_]=0,A=L===m,b=0,u=this._characterJoinerService.getJoinedCharacters(m),v=0;v<r.cols;v++){if(o=this._cellColorResolver.result.bg,c.loadCell(v,a),v===0&&(o=this._cellColorResolver.result.bg),h=!1,f=v>=b,C=v,u.length>0&&v===u[0][0]&&f){E=u.shift();let q=this._model.selection.isCellSelected(this._terminal,E[0],m);for(d=E[0]+1;d<E[1];d++)f&&=q===this._model.selection.isCellSelected(this._terminal,d,m);f&&=!A||k<E[0]||k>=E[1],f?(h=!0,a=new t3(a,c.translateToString(!0,E[0],E[1]),E[1]-E[0]),C=E[1]-1):b=E[1]}if(x=a.getChars(),p=a.getCode(),d=(_*r.cols+v)*qu,this._cellColorResolver.resolve(a,v,m,this.dimensions.device.cell.width),W&&m===L&&(v===k&&(this._model.cursor={x:k,y:M,width:a.getWidth(),style:this._coreBrowserService.isFocused?R:r.options.cursorInactiveStyle,cursorWidth:r.options.cursorWidth,dpr:this._devicePixelRatio},B=k+a.getWidth()-1),v>=k&&v<=B&&(this._coreBrowserService.isFocused&&R==="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)),p!==0&&(this._model.lineLengths[_]=v+1),!(this._model.cells[d]===p&&this._model.cells[d+ku]===this._cellColorResolver.result.bg&&this._model.cells[d+Ru]===this._cellColorResolver.result.fg&&this._model.cells[d+Vf]===this._cellColorResolver.result.ext)&&(F=!0,x.length>1&&(p|=Mk),this._model.cells[d]=p,this._model.cells[d+ku]=this._cellColorResolver.result.bg,this._model.cells[d+Ru]=this._cellColorResolver.result.fg,this._model.cells[d+Vf]=this._cellColorResolver.result.ext,y=a.getWidth(),this._glyphRenderer.value.updateCell(v,_,p,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,x,y,o),h)){for(a=this._workCell,v++;v<=C;v++)T=(_*r.cols+v)*qu,this._glyphRenderer.value.updateCell(v,_,0,0,0,0,zA,0,0),this._model.cells[T]=0,this._model.cells[T+ku]=this._cellColorResolver.result.bg,this._model.cells[T+Ru]=this._cellColorResolver.result.fg,this._model.cells[T+Vf]=this._cellColorResolver.result.ext;v--}}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,i){this._canvas.width===e&&this._canvas.height===i||(this._canvas.width=e,this._canvas.height=i,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})}},t3=class extends Ya{constructor(e,i,r){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=i,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 Fb(e,i,r=0){return Math.max(Math.min(e,i),r)}var qb="di$target",Wb="di$dependencies",Qf=new Map;function rr(e){if(Qf.has(e))return Qf.get(e);let i=function(r,a,o){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");i3(i,r,o)};return i._id=e,Qf.set(e,i),i}function i3(e,i,r){i[qb]===i?i[Wb].push({id:e,index:r}):(i[Wb]=[{id:e,index:r}],i[qb]=i)}rr("BufferService");rr("CoreMouseService");rr("CoreService");rr("CharsetService");rr("InstantiationService");rr("LogService");var n3=rr("OptionsService");rr("OscLinkService");rr("UnicodeService");rr("DecorationService");var r3={trace:0,debug:1,info:2,warn:3,error:4,off:5},s3="xterm.js: ",Gb=class extends qn{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=r3[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let i=0;i<e.length;i++)typeof e[i]=="function"&&(e[i]=e[i]())}_log(e,i,r){this._evalLazyOptionalParams(r),e.call(console,(this._optionsService.options.logger?"":s3)+i,...r)}trace(e,...i){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,i)}debug(e,...i){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,i)}info(e,...i){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,i)}warn(e,...i){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,i)}error(e,...i){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,i)}};Gb=TA([AA(0,n3)],Gb);var a3=class extends qn{constructor(e){if(xS&&jA()<16){let i={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",i))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=e,this._onChangeTextureAtlas=this._register(new Mt),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Mt),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Mt),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new Mt),this.onContextLoss=this._onContextLoss.event}activate(e){let i=e._core;if(!e.element){this._register(i.onWillOpen(()=>this.activate(e)));return}this._terminal=e;let r=i.coreService,a=i.optionsService,o=i,_=o._renderService,m=o._characterJoinerService,c=o._charSizeService,u=o._coreBrowserService,h=o._decorationService;o._logService;let b=o._themeService;this._renderer=this._register(new e3(e,m,c,u,r,h,a,b,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)),_.setRenderer(this._renderer),this._register(Di(()=>{if(this._terminal._core._store._isDisposed)return;let f=this._terminal._core._renderService;f.setRenderer(this._terminal._core._createRenderer()),f.handleResize(e.cols,e.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}},ep={exports:{}},Kb;function o3(){return Kb||(Kb=1,(function(e,i){(function(r,a){e.exports=a()})(globalThis,(()=>(()=>{var r={4567:function(m,c,u){var h=this&&this.__decorate||function(d,v,T,R){var L,M=arguments.length,k=M<3?v:R===null?R=Object.getOwnPropertyDescriptor(v,T):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(d,v,T,R);else for(var B=d.length-1;B>=0;B--)(L=d[B])&&(k=(M<3?L(k):M>3?L(v,T,k):L(v,T))||k);return M>3&&k&&Object.defineProperty(v,T,k),k},b=this&&this.__param||function(d,v){return function(T,R){v(T,R,d)}};Object.defineProperty(c,"__esModule",{value:!0}),c.AccessibilityManager=void 0;const f=u(9042),C=u(9924),E=u(844),A=u(4725),x=u(2585),p=u(3656);let y=c.AccessibilityManager=class extends E.Disposable{constructor(d,v,T,R){super(),this._terminal=d,this._coreBrowserService=T,this._renderService=R,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 L=0;L<this._terminal.rows;L++)this._rowElements[L]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[L]);if(this._topBoundaryFocusListener=L=>this._handleBoundaryFocus(L,0),this._bottomBoundaryFocusListener=L=>this._handleBoundaryFocus(L,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((L=>this._handleResize(L.rows)))),this.register(this._terminal.onRender((L=>this._refreshRows(L.start,L.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((L=>this._handleChar(L)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
76
|
+
`)))),this.register(this._terminal.onA11yTab((L=>this._handleTab(L)))),this.register(this._terminal.onKey((L=>this._handleKey(L.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,p.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,E.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(d){for(let v=0;v<d;v++)this._handleChar(" ")}_handleChar(d){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==d&&(this._charsToAnnounce+=d):this._charsToAnnounce+=d,d===`
|
|
77
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=f.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(d){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(d)||this._charsToConsume.push(d)}_refreshRows(d,v){this._liveRegionDebouncer.refresh(d,v,this._terminal.rows)}_renderRows(d,v){const T=this._terminal.buffer,R=T.lines.length.toString();for(let L=d;L<=v;L++){const M=T.lines.get(T.ydisp+L),k=[],B=M?.translateToString(!0,void 0,void 0,k)||"",W=(T.ydisp+L+1).toString(),F=this._rowElements[L];F&&(B.length===0?(F.innerText=" ",this._rowColumns.set(F,[0,1])):(F.textContent=B,this._rowColumns.set(F,k)),F.setAttribute("aria-posinset",W),F.setAttribute("aria-setsize",R))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(d,v){const T=d.target,R=this._rowElements[v===0?1:this._rowElements.length-2];if(T.getAttribute("aria-posinset")===(v===0?"1":`${this._terminal.buffer.lines.length}`)||d.relatedTarget!==R)return;let L,M;if(v===0?(L=T,M=this._rowElements.pop(),this._rowContainer.removeChild(M)):(L=this._rowElements.shift(),M=T,this._rowContainer.removeChild(L)),L.removeEventListener("focus",this._topBoundaryFocusListener),M.removeEventListener("focus",this._bottomBoundaryFocusListener),v===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(v===0?-1:1),this._rowElements[v===0?1:this._rowElements.length-2].focus(),d.preventDefault(),d.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;const d=document.getSelection();if(!d)return;if(d.isCollapsed)return void(this._rowContainer.contains(d.anchorNode)&&this._terminal.clearSelection());if(!d.anchorNode||!d.focusNode)return void console.error("anchorNode and/or focusNode are null");let v={node:d.anchorNode,offset:d.anchorOffset},T={node:d.focusNode,offset:d.focusOffset};if((v.node.compareDocumentPosition(T.node)&Node.DOCUMENT_POSITION_PRECEDING||v.node===T.node&&v.offset>T.offset)&&([v,T]=[T,v]),v.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(v={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(v.node))return;const R=this._rowElements.slice(-1)[0];if(T.node.compareDocumentPosition(R)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(T={node:R,offset:R.textContent?.length??0}),!this._rowContainer.contains(T.node))return;const L=({node:B,offset:W})=>{const F=B instanceof Text?B.parentNode:B;let q=parseInt(F?.getAttribute("aria-posinset"),10)-1;if(isNaN(q))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 G=W<I.length?I[W]:I.slice(-1)[0]+1;return G>=this._terminal.cols&&(++q,G=0),{row:q,column:G}},M=L(v),k=L(T);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(d){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let v=this._rowContainer.children.length;v<this._terminal.rows;v++)this._rowElements[v]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[v]);for(;this._rowElements.length>d;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const d=this._coreBrowserService.mainDocument.createElement("div");return d.setAttribute("role","listitem"),d.tabIndex=-1,this._refreshRowDimensions(d),d}_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 d=0;d<this._terminal.rows;d++)this._refreshRowDimensions(this._rowElements[d])}}_refreshRowDimensions(d){d.style.height=`${this._renderService.dimensions.css.cell.height}px`}};c.AccessibilityManager=y=h([b(1,x.IInstantiationService),b(2,A.ICoreBrowserService),b(3,A.IRenderService)],y)},3614:(m,c)=>{function u(C){return C.replace(/\r?\n/g,"\r")}function h(C,E){return E?"\x1B[200~"+C+"\x1B[201~":C}function b(C,E,A,x){C=h(C=u(C),A.decPrivateModes.bracketedPasteMode&&x.rawOptions.ignoreBracketedPasteMode!==!0),A.triggerDataEvent(C,!0),E.value=""}function f(C,E,A){const x=A.getBoundingClientRect(),p=C.clientX-x.left-10,y=C.clientY-x.top-10;E.style.width="20px",E.style.height="20px",E.style.left=`${p}px`,E.style.top=`${y}px`,E.style.zIndex="1000",E.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,E){C.clipboardData&&C.clipboardData.setData("text/plain",E.selectionText),C.preventDefault()},c.handlePasteEvent=function(C,E,A,x){C.stopPropagation(),C.clipboardData&&b(C.clipboardData.getData("text/plain"),E,A,x)},c.paste=b,c.moveTextAreaUnderMouseCursor=f,c.rightClickHandler=function(C,E,A,x,p){f(C,E,A),p&&x.rightClickSelect(C),E.value=x.selectionText,E.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(b,f,C){this._css.set(b,f,C)}getCss(b,f){return this._css.get(b,f)}setColor(b,f,C){this._color.set(b,f,C)}getColor(b,f){return this._color.get(b,f)}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,b,f){u.addEventListener(h,b,f);let C=!1;return{dispose:()=>{C||(C=!0,u.removeEventListener(h,b,f))}}}},3551:function(m,c,u){var h=this&&this.__decorate||function(y,d,v,T){var R,L=arguments.length,M=L<3?d:T===null?T=Object.getOwnPropertyDescriptor(d,v):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,d,v,T);else for(var k=y.length-1;k>=0;k--)(R=y[k])&&(M=(L<3?R(M):L>3?R(d,v,M):R(d,v))||M);return L>3&&M&&Object.defineProperty(d,v,M),M},b=this&&this.__param||function(y,d){return function(v,T){d(v,T,y)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Linkifier=void 0;const f=u(3656),C=u(8460),E=u(844),A=u(2585),x=u(4725);let p=c.Linkifier=class extends E.Disposable{get currentLink(){return this._currentLink}constructor(y,d,v,T,R){super(),this._element=y,this._mouseService=d,this._renderService=v,this._bufferService=T,this._linkProviderService=R,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,E.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,E.toDisposable)((()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,f.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,f.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(y){this._lastMouseEvent=y;const d=this._positionFromMouseEvent(y,this._element,this._mouseService);if(!d)return;this._isMouseOut=!1;const v=y.composedPath();for(let T=0;T<v.length;T++){const R=v[T];if(R.classList.contains("xterm"))break;if(R.classList.contains("xterm-hover"))return}this._lastBufferCell&&d.x===this._lastBufferCell.x&&d.y===this._lastBufferCell.y||(this._handleHover(d),this._lastBufferCell=d)}_handleHover(y){if(this._activeLine!==y.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(y,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,y)||(this._clearCurrentLink(),this._askForLink(y,!0))}_askForLink(y,d){this._activeProviderReplies&&d||(this._activeProviderReplies?.forEach((T=>{T?.forEach((R=>{R.link.dispose&&R.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=y.y);let v=!1;for(const[T,R]of this._linkProviderService.linkProviders.entries())d?this._activeProviderReplies?.get(T)&&(v=this._checkLinkProviderResult(T,y,v)):R.provideLinks(y.y,(L=>{if(this._isMouseOut)return;const M=L?.map((k=>({link:k})));this._activeProviderReplies?.set(T,M),v=this._checkLinkProviderResult(T,y,v),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(y.y,this._activeProviderReplies)}))}_removeIntersectingLinks(y,d){const v=new Set;for(let T=0;T<d.size;T++){const R=d.get(T);if(R)for(let L=0;L<R.length;L++){const M=R[L],k=M.link.range.start.y<y?0:M.link.range.start.x,B=M.link.range.end.y>y?this._bufferService.cols:M.link.range.end.x;for(let W=k;W<=B;W++){if(v.has(W)){R.splice(L--,1);break}v.add(W)}}}}_checkLinkProviderResult(y,d,v){if(!this._activeProviderReplies)return v;const T=this._activeProviderReplies.get(y);let R=!1;for(let L=0;L<y;L++)this._activeProviderReplies.has(L)&&!this._activeProviderReplies.get(L)||(R=!0);if(!R&&T){const L=T.find((M=>this._linkAtPosition(M.link,d)));L&&(v=!0,this._handleNewLink(L))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!v)for(let L=0;L<this._activeProviderReplies.size;L++){const M=this._activeProviderReplies.get(L)?.find((k=>this._linkAtPosition(k.link,d)));if(M){v=!0,this._handleNewLink(M);break}}return v}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(y){if(!this._currentLink)return;const d=this._positionFromMouseEvent(y,this._element,this._mouseService);d&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,d)&&this._currentLink.link.activate(y,this._currentLink.link.text)}_clearCurrentLink(y,d){this._currentLink&&this._lastMouseEvent&&(!y||!d||this._currentLink.link.range.start.y>=y&&this._currentLink.link.range.end.y<=d)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,E.disposeArray)(this._linkCacheDisposables))}_handleNewLink(y){if(!this._lastMouseEvent)return;const d=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);d&&this._linkAtPosition(y.link,d)&&(this._currentLink=y,this._currentLink.state={decorations:{underline:y.link.decorations===void 0||y.link.decorations.underline,pointerCursor:y.link.decorations===void 0||y.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,y.link,this._lastMouseEvent),y.link.decorations={},Object.defineProperties(y.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:v=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==v&&(this._currentLink.state.decorations.pointerCursor=v,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",v))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:v=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==v&&(this._currentLink.state.decorations.underline=v,this._currentLink.state.isHovered&&this._fireUnderlineEvent(y.link,v))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((v=>{if(!this._currentLink)return;const T=v.start===0?0:v.start+1+this._bufferService.buffer.ydisp,R=this._bufferService.buffer.ydisp+1+v.end;if(this._currentLink.link.range.start.y>=T&&this._currentLink.link.range.end.y<=R&&(this._clearCurrentLink(T,R),this._lastMouseEvent)){const L=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);L&&this._askForLink(L,!1)}}))))}_linkHover(y,d,v){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(d,!0),this._currentLink.state.decorations.pointerCursor&&y.classList.add("xterm-cursor-pointer")),d.hover&&d.hover(v,d.text)}_fireUnderlineEvent(y,d){const v=y.range,T=this._bufferService.buffer.ydisp,R=this._createLinkUnderlineEvent(v.start.x-1,v.start.y-T-1,v.end.x,v.end.y-T-1,void 0);(d?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(R)}_linkLeave(y,d,v){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(d,!1),this._currentLink.state.decorations.pointerCursor&&y.classList.remove("xterm-cursor-pointer")),d.leave&&d.leave(v,d.text)}_linkAtPosition(y,d){const v=y.range.start.y*this._bufferService.cols+y.range.start.x,T=y.range.end.y*this._bufferService.cols+y.range.end.x,R=d.y*this._bufferService.cols+d.x;return v<=R&&R<=T}_positionFromMouseEvent(y,d,v){const T=v.getCoords(y,d,this._bufferService.cols,this._bufferService.rows);if(T)return{x:T[0],y:T[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(y,d,v,T,R){return{x1:y,y1:d,x2:v,y2:T,cols:this._bufferService.cols,fg:R}}};c.Linkifier=p=h([b(1,x.IMouseService),b(2,x.IRenderService),b(3,A.IBufferService),b(4,x.ILinkProviderService)],p)},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,p,y,d){var v,T=arguments.length,R=T<3?p:d===null?d=Object.getOwnPropertyDescriptor(p,y):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(x,p,y,d);else for(var L=x.length-1;L>=0;L--)(v=x[L])&&(R=(T<3?v(R):T>3?v(p,y,R):v(p,y))||R);return T>3&&R&&Object.defineProperty(p,y,R),R},b=this&&this.__param||function(x,p){return function(y,d){p(y,d,x)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OscLinkProvider=void 0;const f=u(511),C=u(2585);let E=c.OscLinkProvider=class{constructor(x,p,y){this._bufferService=x,this._optionsService=p,this._oscLinkService=y}provideLinks(x,p){const y=this._bufferService.buffer.lines.get(x-1);if(!y)return void p(void 0);const d=[],v=this._optionsService.rawOptions.linkHandler,T=new f.CellData,R=y.getTrimmedLength();let L=-1,M=-1,k=!1;for(let B=0;B<R;B++)if(M!==-1||y.hasContent(B)){if(y.loadCell(B,T),T.hasExtendedAttrs()&&T.extended.urlId){if(M===-1){M=B,L=T.extended.urlId;continue}k=T.extended.urlId!==L}else M!==-1&&(k=!0);if(k||M!==-1&&B===R-1){const W=this._oscLinkService.getLinkData(L)?.uri;if(W){const F={start:{x:M+1,y:x},end:{x:B+(k||B!==R-1?0:1),y:x}};let q=!1;if(!v?.allowNonHttpProtocols)try{const I=new URL(W);["http:","https:"].includes(I.protocol)||(q=!0)}catch{q=!0}q||d.push({text:W,range:F,activate:(I,G)=>v?v.activate(I,G,F):A(0,G),hover:(I,G)=>v?.hover?.(I,G,F),leave:(I,G)=>v?.leave?.(I,G,F)})}k=!1,T.hasExtendedAttrs()&&T.extended.urlId?(M=B,L=T.extended.urlId):(M=-1,L=-1)}}p(d)}};function A(x,p){if(confirm(`Do you want to navigate to ${p}?
|
|
78
|
+
|
|
79
|
+
WARNING: This link could potentially be dangerous`)){const y=window.open();if(y){try{y.opener=null}catch{}y.location.href=p}else console.warn("Opening link blocked as opener could not be cleared")}}c.OscLinkProvider=E=h([b(0,C.IBufferService),b(1,C.IOptionsService),b(2,C.IOscLinkService)],E)},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,b){this._rowCount=b,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),b=u(3656),f=u(3551),C=u(9042),E=u(3730),A=u(1680),x=u(3107),p=u(5744),y=u(2950),d=u(1296),v=u(428),T=u(4269),R=u(5114),L=u(8934),M=u(3230),k=u(9312),B=u(4725),W=u(6731),F=u(8055),q=u(8969),I=u(8460),G=u(844),te=u(6114),P=u(8437),V=u(2584),X=u(7399),N=u(5941),z=u(9074),O=u(2585),H=u(5435),Z=u(4567),ae=u(779);class ce extends q.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 G.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(z.DecorationService),this._instantiationService.setService(O.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ae.LinkProviderService),this._instantiationService.setService(B.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(E.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows((($,oe)=>this.refresh($,oe)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport(($=>this._reportWindowsOptions($)))),this.register(this._inputHandler.onColor(($=>this._handleColorEvent($)))),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(($=>this._afterResize($.cols,$.rows)))),this.register((0,G.toDisposable)((()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)})))}_handleColorEvent(Q){if(this._themeService)for(const $ of Q){let oe,ge="";switch($.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;"+$.index}switch($.type){case 0:const Se=F.color.toColorRGB(oe==="ansi"?this._themeService.colors.ansi[$.index]:this._themeService.colors[oe]);this.coreService.triggerDataEvent(`${V.C0.ESC}]${ge};${(0,N.toRgbString)(Se)}${V.C1_ESCAPED.ST}`);break;case 1:if(oe==="ansi")this._themeService.modifyColors((ye=>ye.ansi[$.index]=F.channels.toColor(...$.color)));else{const ye=oe;this._themeService.modifyColors(($e=>$e[ye]=F.channels.toColor(...$.color)))}break;case 2:this._themeService.restoreColor($.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(V.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(V.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,$=this.buffer.lines.get(Q);if(!$)return;const oe=Math.min(this.buffer.x,this.cols-1),ge=this._renderService.dimensions.css.cell.height,Se=$.getWidth(oe),ye=this._renderService.dimensions.css.cell.width*Se,$e=this.buffer.y*this._renderService.dimensions.css.cell.height,Fe=oe*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Fe+"px",this.textarea.style.top=$e+"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,b.addDisposableDomListener)(this.element,"copy",($=>{this.hasSelection()&&(0,h.copyHandler)($,this._selectionService)})));const Q=$=>(0,h.handlePasteEvent)($,this.textarea,this.coreService,this.optionsService);this.register((0,b.addDisposableDomListener)(this.textarea,"paste",Q)),this.register((0,b.addDisposableDomListener)(this.element,"paste",Q)),te.isFirefox?this.register((0,b.addDisposableDomListener)(this.element,"mousedown",($=>{$.button===2&&(0,h.rightClickHandler)($,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,b.addDisposableDomListener)(this.element,"contextmenu",($=>{(0,h.rightClickHandler)($,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),te.isLinux&&this.register((0,b.addDisposableDomListener)(this.element,"auxclick",($=>{$.button===1&&(0,h.moveTextAreaUnderMouseCursor)($,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,b.addDisposableDomListener)(this.textarea,"keyup",(Q=>this._keyUp(Q)),!0)),this.register((0,b.addDisposableDomListener)(this.textarea,"keydown",(Q=>this._keyDown(Q)),!0)),this.register((0,b.addDisposableDomListener)(this.textarea,"keypress",(Q=>this._keyPress(Q)),!0)),this.register((0,b.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,b.addDisposableDomListener)(this.textarea,"compositionupdate",(Q=>this._compositionHelper.compositionupdate(Q)))),this.register((0,b.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,b.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 $=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),$.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,b.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),$.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(R.CoreBrowserService,this.textarea,Q.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(B.ICoreBrowserService,this._coreBrowserService),this.register((0,b.addDisposableDomListener)(this.textarea,"focus",(oe=>this._handleTextAreaFocus(oe)))),this.register((0,b.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(v.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(B.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(W.ThemeService),this._instantiationService.setService(B.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(T.CharacterJoinerService),this._instantiationService.setService(B.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(M.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(B.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(y.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(L.MouseService),this._instantiationService.setService(B.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(f.Linkifier,this.screenElement)),this.element.appendChild($);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(B.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,b.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(x.BufferDecorationRenderer,this.screenElement)),this.register((0,b.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(p.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(oe=>{!this._overviewRulerRenderer&&oe&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(p.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(d.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const Q=this,$=this.element;function oe(ye){const $e=Q._mouseService.getMouseReportCoords(ye,Q.screenElement);if(!$e)return!1;let Fe,Ve;switch(ye.overrideType||ye.type){case"mousemove":Ve=32,ye.buttons===void 0?(Fe=3,ye.button!==void 0&&(Fe=ye.button<3?ye.button:3)):Fe=1&ye.buttons?0:4&ye.buttons?1:2&ye.buttons?2:3;break;case"mouseup":Ve=0,Fe=ye.button<3?ye.button:3;break;case"mousedown":Ve=1,Fe=ye.button<3?ye.button:3;break;case"wheel":if(Q._customWheelEventHandler&&Q._customWheelEventHandler(ye)===!1||Q.viewport.getLinesScrolled(ye)===0)return!1;Ve=ye.deltaY<0?0:1,Fe=4;break;default:return!1}return!(Ve===void 0||Fe===void 0||Fe>4)&&Q.coreMouseService.triggerMouseEvent({col:$e.col,row:$e.row,x:$e.x,y:$e.y,button:Fe,action:Ve,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||($.addEventListener("mousemove",Se.mousemove),ge.mousemove=Se.mousemove):($.removeEventListener("mousemove",ge.mousemove),ge.mousemove=null),16&ye?ge.wheel||($.addEventListener("wheel",Se.wheel,{passive:!1}),ge.wheel=Se.wheel):($.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,b.addDisposableDomListener)($,"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,b.addDisposableDomListener)($,"wheel",(ye=>{if(!ge.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(ye)===!1)return!1;if(!this.buffer.hasScrollback){const $e=this.viewport.getLinesScrolled(ye);if($e===0)return;const Fe=V.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(ye.deltaY<0?"A":"B");let Ve="";for(let Ct=0;Ct<Math.abs($e);Ct++)Ve+=Fe;return this.coreService.triggerDataEvent(Ve,!0),this.cancel(ye,!0)}return this.viewport.handleWheel(ye)?this.cancel(ye):void 0}}),{passive:!1})),this.register((0,b.addDisposableDomListener)($,"touchstart",(ye=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(ye),this.cancel(ye)}),{passive:!0})),this.register((0,b.addDisposableDomListener)($,"touchmove",(ye=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(ye)?void 0:this.cancel(ye)}),{passive:!1}))}refresh(Q,$){this._renderService?.refreshRows(Q,$)}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,$,oe=0){oe===1?(super.scrollLines(Q,$,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 $=this._characterJoinerService.register(Q);return this.refresh(0,this.rows-1),$}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,$,oe){this._selectionService.setSelection(Q,$,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,$){this._selectionService?.selectLines(Q,$)}_keyDown(Q){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(Q)===!1)return!1;const $=this.browser.isMac&&this.options.macOptionIsMeta&&Q.altKey;if(!$&&!this._compositionHelper.keydown(Q))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;$||Q.key!=="Dead"&&Q.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const oe=(0,X.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!==V.C0.ETX&&oe.key!==V.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,$){const oe=Q.isMac&&!this.options.macOptionIsMeta&&$.altKey&&!$.ctrlKey&&!$.metaKey||Q.isWindows&&$.altKey&&$.ctrlKey&&!$.metaKey||Q.isWindows&&$.getModifierState("AltGraph");return $.type==="keypress"?oe:oe&&(!$.keyCode||$.keyCode>47)}_keyUp(Q){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(Q)===!1||((function($){return $.keyCode===16||$.keyCode===17||$.keyCode===18})(Q)||this.focus(),this.updateCursorStyle(Q),this._keyPressHandled=!1)}_keyPress(Q){let $;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(Q)===!1)return!1;if(this.cancel(Q),Q.charCode)$=Q.charCode;else if(Q.which===null||Q.which===void 0)$=Q.keyCode;else{if(Q.which===0||Q.charCode===0)return!1;$=Q.which}return!(!$||(Q.altKey||Q.ctrlKey||Q.metaKey)&&!this._isThirdLevelShift(this.browser,Q)||($=String.fromCharCode($),this._onKey.fire({key:$,domEvent:Q}),this._showCursor(),this.coreService.triggerDataEvent($,!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 $=Q.data;return this.coreService.triggerDataEvent($,!0),this.cancel(Q),!0}return!1}resize(Q,$){Q!==this.cols||$!==this.rows?super.resize(Q,$):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(Q,$){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(P.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(V.C0.ESC+"[I"):this.coreService.triggerDataEvent(V.C0.ESC+"[O")}_reportWindowsOptions(Q){if(this._renderService)switch(Q){case H.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const $=this._renderService.dimensions.css.canvas.width.toFixed(0),oe=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${V.C0.ESC}[4;${oe};${$}t`);break;case H.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(`${V.C0.ESC}[6;${Se};${ge}t`)}}cancel(Q,$){if(this.options.cancelEvents||$)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,b){this._rowCount=b,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 f=Date.now();if(f-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=f,this._innerRefresh();else if(!this._additionalRefreshRequested){const C=f-this._lastRefreshMs,E=this._debounceThresholdMS-C;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),E)}}_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(y,d,v,T){var R,L=arguments.length,M=L<3?d:T===null?T=Object.getOwnPropertyDescriptor(d,v):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,d,v,T);else for(var k=y.length-1;k>=0;k--)(R=y[k])&&(M=(L<3?R(M):L>3?R(d,v,M):R(d,v))||M);return L>3&&M&&Object.defineProperty(d,v,M),M},b=this&&this.__param||function(y,d){return function(v,T){d(v,T,y)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Viewport=void 0;const f=u(3656),C=u(4725),E=u(8460),A=u(844),x=u(2585);let p=c.Viewport=class extends A.Disposable{constructor(y,d,v,T,R,L,M,k){super(),this._viewportElement=y,this._scrollArea=d,this._bufferService=v,this._optionsService=T,this._charSizeService=R,this._renderService=L,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 E.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,f.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((B=>this._activeBuffer=B.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((B=>this._renderDimensions=B))),this._handleThemeChange(k.colors),this.register(k.onChangeColors((B=>this._handleThemeChange(B)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(y){this._viewportElement.style.backgroundColor=y.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(y){if(y)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 d=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==d&&(this._lastRecordedBufferHeight=d,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const y=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==y&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=y),this._refreshAnimationFrame=null}syncScrollArea(y=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(y);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(y)}_handleScroll(y){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 d=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:d,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const y=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(y*(this._smoothScrollState.target-this._smoothScrollState.origin)),y<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(y,d){const v=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(d<0&&this._viewportElement.scrollTop!==0||d>0&&v<this._lastRecordedBufferHeight)||(y.cancelable&&y.preventDefault(),!1)}handleWheel(y){const d=this._getPixelsScrolled(y);return d!==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+d:this._smoothScrollState.target+=d,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=d,this._bubbleScroll(y,d))}scrollLines(y){if(y!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const d=y*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+d,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:y,suppressScrollEvent:!1})}_getPixelsScrolled(y){if(y.deltaY===0||y.shiftKey)return 0;let d=this._applyScrollModifier(y.deltaY,y);return y.deltaMode===WheelEvent.DOM_DELTA_LINE?d*=this._currentRowHeight:y.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(d*=this._currentRowHeight*this._bufferService.rows),d}getBufferElements(y,d){let v,T="";const R=[],L=d??this._bufferService.buffer.lines.length,M=this._bufferService.buffer.lines;for(let k=y;k<L;k++){const B=M.get(k);if(!B)continue;const W=M.get(k+1)?.isWrapped;if(T+=B.translateToString(!W),!W||k===M.length-1){const F=document.createElement("div");F.textContent=T,R.push(F),T.length>0&&(v=F),T=""}}return{bufferElements:R,cursorElement:v}}getLinesScrolled(y){if(y.deltaY===0||y.shiftKey)return 0;let d=this._applyScrollModifier(y.deltaY,y);return y.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(d/=this._currentRowHeight+0,this._wheelPartialScroll+=d,d=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):y.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(d*=this._bufferService.rows),d}_applyScrollModifier(y,d){const v=this._optionsService.rawOptions.fastScrollModifier;return v==="alt"&&d.altKey||v==="ctrl"&&d.ctrlKey||v==="shift"&&d.shiftKey?y*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:y*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(y){this._lastTouchY=y.touches[0].pageY}handleTouchMove(y){const d=this._lastTouchY-y.touches[0].pageY;return this._lastTouchY=y.touches[0].pageY,d!==0&&(this._viewportElement.scrollTop+=d,this._bubbleScroll(y,d))}};c.Viewport=p=h([b(2,x.IBufferService),b(3,x.IOptionsService),b(4,C.ICharSizeService),b(5,C.IRenderService),b(6,C.ICoreBrowserService),b(7,C.IThemeService)],p)},3107:function(m,c,u){var h=this&&this.__decorate||function(x,p,y,d){var v,T=arguments.length,R=T<3?p:d===null?d=Object.getOwnPropertyDescriptor(p,y):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(x,p,y,d);else for(var L=x.length-1;L>=0;L--)(v=x[L])&&(R=(T<3?v(R):T>3?v(p,y,R):v(p,y))||R);return T>3&&R&&Object.defineProperty(p,y,R),R},b=this&&this.__param||function(x,p){return function(y,d){p(y,d,x)}};Object.defineProperty(c,"__esModule",{value:!0}),c.BufferDecorationRenderer=void 0;const f=u(4725),C=u(844),E=u(2585);let A=c.BufferDecorationRenderer=class extends C.Disposable{constructor(x,p,y,d,v){super(),this._screenElement=x,this._bufferService=p,this._coreBrowserService=y,this._decorationService=d,this._renderService=v,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((T=>this._removeDecoration(T)))),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 p=this._coreBrowserService.mainDocument.createElement("div");p.classList.add("xterm-decoration"),p.classList.toggle("xterm-decoration-top-layer",x?.options?.layer==="top"),p.style.width=`${Math.round((x.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,p.style.height=(x.options.height||1)*this._renderService.dimensions.css.cell.height+"px",p.style.top=(x.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",p.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const y=x.options.x??0;return y&&y>this._bufferService.cols&&(p.style.display="none"),this._refreshXPosition(x,p),p}_refreshStyle(x){const p=x.marker.line-this._bufferService.buffers.active.ydisp;if(p<0||p>=this._bufferService.rows)x.element&&(x.element.style.display="none",x.onRenderEmitter.fire(x.element));else{let y=this._decorationElements.get(x);y||(y=this._createElement(x),x.element=y,this._decorationElements.set(x,y),this._container.appendChild(y),x.onDispose((()=>{this._decorationElements.delete(x),y.remove()}))),y.style.top=p*this._renderService.dimensions.css.cell.height+"px",y.style.display=this._altBufferIsActive?"none":"block",x.onRenderEmitter.fire(y)}}_refreshXPosition(x,p=x.element){if(!p)return;const y=x.options.x??0;(x.options.anchor||"left")==="right"?p.style.right=y?y*this._renderService.dimensions.css.cell.width+"px":"":p.style.left=y?y*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(x){this._decorationElements.get(x)?.remove(),this._decorationElements.delete(x),x.dispose()}};c.BufferDecorationRenderer=A=h([b(1,E.IBufferService),b(2,f.ICoreBrowserService),b(3,E.IDecorationService),b(4,f.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,b){return h>=u.startBufferLine-this._linePadding[b||"full"]&&h<=u.endBufferLine+this._linePadding[b||"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(v,T,R,L){var M,k=arguments.length,B=k<3?T:L===null?L=Object.getOwnPropertyDescriptor(T,R):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(v,T,R,L);else for(var W=v.length-1;W>=0;W--)(M=v[W])&&(B=(k<3?M(B):k>3?M(T,R,B):M(T,R))||B);return k>3&&B&&Object.defineProperty(T,R,B),B},b=this&&this.__param||function(v,T){return function(R,L){T(R,L,v)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OverviewRulerRenderer=void 0;const f=u(5871),C=u(4725),E=u(844),A=u(2585),x={full:0,left:0,center:0,right:0},p={full:0,left:0,center:0,right:0},y={full:0,left:0,center:0,right:0};let d=c.OverviewRulerRenderer=class extends E.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(v,T,R,L,M,k,B){super(),this._viewportElement=v,this._screenElement=T,this._bufferService=R,this._decorationService=L,this._renderService=M,this._optionsService=k,this._coreBrowserService=B,this._colorZoneStore=new f.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 W=this._canvas.getContext("2d");if(!W)throw new Error("Ctx cannot be null");this._ctx=W,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,E.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 v=Math.floor(this._canvas.width/3),T=Math.ceil(this._canvas.width/3);p.full=this._canvas.width,p.left=v,p.center=T,p.right=v,this._refreshDrawHeightConstants(),y.full=0,y.left=0,y.center=p.left,y.right=p.left+p.center}_refreshDrawHeightConstants(){x.full=Math.round(2*this._coreBrowserService.dpr);const v=this._canvas.height/this._bufferService.buffer.lines.length,T=Math.round(Math.max(Math.min(v,12),6)*this._coreBrowserService.dpr);x.left=T,x.center=T,x.right=T}_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 T of this._decorationService.decorations)this._colorZoneStore.addDecoration(T);this._ctx.lineWidth=1;const v=this._colorZoneStore.zones;for(const T of v)T.position!=="full"&&this._renderColorZone(T);for(const T of v)T.position==="full"&&this._renderColorZone(T);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(v){this._ctx.fillStyle=v.color,this._ctx.fillRect(y[v.position||"full"],Math.round((this._canvas.height-1)*(v.startBufferLine/this._bufferService.buffers.active.lines.length)-x[v.position||"full"]/2),p[v.position||"full"],Math.round((this._canvas.height-1)*((v.endBufferLine-v.startBufferLine)/this._bufferService.buffers.active.lines.length)+x[v.position||"full"]))}_queueRefresh(v,T){this._shouldUpdateDimensions=v||this._shouldUpdateDimensions,this._shouldUpdateAnchor=T||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};c.OverviewRulerRenderer=d=h([b(2,A.IBufferService),b(3,A.IDecorationService),b(4,C.IRenderService),b(5,A.IOptionsService),b(6,C.ICoreBrowserService)],d)},2950:function(m,c,u){var h=this&&this.__decorate||function(x,p,y,d){var v,T=arguments.length,R=T<3?p:d===null?d=Object.getOwnPropertyDescriptor(p,y):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(x,p,y,d);else for(var L=x.length-1;L>=0;L--)(v=x[L])&&(R=(T<3?v(R):T>3?v(p,y,R):v(p,y))||R);return T>3&&R&&Object.defineProperty(p,y,R),R},b=this&&this.__param||function(x,p){return function(y,d){p(y,d,x)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CompositionHelper=void 0;const f=u(4725),C=u(2585),E=u(2584);let A=c.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(x,p,y,d,v,T){this._textarea=x,this._compositionView=p,this._bufferService=y,this._optionsService=d,this._coreService=v,this._renderService=T,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 p={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let y;this._isSendingComposition=!1,p.start+=this._dataAlreadySent.length,y=this._isComposing?this._textarea.value.substring(p.start,p.end):this._textarea.value.substring(p.start),y.length>0&&this._coreService.triggerDataEvent(y,!0)}}),0)}else{this._isSendingComposition=!1;const p=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(p,!0)}}_handleAnyTextareaChanges(){const x=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const p=this._textarea.value,y=p.replace(x,"");this._dataAlreadySent=y,p.length>x.length?this._coreService.triggerDataEvent(y,!0):p.length<x.length?this._coreService.triggerDataEvent(`${E.C0.DEL}`,!0):p.length===x.length&&p!==x&&this._coreService.triggerDataEvent(p,!0)}}),0)}updateCompositionElements(x){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const p=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),y=this._renderService.dimensions.css.cell.height,d=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,v=p*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=v+"px",this._compositionView.style.top=d+"px",this._compositionView.style.height=y+"px",this._compositionView.style.lineHeight=y+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const T=this._compositionView.getBoundingClientRect();this._textarea.style.left=v+"px",this._textarea.style.top=d+"px",this._textarea.style.width=Math.max(T.width,1)+"px",this._textarea.style.height=Math.max(T.height,1)+"px",this._textarea.style.lineHeight=T.height+"px"}x||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};c.CompositionHelper=A=h([b(2,C.IBufferService),b(3,C.IOptionsService),b(4,C.ICoreService),b(5,f.IRenderService)],A)},9806:(m,c)=>{function u(h,b,f){const C=f.getBoundingClientRect(),E=h.getComputedStyle(f),A=parseInt(E.getPropertyValue("padding-left")),x=parseInt(E.getPropertyValue("padding-top"));return[b.clientX-C.left-A,b.clientY-C.top-x]}Object.defineProperty(c,"__esModule",{value:!0}),c.getCoords=c.getCoordsRelativeToElement=void 0,c.getCoordsRelativeToElement=u,c.getCoords=function(h,b,f,C,E,A,x,p,y){if(!A)return;const d=u(h,b,f);return d?(d[0]=Math.ceil((d[0]+(y?x/2:0))/x),d[1]=Math.ceil(d[1]/p),d[0]=Math.min(Math.max(d[0],1),C+(y?1:0)),d[1]=Math.min(Math.max(d[1],1),E),d):void 0}},9504:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.moveToCellSequence=void 0;const h=u(2584);function b(p,y,d,v){const T=p-f(p,d),R=y-f(y,d),L=Math.abs(T-R)-(function(M,k,B){let W=0;const F=M-f(M,B),q=k-f(k,B);for(let I=0;I<Math.abs(F-q);I++){const G=C(M,k)==="A"?-1:1;B.buffer.lines.get(F+G*I)?.isWrapped&&W++}return W})(p,y,d);return x(L,A(C(p,y),v))}function f(p,y){let d=0,v=y.buffer.lines.get(p),T=v?.isWrapped;for(;T&&p>=0&&p<y.rows;)d++,v=y.buffer.lines.get(--p),T=v?.isWrapped;return d}function C(p,y){return p>y?"A":"B"}function E(p,y,d,v,T,R){let L=p,M=y,k="";for(;L!==d||M!==v;)L+=T?1:-1,T&&L>R.cols-1?(k+=R.buffer.translateBufferLineToString(M,!1,p,L),L=0,p=0,M++):!T&&L<0&&(k+=R.buffer.translateBufferLineToString(M,!1,0,p+1),L=R.cols-1,p=L,M--);return k+R.buffer.translateBufferLineToString(M,!1,p,L)}function A(p,y){const d=y?"O":"[";return h.C0.ESC+d+p}function x(p,y){p=Math.floor(p);let d="";for(let v=0;v<p;v++)d+=y;return d}c.moveToCellSequence=function(p,y,d,v){const T=d.buffer.x,R=d.buffer.y;if(!d.buffer.hasScrollback)return(function(k,B,W,F,q,I){return b(B,F,q,I).length===0?"":x(E(k,B,k,B-f(B,q),!1,q).length,A("D",I))})(T,R,0,y,d,v)+b(R,y,d,v)+(function(k,B,W,F,q,I){let G;G=b(B,F,q,I).length>0?F-f(F,q):B;const te=F,P=(function(V,X,N,z,O,H){let Z;return Z=b(N,z,O,H).length>0?z-f(z,O):X,V<N&&Z<=z||V>=N&&Z<z?"C":"D"})(k,B,W,F,q,I);return x(E(k,G,W,te,P==="C",q).length,A(P,I))})(T,R,p,y,d,v);let L;if(R===y)return L=T>p?"D":"C",x(Math.abs(T-p),A(L,v));L=R>y?"D":"C";const M=Math.abs(R-y);return x((function(k,B){return B.cols-k})(R>y?p:T,d)+(M-1)*d.cols+1+((R>y?T:p)-1),A(L,v))}},1296:function(m,c,u){var h=this&&this.__decorate||function(I,G,te,P){var V,X=arguments.length,N=X<3?G:P===null?P=Object.getOwnPropertyDescriptor(G,te):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(I,G,te,P);else for(var z=I.length-1;z>=0;z--)(V=I[z])&&(N=(X<3?V(N):X>3?V(G,te,N):V(G,te))||N);return X>3&&N&&Object.defineProperty(G,te,N),N},b=this&&this.__param||function(I,G){return function(te,P){G(te,P,I)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRenderer=void 0;const f=u(3787),C=u(2550),E=u(2223),A=u(6171),x=u(6052),p=u(4725),y=u(8055),d=u(8460),v=u(844),T=u(2585),R="xterm-dom-renderer-owner-",L="xterm-rows",M="xterm-fg-",k="xterm-bg-",B="xterm-focus",W="xterm-selection";let F=1,q=c.DomRenderer=class extends v.Disposable{constructor(I,G,te,P,V,X,N,z,O,H,Z,ae,ce){super(),this._terminal=I,this._document=G,this._element=te,this._screenElement=P,this._viewportElement=V,this._helperContainer=X,this._linkifier2=N,this._charSizeService=O,this._optionsService=H,this._bufferService=Z,this._coreBrowserService=ae,this._themeService=ce,this._terminalClass=F++,this._rowElements=[],this._selectionRenderModel=(0,x.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new d.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(L),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(W),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=z.createInstance(f.DomRendererRowFactory,document),this._element.classList.add(R+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,v.toDisposable)((()=>{this._element.classList.remove(R+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 G=`${this._terminalSelector} .${L} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=G,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 G=`${this._terminalSelector} .${L} { color: ${I.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;G+=`${this._terminalSelector} .${L} .xterm-dim { color: ${y.color.multiplyOpacity(I.foreground,.5).css};}`,G+=`${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}`,P=`blink_bar_${this._terminalClass}`,V=`blink_block_${this._terminalClass}`;G+=`@keyframes ${te} { 50% { border-bottom-style: hidden; }}`,G+=`@keyframes ${P} { 50% { box-shadow: none; }}`,G+=`@keyframes ${V} { 0% { background-color: ${I.cursor.css}; color: ${I.cursorAccent.css}; } 50% { background-color: inherit; color: ${I.cursor.css}; }}`,G+=`${this._terminalSelector} .${L}.${B} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${te} 1s step-end infinite;}${this._terminalSelector} .${L}.${B} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${P} 1s step-end infinite;}${this._terminalSelector} .${L}.${B} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${V} 1s step-end infinite;}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-block { background-color: ${I.cursor.css}; color: ${I.cursorAccent.css};}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${I.cursor.css} !important; color: ${I.cursorAccent.css} !important;}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${I.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${I.cursor.css} inset;}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${I.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,G+=`${this._terminalSelector} .${W} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${W} div { position: absolute; background-color: ${I.selectionBackgroundOpaque.css};}${this._terminalSelector} .${W} div { position: absolute; background-color: ${I.selectionInactiveBackgroundOpaque.css};}`;for(const[X,N]of I.ansi.entries())G+=`${this._terminalSelector} .${M}${X} { color: ${N.css}; }${this._terminalSelector} .${M}${X}.xterm-dim { color: ${y.color.multiplyOpacity(N,.5).css}; }${this._terminalSelector} .${k}${X} { background-color: ${N.css}; }`;G+=`${this._terminalSelector} .${M}${E.INVERTED_DEFAULT_COLOR} { color: ${y.color.opaque(I.background).css}; }${this._terminalSelector} .${M}${E.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${y.color.multiplyOpacity(y.color.opaque(I.background),.5).css}; }${this._terminalSelector} .${k}${E.INVERTED_DEFAULT_COLOR} { background-color: ${I.foreground.css}; }`,this._themeStyleElement.textContent=G}_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,G){for(let te=this._rowElements.length;te<=G;te++){const P=this._document.createElement("div");this._rowContainer.appendChild(P),this._rowElements.push(P)}for(;this._rowElements.length>G;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(I,G){this._refreshRowElements(I,G),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(B),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(B),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(I,G,te){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(I,G,te),this.renderRows(0,this._bufferService.rows-1),!I||!G)return;this._selectionRenderModel.update(this._terminal,I,G,te);const P=this._selectionRenderModel.viewportStartRow,V=this._selectionRenderModel.viewportEndRow,X=this._selectionRenderModel.viewportCappedStartRow,N=this._selectionRenderModel.viewportCappedEndRow;if(X>=this._bufferService.rows||N<0)return;const z=this._document.createDocumentFragment();if(te){const O=I[0]>G[0];z.appendChild(this._createSelectionElement(X,O?G[0]:I[0],O?I[0]:G[0],N-X+1))}else{const O=P===X?I[0]:0,H=X===V?G[0]:this._bufferService.cols;z.appendChild(this._createSelectionElement(X,O,H));const Z=N-X-1;if(z.appendChild(this._createSelectionElement(X+1,0,this._bufferService.cols,Z)),X!==N){const ae=V===N?G[0]:this._bufferService.cols;z.appendChild(this._createSelectionElement(N,0,ae))}}this._selectionContainer.appendChild(z)}_createSelectionElement(I,G,te,P=1){const V=this._document.createElement("div"),X=G*this.dimensions.css.cell.width;let N=this.dimensions.css.cell.width*(te-G);return X+N>this.dimensions.css.canvas.width&&(N=this.dimensions.css.canvas.width-X),V.style.height=P*this.dimensions.css.cell.height+"px",V.style.top=I*this.dimensions.css.cell.height+"px",V.style.left=`${X}px`,V.style.width=`${N}px`,V}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,G){const te=this._bufferService.buffer,P=te.ybase+te.y,V=Math.min(te.x,this._bufferService.cols-1),X=this._optionsService.rawOptions.cursorBlink,N=this._optionsService.rawOptions.cursorStyle,z=this._optionsService.rawOptions.cursorInactiveStyle;for(let O=I;O<=G;O++){const H=O+te.ydisp,Z=this._rowElements[O],ae=te.lines.get(H);if(!Z||!ae)break;Z.replaceChildren(...this._rowFactory.createRow(ae,H,H===P,N,z,V,X,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${R}${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,G,te,P,V,X){te<0&&(I=0),P<0&&(G=0);const N=this._bufferService.rows-1;te=Math.max(Math.min(te,N),0),P=Math.max(Math.min(P,N),0),V=Math.min(V,this._bufferService.cols);const z=this._bufferService.buffer,O=z.ybase+z.y,H=Math.min(z.x,V-1),Z=this._optionsService.rawOptions.cursorBlink,ae=this._optionsService.rawOptions.cursorStyle,ce=this._optionsService.rawOptions.cursorInactiveStyle;for(let _e=te;_e<=P;++_e){const Q=_e+z.ydisp,$=this._rowElements[_e],oe=z.lines.get(Q);if(!$||!oe)break;$.replaceChildren(...this._rowFactory.createRow(oe,Q,Q===O,ae,ce,H,Z,this.dimensions.css.cell.width,this._widthCache,X?_e===te?I:0:-1,X?(_e===P?G:V)-1:-1))}}};c.DomRenderer=q=h([b(7,T.IInstantiationService),b(8,p.ICharSizeService),b(9,T.IOptionsService),b(10,T.IBufferService),b(11,p.ICoreBrowserService),b(12,p.IThemeService)],q)},3787:function(m,c,u){var h=this&&this.__decorate||function(L,M,k,B){var W,F=arguments.length,q=F<3?M:B===null?B=Object.getOwnPropertyDescriptor(M,k):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")q=Reflect.decorate(L,M,k,B);else for(var I=L.length-1;I>=0;I--)(W=L[I])&&(q=(F<3?W(q):F>3?W(M,k,q):W(M,k))||q);return F>3&&q&&Object.defineProperty(M,k,q),q},b=this&&this.__param||function(L,M){return function(k,B){M(k,B,L)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRendererRowFactory=void 0;const f=u(2223),C=u(643),E=u(511),A=u(2585),x=u(8055),p=u(4725),y=u(4269),d=u(6171),v=u(3734);let T=c.DomRendererRowFactory=class{constructor(L,M,k,B,W,F,q){this._document=L,this._characterJoinerService=M,this._optionsService=k,this._coreBrowserService=B,this._coreService=W,this._decorationService=F,this._themeService=q,this._workCell=new E.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(L,M,k){this._selectionStart=L,this._selectionEnd=M,this._columnSelectMode=k}createRow(L,M,k,B,W,F,q,I,G,te,P){const V=[],X=this._characterJoinerService.getJoinedCharacters(M),N=this._themeService.colors;let z,O=L.getNoBgTrimmedLength();k&&O<F+1&&(O=F+1);let H=0,Z="",ae=0,ce=0,_e=0,Q=!1,$=0,oe=!1,ge=0;const Se=[],ye=te!==-1&&P!==-1;for(let $e=0;$e<O;$e++){L.loadCell($e,this._workCell);let Fe=this._workCell.getWidth();if(Fe===0)continue;let Ve=!1,Ct=$e,Ne=this._workCell;if(X.length>0&&$e===X[0][0]){Ve=!0;const dt=X.shift();Ne=new y.JoinedCellData(this._workCell,L.translateToString(!0,dt[0],dt[1]),dt[1]-dt[0]),Ct=dt[1]-1,Fe=Ne.getWidth()}const Qt=this._isCellInSelection($e,M),_i=k&&$e===F,vi=ye&&$e>=te&&$e<=P;let fn=!1;this._decorationService.forEachDecorationAtCell($e,M,void 0,(dt=>{fn=!0}));let Mn=Ne.getChars()||C.WHITESPACE_CELL_CHAR;if(Mn===" "&&(Ne.isUnderline()||Ne.isOverline())&&(Mn=" "),ge=Fe*I-G.get(Mn,Ne.isBold(),Ne.isItalic()),z){if(H&&(Qt&&oe||!Qt&&!oe&&Ne.bg===ae)&&(Qt&&oe&&N.selectionForeground||Ne.fg===ce)&&Ne.extended.ext===_e&&vi===Q&&ge===$&&!_i&&!Ve&&!fn){Ne.isInvisible()?Z+=C.WHITESPACE_CELL_CHAR:Z+=Mn,H++;continue}H&&(z.textContent=Z),z=this._document.createElement("span"),H=0,Z=""}else z=this._document.createElement("span");if(ae=Ne.bg,ce=Ne.fg,_e=Ne.extended.ext,Q=vi,$=ge,oe=Qt,Ve&&F>=$e&&F<=Ct&&(F=$e),!this._coreService.isCursorHidden&&_i&&this._coreService.isCursorInitialized){if(Se.push("xterm-cursor"),this._coreBrowserService.isFocused)q&&Se.push("xterm-cursor-blink"),Se.push(B==="bar"?"xterm-cursor-bar":B==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(W)switch(W){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())z.style.textDecorationColor=`rgb(${v.AttributeData.toColorRGB(Ne.getUnderlineColor()).join(",")})`;else{let dt=Ne.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Ne.isBold()&&dt<8&&(dt+=8),z.style.textDecorationColor=N.ansi[dt].css}Ne.isOverline()&&(Se.push("xterm-overline"),Z===" "&&(Z=" ")),Ne.isStrikethrough()&&Se.push("xterm-strikethrough"),vi&&(z.style.textDecoration="underline");let ei=Ne.getFgColor(),ut=Ne.getFgColorMode(),Kt=Ne.getBgColor(),jt=Ne.getBgColorMode();const zt=!!Ne.isInverse();if(zt){const dt=ei;ei=Kt,Kt=dt;const Hi=ut;ut=jt,jt=Hi}let ti,Dn,Ri,en=!1;switch(this._decorationService.forEachDecorationAtCell($e,M,void 0,(dt=>{dt.options.layer!=="top"&&en||(dt.backgroundColorRGB&&(jt=50331648,Kt=dt.backgroundColorRGB.rgba>>8&16777215,ti=dt.backgroundColorRGB),dt.foregroundColorRGB&&(ut=50331648,ei=dt.foregroundColorRGB.rgba>>8&16777215,Dn=dt.foregroundColorRGB),en=dt.options.layer==="top")})),!en&&Qt&&(ti=this._coreBrowserService.isFocused?N.selectionBackgroundOpaque:N.selectionInactiveBackgroundOpaque,Kt=ti.rgba>>8&16777215,jt=50331648,en=!0,N.selectionForeground&&(ut=50331648,ei=N.selectionForeground.rgba>>8&16777215,Dn=N.selectionForeground)),en&&Se.push("xterm-decoration-top"),jt){case 16777216:case 33554432:Ri=N.ansi[Kt],Se.push(`xterm-bg-${Kt}`);break;case 50331648:Ri=x.channels.toColor(Kt>>16,Kt>>8&255,255&Kt),this._addStyle(z,`background-color:#${R((Kt>>>0).toString(16),"0",6)}`);break;default:zt?(Ri=N.foreground,Se.push(`xterm-bg-${f.INVERTED_DEFAULT_COLOR}`)):Ri=N.background}switch(ti||Ne.isDim()&&(ti=x.color.multiplyOpacity(Ri,.5)),ut){case 16777216:case 33554432:Ne.isBold()&&ei<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ei+=8),this._applyMinimumContrast(z,Ri,N.ansi[ei],Ne,ti,void 0)||Se.push(`xterm-fg-${ei}`);break;case 50331648:const dt=x.channels.toColor(ei>>16&255,ei>>8&255,255&ei);this._applyMinimumContrast(z,Ri,dt,Ne,ti,Dn)||this._addStyle(z,`color:#${R(ei.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(z,Ri,N.foreground,Ne,ti,Dn)||zt&&Se.push(`xterm-fg-${f.INVERTED_DEFAULT_COLOR}`)}Se.length&&(z.className=Se.join(" "),Se.length=0),_i||Ve||fn?z.textContent=Z:H++,ge!==this.defaultSpacing&&(z.style.letterSpacing=`${ge}px`),V.push(z),$e=Ct}return z&&H&&(z.textContent=Z),V}_applyMinimumContrast(L,M,k,B,W,F){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,d.treatGlyphAsBackgroundColor)(B.getCode()))return!1;const q=this._getContrastCache(B);let I;if(W||F||(I=q.getColor(M.rgba,k.rgba)),I===void 0){const G=this._optionsService.rawOptions.minimumContrastRatio/(B.isDim()?2:1);I=x.color.ensureContrastRatio(W||M,F||k,G),q.setColor((W||M).rgba,(F||k).rgba,I??null)}return!!I&&(this._addStyle(L,`color:${I.css}`),!0)}_getContrastCache(L){return L.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(L,M){L.setAttribute("style",`${L.getAttribute("style")||""}${M};`)}_isCellInSelection(L,M){const k=this._selectionStart,B=this._selectionEnd;return!(!k||!B)&&(this._columnSelectMode?k[0]<=B[0]?L>=k[0]&&M>=k[1]&&L<B[0]&&M<=B[1]:L<k[0]&&M>=k[1]&&L>=B[0]&&M<=B[1]:M>k[1]&&M<B[1]||k[1]===B[1]&&M===k[1]&&L>=k[0]&&L<B[0]||k[1]<B[1]&&M===B[1]&&L<B[0]||k[1]<B[1]&&M===k[1]&&L>=k[0])}};function R(L,M,k){for(;L.length<k;)L=M+L;return L}c.DomRendererRowFactory=T=h([b(1,p.ICharacterJoinerService),b(2,A.IOptionsService),b(3,p.ICoreBrowserService),b(4,A.ICoreService),b(5,A.IDecorationService),b(6,p.IThemeService)],T)},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 b=u.createElement("span");b.classList.add("xterm-char-measure-element");const f=u.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontWeight="bold";const C=u.createElement("span");C.classList.add("xterm-char-measure-element"),C.style.fontStyle="italic";const E=u.createElement("span");E.classList.add("xterm-char-measure-element"),E.style.fontWeight="bold",E.style.fontStyle="italic",this._measureElements=[b,f,C,E],this._container.appendChild(b),this._container.appendChild(f),this._container.appendChild(C),this._container.appendChild(E),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,b,f){u===this._font&&h===this._fontSize&&b===this._weight&&f===this._weightBold||(this._font=u,this._fontSize=h,this._weight=b,this._weightBold=f,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${b}`,this._measureElements[1].style.fontWeight=`${f}`,this._measureElements[2].style.fontWeight=`${b}`,this._measureElements[3].style.fontWeight=`${f}`,this.clear())}get(u,h,b){let f=0;if(!h&&!b&&u.length===1&&(f=u.charCodeAt(0))<256){if(this._flat[f]!==-9999)return this._flat[f];const A=this._measure(u,0);return A>0&&(this._flat[f]=A),A}let C=u;h&&(C+="B"),b&&(C+="I");let E=this._holey.get(C);if(E===void 0){let A=0;h&&(A|=1),b&&(A|=2),E=this._measure(u,A),E>0&&this._holey.set(C,E)}return E}_measure(u,h){const b=this._measureElements[h];return b.textContent=u.repeat(32),b.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(b){return 57508<=b&&b<=57558}function h(b){return b>=128512&&b<=128591||b>=127744&&b<=128511||b>=128640&&b<=128767||b>=9728&&b<=9983||b>=9984&&b<=10175||b>=65024&&b<=65039||b>=129280&&b<=129535||b>=127462&&b<=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(b){if(!b)throw new Error("value must not be falsy");return b},c.isPowerlineGlyph=u,c.isRestrictedPowerlineGlyph=function(b){return 57520<=b&&b<=57527},c.isEmoji=h,c.allowRescaling=function(b,f,C,E){return f===1&&C>Math.ceil(1.5*E)&&b!==void 0&&b>255&&!h(b)&&!u(b)&&!(function(A){return 57344<=A&&A<=63743})(b)},c.treatGlyphAsBackgroundColor=function(b){return u(b)||(function(f){return 9472<=f&&f<=9631})(b)},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(b,f,C=0){return(b-(2*Math.round(f)-C))%(2*Math.round(f))}},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(b,f,C,E=!1){if(this.selectionStart=f,this.selectionEnd=C,!f||!C||f[0]===C[0]&&f[1]===C[1])return void this.clear();const A=b.buffers.active.ydisp,x=f[1]-A,p=C[1]-A,y=Math.max(x,0),d=Math.min(p,b.rows-1);y>=b.rows||d<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=E,this.viewportStartRow=x,this.viewportEndRow=p,this.viewportCappedStartRow=y,this.viewportCappedEndRow=d,this.startCol=f[0],this.endCol=C[0])}isCellSelected(b,f,C){return!!this.hasSelection&&(C-=b.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?f>=this.startCol&&C>=this.viewportCappedStartRow&&f<this.endCol&&C<=this.viewportCappedEndRow:f<this.startCol&&C>=this.viewportCappedStartRow&&f>=this.endCol&&C<=this.viewportCappedEndRow:C>this.viewportStartRow&&C<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&C===this.viewportStartRow&&f>=this.startCol&&f<this.endCol||this.viewportStartRow<this.viewportEndRow&&C===this.viewportEndRow&&f<this.endCol||this.viewportStartRow<this.viewportEndRow&&C===this.viewportStartRow&&f>=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(d,v,T,R){var L,M=arguments.length,k=M<3?v:R===null?R=Object.getOwnPropertyDescriptor(v,T):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(d,v,T,R);else for(var B=d.length-1;B>=0;B--)(L=d[B])&&(k=(M<3?L(k):M>3?L(v,T,k):L(v,T))||k);return M>3&&k&&Object.defineProperty(v,T,k),k},b=this&&this.__param||function(d,v){return function(T,R){v(T,R,d)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CharSizeService=void 0;const f=u(2585),C=u(8460),E=u(844);let A=c.CharSizeService=class extends E.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(d,v,T){super(),this._optionsService=T,this.width=0,this.height=0,this._onCharSizeChange=this.register(new C.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new y(this._optionsService))}catch{this._measureStrategy=this.register(new p(d,v,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const d=this._measureStrategy.measure();d.width===this.width&&d.height===this.height||(this.width=d.width,this.height=d.height,this._onCharSizeChange.fire())}};c.CharSizeService=A=h([b(2,f.IOptionsService)],A);class x extends E.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(v,T){v!==void 0&&v>0&&T!==void 0&&T>0&&(this._result.width=v,this._result.height=T)}}class p extends x{constructor(v,T,R){super(),this._document=v,this._parentElement=T,this._optionsService=R,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 y extends x{constructor(v){super(),this._optionsService=v,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const T=this._ctx.measureText("W");if(!("width"in T&&"fontBoundingBoxAscent"in T&&"fontBoundingBoxDescent"in T))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const v=this._ctx.measureText("W");return this._validateAndSet(v.width,v.fontBoundingBoxAscent+v.fontBoundingBoxDescent),this._result}}},4269:function(m,c,u){var h=this&&this.__decorate||function(y,d,v,T){var R,L=arguments.length,M=L<3?d:T===null?T=Object.getOwnPropertyDescriptor(d,v):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,d,v,T);else for(var k=y.length-1;k>=0;k--)(R=y[k])&&(M=(L<3?R(M):L>3?R(d,v,M):R(d,v))||M);return L>3&&M&&Object.defineProperty(d,v,M),M},b=this&&this.__param||function(y,d){return function(v,T){d(v,T,y)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CharacterJoinerService=c.JoinedCellData=void 0;const f=u(3734),C=u(643),E=u(511),A=u(2585);class x extends f.AttributeData{constructor(d,v,T){super(),this.content=0,this.combinedData="",this.fg=d.fg,this.bg=d.bg,this.combinedData=v,this._width=T}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(d){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}c.JoinedCellData=x;let p=c.CharacterJoinerService=class WS{constructor(d){this._bufferService=d,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new E.CellData}register(d){const v={id:this._nextCharacterJoinerId++,handler:d};return this._characterJoiners.push(v),v.id}deregister(d){for(let v=0;v<this._characterJoiners.length;v++)if(this._characterJoiners[v].id===d)return this._characterJoiners.splice(v,1),!0;return!1}getJoinedCharacters(d){if(this._characterJoiners.length===0)return[];const v=this._bufferService.buffer.lines.get(d);if(!v||v.length===0)return[];const T=[],R=v.translateToString(!0);let L=0,M=0,k=0,B=v.getFg(0),W=v.getBg(0);for(let F=0;F<v.getTrimmedLength();F++)if(v.loadCell(F,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==B||this._workCell.bg!==W){if(F-L>1){const q=this._getJoinedRanges(R,k,M,v,L);for(let I=0;I<q.length;I++)T.push(q[I])}L=F,k=M,B=this._workCell.fg,W=this._workCell.bg}M+=this._workCell.getChars().length||C.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-L>1){const F=this._getJoinedRanges(R,k,M,v,L);for(let q=0;q<F.length;q++)T.push(F[q])}return T}_getJoinedRanges(d,v,T,R,L){const M=d.substring(v,T);let k=[];try{k=this._characterJoiners[0].handler(M)}catch(B){console.error(B)}for(let B=1;B<this._characterJoiners.length;B++)try{const W=this._characterJoiners[B].handler(M);for(let F=0;F<W.length;F++)WS._mergeRanges(k,W[F])}catch(W){console.error(W)}return this._stringRangesToCellRanges(k,R,L),k}_stringRangesToCellRanges(d,v,T){let R=0,L=!1,M=0,k=d[R];if(k){for(let B=T;B<this._bufferService.cols;B++){const W=v.getWidth(B),F=v.getString(B).length||C.WHITESPACE_CELL_CHAR.length;if(W!==0){if(!L&&k[0]<=M&&(k[0]=B,L=!0),k[1]<=M){if(k[1]=B,k=d[++R],!k)break;k[0]<=M?(k[0]=B,L=!0):L=!1}M+=F}}k&&(k[1]=this._bufferService.cols)}}static _mergeRanges(d,v){let T=!1;for(let R=0;R<d.length;R++){const L=d[R];if(T){if(v[1]<=L[0])return d[R-1][1]=v[1],d;if(v[1]<=L[1])return d[R-1][1]=Math.max(v[1],L[1]),d.splice(R,1),d;d.splice(R,1),R--}else{if(v[1]<=L[0])return d.splice(R,0,v),d;if(v[1]<=L[1])return L[0]=Math.min(v[0],L[0]),d;v[0]<L[1]&&(L[0]=Math.min(v[0],L[0]),T=!0)}}return T?d[d.length-1][1]=v[1]:d.push(v),d}};c.CharacterJoinerService=p=h([b(0,A.IBufferService)],p)},5114:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CoreBrowserService=void 0;const h=u(844),b=u(8460),f=u(3656);class C extends h.Disposable{constructor(x,p,y){super(),this._textarea=x,this._window=p,this.mainDocument=y,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new E(this._window),this._onDprChange=this.register(new b.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new b.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((d=>this._screenDprMonitor.setWindow(d)))),this.register((0,b.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 E extends h.Disposable{constructor(x){super(),this._parentWindow=x,this._windowResizeListener=this.register(new h.MutableDisposable),this._onDprChange=this.register(new b.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,f.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 b 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 E=this.linkProviders.indexOf(C);E!==-1&&this.linkProviders.splice(E,1)}}}}c.LinkProviderService=b},8934:function(m,c,u){var h=this&&this.__decorate||function(A,x,p,y){var d,v=arguments.length,T=v<3?x:y===null?y=Object.getOwnPropertyDescriptor(x,p):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(A,x,p,y);else for(var R=A.length-1;R>=0;R--)(d=A[R])&&(T=(v<3?d(T):v>3?d(x,p,T):d(x,p))||T);return v>3&&T&&Object.defineProperty(x,p,T),T},b=this&&this.__param||function(A,x){return function(p,y){x(p,y,A)}};Object.defineProperty(c,"__esModule",{value:!0}),c.MouseService=void 0;const f=u(4725),C=u(9806);let E=c.MouseService=class{constructor(A,x){this._renderService=A,this._charSizeService=x}getCoords(A,x,p,y,d){return(0,C.getCoords)(window,A,x,p,y,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,d)}getMouseReportCoords(A,x){const p=(0,C.getCoordsRelativeToElement)(window,A,x);if(this._charSizeService.hasValidSize)return p[0]=Math.min(Math.max(p[0],0),this._renderService.dimensions.css.canvas.width-1),p[1]=Math.min(Math.max(p[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(p[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(p[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(p[0]),y:Math.floor(p[1])}}};c.MouseService=E=h([b(0,f.IRenderService),b(1,f.ICharSizeService)],E)},3230:function(m,c,u){var h=this&&this.__decorate||function(d,v,T,R){var L,M=arguments.length,k=M<3?v:R===null?R=Object.getOwnPropertyDescriptor(v,T):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(d,v,T,R);else for(var B=d.length-1;B>=0;B--)(L=d[B])&&(k=(M<3?L(k):M>3?L(v,T,k):L(v,T))||k);return M>3&&k&&Object.defineProperty(v,T,k),k},b=this&&this.__param||function(d,v){return function(T,R){v(T,R,d)}};Object.defineProperty(c,"__esModule",{value:!0}),c.RenderService=void 0;const f=u(6193),C=u(4725),E=u(8460),A=u(844),x=u(7226),p=u(2585);let y=c.RenderService=class extends A.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(d,v,T,R,L,M,k,B){super(),this._rowCount=d,this._charSizeService=R,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 E.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new E.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new E.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new E.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new f.RenderDebouncer(((W,F)=>this._renderRows(W,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(T.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(L.onDecorationRegistered((()=>this._fullRefresh()))),this.register(L.onDecorationRemoved((()=>this._fullRefresh()))),this.register(T.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(M.cols,M.rows),this._fullRefresh()}))),this.register(T.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(M.buffer.y,M.buffer.y,!0)))),this.register(B.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(k.window,v),this.register(k.onWindowChange((W=>this._registerIntersectionObserver(W,v))))}_registerIntersectionObserver(d,v){if("IntersectionObserver"in d){const T=new d.IntersectionObserver((R=>this._handleIntersectionChange(R[R.length-1])),{threshold:0});T.observe(v),this._observerDisposable.value=(0,A.toDisposable)((()=>T.disconnect()))}}_handleIntersectionChange(d){this._isPaused=d.isIntersecting===void 0?d.intersectionRatio===0:!d.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(d,v,T=!1){this._isPaused?this._needsFullRefresh=!0:(T||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(d,v,this._rowCount))}_renderRows(d,v){this._renderer.value&&(d=Math.min(d,this._rowCount-1),v=Math.min(v,this._rowCount-1),this._renderer.value.renderRows(d,v),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:d,end:v}),this._onRender.fire({start:d,end:v}),this._isNextRenderRedrawOnly=!0)}resize(d,v){this._rowCount=v,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(d){this._renderer.value=d,this._renderer.value&&(this._renderer.value.onRequestRedraw((v=>this.refreshRows(v.start,v.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(d){return this._renderDebouncer.addRefreshCallback(d)}_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(d,v){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value?.handleResize(d,v))):this._renderer.value.handleResize(d,v),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(d,v,T){this._selectionState.start=d,this._selectionState.end=v,this._selectionState.columnSelectMode=T,this._renderer.value?.handleSelectionChanged(d,v,T)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};c.RenderService=y=h([b(2,p.IOptionsService),b(3,C.ICharSizeService),b(4,p.IDecorationService),b(5,p.IBufferService),b(6,C.ICoreBrowserService),b(7,C.IThemeService)],y)},9312:function(m,c,u){var h=this&&this.__decorate||function(k,B,W,F){var q,I=arguments.length,G=I<3?B:F===null?F=Object.getOwnPropertyDescriptor(B,W):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")G=Reflect.decorate(k,B,W,F);else for(var te=k.length-1;te>=0;te--)(q=k[te])&&(G=(I<3?q(G):I>3?q(B,W,G):q(B,W))||G);return I>3&&G&&Object.defineProperty(B,W,G),G},b=this&&this.__param||function(k,B){return function(W,F){B(W,F,k)}};Object.defineProperty(c,"__esModule",{value:!0}),c.SelectionService=void 0;const f=u(9806),C=u(9504),E=u(456),A=u(4725),x=u(8460),p=u(844),y=u(6114),d=u(4841),v=u(511),T=u(2585),R=" ",L=new RegExp(R,"g");let M=c.SelectionService=class extends p.Disposable{constructor(k,B,W,F,q,I,G,te,P){super(),this._element=k,this._screenElement=B,this._linkifier=W,this._bufferService=F,this._coreService=q,this._mouseService=I,this._optionsService=G,this._renderService=te,this._coreBrowserService=P,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new v.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=V=>this._handleMouseMove(V),this._mouseUpListener=V=>this._handleMouseUp(V),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((V=>this._handleTrim(V))),this.register(this._bufferService.buffers.onBufferActivate((V=>this._handleBufferActivate(V)))),this.enable(),this._model=new E.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,p.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,B=this._model.finalSelectionEnd;return!(!k||!B||k[0]===B[0]&&k[1]===B[1])}get selectionText(){const k=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;if(!k||!B)return"";const W=this._bufferService.buffer,F=[];if(this._activeSelectionMode===3){if(k[0]===B[0])return"";const q=k[0]<B[0]?k[0]:B[0],I=k[0]<B[0]?B[0]:k[0];for(let G=k[1];G<=B[1];G++){const te=W.translateBufferLineToString(G,!0,q,I);F.push(te)}}else{const q=k[1]===B[1]?B[0]:void 0;F.push(W.translateBufferLineToString(k[1],!0,k[0],q));for(let I=k[1]+1;I<=B[1]-1;I++){const G=W.lines.get(I),te=W.translateBufferLineToString(I,!0);G?.isWrapped?F[F.length-1]+=te:F.push(te)}if(k[1]!==B[1]){const I=W.lines.get(B[1]),G=W.translateBufferLineToString(B[1],!0,0,B[0]);I&&I.isWrapped?F[F.length-1]+=G:F.push(G)}}return F.map((q=>q.replace(L," "))).join(y.isWindows?`\r
|
|
80
|
+
`:`
|
|
81
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(k){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),y.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 B=this._getMouseBufferCoords(k),W=this._model.finalSelectionStart,F=this._model.finalSelectionEnd;return!!(W&&F&&B)&&this._areCoordsInSelection(B,W,F)}isCellInSelection(k,B){const W=this._model.finalSelectionStart,F=this._model.finalSelectionEnd;return!(!W||!F)&&this._areCoordsInSelection([k,B],W,F)}_areCoordsInSelection(k,B,W){return k[1]>B[1]&&k[1]<W[1]||B[1]===W[1]&&k[1]===B[1]&&k[0]>=B[0]&&k[0]<W[0]||B[1]<W[1]&&k[1]===W[1]&&k[0]<W[0]||B[1]<W[1]&&k[1]===B[1]&&k[0]>=B[0]}_selectWordAtCursor(k,B){const W=this._linkifier.currentLink?.link?.range;if(W)return this._model.selectionStart=[W.start.x-1,W.start.y-1],this._model.selectionStartLength=(0,d.getRangeLength)(W,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const F=this._getMouseBufferCoords(k);return!!F&&(this._selectWordAt(F,B),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(k,B){this._model.clearSelection(),k=Math.max(k,0),B=Math.min(B,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,k],this._model.selectionEnd=[this._bufferService.cols,B],this.refresh(),this._onSelectionChange.fire()}_handleTrim(k){this._model.handleTrim(k)&&this.refresh()}_getMouseBufferCoords(k){const B=this._mouseService.getCoords(k,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(B)return B[0]--,B[1]--,B[1]+=this._bufferService.buffer.ydisp,B}_getMouseEventScrollAmount(k){let B=(0,f.getCoordsRelativeToElement)(this._coreBrowserService.window,k,this._screenElement)[1];const W=this._renderService.dimensions.css.canvas.height;return B>=0&&B<=W?0:(B>W&&(B-=W),B=Math.min(Math.max(B,-50),50),B/=50,B/Math.abs(B)+Math.round(14*B))}shouldForceSelection(k){return y.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 B=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);B&&B.length!==this._model.selectionStart[0]&&B.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(k){this._selectWordAtCursor(k,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(k){const B=this._getMouseBufferCoords(k);B&&(this._activeSelectionMode=2,this._selectLineAt(B[1]))}shouldColumnSelect(k){return k.altKey&&!(y.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(k){if(k.stopImmediatePropagation(),!this._model.selectionStart)return;const B=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(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 W=this._bufferService.buffer;if(this._model.selectionEnd[1]<W.lines.length){const F=W.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]++}B&&B[0]===this._model.selectionEnd[0]&&B[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const 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 B=k.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&B<500&&k.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const W=this._mouseService.getCoords(k,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(W&&W[0]!==void 0&&W[1]!==void 0){const F=(0,C.moveToCellSequence)(W[0]-1,W[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(F,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const k=this._model.finalSelectionStart,B=this._model.finalSelectionEnd,W=!(!k||!B||k[0]===B[0]&&k[1]===B[1]);W?k&&B&&(this._oldSelectionStart&&this._oldSelectionEnd&&k[0]===this._oldSelectionStart[0]&&k[1]===this._oldSelectionStart[1]&&B[0]===this._oldSelectionEnd[0]&&B[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(k,B,W)):this._oldHasSelection&&this._fireOnSelectionChange(k,B,W)}_fireOnSelectionChange(k,B,W){this._oldSelectionStart=k,this._oldSelectionEnd=B,this._oldHasSelection=W,this._onSelectionChange.fire()}_handleBufferActivate(k){this.clearSelection(),this._trimListener.dispose(),this._trimListener=k.activeBuffer.lines.onTrim((B=>this._handleTrim(B)))}_convertViewportColToCharacterIndex(k,B){let W=B;for(let F=0;B>=F;F++){const q=k.loadCell(F,this._workCell).getChars().length;this._workCell.getWidth()===0?W--:q>1&&B!==F&&(W+=q-1)}return W}setSelection(k,B,W){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[k,B],this._model.selectionStartLength=W,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(k){this._isClickInSelection(k)||(this._selectWordAtCursor(k,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(k,B,W=!0,F=!0){if(k[0]>=this._bufferService.cols)return;const q=this._bufferService.buffer,I=q.lines.get(k[1]);if(!I)return;const G=q.translateBufferLineToString(k[1],!1);let te=this._convertViewportColToCharacterIndex(I,k[0]),P=te;const V=k[0]-te;let X=0,N=0,z=0,O=0;if(G.charAt(te)===" "){for(;te>0&&G.charAt(te-1)===" ";)te--;for(;P<G.length&&G.charAt(P+1)===" ";)P++}else{let ae=k[0],ce=k[0];I.getWidth(ae)===0&&(X++,ae--),I.getWidth(ce)===2&&(N++,ce++);const _e=I.getString(ce).length;for(_e>1&&(O+=_e-1,P+=_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?(X++,ae--):Q>1&&(z+=Q-1,te-=Q-1),te--,ae--}for(;ce<I.length&&P+1<G.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?(N++,ce++):Q>1&&(O+=Q-1,P+=Q-1),P++,ce++}}P++;let H=te+V-X+z,Z=Math.min(this._bufferService.cols,P-te+X+N-z-O);if(B||G.slice(te,P).trim()!==""){if(W&&H===0&&I.getCodePoint(0)!==32){const ae=q.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;H-=_e,Z+=_e}}}if(F&&H+Z===this._bufferService.cols&&I.getCodePoint(this._bufferService.cols-1)!==32){const ae=q.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:H,length:Z}}}_selectWordAt(k,B){const W=this._getWordAt(k,B);if(W){for(;W.start<0;)W.start+=this._bufferService.cols,k[1]--;this._model.selectionStart=[W.start,k[1]],this._model.selectionStartLength=W.length}}_selectToWordAt(k){const B=this._getWordAt(k,!0);if(B){let W=k[1];for(;B.start<0;)B.start+=this._bufferService.cols,W--;if(!this._model.areSelectionValuesReversed())for(;B.start+B.length>this._bufferService.cols;)B.length-=this._bufferService.cols,W++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?B.start:B.start+B.length,W]}}_isCharWordSeparator(k){return k.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(k.getChars())>=0}_selectLineAt(k){const B=this._bufferService.buffer.getWrappedRangeForLine(k),W={start:{x:0,y:B.first},end:{x:this._bufferService.cols-1,y:B.last}};this._model.selectionStart=[0,B.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,d.getRangeLength)(W,this._bufferService.cols)}};c.SelectionService=M=h([b(3,T.IBufferService),b(4,T.ICoreService),b(5,A.IMouseService),b(6,T.IOptionsService),b(7,A.IRenderService),b(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,B,W){var F,q=arguments.length,I=q<3?k:W===null?W=Object.getOwnPropertyDescriptor(k,B):W;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(M,k,B,W);else for(var G=M.length-1;G>=0;G--)(F=M[G])&&(I=(q<3?F(I):q>3?F(k,B,I):F(k,B))||I);return q>3&&I&&Object.defineProperty(k,B,I),I},b=this&&this.__param||function(M,k){return function(B,W){k(B,W,M)}};Object.defineProperty(c,"__esModule",{value:!0}),c.ThemeService=c.DEFAULT_ANSI_COLORS=void 0;const f=u(7239),C=u(8055),E=u(8460),A=u(844),x=u(2585),p=C.css.toColor("#ffffff"),y=C.css.toColor("#000000"),d=C.css.toColor("#ffffff"),v=C.css.toColor("#000000"),T={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 B=0;B<216;B++){const W=k[B/36%6|0],F=k[B/6%6|0],q=k[B%6];M.push({css:C.channels.toCss(W,F,q),rgba:C.channels.toRgba(W,F,q)})}for(let B=0;B<24;B++){const W=8+10*B;M.push({css:C.channels.toCss(W,W,W),rgba:C.channels.toRgba(W,W,W)})}return M})());let R=c.ThemeService=class extends A.Disposable{get colors(){return this._colors}constructor(M){super(),this._optionsService=M,this._contrastCache=new f.ColorContrastCache,this._halfContrastCache=new f.ColorContrastCache,this._onChangeColors=this.register(new E.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:p,background:y,cursor:d,cursorAccent:v,selectionForeground:void 0,selectionBackgroundTransparent:T,selectionBackgroundOpaque:C.color.blend(y,T),selectionInactiveBackgroundTransparent:T,selectionInactiveBackgroundOpaque:C.color.blend(y,T),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=L(M.foreground,p),k.background=L(M.background,y),k.cursor=L(M.cursor,d),k.cursorAccent=L(M.cursorAccent,v),k.selectionBackgroundTransparent=L(M.selectionBackground,T),k.selectionBackgroundOpaque=C.color.blend(k.background,k.selectionBackgroundTransparent),k.selectionInactiveBackgroundTransparent=L(M.selectionInactiveBackground,k.selectionBackgroundTransparent),k.selectionInactiveBackgroundOpaque=C.color.blend(k.background,k.selectionInactiveBackgroundTransparent),k.selectionForeground=M.selectionForeground?L(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]=L(M.black,c.DEFAULT_ANSI_COLORS[0]),k.ansi[1]=L(M.red,c.DEFAULT_ANSI_COLORS[1]),k.ansi[2]=L(M.green,c.DEFAULT_ANSI_COLORS[2]),k.ansi[3]=L(M.yellow,c.DEFAULT_ANSI_COLORS[3]),k.ansi[4]=L(M.blue,c.DEFAULT_ANSI_COLORS[4]),k.ansi[5]=L(M.magenta,c.DEFAULT_ANSI_COLORS[5]),k.ansi[6]=L(M.cyan,c.DEFAULT_ANSI_COLORS[6]),k.ansi[7]=L(M.white,c.DEFAULT_ANSI_COLORS[7]),k.ansi[8]=L(M.brightBlack,c.DEFAULT_ANSI_COLORS[8]),k.ansi[9]=L(M.brightRed,c.DEFAULT_ANSI_COLORS[9]),k.ansi[10]=L(M.brightGreen,c.DEFAULT_ANSI_COLORS[10]),k.ansi[11]=L(M.brightYellow,c.DEFAULT_ANSI_COLORS[11]),k.ansi[12]=L(M.brightBlue,c.DEFAULT_ANSI_COLORS[12]),k.ansi[13]=L(M.brightMagenta,c.DEFAULT_ANSI_COLORS[13]),k.ansi[14]=L(M.brightCyan,c.DEFAULT_ANSI_COLORS[14]),k.ansi[15]=L(M.brightWhite,c.DEFAULT_ANSI_COLORS[15]),M.extendedAnsi){const B=Math.min(k.ansi.length-16,M.extendedAnsi.length);for(let W=0;W<B;W++)k.ansi[W+16]=L(M.extendedAnsi[W],c.DEFAULT_ANSI_COLORS[W+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 L(M,k){if(M!==void 0)try{return C.css.toColor(M)}catch{}return k}c.ThemeService=R=h([b(0,x.IOptionsService)],R)},6349:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CircularList=void 0;const h=u(8460),b=u(844);class f extends b.Disposable{constructor(E){super(),this._maxLength=E,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(E){if(this._maxLength===E)return;const A=new Array(E);for(let x=0;x<Math.min(E,this.length);x++)A[x]=this._array[this._getCyclicIndex(x)];this._array=A,this._maxLength=E,this._startIndex=0}get length(){return this._length}set length(E){if(E>this._length)for(let A=this._length;A<E;A++)this._array[A]=void 0;this._length=E}get(E){return this._array[this._getCyclicIndex(E)]}set(E,A){this._array[this._getCyclicIndex(E)]=A}push(E){this._array[this._getCyclicIndex(this._length)]=E,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(E,A,...x){if(A){for(let p=E;p<this._length-A;p++)this._array[this._getCyclicIndex(p)]=this._array[this._getCyclicIndex(p+A)];this._length-=A,this.onDeleteEmitter.fire({index:E,amount:A})}for(let p=this._length-1;p>=E;p--)this._array[this._getCyclicIndex(p+x.length)]=this._array[this._getCyclicIndex(p)];for(let p=0;p<x.length;p++)this._array[this._getCyclicIndex(E+p)]=x[p];if(x.length&&this.onInsertEmitter.fire({index:E,amount:x.length}),this._length+x.length>this._maxLength){const p=this._length+x.length-this._maxLength;this._startIndex+=p,this._length=this._maxLength,this.onTrimEmitter.fire(p)}else this._length+=x.length}trimStart(E){E>this._length&&(E=this._length),this._startIndex+=E,this._length-=E,this.onTrimEmitter.fire(E)}shiftElements(E,A,x){if(!(A<=0)){if(E<0||E>=this._length)throw new Error("start argument out of range");if(E+x<0)throw new Error("Cannot shift elements in list beyond index 0");if(x>0){for(let y=A-1;y>=0;y--)this.set(E+y+x,this.get(E+y));const p=E+A+x-this._length;if(p>0)for(this._length+=p;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let p=0;p<A;p++)this.set(E+p+x,this.get(E+p))}}_getCyclicIndex(E){return(this._startIndex+E)%this._maxLength}}c.CircularList=f},1439:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.clone=void 0,c.clone=function u(h,b=5){if(typeof h!="object")return h;const f=Array.isArray(h)?[]:{};for(const C in h)f[C]=b<=1?h[C]:h[C]&&u(h[C],b-1);return f}},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,b=0,f=0;var C,E,A,x,p;function y(v){const T=v.toString(16);return T.length<2?"0"+T:T}function d(v,T){return v<T?(T+.05)/(v+.05):(v+.05)/(T+.05)}c.NULL_COLOR={css:"#00000000",rgba:0},(function(v){v.toCss=function(T,R,L,M){return M!==void 0?`#${y(T)}${y(R)}${y(L)}${y(M)}`:`#${y(T)}${y(R)}${y(L)}`},v.toRgba=function(T,R,L,M=255){return(T<<24|R<<16|L<<8|M)>>>0},v.toColor=function(T,R,L,M){return{css:v.toCss(T,R,L,M),rgba:v.toRgba(T,R,L,M)}}})(C||(c.channels=C={})),(function(v){function T(R,L){return f=Math.round(255*L),[u,h,b]=p.toChannels(R.rgba),{css:C.toCss(u,h,b,f),rgba:C.toRgba(u,h,b,f)}}v.blend=function(R,L){if(f=(255&L.rgba)/255,f===1)return{css:L.css,rgba:L.rgba};const M=L.rgba>>24&255,k=L.rgba>>16&255,B=L.rgba>>8&255,W=R.rgba>>24&255,F=R.rgba>>16&255,q=R.rgba>>8&255;return u=W+Math.round((M-W)*f),h=F+Math.round((k-F)*f),b=q+Math.round((B-q)*f),{css:C.toCss(u,h,b),rgba:C.toRgba(u,h,b)}},v.isOpaque=function(R){return(255&R.rgba)==255},v.ensureContrastRatio=function(R,L,M){const k=p.ensureContrastRatio(R.rgba,L.rgba,M);if(k)return C.toColor(k>>24&255,k>>16&255,k>>8&255)},v.opaque=function(R){const L=(255|R.rgba)>>>0;return[u,h,b]=p.toChannels(L),{css:C.toCss(u,h,b),rgba:L}},v.opacity=T,v.multiplyOpacity=function(R,L){return f=255&R.rgba,T(R,f*L/255)},v.toColorRGB=function(R){return[R.rgba>>24&255,R.rgba>>16&255,R.rgba>>8&255]}})(E||(c.color=E={})),(function(v){let T,R;try{const L=document.createElement("canvas");L.width=1,L.height=1;const M=L.getContext("2d",{willReadFrequently:!0});M&&(T=M,T.globalCompositeOperation="copy",R=T.createLinearGradient(0,0,1,1))}catch{}v.toColor=function(L){if(L.match(/#[\da-f]{3,8}/i))switch(L.length){case 4:return u=parseInt(L.slice(1,2).repeat(2),16),h=parseInt(L.slice(2,3).repeat(2),16),b=parseInt(L.slice(3,4).repeat(2),16),C.toColor(u,h,b);case 5:return u=parseInt(L.slice(1,2).repeat(2),16),h=parseInt(L.slice(2,3).repeat(2),16),b=parseInt(L.slice(3,4).repeat(2),16),f=parseInt(L.slice(4,5).repeat(2),16),C.toColor(u,h,b,f);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}}const M=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(M)return u=parseInt(M[1]),h=parseInt(M[2]),b=parseInt(M[3]),f=Math.round(255*(M[5]===void 0?1:parseFloat(M[5]))),C.toColor(u,h,b,f);if(!T||!R)throw new Error("css.toColor: Unsupported css format");if(T.fillStyle=R,T.fillStyle=L,typeof T.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(T.fillRect(0,0,1,1),[u,h,b,f]=T.getImageData(0,0,1,1).data,f!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:C.toRgba(u,h,b,f),css:L}}})(A||(c.css=A={})),(function(v){function T(R,L,M){const k=R/255,B=L/255,W=M/255;return .2126*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.7152*(B<=.03928?B/12.92:Math.pow((B+.055)/1.055,2.4))+.0722*(W<=.03928?W/12.92:Math.pow((W+.055)/1.055,2.4))}v.relativeLuminance=function(R){return T(R>>16&255,R>>8&255,255&R)},v.relativeLuminance2=T})(x||(c.rgb=x={})),(function(v){function T(L,M,k){const B=L>>24&255,W=L>>16&255,F=L>>8&255;let q=M>>24&255,I=M>>16&255,G=M>>8&255,te=d(x.relativeLuminance2(q,I,G),x.relativeLuminance2(B,W,F));for(;te<k&&(q>0||I>0||G>0);)q-=Math.max(0,Math.ceil(.1*q)),I-=Math.max(0,Math.ceil(.1*I)),G-=Math.max(0,Math.ceil(.1*G)),te=d(x.relativeLuminance2(q,I,G),x.relativeLuminance2(B,W,F));return(q<<24|I<<16|G<<8|255)>>>0}function R(L,M,k){const B=L>>24&255,W=L>>16&255,F=L>>8&255;let q=M>>24&255,I=M>>16&255,G=M>>8&255,te=d(x.relativeLuminance2(q,I,G),x.relativeLuminance2(B,W,F));for(;te<k&&(q<255||I<255||G<255);)q=Math.min(255,q+Math.ceil(.1*(255-q))),I=Math.min(255,I+Math.ceil(.1*(255-I))),G=Math.min(255,G+Math.ceil(.1*(255-G))),te=d(x.relativeLuminance2(q,I,G),x.relativeLuminance2(B,W,F));return(q<<24|I<<16|G<<8|255)>>>0}v.blend=function(L,M){if(f=(255&M)/255,f===1)return M;const k=M>>24&255,B=M>>16&255,W=M>>8&255,F=L>>24&255,q=L>>16&255,I=L>>8&255;return u=F+Math.round((k-F)*f),h=q+Math.round((B-q)*f),b=I+Math.round((W-I)*f),C.toRgba(u,h,b)},v.ensureContrastRatio=function(L,M,k){const B=x.relativeLuminance(L>>8),W=x.relativeLuminance(M>>8);if(d(B,W)<k){if(W<B){const I=T(L,M,k),G=d(B,x.relativeLuminance(I>>8));if(G<k){const te=R(L,M,k);return G>d(B,x.relativeLuminance(te>>8))?I:te}return I}const F=R(L,M,k),q=d(B,x.relativeLuminance(F>>8));if(q<k){const I=T(L,M,k);return q>d(B,x.relativeLuminance(I>>8))?F:I}return F}},v.reduceLuminance=T,v.increaseLuminance=R,v.toChannels=function(L){return[L>>24&255,L>>16&255,L>>8&255,255&L]}})(p||(c.rgba=p={})),c.toPaddedHex=y,c.contrastRatio=d},8969:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CoreTerminal=void 0;const h=u(844),b=u(2585),f=u(4348),C=u(7866),E=u(744),A=u(7302),x=u(6975),p=u(8460),y=u(1753),d=u(1480),v=u(7994),T=u(9282),R=u(5435),L=u(5981),M=u(2660);let k=!1;class B extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new p.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 q in F)this.optionsService.options[q]=F[q]}constructor(F){super(),this._windowsWrappingHeuristics=this.register(new h.MutableDisposable),this._onBinary=this.register(new p.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new p.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new p.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new p.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new p.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new p.EventEmitter),this._instantiationService=new f.InstantiationService,this.optionsService=this.register(new A.OptionsService(F)),this._instantiationService.setService(b.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(E.BufferService)),this._instantiationService.setService(b.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(C.LogService)),this._instantiationService.setService(b.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(x.CoreService)),this._instantiationService.setService(b.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(y.CoreMouseService)),this._instantiationService.setService(b.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(d.UnicodeService)),this._instantiationService.setService(b.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(v.CharsetService),this._instantiationService.setService(b.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(M.OscLinkService),this._instantiationService.setService(b.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new R.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,p.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,p.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,p.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,p.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((q=>{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((q=>{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 L.WriteBuffer(((q,I)=>this._inputHandler.parse(q,I)))),this.register((0,p.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(F,q){this._writeBuffer.write(F,q)}writeSync(F,q){this._logService.logLevel<=b.LogLevelEnum.WARN&&!k&&(this._logService.warn("writeSync is unreliable and will be removed soon."),k=!0),this._writeBuffer.writeSync(F,q)}input(F,q=!0){this.coreService.triggerDataEvent(F,q)}resize(F,q){isNaN(F)||isNaN(q)||(F=Math.max(F,E.MINIMUM_COLS),q=Math.max(q,E.MINIMUM_ROWS),this._bufferService.resize(F,q))}scroll(F,q=!1){this._bufferService.scroll(F,q)}scrollLines(F,q,I){this._bufferService.scrollLines(F,q,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 q=F-this._bufferService.buffer.ydisp;q!==0&&this.scrollLines(q)}registerEscHandler(F,q){return this._inputHandler.registerEscHandler(F,q)}registerDcsHandler(F,q){return this._inputHandler.registerDcsHandler(F,q)}registerCsiHandler(F,q){return this._inputHandler.registerCsiHandler(F,q)}registerOscHandler(F,q){return this._inputHandler.registerOscHandler(F,q)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let F=!1;const q=this.optionsService.rawOptions.windowsPty;q&&q.buildNumber!==void 0&&q.buildNumber!==void 0?F=q.backend==="conpty"&&q.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(T.updateWindowsModeWrappedState.bind(null,this._bufferService))),F.push(this.registerCsiHandler({final:"H"},(()=>((0,T.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)((()=>{for(const q of F)q.dispose()}))}}}c.CoreTerminal=B},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 b=[];for(let f=0;f<this._listeners.length;f++)b.push(this._listeners[f]);for(let f=0;f<b.length;f++)b[f].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((b=>h.fire(b)))},c.runAndSubscribe=function(u,h){return h(void 0),u((b=>h(b)))}},5435:function(m,c,u){var h=this&&this.__decorate||function(X,N,z,O){var H,Z=arguments.length,ae=Z<3?N:O===null?O=Object.getOwnPropertyDescriptor(N,z):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ae=Reflect.decorate(X,N,z,O);else for(var ce=X.length-1;ce>=0;ce--)(H=X[ce])&&(ae=(Z<3?H(ae):Z>3?H(N,z,ae):H(N,z))||ae);return Z>3&&ae&&Object.defineProperty(N,z,ae),ae},b=this&&this.__param||function(X,N){return function(z,O){N(z,O,X)}};Object.defineProperty(c,"__esModule",{value:!0}),c.InputHandler=c.WindowsOptionsReportType=void 0;const f=u(2584),C=u(7116),E=u(2015),A=u(844),x=u(482),p=u(8437),y=u(8460),d=u(643),v=u(511),T=u(3734),R=u(2585),L=u(1480),M=u(6242),k=u(6351),B=u(5941),W={"(":0,")":1,"*":2,"+":3,"-":1,".":2},F=131072;function q(X,N){if(X>24)return N.setWinLines||!1;switch(X){case 1:return!!N.restoreWin;case 2:return!!N.minimizeWin;case 3:return!!N.setWinPosition;case 4:return!!N.setWinSizePixels;case 5:return!!N.raiseWin;case 6:return!!N.lowerWin;case 7:return!!N.refreshWin;case 8:return!!N.setWinSizeChars;case 9:return!!N.maximizeWin;case 10:return!!N.fullscreenWin;case 11:return!!N.getWinState;case 13:return!!N.getWinPosition;case 14:return!!N.getWinSizePixels;case 15:return!!N.getScreenSizePixels;case 16:return!!N.getCellSizePixels;case 18:return!!N.getWinSizeChars;case 19:return!!N.getScreenSizeChars;case 20:return!!N.getIconTitle;case 21:return!!N.getWinTitle;case 22:return!!N.pushTitle;case 23:return!!N.popTitle;case 24:return!!N.setWinLines}return!1}var I;(function(X){X[X.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",X[X.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(I||(c.WindowsOptionsReportType=I={}));let G=0;class te extends A.Disposable{getAttrData(){return this._curAttrData}constructor(N,z,O,H,Z,ae,ce,_e,Q=new E.EscapeSequenceParser){super(),this._bufferService=N,this._charsetService=z,this._coreService=O,this._logService=H,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 v.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=p.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=p.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new y.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new y.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new y.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new y.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new y.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new y.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new y.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new y.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new y.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new y.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new y.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new y.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new y.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 P(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(($=>this._activeBuffer=$.activeBuffer))),this._parser.setCsiHandlerFallback((($,oe)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString($),params:oe.toArray()})})),this._parser.setEscHandlerFallback(($=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString($)})})),this._parser.setExecuteHandlerFallback(($=>{this._logService.debug("Unknown EXECUTE code: ",{code:$})})),this._parser.setOscHandlerFallback((($,oe,ge)=>{this._logService.debug("Unknown OSC code: ",{identifier:$,action:oe,data:ge})})),this._parser.setDcsHandlerFallback((($,oe,ge)=>{oe==="HOOK"&&(ge=ge.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString($),action:oe,payload:ge})})),this._parser.setPrintHandler((($,oe,ge)=>this.print($,oe,ge))),this._parser.registerCsiHandler({final:"@"},($=>this.insertChars($))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},($=>this.scrollLeft($))),this._parser.registerCsiHandler({final:"A"},($=>this.cursorUp($))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},($=>this.scrollRight($))),this._parser.registerCsiHandler({final:"B"},($=>this.cursorDown($))),this._parser.registerCsiHandler({final:"C"},($=>this.cursorForward($))),this._parser.registerCsiHandler({final:"D"},($=>this.cursorBackward($))),this._parser.registerCsiHandler({final:"E"},($=>this.cursorNextLine($))),this._parser.registerCsiHandler({final:"F"},($=>this.cursorPrecedingLine($))),this._parser.registerCsiHandler({final:"G"},($=>this.cursorCharAbsolute($))),this._parser.registerCsiHandler({final:"H"},($=>this.cursorPosition($))),this._parser.registerCsiHandler({final:"I"},($=>this.cursorForwardTab($))),this._parser.registerCsiHandler({final:"J"},($=>this.eraseInDisplay($,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},($=>this.eraseInDisplay($,!0))),this._parser.registerCsiHandler({final:"K"},($=>this.eraseInLine($,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},($=>this.eraseInLine($,!0))),this._parser.registerCsiHandler({final:"L"},($=>this.insertLines($))),this._parser.registerCsiHandler({final:"M"},($=>this.deleteLines($))),this._parser.registerCsiHandler({final:"P"},($=>this.deleteChars($))),this._parser.registerCsiHandler({final:"S"},($=>this.scrollUp($))),this._parser.registerCsiHandler({final:"T"},($=>this.scrollDown($))),this._parser.registerCsiHandler({final:"X"},($=>this.eraseChars($))),this._parser.registerCsiHandler({final:"Z"},($=>this.cursorBackwardTab($))),this._parser.registerCsiHandler({final:"`"},($=>this.charPosAbsolute($))),this._parser.registerCsiHandler({final:"a"},($=>this.hPositionRelative($))),this._parser.registerCsiHandler({final:"b"},($=>this.repeatPrecedingCharacter($))),this._parser.registerCsiHandler({final:"c"},($=>this.sendDeviceAttributesPrimary($))),this._parser.registerCsiHandler({prefix:">",final:"c"},($=>this.sendDeviceAttributesSecondary($))),this._parser.registerCsiHandler({final:"d"},($=>this.linePosAbsolute($))),this._parser.registerCsiHandler({final:"e"},($=>this.vPositionRelative($))),this._parser.registerCsiHandler({final:"f"},($=>this.hVPosition($))),this._parser.registerCsiHandler({final:"g"},($=>this.tabClear($))),this._parser.registerCsiHandler({final:"h"},($=>this.setMode($))),this._parser.registerCsiHandler({prefix:"?",final:"h"},($=>this.setModePrivate($))),this._parser.registerCsiHandler({final:"l"},($=>this.resetMode($))),this._parser.registerCsiHandler({prefix:"?",final:"l"},($=>this.resetModePrivate($))),this._parser.registerCsiHandler({final:"m"},($=>this.charAttributes($))),this._parser.registerCsiHandler({final:"n"},($=>this.deviceStatus($))),this._parser.registerCsiHandler({prefix:"?",final:"n"},($=>this.deviceStatusPrivate($))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},($=>this.softReset($))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},($=>this.setCursorStyle($))),this._parser.registerCsiHandler({final:"r"},($=>this.setScrollRegion($))),this._parser.registerCsiHandler({final:"s"},($=>this.saveCursor($))),this._parser.registerCsiHandler({final:"t"},($=>this.windowOptions($))),this._parser.registerCsiHandler({final:"u"},($=>this.restoreCursor($))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},($=>this.insertColumns($))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},($=>this.deleteColumns($))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},($=>this.selectProtected($))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},($=>this.requestMode($,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},($=>this.requestMode($,!1))),this._parser.setExecuteHandler(f.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(f.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(f.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(f.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(f.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(f.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(f.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(f.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(f.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new M.OscHandler(($=>(this.setTitle($),this.setIconName($),!0)))),this._parser.registerOscHandler(1,new M.OscHandler(($=>this.setIconName($)))),this._parser.registerOscHandler(2,new M.OscHandler(($=>this.setTitle($)))),this._parser.registerOscHandler(4,new M.OscHandler(($=>this.setOrReportIndexedColor($)))),this._parser.registerOscHandler(8,new M.OscHandler(($=>this.setHyperlink($)))),this._parser.registerOscHandler(10,new M.OscHandler(($=>this.setOrReportFgColor($)))),this._parser.registerOscHandler(11,new M.OscHandler(($=>this.setOrReportBgColor($)))),this._parser.registerOscHandler(12,new M.OscHandler(($=>this.setOrReportCursorColor($)))),this._parser.registerOscHandler(104,new M.OscHandler(($=>this.restoreIndexedColor($)))),this._parser.registerOscHandler(110,new M.OscHandler(($=>this.restoreFgColor($)))),this._parser.registerOscHandler(111,new M.OscHandler(($=>this.restoreBgColor($)))),this._parser.registerOscHandler(112,new M.OscHandler(($=>this.restoreCursorColor($)))),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 $ in C.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:$},(()=>this.selectCharset("("+$))),this._parser.registerEscHandler({intermediates:")",final:$},(()=>this.selectCharset(")"+$))),this._parser.registerEscHandler({intermediates:"*",final:$},(()=>this.selectCharset("*"+$))),this._parser.registerEscHandler({intermediates:"+",final:$},(()=>this.selectCharset("+"+$))),this._parser.registerEscHandler({intermediates:"-",final:$},(()=>this.selectCharset("-"+$))),this._parser.registerEscHandler({intermediates:".",final:$},(()=>this.selectCharset("."+$))),this._parser.registerEscHandler({intermediates:"/",final:$},(()=>this.selectCharset("/"+$)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler(($=>(this._logService.error("Parsing error: ",$),$))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new k.DcsHandler((($,oe)=>this.requestStatusString($,oe))))}_preserveStack(N,z,O,H){this._parseStack.paused=!0,this._parseStack.cursorStartX=N,this._parseStack.cursorStartY=z,this._parseStack.decodedLength=O,this._parseStack.position=H}_logSlowResolvingAsync(N){this._logService.logLevel<=R.LogLevelEnum.WARN&&Promise.race([N,new Promise(((z,O)=>setTimeout((()=>O("#SLOW_TIMEOUT")),5e3)))]).catch((z=>{if(z!=="#SLOW_TIMEOUT")throw z;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(N,z){let O,H=this._activeBuffer.x,Z=this._activeBuffer.y,ae=0;const ce=this._parseStack.paused;if(ce){if(O=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,z))return this._logSlowResolvingAsync(O),O;H=this._parseStack.cursorStartX,Z=this._parseStack.cursorStartY,this._parseStack.paused=!1,N.length>F&&(ae=this._parseStack.position+F)}if(this._logService.logLevel<=R.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof N=="string"?` "${N}"`:` "${Array.prototype.map.call(N,($=>String.fromCharCode($))).join("")}"`),typeof N=="string"?N.split("").map(($=>$.charCodeAt(0))):N),this._parseBuffer.length<N.length&&this._parseBuffer.length<F&&(this._parseBuffer=new Uint32Array(Math.min(N.length,F))),ce||this._dirtyRowTracker.clearRange(),N.length>F)for(let $=ae;$<N.length;$+=F){const oe=$+F<N.length?$+F:N.length,ge=typeof N=="string"?this._stringDecoder.decode(N.substring($,oe),this._parseBuffer):this._utf8Decoder.decode(N.subarray($,oe),this._parseBuffer);if(O=this._parser.parse(this._parseBuffer,ge))return this._preserveStack(H,Z,ge,$),this._logSlowResolvingAsync(O),O}else if(!ce){const $=typeof N=="string"?this._stringDecoder.decode(N,this._parseBuffer):this._utf8Decoder.decode(N,this._parseBuffer);if(O=this._parser.parse(this._parseBuffer,$))return this._preserveStack(H,Z,$,0),this._logSlowResolvingAsync(O),O}this._activeBuffer.x===H&&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(N,z,O){let H,Z;const ae=this._charsetService.charset,ce=this._optionsService.rawOptions.screenReaderMode,_e=this._bufferService.cols,Q=this._coreService.decPrivateModes.wraparound,$=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&&O-z>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=z;ye<O;++ye){if(H=N[ye],H<127&&ae){const Ct=ae[String.fromCharCode(H)];Ct&&(H=Ct.charCodeAt(0))}const $e=this._unicodeService.charProperties(H,Se);Z=L.UnicodeService.extractWidth($e);const Fe=L.UnicodeService.extractShouldJoin($e),Ve=Fe?L.UnicodeService.extractWidth(Se):0;if(Se=$e,ce&&this._onA11yChar.fire((0,x.stringFromCodePoint)(H)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+Z-Ve>_e){if(Q){const Ct=ge;let Ne=this._activeBuffer.x-Ve;for(this._activeBuffer.x=Ve,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),Ve>0&&ge instanceof p.BufferLine&&ge.copyCellsFrom(Ct,Ne,0,Ve,!1);Ne<_e;)Ct.setCellFromCodepoint(Ne++,0,1,oe)}else if(this._activeBuffer.x=_e-1,Z===2)continue}if(Fe&&this._activeBuffer.x){const Ct=ge.getWidth(this._activeBuffer.x-1)?1:2;ge.addCodepointToCell(this._activeBuffer.x-Ct,H,Z);for(let Ne=Z-Ve;--Ne>=0;)ge.setCellFromCodepoint(this._activeBuffer.x++,0,0,oe)}else if($&&(ge.insertCells(this._activeBuffer.x,Z-Ve,this._activeBuffer.getNullCell(oe)),ge.getWidth(_e-1)===2&&ge.setCellFromCodepoint(_e-1,d.NULL_CELL_CODE,d.NULL_CELL_WIDTH,oe)),ge.setCellFromCodepoint(this._activeBuffer.x++,H,Z,oe),Z>0)for(;--Z;)ge.setCellFromCodepoint(this._activeBuffer.x++,0,0,oe)}this._parser.precedingJoinState=Se,this._activeBuffer.x<_e&&O-z>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(N,z){return N.final!=="t"||N.prefix||N.intermediates?this._parser.registerCsiHandler(N,z):this._parser.registerCsiHandler(N,(O=>!q(O.params[0],this._optionsService.rawOptions.windowOptions)||z(O)))}registerDcsHandler(N,z){return this._parser.registerDcsHandler(N,new k.DcsHandler(z))}registerEscHandler(N,z){return this._parser.registerEscHandler(N,z)}registerOscHandler(N,z){return this._parser.registerOscHandler(N,new M.OscHandler(z))}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 N=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);N.hasWidth(this._activeBuffer.x)&&!N.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const N=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-N),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(N=this._bufferService.cols-1){this._activeBuffer.x=Math.min(N,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(N,z){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=N,this._activeBuffer.y=this._activeBuffer.scrollTop+z):(this._activeBuffer.x=N,this._activeBuffer.y=z),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(N,z){this._restrictCursor(),this._setCursor(this._activeBuffer.x+N,this._activeBuffer.y+z)}cursorUp(N){const z=this._activeBuffer.y-this._activeBuffer.scrollTop;return z>=0?this._moveCursor(0,-Math.min(z,N.params[0]||1)):this._moveCursor(0,-(N.params[0]||1)),!0}cursorDown(N){const z=this._activeBuffer.scrollBottom-this._activeBuffer.y;return z>=0?this._moveCursor(0,Math.min(z,N.params[0]||1)):this._moveCursor(0,N.params[0]||1),!0}cursorForward(N){return this._moveCursor(N.params[0]||1,0),!0}cursorBackward(N){return this._moveCursor(-(N.params[0]||1),0),!0}cursorNextLine(N){return this.cursorDown(N),this._activeBuffer.x=0,!0}cursorPrecedingLine(N){return this.cursorUp(N),this._activeBuffer.x=0,!0}cursorCharAbsolute(N){return this._setCursor((N.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(N){return this._setCursor(N.length>=2?(N.params[1]||1)-1:0,(N.params[0]||1)-1),!0}charPosAbsolute(N){return this._setCursor((N.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(N){return this._moveCursor(N.params[0]||1,0),!0}linePosAbsolute(N){return this._setCursor(this._activeBuffer.x,(N.params[0]||1)-1),!0}vPositionRelative(N){return this._moveCursor(0,N.params[0]||1),!0}hVPosition(N){return this.cursorPosition(N),!0}tabClear(N){const z=N.params[0];return z===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:z===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(N){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let z=N.params[0]||1;for(;z--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(N){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let z=N.params[0]||1;for(;z--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(N){const z=N.params[0];return z===1&&(this._curAttrData.bg|=536870912),z!==2&&z!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(N,z,O,H=!1,Z=!1){const ae=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);ae.replaceCells(z,O,this._activeBuffer.getNullCell(this._eraseAttrData()),Z),H&&(ae.isWrapped=!1)}_resetBufferLine(N,z=!1){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);O&&(O.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),z),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+N),O.isWrapped=!1)}eraseInDisplay(N,z=!1){let O;switch(this._restrictCursor(this._bufferService.cols),N.params[0]){case 0:for(O=this._activeBuffer.y,this._dirtyRowTracker.markDirty(O),this._eraseInBufferLine(O++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,z);O<this._bufferService.rows;O++)this._resetBufferLine(O,z);this._dirtyRowTracker.markDirty(O);break;case 1:for(O=this._activeBuffer.y,this._dirtyRowTracker.markDirty(O),this._eraseInBufferLine(O,0,this._activeBuffer.x+1,!0,z),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(O+1).isWrapped=!1);O--;)this._resetBufferLine(O,z);this._dirtyRowTracker.markDirty(0);break;case 2:for(O=this._bufferService.rows,this._dirtyRowTracker.markDirty(O-1);O--;)this._resetBufferLine(O,z);this._dirtyRowTracker.markDirty(0);break;case 3:const H=this._activeBuffer.lines.length-this._bufferService.rows;H>0&&(this._activeBuffer.lines.trimStart(H),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-H,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-H,0),this._onScroll.fire(0))}return!0}eraseInLine(N,z=!1){switch(this._restrictCursor(this._bufferService.cols),N.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,z);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,z);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,z)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(N){this._restrictCursor();let z=N.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=this._activeBuffer.ybase+this._activeBuffer.y,H=this._bufferService.rows-1-this._activeBuffer.scrollBottom,Z=this._bufferService.rows-1+this._activeBuffer.ybase-H+1;for(;z--;)this._activeBuffer.lines.splice(Z-1,1),this._activeBuffer.lines.splice(O,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(N){this._restrictCursor();let z=N.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=this._activeBuffer.ybase+this._activeBuffer.y;let H;for(H=this._bufferService.rows-1-this._activeBuffer.scrollBottom,H=this._bufferService.rows-1+this._activeBuffer.ybase-H;z--;)this._activeBuffer.lines.splice(O,1),this._activeBuffer.lines.splice(H,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(N){this._restrictCursor();const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return z&&(z.insertCells(this._activeBuffer.x,N.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(N){this._restrictCursor();const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return z&&(z.deleteCells(this._activeBuffer.x,N.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(N){let z=N.params[0]||1;for(;z--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(N){let z=N.params[0]||1;for(;z--;)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(p.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const z=N.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);H.deleteCells(0,z,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const z=N.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);H.insertCells(0,z,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const z=N.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);H.insertCells(this._activeBuffer.x,z,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const z=N.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);H.deleteCells(this._activeBuffer.x,z,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(N){this._restrictCursor();const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return z&&(z.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(N.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(N){const z=this._parser.precedingJoinState;if(!z)return!0;const O=N.params[0]||1,H=L.UnicodeService.extractWidth(z),Z=this._activeBuffer.x-H,ae=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(Z),ce=new Uint32Array(ae.length*O);let _e=0;for(let $=0;$<ae.length;){const oe=ae.codePointAt($)||0;ce[_e++]=oe,$+=oe>65535?2:1}let Q=_e;for(let $=1;$<O;++$)ce.copyWithin(Q,0,_e),Q+=_e;return this.print(ce,0,Q),!0}sendDeviceAttributesPrimary(N){return N.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(f.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(f.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(N){return N.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(f.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(f.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(N.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(f.C0.ESC+"[>83;40003;0c")),!0}_is(N){return(this._optionsService.rawOptions.termName+"").indexOf(N)===0}setMode(N){for(let z=0;z<N.length;z++)switch(N.params[z]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(N){for(let z=0;z<N.length;z++)switch(N.params[z]){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(N){for(let z=0;z<N.length;z++)switch(N.params[z]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(N){for(let z=0;z<N.length;z++)switch(N.params[z]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),N.params[z]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(N,z){const O=this._coreService.decPrivateModes,{activeProtocol:H,activeEncoding:Z}=this._coreMouseService,ae=this._coreService,{buffers:ce,cols:_e}=this._bufferService,{active:Q,alt:$}=ce,oe=this._optionsService.rawOptions,ge=Fe=>Fe?1:2,Se=N.params[0];return ye=Se,$e=z?Se===2?4:Se===4?ge(ae.modes.insertMode):Se===12?3:Se===20?ge(oe.convertEol):0:Se===1?ge(O.applicationCursorKeys):Se===3?oe.windowOptions.setWinLines?_e===80?2:_e===132?1:0:0:Se===6?ge(O.origin):Se===7?ge(O.wraparound):Se===8?3:Se===9?ge(H==="X10"):Se===12?ge(oe.cursorBlink):Se===25?ge(!ae.isCursorHidden):Se===45?ge(O.reverseWraparound):Se===66?ge(O.applicationKeypad):Se===67?4:Se===1e3?ge(H==="VT200"):Se===1002?ge(H==="DRAG"):Se===1003?ge(H==="ANY"):Se===1004?ge(O.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===$):Se===2004?ge(O.bracketedPasteMode):0,ae.triggerDataEvent(`${f.C0.ESC}[${z?"":"?"}${ye};${$e}$y`),!0;var ye,$e}_updateAttrColor(N,z,O,H,Z){return z===2?(N|=50331648,N&=-16777216,N|=T.AttributeData.fromColorRGB([O,H,Z])):z===5&&(N&=-50331904,N|=33554432|255&O),N}_extractColor(N,z,O){const H=[0,0,-1,0,0,0];let Z=0,ae=0;do{if(H[ae+Z]=N.params[z+ae],N.hasSubParams(z+ae)){const ce=N.getSubParams(z+ae);let _e=0;do H[1]===5&&(Z=1),H[ae+_e+1+Z]=ce[_e];while(++_e<ce.length&&_e+ae+1+Z<H.length);break}if(H[1]===5&&ae+Z>=2||H[1]===2&&ae+Z>=5)break;H[1]&&(Z=1)}while(++ae+z<N.length&&ae+Z<H.length);for(let ce=2;ce<H.length;++ce)H[ce]===-1&&(H[ce]=0);switch(H[0]){case 38:O.fg=this._updateAttrColor(O.fg,H[1],H[3],H[4],H[5]);break;case 48:O.bg=this._updateAttrColor(O.bg,H[1],H[3],H[4],H[5]);break;case 58:O.extended=O.extended.clone(),O.extended.underlineColor=this._updateAttrColor(O.extended.underlineColor,H[1],H[3],H[4],H[5])}return ae}_processUnderline(N,z){z.extended=z.extended.clone(),(!~N||N>5)&&(N=1),z.extended.underlineStyle=N,z.fg|=268435456,N===0&&(z.fg&=-268435457),z.updateExtended()}_processSGR0(N){N.fg=p.DEFAULT_ATTR_DATA.fg,N.bg=p.DEFAULT_ATTR_DATA.bg,N.extended=N.extended.clone(),N.extended.underlineStyle=0,N.extended.underlineColor&=-67108864,N.updateExtended()}charAttributes(N){if(N.length===1&&N.params[0]===0)return this._processSGR0(this._curAttrData),!0;const z=N.length;let O;const H=this._curAttrData;for(let Z=0;Z<z;Z++)O=N.params[Z],O>=30&&O<=37?(H.fg&=-50331904,H.fg|=16777216|O-30):O>=40&&O<=47?(H.bg&=-50331904,H.bg|=16777216|O-40):O>=90&&O<=97?(H.fg&=-50331904,H.fg|=16777224|O-90):O>=100&&O<=107?(H.bg&=-50331904,H.bg|=16777224|O-100):O===0?this._processSGR0(H):O===1?H.fg|=134217728:O===3?H.bg|=67108864:O===4?(H.fg|=268435456,this._processUnderline(N.hasSubParams(Z)?N.getSubParams(Z)[0]:1,H)):O===5?H.fg|=536870912:O===7?H.fg|=67108864:O===8?H.fg|=1073741824:O===9?H.fg|=2147483648:O===2?H.bg|=134217728:O===21?this._processUnderline(2,H):O===22?(H.fg&=-134217729,H.bg&=-134217729):O===23?H.bg&=-67108865:O===24?(H.fg&=-268435457,this._processUnderline(0,H)):O===25?H.fg&=-536870913:O===27?H.fg&=-67108865:O===28?H.fg&=-1073741825:O===29?H.fg&=2147483647:O===39?(H.fg&=-67108864,H.fg|=16777215&p.DEFAULT_ATTR_DATA.fg):O===49?(H.bg&=-67108864,H.bg|=16777215&p.DEFAULT_ATTR_DATA.bg):O===38||O===48||O===58?Z+=this._extractColor(N,Z,H):O===53?H.bg|=1073741824:O===55?H.bg&=-1073741825:O===59?(H.extended=H.extended.clone(),H.extended.underlineColor=-1,H.updateExtended()):O===100?(H.fg&=-67108864,H.fg|=16777215&p.DEFAULT_ATTR_DATA.fg,H.bg&=-67108864,H.bg|=16777215&p.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",O);return!0}deviceStatus(N){switch(N.params[0]){case 5:this._coreService.triggerDataEvent(`${f.C0.ESC}[0n`);break;case 6:const z=this._activeBuffer.y+1,O=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[${z};${O}R`)}return!0}deviceStatusPrivate(N){if(N.params[0]===6){const z=this._activeBuffer.y+1,O=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[?${z};${O}R`)}return!0}softReset(N){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=p.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(N){const z=N.params[0]||1;switch(z){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 O=z%2==1;return this._optionsService.options.cursorBlink=O,!0}setScrollRegion(N){const z=N.params[0]||1;let O;return(N.length<2||(O=N.params[1])>this._bufferService.rows||O===0)&&(O=this._bufferService.rows),O>z&&(this._activeBuffer.scrollTop=z-1,this._activeBuffer.scrollBottom=O-1,this._setCursor(0,0)),!0}windowOptions(N){if(!q(N.params[0],this._optionsService.rawOptions.windowOptions))return!0;const z=N.length>1?N.params[1]:0;switch(N.params[0]){case 14:z!==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(`${f.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:z!==0&&z!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),z!==0&&z!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:z!==0&&z!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),z!==0&&z!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(N){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(N){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(N){return this._windowTitle=N,this._onTitleChange.fire(N),!0}setIconName(N){return this._iconName=N,!0}setOrReportIndexedColor(N){const z=[],O=N.split(";");for(;O.length>1;){const H=O.shift(),Z=O.shift();if(/^\d+$/.exec(H)){const ae=parseInt(H);if(V(ae))if(Z==="?")z.push({type:0,index:ae});else{const ce=(0,B.parseColor)(Z);ce&&z.push({type:1,index:ae,color:ce})}}}return z.length&&this._onColor.fire(z),!0}setHyperlink(N){const z=N.split(";");return!(z.length<2)&&(z[1]?this._createHyperlink(z[0],z[1]):!z[0]&&this._finishHyperlink())}_createHyperlink(N,z){this._getCurrentLinkId()&&this._finishHyperlink();const O=N.split(":");let H;const Z=O.findIndex((ae=>ae.startsWith("id=")));return Z!==-1&&(H=O[Z].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:H,uri:z}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(N,z){const O=N.split(";");for(let H=0;H<O.length&&!(z>=this._specialColors.length);++H,++z)if(O[H]==="?")this._onColor.fire([{type:0,index:this._specialColors[z]}]);else{const Z=(0,B.parseColor)(O[H]);Z&&this._onColor.fire([{type:1,index:this._specialColors[z],color:Z}])}return!0}setOrReportFgColor(N){return this._setOrReportSpecialColor(N,0)}setOrReportBgColor(N){return this._setOrReportSpecialColor(N,1)}setOrReportCursorColor(N){return this._setOrReportSpecialColor(N,2)}restoreIndexedColor(N){if(!N)return this._onColor.fire([{type:2}]),!0;const z=[],O=N.split(";");for(let H=0;H<O.length;++H)if(/^\d+$/.exec(O[H])){const Z=parseInt(O[H]);V(Z)&&z.push({type:2,index:Z})}return z.length&&this._onColor.fire(z),!0}restoreFgColor(N){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(N){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(N){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,C.DEFAULT_CHARSET),!0}selectCharset(N){return N.length!==2?(this.selectDefaultCharset(),!0):(N[0]==="/"||this._charsetService.setgCharset(W[N[0]],C.CHARSETS[N[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 N=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,N,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=p.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=p.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(N){return this._charsetService.setgLevel(N),!0}screenAlignmentPattern(){const N=new v.CellData;N.content=4194373,N.fg=this._curAttrData.fg,N.bg=this._curAttrData.bg,this._setCursor(0,0);for(let z=0;z<this._bufferService.rows;++z){const O=this._activeBuffer.ybase+this._activeBuffer.y+z,H=this._activeBuffer.lines.get(O);H&&(H.fill(N),H.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(N,z){const O=this._bufferService.buffer,H=this._optionsService.rawOptions;return(Z=>(this._coreService.triggerDataEvent(`${f.C0.ESC}${Z}${f.C0.ESC}\\`),!0))(N==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:N==='"p'?'P1$r61;1"p':N==="r"?`P1$r${O.scrollTop+1};${O.scrollBottom+1}r`:N==="m"?"P1$r0m":N===" q"?`P1$r${{block:2,underline:4,bar:6}[H.cursorStyle]-(H.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(N,z){this._dirtyRowTracker.markRangeDirty(N,z)}}c.InputHandler=te;let P=class{constructor(X){this._bufferService=X,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(X){X<this.start?this.start=X:X>this.end&&(this.end=X)}markRangeDirty(X,N){X>N&&(G=X,X=N,N=G),X<this.start&&(this.start=X),N>this.end&&(this.end=N)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function V(X){return 0<=X&&X<256}P=h([b(0,R.IBufferService)],P)},844:(m,c)=>{function u(h){for(const b of h)b.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 b=this._disposables.indexOf(h);b!==-1&&this._disposables.splice(b,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(b,f,C){this._data[b]||(this._data[b]={}),this._data[b][f]=C}get(b,f){return this._data[b]?this._data[b][f]:void 0}clear(){this._data={}}}c.TwoKeyMap=u,c.FourKeyMap=class{constructor(){this._data=new u}set(h,b,f,C,E){this._data.get(h,b)||this._data.set(h,b,new u),this._data.get(h,b).set(f,C,E)}get(h,b,f,C){return this._data.get(h,b)?.get(f,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 b=u.match(/Version\/(\d+)/);return b===null||b.length<2?0:parseInt(b[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 b=this._getKey(h);if(b===void 0||(u=this._search(b),u===-1)||this._getKey(this._array[u])!==b)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])===b);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,b){if(this._array.length!==0&&(u=this._search(h),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===h))do b(this._array[u]);while(++u<this._array.length&&this._getKey(this._array[u])===h)}values(){return[...this._array].values()}_search(h){let b=0,f=this._array.length-1;for(;f>=b;){let C=b+f>>1;const E=this._getKey(this._array[C]);if(E>h)f=C-1;else{if(!(E<h)){for(;C>0&&this._getKey(this._array[C-1])===h;)C--;return C}b=C+1}}return b}}},7226:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DebouncedIdleTask=c.IdleTaskQueue=c.PriorityTaskQueue=void 0;const h=u(6114);class b{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 A=0,x=0,p=E.timeRemaining(),y=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),y=E.timeRemaining(),1.5*x>y)return p-A<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(p-A))}ms`),void this._start();p=y}this.clear()}}class f extends b{_requestCallback(E){return setTimeout((()=>E(this._createDeadline(16))))}_cancelCallback(E){clearTimeout(E)}_createDeadline(E){const A=Date.now()+E;return{timeRemaining:()=>Math.max(0,A-Date.now())}}}c.PriorityTaskQueue=f,c.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends b{_requestCallback(C){return requestIdleCallback(C)}_cancelCallback(C){cancelIdleCallback(C)}}:f,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(b){const f=b.buffer.lines.get(b.buffer.ybase+b.buffer.y-1),C=f?.get(b.cols-1),E=b.buffer.lines.get(b.buffer.ybase+b.buffer.y);E&&C&&(E.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(f){return[f>>>16&255,f>>>8&255,255&f]}static fromColorRGB(f){return(255&f[0])<<16|(255&f[1])<<8|255&f[2]}clone(){const f=new u;return f.fg=this.fg,f.bg=this.bg,f.extended=this.extended.clone(),f}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}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(f){this._ext=f}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(f){this._ext&=-469762049,this._ext|=f<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(f){this._ext&=-67108864,this._ext|=67108863&f}get urlId(){return this._urlId}set urlId(f){this._urlId=f}get underlineVariantOffset(){const f=(3758096384&this._ext)>>29;return f<0?4294967288^f:f}set underlineVariantOffset(f){this._ext&=536870911,this._ext|=f<<29&3758096384}constructor(f=0,C=0){this._ext=0,this._urlId=0,this._ext=f,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),b=u(7226),f=u(3734),C=u(8437),E=u(4634),A=u(511),x=u(643),p=u(4863),y=u(7116);c.MAX_BUFFER_SIZE=4294967295,c.Buffer=class{constructor(d,v,T){this._hasScrollback=d,this._optionsService=v,this._bufferService=T,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=y.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 b.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(d){return d?(this._nullCell.fg=d.fg,this._nullCell.bg=d.bg,this._nullCell.extended=d.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new f.ExtendedAttrs),this._nullCell}getWhitespaceCell(d){return d?(this._whitespaceCell.fg=d.fg,this._whitespaceCell.bg=d.bg,this._whitespaceCell.extended=d.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new f.ExtendedAttrs),this._whitespaceCell}getBlankLine(d,v){return new C.BufferLine(this._bufferService.cols,this.getNullCell(d),v)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const d=this.ybase+this.y-this.ydisp;return d>=0&&d<this._rows}_getCorrectBufferLength(d){if(!this._hasScrollback)return d;const v=d+this._optionsService.rawOptions.scrollback;return v>c.MAX_BUFFER_SIZE?c.MAX_BUFFER_SIZE:v}fillViewportRows(d){if(this.lines.length===0){d===void 0&&(d=C.DEFAULT_ATTR_DATA);let v=this._rows;for(;v--;)this.lines.push(this.getBlankLine(d))}}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(d,v){const T=this.getNullCell(C.DEFAULT_ATTR_DATA);let R=0;const L=this._getCorrectBufferLength(v);if(L>this.lines.maxLength&&(this.lines.maxLength=L),this.lines.length>0){if(this._cols<d)for(let k=0;k<this.lines.length;k++)R+=+this.lines.get(k).resize(d,T);let M=0;if(this._rows<v)for(let k=this._rows;k<v;k++)this.lines.length<v+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(d,T)):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(d,T)));else for(let k=this._rows;k>v;k--)this.lines.length>v+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(L<this.lines.maxLength){const k=this.lines.length-L;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=L}this.x=Math.min(this.x,d-1),this.y=Math.min(this.y,v-1),M&&(this.y+=M),this.savedX=Math.min(this.savedX,d-1),this.scrollTop=0}if(this.scrollBottom=v-1,this._isReflowEnabled&&(this._reflow(d,v),this._cols>d))for(let M=0;M<this.lines.length;M++)R+=+this.lines.get(M).resize(d,T);this._cols=d,this._rows=v,this._memoryCleanupQueue.clear(),R>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let d=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,d=!1);let v=0;for(;this._memoryCleanupPosition<this.lines.length;)if(v+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),v>100)return!0;return d}get _isReflowEnabled(){const d=this._optionsService.rawOptions.windowsPty;return d&&d.buildNumber?this._hasScrollback&&d.backend==="conpty"&&d.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(d,v){this._cols!==d&&(d>this._cols?this._reflowLarger(d,v):this._reflowSmaller(d,v))}_reflowLarger(d,v){const T=(0,E.reflowLargerGetLinesToRemove)(this.lines,this._cols,d,this.ybase+this.y,this.getNullCell(C.DEFAULT_ATTR_DATA));if(T.length>0){const R=(0,E.reflowLargerCreateNewLayout)(this.lines,T);(0,E.reflowLargerApplyNewLayout)(this.lines,R.layout),this._reflowLargerAdjustViewport(d,v,R.countRemoved)}}_reflowLargerAdjustViewport(d,v,T){const R=this.getNullCell(C.DEFAULT_ATTR_DATA);let L=T;for(;L-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<v&&this.lines.push(new C.BufferLine(d,R))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-T,0)}_reflowSmaller(d,v){const T=this.getNullCell(C.DEFAULT_ATTR_DATA),R=[];let L=0;for(let M=this.lines.length-1;M>=0;M--){let k=this.lines.get(M);if(!k||!k.isWrapped&&k.getTrimmedLength()<=d)continue;const B=[k];for(;k.isWrapped&&M>0;)k=this.lines.get(--M),B.unshift(k);const W=this.ybase+this.y;if(W>=M&&W<M+B.length)continue;const F=B[B.length-1].getTrimmedLength(),q=(0,E.reflowSmallerGetNewLineLengths)(B,this._cols,d),I=q.length-B.length;let G;G=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 O=0;O<I;O++){const H=this.getBlankLine(C.DEFAULT_ATTR_DATA,!0);te.push(H)}te.length>0&&(R.push({start:M+B.length+L,newLines:te}),L+=te.length),B.push(...te);let P=q.length-1,V=q[P];V===0&&(P--,V=q[P]);let X=B.length-I-1,N=F;for(;X>=0;){const O=Math.min(N,V);if(B[P]===void 0)break;if(B[P].copyCellsFrom(B[X],N-O,V-O,O,!0),V-=O,V===0&&(P--,V=q[P]),N-=O,N===0){X--;const H=Math.max(X,0);N=(0,E.getWrappedLineTrimmedLength)(B,H,this._cols)}}for(let O=0;O<B.length;O++)q[O]<d&&B[O].setCell(q[O],T);let z=I-G;for(;z-- >0;)this.ybase===0?this.y<v-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+L)-v&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+I,this.ybase+v-1)}if(R.length>0){const M=[],k=[];for(let P=0;P<this.lines.length;P++)k.push(this.lines.get(P));const B=this.lines.length;let W=B-1,F=0,q=R[F];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+L);let I=0;for(let P=Math.min(this.lines.maxLength-1,B+L-1);P>=0;P--)if(q&&q.start>W+I){for(let V=q.newLines.length-1;V>=0;V--)this.lines.set(P--,q.newLines[V]);P++,M.push({index:W+1,amount:q.newLines.length}),I+=q.newLines.length,q=R[++F]}else this.lines.set(P,k[W--]);let G=0;for(let P=M.length-1;P>=0;P--)M[P].index+=G,this.lines.onInsertEmitter.fire(M[P]),G+=M[P].amount;const te=Math.max(0,B+L-this.lines.maxLength);te>0&&this.lines.onTrimEmitter.fire(te)}}translateBufferLineToString(d,v,T=0,R){const L=this.lines.get(d);return L?L.translateToString(v,T,R):""}getWrappedRangeForLine(d){let v=d,T=d;for(;v>0&&this.lines.get(v).isWrapped;)v--;for(;T+1<this.lines.length&&this.lines.get(T+1).isWrapped;)T++;return{first:v,last:T}}setupTabStops(d){for(d!=null?this.tabs[d]||(d=this.prevStop(d)):(this.tabs={},d=0);d<this._cols;d+=this._optionsService.rawOptions.tabStopWidth)this.tabs[d]=!0}prevStop(d){for(d==null&&(d=this.x);!this.tabs[--d]&&d>0;);return d>=this._cols?this._cols-1:d<0?0:d}nextStop(d){for(d==null&&(d=this.x);!this.tabs[++d]&&d<this._cols;);return d>=this._cols?this._cols-1:d<0?0:d}clearMarkers(d){this._isClearing=!0;for(let v=0;v<this.markers.length;v++)this.markers[v].line===d&&(this.markers[v].dispose(),this.markers.splice(v--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let d=0;d<this.markers.length;d++)this.markers[d].dispose(),this.markers.splice(d--,1);this._isClearing=!1}addMarker(d){const v=new p.Marker(d);return this.markers.push(v),v.register(this.lines.onTrim((T=>{v.line-=T,v.line<0&&v.dispose()}))),v.register(this.lines.onInsert((T=>{v.line>=T.index&&(v.line+=T.amount)}))),v.register(this.lines.onDelete((T=>{v.line>=T.index&&v.line<T.index+T.amount&&v.dispose(),v.line>T.index&&(v.line-=T.amount)}))),v.register(v.onDispose((()=>this._removeMarker(v)))),v}_removeMarker(d){this._isClearing||this.markers.splice(this.markers.indexOf(d),1)}}},8437:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferLine=c.DEFAULT_ATTR_DATA=void 0;const h=u(3734),b=u(511),f=u(643),C=u(482);c.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let E=0;class A{constructor(p,y,d=!1){this.isWrapped=d,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*p);const v=y||b.CellData.fromCharData([0,f.NULL_CELL_CHAR,f.NULL_CELL_WIDTH,f.NULL_CELL_CODE]);for(let T=0;T<p;++T)this.setCell(T,v);this.length=p}get(p){const y=this._data[3*p+0],d=2097151&y;return[this._data[3*p+1],2097152&y?this._combined[p]:d?(0,C.stringFromCodePoint)(d):"",y>>22,2097152&y?this._combined[p].charCodeAt(this._combined[p].length-1):d]}set(p,y){this._data[3*p+1]=y[f.CHAR_DATA_ATTR_INDEX],y[f.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[p]=y[1],this._data[3*p+0]=2097152|p|y[f.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*p+0]=y[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|y[f.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(p){return this._data[3*p+0]>>22}hasWidth(p){return 12582912&this._data[3*p+0]}getFg(p){return this._data[3*p+1]}getBg(p){return this._data[3*p+2]}hasContent(p){return 4194303&this._data[3*p+0]}getCodePoint(p){const y=this._data[3*p+0];return 2097152&y?this._combined[p].charCodeAt(this._combined[p].length-1):2097151&y}isCombined(p){return 2097152&this._data[3*p+0]}getString(p){const y=this._data[3*p+0];return 2097152&y?this._combined[p]:2097151&y?(0,C.stringFromCodePoint)(2097151&y):""}isProtected(p){return 536870912&this._data[3*p+2]}loadCell(p,y){return E=3*p,y.content=this._data[E+0],y.fg=this._data[E+1],y.bg=this._data[E+2],2097152&y.content&&(y.combinedData=this._combined[p]),268435456&y.bg&&(y.extended=this._extendedAttrs[p]),y}setCell(p,y){2097152&y.content&&(this._combined[p]=y.combinedData),268435456&y.bg&&(this._extendedAttrs[p]=y.extended),this._data[3*p+0]=y.content,this._data[3*p+1]=y.fg,this._data[3*p+2]=y.bg}setCellFromCodepoint(p,y,d,v){268435456&v.bg&&(this._extendedAttrs[p]=v.extended),this._data[3*p+0]=y|d<<22,this._data[3*p+1]=v.fg,this._data[3*p+2]=v.bg}addCodepointToCell(p,y,d){let v=this._data[3*p+0];2097152&v?this._combined[p]+=(0,C.stringFromCodePoint)(y):2097151&v?(this._combined[p]=(0,C.stringFromCodePoint)(2097151&v)+(0,C.stringFromCodePoint)(y),v&=-2097152,v|=2097152):v=y|4194304,d&&(v&=-12582913,v|=d<<22),this._data[3*p+0]=v}insertCells(p,y,d){if((p%=this.length)&&this.getWidth(p-1)===2&&this.setCellFromCodepoint(p-1,0,1,d),y<this.length-p){const v=new b.CellData;for(let T=this.length-p-y-1;T>=0;--T)this.setCell(p+y+T,this.loadCell(p+T,v));for(let T=0;T<y;++T)this.setCell(p+T,d)}else for(let v=p;v<this.length;++v)this.setCell(v,d);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,d)}deleteCells(p,y,d){if(p%=this.length,y<this.length-p){const v=new b.CellData;for(let T=0;T<this.length-p-y;++T)this.setCell(p+T,this.loadCell(p+y+T,v));for(let T=this.length-y;T<this.length;++T)this.setCell(T,d)}else for(let v=p;v<this.length;++v)this.setCell(v,d);p&&this.getWidth(p-1)===2&&this.setCellFromCodepoint(p-1,0,1,d),this.getWidth(p)!==0||this.hasContent(p)||this.setCellFromCodepoint(p,0,1,d)}replaceCells(p,y,d,v=!1){if(v)for(p&&this.getWidth(p-1)===2&&!this.isProtected(p-1)&&this.setCellFromCodepoint(p-1,0,1,d),y<this.length&&this.getWidth(y-1)===2&&!this.isProtected(y)&&this.setCellFromCodepoint(y,0,1,d);p<y&&p<this.length;)this.isProtected(p)||this.setCell(p,d),p++;else for(p&&this.getWidth(p-1)===2&&this.setCellFromCodepoint(p-1,0,1,d),y<this.length&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y,0,1,d);p<y&&p<this.length;)this.setCell(p++,d)}resize(p,y){if(p===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const d=3*p;if(p>this.length){if(this._data.buffer.byteLength>=4*d)this._data=new Uint32Array(this._data.buffer,0,d);else{const v=new Uint32Array(d);v.set(this._data),this._data=v}for(let v=this.length;v<p;++v)this.setCell(v,y)}else{this._data=this._data.subarray(0,d);const v=Object.keys(this._combined);for(let R=0;R<v.length;R++){const L=parseInt(v[R],10);L>=p&&delete this._combined[L]}const T=Object.keys(this._extendedAttrs);for(let R=0;R<T.length;R++){const L=parseInt(T[R],10);L>=p&&delete this._extendedAttrs[L]}}return this.length=p,4*d*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const p=new Uint32Array(this._data.length);return p.set(this._data),this._data=p,1}return 0}fill(p,y=!1){if(y)for(let d=0;d<this.length;++d)this.isProtected(d)||this.setCell(d,p);else{this._combined={},this._extendedAttrs={};for(let d=0;d<this.length;++d)this.setCell(d,p)}}copyFrom(p){this.length!==p.length?this._data=new Uint32Array(p._data):this._data.set(p._data),this.length=p.length,this._combined={};for(const y in p._combined)this._combined[y]=p._combined[y];this._extendedAttrs={};for(const y in p._extendedAttrs)this._extendedAttrs[y]=p._extendedAttrs[y];this.isWrapped=p.isWrapped}clone(){const p=new A(0);p._data=new Uint32Array(this._data),p.length=this.length;for(const y in this._combined)p._combined[y]=this._combined[y];for(const y in this._extendedAttrs)p._extendedAttrs[y]=this._extendedAttrs[y];return p.isWrapped=this.isWrapped,p}getTrimmedLength(){for(let p=this.length-1;p>=0;--p)if(4194303&this._data[3*p+0])return p+(this._data[3*p+0]>>22);return 0}getNoBgTrimmedLength(){for(let p=this.length-1;p>=0;--p)if(4194303&this._data[3*p+0]||50331648&this._data[3*p+2])return p+(this._data[3*p+0]>>22);return 0}copyCellsFrom(p,y,d,v,T){const R=p._data;if(T)for(let M=v-1;M>=0;M--){for(let k=0;k<3;k++)this._data[3*(d+M)+k]=R[3*(y+M)+k];268435456&R[3*(y+M)+2]&&(this._extendedAttrs[d+M]=p._extendedAttrs[y+M])}else for(let M=0;M<v;M++){for(let k=0;k<3;k++)this._data[3*(d+M)+k]=R[3*(y+M)+k];268435456&R[3*(y+M)+2]&&(this._extendedAttrs[d+M]=p._extendedAttrs[y+M])}const L=Object.keys(p._combined);for(let M=0;M<L.length;M++){const k=parseInt(L[M],10);k>=y&&(this._combined[k-y+d]=p._combined[k])}}translateToString(p,y,d,v){y=y??0,d=d??this.length,p&&(d=Math.min(d,this.getTrimmedLength())),v&&(v.length=0);let T="";for(;y<d;){const R=this._data[3*y+0],L=2097151&R,M=2097152&R?this._combined[y]:L?(0,C.stringFromCodePoint)(L):f.WHITESPACE_CELL_CHAR;if(T+=M,v)for(let k=0;k<M.length;++k)v.push(y);y+=R>>22||1}return v&&v.push(y),T}}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,b,f){if(b===h.length-1)return h[b].getTrimmedLength();const C=!h[b].hasContent(f-1)&&h[b].getWidth(f-1)===1,E=h[b+1].getWidth(0)===2;return C&&E?f-1:f}Object.defineProperty(c,"__esModule",{value:!0}),c.getWrappedLineTrimmedLength=c.reflowSmallerGetNewLineLengths=c.reflowLargerApplyNewLayout=c.reflowLargerCreateNewLayout=c.reflowLargerGetLinesToRemove=void 0,c.reflowLargerGetLinesToRemove=function(h,b,f,C,E){const A=[];for(let x=0;x<h.length-1;x++){let p=x,y=h.get(++p);if(!y.isWrapped)continue;const d=[h.get(x)];for(;p<h.length&&y.isWrapped;)d.push(y),y=h.get(++p);if(C>=x&&C<p){x+=d.length-1;continue}let v=0,T=u(d,v,b),R=1,L=0;for(;R<d.length;){const k=u(d,R,b),B=k-L,W=f-T,F=Math.min(B,W);d[v].copyCellsFrom(d[R],L,T,F,!1),T+=F,T===f&&(v++,T=0),L+=F,L===k&&(R++,L=0),T===0&&v!==0&&d[v-1].getWidth(f-1)===2&&(d[v].copyCellsFrom(d[v-1],f-1,T++,1,!1),d[v-1].setCell(f-1,E))}d[v].replaceCells(T,f,E);let M=0;for(let k=d.length-1;k>0&&(k>v||d[k].getTrimmedLength()===0);k--)M++;M>0&&(A.push(x+d.length-M),A.push(M)),x+=d.length-1}return A},c.reflowLargerCreateNewLayout=function(h,b){const f=[];let C=0,E=b[C],A=0;for(let x=0;x<h.length;x++)if(E===x){const p=b[++C];h.onDeleteEmitter.fire({index:x-A,amount:p}),x+=p-1,A+=p,E=b[++C]}else f.push(x);return{layout:f,countRemoved:A}},c.reflowLargerApplyNewLayout=function(h,b){const f=[];for(let C=0;C<b.length;C++)f.push(h.get(b[C]));for(let C=0;C<f.length;C++)h.set(C,f[C]);h.length=b.length},c.reflowSmallerGetNewLineLengths=function(h,b,f){const C=[],E=h.map(((y,d)=>u(h,d,b))).reduce(((y,d)=>y+d));let A=0,x=0,p=0;for(;p<E;){if(E-p<f){C.push(E-p);break}A+=f;const y=u(h,x,b);A>y&&(A-=y,x++);const d=h[x].getWidth(A-1)===2;d&&A--;const v=d?f-1:f;C.push(v),p+=v}return C},c.getWrappedLineTrimmedLength=u},5295:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferSet=void 0;const h=u(8460),b=u(844),f=u(9092);class C extends b.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 f.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new f.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(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),b=u(643),f=u(3734);class C extends f.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new f.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[b.CHAR_DATA_ATTR_INDEX],this.bg=0;let x=!1;if(A[b.CHAR_DATA_CHAR_INDEX].length>2)x=!0;else if(A[b.CHAR_DATA_CHAR_INDEX].length===2){const p=A[b.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=p&&p<=56319){const y=A[b.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=y&&y<=57343?this.content=1024*(p-55296)+y-56320+65536|A[b.CHAR_DATA_WIDTH_INDEX]<<22:x=!0}else x=!0}else this.content=A[b.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|A[b.CHAR_DATA_WIDTH_INDEX]<<22;x&&(this.combinedData=A[b.CHAR_DATA_CHAR_INDEX],this.content=2097152|A[b.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),b=u(844);class f{get id(){return this._id}constructor(E){this.line=E,this.isDisposed=!1,this._disposables=[],this._id=f._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,b.disposeArray)(this._disposables),this._disposables.length=0)}register(E){return this._disposables.push(E),E}}c.Marker=f,f._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,b;Object.defineProperty(c,"__esModule",{value:!0}),c.C1_ESCAPED=c.C1=c.C0=void 0,(function(f){f.NUL="\0",f.SOH="",f.STX="",f.ETX="",f.EOT="",f.ENQ="",f.ACK="",f.BEL="\x07",f.BS="\b",f.HT=" ",f.LF=`
|
|
82
|
+
`,f.VT="\v",f.FF="\f",f.CR="\r",f.SO="",f.SI="",f.DLE="",f.DC1="",f.DC2="",f.DC3="",f.DC4="",f.NAK="",f.SYN="",f.ETB="",f.CAN="",f.EM="",f.SUB="",f.ESC="\x1B",f.FS="",f.GS="",f.RS="",f.US="",f.SP=" ",f.DEL=""})(u||(c.C0=u={})),(function(f){f.PAD="",f.HOP="",f.BPH="",f.NBH="",f.IND="",f.NEL="
",f.SSA="",f.ESA="",f.HTS="",f.HTJ="",f.VTS="",f.PLD="",f.PLU="",f.RI="",f.SS2="",f.SS3="",f.DCS="",f.PU1="",f.PU2="",f.STS="",f.CCH="",f.MW="",f.SPA="",f.EPA="",f.SOS="",f.SGCI="",f.SCI="",f.CSI="",f.ST="",f.OSC="",f.PM="",f.APC=""})(h||(c.C1=h={})),(function(f){f.ST=`${u.ESC}\\`})(b||(c.C1_ESCAPED=b={}))},7399:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.evaluateKeyboardEvent=void 0;const h=u(2584),b={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(f,C,E,A){const x={type:0,cancel:!1,key:void 0},p=(f.shiftKey?1:0)|(f.altKey?2:0)|(f.ctrlKey?4:0)|(f.metaKey?8:0);switch(f.keyCode){case 0:f.key==="UIKeyInputUpArrow"?x.key=C?h.C0.ESC+"OA":h.C0.ESC+"[A":f.key==="UIKeyInputLeftArrow"?x.key=C?h.C0.ESC+"OD":h.C0.ESC+"[D":f.key==="UIKeyInputRightArrow"?x.key=C?h.C0.ESC+"OC":h.C0.ESC+"[C":f.key==="UIKeyInputDownArrow"&&(x.key=C?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:x.key=f.ctrlKey?"\b":h.C0.DEL,f.altKey&&(x.key=h.C0.ESC+x.key);break;case 9:if(f.shiftKey){x.key=h.C0.ESC+"[Z";break}x.key=h.C0.HT,x.cancel=!0;break;case 13:x.key=f.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,x.cancel=!0;break;case 27:x.key=h.C0.ESC,f.altKey&&(x.key=h.C0.ESC+h.C0.ESC),x.cancel=!0;break;case 37:if(f.metaKey)break;p?(x.key=h.C0.ESC+"[1;"+(p+1)+"D",x.key===h.C0.ESC+"[1;3D"&&(x.key=h.C0.ESC+(E?"b":"[1;5D"))):x.key=C?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(f.metaKey)break;p?(x.key=h.C0.ESC+"[1;"+(p+1)+"C",x.key===h.C0.ESC+"[1;3C"&&(x.key=h.C0.ESC+(E?"f":"[1;5C"))):x.key=C?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(f.metaKey)break;p?(x.key=h.C0.ESC+"[1;"+(p+1)+"A",E||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(f.metaKey)break;p?(x.key=h.C0.ESC+"[1;"+(p+1)+"B",E||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:f.shiftKey||f.ctrlKey||(x.key=h.C0.ESC+"[2~");break;case 46:x.key=p?h.C0.ESC+"[3;"+(p+1)+"~":h.C0.ESC+"[3~";break;case 36:x.key=p?h.C0.ESC+"[1;"+(p+1)+"H":C?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:x.key=p?h.C0.ESC+"[1;"+(p+1)+"F":C?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:f.shiftKey?x.type=2:f.ctrlKey?x.key=h.C0.ESC+"[5;"+(p+1)+"~":x.key=h.C0.ESC+"[5~";break;case 34:f.shiftKey?x.type=3:f.ctrlKey?x.key=h.C0.ESC+"[6;"+(p+1)+"~":x.key=h.C0.ESC+"[6~";break;case 112:x.key=p?h.C0.ESC+"[1;"+(p+1)+"P":h.C0.ESC+"OP";break;case 113:x.key=p?h.C0.ESC+"[1;"+(p+1)+"Q":h.C0.ESC+"OQ";break;case 114:x.key=p?h.C0.ESC+"[1;"+(p+1)+"R":h.C0.ESC+"OR";break;case 115:x.key=p?h.C0.ESC+"[1;"+(p+1)+"S":h.C0.ESC+"OS";break;case 116:x.key=p?h.C0.ESC+"[15;"+(p+1)+"~":h.C0.ESC+"[15~";break;case 117:x.key=p?h.C0.ESC+"[17;"+(p+1)+"~":h.C0.ESC+"[17~";break;case 118:x.key=p?h.C0.ESC+"[18;"+(p+1)+"~":h.C0.ESC+"[18~";break;case 119:x.key=p?h.C0.ESC+"[19;"+(p+1)+"~":h.C0.ESC+"[19~";break;case 120:x.key=p?h.C0.ESC+"[20;"+(p+1)+"~":h.C0.ESC+"[20~";break;case 121:x.key=p?h.C0.ESC+"[21;"+(p+1)+"~":h.C0.ESC+"[21~";break;case 122:x.key=p?h.C0.ESC+"[23;"+(p+1)+"~":h.C0.ESC+"[23~";break;case 123:x.key=p?h.C0.ESC+"[24;"+(p+1)+"~":h.C0.ESC+"[24~";break;default:if(!f.ctrlKey||f.shiftKey||f.altKey||f.metaKey)if(E&&!A||!f.altKey||f.metaKey)!E||f.altKey||f.ctrlKey||f.shiftKey||!f.metaKey?f.key&&!f.ctrlKey&&!f.altKey&&!f.metaKey&&f.keyCode>=48&&f.key.length===1?x.key=f.key:f.key&&f.ctrlKey&&(f.key==="_"&&(x.key=h.C0.US),f.key==="@"&&(x.key=h.C0.NUL)):f.keyCode===65&&(x.type=1);else{const y=b[f.keyCode],d=y?.[f.shiftKey?1:0];if(d)x.key=h.C0.ESC+d;else if(f.keyCode>=65&&f.keyCode<=90){const v=f.ctrlKey?f.keyCode-64:f.keyCode+32;let T=String.fromCharCode(v);f.shiftKey&&(T=T.toUpperCase()),x.key=h.C0.ESC+T}else if(f.keyCode===32)x.key=h.C0.ESC+(f.ctrlKey?h.C0.NUL:" ");else if(f.key==="Dead"&&f.code.startsWith("Key")){let v=f.code.slice(3,4);f.shiftKey||(v=v.toLowerCase()),x.key=h.C0.ESC+v,x.cancel=!0}}else f.keyCode>=65&&f.keyCode<=90?x.key=String.fromCharCode(f.keyCode-64):f.keyCode===32?x.key=h.C0.NUL:f.keyCode>=51&&f.keyCode<=55?x.key=String.fromCharCode(f.keyCode-51+27):f.keyCode===56?x.key=h.C0.DEL:f.keyCode===219?x.key=h.C0.ESC:f.keyCode===220?x.key=h.C0.FS:f.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,b=u.length){let f="";for(let C=h;C<b;++C){let E=u[C];E>65535?(E-=65536,f+=String.fromCharCode(55296+(E>>10))+String.fromCharCode(E%1024+56320)):f+=String.fromCharCode(E)}return f},c.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,h){const b=u.length;if(!b)return 0;let f=0,C=0;if(this._interim){const E=u.charCodeAt(C++);56320<=E&&E<=57343?h[f++]=1024*(this._interim-55296)+E-56320+65536:(h[f++]=this._interim,h[f++]=E),this._interim=0}for(let E=C;E<b;++E){const A=u.charCodeAt(E);if(55296<=A&&A<=56319){if(++E>=b)return this._interim=A,f;const x=u.charCodeAt(E);56320<=x&&x<=57343?h[f++]=1024*(A-55296)+x-56320+65536:(h[f++]=A,h[f++]=x)}else A!==65279&&(h[f++]=A)}return f}},c.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,h){const b=u.length;if(!b)return 0;let f,C,E,A,x=0,p=0,y=0;if(this.interim[0]){let T=!1,R=this.interim[0];R&=(224&R)==192?31:(240&R)==224?15:7;let L,M=0;for(;(L=63&this.interim[++M])&&M<4;)R<<=6,R|=L;const k=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,B=k-M;for(;y<B;){if(y>=b)return 0;if(L=u[y++],(192&L)!=128){y--,T=!0;break}this.interim[M++]=L,R<<=6,R|=63&L}T||(k===2?R<128?y--:h[x++]=R:k===3?R<2048||R>=55296&&R<=57343||R===65279||(h[x++]=R):R<65536||R>1114111||(h[x++]=R)),this.interim.fill(0)}const d=b-4;let v=y;for(;v<b;){for(;!(!(v<d)||128&(f=u[v])||128&(C=u[v+1])||128&(E=u[v+2])||128&(A=u[v+3]));)h[x++]=f,h[x++]=C,h[x++]=E,h[x++]=A,v+=4;if(f=u[v++],f<128)h[x++]=f;else if((224&f)==192){if(v>=b)return this.interim[0]=f,x;if(C=u[v++],(192&C)!=128){v--;continue}if(p=(31&f)<<6|63&C,p<128){v--;continue}h[x++]=p}else if((240&f)==224){if(v>=b)return this.interim[0]=f,x;if(C=u[v++],(192&C)!=128){v--;continue}if(v>=b)return this.interim[0]=f,this.interim[1]=C,x;if(E=u[v++],(192&E)!=128){v--;continue}if(p=(15&f)<<12|(63&C)<<6|63&E,p<2048||p>=55296&&p<=57343||p===65279)continue;h[x++]=p}else if((248&f)==240){if(v>=b)return this.interim[0]=f,x;if(C=u[v++],(192&C)!=128){v--;continue}if(v>=b)return this.interim[0]=f,this.interim[1]=C,x;if(E=u[v++],(192&E)!=128){v--;continue}if(v>=b)return this.interim[0]=f,this.interim[1]=C,this.interim[2]=E,x;if(A=u[v++],(192&A)!=128){v--;continue}if(p=(7&f)<<18|(63&C)<<12|(63&E)<<6|63&A,p<65536||p>1114111)continue;h[x++]=p}}return x}}},225:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeV6=void 0;const h=u(1480),b=[[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]],f=[[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 E=0;E<b.length;++E)C.fill(0,b[E][0],b[E][1]+1)}}wcwidth(E){return E<32?0:E<127?1:E<65536?C[E]:(function(A,x){let p,y=0,d=x.length-1;if(A<x[0][0]||A>x[d][1])return!1;for(;d>=y;)if(p=y+d>>1,A>x[p][1])y=p+1;else{if(!(A<x[p][0]))return!0;d=p-1}return!1})(E,f)?0:E>=131072&&E<=196605||E>=196608&&E<=262141?2:1}charProperties(E,A){let x=this.wcwidth(E),p=x===0&&A!==0;if(p){const y=h.UnicodeService.extractWidth(A);y===0?p=!1:y>x&&(x=y)}return h.UnicodeService.createPropertyValue(0,x,p)}}},5981:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.WriteBuffer=void 0;const h=u(8460),b=u(844);class f extends b.Disposable{constructor(E){super(),this._action=E,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(E,A){if(A!==void 0&&this._syncCalls>A)return void(this._syncCalls=0);if(this._pendingData+=E.length,this._writeBuffer.push(E),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let x;for(this._isSyncWriting=!0;x=this._writeBuffer.shift();){this._action(x);const p=this._callbacks.shift();p&&p()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(E,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+=E.length,this._writeBuffer.push(E),this._callbacks.push(A),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=E.length,this._writeBuffer.push(E),this._callbacks.push(A)}_innerWrite(E=0,A=!0){const x=E||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const p=this._writeBuffer[this._bufferOffset],y=this._action(p,A);if(y){const v=T=>Date.now()-x>=12?setTimeout((()=>this._innerWrite(0,T))):this._innerWrite(x,T);return void y.catch((T=>(queueMicrotask((()=>{throw T})),Promise.resolve(!1)))).then(v)}const d=this._callbacks[this._bufferOffset];if(d&&d(),this._bufferOffset++,this._pendingData-=p.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=f},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 b(f,C){const E=f.toString(16),A=E.length<2?"0"+E:E;switch(C){case 4:return E[0];case 8:return A;case 12:return(A+A).slice(0,3);default:return A+A}}c.parseColor=function(f){if(!f)return;let C=f.toLowerCase();if(C.indexOf("rgb:")===0){C=C.slice(4);const E=u.exec(C);if(E){const A=E[1]?15:E[4]?255:E[7]?4095:65535;return[Math.round(parseInt(E[1]||E[4]||E[7]||E[10],16)/A*255),Math.round(parseInt(E[2]||E[5]||E[8]||E[11],16)/A*255),Math.round(parseInt(E[3]||E[6]||E[9]||E[12],16)/A*255)]}}else if(C.indexOf("#")===0&&(C=C.slice(1),h.exec(C)&&[3,6,9,12].includes(C.length))){const E=C.length/3,A=[0,0,0];for(let x=0;x<3;++x){const p=parseInt(C.slice(E*x,E*x+E),16);A[x]=E===1?p<<4:E===2?p:E===3?p>>4:p>>8}return A}},c.toRgbString=function(f,C=16){const[E,A,x]=f;return`rgb:${b(E,C)}/${b(A,C)}/${b(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),b=u(8742),f=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 p=this._handlers[A];return p.push(x),{dispose:()=>{const y=p.indexOf(x);y!==-1&&p.splice(y,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 p=this._active.length-1;p>=0;p--)this._active[p].hook(x);else this._handlerFb(this._ident,"HOOK",x)}put(A,x,p){if(this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].put(A,x,p);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(A,x,p))}unhook(A,x=!0){if(this._active.length){let p=!1,y=this._active.length-1,d=!1;if(this._stack.paused&&(y=this._stack.loopPosition-1,p=x,d=this._stack.fallThrough,this._stack.paused=!1),!d&&p===!1){for(;y>=0&&(p=this._active[y].unhook(A),p!==!0);y--)if(p instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!1,p;y--}for(;y>=0;y--)if(p=this._active[y].unhook(!1),p instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!0,p}else this._handlerFb(this._ident,"UNHOOK",A);this._active=C,this._ident=0}};const E=new b.Params;E.addParam(0),c.DcsHandler=class{constructor(A){this._handler=A,this._data="",this._params=E,this._hitLimit=!1}hook(A){this._params=A.length>1||A.params[0]?A.clone():E,this._data="",this._hitLimit=!1}put(A,x,p){this._hitLimit||(this._data+=(0,h.utf32ToString)(A,x,p),this._data.length>f.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((p=>(this._params=E,this._data="",this._hitLimit=!1,p)));return this._params=E,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),b=u(8742),f=u(6242),C=u(6351);class E{constructor(y){this.table=new Uint8Array(y)}setDefault(y,d){this.table.fill(y<<4|d)}add(y,d,v,T){this.table[d<<8|y]=v<<4|T}addMany(y,d,v,T){for(let R=0;R<y.length;R++)this.table[d<<8|y[R]]=v<<4|T}}c.TransitionTable=E;const A=160;c.VT500_TRANSITION_TABLE=(function(){const p=new E(4095),y=Array.apply(null,Array(256)).map(((M,k)=>k)),d=(M,k)=>y.slice(M,k),v=d(32,127),T=d(0,24);T.push(25),T.push.apply(T,d(28,32));const R=d(0,14);let L;for(L in p.setDefault(1,0),p.addMany(v,0,2,0),R)p.addMany([24,26,153,154],L,3,0),p.addMany(d(128,144),L,3,0),p.addMany(d(144,152),L,3,0),p.add(156,L,0,0),p.add(27,L,11,1),p.add(157,L,4,8),p.addMany([152,158,159],L,0,7),p.add(155,L,11,3),p.add(144,L,11,9);return p.addMany(T,0,3,0),p.addMany(T,1,3,1),p.add(127,1,0,1),p.addMany(T,8,0,8),p.addMany(T,3,3,3),p.add(127,3,0,3),p.addMany(T,4,3,4),p.add(127,4,0,4),p.addMany(T,6,3,6),p.addMany(T,5,3,5),p.add(127,5,0,5),p.addMany(T,2,3,2),p.add(127,2,0,2),p.add(93,1,4,8),p.addMany(v,8,5,8),p.add(127,8,5,8),p.addMany([156,27,24,26,7],8,6,0),p.addMany(d(28,32),8,0,8),p.addMany([88,94,95],1,0,7),p.addMany(v,7,0,7),p.addMany(T,7,0,7),p.add(156,7,0,0),p.add(127,7,0,7),p.add(91,1,11,3),p.addMany(d(64,127),3,7,0),p.addMany(d(48,60),3,8,4),p.addMany([60,61,62,63],3,9,4),p.addMany(d(48,60),4,8,4),p.addMany(d(64,127),4,7,0),p.addMany([60,61,62,63],4,0,6),p.addMany(d(32,64),6,0,6),p.add(127,6,0,6),p.addMany(d(64,127),6,0,0),p.addMany(d(32,48),3,9,5),p.addMany(d(32,48),5,9,5),p.addMany(d(48,64),5,0,6),p.addMany(d(64,127),5,7,0),p.addMany(d(32,48),4,9,5),p.addMany(d(32,48),1,9,2),p.addMany(d(32,48),2,9,2),p.addMany(d(48,127),2,10,0),p.addMany(d(48,80),1,10,0),p.addMany(d(81,88),1,10,0),p.addMany([89,90,92],1,10,0),p.addMany(d(96,127),1,10,0),p.add(80,1,11,9),p.addMany(T,9,0,9),p.add(127,9,0,9),p.addMany(d(28,32),9,0,9),p.addMany(d(32,48),9,9,12),p.addMany(d(48,60),9,8,10),p.addMany([60,61,62,63],9,9,10),p.addMany(T,11,0,11),p.addMany(d(32,128),11,0,11),p.addMany(d(28,32),11,0,11),p.addMany(T,10,0,10),p.add(127,10,0,10),p.addMany(d(28,32),10,0,10),p.addMany(d(48,60),10,8,10),p.addMany([60,61,62,63],10,0,11),p.addMany(d(32,48),10,9,12),p.addMany(T,12,0,12),p.add(127,12,0,12),p.addMany(d(28,32),12,0,12),p.addMany(d(32,48),12,9,12),p.addMany(d(48,64),12,0,11),p.addMany(d(64,127),12,12,13),p.addMany(d(64,127),10,12,13),p.addMany(d(64,127),9,12,13),p.addMany(T,13,13,13),p.addMany(v,13,13,13),p.add(127,13,0,13),p.addMany([27,156,24,26],13,14,0),p.add(A,0,2,0),p.add(A,8,5,8),p.add(A,6,0,6),p.add(A,11,0,11),p.add(A,13,13,13),p})();class x extends h.Disposable{constructor(y=c.VT500_TRANSITION_TABLE){super(),this._transitions=y,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new b.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(d,v,T)=>{},this._executeHandlerFb=d=>{},this._csiHandlerFb=(d,v)=>{},this._escHandlerFb=d=>{},this._errorHandlerFb=d=>d,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 f.OscParser),this._dcsParser=this.register(new C.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(y,d=[64,126]){let v=0;if(y.prefix){if(y.prefix.length>1)throw new Error("only one byte as prefix supported");if(v=y.prefix.charCodeAt(0),v&&60>v||v>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(y.intermediates){if(y.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let R=0;R<y.intermediates.length;++R){const L=y.intermediates.charCodeAt(R);if(32>L||L>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");v<<=8,v|=L}}if(y.final.length!==1)throw new Error("final must be a single byte");const T=y.final.charCodeAt(0);if(d[0]>T||T>d[1])throw new Error(`final must be in range ${d[0]} .. ${d[1]}`);return v<<=8,v|=T,v}identToString(y){const d=[];for(;y;)d.push(String.fromCharCode(255&y)),y>>=8;return d.reverse().join("")}setPrintHandler(y){this._printHandler=y}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(y,d){const v=this._identifier(y,[48,126]);this._escHandlers[v]===void 0&&(this._escHandlers[v]=[]);const T=this._escHandlers[v];return T.push(d),{dispose:()=>{const R=T.indexOf(d);R!==-1&&T.splice(R,1)}}}clearEscHandler(y){this._escHandlers[this._identifier(y,[48,126])]&&delete this._escHandlers[this._identifier(y,[48,126])]}setEscHandlerFallback(y){this._escHandlerFb=y}setExecuteHandler(y,d){this._executeHandlers[y.charCodeAt(0)]=d}clearExecuteHandler(y){this._executeHandlers[y.charCodeAt(0)]&&delete this._executeHandlers[y.charCodeAt(0)]}setExecuteHandlerFallback(y){this._executeHandlerFb=y}registerCsiHandler(y,d){const v=this._identifier(y);this._csiHandlers[v]===void 0&&(this._csiHandlers[v]=[]);const T=this._csiHandlers[v];return T.push(d),{dispose:()=>{const R=T.indexOf(d);R!==-1&&T.splice(R,1)}}}clearCsiHandler(y){this._csiHandlers[this._identifier(y)]&&delete this._csiHandlers[this._identifier(y)]}setCsiHandlerFallback(y){this._csiHandlerFb=y}registerDcsHandler(y,d){return this._dcsParser.registerHandler(this._identifier(y),d)}clearDcsHandler(y){this._dcsParser.clearHandler(this._identifier(y))}setDcsHandlerFallback(y){this._dcsParser.setHandlerFallback(y)}registerOscHandler(y,d){return this._oscParser.registerHandler(y,d)}clearOscHandler(y){this._oscParser.clearHandler(y)}setOscHandlerFallback(y){this._oscParser.setHandlerFallback(y)}setErrorHandler(y){this._errorHandler=y}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(y,d,v,T,R){this._parseStack.state=y,this._parseStack.handlers=d,this._parseStack.handlerPos=v,this._parseStack.transition=T,this._parseStack.chunkPos=R}parse(y,d,v){let T,R=0,L=0,M=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,M=this._parseStack.chunkPos+1;else{if(v===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 B=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(v===!1&&B>-1){for(;B>=0&&(T=k[B](this._params),T!==!0);B--)if(T instanceof Promise)return this._parseStack.handlerPos=B,T}this._parseStack.handlers=[];break;case 4:if(v===!1&&B>-1){for(;B>=0&&(T=k[B](),T!==!0);B--)if(T instanceof Promise)return this._parseStack.handlerPos=B,T}this._parseStack.handlers=[];break;case 6:if(R=y[this._parseStack.chunkPos],T=this._dcsParser.unhook(R!==24&&R!==26,v),T)return T;R===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(R=y[this._parseStack.chunkPos],T=this._oscParser.end(R!==24&&R!==26,v),T)return T;R===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<d;++k){switch(R=y[k],L=this._transitions.table[this.currentState<<8|(R<160?R:A)],L>>4){case 2:for(let I=k+1;;++I){if(I>=d||(R=y[I])<32||R>126&&R<A){this._printHandler(y,k,I),k=I-1;break}if(++I>=d||(R=y[I])<32||R>126&&R<A){this._printHandler(y,k,I),k=I-1;break}if(++I>=d||(R=y[I])<32||R>126&&R<A){this._printHandler(y,k,I),k=I-1;break}if(++I>=d||(R=y[I])<32||R>126&&R<A){this._printHandler(y,k,I),k=I-1;break}}break;case 3:this._executeHandlers[R]?this._executeHandlers[R]():this._executeHandlerFb(R),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:k,code:R,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const B=this._csiHandlers[this._collect<<8|R];let W=B?B.length-1:-1;for(;W>=0&&(T=B[W](this._params),T!==!0);W--)if(T instanceof Promise)return this._preserveStack(3,B,W,L,k),T;W<0&&this._csiHandlerFb(this._collect<<8|R,this._params),this.precedingJoinState=0;break;case 8:do switch(R){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(R-48)}while(++k<d&&(R=y[k])>47&&R<60);k--;break;case 9:this._collect<<=8,this._collect|=R;break;case 10:const F=this._escHandlers[this._collect<<8|R];let q=F?F.length-1:-1;for(;q>=0&&(T=F[q](),T!==!0);q--)if(T instanceof Promise)return this._preserveStack(4,F,q,L,k),T;q<0&&this._escHandlerFb(this._collect<<8|R),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|R,this._params);break;case 13:for(let I=k+1;;++I)if(I>=d||(R=y[I])===24||R===26||R===27||R>127&&R<A){this._dcsParser.put(y,k,I),k=I-1;break}break;case 14:if(T=this._dcsParser.unhook(R!==24&&R!==26),T)return this._preserveStack(6,[],0,L,k),T;R===27&&(L|=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>=d||(R=y[I])<32||R>127&&R<A){this._oscParser.put(y,k,I),k=I-1;break}break;case 6:if(T=this._oscParser.end(R!==24&&R!==26),T)return this._preserveStack(5,[],0,L,k),T;R===27&&(L|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&L}}}c.EscapeSequenceParser=x},6242:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.OscHandler=c.OscParser=void 0;const h=u(5770),b=u(482),f=[];c.OscParser=class{constructor(){this._state=0,this._active=f,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(C,E){this._handlers[C]===void 0&&(this._handlers[C]=[]);const A=this._handlers[C];return A.push(E),{dispose:()=>{const x=A.indexOf(E);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=f}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=f,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||f,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,E,A){if(this._active.length)for(let x=this._active.length-1;x>=0;x--)this._active[x].put(C,E,A);else this._handlerFb(this._id,"PUT",(0,b.utf32ToString)(C,E,A))}start(){this.reset(),this._state=1}put(C,E,A){if(this._state!==3){if(this._state===1)for(;E<A;){const x=C[E++];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-E>0&&this._put(C,E,A)}}end(C,E=!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,p=!1;if(this._stack.paused&&(x=this._stack.loopPosition-1,A=E,p=this._stack.fallThrough,this._stack.paused=!1),!p&&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=f,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,E,A){this._hitLimit||(this._data+=(0,b.utf32ToString)(C,E,A),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(C){let E=!1;if(this._hitLimit)E=!1;else if(C&&(E=this._handler(this._data),E instanceof Promise))return E.then((A=>(this._data="",this._hitLimit=!1,A)));return this._data="",this._hitLimit=!1,E}}},8742:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Params=void 0;const u=2147483647;class h{static fromArray(f){const C=new h;if(!f.length)return C;for(let E=Array.isArray(f[0])?1:0;E<f.length;++E){const A=f[E];if(Array.isArray(A))for(let x=0;x<A.length;++x)C.addSubParam(A[x]);else C.addParam(A)}return C}constructor(f=32,C=32){if(this.maxLength=f,this.maxSubParamsLength=C,C>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(f),this.length=0,this._subParams=new Int32Array(C),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(f),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const f=new h(this.maxLength,this.maxSubParamsLength);return f.params.set(this.params),f.length=this.length,f._subParams.set(this._subParams),f._subParamsLength=this._subParamsLength,f._subParamsIdx.set(this._subParamsIdx),f._rejectDigits=this._rejectDigits,f._rejectSubDigits=this._rejectSubDigits,f._digitIsSub=this._digitIsSub,f}toArray(){const f=[];for(let C=0;C<this.length;++C){f.push(this.params[C]);const E=this._subParamsIdx[C]>>8,A=255&this._subParamsIdx[C];A-E>0&&f.push(Array.prototype.slice.call(this._subParams,E,A))}return f}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(f){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=f>u?u:f}}addSubParam(f){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=f>u?u:f,this._subParamsIdx[this.length-1]++}}hasSubParams(f){return(255&this._subParamsIdx[f])-(this._subParamsIdx[f]>>8)>0}getSubParams(f){const C=this._subParamsIdx[f]>>8,E=255&this._subParamsIdx[f];return E-C>0?this._subParams.subarray(C,E):null}getSubParamsAll(){const f={};for(let C=0;C<this.length;++C){const E=this._subParamsIdx[C]>>8,A=255&this._subParamsIdx[C];A-E>0&&(f[C]=this._subParams.slice(E,A))}return f}addDigit(f){let C;if(this._rejectDigits||!(C=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const E=this._digitIsSub?this._subParams:this.params,A=E[C-1];E[C-1]=~A?Math.min(10*A+f,u):f}}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 b={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(b),h.dispose=()=>this._wrappedAddonDispose(b),h.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let h=-1;for(let b=0;b<this._addons.length;b++)if(this._addons[b]===u){h=b;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),b=u(511);c.BufferApiView=class{constructor(f,C){this._buffer=f,this.type=C}init(f){return this._buffer=f,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(f){const C=this._buffer.lines.get(f);if(C)return new h.BufferLineApiView(C)}getNullCell(){return new b.CellData}}},3785:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferLineApiView=void 0;const h=u(511);c.BufferLineApiView=class{constructor(b){this._line=b}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(b,f){if(!(b<0||b>=this._line.length))return f?(this._line.loadCell(b,f),f):this._line.loadCell(b,new h.CellData)}translateToString(b,f,C){return this._line.translateToString(b,f,C)}}},8285:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferNamespaceApi=void 0;const h=u(8771),b=u(8460),f=u(844);class C extends f.Disposable{constructor(A){super(),this._core=A,this._onBufferChange=this.register(new b.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,(b=>h(b.toArray())))}addCsiHandler(u,h){return this.registerCsiHandler(u,h)}registerDcsHandler(u,h){return this._core.registerDcsHandler(u,((b,f)=>h(b,f.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(p,y,d,v){var T,R=arguments.length,L=R<3?y:v===null?v=Object.getOwnPropertyDescriptor(y,d):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(p,y,d,v);else for(var M=p.length-1;M>=0;M--)(T=p[M])&&(L=(R<3?T(L):R>3?T(y,d,L):T(y,d))||L);return R>3&&L&&Object.defineProperty(y,d,L),L},b=this&&this.__param||function(p,y){return function(d,v){y(d,v,p)}};Object.defineProperty(c,"__esModule",{value:!0}),c.BufferService=c.MINIMUM_ROWS=c.MINIMUM_COLS=void 0;const f=u(8460),C=u(844),E=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(p){super(),this.isUserScrolling=!1,this._onResize=this.register(new f.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new f.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(p.rawOptions.cols||0,c.MINIMUM_COLS),this.rows=Math.max(p.rawOptions.rows||0,c.MINIMUM_ROWS),this.buffers=this.register(new E.BufferSet(p,this))}resize(p,y){this.cols=p,this.rows=y,this.buffers.resize(p,y),this._onResize.fire({cols:p,rows:y})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(p,y=!1){const d=this.buffer;let v;v=this._cachedBlankLine,v&&v.length===this.cols&&v.getFg(0)===p.fg&&v.getBg(0)===p.bg||(v=d.getBlankLine(p,y),this._cachedBlankLine=v),v.isWrapped=y;const T=d.ybase+d.scrollTop,R=d.ybase+d.scrollBottom;if(d.scrollTop===0){const L=d.lines.isFull;R===d.lines.length-1?L?d.lines.recycle().copyFrom(v):d.lines.push(v.clone()):d.lines.splice(R+1,0,v.clone()),L?this.isUserScrolling&&(d.ydisp=Math.max(d.ydisp-1,0)):(d.ybase++,this.isUserScrolling||d.ydisp++)}else{const L=R-T+1;d.lines.shiftElements(T+1,L-1,-1),d.lines.set(R,v.clone())}this.isUserScrolling||(d.ydisp=d.ybase),this._onScroll.fire(d.ydisp)}scrollLines(p,y,d){const v=this.buffer;if(p<0){if(v.ydisp===0)return;this.isUserScrolling=!0}else p+v.ydisp>=v.ybase&&(this.isUserScrolling=!1);const T=v.ydisp;v.ydisp=Math.max(Math.min(v.ydisp+p,v.ybase),0),T!==v.ydisp&&(y||this._onScroll.fire(v.ydisp))}};c.BufferService=x=h([b(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(v,T,R,L){var M,k=arguments.length,B=k<3?T:L===null?L=Object.getOwnPropertyDescriptor(T,R):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(v,T,R,L);else for(var W=v.length-1;W>=0;W--)(M=v[W])&&(B=(k<3?M(B):k>3?M(T,R,B):M(T,R))||B);return k>3&&B&&Object.defineProperty(T,R,B),B},b=this&&this.__param||function(v,T){return function(R,L){T(R,L,v)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreMouseService=void 0;const f=u(2585),C=u(8460),E=u(844),A={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:v=>v.button!==4&&v.action===1&&(v.ctrl=!1,v.alt=!1,v.shift=!1,!0)},VT200:{events:19,restrict:v=>v.action!==32},DRAG:{events:23,restrict:v=>v.action!==32||v.button!==3},ANY:{events:31,restrict:v=>!0}};function x(v,T){let R=(v.ctrl?16:0)|(v.shift?4:0)|(v.alt?8:0);return v.button===4?(R|=64,R|=v.action):(R|=3&v.button,4&v.button&&(R|=64),8&v.button&&(R|=128),v.action===32?R|=32:v.action!==0||T||(R|=3)),R}const p=String.fromCharCode,y={DEFAULT:v=>{const T=[x(v,!1)+32,v.col+32,v.row+32];return T[0]>255||T[1]>255||T[2]>255?"":`\x1B[M${p(T[0])}${p(T[1])}${p(T[2])}`},SGR:v=>{const T=v.action===0&&v.button!==4?"m":"M";return`\x1B[<${x(v,!0)};${v.col};${v.row}${T}`},SGR_PIXELS:v=>{const T=v.action===0&&v.button!==4?"m":"M";return`\x1B[<${x(v,!0)};${v.x};${v.y}${T}`}};let d=c.CoreMouseService=class extends E.Disposable{constructor(v,T){super(),this._bufferService=v,this._coreService=T,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 R of Object.keys(A))this.addProtocol(R,A[R]);for(const R of Object.keys(y))this.addEncoding(R,y[R]);this.reset()}addProtocol(v,T){this._protocols[v]=T}addEncoding(v,T){this._encodings[v]=T}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(v){if(!this._protocols[v])throw new Error(`unknown protocol "${v}"`);this._activeProtocol=v,this._onProtocolChange.fire(this._protocols[v].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(v){if(!this._encodings[v])throw new Error(`unknown encoding "${v}"`);this._activeEncoding=v}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(v){if(v.col<0||v.col>=this._bufferService.cols||v.row<0||v.row>=this._bufferService.rows||v.button===4&&v.action===32||v.button===3&&v.action!==32||v.button!==4&&(v.action===2||v.action===3)||(v.col++,v.row++,v.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,v,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(v))return!1;const T=this._encodings[this._activeEncoding](v);return T&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(T):this._coreService.triggerDataEvent(T,!0)),this._lastEvent=v,!0}explainEvents(v){return{down:!!(1&v),up:!!(2&v),drag:!!(4&v),move:!!(8&v),wheel:!!(16&v)}}_equalEvents(v,T,R){if(R){if(v.x!==T.x||v.y!==T.y)return!1}else if(v.col!==T.col||v.row!==T.row)return!1;return v.button===T.button&&v.action===T.action&&v.ctrl===T.ctrl&&v.alt===T.alt&&v.shift===T.shift}};c.CoreMouseService=d=h([b(0,f.IBufferService),b(1,f.ICoreService)],d)},6975:function(m,c,u){var h=this&&this.__decorate||function(d,v,T,R){var L,M=arguments.length,k=M<3?v:R===null?R=Object.getOwnPropertyDescriptor(v,T):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(d,v,T,R);else for(var B=d.length-1;B>=0;B--)(L=d[B])&&(k=(M<3?L(k):M>3?L(v,T,k):L(v,T))||k);return M>3&&k&&Object.defineProperty(v,T,k),k},b=this&&this.__param||function(d,v){return function(T,R){v(T,R,d)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreService=void 0;const f=u(1439),C=u(8460),E=u(844),A=u(2585),x=Object.freeze({insertMode:!1}),p=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let y=c.CoreService=class extends E.Disposable{constructor(d,v,T){super(),this._bufferService=d,this._logService=v,this._optionsService=T,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,f.clone)(x),this.decPrivateModes=(0,f.clone)(p)}reset(){this.modes=(0,f.clone)(x),this.decPrivateModes=(0,f.clone)(p)}triggerDataEvent(d,v=!1){if(this._optionsService.rawOptions.disableStdin)return;const T=this._bufferService.buffer;v&&this._optionsService.rawOptions.scrollOnUserInput&&T.ybase!==T.ydisp&&this._onRequestScrollToBottom.fire(),v&&this._onUserInput.fire(),this._logService.debug(`sending data "${d}"`,(()=>d.split("").map((R=>R.charCodeAt(0))))),this._onData.fire(d)}triggerBinaryEvent(d){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${d}"`,(()=>d.split("").map((v=>v.charCodeAt(0))))),this._onBinary.fire(d))}};c.CoreService=y=h([b(0,A.IBufferService),b(1,A.ILogService),b(2,A.IOptionsService)],y)},9074:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DecorationService=void 0;const h=u(8055),b=u(8460),f=u(844),C=u(6106);let E=0,A=0;class x extends f.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new C.SortedList((d=>d?.marker.line)),this._onDecorationRegistered=this.register(new b.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new b.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,f.toDisposable)((()=>this.reset())))}registerDecoration(d){if(d.marker.isDisposed)return;const v=new p(d);if(v){const T=v.marker.onDispose((()=>v.dispose()));v.onDispose((()=>{v&&(this._decorations.delete(v)&&this._onDecorationRemoved.fire(v),T.dispose())})),this._decorations.insert(v),this._onDecorationRegistered.fire(v)}return v}reset(){for(const d of this._decorations.values())d.dispose();this._decorations.clear()}*getDecorationsAtCell(d,v,T){let R=0,L=0;for(const M of this._decorations.getKeyIterator(v))R=M.options.x??0,L=R+(M.options.width??1),d>=R&&d<L&&(!T||(M.options.layer??"bottom")===T)&&(yield M)}forEachDecorationAtCell(d,v,T,R){this._decorations.forEachByKey(v,(L=>{E=L.options.x??0,A=E+(L.options.width??1),d>=E&&d<A&&(!T||(L.options.layer??"bottom")===T)&&R(L)}))}}c.DecorationService=x;class p extends f.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(d){super(),this.options=d,this.onRenderEmitter=this.register(new b.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new b.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=d.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),b=u(8343);class f{constructor(...E){this._entries=new Map;for(const[A,x]of E)this.set(A,x)}set(E,A){const x=this._entries.get(E);return this._entries.set(E,A),x}forEach(E){for(const[A,x]of this._entries.entries())E(A,x)}has(E){return this._entries.has(E)}get(E){return this._entries.get(E)}}c.ServiceCollection=f,c.InstantiationService=class{constructor(){this._services=new f,this._services.set(h.IInstantiationService,this)}setService(C,E){this._services.set(C,E)}getService(C){return this._services.get(C)}createInstance(C,...E){const A=(0,b.getServiceDependencies)(C).sort(((y,d)=>y.index-d.index)),x=[];for(const y of A){const d=this._services.get(y.id);if(!d)throw new Error(`[createInstance] ${C.name} depends on UNKNOWN service ${y.id}.`);x.push(d)}const p=A.length>0?A[0].index:E.length;if(E.length!==p)throw new Error(`[createInstance] First service dependency of ${C.name} at position ${p+1} conflicts with ${E.length} static arguments`);return new C(...E,...x)}}},7866:function(m,c,u){var h=this&&this.__decorate||function(p,y,d,v){var T,R=arguments.length,L=R<3?y:v===null?v=Object.getOwnPropertyDescriptor(y,d):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(p,y,d,v);else for(var M=p.length-1;M>=0;M--)(T=p[M])&&(L=(R<3?T(L):R>3?T(y,d,L):T(y,d))||L);return R>3&&L&&Object.defineProperty(y,d,L),L},b=this&&this.__param||function(p,y){return function(d,v){y(d,v,p)}};Object.defineProperty(c,"__esModule",{value:!0}),c.traceCall=c.setTraceLogger=c.LogService=void 0;const f=u(844),C=u(2585),E={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 f.Disposable{get logLevel(){return this._logLevel}constructor(p){super(),this._optionsService=p,this._logLevel=C.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),A=this}_updateLogLevel(){this._logLevel=E[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(p){for(let y=0;y<p.length;y++)typeof p[y]=="function"&&(p[y]=p[y]())}_log(p,y,d){this._evalLazyOptionalParams(d),p.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+y,...d)}trace(p,...y){this._logLevel<=C.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,p,y)}debug(p,...y){this._logLevel<=C.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,p,y)}info(p,...y){this._logLevel<=C.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,p,y)}warn(p,...y){this._logLevel<=C.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,p,y)}error(p,...y){this._logLevel<=C.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,p,y)}};c.LogService=x=h([b(0,C.IOptionsService)],x),c.setTraceLogger=function(p){A=p},c.traceCall=function(p,y,d){if(typeof d.value!="function")throw new Error("not supported");const v=d.value;d.value=function(...T){if(A.logLevel!==C.LogLevelEnum.TRACE)return v.apply(this,T);A.trace(`GlyphRenderer#${v.name}(${T.map((L=>JSON.stringify(L))).join(", ")})`);const R=v.apply(this,T);return A.trace(`GlyphRenderer#${v.name} return`,R),R}}},7302:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.OptionsService=c.DEFAULT_OPTIONS=void 0;const h=u(8460),b=u(844),f=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:f.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 E extends b.Disposable{constructor(x){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const p={...c.DEFAULT_OPTIONS};for(const y in x)if(y in p)try{const d=x[y];p[y]=this._sanitizeAndValidateOption(y,d)}catch(d){console.error(d)}this.rawOptions=p,this.options={...p},this._setupOptions(),this.register((0,b.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(x,p){return this.onOptionChange((y=>{y===x&&p(this.rawOptions[x])}))}onMultipleOptionChange(x,p){return this.onOptionChange((y=>{x.indexOf(y)!==-1&&p()}))}_setupOptions(){const x=y=>{if(!(y in c.DEFAULT_OPTIONS))throw new Error(`No option with key "${y}"`);return this.rawOptions[y]},p=(y,d)=>{if(!(y in c.DEFAULT_OPTIONS))throw new Error(`No option with key "${y}"`);d=this._sanitizeAndValidateOption(y,d),this.rawOptions[y]!==d&&(this.rawOptions[y]=d,this._onOptionChange.fire(y))};for(const y in this.rawOptions){const d={get:x.bind(this,y),set:p.bind(this,y)};Object.defineProperty(this.options,y,d)}}_sanitizeAndValidateOption(x,p){switch(x){case"cursorStyle":if(p||(p=c.DEFAULT_OPTIONS[x]),!(function(y){return y==="block"||y==="underline"||y==="bar"})(p))throw new Error(`"${p}" is not a valid value for ${x}`);break;case"wordSeparator":p||(p=c.DEFAULT_OPTIONS[x]);break;case"fontWeight":case"fontWeightBold":if(typeof p=="number"&&1<=p&&p<=1e3)break;p=C.includes(p)?p:c.DEFAULT_OPTIONS[x];break;case"cursorWidth":p=Math.floor(p);case"lineHeight":case"tabStopWidth":if(p<1)throw new Error(`${x} cannot be less than 1, value: ${p}`);break;case"minimumContrastRatio":p=Math.max(1,Math.min(21,Math.round(10*p)/10));break;case"scrollback":if((p=Math.min(p,4294967295))<0)throw new Error(`${x} cannot be less than 0, value: ${p}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(p<=0)throw new Error(`${x} cannot be less than or equal to 0, value: ${p}`);break;case"rows":case"cols":if(!p&&p!==0)throw new Error(`${x} must be numeric, value: ${p}`);break;case"windowsPty":p=p??{}}return p}}c.OptionsService=E},2660:function(m,c,u){var h=this&&this.__decorate||function(E,A,x,p){var y,d=arguments.length,v=d<3?A:p===null?p=Object.getOwnPropertyDescriptor(A,x):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(E,A,x,p);else for(var T=E.length-1;T>=0;T--)(y=E[T])&&(v=(d<3?y(v):d>3?y(A,x,v):y(A,x))||v);return d>3&&v&&Object.defineProperty(A,x,v),v},b=this&&this.__param||function(E,A){return function(x,p){A(x,p,E)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OscLinkService=void 0;const f=u(2585);let C=c.OscLinkService=class{constructor(E){this._bufferService=E,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(E){const A=this._bufferService.buffer;if(E.id===void 0){const T=A.addMarker(A.ybase+A.y),R={data:E,id:this._nextId++,lines:[T]};return T.onDispose((()=>this._removeMarkerFromLink(R,T))),this._dataByLinkId.set(R.id,R),R.id}const x=E,p=this._getEntryIdKey(x),y=this._entriesWithId.get(p);if(y)return this.addLineToLink(y.id,A.ybase+A.y),y.id;const d=A.addMarker(A.ybase+A.y),v={id:this._nextId++,key:this._getEntryIdKey(x),data:x,lines:[d]};return d.onDispose((()=>this._removeMarkerFromLink(v,d))),this._entriesWithId.set(v.key,v),this._dataByLinkId.set(v.id,v),v.id}addLineToLink(E,A){const x=this._dataByLinkId.get(E);if(x&&x.lines.every((p=>p.line!==A))){const p=this._bufferService.buffer.addMarker(A);x.lines.push(p),p.onDispose((()=>this._removeMarkerFromLink(x,p)))}}getLinkData(E){return this._dataByLinkId.get(E)?.data}_getEntryIdKey(E){return`${E.id};;${E.uri}`}_removeMarkerFromLink(E,A){const x=E.lines.indexOf(A);x!==-1&&(E.lines.splice(x,1),E.lines.length===0&&(E.data.id!==void 0&&this._entriesWithId.delete(E.key),this._dataByLinkId.delete(E.id)))}};c.OscLinkService=C=h([b(0,f.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(b){return b[h]||[]},c.createDecorator=function(b){if(c.serviceRegistry.has(b))return c.serviceRegistry.get(b);const f=function(C,E,A){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(x,p,y){p[u]===p?p[h].push({id:x,index:y}):(p[h]=[{id:x,index:y}],p[u]=p)})(f,C,A)};return f.toString=()=>b,c.serviceRegistry.set(b,f),f}},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 b;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(f){f[f.TRACE=0]="TRACE",f[f.DEBUG=1]="DEBUG",f[f.INFO=2]="INFO",f[f.WARN=3]="WARN",f[f.ERROR=4]="ERROR",f[f.OFF=5]="OFF"})(b||(c.LogLevelEnum=b={})),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),b=u(225);class f{static extractShouldJoin(E){return(1&E)!=0}static extractWidth(E){return E>>1&3}static extractCharKind(E){return E>>3}static createPropertyValue(E,A,x=!1){return(16777215&E)<<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 E=new b.UnicodeV6;this.register(E),this._active=E.version,this._activeProvider=E}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(E){if(!this._providers[E])throw new Error(`unknown Unicode version "${E}"`);this._active=E,this._activeProvider=this._providers[E],this._onChange.fire(E)}register(E){this._providers[E.version]=E}wcwidth(E){return this._activeProvider.wcwidth(E)}getStringCellWidth(E){let A=0,x=0;const p=E.length;for(let y=0;y<p;++y){let d=E.charCodeAt(y);if(55296<=d&&d<=56319){if(++y>=p)return A+this.wcwidth(d);const R=E.charCodeAt(y);56320<=R&&R<=57343?d=1024*(d-55296)+R-56320+65536:A+=this.wcwidth(R)}const v=this.charProperties(d,x);let T=f.extractWidth(v);f.extractShouldJoin(v)&&(T-=f.extractWidth(x)),A+=T,x=v}return A}charProperties(E,A){return this._activeProvider.charProperties(E,A)}}c.UnicodeService=f}},a={};function o(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,o),u.exports}var _={};return(()=>{var m=_;Object.defineProperty(m,"__esModule",{value:!0}),m.Terminal=void 0;const c=o(9042),u=o(3236),h=o(844),b=o(5741),f=o(8285),C=o(7975),E=o(7090),A=["cols","rows"];class x extends h.Disposable{constructor(y){super(),this._core=this.register(new u.Terminal(y)),this._addonManager=this.register(new b.AddonManager),this._publicOptions={...this._core.options};const d=T=>this._core.options[T],v=(T,R)=>{this._checkReadonlyOptions(T),this._core.options[T]=R};for(const T in this._core.options){const R={get:d.bind(this,T),set:v.bind(this,T)};Object.defineProperty(this._publicOptions,T,R)}}_checkReadonlyOptions(y){if(A.includes(y))throw new Error(`Option "${y}" 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 E.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new f.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const y=this._core.coreService.decPrivateModes;let d="none";switch(this._core.coreMouseService.activeProtocol){case"X10":d="x10";break;case"VT200":d="vt200";break;case"DRAG":d="drag";break;case"ANY":d="any"}return{applicationCursorKeysMode:y.applicationCursorKeys,applicationKeypadMode:y.applicationKeypad,bracketedPasteMode:y.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:d,originMode:y.origin,reverseWraparoundMode:y.reverseWraparound,sendFocusMode:y.sendFocus,wraparoundMode:y.wraparound}}get options(){return this._publicOptions}set options(y){for(const d in y)this._publicOptions[d]=y[d]}blur(){this._core.blur()}focus(){this._core.focus()}input(y,d=!0){this._core.input(y,d)}resize(y,d){this._verifyIntegers(y,d),this._core.resize(y,d)}open(y){this._core.open(y)}attachCustomKeyEventHandler(y){this._core.attachCustomKeyEventHandler(y)}attachCustomWheelEventHandler(y){this._core.attachCustomWheelEventHandler(y)}registerLinkProvider(y){return this._core.registerLinkProvider(y)}registerCharacterJoiner(y){return this._checkProposedApi(),this._core.registerCharacterJoiner(y)}deregisterCharacterJoiner(y){this._checkProposedApi(),this._core.deregisterCharacterJoiner(y)}registerMarker(y=0){return this._verifyIntegers(y),this._core.registerMarker(y)}registerDecoration(y){return this._checkProposedApi(),this._verifyPositiveIntegers(y.x??0,y.width??0,y.height??0),this._core.registerDecoration(y)}hasSelection(){return this._core.hasSelection()}select(y,d,v){this._verifyIntegers(y,d,v),this._core.select(y,d,v)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(y,d){this._verifyIntegers(y,d),this._core.selectLines(y,d)}dispose(){super.dispose()}scrollLines(y){this._verifyIntegers(y),this._core.scrollLines(y)}scrollPages(y){this._verifyIntegers(y),this._core.scrollPages(y)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(y){this._verifyIntegers(y),this._core.scrollToLine(y)}clear(){this._core.clear()}write(y,d){this._core.write(y,d)}writeln(y,d){this._core.write(y),this._core.write(`\r
|
|
83
|
+
`,d)}paste(y){this._core.paste(y)}refresh(y,d){this._verifyIntegers(y,d),this._core.refresh(y,d)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(y){this._addonManager.loadAddon(this,y)}static get strings(){return c}_verifyIntegers(...y){for(const d of y)if(d===1/0||isNaN(d)||d%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...y){for(const d of y)if(d&&(d===1/0||isNaN(d)||d%1!=0||d<0))throw new Error("This API only accepts positive integers")}}m.Terminal=x})(),_})()))})(ep)),ep.exports}var l3=o3();function GS(){return U.useSyncExternalStore(TT,pb,pb)}const Vb=250,c3=5e3,Yb=1,u3=4e3,h3=4001;function d3(e){const i=new AbortController,r=new TextEncoder;let a=Vb,o=null,_=null,m=null,c=!1;const u=()=>{_?.dispose(),_=null},h=(C,E)=>{m={cols:C,rows:E},o?.readyState===Yb&&o.send(JSON.stringify({type:"resize",cols:C,rows:E}))},b=async()=>{for(;!i.signal.aborted;){e.onStatus?.("connecting");try{const C=e.fetchTicket??iT,{ticket:E}=await C(e.sessionId,{kind:e.kind,theaterId:e.theaterId,signal:i.signal});if(i.signal.aborted)return;await f(f3(E,e.location),e),a=Vb}catch(C){if(i.signal.aborted)return;e.onStatus?.("connecting",C instanceof Error?C.message:String(C))}await g3(a,i.signal),a=Math.min(a*2,c3)}},f=async(C,E)=>{await new Promise((A,x)=>{const p=(E.webSocketFactory??p3)(C);o=p,p.binaryType="arraybuffer",p.onopen=()=>{E.onStatus?.("live"),u(),_=E.terminal.onData(y=>{p.readyState===Yb&&p.send(r.encode(y))}),m&&h(m.cols,m.rows)},p.onmessage=y=>{y.data instanceof ArrayBuffer&&E.terminal.write(new Uint8Array(y.data))},p.onerror=()=>{x(new Error("Terminal WebSocket error"))},p.onclose=y=>{u(),o===p&&(o=null);const d=y?.code;d===u3?i.abort():d===h3&&(i.abort(),E.onExit?.()),A()}})};return{start:()=>{c||(c=!0,b())},resize:h,dispose:()=>{i.abort(),u(),e.onStatus?.("closed"),o?.close(),o=null}}}function f3(e,i=window.location){return`${i.protocol==="https:"?"wss":"ws"}://${i.host}/terminal/ws?ticket=${encodeURIComponent(e)}`}function p3(e){return new WebSocket(e)}async function g3(e,i){await new Promise(r=>{const a=()=>{clearTimeout(o),i.removeEventListener("abort",a),r()},o=setTimeout(a,e);i.addEventListener("abort",a)})}const m3={allowProposedApi:!0,convertEol:!0,cursorBlink:!0,cursorStyle:"block",fontFamily:'"Cascadia Code", "Cascadia Mono", "JetBrains Mono Variable", ui-monospace, "SF Mono", Menlo, monospace',fontSize:14,lineHeight:1.2},_3=80,v3={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)"},b3={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 gh({sessionId:e,kind:i,theaterId:r,onExit:a,active:o}){const{activeTheme:_,terminalRenderer:m}=GS(),c=U.useRef(null),u=U.useRef(null),h=U.useRef(null),b=U.useRef(null),f=U.useRef(a);f.current=a;const C=U.useRef(o);C.current=o;const[E,A]=U.useState("connecting");U.useEffect(()=>{const p=c.current;if(!p)return;let y=!1;const d=new l3.Terminal({...m3,theme:Xb(_)});u.current=d;const v=new wA.FitAddon;d.loadAddon(v),d.open(p),d.loadAddon(new EA.Unicode11Addon),d.unicode.activeVersion="11",d.attachCustomKeyEventHandler(F=>F.key==="Enter"&&F.shiftKey?(F.type==="keydown"&&d.input(`
|
|
84
|
+
`),!1):!0);const T=d3({sessionId:e,kind:i,theaterId:r,terminal:d,onExit:()=>f.current?.(),onStatus:(F,q)=>{A(q?`${F}: ${q}`:F)}});h.current=T;let R=null;const L=()=>{v.fit(),T.resize(d.cols,d.rows)},M=()=>{L(),d.refresh(0,d.rows-1)},k=()=>{R&&clearTimeout(R),R=setTimeout(()=>{R=null,y||M()},_3)},B=async()=>{await document.fonts?.ready,!y&&(L(),T.start(),C.current!==!1&&d.focus())},W=new ResizeObserver(k);return W.observe(p),B(),()=>{y=!0,W.disconnect(),R&&clearTimeout(R),T.dispose(),u.current=null,h.current=null;try{d.dispose()}catch{}}},[i,e,r]),U.useEffect(()=>{o&&u.current?.focus()},[o]),U.useEffect(()=>{const p=u.current;if(!p)return;let y=!1;if(m==="webgl")try{const d=new a3;b.current=d,d.onContextLoss(()=>{if(!y){try{d.dispose()}catch{}b.current===d&&(b.current=null)}}),p.loadAddon(d)}catch{try{b.current?.dispose()}catch{}b.current=null}return()=>{y=!0;const d=b.current;if(d){b.current=null;try{d.dispose()}catch{}}}},[m,i,e]),U.useEffect(()=>{const p=u.current;p&&(p.options.theme=Xb(_))},[_]);const x=E.startsWith("live");return S.jsx("section",{className:"terminal-stage","aria-label":i==="shell"?"Shell terminal":"Fleet terminal",children:S.jsxs("div",{className:"terminal-shell",children:[x?null:S.jsxs("div",{className:"terminal-status","aria-live":"polite",children:[S.jsx("span",{className:"terminal-status-dot","aria-hidden":"true"}),E]}),S.jsx("div",{className:"terminal-canvas",ref:c})]})})}function Xb(e){return e==="carbon"?b3:v3}function y3({state:e}){const i=U.useRef(null);return e.shellOpen&&i.current===null&&(i.current=document.activeElement),U.useEffect(()=>{if(!e.shellOpen)return;const r=a=>{a.key==="Escape"&&bl()};return window.addEventListener("keydown",r),()=>{window.removeEventListener("keydown",r);const a=i.current;i.current=null,a?.focus?.()}},[e.shellOpen]),e.shellOpen?S.jsxs("div",{className:"shell-overlay",role:"dialog","aria-modal":"true","aria-label":"Shell",children:[S.jsx("button",{type:"button",className:"shell-overlay-scrim",onClick:bl,"aria-label":"Close shell"}),S.jsxs("section",{className:"shell-overlay-card",children:[S.jsxs("header",{className:"shell-overlay-header",children:[S.jsx("span",{className:"shell-overlay-kicker",children:"Free Shell"}),S.jsx("h2",{children:"Local Shell"})]}),S.jsx("button",{type:"button",className:"shell-overlay-close",onClick:bl,"aria-label":"Close shell",children:"×"}),S.jsx("div",{className:"shell-overlay-terminal",children:S.jsx(gh,{sessionId:db,kind:"shell",onExit:bl},db)})]})]}):null}const S3="a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex='-1'])",Zb="operation-search-listbox",KS="__unassigned__";function w3({state:e}){const i=$l(),[r,a]=U.useState(""),[o,_]=U.useState(0),m=U.useRef(null),c=U.useRef(null),u=U.useRef(null),h=U.useRef(new Map),b=U.useMemo(()=>YT(e),[e]),f=U.useMemo(()=>ST(b,r),[b,r]),C=U.useMemo(()=>wT(f),[f]),E=U.useMemo(()=>iS(r),[r]),A=Jb(o,f.length),x=f[A]?Qb(f[A].sessionId):void 0;if(U.useEffect(()=>{if(!e.operationSearchOpen)return;u.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const d=document.body.style.overflow;return document.body.style.overflow="hidden",window.setTimeout(()=>m.current?.focus(),0),()=>{document.body.style.overflow=d,u.current?.focus()}},[e.operationSearchOpen]),U.useEffect(()=>{if(!e.operationSearchOpen){a(""),_(0);return}_(0)},[e.operationSearchOpen,r]),U.useEffect(()=>{if(!e.operationSearchOpen)return;const d=f[A];d&&h.current.get(d.sessionId)?.scrollIntoView({block:"nearest"})},[A,f,e.operationSearchOpen]),!e.operationSearchOpen)return null;const p=d=>{Rg(d),i("/operations"),jf()},y=d=>{if(d.key==="Escape"){d.preventDefault(),jf();return}if(d.key==="ArrowDown"||d.key==="ArrowUp"){d.preventDefault(),_(v=>Jb(v+(d.key==="ArrowDown"?1:-1),f.length));return}if(d.key==="Enter"){const v=f[A];if(!v)return;d.preventDefault(),p(v.sessionId);return}d.key==="Tab"&&T3(d,c.current)};return S.jsx("div",{className:"operation-search-overlay",onMouseDown:d=>{d.target===d.currentTarget&&jf()},children:S.jsxs("section",{ref:c,className:"operation-search-card",role:"dialog","aria-modal":"true","aria-label":"Operation quick search",tabIndex:-1,onKeyDown:y,children:[S.jsxs("div",{className:"operation-search-field",children:[S.jsx(A3,{}),S.jsx("input",{ref:m,id:"operation-search-input",type:"search",value:r,onChange:d=>a(d.target.value),placeholder:"Search Operations across Theaters",autoComplete:"off",role:"combobox","aria-expanded":!0,"aria-controls":Zb,"aria-activedescendant":x,"aria-autocomplete":"list",spellCheck:!1}),S.jsx("kbd",{children:"esc"})]}),S.jsx("div",{id:Zb,className:"operation-search-results",role:"listbox","aria-label":"Operation results",children:C.length>0?C.map(d=>{const v=x3(d.theaterId);return S.jsxs("section",{className:"operation-search-section",role:"group","aria-labelledby":v,children:[S.jsx("h2",{id:v,className:"operation-search-section-heading",children:tp(d.theaterLabel,E)}),d.entries.map(T=>{const R=f.indexOf(T),L=R===A;return S.jsxs("button",{id:Qb(T.sessionId),ref:M=>{M?h.current.set(T.sessionId,M):h.current.delete(T.sessionId)},type:"button",className:`operation-search-result ${L?"is-active":""}`,role:"option","aria-selected":L,onMouseEnter:()=>_(R),onClick:()=>p(T.sessionId),children:[S.jsxs("span",{className:"operation-search-result-text",children:[S.jsx("strong",{children:tp(T.operationName,E)}),S.jsx("small",{children:C3(T)})]}),S.jsx("span",{className:"operation-search-theater",children:tp(T.theaterLabel,E)})]},T.sessionId)})]},d.theaterId??KS)}):S.jsx("p",{className:"operation-search-empty",children:"No matching Operations."})})]})})}function Jb(e,i){return i<=0?0:Math.max(0,Math.min(e,i-1))}function C3(e){return[e.cliLabel,e.status].filter(Boolean).join(" · ")}function x3(e){return`operation-search-heading-${VS(e??KS)}`}function Qb(e){return`operation-search-option-${VS(e)}`}function VS(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-")}function tp(e,i){if(i.length===0)return e;const r=[];let a=0;for(;a<e.length;){const o=E3(e,i,a);if(!o){r.push(e.slice(a));break}o.start>a&&r.push(e.slice(a,o.start)),r.push(S.jsx("mark",{children:e.slice(o.start,o.end)},`${o.start}-${o.end}`)),a=o.end}return r}function E3(e,i,r){const a=e.toLocaleLowerCase();let o=null;for(const _ of i){const m=a.indexOf(_,r);m!==-1&&(!o||m<o.start)&&(o={start:m,end:m+_.length})}return o}function T3(e,i){if(!i)return;const r=Array.from(i.querySelectorAll(S3)).filter(_=>_.offsetParent!==null);if(r.length===0)return;const a=r[0],o=r[r.length-1];if(e.shiftKey&&document.activeElement===a){e.preventDefault(),o?.focus();return}!e.shiftKey&&document.activeElement===o&&(e.preventDefault(),a?.focus())}function A3(){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"})})}const e1={"carrier-call":"Sortie launched",ended:"Stood down","input-waiting":"Awaiting orders"},k3=1e4;function R3({toasts:e}){return e.length===0?null:S.jsx("div",{className:"app-toast-host operation-toast-stack","aria-live":"polite",children:e.map(i=>S.jsx(L3,{toast:i},i.id))})}function L3({toast:e}){const i=$l();U.useEffect(()=>{if(e.kind==="ended"||e.kind==="input-waiting")return;const a=setTimeout(()=>zf(e.id),k3);return()=>clearTimeout(a)},[e.id,e.kind]);const r=()=>{Rg(e.sessionId),i("/operations"),zf(e.id)};return S.jsxs("div",{className:`app-toast operation-toast operation-toast--${e.kind}`,role:"status",children:[S.jsxs("button",{type:"button",className:"operation-toast-go-surface",onClick:r,"aria-label":`${e.theaterLabel} › ${e.operationLabel} — ${e1[e.kind]}. 선택하여 이동`,children:[S.jsx("span",{className:"app-toast-dot","aria-hidden":"true"}),S.jsxs("span",{className:"operation-toast-text",children:[S.jsx("span",{className:"operation-toast-theater",children:e.theaterLabel}),S.jsx("span",{className:"operation-toast-sep","aria-hidden":"true",children:"›"}),S.jsx("span",{className:"operation-toast-op",children:e.operationLabel}),S.jsx("span",{className:"operation-toast-status",children:e1[e.kind]})]})]}),S.jsx("button",{type:"button",className:"app-toast-close",onClick:()=>zf(e.id),"aria-label":"Dismiss notification",children:"×"})]})}function M3({open:e,title:i,message:r,tone:a="info",onDismiss:o}){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:i}),r?S.jsx("p",{className:"app-toast-message",children:r}):null]}),o?S.jsx("button",{type:"button",className:"app-toast-close",onClick:o,"aria-label":"Dismiss notification",children:"×"}):null]})}):null}const D3=[{id:"route",label:"Full",title:"Codex view: Full page"},{id:"side",label:"Side",title:"Codex view: Side panel"}];function O3({mode:e,onSelect:i}){return S.jsx("div",{className:"codex-mode-toggle",role:"group","aria-label":"Codex view mode",children:D3.map(r=>S.jsx("button",{type:"button",className:`codex-mode-option ${e===r.id?"is-active":""}`,onClick:()=>i(r.id),"aria-pressed":e===r.id,title:r.title,children:r.label},r.id))})}const N3=[{to:"/operations",label:"Operation",end:!1,icon:"operations"},{to:"/codex",label:"Codex",end:!1,icon:"codex"}],ip=[{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)"]}];function B3({state:e,codexMode:i}){const r=e.connectionError!==null,a=Ln().pathname,o=Eg(),_=a.startsWith("/operations"),m=a.startsWith("/codex"),c=a.startsWith("/codex")?S.jsx(i1,{}):a.startsWith("/carrier-settings")?S.jsx(r1,{}):a.startsWith("/settings")?S.jsx(n1,{}):a.startsWith("/operations")?S.jsx(t1,{}):S.jsx(q3,{});return S.jsxs("header",{className:"topbar",children:[S.jsxs("div",{className:"topbar-lead",children:[S.jsxs(Ll,{className:"topbar-brand",to:"/","aria-label":"Welcome으로 이동",children:[S.jsx("span",{className:`topbar-sigil ${r?"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.jsx("span",{className:"topbar-preview-badge",children:"Research Preview"})]}),S.jsx(j3,{state:e}),S.jsxs("div",{className:"topbar-meta",children:[e.updateAvailable?S.jsx("a",{className:"topbar-update-badge",href:"https://www.npmjs.com/package/@dotobokuri/fleet-console",target:"_blank",rel:"noreferrer",title:e.latestVersion?`Latest version: ${e.latestVersion}`:"Update available",children:"Update available"}):null,S.jsx("nav",{className:"topbar-nav","aria-label":"주 내비게이션",children:N3.map(u=>S.jsxs(U.Fragment,{children:[S.jsxs(xu,{to:u.to,end:u.end,className:({isActive:h})=>`topbar-nav-link ${h?"is-active":""}`,children:[S.jsx("span",{className:"topbar-nav-icon","aria-hidden":"true",children:u.icon==="operations"?S.jsx(t1,{}):S.jsx(i1,{})}),S.jsx("span",{children:u.label})]}),u.icon==="operations"&&_?S.jsx(I3,{mode:o}):null,u.icon==="codex"&&m?S.jsx(O3,{mode:i,onSelect:U5}):null]},u.to))}),S.jsxs("button",{type:"button",className:"topbar-shell-button",onMouseDown:u=>u.preventDefault(),onClick:uS,"aria-label":"Shell",title:"Shell (⌘`)",children:[S.jsx(G3,{}),S.jsx("span",{children:"Shell"})]}),S.jsx("button",{type:"button",className:"topbar-shell-button topbar-shortcuts-button",onMouseDown:u=>u.preventDefault(),onClick:PT,"aria-label":"Keyboard shortcuts",title:"Keyboard shortcuts",children:S.jsx(K3,{})}),S.jsxs(xu,{to:"/carrier-settings",className:({isActive:u})=>`topbar-nav-link ${u?"is-active":""}`,title:"Carrier settings",children:[S.jsx("span",{className:"topbar-nav-icon","aria-hidden":"true",children:S.jsx(r1,{})}),S.jsx("span",{children:"Carriers"})]}),S.jsxs(xu,{to:"/settings",className:({isActive:u})=>`topbar-nav-link ${u?"is-active":""}`,title:"Settings",children:[S.jsx("span",{className:"topbar-nav-icon","aria-hidden":"true",children:S.jsx(n1,{})}),S.jsx("span",{children:"Settings"})]}),S.jsx(z3,{activeTheme:e.activeTheme}),S.jsx($3,{renderer:e.terminalRenderer})]})]})}function I3({mode:e}){return S.jsxs("div",{className:"operations-mode-toggle",role:"group","aria-label":"Operation view mode",children:[S.jsx("button",{type:"button",className:`operations-mode-option ${e==="canvas"?"is-active":""}`,onClick:()=>rb("canvas"),"aria-pressed":e==="canvas",title:"Operation mode: Map",children:"Map"}),S.jsx("button",{type:"button",className:`operations-mode-option ${e==="classic"?"is-active":""}`,onClick:()=>rb("classic"),"aria-pressed":e==="classic",title:"Operation mode: Helm",children:"Helm"})]})}function j3({state:e}){const[i,r]=U.useState(!1),[a,o]=U.useState(!1),_=U.useRef(null),m=U.useRef(null),c=U.useRef(null),u=e.theaters.find(p=>p.id===e.activeTheaterId)??null,h=u?.label??(e.theaters.length===0?"No Theaters":"Theater");U.useEffect(()=>{if(!i)return;const p=d=>{_.current?.contains(d.target)||r(!1)},y=d=>{d.key==="Escape"&&(r(!1),m.current?.focus())};return document.addEventListener("mousedown",p),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousedown",p),document.removeEventListener("keydown",y)}},[i]),U.useEffect(()=>{if(!i)return;const p=c.current;if(!p)return;(p.querySelector('[data-active="true"]')??p.querySelector("[role^='menuitem']"))?.focus()},[i]);const b=p=>{BT(p),r(!1),m.current?.focus()},f=async()=>{r(!1),o(!0)},C=()=>{o(!1),IT()},E=async p=>{o(!1),lS();try{const y=await Yy(p),d=await Vy(y);cS(d)}catch(y){Hp(y instanceof Error?y.message:String(y))}},A=async()=>{if(u){r(!1);try{await eT(u.id),_b(u.id)}catch(p){if(p instanceof lt&&p.status===404){_b(u.id);return}Hp(p instanceof Error?p.message:String(p))}}},x=p=>{if(p.key!=="ArrowDown"&&p.key!=="ArrowUp")return;p.preventDefault();const y=Array.from(c.current?.querySelectorAll("[role^='menuitem']")??[]);if(y.length===0)return;const d=y.indexOf(document.activeElement),v=p.key==="ArrowDown"?1:-1,T=(d+v+y.length)%y.length;y[T]?.focus()};return S.jsxs("div",{className:"theater-control",ref:_,children:[S.jsx("span",{className:"theater-eyebrow","aria-hidden":"true",children:"Theater"}),S.jsxs("button",{type:"button",ref:m,className:`theater-trigger ${i?"is-open":""}`,"aria-haspopup":"menu","aria-expanded":i,"aria-label":"Theater",title:u?.label??e.theaterError??void 0,onClick:()=>r(p=>!p),children:[S.jsx("span",{className:"theater-trigger-sigil","aria-hidden":"true",children:S.jsx(H3,{})}),S.jsx("span",{className:"theater-trigger-label",children:h}),S.jsx("span",{className:"theater-trigger-caret","aria-hidden":"true",children:S.jsx(YS,{})})]}),i?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(p=>{const y=p.id===e.activeTheaterId;return S.jsx("li",{children:S.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":y,"data-active":y?"true":void 0,className:`theater-menu-item ${y?"is-active":""}`,title:p.label,onClick:()=>b(p.id),children:[S.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:y?S.jsx(XS,{}):null}),S.jsx("span",{className:"theater-menu-label",children:p.label})]})},p.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(U3,{})}),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:f,children:[S.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:S.jsx(W3,{})}),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(_S,{open:a,onCancel:C,onConfirm:E})]})}function z3({activeTheme:e}){const[i,r]=U.useState(!1),a=U.useRef(null),o=U.useRef(null),_=U.useRef(null),m=ip.find(h=>h.id===e)??ip[0];U.useEffect(()=>{if(!i)return;const h=f=>{a.current?.contains(f.target)||r(!1)},b=f=>{f.key==="Escape"&&(r(!1),o.current?.focus())};return document.addEventListener("mousedown",h),document.addEventListener("keydown",b),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("keydown",b)}},[i]),U.useEffect(()=>{if(!i)return;const h=_.current;if(!h)return;(h.querySelector('[data-active="true"]')??h.querySelector("[role^='menuitem']"))?.focus()},[i]);const c=h=>{RT(h),r(!1),o.current?.focus()},u=h=>{if(h.key!=="ArrowDown"&&h.key!=="ArrowUp")return;h.preventDefault();const b=Array.from(_.current?.querySelectorAll("[role^='menuitem']")??[]);if(b.length===0)return;const f=b.indexOf(document.activeElement),C=h.key==="ArrowDown"?1:-1,E=(f+C+b.length)%b.length;b[E]?.focus()};return S.jsxs("div",{className:"theme-control",ref:a,children:[S.jsxs("button",{type:"button",ref:o,className:`theme-trigger ${i?"is-open":""}`,"aria-haspopup":"menu","aria-expanded":i,"aria-label":"Theme",onClick:()=>r(h=>!h),children:[S.jsx(F3,{}),S.jsx("span",{className:"theme-trigger-label",children:m.label}),S.jsx("span",{className:"theme-trigger-caret","aria-hidden":"true",children:S.jsx(YS,{})})]}),i?S.jsx("div",{className:"theme-menu",role:"menu","aria-label":"Theme",ref:_,onKeyDown:u,children:ip.map(h=>{const b=h.id===e;return S.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":b,"data-active":b?"true":void 0,className:`theme-menu-item ${b?"is-active":""}`,onClick:()=>c(h.id),children:[S.jsx("span",{className:"theme-swatch","aria-hidden":"true",children:h.swatch.map(f=>S.jsx("i",{style:{background:f}},f))}),S.jsx("span",{className:"theme-menu-label",children:h.label}),S.jsx("span",{className:"theme-menu-check","aria-hidden":"true",children:b?S.jsx(XS,{}):null})]},h.id)})}):null]})}function $3({renderer:e}){const i=e==="webgl"?"dom":"webgl",r=e==="webgl"?"WebGL":"DOM";return S.jsxs("button",{type:"button",className:"theme-trigger","aria-label":`Terminal renderer: ${r}`,title:`Terminal renderer: ${r}`,onClick:()=>LT(i),children:[S.jsx(P3,{}),S.jsx("span",{className:"theme-trigger-label",children:r})]})}function H3(){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 P3(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("rect",{x:"2.5",y:"3",width:"11",height:"8",rx:"1.2",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),S.jsx("path",{d:"M5.2 13h5.6M8 11v2",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function YS(){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 XS(){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 U3(){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 F3(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("path",{d:"M8 2.6a5.4 5.4 0 0 0-5.4 5.5c0 2.4 1.8 4.5 4.2 5 .8.2 1.2-.2 1.2-.8 0-.5-.4-.8-.4-1.3 0-.7.6-1.1 1.3-1.1h1.1c1.9 0 3.4-1.5 3.4-3.3C13.4 4.4 11 2.6 8 2.6Z",fill:"none",stroke:"currentColor",strokeWidth:"1.15",strokeLinejoin:"round"}),S.jsx("circle",{cx:"5.6",cy:"6.4",r:".75",fill:"currentColor"}),S.jsx("circle",{cx:"8",cy:"5.2",r:".75",fill:"currentColor"}),S.jsx("circle",{cx:"10.4",cy:"6.5",r:".75",fill:"currentColor"})]})}function q3(){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 t1(){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 i1(){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 n1(){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 r1(){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 W3(){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 G3(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("path",{d:"M2.8 4.2h10.4v7.6H2.8z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),S.jsx("path",{d:"M5 6.7 6.8 8 5 9.3M8.2 9.4h2.6",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function K3(){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"})]})}function V3(){let e="";return i=>{e+=i;const r=[];let a=e.indexOf(`
|
|
85
|
+
|
|
86
|
+
`);for(;a>=0;){const o=e.slice(0,a);e=e.slice(a+2);const _=X3(o);_&&r.push(_),a=e.indexOf(`
|
|
87
|
+
|
|
88
|
+
`)}return r}}function Y3(e){if(!e.data)return null;let i;try{i=JSON.parse(e.data)}catch{return null}if(e.event==="observer:truncated"){const a=i.tenant?.tenantId;return!a||!i.truncation?null:{kind:"truncation",tenantId:a,tenantLabel:i.tenant?.tenantLabel,truncation:i.truncation}}if(e.event==="session:updated"){const a=a1(i.session);return a?{kind:"session",tenantId:a.tenantId??a.sessionId,session:a}:null}if(e.event==="session:attention"){const a=a1(i.session);return a?{kind:"attention",tenantId:a.tenantId??a.sessionId,session:a}:null}const r=s1(i.event)??s1(i);return r?{kind:"event",tenantId:r.tenantId,tenantLabel:i.tenant?.tenantLabel,event:r}:null}function X3(e){const i=e.split(`
|
|
89
|
+
`),r=i.find(o=>o.startsWith("event:"))?.slice(6).trim()??"message",a=i.filter(o=>o.startsWith("data:")).map(o=>o.slice(5).trim()).join(`
|
|
90
|
+
`);return!a&&r==="message"?null:{event:r,data:a}}function s1(e){if(typeof e!="object"||e===null)return null;const i=e;return typeof i.id!="number"||typeof i.tenantId!="string"||typeof i.type!="string"||typeof i.at!="number"?null:typeof i.event!="object"||i.event===null?{...i,event:{}}:i}function a1(e){if(typeof e!="object"||e===null)return null;const i=e;return typeof i.sessionId!="string"||typeof i.cwdLabel!="string"||typeof i.sequence!="number"||typeof i.status!="string"||typeof i.createdAt!="number"||"cwd"in i||"canonicalCwd"in i||"providerSession"in i||"ticket"in i||"token"in i||"transcriptPath"in i?null:{sessionId:i.sessionId,terminalSessionId:typeof i.terminalSessionId=="string"?i.terminalSessionId:i.sessionId,cwdLabel:i.cwdLabel,sequence:i.sequence,label:typeof i.label=="string"?i.label:void 0,cliId:typeof i.cliId=="string"?i.cliId:void 0,cliLabel:typeof i.cliLabel=="string"?i.cliLabel:void 0,status:i.status,turnState:i.turnState==="running"||i.turnState==="ended"?i.turnState:"none",createdAt:i.createdAt,theaterId:typeof i.theaterId=="string"?i.theaterId:void 0,tenantId:typeof i.tenantId=="string"?i.tenantId:void 0,registrationId:typeof i.registrationId=="string"?i.registrationId:void 0,resumeAvailable:i.resumeAvailable===!0}}const o1=250,Z3=5e3;function J3(){const e=new AbortController;return Q3(e.signal),()=>e.abort()}async function Q3(e){let i=o1,r=!1;const a=async()=>{if(!r){r=!0;try{hS(await Gy(e))}catch{}finally{r=!1}}};for(;!e.aborted;){Pe({connection:"connecting"});try{await tR(e);const o=await X5(e);Pe({connection:"live",connectionError:null}),i=o1,await eR(o,e,a),e.aborted||Pe({connection:"connecting",connectionError:null})}catch(o){if(e.aborted)return;Pe({connection:"connecting",connectionError:o instanceof Error?o.message:String(o)})}if(e.aborted)return;await iR(i,e),i=Math.min(i*2,Z3)}}async function eR(e,i,r){const a=new TextDecoder,o=V3();for(;!i.aborted;){const _=await e.read();if(_.done)return;for(const m of o(a.decode(_.value,{stream:!0}))){const c=Y3(m);if(c){if(c.kind==="truncation"&&c.truncation){WT(c.tenantId,c.tenantLabel,c.truncation);continue}if(c.kind==="session"&&c.session){vs(c.session);continue}if(c.kind==="attention"&&c.session){$T(c.session);continue}if(c.event){const{unknownTenant:u}=qT(c.event,c.tenantLabel);u&&r()}}}}}async function tR(e){const[i,r]=await Promise.all([Gy(e),Y5(e)]);hS(i),FT(r)}async function iR(e,i){await new Promise(r=>{const a=()=>{clearTimeout(o),i.removeEventListener("abort",a),r()},o=setTimeout(a,e);i.addEventListener("abort",a)})}const nR=new Set(["token","credential","cwd","path","persona","prompt","toolAllowlist","allowedExecutorTools"]);async function ZS(e){const i=await fetch("/carrier-settings/state",{signal:e});return await jg(i),JS(await i.json(),i.status)}async function rR(e){const i=await fetch("/carrier-settings/options",{signal:e});return await jg(i),uR(await i.json(),i.status)}async function sR(e,i,r){return co(`/carrier-settings/carriers/${encodeURIComponent(e)}/cli`,"PUT",{cliType:i},r)}async function aR(e,i,r){return co(`/carrier-settings/carriers/${encodeURIComponent(e)}/model`,"PUT",i,r)}async function oR(e,i,r){return co(`/carrier-settings/carriers/${encodeURIComponent(e)}/display-name`,"PATCH",{displayName:i},r)}async function l1(e,i,r){return co(`/carrier-settings/carriers/${encodeURIComponent(e)}/agent-mode`,"PUT",{agentMode:i},r)}async function lR(e,i,r,a){return co(`/carrier-settings/carriers/${encodeURIComponent(e)}/taskforce/${encodeURIComponent(i)}`,"PUT",r,a)}async function cR(e,i,r){return co(`/carrier-settings/carriers/${encodeURIComponent(e)}/taskforce/${encodeURIComponent(i)}`,"DELETE",{},r)}async function co(e,i,r,a){const o=await fetch(e,{method:i,headers:{"Content-Type":"application/json"},body:JSON.stringify(r),signal:a});await jg(o);const _=await o.json();if(!_||typeof _!="object"||!("state"in _))throw new lt(o.status,"Invalid carrier settings mutation response");return{state:JS(_.state,o.status)}}async function jg(e){if(e.ok)return;let i=e.statusText||`HTTP ${e.status}`;try{const r=await e.json();typeof r.error=="string"&&(i=r.error)}catch{}throw new lt(e.status,i)}function JS(e,i){QS(e,i);const r=e;if(!r||typeof r.generation!="number"||!Array.isArray(r.carriers))throw new lt(i,"Invalid carrier settings state response");return{generation:r.generation,carriers:r.carriers.map(a=>hR(a,i))}}function uR(e,i){QS(e,i);const r=e;if(!r||!Array.isArray(r.cliTypes)||!r.taskForceConstraints||typeof r.taskForceConstraints.minBackends!="number")throw new lt(i,"Invalid carrier settings options response");return{cliTypes:r.cliTypes.map(a=>dR(a,i)),taskForceConstraints:{minBackends:r.taskForceConstraints.minBackends}}}function hR(e,i){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 lt(i,"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=>pR(a,i))}}}function dR(e,i){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 lt(i,"Invalid carrier settings CLI option");return{id:r.id,displayName:r.displayName,supportsSubagent:r.supportsSubagent,models:r.models.map(a=>fR(a,i)),defaultModel:r.defaultModel}}function fR(e,i){const r=e;if(!r||typeof r.modelId!="string"||typeof r.name!="string")throw new lt(i,"Invalid carrier settings model option");if(r.effort!==void 0&&(!Array.isArray(r.effort.levels)||typeof r.effort.default!="string"))throw new lt(i,"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 pR(e,i){const r=e;if(!r||typeof r.cliType!="string"||typeof r.model!="string"||r.effort!==void 0&&typeof r.effort!="string")throw new lt(i,"Invalid carrier settings Task Force backend");return{cliType:r.cliType,model:r.model,...r.effort?{effort:r.effort}:{}}}function QS(e,i){const r=[e];for(;r.length>0;){const a=r.pop();if(!(!a||typeof a!="object"))for(const[o,_]of Object.entries(a)){if(nR.has(o))throw new lt(i,"Carrier settings response leaked a restricted field");_&&typeof _=="object"&&r.push(_)}}}const gR={cliType:"",model:"",effort:"",displayName:"",agentMode:"cli",taskforce:{}},Kp=new Set;let ki={loading:!1,state:null,options:null,activeCarrierId:null,draft:gR,savingActionId:null,error:null};function ew(){return U.useSyncExternalStore(mR,c1,c1)}function c1(){return ki}function mR(e){return Kp.add(e),()=>{Kp.delete(e)}}async function u1(e){er({loading:!0,error:null});try{const[i,r]=await Promise.all([ZS(e),rR(e)]);tw(i,r)}catch(i){if(e?.aborted)return;er({loading:!1,error:nw(i)})}}function _R(e){const i=ki.state?.carriers.find(r=>r.carrierId===e);er({activeCarrierId:e,draft:i?zg(i,ki.options):ki.draft,error:null})}function qs(e){er({draft:{...ki.draft,...e},error:null})}function Vp(e,i){const r=ki.draft.taskforce[e]??{model:"",effort:""};er({draft:{...ki.draft,taskforce:{...ki.draft.taskforce,[e]:{...r,...i}}},error:null})}function vR(){const e=iw();e&&er({draft:zg(e,ki.options),error:null})}async function bR(e){const i=iw();return i?yR("save-all",async()=>{const r=ki.draft;let a=null;r.displayName!==i.displayName&&(a=(await oR(i.carrierId,r.displayName)).state);const o=r.cliType!==i.cliType;return o&&(a=(await sR(i.carrierId,r.cliType)).state),(o||r.model!==i.model||(r.effort||"")!==(i.effort||""))&&(a=(await aR(i.carrierId,wR(r))).state),r.agentMode==="subagent"?(i.agentMode!=="subagent"||i.taskForceBackendCount>0)&&(a=(await l1(i.carrierId,"subagent")).state):(i.agentMode!=="cli"&&(a=(await l1(i.carrierId,"cli")).state),a=await CR(i,e,a)),{state:a??await ZS()}}):!1}function tw(e,i){const r=xR(e,ki.activeCarrierId),a=e.carriers.find(o=>o.carrierId===r)??null;er({loading:!1,state:e,options:i,activeCarrierId:r,draft:a?zg(a,i):ki.draft,error:null})}async function yR(e,i){er({savingActionId:e,error:null});try{const r=await i();return tw(r.state,ki.options??{cliTypes:[],taskForceConstraints:{minBackends:2}}),er({savingActionId:null}),!0}catch(r){return er({savingActionId:null,error:nw(r)}),!1}}function zg(e,i){const r=Object.fromEntries((i?.cliTypes??[]).map(a=>{const o=e.taskforce.backends.find(_=>_.cliType===a.id);return[a.id,{model:o?.model??a.defaultModel,effort:o?.effort??SR(a.id,o?.model??a.defaultModel,i)??""}]}));return{cliType:e.cliType,model:e.model,effort:e.effort??"",displayName:e.displayName,agentMode:e.agentMode,taskforce:r}}function SR(e,i,r){return r?.cliTypes.find(_=>_.id===e)?.models.find(_=>_.modelId===i)?.effort?.default??null}function wR(e){return{model:e.model,...e.effort?{effort:e.effort}:{}}}function iw(){return ki.state?.carriers.find(e=>e.carrierId===ki.activeCarrierId)??null}async function CR(e,i,r){const a=new Set(i.map(o=>o.cliType));for(const o of e.taskforce.backends)a.has(o.cliType)||(r=(await cR(e.carrierId,o.cliType)).state);for(const o of i){const _=e.taskforce.backends.find(m=>m.cliType===o.cliType);_&&_.model===o.model&&(_.effort||"")===(o.effort||"")||(r=(await lR(e.carrierId,o.cliType,{model:o.model,...o.effort?{effort:o.effort}:{}})).state)}return r}function xR(e,i){return i&&e.carriers.some(r=>r.carrierId===i)?i:e.carriers[0]?.carrierId??null}function er(e){ki={...ki,...e};for(const i of Kp)i()}function nw(e){return e instanceof Error?e.message:String(e)}const ER=50,TR=2400,AR={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 kR(){const e=ew(),i=e.state?.carriers.find(d=>d.carrierId===e.activeCarrierId)??null,r=e.options?.cliTypes.find(d=>d.id===e.draft.cliType)??null,a=r?.models.find(d=>d.modelId===e.draft.model)??null,[o,_]=U.useState(!1),[m,c]=U.useState([]),[u,h]=U.useState("idle"),b=m.length>0,f=e.draft.agentMode==="subagent",C=e.draft.agentMode==="subagent",E=e.savingActionId==="save-all",A=i?NR(i,e.draft,m):!1,x=i?.taskforce.backends.map(d=>`${d.cliType}:${d.model}:${d.effort??""}`).join("|")??"";U.useEffect(()=>{const d=new AbortController;return u1(d.signal),()=>d.abort()},[]),U.useEffect(()=>{_(!1),c(i?.taskforce.backends.map(d=>d.cliType)??[]),h("idle")},[i?.carrierId,x]),U.useEffect(()=>{if(u!=="saved")return;const d=window.setTimeout(()=>h("idle"),TR);return()=>window.clearTimeout(d)},[u]);function p(){i&&(vR(),c(i.taskforce.backends.map(d=>d.cliType)),_(!1),h("idle"))}async function y(){if(!i)return;if(h("saving"),!await bR(IR(m,e.draft.taskforce))){h("idle");return}_(!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"||E?"Saving…":u==="saved"?"Saved ✓":""}),i?S.jsxs("div",{className:"carrier-settings-save-actions",children:[S.jsx("button",{type:"button",className:`carrier-settings-action-button ${A?"is-dirty":""}`,disabled:!A||E,onClick:()=>{y()},children:"Save"}),S.jsx("button",{type:"button",className:`carrier-settings-action-button ${A?"is-dirty":""}`,disabled:!A||E,onClick:p,children:"Discard"})]}):null,S.jsx("button",{type:"button",className:"carrier-settings-action-button carrier-settings-hero-refresh",disabled:e.loading,onClick:()=>{u1()},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(d=>S.jsx(RR,{carrier:d,active:d.carrierId===e.activeCarrierId,minBackends:e.options?.taskForceConstraints.minBackends??2,onSelect:()=>_R(d.carrierId)},d.carrierId))]}),i&&e.options&&r?S.jsxs("div",{className:"carrier-settings-detail",style:aw(i.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"})," · ",i.carrierId.toUpperCase()]}),S.jsx("div",{className:`carrier-settings-name-line ${o?"is-editing":""}`,children:o?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:ER,onChange:d=>qs({displayName:d.target.value})}),S.jsx("button",{type:"button",className:"carrier-settings-icon-button","aria-label":"Save display name",disabled:E,onClick:()=>{_(!1)},children:S.jsx(zR,{})}),S.jsx("button",{type:"button",className:"carrier-settings-icon-button","aria-label":"Cancel display name edit",onClick:()=>{qs({displayName:i.displayName}),_(!1)},children:S.jsx($R,{})})]}):S.jsxs(S.Fragment,{children:[S.jsx("h3",{className:"carrier-settings-captain-name",children:i.displayName}),S.jsx("button",{type:"button",className:"carrier-settings-icon-button","aria-label":"Edit display name",onClick:()=>{qs({displayName:i.displayName}),_(!0)},children:S.jsx(jR,{})})]})}),S.jsx("div",{className:"carrier-settings-captain-role",children:i.role})]}),S.jsxs("div",{className:"carrier-settings-cli-badge",children:[S.jsx("span",{className:"ind","aria-hidden":"true"}),i.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:['"',i.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:d=>MR(d.target.value,e.options?.cliTypes??[]),children:e.options.cliTypes.map(d=>S.jsx("option",{value:d.id,children:d.displayName},d.id))})]})}),S.jsxs("div",{className:"carrier-settings-runtime-row carrier-settings-runtime-row--model",children:[S.jsx(rw,{id:"carrier-model",label:"Model",models:r.models,value:e.draft.model,onChange:d=>DR(r,d)}),S.jsx(sw,{id:"carrier-effort",model:a,value:e.draft.effort,onChange:d=>qs({effort:d})})]})]})]}),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:b?"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 ${f?"is-on":""}`,disabled:E||!f&&(!r.supportsSubagent||b),"aria-pressed":f,onClick:()=>qs({agentMode:f?"cli":"subagent"}),children:S.jsx("span",{children:f?"On":"Off"})})]})}),S.jsx(LR,{carrier:i,cliOptions:e.options.cliTypes,minBackends:e.options.taskForceConstraints.minBackends,savingActionId:e.savingActionId,rows:m,disabled:C,onRowsChange:c})]})]},i.carrierId):S.jsx("div",{className:"carrier-settings-detail",children:S.jsx("p",{className:"carrier-settings-empty",children:"Select a carrier."})})]})]})}function RR({carrier:e,active:i,minBackends:r,onSelect:a}){const o=e.taskForceBackendCount>=r;return S.jsxs("button",{type:"button",className:`carrier-settings-row ${i?"is-active":""}`,style:aw(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 ${o?"is-live":""}`})]})]})}function rw({id:e,label:i,models:r,value:a,disabled:o=!1,onChange:_}){return S.jsxs("div",{className:"carrier-settings-field",children:[S.jsx("label",{className:"carrier-settings-label",htmlFor:e,children:i}),S.jsx("select",{id:e,className:"carrier-settings-select",value:a,disabled:o,onChange:m=>_(m.target.value),children:r.map(m=>S.jsx("option",{value:m.modelId,children:m.name},m.modelId))})]})}function sw({id:e,model:i,value:r,disabled:a=!1,onChange:o}){return i?.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||i.effort.default,disabled:a,onChange:_=>o(_.target.value),children:i.effort.levels.map(_=>S.jsx("option",{value:_,children:_},_))})]}):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 LR({carrier:e,cliOptions:i,minBackends:r,savingActionId:a,rows:o,disabled:_,onRowsChange:m}){const c=ew(),u=e.taskforce.backends.length,[h,b]=U.useState(u>0),[f,C]=U.useState(!1),[E,A]=U.useState(""),x=e.taskForceBackendCount>=r,p=i.filter(d=>!o.includes(d.id)),y=E||p[0]?.id||"";return S.jsxs("div",{className:`carrier-settings-control-group carrier-settings-control-group--taskforce ${h?"is-expanded":""} ${_?"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:_?"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:()=>b(d=>!d),children:h?"Hide":"Configure"})})]}),h?S.jsxs("div",{className:"carrier-settings-tf-list",children:[o.length===0?S.jsx("p",{className:"carrier-settings-tf-empty",children:"No Task Force backend drafted."}):null,o.map(d=>{const v=i.find(M=>M.id===d);if(!v)return null;const T=c.draft.taskforce[v.id]??{model:v.defaultModel,effort:""},R=v.models.find(M=>M.modelId===T.model)??v.models[0]??null,L=e.taskforce.backends.some(M=>M.cliType===v.id);return S.jsxs("div",{className:`carrier-settings-tf-item ${L?"is-active":""}`,children:[S.jsxs("div",{className:"carrier-settings-tf-title",children:[S.jsx("span",{className:`carrier-settings-live-dot ${L?"is-live":""}`,"aria-hidden":"true"}),S.jsx("strong",{children:v.displayName})]}),S.jsx(rw,{id:`tf-${v.id}-model`,label:"Model",models:v.models,value:T.model,disabled:_,onChange:M=>OR(v,M)}),S.jsx(sw,{id:`tf-${v.id}-effort`,model:R,value:T.effort,disabled:_,onChange:M=>Vp(v.id,{effort:M})}),S.jsx("div",{className:"carrier-settings-tf-actions",children:S.jsx("button",{type:"button",className:"carrier-settings-ghost-button",disabled:_||a==="save-all",onClick:()=>m(o.filter(M=>M!==v.id)),children:"Remove"})})]},v.id)}),S.jsxs("div",{className:"carrier-settings-tf-add-row",children:[f&&p.length>0?S.jsx("select",{className:"carrier-settings-select carrier-settings-tf-add-select",value:y,onChange:d=>A(d.target.value),"aria-label":"Task Force CLI to add",children:p.map(d=>S.jsx("option",{value:d.id,children:d.displayName},d.id))}):null,S.jsx("button",{type:"button",className:"carrier-settings-ghost-button",disabled:_||p.length===0||a==="save-all",onClick:()=>{if(!f){C(!0);return}const d=y,v=i.find(R=>R.id===d),T=v?.models.find(R=>R.modelId===v.defaultModel)??v?.models[0]??null;!v||!T||(Vp(v.id,{model:T.modelId,effort:T.effort?.default??""}),m(o.includes(v.id)?o:[...o,v.id]),A(""),C(!1))},children:"Add"})]})]}):null]})}function MR(e,i){const r=i.find(_=>_.id===e),a=r?.models.find(_=>_.modelId===r.defaultModel)??r?.models[0]??null,o={cliType:e,model:a?.modelId??"",effort:a?.effort?.default??""};r?.supportsSubagent||(o.agentMode="cli"),qs(o)}function DR(e,i){const r=e.models.find(a=>a.modelId===i);qs({model:i,effort:r?.effort?.default??""})}function OR(e,i){const r=e.models.find(a=>a.modelId===i);Vp(e.id,{model:i,effort:r?.effort?.default??""})}function NR(e,i,r){return i.displayName!==e.displayName||i.cliType!==e.cliType||i.model!==e.model||(i.effort||"")!==(e.effort||"")||i.agentMode!==e.agentMode?!0:i.agentMode==="subagent"?e.taskForceBackendCount>0:BR(e,r,i.taskforce)}function BR(e,i,r){if(i.length!==e.taskforce.backends.length)return!0;const a=new Set(i);for(const o of e.taskforce.backends){if(!a.has(o.cliType))return!0;const _=r[o.cliType];if(!_||_.model!==o.model||(_.effort||"")!==(o.effort||""))return!0}return!1}function IR(e,i){return e.map(r=>{const a=i[r];return a?{cliType:r,model:a.model,...a.effort?{effort:a.effort}:{}}:null}).filter(r=>r!==null)}function aw(e){return{"--cap-color":AR[e]??"var(--brass)"}}function jR(){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 zR(){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 $R(){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 Ae(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function Je(e){return Ae(e).replace(/"/g,""")}const HR="contextual-knowledge-not-instructions";function PR(e,i,r){const a=r?.whyThisMatched??e.frontmatter.whyThisMatched,o=cw(e,i);return`
|
|
91
|
+
<div class="context-actions-grid">
|
|
92
|
+
<button class="context-action-btn" type="button" data-action="copy-compact-context">
|
|
93
|
+
<span class="context-action-label">Compact context</span>
|
|
94
|
+
<span class="context-action-meta">${Mu(ow(e))} tok</span>
|
|
95
|
+
</button>
|
|
96
|
+
<button class="context-action-btn" type="button" data-action="copy-provenance-context">
|
|
97
|
+
<span class="context-action-label">Provenance</span>
|
|
98
|
+
<span class="context-action-meta">${Mu(lw(e))} tok</span>
|
|
99
|
+
</button>
|
|
100
|
+
<button class="context-action-btn" type="button" data-action="copy-related-context">
|
|
101
|
+
<span class="context-action-label">Context pack</span>
|
|
102
|
+
<span class="context-action-meta">${Mu(o)} tok</span>
|
|
103
|
+
</button>
|
|
104
|
+
${a?`
|
|
105
|
+
<button class="context-action-btn context-action-btn--secondary" type="button" data-action="toggle-why-matched">
|
|
106
|
+
<span class="context-action-label">Why this matched</span>
|
|
107
|
+
</button>
|
|
108
|
+
<div class="context-why-matched" hidden>${Ae(a)}</div>
|
|
109
|
+
`:""}
|
|
110
|
+
</div>
|
|
111
|
+
`}function ow(e){const i={id:e.frontmatter.id,title:e.frontmatter.title,status:e.frontmatter.status??null,tags:e.frontmatter.tags,updated:e.frontmatter.updated,summary:$g(e.body)};return JSON.stringify({...i,token_estimate:Mu(JSON.stringify(i))},null,2)}function lw(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",$g(e.body)].join(`
|
|
112
|
+
`)}function cw(e,i){const r=new Set([...e.frontmatter.related??[]]),a=i.filter(o=>r.has(o.id)).sort((o,_)=>o.title.localeCompare(_.title));return[`<fleet-wiki-context boundary="${HR}">`,"# 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",$g(e.body),"","### Related Entries",...a.length>0?a.map(o=>`- [[wiki:${o.id}]] — ${o.title}`):["- (none)"],"","</fleet-wiki-context>"].join(`
|
|
113
|
+
`)}function Mu(e){return Math.max(1,Math.ceil(e.length/4))}function $g(e){return e.replace(/\s+/g," ").trim().slice(0,240)||"(empty)"}async function UR(){return sr(Qi("/health"))}async function FR(){return sr(Qi("/workspaces"))}async function qR(){return sr(Qi("/index"))}async function WR(){return hw(Qi("/index-md"))}async function GR(e){return sr(Qi(`/entry/${encodeURIComponent(e)}`))}async function KR(e,i=[],r=!1){const a=new URLSearchParams;e&&a.set("q",e),i.length>0&&a.set("tags",i.join(",")),r&&a.set("enhanced","true");const o=a.toString();return sr(Qi(`/search${o?`?${o}`:""}`))}async function VR(e){return hw(Qi(`/raw?ref=${encodeURIComponent(e)}`))}async function mh(e){return sr(Qi(`/queue?status=${encodeURIComponent(e)}`))}async function YR(e){return sr(Qi(`/queue/${encodeURIComponent(e)}`))}async function XR(e){return dw(Qi(`/queue/${encodeURIComponent(e)}/approve`),{})}async function ZR(e,i){return dw(Qi(`/queue/${encodeURIComponent(e)}/reject`),{reason:i})}async function uw(){return sr(Qi("/conflicts"))}async function JR(e){return sr(Qi(`/conflicts/${encodeURIComponent(e)}`))}async function QR(e){const i=typeof e=="number"?`?limit=${encodeURIComponent(String(e))}`:"";return sr(Qi(`/log${i}`))}function Qi(e){const i=window.location.pathname.match(/^\/console\/codex\/w\/([^/]+)(?:\/|$)/),r=e.startsWith("/")?e:`/${e}`;return i?`/console/codex/w/${encodeURIComponent(decodeURIComponent(i[1]??""))}/api${r}`:`/console/codex/api${r}`}async function sr(e){const i=await fetch(e,{headers:{accept:"application/json"}});if(!i.ok)throw new Error(await Hg(e,i));return i.json()}async function hw(e){const i=await fetch(e,{headers:{accept:"text/markdown,text/plain"}});if(!i.ok)throw new Error(await Hg(e,i));return i.text()}async function dw(e,i){const r=await fetch(e,{method:"POST",headers:{"content-type":"application/json",accept:"application/json"},body:JSON.stringify(i)});if(!r.ok)throw new Error(await Hg(e,r));return r.json()}async function Hg(e,i){return(await i.json().catch(()=>null))?.error??`${e} request failed: ${i.status}`}const eL=/^[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}$/,Hn="/console/codex",Yp=new Set;let eo=null;function Fl(){const e=cL(uL(_w(window.location.pathname)).pathname);return e.name==="queue"?{name:"queue",tab:new URLSearchParams(window.location.search).get("tab")==="archived"?"archived":"pending"}:e}function Xp(){return mw(_w(window.location.pathname))?.wsId??null}function ea(e){e!==window.location.pathname+window.location.search&&(window.history.pushState({},"",e),Pg(Fl()))}function tL(e){window.history.replaceState({},"",e),Pg(Fl())}function iL(e){return Yp.add(e),()=>Yp.delete(e)}function nL(){eo||(eo=()=>Pg(Fl()),window.addEventListener("popstate",eo))}function rL(){eo&&(window.removeEventListener("popstate",eo),eo=null)}function Ir(e){return ir(`/entry/${encodeURIComponent(e)}`)}function fw(e){return ir(`/raw/${encodeURIComponent(e)}`)}function no(e="pending"){return ir(e==="archived"?"/queue?tab=archived":"/queue")}function sL(e){return ir(`/queue/${encodeURIComponent(e)}`)}function aL(){return ir("/conflicts")}function oL(e){return ir(`/conflicts/${encodeURIComponent(e)}`)}function lL(){return ir("/index-md")}function pw(e){return ir(typeof e!="number"?"/log":`/log?limit=${encodeURIComponent(String(e))}`)}function gw(){return ir("/")}function h1(e){return`${Hn}/w/${encodeURIComponent(e)}/`}function cL(e){if(e==="/index"||e==="/index-md")return{name:"index-md"};if(e==="/log"){const _=new URLSearchParams(window.location.search).get("limit"),m=Number(_??20);return{name:"log",limit:Number.isInteger(m)?m:20}}if(e==="/conflicts")return{name:"conflicts"};const i=e.match(/^\/conflicts\/([^/]+)$/);if(i)return{name:"conflict-detail",id:decodeURIComponent(i[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 o=e.match(/^\/queue\/([^/]+)$/);if(o){const _=decodeURIComponent(o[1]??"");return eL.test(_)?{name:"queue-detail",patchId:_}:{name:"home"}}return{name:"home"}}function ir(e){const i=Xp();return i?`${Hn}/w/${encodeURIComponent(i)}${e}`:`${Hn}${e}`}function uL(e){const i=mw(e);return i?{pathname:i.pathname,wsId:i.wsId}:{pathname:e,wsId:null}}function mw(e){const i=e.match(/^\/w\/([^/]+)(\/.*)?$/);return i?{wsId:decodeURIComponent(i[1]??""),pathname:i[2]??"/"}:null}function _w(e){return e===Hn||e===`${Hn}/`?"/":e.startsWith(`${Hn}/`)?e.slice(Hn.length)||"/":e}function Pg(e){for(const i of Yp)i(e)}const vw="fleet-wiki-web-recent",Zp=new Set,ta={health:null,index:[],currentEntry:null,currentMatchHint:null,conflicts:[],currentConflict:null,indexMarkdown:null,log:null,loading:!1,error:null,recentIds:bL(),pendingPatchCount:0,currentWorkspaceId:null,workspaces:[]};function Du(){return ta}function hL(e){return Zp.add(e),()=>Zp.delete(e)}async function dL(){Jt({loading:!0,error:null});try{const[e,i,r,a]=await Promise.all([UR(),qR(),mh("pending").catch(()=>null),FR().catch(()=>null)]);Jt({health:e,index:i,pendingPatchCount:r?.pendingCount??0,currentWorkspaceId:a?.currentWorkspaceId??null,workspaces:a?.workspaces??[],loading:!1})}catch(e){Jt({loading:!1,error:uo(e)})}}async function fL(e){Jt({loading:!0,error:null,currentEntry:null,currentMatchHint:ta.currentMatchHint?.id===e?ta.currentMatchHint:null,currentConflict:null,indexMarkdown:null,log:null});try{const i=await GR(e),r=vL(e);Jt({currentEntry:i,currentConflict:null,indexMarkdown:null,log:null,recentIds:r,loading:!1})}catch(i){Jt({loading:!1,error:uo(i)})}}async function pL(){Jt({loading:!0,error:null,currentEntry:null,currentConflict:null,log:null});try{Jt({indexMarkdown:await WR(),loading:!1})}catch(e){Jt({loading:!1,error:uo(e)})}}async function gL(e){Jt({loading:!0,error:null,currentEntry:null,currentConflict:null,indexMarkdown:null});try{Jt({log:await QR(e),loading:!1})}catch(i){Jt({loading:!1,error:uo(i)})}}async function mL(){Jt({loading:!0,error:null,currentEntry:null,currentConflict:null,indexMarkdown:null,log:null});try{Jt({conflicts:await uw(),loading:!1})}catch(e){Jt({loading:!1,error:uo(e)})}}async function _L(e){Jt({loading:!0,error:null,currentEntry:null,indexMarkdown:null,log:null});try{const[i,r]=await Promise.all([JR(e),uw().catch(()=>ta.conflicts)]);Jt({currentConflict:i,conflicts:r,loading:!1})}catch(i){Jt({loading:!1,error:uo(i)})}}function np(){Jt({currentEntry:null,currentMatchHint:null,currentConflict:null,indexMarkdown:null,log:null,error:null,loading:!1})}function bw(e){Jt({currentMatchHint:e})}function Ug(e){Jt({pendingPatchCount:e})}function Jt(e){Object.assign(ta,e);for(const i of Zp)i(ta)}function vL(e){const i=[e,...ta.recentIds.filter(r=>r!==e)].slice(0,8);return window.localStorage.setItem(vw,JSON.stringify(i)),i}function bL(){try{const e=window.localStorage.getItem(vw),i=e?JSON.parse(e):[];return Array.isArray(i)?i.filter(r=>typeof r=="string").slice(0,8):[]}catch{return[]}}function uo(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 Jp=[],Fg=[];function yL(e,i){Jp=e,Fg=i,ke.open&&!ke.query&&(ke.results=qg(),ke.selectedIndex=0,Wu())}function yw(){if(ke.open){f1();return}ke.open=!0,ke.query="",ke.selectedIndex=0,ke.results=qg(),ke.previousActiveElement=document.activeElement instanceof HTMLElement?document.activeElement:null,ML(),TL(),Wu(),f1()}function to(){ke.open&&(ke.open=!1,ke.searchSeq++,ke.debounceId!==null&&(window.clearTimeout(ke.debounceId),ke.debounceId=null),AL(),DL(),OL())}function SL(){document.addEventListener("keydown",Sw),document.addEventListener("input",ww),document.addEventListener("click",Cw),document.addEventListener("mouseover",xw)}function wL(){ke.open&&to(),document.removeEventListener("keydown",Sw),document.removeEventListener("input",ww),document.removeEventListener("click",Cw),document.removeEventListener("mouseover",xw)}function CL(){return ke.open}function Sw(e){if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()==="k"){e.preventDefault(),ke.open?to():yw();return}if(ke.open){if(e.key==="Tab"){NL(e);return}if(e.key==="Escape"){e.preventDefault(),to();return}if(e.key==="ArrowDown"){e.preventDefault(),ke.selectedIndex=Math.min(ke.selectedIndex+1,Math.max(0,ke.results.length-1)),Qp({scroll:!0});return}if(e.key==="ArrowUp"){e.preventDefault(),ke.selectedIndex=Math.max(0,ke.selectedIndex-1),Qp({scroll:!0});return}if(e.key==="Enter"){e.preventDefault();const r=ke.results[ke.selectedIndex];if(!r)return;bw(r),ea(Ir(r.id)),to()}}}function ww(e){const i=e.target;!(i instanceof HTMLInputElement)||i.id!=="command-input"||(ke.query=i.value.trim(),ke.selectedIndex=0,ke.debounceId!==null&&window.clearTimeout(ke.debounceId),ke.debounceId=window.setTimeout(()=>{xL(ke.query)},150))}function Cw(e){const i=e.target;if(!(i instanceof Element))return;if(i.matches("[data-action='open-command']")||i.closest("[data-action='open-command']")){yw();return}if(!ke.open)return;if(i.classList.contains("command-overlay")){to();return}const r=i.closest("[data-command-entry-id]");if(r){const a=ke.results.find(o=>o.id===(r.dataset.commandEntryId??""));bw(a??null),ea(Ir(r.dataset.commandEntryId??"")),to()}}function xw(e){if(!ke.open)return;const i=e.target;if(!(i instanceof Element))return;const r=i.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,Qp({scroll:!1}))}async function xL(e){const i=++ke.searchSeq;if(!e){ke.results=qg(),ke.selectedIndex=0,Wu();return}let r;try{r=await KR(e)}catch{r=[]}i!==ke.searchSeq||!ke.open||(ke.results=r,ke.selectedIndex=0,Wu())}function EL(){let e=document.querySelector("#command-palette-root");return e||(e=document.createElement("div"),e.id="command-palette-root",document.body.append(e)),e}function TL(){const e=EL();e.querySelector(".command-overlay")||(e.innerHTML=kL())}function AL(){const e=document.querySelector("#command-palette-root");e&&(e.innerHTML="")}function Wu(){const e=document.querySelector("#command-results-list");if(e){if(ke.results.length===0){e.innerHTML=`<p class="empty-state">${Ae("No results found.")}</p>`;return}e.innerHTML=ke.query?ke.results.map(Ew).join(""):RL()}}function Qp(e={scroll:!0}){const i=document.querySelectorAll(".command-result");i.forEach((a,o)=>{a.classList.toggle("active",o===ke.selectedIndex)});const r=i[ke.selectedIndex];e.scroll&&r?.scrollIntoView({block:"nearest"})}function kL(){const e=Je("Command palette"),i=Je("Search titles · tags · content");return`
|
|
114
|
+
<div class="command-overlay">
|
|
115
|
+
<section class="command-card" role="dialog" aria-modal="true" aria-label="${e}" tabindex="-1">
|
|
116
|
+
<div class="command-search">
|
|
117
|
+
<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">
|
|
118
|
+
<circle cx="11" cy="11" r="6.5" />
|
|
119
|
+
<path d="m20 20-3.5-3.5" />
|
|
120
|
+
</svg>
|
|
121
|
+
<input id="command-input" type="search" autocomplete="off" spellcheck="false" placeholder="${i}" />
|
|
122
|
+
<kbd>esc</kbd>
|
|
123
|
+
</div>
|
|
124
|
+
<div class="command-results" id="command-results-list"></div>
|
|
125
|
+
</section>
|
|
126
|
+
</div>
|
|
127
|
+
`}function Ew(e,i){const r=i===ke.selectedIndex?" active":"",a=Je(e.title),o=e.tags.slice(0,2),_=e.tags.length-o.length,m=zL(e),c=o.map(h=>`<span class="chip chip-tag">${Ae(h)}</span>`).join(""),u=_>0?`<span class="chip chip-muted">+${_}</span>`:"";return`
|
|
128
|
+
<button class="command-result${r}" type="button" data-command-entry-id="${Je(e.id)}" data-command-index="${i}" title="${a}">
|
|
129
|
+
<span class="command-result-text">
|
|
130
|
+
<strong>${IL(e.title,ke.query)}</strong>
|
|
131
|
+
<small>${Ae(jL(e))}</small>
|
|
132
|
+
${m?`<small class="command-result-excerpt">${Ae(m)}</small>`:""}
|
|
133
|
+
</span>
|
|
134
|
+
<span class="command-result-aside">${c}${u}</span>
|
|
135
|
+
</button>
|
|
136
|
+
`}function RL(){const e=LL(),i=ke.results.slice(0,e),r=ke.results.slice(e);return[i.length>0?d1("Recent",i,0):"",r.length>0?d1("All",r,e):""].join("")}function d1(e,i,r){return`
|
|
137
|
+
<div class="command-section-heading">${Ae(e)}</div>
|
|
138
|
+
${i.map((a,o)=>Ew(a,r+o)).join("")}
|
|
139
|
+
`}function qg(){const e=new Set(Fg),i=Tw().map(a=>Jp.find(o=>o.id===a)).filter(a=>!!a),r=Jp.filter(a=>!e.has(a.id));return[...i,...r].slice(0,12).map((a,o)=>({id:a.id,title:a.title,score:Math.max(1,100-o),reason:"title",excerpt:"",path:a.path,tags:a.tags,updated:a.updated}))}function LL(){return Tw().filter((e,i)=>ke.results[i]?.id===e).length}function Tw(){return Array.from(new Set(Fg))}function ML(){ke.previousBodyOverflow===null&&(ke.previousBodyOverflow=document.body.style.overflow,document.body.style.overflow="hidden")}function DL(){ke.previousBodyOverflow!==null&&(document.body.style.overflow=ke.previousBodyOverflow,ke.previousBodyOverflow=null)}function OL(){const e=ke.previousActiveElement;ke.previousActiveElement=null,e?.isConnected&&e.focus()}function f1(){window.setTimeout(()=>{const e=document.querySelector("#command-input");e&&(e.focus(),e.select())},0)}function NL(e){const i=document.querySelector(".command-card");if(!i)return;const r=BL(i);if(r.length===0){e.preventDefault(),i.focus();return}const a=document.activeElement,o=a instanceof HTMLElement?r.indexOf(a):-1,_=e.shiftKey?o<=0?r.length-1:o-1:o===-1||o===r.length-1?0:o+1;(o===-1||e.shiftKey&&o===0||!e.shiftKey&&o===r.length-1)&&(e.preventDefault(),r[_]?.focus())}function BL(e){const i=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");return Array.from(e.querySelectorAll(i)).filter(r=>!r.hasAttribute("hidden")&&r.offsetParent!==null)}function IL(e,i){if(!i)return Ae(e);const r=e.toLocaleLowerCase(),a=i.toLocaleLowerCase();if(!a)return Ae(e);let o=0,_="";for(;o<e.length;){const m=r.indexOf(a,o);if(m===-1)break;_+=Ae(e.slice(o,m)),_+=`<mark class="command-highlight">${Ae(e.slice(m,m+i.length))}</mark>`,o=m+i.length}return _+Ae(e.slice(o))}function jL(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 zL(e){const i=e.matchedSnippets?.find(a=>a.field==="body")?.snippet;if(e.reason!=="body")return"";const r=i??e.excerpt;return $L(r??"")}function $L(e){return PL(HL(e)).replace(/\s+/g," ").trim().slice(0,180)}function HL(e){return e.replace(/<<<[^>]*>>>/g," ")}function PL(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 Wg(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var sa=Wg();function Aw(e){sa=e}var Al={exec:()=>null};function ct(e,i=""){let r=typeof e=="string"?e:e.source,a={replace:(o,_)=>{let m=typeof _=="string"?_:_.source;return m=m.replace(zi.caret,"$1"),r=r.replace(o,m),a},getRegex:()=>new RegExp(r,i)};return a}var UL=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),zi={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")},FL=/^(?:[ \t]*(?:\n|$))+/,qL=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,WL=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ql=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,GL=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Gg=/(?:[*+-]|\d{1,9}[.)])/,kw=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Rw=ct(kw).replace(/bull/g,Gg).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(),KL=ct(kw).replace(/bull/g,Gg).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(),Kg=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,VL=/^[^\n]+/,Vg=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,YL=ct(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Vg).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),XL=ct(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Gg).getRegex(),_h="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",Yg=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ZL=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",Yg).replace("tag",_h).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Lw=ct(Kg).replace("hr",ql).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",_h).getRegex(),JL=ct(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Lw).getRegex(),Xg={blockquote:JL,code:qL,def:YL,fences:WL,heading:GL,hr:ql,html:ZL,lheading:Rw,list:XL,newline:FL,paragraph:Lw,table:Al,text:VL},p1=ct("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ql).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",_h).getRegex(),QL={...Xg,lheading:KL,table:p1,paragraph:ct(Kg).replace("hr",ql).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",p1).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",_h).getRegex()},eM={...Xg,html:ct(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Yg).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:Al,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ct(Kg).replace("hr",ql).replace("heading",` *#{1,6} *[^
|
|
140
|
+
]`).replace("lheading",Rw).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},tM=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,iM=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Mw=/^( {2,}|\\)\n(?!\s*$)/,nM=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,vh=/[\p{P}\p{S}]/u,Zg=/[\s\p{P}\p{S}]/u,Dw=/[^\s\p{P}\p{S}]/u,rM=ct(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Zg).getRegex(),Ow=/(?!~)[\p{P}\p{S}]/u,sM=/(?!~)[\s\p{P}\p{S}]/u,aM=/(?:[^\s\p{P}\p{S}]|~)/u,oM=ct(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",UL?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Nw=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,lM=ct(Nw,"u").replace(/punct/g,vh).getRegex(),cM=ct(Nw,"u").replace(/punct/g,Ow).getRegex(),Bw="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",uM=ct(Bw,"gu").replace(/notPunctSpace/g,Dw).replace(/punctSpace/g,Zg).replace(/punct/g,vh).getRegex(),hM=ct(Bw,"gu").replace(/notPunctSpace/g,aM).replace(/punctSpace/g,sM).replace(/punct/g,Ow).getRegex(),dM=ct("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Dw).replace(/punctSpace/g,Zg).replace(/punct/g,vh).getRegex(),fM=ct(/\\(punct)/,"gu").replace(/punct/g,vh).getRegex(),pM=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(),gM=ct(Yg).replace("(?:-->|$)","-->").getRegex(),mM=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",gM).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Gu=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,_M=ct(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Gu).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Iw=ct(/^!?\[(label)\]\[(ref)\]/).replace("label",Gu).replace("ref",Vg).getRegex(),jw=ct(/^!?\[(ref)\](?:\[\])?/).replace("ref",Vg).getRegex(),vM=ct("reflink|nolink(?!\\()","g").replace("reflink",Iw).replace("nolink",jw).getRegex(),g1=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Jg={_backpedal:Al,anyPunctuation:fM,autolink:pM,blockSkip:oM,br:Mw,code:iM,del:Al,emStrongLDelim:lM,emStrongRDelimAst:uM,emStrongRDelimUnd:dM,escape:tM,link:_M,nolink:jw,punctuation:rM,reflink:Iw,reflinkSearch:vM,tag:mM,text:nM,url:Al},bM={...Jg,link:ct(/^!?\[(label)\]\((.*?)\)/).replace("label",Gu).getRegex(),reflink:ct(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Gu).getRegex()},eg={...Jg,emStrongRDelimAst:hM,emStrongLDelim:cM,url:ct(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",g1).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",g1).getRegex()},yM={...eg,br:ct(Mw).replace("{2,}","*").getRegex(),text:ct(eg.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},hu={normal:Xg,gfm:QL,pedantic:eM},dl={normal:Jg,gfm:eg,breaks:yM,pedantic:bM},SM={"&":"&","<":"<",">":">",'"':""","'":"'"},m1=e=>SM[e];function Jn(e,i){if(i){if(zi.escapeTest.test(e))return e.replace(zi.escapeReplace,m1)}else if(zi.escapeTestNoEncode.test(e))return e.replace(zi.escapeReplaceNoEncode,m1);return e}function _1(e){try{e=encodeURI(e).replace(zi.percentDecode,"%")}catch{return null}return e}function v1(e,i){let r=e.replace(zi.findPipe,(_,m,c)=>{let u=!1,h=m;for(;--h>=0&&c[h]==="\\";)u=!u;return u?"|":" |"}),a=r.split(zi.splitPipe),o=0;if(a[0].trim()||a.shift(),a.length>0&&!a.at(-1)?.trim()&&a.pop(),i)if(a.length>i)a.splice(i);else for(;a.length<i;)a.push("");for(;o<a.length;o++)a[o]=a[o].trim().replace(zi.slashPipe,"|");return a}function fl(e,i,r){let a=e.length;if(a===0)return"";let o=0;for(;o<a&&e.charAt(a-o-1)===i;)o++;return e.slice(0,a-o)}function wM(e,i){if(e.indexOf(i[1])===-1)return-1;let r=0;for(let a=0;a<e.length;a++)if(e[a]==="\\")a++;else if(e[a]===i[0])r++;else if(e[a]===i[1]&&(r--,r<0))return a;return r>0?-2:-1}function b1(e,i,r,a,o){let _=i.href,m=i.title||null,c=e[1].replace(o.other.outputLinkReplace,"$1");a.state.inLink=!0;let u={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:_,title:m,text:c,tokens:a.inlineTokens(c)};return a.state.inLink=!1,u}function CM(e,i,r){let a=e.match(r.other.indentCodeCompensation);if(a===null)return i;let o=a[1];return i.split(`
|
|
141
|
+
`).map(_=>{let m=_.match(r.other.beginningSpace);if(m===null)return _;let[c]=m;return c.length>=o.length?_.slice(o.length):_}).join(`
|
|
142
|
+
`)}var Ku=class{options;rules;lexer;constructor(e){this.options=e||sa}space(e){let i=this.rules.block.newline.exec(e);if(i&&i[0].length>0)return{type:"space",raw:i[0]}}code(e){let i=this.rules.block.code.exec(e);if(i){let r=i[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:i[0],codeBlockStyle:"indented",text:this.options.pedantic?r:fl(r,`
|
|
143
|
+
`)}}}fences(e){let i=this.rules.block.fences.exec(e);if(i){let r=i[0],a=CM(r,i[3]||"",this.rules);return{type:"code",raw:r,lang:i[2]?i[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):i[2],text:a}}}heading(e){let i=this.rules.block.heading.exec(e);if(i){let r=i[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:i[0],depth:i[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){let i=this.rules.block.hr.exec(e);if(i)return{type:"hr",raw:fl(i[0],`
|
|
144
|
+
`)}}blockquote(e){let i=this.rules.block.blockquote.exec(e);if(i){let r=fl(i[0],`
|
|
145
|
+
`).split(`
|
|
146
|
+
`),a="",o="",_=[];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(`
|
|
147
|
+
`),b=h.replace(this.rules.other.blockquoteSetextReplace,`
|
|
148
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");a=a?`${a}
|
|
149
|
+
${h}`:h,o=o?`${o}
|
|
150
|
+
${b}`:b;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(b,_,!0),this.lexer.state.top=f,r.length===0)break;let C=_.at(-1);if(C?.type==="code")break;if(C?.type==="blockquote"){let E=C,A=E.raw+`
|
|
151
|
+
`+r.join(`
|
|
152
|
+
`),x=this.blockquote(A);_[_.length-1]=x,a=a.substring(0,a.length-E.raw.length)+x.raw,o=o.substring(0,o.length-E.text.length)+x.text;break}else if(C?.type==="list"){let E=C,A=E.raw+`
|
|
153
|
+
`+r.join(`
|
|
154
|
+
`),x=this.list(A);_[_.length-1]=x,a=a.substring(0,a.length-C.raw.length)+x.raw,o=o.substring(0,o.length-E.raw.length)+x.raw,r=A.substring(_.at(-1).raw.length).split(`
|
|
155
|
+
`);continue}}return{type:"blockquote",raw:a,tokens:_,text:o}}}list(e){let i=this.rules.block.list.exec(e);if(i){let r=i[1].trim(),a=r.length>1,o={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 _=this.rules.other.listItemRegex(r),m=!1;for(;e;){let u=!1,h="",b="";if(!(i=_.exec(e))||this.rules.block.hr.test(e))break;h=i[0],e=e.substring(h.length);let f=i[2].split(`
|
|
156
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,y=>" ".repeat(3*y.length)),C=e.split(`
|
|
157
|
+
`,1)[0],E=!f.trim(),A=0;if(this.options.pedantic?(A=2,b=f.trimStart()):E?A=i[1].length+1:(A=i[2].search(this.rules.other.nonSpaceChar),A=A>4?1:A,b=f.slice(A),A+=i[1].length),E&&this.rules.other.blankLine.test(C)&&(h+=C+`
|
|
158
|
+
`,e=e.substring(C.length+1),u=!0),!u){let y=this.rules.other.nextBulletRegex(A),d=this.rules.other.hrRegex(A),v=this.rules.other.fencesBeginRegex(A),T=this.rules.other.headingBeginRegex(A),R=this.rules.other.htmlBeginRegex(A);for(;e;){let L=e.split(`
|
|
159
|
+
`,1)[0],M;if(C=L,this.options.pedantic?(C=C.replace(this.rules.other.listReplaceNesting," "),M=C):M=C.replace(this.rules.other.tabCharGlobal," "),v.test(C)||T.test(C)||R.test(C)||y.test(C)||d.test(C))break;if(M.search(this.rules.other.nonSpaceChar)>=A||!C.trim())b+=`
|
|
160
|
+
`+M.slice(A);else{if(E||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||v.test(f)||T.test(f)||d.test(f))break;b+=`
|
|
161
|
+
`+C}!E&&!C.trim()&&(E=!0),h+=L+`
|
|
162
|
+
`,e=e.substring(L.length+1),f=M.slice(A)}}o.loose||(m?o.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(m=!0));let x=null,p;this.options.gfm&&(x=this.rules.other.listIsTask.exec(b),x&&(p=x[0]!=="[ ] ",b=b.replace(this.rules.other.listReplaceTask,""))),o.items.push({type:"list_item",raw:h,task:!!x,checked:p,loose:!1,text:b,tokens:[]}),o.raw+=h}let c=o.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let u=0;u<o.items.length;u++)if(this.lexer.state.top=!1,o.items[u].tokens=this.lexer.blockTokens(o.items[u].text,[]),!o.loose){let h=o.items[u].tokens.filter(f=>f.type==="space"),b=h.length>0&&h.some(f=>this.rules.other.anyLine.test(f.raw));o.loose=b}if(o.loose)for(let u=0;u<o.items.length;u++)o.items[u].loose=!0;return o}}html(e){let i=this.rules.block.html.exec(e);if(i)return{type:"html",block:!0,raw:i[0],pre:i[1]==="pre"||i[1]==="script"||i[1]==="style",text:i[0]}}def(e){let i=this.rules.block.def.exec(e);if(i){let r=i[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),a=i[2]?i[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=i[3]?i[3].substring(1,i[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):i[3];return{type:"def",tag:r,raw:i[0],href:a,title:o}}}table(e){let i=this.rules.block.table.exec(e);if(!i||!this.rules.other.tableDelimiter.test(i[2]))return;let r=v1(i[1]),a=i[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=i[3]?.trim()?i[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
163
|
+
`):[],_={type:"table",raw:i[0],header:[],align:[],rows:[]};if(r.length===a.length){for(let m of a)this.rules.other.tableAlignRight.test(m)?_.align.push("right"):this.rules.other.tableAlignCenter.test(m)?_.align.push("center"):this.rules.other.tableAlignLeft.test(m)?_.align.push("left"):_.align.push(null);for(let m=0;m<r.length;m++)_.header.push({text:r[m],tokens:this.lexer.inline(r[m]),header:!0,align:_.align[m]});for(let m of o)_.rows.push(v1(m,_.header.length).map((c,u)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:_.align[u]})));return _}}lheading(e){let i=this.rules.block.lheading.exec(e);if(i)return{type:"heading",raw:i[0],depth:i[2].charAt(0)==="="?1:2,text:i[1],tokens:this.lexer.inline(i[1])}}paragraph(e){let i=this.rules.block.paragraph.exec(e);if(i){let r=i[1].charAt(i[1].length-1)===`
|
|
164
|
+
`?i[1].slice(0,-1):i[1];return{type:"paragraph",raw:i[0],text:r,tokens:this.lexer.inline(r)}}}text(e){let i=this.rules.block.text.exec(e);if(i)return{type:"text",raw:i[0],text:i[0],tokens:this.lexer.inline(i[0])}}escape(e){let i=this.rules.inline.escape.exec(e);if(i)return{type:"escape",raw:i[0],text:i[1]}}tag(e){let i=this.rules.inline.tag.exec(e);if(i)return!this.lexer.state.inLink&&this.rules.other.startATag.test(i[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(i[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(i[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(i[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:i[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:i[0]}}link(e){let i=this.rules.inline.link.exec(e);if(i){let r=i[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let _=fl(r.slice(0,-1),"\\");if((r.length-_.length)%2===0)return}else{let _=wM(i[2],"()");if(_===-2)return;if(_>-1){let m=(i[0].indexOf("!")===0?5:4)+i[1].length+_;i[2]=i[2].substring(0,_),i[0]=i[0].substring(0,m).trim(),i[3]=""}}let a=i[2],o="";if(this.options.pedantic){let _=this.rules.other.pedanticHrefTitle.exec(a);_&&(a=_[1],o=_[3])}else o=i[3]?i[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)),b1(i,{href:a&&a.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},i[0],this.lexer,this.rules)}}reflink(e,i){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," "),o=i[a.toLowerCase()];if(!o){let _=r[0].charAt(0);return{type:"text",raw:_,text:_}}return b1(r,o,r[0],this.lexer,this.rules)}}emStrong(e,i,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 o=[...a[0]].length-1,_,m,c=o,u=0,h=a[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,i=i.slice(-1*e.length+o);(a=h.exec(i))!=null;){if(_=a[1]||a[2]||a[3]||a[4]||a[5]||a[6],!_)continue;if(m=[..._].length,a[3]||a[4]){c+=m;continue}else if((a[5]||a[6])&&o%3&&!((o+m)%3)){u+=m;continue}if(c-=m,c>0)continue;m=Math.min(m,m+c+u);let b=[...a[0]][0].length,f=e.slice(0,o+a.index+b+m);if(Math.min(o,m)%2){let E=f.slice(1,-1);return{type:"em",raw:f,text:E,tokens:this.lexer.inlineTokens(E)}}let C=f.slice(2,-2);return{type:"strong",raw:f,text:C,tokens:this.lexer.inlineTokens(C)}}}}codespan(e){let i=this.rules.inline.code.exec(e);if(i){let r=i[2].replace(this.rules.other.newLineCharGlobal," "),a=this.rules.other.nonSpaceChar.test(r),o=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return a&&o&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:i[0],text:r}}}br(e){let i=this.rules.inline.br.exec(e);if(i)return{type:"br",raw:i[0]}}del(e){let i=this.rules.inline.del.exec(e);if(i)return{type:"del",raw:i[0],text:i[2],tokens:this.lexer.inlineTokens(i[2])}}autolink(e){let i=this.rules.inline.autolink.exec(e);if(i){let r,a;return i[2]==="@"?(r=i[1],a="mailto:"+r):(r=i[1],a=r),{type:"link",raw:i[0],text:r,href:a,tokens:[{type:"text",raw:r,text:r}]}}}url(e){let i;if(i=this.rules.inline.url.exec(e)){let r,a;if(i[2]==="@")r=i[0],a="mailto:"+r;else{let o;do o=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])?.[0]??"";while(o!==i[0]);r=i[0],i[1]==="www."?a="http://"+i[0]:a=i[0]}return{type:"link",raw:i[0],text:r,href:a,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){let i=this.rules.inline.text.exec(e);if(i){let r=this.lexer.state.inRawBlock;return{type:"text",raw:i[0],text:i[0],escaped:r}}}},zn=class tg{tokens;options;state;tokenizer;inlineQueue;constructor(i){this.tokens=[],this.tokens.links=Object.create(null),this.options=i||sa,this.options.tokenizer=this.options.tokenizer||new Ku,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:zi,block:hu.normal,inline:dl.normal};this.options.pedantic?(r.block=hu.pedantic,r.inline=dl.pedantic):this.options.gfm&&(r.block=hu.gfm,this.options.breaks?r.inline=dl.breaks:r.inline=dl.gfm),this.tokenizer.rules=r}static get rules(){return{block:hu,inline:dl}}static lex(i,r){return new tg(r).lex(i)}static lexInline(i,r){return new tg(r).inlineTokens(i)}lex(i){i=i.replace(zi.carriageReturn,`
|
|
165
|
+
`),this.blockTokens(i,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(i,r=[],a=!1){for(this.options.pedantic&&(i=i.replace(zi.tabCharGlobal," ").replace(zi.spaceLine,""));i;){let o;if(this.options.extensions?.block?.some(m=>(o=m.call({lexer:this},i,r))?(i=i.substring(o.raw.length),r.push(o),!0):!1))continue;if(o=this.tokenizer.space(i)){i=i.substring(o.raw.length);let m=r.at(-1);o.raw.length===1&&m!==void 0?m.raw+=`
|
|
166
|
+
`:r.push(o);continue}if(o=this.tokenizer.code(i)){i=i.substring(o.raw.length);let m=r.at(-1);m?.type==="paragraph"||m?.type==="text"?(m.raw+=(m.raw.endsWith(`
|
|
167
|
+
`)?"":`
|
|
168
|
+
`)+o.raw,m.text+=`
|
|
169
|
+
`+o.text,this.inlineQueue.at(-1).src=m.text):r.push(o);continue}if(o=this.tokenizer.fences(i)){i=i.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.heading(i)){i=i.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.hr(i)){i=i.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.blockquote(i)){i=i.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.list(i)){i=i.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.html(i)){i=i.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.def(i)){i=i.substring(o.raw.length);let m=r.at(-1);m?.type==="paragraph"||m?.type==="text"?(m.raw+=(m.raw.endsWith(`
|
|
170
|
+
`)?"":`
|
|
171
|
+
`)+o.raw,m.text+=`
|
|
172
|
+
`+o.raw,this.inlineQueue.at(-1).src=m.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title},r.push(o));continue}if(o=this.tokenizer.table(i)){i=i.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.lheading(i)){i=i.substring(o.raw.length),r.push(o);continue}let _=i;if(this.options.extensions?.startBlock){let m=1/0,c=i.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&&(_=i.substring(0,m+1))}if(this.state.top&&(o=this.tokenizer.paragraph(_))){let m=r.at(-1);a&&m?.type==="paragraph"?(m.raw+=(m.raw.endsWith(`
|
|
173
|
+
`)?"":`
|
|
174
|
+
`)+o.raw,m.text+=`
|
|
175
|
+
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=m.text):r.push(o),a=_.length!==i.length,i=i.substring(o.raw.length);continue}if(o=this.tokenizer.text(i)){i=i.substring(o.raw.length);let m=r.at(-1);m?.type==="text"?(m.raw+=(m.raw.endsWith(`
|
|
176
|
+
`)?"":`
|
|
177
|
+
`)+o.raw,m.text+=`
|
|
178
|
+
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=m.text):r.push(o);continue}if(i){let m="Infinite loop on byte: "+i.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return this.state.top=!0,r}inline(i,r=[]){return this.inlineQueue.push({src:i,tokens:r}),r}inlineTokens(i,r=[]){let a=i,o=null;if(this.tokens.links){let u=Object.keys(this.tokens.links);if(u.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null;)u.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(a))!=null;)a=a.slice(0,o.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let _;for(;(o=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)_=o[2]?o[2].length:0,a=a.slice(0,o.index+_)+"["+"a".repeat(o[0].length-_-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);a=this.options.hooks?.emStrongMask?.call({lexer:this},a)??a;let m=!1,c="";for(;i;){m||(c=""),m=!1;let u;if(this.options.extensions?.inline?.some(b=>(u=b.call({lexer:this},i,r))?(i=i.substring(u.raw.length),r.push(u),!0):!1))continue;if(u=this.tokenizer.escape(i)){i=i.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.tag(i)){i=i.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.link(i)){i=i.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.reflink(i,this.tokens.links)){i=i.substring(u.raw.length);let b=r.at(-1);u.type==="text"&&b?.type==="text"?(b.raw+=u.raw,b.text+=u.text):r.push(u);continue}if(u=this.tokenizer.emStrong(i,a,c)){i=i.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.codespan(i)){i=i.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.br(i)){i=i.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.del(i)){i=i.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.autolink(i)){i=i.substring(u.raw.length),r.push(u);continue}if(!this.state.inLink&&(u=this.tokenizer.url(i))){i=i.substring(u.raw.length),r.push(u);continue}let h=i;if(this.options.extensions?.startInline){let b=1/0,f=i.slice(1),C;this.options.extensions.startInline.forEach(E=>{C=E.call({lexer:this},f),typeof C=="number"&&C>=0&&(b=Math.min(b,C))}),b<1/0&&b>=0&&(h=i.substring(0,b+1))}if(u=this.tokenizer.inlineText(h)){i=i.substring(u.raw.length),u.raw.slice(-1)!=="_"&&(c=u.raw.slice(-1)),m=!0;let b=r.at(-1);b?.type==="text"?(b.raw+=u.raw,b.text+=u.text):r.push(u);continue}if(i){let b="Infinite loop on byte: "+i.charCodeAt(0);if(this.options.silent){console.error(b);break}else throw new Error(b)}}return r}},Vu=class{options;parser;constructor(e){this.options=e||sa}space(e){return""}code({text:e,lang:i,escaped:r}){let a=(i||"").match(zi.notSpaceStart)?.[0],o=e.replace(zi.endingNewline,"")+`
|
|
179
|
+
`;return a?'<pre><code class="language-'+Jn(a)+'">'+(r?o:Jn(o,!0))+`</code></pre>
|
|
180
|
+
`:"<pre><code>"+(r?o:Jn(o,!0))+`</code></pre>
|
|
181
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
|
182
|
+
${this.parser.parse(e)}</blockquote>
|
|
183
|
+
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:i}){return`<h${i}>${this.parser.parseInline(e)}</h${i}>
|
|
184
|
+
`}hr(e){return`<hr>
|
|
185
|
+
`}list(e){let i=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 o=i?"ol":"ul",_=i&&r!==1?' start="'+r+'"':"";return"<"+o+_+`>
|
|
186
|
+
`+a+"</"+o+`>
|
|
187
|
+
`}listitem(e){let i="";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+" "+Jn(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):i+=r+" "}return i+=this.parser.parse(e.tokens,!!e.loose),`<li>${i}</li>
|
|
188
|
+
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
189
|
+
`}table(e){let i="",r="";for(let o=0;o<e.header.length;o++)r+=this.tablecell(e.header[o]);i+=this.tablerow({text:r});let a="";for(let o=0;o<e.rows.length;o++){let _=e.rows[o];r="";for(let m=0;m<_.length;m++)r+=this.tablecell(_[m]);a+=this.tablerow({text:r})}return a&&(a=`<tbody>${a}</tbody>`),`<table>
|
|
190
|
+
<thead>
|
|
191
|
+
`+i+`</thead>
|
|
192
|
+
`+a+`</table>
|
|
193
|
+
`}tablerow({text:e}){return`<tr>
|
|
194
|
+
${e}</tr>
|
|
195
|
+
`}tablecell(e){let i=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+i+`</${r}>
|
|
196
|
+
`}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>${Jn(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:i,tokens:r}){let a=this.parser.parseInline(r),o=_1(e);if(o===null)return a;e=o;let _='<a href="'+e+'"';return i&&(_+=' title="'+Jn(i)+'"'),_+=">"+a+"</a>",_}image({href:e,title:i,text:r,tokens:a}){a&&(r=this.parser.parseInline(a,this.parser.textRenderer));let o=_1(e);if(o===null)return Jn(r);e=o;let _=`<img src="${e}" alt="${r}"`;return i&&(_+=` title="${Jn(i)}"`),_+=">",_}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Jn(e.text)}},Qg=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""}},$n=class ig{options;renderer;textRenderer;constructor(i){this.options=i||sa,this.options.renderer=this.options.renderer||new Vu,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Qg}static parse(i,r){return new ig(r).parse(i)}static parseInline(i,r){return new ig(r).parseInline(i)}parse(i,r=!0){let a="";for(let o=0;o<i.length;o++){let _=i[o];if(this.options.extensions?.renderers?.[_.type]){let c=_,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=_;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(;o+1<i.length&&i[o+1].type==="text";)c=i[++o],u+=`
|
|
197
|
+
`+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(i,r=this.renderer){let a="";for(let o=0;o<i.length;o++){let _=i[o];if(this.options.extensions?.renderers?.[_.type]){let c=this.options.extensions.renderers[_.type].call({parser:this},_);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(_.type)){a+=c||"";continue}}let m=_;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}},Sl=class{options;block;constructor(e){this.options=e||sa}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?zn.lex:zn.lexInline}provideParser(){return this.block?$n.parse:$n.parseInline}},zw=class{defaults=Wg();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=$n;Renderer=Vu;TextRenderer=Qg;Lexer=zn;Tokenizer=Ku;Hooks=Sl;constructor(...e){this.use(...e)}walkTokens(e,i){let r=[];for(let a of e)switch(r=r.concat(i.call(this,a)),a.type){case"table":{let o=a;for(let _ of o.header)r=r.concat(this.walkTokens(_.tokens,i));for(let _ of o.rows)for(let m of _)r=r.concat(this.walkTokens(m.tokens,i));break}case"list":{let o=a;r=r.concat(this.walkTokens(o.items,i));break}default:{let o=a;this.defaults.extensions?.childTokens?.[o.type]?this.defaults.extensions.childTokens[o.type].forEach(_=>{let m=o[_].flat(1/0);r=r.concat(this.walkTokens(m,i))}):o.tokens&&(r=r.concat(this.walkTokens(o.tokens,i)))}}return r}use(...e){let i=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(r=>{let a={...r};if(a.async=this.defaults.async||a.async||!1,r.extensions&&(r.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let _=i.renderers[o.name];_?i.renderers[o.name]=function(...m){let c=o.renderer.apply(this,m);return c===!1&&(c=_.apply(this,m)),c}:i.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let _=i[o.level];_?_.unshift(o.tokenizer):i[o.level]=[o.tokenizer],o.start&&(o.level==="block"?i.startBlock?i.startBlock.push(o.start):i.startBlock=[o.start]:o.level==="inline"&&(i.startInline?i.startInline.push(o.start):i.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(i.childTokens[o.name]=o.childTokens)}),a.extensions=i),r.renderer){let o=this.defaults.renderer||new Vu(this.defaults);for(let _ in r.renderer){if(!(_ in o))throw new Error(`renderer '${_}' does not exist`);if(["options","parser"].includes(_))continue;let m=_,c=r.renderer[m],u=o[m];o[m]=(...h)=>{let b=c.apply(o,h);return b===!1&&(b=u.apply(o,h)),b||""}}a.renderer=o}if(r.tokenizer){let o=this.defaults.tokenizer||new Ku(this.defaults);for(let _ in r.tokenizer){if(!(_ in o))throw new Error(`tokenizer '${_}' does not exist`);if(["options","rules","lexer"].includes(_))continue;let m=_,c=r.tokenizer[m],u=o[m];o[m]=(...h)=>{let b=c.apply(o,h);return b===!1&&(b=u.apply(o,h)),b}}a.tokenizer=o}if(r.hooks){let o=this.defaults.hooks||new Sl;for(let _ in r.hooks){if(!(_ in o))throw new Error(`hook '${_}' does not exist`);if(["options","block"].includes(_))continue;let m=_,c=r.hooks[m],u=o[m];Sl.passThroughHooks.has(_)?o[m]=h=>{if(this.defaults.async&&Sl.passThroughHooksRespectAsync.has(_))return(async()=>{let f=await c.call(o,h);return u.call(o,f)})();let b=c.call(o,h);return u.call(o,b)}:o[m]=(...h)=>{if(this.defaults.async)return(async()=>{let f=await c.apply(o,h);return f===!1&&(f=await u.apply(o,h)),f})();let b=c.apply(o,h);return b===!1&&(b=u.apply(o,h)),b}}a.hooks=o}if(r.walkTokens){let o=this.defaults.walkTokens,_=r.walkTokens;a.walkTokens=function(m){let c=[];return c.push(_.call(this,m)),o&&(c=c.concat(o.call(this,m))),c}}this.defaults={...this.defaults,...a}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,i){return zn.lex(e,i??this.defaults)}parser(e,i){return $n.parse(e,i??this.defaults)}parseMarkdown(e){return(i,r)=>{let a={...r},o={...this.defaults,...a},_=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&a.async===!1)return _(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 i>"u"||i===null)return _(new Error("marked(): input parameter is undefined or null"));if(typeof i!="string")return _(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(i)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=e),o.async)return(async()=>{let m=o.hooks?await o.hooks.preprocess(i):i,c=await(o.hooks?await o.hooks.provideLexer():e?zn.lex:zn.lexInline)(m,o),u=o.hooks?await o.hooks.processAllTokens(c):c;o.walkTokens&&await Promise.all(this.walkTokens(u,o.walkTokens));let h=await(o.hooks?await o.hooks.provideParser():e?$n.parse:$n.parseInline)(u,o);return o.hooks?await o.hooks.postprocess(h):h})().catch(_);try{o.hooks&&(i=o.hooks.preprocess(i));let m=(o.hooks?o.hooks.provideLexer():e?zn.lex:zn.lexInline)(i,o);o.hooks&&(m=o.hooks.processAllTokens(m)),o.walkTokens&&this.walkTokens(m,o.walkTokens);let c=(o.hooks?o.hooks.provideParser():e?$n.parse:$n.parseInline)(m,o);return o.hooks&&(c=o.hooks.postprocess(c)),c}catch(m){return _(m)}}}onError(e,i){return r=>{if(r.message+=`
|
|
198
|
+
Please report this to https://github.com/markedjs/marked.`,e){let a="<p>An error occurred:</p><pre>"+Jn(r.message+"",!0)+"</pre>";return i?Promise.resolve(a):a}if(i)return Promise.reject(r);throw r}}},ia=new zw;function yt(e,i){return ia.parse(e,i)}yt.options=yt.setOptions=function(e){return ia.setOptions(e),yt.defaults=ia.defaults,Aw(yt.defaults),yt};yt.getDefaults=Wg;yt.defaults=sa;yt.use=function(...e){return ia.use(...e),yt.defaults=ia.defaults,Aw(yt.defaults),yt};yt.walkTokens=function(e,i){return ia.walkTokens(e,i)};yt.parseInline=ia.parseInline;yt.Parser=$n;yt.parser=$n.parse;yt.Renderer=Vu;yt.TextRenderer=Qg;yt.Lexer=zn;yt.lexer=zn.lex;yt.Tokenizer=Ku;yt.Hooks=Sl;yt.parse=yt;yt.options;yt.setOptions;yt.use;yt.walkTokens;yt.parseInline;$n.parse;zn.lex;const{entries:$w,setPrototypeOf:y1,isFrozen:xM,getPrototypeOf:EM,getOwnPropertyDescriptor:TM}=Object;let{freeze:$i,seal:Rn,create:Ga}=Object,{apply:ng,construct:rg}=typeof Reflect<"u"&&Reflect;$i||($i=function(i){return i});Rn||(Rn=function(i){return i});ng||(ng=function(i,r){for(var a=arguments.length,o=new Array(a>2?a-2:0),_=2;_<a;_++)o[_-2]=arguments[_];return i.apply(r,o)});rg||(rg=function(i){for(var r=arguments.length,a=new Array(r>1?r-1:0),o=1;o<r;o++)a[o-1]=arguments[o];return new i(...a)});const pl=ui(Array.prototype.forEach),AM=ui(Array.prototype.lastIndexOf),S1=ui(Array.prototype.pop),gl=ui(Array.prototype.push),kM=ui(Array.prototype.splice),Ii=Array.isArray,wl=ui(String.prototype.toLowerCase),rp=ui(String.prototype.toString),w1=ui(String.prototype.match),qa=ui(String.prototype.replace),C1=ui(String.prototype.indexOf),RM=ui(String.prototype.trim),LM=ui(Number.prototype.toString),MM=ui(Boolean.prototype.toString),x1=typeof BigInt>"u"?null:ui(BigInt.prototype.toString),E1=typeof Symbol>"u"?null:ui(Symbol.prototype.toString),Wt=ui(Object.prototype.hasOwnProperty),ml=ui(Object.prototype.toString),Ti=ui(RegExp.prototype.test),du=DM(TypeError);function ui(e){return function(i){i instanceof RegExp&&(i.lastIndex=0);for(var r=arguments.length,a=new Array(r>1?r-1:0),o=1;o<r;o++)a[o-1]=arguments[o];return ng(e,i,a)}}function DM(e){return function(){for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return rg(e,r)}}function Ke(e,i){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:wl;if(y1&&y1(e,null),!Ii(i))return e;let a=i.length;for(;a--;){let o=i[a];if(typeof o=="string"){const _=r(o);_!==o&&(xM(i)||(i[a]=_),o=_)}e[o]=!0}return e}function OM(e){for(let i=0;i<e.length;i++)Wt(e,i)||(e[i]=null);return e}function Zi(e){const i=Ga(null);for(const[r,a]of $w(e))Wt(e,r)&&(Ii(a)?i[r]=OM(a):a&&typeof a=="object"&&a.constructor===Object?i[r]=Zi(a):i[r]=a);return i}function NM(e){switch(typeof e){case"string":return e;case"number":return LM(e);case"boolean":return MM(e);case"bigint":return x1?x1(e):"0";case"symbol":return E1?E1(e):"Symbol()";case"undefined":return ml(e);case"function":case"object":{if(e===null)return ml(e);const i=e,r=Ka(i,"toString");if(typeof r=="function"){const a=r(i);return typeof a=="string"?a:ml(a)}return ml(e)}default:return ml(e)}}function Ka(e,i){for(;e!==null;){const a=TM(e,i);if(a){if(a.get)return ui(a.get);if(typeof a.value=="function")return ui(a.value)}e=EM(e)}function r(){return null}return r}function BM(e){try{return Ti(e,""),!0}catch{return!1}}const T1=$i(["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"]),sp=$i(["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"]),ap=$i(["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"]),IM=$i(["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"]),op=$i(["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"]),jM=$i(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),A1=$i(["#text"]),k1=$i(["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"]),lp=$i(["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"]),R1=$i(["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"]),fu=$i(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),zM=Rn(/\{\{[\w\W]*|[\w\W]*\}\}/gm),$M=Rn(/<%[\w\W]*|[\w\W]*%>/gm),HM=Rn(/\$\{[\w\W]*/gm),PM=Rn(/^data-[\-\w.\u00B7-\uFFFF]+$/),UM=Rn(/^aria-[\-\w]+$/),Hw=Rn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),FM=Rn(/^(?:\w+script|data):/i),qM=Rn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Pw=Rn(/^html$/i),WM=Rn(/^[a-z][.\w]*(-[.\w]+)+$/i);var L1=Object.freeze({__proto__:null,ARIA_ATTR:UM,ATTR_WHITESPACE:qM,CUSTOM_ELEMENT:WM,DATA_ATTR:PM,DOCTYPE_NAME:Pw,ERB_EXPR:$M,IS_ALLOWED_URI:Hw,IS_SCRIPT_OR_DATA:FM,MUSTACHE_EXPR:zM,TMPLIT_EXPR:HM});const _l={element:1,text:3,progressingInstruction:7,comment:8,document:9},GM=function(){return typeof window>"u"?null:window},KM=function(i,r){if(typeof i!="object"||typeof i.createPolicy!="function")return null;let a=null;const o="data-tt-policy-suffix";r&&r.hasAttribute(o)&&(a=r.getAttribute(o));const _="dompurify"+(a?"#"+a:"");try{return i.createPolicy(_,{createHTML(m){return m},createScriptURL(m){return m}})}catch{return console.warn("TrustedTypes policy "+_+" could not be created."),null}},M1=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Uw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:GM();const i=De=>Uw(De);if(i.version="3.4.2",i.removed=[],!e||!e.document||e.document.nodeType!==_l.document||!e.Element)return i.isSupported=!1,i;let{document:r}=e;const a=r,o=a.currentScript,{DocumentFragment:_,HTMLTemplateElement:m,Node:c,Element:u,NodeFilter:h,NamedNodeMap:b=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:f,DOMParser:C,trustedTypes:E}=e,A=u.prototype,x=Ka(A,"cloneNode"),p=Ka(A,"remove"),y=Ka(A,"nextSibling"),d=Ka(A,"childNodes"),v=Ka(A,"parentNode");if(typeof m=="function"){const De=r.createElement("template");De.content&&De.content.ownerDocument&&(r=De.content.ownerDocument)}let T,R="";const{implementation:L,createNodeIterator:M,createDocumentFragment:k,getElementsByTagName:B}=r,{importNode:W}=a;let F=M1();i.isSupported=typeof $w=="function"&&typeof v=="function"&&L&&L.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:q,ERB_EXPR:I,TMPLIT_EXPR:G,DATA_ATTR:te,ARIA_ATTR:P,IS_SCRIPT_OR_DATA:V,ATTR_WHITESPACE:X,CUSTOM_ELEMENT:N}=L1;let{IS_ALLOWED_URI:z}=L1,O=null;const H=Ke({},[...T1,...sp,...ap,...op,...A1]);let Z=null;const ae=Ke({},[...k1,...lp,...R1,...fu]);let ce=Object.seal(Ga(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 $=Object.seal(Ga(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,$e=!1,Fe=!0,Ve=!1,Ct=!1,Ne=!1,Qt=!1,_i=!1,vi=!1,fn=!0,Mn=!1;const ei="user-content-";let ut=!0,Kt=!1,jt={},zt=null;const ti=Ke({},["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 Dn=null;const Ri=Ke({},["audio","video","img","source","image","track"]);let en=null;const dt=Ke({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Hi="http://www.w3.org/1998/Math/MathML",Vt="http://www.w3.org/2000/svg",Yt="http://www.w3.org/1999/xhtml";let $t=Yt,Ss=!1,ar=null;const aa=Ke({},[Hi,Vt,Yt],rp);let On=Ke({},["mi","mo","mn","ms","mtext"]),Wn=Ke({},["annotation-xml"]);const or=Ke({},["title","style","font","a","script"]);let ii=null;const J=["application/xhtml+xml","text/html"],he="text/html";let ve=null,Ie=null;const St=r.createElement("form"),ft=function(K){return K instanceof RegExp||K instanceof Function},Ee=function(){let K=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Ie&&Ie===K)return;(!K||typeof K!="object")&&(K={}),K=Zi(K),ii=J.indexOf(K.PARSER_MEDIA_TYPE)===-1?he:K.PARSER_MEDIA_TYPE,ve=ii==="application/xhtml+xml"?rp:wl,O=Wt(K,"ALLOWED_TAGS")&&Ii(K.ALLOWED_TAGS)?Ke({},K.ALLOWED_TAGS,ve):H,Z=Wt(K,"ALLOWED_ATTR")&&Ii(K.ALLOWED_ATTR)?Ke({},K.ALLOWED_ATTR,ve):ae,ar=Wt(K,"ALLOWED_NAMESPACES")&&Ii(K.ALLOWED_NAMESPACES)?Ke({},K.ALLOWED_NAMESPACES,rp):aa,en=Wt(K,"ADD_URI_SAFE_ATTR")&&Ii(K.ADD_URI_SAFE_ATTR)?Ke(Zi(dt),K.ADD_URI_SAFE_ATTR,ve):dt,Dn=Wt(K,"ADD_DATA_URI_TAGS")&&Ii(K.ADD_DATA_URI_TAGS)?Ke(Zi(Ri),K.ADD_DATA_URI_TAGS,ve):Ri,zt=Wt(K,"FORBID_CONTENTS")&&Ii(K.FORBID_CONTENTS)?Ke({},K.FORBID_CONTENTS,ve):ti,_e=Wt(K,"FORBID_TAGS")&&Ii(K.FORBID_TAGS)?Ke({},K.FORBID_TAGS,ve):Zi({}),Q=Wt(K,"FORBID_ATTR")&&Ii(K.FORBID_ATTR)?Ke({},K.FORBID_ATTR,ve):Zi({}),jt=Wt(K,"USE_PROFILES")?K.USE_PROFILES&&typeof K.USE_PROFILES=="object"?Zi(K.USE_PROFILES):K.USE_PROFILES:!1,oe=K.ALLOW_ARIA_ATTR!==!1,ge=K.ALLOW_DATA_ATTR!==!1,Se=K.ALLOW_UNKNOWN_PROTOCOLS||!1,ye=K.ALLOW_SELF_CLOSE_IN_ATTR!==!1,$e=K.SAFE_FOR_TEMPLATES||!1,Fe=K.SAFE_FOR_XML!==!1,Ve=K.WHOLE_DOCUMENT||!1,Qt=K.RETURN_DOM||!1,_i=K.RETURN_DOM_FRAGMENT||!1,vi=K.RETURN_TRUSTED_TYPE||!1,Ne=K.FORCE_BODY||!1,fn=K.SANITIZE_DOM!==!1,Mn=K.SANITIZE_NAMED_PROPS||!1,ut=K.KEEP_CONTENT!==!1,Kt=K.IN_PLACE||!1,z=BM(K.ALLOWED_URI_REGEXP)?K.ALLOWED_URI_REGEXP:Hw,$t=typeof K.NAMESPACE=="string"?K.NAMESPACE:Yt,On=Wt(K,"MATHML_TEXT_INTEGRATION_POINTS")&&K.MATHML_TEXT_INTEGRATION_POINTS&&typeof K.MATHML_TEXT_INTEGRATION_POINTS=="object"?Zi(K.MATHML_TEXT_INTEGRATION_POINTS):Ke({},["mi","mo","mn","ms","mtext"]),Wn=Wt(K,"HTML_INTEGRATION_POINTS")&&K.HTML_INTEGRATION_POINTS&&typeof K.HTML_INTEGRATION_POINTS=="object"?Zi(K.HTML_INTEGRATION_POINTS):Ke({},["annotation-xml"]);const pe=Wt(K,"CUSTOM_ELEMENT_HANDLING")&&K.CUSTOM_ELEMENT_HANDLING&&typeof K.CUSTOM_ELEMENT_HANDLING=="object"?Zi(K.CUSTOM_ELEMENT_HANDLING):Ga(null);if(ce=Ga(null),Wt(pe,"tagNameCheck")&&ft(pe.tagNameCheck)&&(ce.tagNameCheck=pe.tagNameCheck),Wt(pe,"attributeNameCheck")&&ft(pe.attributeNameCheck)&&(ce.attributeNameCheck=pe.attributeNameCheck),Wt(pe,"allowCustomizedBuiltInElements")&&typeof pe.allowCustomizedBuiltInElements=="boolean"&&(ce.allowCustomizedBuiltInElements=pe.allowCustomizedBuiltInElements),$e&&(ge=!1),_i&&(Qt=!0),jt&&(O=Ke({},A1),Z=Ga(null),jt.html===!0&&(Ke(O,T1),Ke(Z,k1)),jt.svg===!0&&(Ke(O,sp),Ke(Z,lp),Ke(Z,fu)),jt.svgFilters===!0&&(Ke(O,ap),Ke(Z,lp),Ke(Z,fu)),jt.mathMl===!0&&(Ke(O,op),Ke(Z,R1),Ke(Z,fu))),$.tagCheck=null,$.attributeCheck=null,Wt(K,"ADD_TAGS")&&(typeof K.ADD_TAGS=="function"?$.tagCheck=K.ADD_TAGS:Ii(K.ADD_TAGS)&&(O===H&&(O=Zi(O)),Ke(O,K.ADD_TAGS,ve))),Wt(K,"ADD_ATTR")&&(typeof K.ADD_ATTR=="function"?$.attributeCheck=K.ADD_ATTR:Ii(K.ADD_ATTR)&&(Z===ae&&(Z=Zi(Z)),Ke(Z,K.ADD_ATTR,ve))),Wt(K,"ADD_URI_SAFE_ATTR")&&Ii(K.ADD_URI_SAFE_ATTR)&&Ke(en,K.ADD_URI_SAFE_ATTR,ve),Wt(K,"FORBID_CONTENTS")&&Ii(K.FORBID_CONTENTS)&&(zt===ti&&(zt=Zi(zt)),Ke(zt,K.FORBID_CONTENTS,ve)),Wt(K,"ADD_FORBID_CONTENTS")&&Ii(K.ADD_FORBID_CONTENTS)&&(zt===ti&&(zt=Zi(zt)),Ke(zt,K.ADD_FORBID_CONTENTS,ve)),ut&&(O["#text"]=!0),Ve&&Ke(O,["html","head","body"]),O.table&&(Ke(O,["tbody"]),delete _e.tbody),K.TRUSTED_TYPES_POLICY){if(typeof K.TRUSTED_TYPES_POLICY.createHTML!="function")throw du('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof K.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw du('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');T=K.TRUSTED_TYPES_POLICY,R=T.createHTML("")}else T===void 0&&(T=KM(E,o)),T!==null&&typeof R=="string"&&(R=T.createHTML(""));$i&&$i(K),Ie=K},Ce=Ke({},[...sp,...ap,...IM]),je=Ke({},[...op,...jM]),Bt=function(K){let pe=v(K);(!pe||!pe.tagName)&&(pe={namespaceURI:$t,tagName:"template"});const xe=wl(K.tagName),nt=wl(pe.tagName);return ar[K.namespaceURI]?K.namespaceURI===Vt?pe.namespaceURI===Yt?xe==="svg":pe.namespaceURI===Hi?xe==="svg"&&(nt==="annotation-xml"||On[nt]):!!Ce[xe]:K.namespaceURI===Hi?pe.namespaceURI===Yt?xe==="math":pe.namespaceURI===Vt?xe==="math"&&Wn[nt]:!!je[xe]:K.namespaceURI===Yt?pe.namespaceURI===Vt&&!Wn[nt]||pe.namespaceURI===Hi&&!On[nt]?!1:!je[xe]&&(or[xe]||!Ce[xe]):!!(ii==="application/xhtml+xml"&&ar[K.namespaceURI]):!1},Qe=function(K){gl(i.removed,{element:K});try{v(K).removeChild(K)}catch{p(K)}},bi=function(K,pe){try{gl(i.removed,{attribute:pe.getAttributeNode(K),from:pe})}catch{gl(i.removed,{attribute:null,from:pe})}if(pe.removeAttribute(K),K==="is")if(Qt||_i)try{Qe(pe)}catch{}else try{pe.setAttribute(K,"")}catch{}},lr=function(K){let pe=null,xe=null;if(Ne)K="<remove></remove>"+K;else{const At=w1(K,/^[\r\n\t ]+/);xe=At&&At[0]}ii==="application/xhtml+xml"&&$t===Yt&&(K='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+K+"</body></html>");const nt=T?T.createHTML(K):K;if($t===Yt)try{pe=new C().parseFromString(nt,ii)}catch{}if(!pe||!pe.documentElement){pe=L.createDocument($t,"template",null);try{pe.documentElement.innerHTML=Ss?R:nt}catch{}}const Ye=pe.body||pe.documentElement;return K&&xe&&Ye.insertBefore(r.createTextNode(xe),Ye.childNodes[0]||null),$t===Yt?B.call(pe,Ve?"html":"body")[0]:Ve?pe.documentElement:Ye},cr=function(K){return M.call(K.ownerDocument||K,K,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT|h.SHOW_PROCESSING_INSTRUCTION|h.SHOW_CDATA_SECTION,null)},Pi=function(K){return K instanceof f&&(typeof K.nodeName!="string"||typeof K.textContent!="string"||typeof K.removeChild!="function"||!(K.attributes instanceof b)||typeof K.removeAttribute!="function"||typeof K.setAttribute!="function"||typeof K.namespaceURI!="string"||typeof K.insertBefore!="function"||typeof K.hasChildNodes!="function")},Tt=function(K){return typeof c=="function"&&K instanceof c};function xt(De,K,pe){pl(De,xe=>{xe.call(i,K,pe,Ie)})}const Nn=function(K){let pe=null;if(xt(F.beforeSanitizeElements,K,null),Pi(K))return Qe(K),!0;const xe=ve(K.nodeName);if(xt(F.uponSanitizeElement,K,{tagName:xe,allowedTags:O}),Fe&&K.hasChildNodes()&&!Tt(K.firstElementChild)&&Ti(/<[/\w!]/g,K.innerHTML)&&Ti(/<[/\w!]/g,K.textContent)||Fe&&K.namespaceURI===Yt&&xe==="style"&&Tt(K.firstElementChild)||K.nodeType===_l.progressingInstruction||Fe&&K.nodeType===_l.comment&&Ti(/<[/\w]/g,K.data))return Qe(K),!0;if(_e[xe]||!($.tagCheck instanceof Function&&$.tagCheck(xe))&&!O[xe]){if(!_e[xe]&&ur(xe)&&(ce.tagNameCheck instanceof RegExp&&Ti(ce.tagNameCheck,xe)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(xe)))return!1;if(ut&&!zt[xe]){const nt=v(K)||K.parentNode,Ye=d(K)||K.childNodes;if(Ye&&nt){const At=Ye.length;for(let Ht=At-1;Ht>=0;--Ht){const Pt=x(Ye[Ht],!0);nt.insertBefore(Pt,y(K))}}}return Qe(K),!0}return K instanceof u&&!Bt(K)||(xe==="noscript"||xe==="noembed"||xe==="noframes")&&Ti(/<\/no(script|embed|frames)/i,K.innerHTML)?(Qe(K),!0):($e&&K.nodeType===_l.text&&(pe=K.textContent,pl([q,I,G],nt=>{pe=qa(pe,nt," ")}),K.textContent!==pe&&(gl(i.removed,{element:K.cloneNode()}),K.textContent=pe)),xt(F.afterSanitizeElements,K,null),!1)},jr=function(K,pe,xe){if(Q[pe]||fn&&(pe==="id"||pe==="name")&&(xe in r||xe in St))return!1;const nt=Z[pe]||$.attributeCheck instanceof Function&&$.attributeCheck(pe,K);if(!(ge&&!Q[pe]&&Ti(te,pe))){if(!(oe&&Ti(P,pe))){if(!nt||Q[pe]){if(!(ur(K)&&(ce.tagNameCheck instanceof RegExp&&Ti(ce.tagNameCheck,K)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(K))&&(ce.attributeNameCheck instanceof RegExp&&Ti(ce.attributeNameCheck,pe)||ce.attributeNameCheck instanceof Function&&ce.attributeNameCheck(pe,K))||pe==="is"&&ce.allowCustomizedBuiltInElements&&(ce.tagNameCheck instanceof RegExp&&Ti(ce.tagNameCheck,xe)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(xe))))return!1}else if(!en[pe]){if(!Ti(z,qa(xe,X,""))){if(!((pe==="src"||pe==="xlink:href"||pe==="href")&&K!=="script"&&C1(xe,"data:")===0&&Dn[K])){if(!(Se&&!Ti(V,qa(xe,X,"")))){if(xe)return!1}}}}}}return!0},oa=Ke({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ur=function(K){return!oa[wl(K)]&&Ti(N,K)},ws=function(K){xt(F.beforeSanitizeAttributes,K,null);const{attributes:pe}=K;if(!pe||Pi(K))return;const xe={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Z,forceKeepAttr:void 0};let nt=pe.length;for(;nt--;){const Ye=pe[nt],{name:At,namespaceURI:Ht,value:Pt}=Ye,me=ve(At),Me=Pt;let Oe=At==="value"?Me:RM(Me);if(xe.attrName=me,xe.attrValue=Oe,xe.keepAttr=!0,xe.forceKeepAttr=void 0,xt(F.uponSanitizeAttribute,K,xe),Oe=xe.attrValue,Mn&&(me==="id"||me==="name")&&C1(Oe,ei)!==0&&(bi(At,K),Oe=ei+Oe),Fe&&Ti(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Oe)){bi(At,K);continue}if(me==="attributename"&&w1(Oe,"href")){bi(At,K);continue}if(xe.forceKeepAttr)continue;if(!xe.keepAttr){bi(At,K);continue}if(!ye&&Ti(/\/>/i,Oe)){bi(At,K);continue}$e&&pl([q,I,G],Dt=>{Oe=qa(Oe,Dt," ")});const st=ve(K.nodeName);if(!jr(st,me,Oe)){bi(At,K);continue}if(T&&typeof E=="object"&&typeof E.getAttributeType=="function"&&!Ht)switch(E.getAttributeType(st,me)){case"TrustedHTML":{Oe=T.createHTML(Oe);break}case"TrustedScriptURL":{Oe=T.createScriptURL(Oe);break}}if(Oe!==Me)try{Ht?K.setAttributeNS(Ht,At,Oe):K.setAttribute(At,Oe),Pi(K)?Qe(K):S1(i.removed)}catch{bi(At,K)}}xt(F.afterSanitizeAttributes,K,null)},Gn=function(K){let pe=null;const xe=cr(K);for(xt(F.beforeSanitizeShadowDOM,K,null);pe=xe.nextNode();)xt(F.uponSanitizeShadowNode,pe,null),Nn(pe),ws(pe),pe.content instanceof _&&Gn(pe.content);xt(F.afterSanitizeShadowDOM,K,null)};return i.sanitize=function(De){let K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},pe=null,xe=null,nt=null,Ye=null;if(Ss=!De,Ss&&(De="<!-->"),typeof De!="string"&&!Tt(De)&&(De=NM(De),typeof De!="string"))throw du("dirty is not a string, aborting");if(!i.isSupported)return De;if(Ct||Ee(K),i.removed=[],typeof De=="string"&&(Kt=!1),Kt){const Pt=De.nodeName;if(typeof Pt=="string"){const me=ve(Pt);if(!O[me]||_e[me])throw du("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(!Qt&&!$e&&!Ve&&De.indexOf("<")===-1)return T&&vi?T.createHTML(De):De;if(pe=lr(De),!pe)return Qt?null:vi?R:""}pe&&Ne&&Qe(pe.firstChild);const At=cr(Kt?De:pe);for(;nt=At.nextNode();)Nn(nt),ws(nt),nt.content instanceof _&&Gn(nt.content);if(Kt)return De;if(Qt){if($e){pe.normalize();let Pt=pe.innerHTML;pl([q,I,G],me=>{Pt=qa(Pt,me," ")}),pe.innerHTML=Pt}if(_i)for(Ye=k.call(pe.ownerDocument);pe.firstChild;)Ye.appendChild(pe.firstChild);else Ye=pe;return(Z.shadowroot||Z.shadowrootmode)&&(Ye=W.call(a,Ye,!0)),Ye}let Ht=Ve?pe.outerHTML:pe.innerHTML;return Ve&&O["!doctype"]&&pe.ownerDocument&&pe.ownerDocument.doctype&&pe.ownerDocument.doctype.name&&Ti(Pw,pe.ownerDocument.doctype.name)&&(Ht="<!DOCTYPE "+pe.ownerDocument.doctype.name+`>
|
|
199
|
+
`+Ht),$e&&pl([q,I,G],Pt=>{Ht=qa(Ht,Pt," ")}),T&&vi?T.createHTML(Ht):Ht},i.setConfig=function(){let De=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ee(De),Ct=!0},i.clearConfig=function(){Ie=null,Ct=!1},i.isValidAttribute=function(De,K,pe){Ie||Ee({});const xe=ve(De),nt=ve(K);return jr(xe,nt,pe)},i.addHook=function(De,K){typeof K=="function"&&gl(F[De],K)},i.removeHook=function(De,K){if(K!==void 0){const pe=AM(F[De],K);return pe===-1?void 0:kM(F[De],pe,1)[0]}return S1(F[De])},i.removeHooks=function(De){F[De]=[]},i.removeAllHooks=function(){F=M1()},i}var kl=Uw(),cp,D1;function VM(){if(D1)return cp;D1=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 ve=J[he],Ie=typeof ve;(Ie==="object"||Ie==="function")&&!Object.isFrozen(ve)&&e(ve)}),J}class i{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,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function a(J,...he){const ve=Object.create(null);for(const Ie in J)ve[Ie]=J[Ie];return he.forEach(function(Ie){for(const St in Ie)ve[St]=Ie[St]}),ve}const o="</span>",_=J=>!!J.scope,m=(J,{prefix:he})=>{if(J.startsWith("language:"))return J.replace("language:","language-");if(J.includes(".")){const ve=J.split(".");return[`${he}${ve.shift()}`,...ve.map((Ie,St)=>`${Ie}${"_".repeat(St+1)}`)].join(" ")}return`${he}${J}`};class c{constructor(he,ve){this.buffer="",this.classPrefix=ve.classPrefix,he.walk(this)}addText(he){this.buffer+=r(he)}openNode(he){if(!_(he))return;const ve=m(he.scope,{prefix:this.classPrefix});this.span(ve)}closeNode(he){_(he)&&(this.buffer+=o)}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 ve=u({scope:he});this.add(ve),this.stack.push(ve)}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,ve){return typeof ve=="string"?he.addText(ve):ve.children&&(he.openNode(ve),ve.children.forEach(Ie=>this._walk(he,Ie)),he.closeNode(ve)),he}static _collapse(he){typeof he!="string"&&he.children&&(he.children.every(ve=>typeof ve=="string")?he.children=[he.children.join("")]:he.children.forEach(ve=>{h._collapse(ve)}))}}class b extends h{constructor(he){super(),this.options=he}addText(he){he!==""&&this.add(he)}startScope(he){this.openNode(he)}endScope(){this.closeNode()}__addSublanguage(he,ve){const Ie=he.root;ve&&(Ie.scope=`language:${ve}`),this.add(Ie)}toHTML(){return new c(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function f(J){return J?typeof J=="string"?J:J.source:null}function C(J){return x("(?=",J,")")}function E(J){return x("(?:",J,")*")}function A(J){return x("(?:",J,")?")}function x(...J){return J.map(ve=>f(ve)).join("")}function p(J){const he=J[J.length-1];return typeof he=="object"&&he.constructor===Object?(J.splice(J.length-1,1),he):{}}function y(...J){return"("+(p(J).capture?"":"?:")+J.map(Ie=>f(Ie)).join("|")+")"}function d(J){return new RegExp(J.toString()+"|").exec("").length-1}function v(J,he){const ve=J&&J.exec(he);return ve&&ve.index===0}const T=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function R(J,{joinWith:he}){let ve=0;return J.map(Ie=>{ve+=1;const St=ve;let ft=f(Ie),Ee="";for(;ft.length>0;){const Ce=T.exec(ft);if(!Ce){Ee+=ft;break}Ee+=ft.substring(0,Ce.index),ft=ft.substring(Ce.index+Ce[0].length),Ce[0][0]==="\\"&&Ce[1]?Ee+="\\"+String(Number(Ce[1])+St):(Ee+=Ce[0],Ce[0]==="("&&ve++)}return Ee}).map(Ie=>`(${Ie})`).join(he)}const L=/\b\B/,M="[a-zA-Z]\\w*",k="[a-zA-Z_]\\w*",B="\\b\\d+(\\.\\d+)?",W="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",F="\\b(0b[01]+)",q="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",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":(ve,Ie)=>{ve.index!==0&&Ie.ignoreMatch()}},J)},G={begin:"\\\\[\\s\\S]",relevance:0},te={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[G]},P={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[G]},V={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/},X=function(J,he,ve={}){const Ie=a({scope:"comment",begin:J,end:he,contains:[]},ve);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 St=y("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(/[ ]+/,"(",St,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Ie},N=X("//","$"),z=X("/\\*","\\*/"),O=X("#","$"),H={scope:"number",begin:B,relevance:0},Z={scope:"number",begin:W,relevance:0},ae={scope:"number",begin:F,relevance:0},ce={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[G,{begin:/\[/,end:/\]/,relevance:0,contains:[G]}]},_e={scope:"title",begin:M,relevance:0},Q={scope:"title",begin:k,relevance:0},$={begin:"\\.\\s*"+k,relevance:0};var ge=Object.freeze({__proto__:null,APOS_STRING_MODE:te,BACKSLASH_ESCAPE:G,BINARY_NUMBER_MODE:ae,BINARY_NUMBER_RE:F,COMMENT:X,C_BLOCK_COMMENT_MODE:z,C_LINE_COMMENT_MODE:N,C_NUMBER_MODE:Z,C_NUMBER_RE:W,END_SAME_AS_BEGIN:function(J){return Object.assign(J,{"on:begin":(he,ve)=>{ve.data._beginMatch=he[1]},"on:end":(he,ve)=>{ve.data._beginMatch!==he[1]&&ve.ignoreMatch()}})},HASH_COMMENT_MODE:O,IDENT_RE:M,MATCH_NOTHING_RE:L,METHOD_GUARD:$,NUMBER_MODE:H,NUMBER_RE:B,PHRASAL_WORDS_MODE:V,QUOTE_STRING_MODE:P,REGEXP_MODE:ce,RE_STARTERS_RE:q,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 $e(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 Fe(J,he){Array.isArray(J.illegal)&&(J.illegal=y(...J.illegal))}function Ve(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 Ct(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 ve=Object.assign({},J);Object.keys(J).forEach(Ie=>{delete J[Ie]}),J.keywords=ve.keywords,J.begin=x(ve.beforeMatch,C(ve.begin)),J.starts={relevance:0,contains:[Object.assign(ve,{endsParent:!0})]},J.relevance=0,delete ve.beforeMatch},Qt=["of","and","for","in","not","or","if","then","parent","list","value"],_i="keyword";function vi(J,he,ve=_i){const Ie=Object.create(null);return typeof J=="string"?St(ve,J.split(" ")):Array.isArray(J)?St(ve,J):Object.keys(J).forEach(function(ft){Object.assign(Ie,vi(J[ft],he,ft))}),Ie;function St(ft,Ee){he&&(Ee=Ee.map(Ce=>Ce.toLowerCase())),Ee.forEach(function(Ce){const je=Ce.split("|");Ie[je[0]]=[ft,fn(je[0],je[1])]})}}function fn(J,he){return he?Number(he):Mn(J)?0:1}function Mn(J){return Qt.includes(J.toLowerCase())}const ei={},ut=J=>{console.error(J)},Kt=(J,...he)=>{console.log(`WARN: ${J}`,...he)},jt=(J,he)=>{ei[`${J}/${he}`]||(console.log(`Deprecated as of ${J}. ${he}`),ei[`${J}/${he}`]=!0)},zt=new Error;function ti(J,he,{key:ve}){let Ie=0;const St=J[ve],ft={},Ee={};for(let Ce=1;Ce<=he.length;Ce++)Ee[Ce+Ie]=St[Ce],ft[Ce+Ie]=!0,Ie+=d(he[Ce-1]);J[ve]=Ee,J[ve]._emit=ft,J[ve]._multi=!0}function Dn(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;ti(J,J.begin,{key:"beginScope"}),J.begin=R(J.begin,{joinWith:""})}}function Ri(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;ti(J,J.end,{key:"endScope"}),J.end=R(J.end,{joinWith:""})}}function en(J){J.scope&&typeof J.scope=="object"&&J.scope!==null&&(J.beginScope=J.scope,delete J.scope)}function dt(J){en(J),typeof J.beginScope=="string"&&(J.beginScope={_wrap:J.beginScope}),typeof J.endScope=="string"&&(J.endScope={_wrap:J.endScope}),Dn(J),Ri(J)}function Hi(J){function he(Ee,Ce){return new RegExp(f(Ee),"m"+(J.case_insensitive?"i":"")+(J.unicodeRegex?"u":"")+(Ce?"g":""))}class ve{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+=d(Ce)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Ce=this.regexes.map(je=>je[1]);this.matcherRe=he(R(Ce,{joinWith:"|"}),!0),this.lastIndex=0}exec(Ce){this.matcherRe.lastIndex=this.lastIndex;const je=this.matcherRe.exec(Ce);if(!je)return null;const Bt=je.findIndex((bi,lr)=>lr>0&&bi!==void 0),Qe=this.matchIndexes[Bt];return je.splice(0,Bt),Object.assign(je,Qe)}}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 ve;return this.rules.slice(Ce).forEach(([Bt,Qe])=>je.addRule(Bt,Qe)),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 Bt=je.exec(Ce);if(this.resumingScanAtSamePosition()&&!(Bt&&Bt.index===this.lastIndex)){const Qe=this.getMatcher(0);Qe.lastIndex=this.lastIndex+1,Bt=Qe.exec(Ce)}return Bt&&(this.regexIndex+=Bt.position+1,this.regexIndex===this.count&&this.considerAll()),Bt}}function St(Ee){const Ce=new Ie;return Ee.contains.forEach(je=>Ce.addRule(je.begin,{rule:je,type:"begin"})),Ee.terminatorEnd&&Ce.addRule(Ee.terminatorEnd,{type:"end"}),Ee.illegal&&Ce.addRule(Ee.illegal,{type:"illegal"}),Ce}function ft(Ee,Ce){const je=Ee;if(Ee.isCompiled)return je;[ye,Ve,dt,Ne].forEach(Qe=>Qe(Ee,Ce)),J.compilerExtensions.forEach(Qe=>Qe(Ee,Ce)),Ee.__beforeBegin=null,[$e,Fe,Ct].forEach(Qe=>Qe(Ee,Ce)),Ee.isCompiled=!0;let Bt=null;return typeof Ee.keywords=="object"&&Ee.keywords.$pattern&&(Ee.keywords=Object.assign({},Ee.keywords),Bt=Ee.keywords.$pattern,delete Ee.keywords.$pattern),Bt=Bt||/\w+/,Ee.keywords&&(Ee.keywords=vi(Ee.keywords,J.case_insensitive)),je.keywordPatternRe=he(Bt,!0),Ce&&(Ee.begin||(Ee.begin=/\B|\b/),je.beginRe=he(je.begin),!Ee.end&&!Ee.endsWithParent&&(Ee.end=/\B|\b/),Ee.end&&(je.endRe=he(je.end)),je.terminatorEnd=f(je.end)||"",Ee.endsWithParent&&Ce.terminatorEnd&&(je.terminatorEnd+=(Ee.end?"|":"")+Ce.terminatorEnd)),Ee.illegal&&(je.illegalRe=he(Ee.illegal)),Ee.contains||(Ee.contains=[]),Ee.contains=[].concat(...Ee.contains.map(function(Qe){return Yt(Qe==="self"?Ee:Qe)})),Ee.contains.forEach(function(Qe){ft(Qe,je)}),Ee.starts&&ft(Ee.starts,Ce),je.matcher=St(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 Vt(J){return J?J.endsWithParent||Vt(J.starts):!1}function Yt(J){return J.variants&&!J.cachedVariants&&(J.cachedVariants=J.variants.map(function(he){return a(J,{variants:null},he)})),J.cachedVariants?J.cachedVariants:Vt(J)?a(J,{starts:J.starts?a(J.starts):null}):Object.isFrozen(J)?a(J):J}var $t="11.11.1";class Ss extends Error{constructor(he,ve){super(he),this.name="HTMLInjectionError",this.html=ve}}const ar=r,aa=a,On=Symbol("nomatch"),Wn=7,or=function(J){const he=Object.create(null),ve=Object.create(null),Ie=[];let St=!0;const ft="Could not find the language '{}', did you forget to load/include a language module?",Ee={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:b};function je(me){return Ce.noHighlightRe.test(me)}function Bt(me){let Me=me.className+" ";Me+=me.parentNode?me.parentNode.className:"";const Oe=Ce.languageDetectRe.exec(Me);if(Oe){const st=K(Oe[1]);return st||(Kt(ft.replace("{}",Oe[1])),Kt("Falling back to no-highlight mode for this block.",me)),st?Oe[1]:"no-highlight"}return Me.split(/\s+/).find(st=>je(st)||K(st))}function Qe(me,Me,Oe){let st="",Dt="";typeof Me=="object"?(st=me,Oe=Me.ignoreIllegals,Dt=Me.language):(jt("10.7.0","highlight(lang, code, ...args) has been deprecated."),jt("10.7.0",`Please use highlight(code, options) instead.
|
|
200
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),Dt=me,st=Me),Oe===void 0&&(Oe=!0);const Li={code:st,language:Dt};Ht("before:highlight",Li);const tn=Li.result?Li.result:bi(Li.language,Li.code,Oe);return tn.code=Li.code,Ht("after:highlight",tn),tn}function bi(me,Me,Oe,st){const Dt=Object.create(null);function Li(we,Re){return we.keywords[Re]}function tn(){if(!He.keywords){ni.addText(pt);return}let we=0;He.keywordPatternRe.lastIndex=0;let Re=He.keywordPatternRe.exec(pt),qe="";for(;Re;){qe+=pt.substring(we,Re.index);const et=yi.case_insensitive?Re[0].toLowerCase():Re[0],It=Li(He,et);if(It){const[pn,mo]=It;if(ni.addText(qe),qe="",Dt[et]=(Dt[et]||0)+1,Dt[et]<=Wn&&(zr+=mo),pn.startsWith("_"))qe+=Re[0];else{const Yl=yi.classNameAliases[pn]||pn;nn(Re[0],Yl)}}else qe+=Re[0];we=He.keywordPatternRe.lastIndex,Re=He.keywordPatternRe.exec(pt)}qe+=pt.substring(we),ni.addText(qe)}function Ui(){if(pt==="")return;let we=null;if(typeof He.subLanguage=="string"){if(!he[He.subLanguage]){ni.addText(pt);return}we=bi(He.subLanguage,pt,!0,Vl[He.subLanguage]),Vl[He.subLanguage]=we._top}else we=cr(pt,He.subLanguage.length?He.subLanguage:null);He.relevance>0&&(zr+=we.relevance),ni.__addSublanguage(we._emitter,we.language)}function Et(){He.subLanguage!=null?Ui():tn(),pt=""}function nn(we,Re){we!==""&&(ni.startScope(Re),ni.addText(we),ni.endScope())}function Gl(we,Re){let qe=1;const et=Re.length-1;for(;qe<=et;){if(!we._emit[qe]){qe++;continue}const It=yi.classNameAliases[we[qe]]||we[qe],pn=Re[qe];It?nn(pn,It):(pt=pn,tn(),pt=""),qe++}}function la(we,Re){return we.scope&&typeof we.scope=="string"&&ni.openNode(yi.classNameAliases[we.scope]||we.scope),we.beginScope&&(we.beginScope._wrap?(nn(pt,yi.classNameAliases[we.beginScope._wrap]||we.beginScope._wrap),pt=""):we.beginScope._multi&&(Gl(we.beginScope,Re),pt="")),He=Object.create(we,{parent:{value:He}}),He}function fo(we,Re,qe){let et=v(we.endRe,qe);if(et){if(we["on:end"]){const It=new i(we);we["on:end"](Re,It),It.isMatchIgnored&&(et=!1)}if(et){for(;we.endsParent&&we.parent;)we=we.parent;return we}}if(we.endsWithParent)return fo(we.parent,Re,qe)}function ca(we){return He.matcher.regexIndex===0?(pt+=we[0],1):($r=!0,0)}function yh(we){const Re=we[0],qe=we.rule,et=new i(qe),It=[qe.__beforeBegin,qe["on:begin"]];for(const pn of It)if(pn&&(pn(we,et),et.isMatchIgnored))return ca(Re);return qe.skip?pt+=Re:(qe.excludeBegin&&(pt+=Re),Et(),!qe.returnBegin&&!qe.excludeBegin&&(pt=Re)),la(qe,we),qe.returnBegin?0:Re.length}function Fi(we){const Re=we[0],qe=Me.substring(we.index),et=fo(He,we,qe);if(!et)return On;const It=He;He.endScope&&He.endScope._wrap?(Et(),nn(Re,He.endScope._wrap)):He.endScope&&He.endScope._multi?(Et(),Gl(He.endScope,we)):It.skip?pt+=Re:(It.returnEnd||It.excludeEnd||(pt+=Re),Et(),It.excludeEnd&&(pt=Re));do He.scope&&ni.closeNode(),!He.skip&&!He.subLanguage&&(zr+=He.relevance),He=He.parent;while(He!==et.parent);return et.starts&&la(et.starts,we),It.returnEnd?0:Re.length}function po(){const we=[];for(let Re=He;Re!==yi;Re=Re.parent)Re.scope&&we.unshift(Re.scope);we.forEach(Re=>ni.openNode(Re))}let Cs={};function ua(we,Re){const qe=Re&&Re[0];if(pt+=we,qe==null)return Et(),0;if(Cs.type==="begin"&&Re.type==="end"&&Cs.index===Re.index&&qe===""){if(pt+=Me.slice(Re.index,Re.index+1),!St){const et=new Error(`0 width match regex (${me})`);throw et.languageName=me,et.badRule=Cs.rule,et}return 1}if(Cs=Re,Re.type==="begin")return yh(Re);if(Re.type==="illegal"&&!Oe){const et=new Error('Illegal lexeme "'+qe+'" for mode "'+(He.scope||"<unnamed>")+'"');throw et.mode=He,et}else if(Re.type==="end"){const et=Fi(Re);if(et!==On)return et}if(Re.type==="illegal"&&qe==="")return pt+=`
|
|
201
|
+
`,1;if(go>1e5&&go>Re.index*3)throw new Error("potential infinite loop, way more iterations than matches");return pt+=qe,qe.length}const yi=K(me);if(!yi)throw ut(ft.replace("{}",me)),new Error('Unknown language: "'+me+'"');const Kl=Hi(yi);let ha="",He=st||Kl;const Vl={},ni=new Ce.__emitter(Ce);po();let pt="",zr=0,hr=0,go=0,$r=!1;try{if(yi.__emitTokens)yi.__emitTokens(Me,ni);else{for(He.matcher.considerAll();;){go++,$r?$r=!1:He.matcher.considerAll(),He.matcher.lastIndex=hr;const we=He.matcher.exec(Me);if(!we)break;const Re=Me.substring(hr,we.index),qe=ua(Re,we);hr=we.index+qe}ua(Me.substring(hr))}return ni.finalize(),ha=ni.toHTML(),{language:me,value:ha,relevance:zr,illegal:!1,_emitter:ni,_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:ha},_emitter:ni};if(St)return{language:me,value:ar(Me),illegal:!1,relevance:0,errorRaised:we,_emitter:ni,_top:He};throw we}}function lr(me){const Me={value:ar(me),illegal:!1,relevance:0,_top:Ee,_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),st=Me.filter(K).filter(xe).map(Et=>bi(Et,me,!1));st.unshift(Oe);const Dt=st.sort((Et,nn)=>{if(Et.relevance!==nn.relevance)return nn.relevance-Et.relevance;if(Et.language&&nn.language){if(K(Et.language).supersetOf===nn.language)return 1;if(K(nn.language).supersetOf===Et.language)return-1}return 0}),[Li,tn]=Dt,Ui=Li;return Ui.secondBest=tn,Ui}function Pi(me,Me,Oe){const st=Me&&ve[Me]||Oe;me.classList.add("hljs"),me.classList.add(`language-${st}`)}function Tt(me){let Me=null;const Oe=Bt(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 Ss("One of your code blocks includes unescaped HTML.",me.innerHTML);Me=me;const st=Me.textContent,Dt=Oe?Qe(st,{language:Oe,ignoreIllegals:!0}):cr(st);me.innerHTML=Dt.value,me.dataset.highlighted="yes",Pi(me,Oe,Dt.language),me.result={language:Dt.language,re:Dt.relevance,relevance:Dt.relevance},Dt.secondBest&&(me.secondBest={language:Dt.secondBest.language,relevance:Dt.secondBest.relevance}),Ht("after:highlightElement",{el:me,result:Dt,text:st})}function xt(me){Ce=aa(Ce,me)}const Nn=()=>{ur(),jt("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function jr(){ur(),jt("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let oa=!1;function ur(){function me(){ur()}if(document.readyState==="loading"){oa||window.addEventListener("DOMContentLoaded",me,!1),oa=!0;return}document.querySelectorAll(Ce.cssSelector).forEach(Tt)}function ws(me,Me){let Oe=null;try{Oe=Me(J)}catch(st){if(ut("Language definition for '{}' could not be registered.".replace("{}",me)),St)ut(st);else throw st;Oe=Ee}Oe.name||(Oe.name=me),he[me]=Oe,Oe.rawDefinition=Me.bind(null,J),Oe.aliases&&pe(Oe.aliases,{languageName:me})}function Gn(me){delete he[me];for(const Me of Object.keys(ve))ve[Me]===me&&delete ve[Me]}function De(){return Object.keys(he)}function K(me){return me=(me||"").toLowerCase(),he[me]||he[ve[me]]}function pe(me,{languageName:Me}){typeof me=="string"&&(me=[me]),me.forEach(Oe=>{ve[Oe.toLowerCase()]=Me})}function xe(me){const Me=K(me);return Me&&!Me.disableAutodetect}function nt(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 Ye(me){nt(me),Ie.push(me)}function At(me){const Me=Ie.indexOf(me);Me!==-1&&Ie.splice(Me,1)}function Ht(me,Me){const Oe=me;Ie.forEach(function(st){st[Oe]&&st[Oe](Me)})}function Pt(me){return jt("10.7.0","highlightBlock will be removed entirely in v12.0"),jt("10.7.0","Please use highlightElement now."),Tt(me)}Object.assign(J,{highlight:Qe,highlightAuto:cr,highlightAll:ur,highlightElement:Tt,highlightBlock:Pt,configure:xt,initHighlighting:Nn,initHighlightingOnLoad:jr,registerLanguage:ws,unregisterLanguage:Gn,listLanguages:De,getLanguage:K,registerAliases:pe,autoDetection:xe,inherit:aa,addPlugin:Ye,removePlugin:At}),J.debugMode=function(){St=!1},J.safeMode=function(){St=!0},J.versionString=$t,J.regex={concat:x,lookahead:C,either:y,optional:A,anyNumberOfTimes:E};for(const me in ge)typeof ge[me]=="object"&&e(ge[me]);return Object.assign(J,ge),J},ii=or({});return ii.newInstance=()=>or({}),cp=ii,ii.HighlightJS=ii,ii.default=ii,cp}var YM=VM();const Cn=v2(YM);function O1(e){const i=e.regex,r={},a={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[r]}]};Object.assign(r,{className:"variable",variants:[{begin:i.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},a]});const o={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},_=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,o]};o.contains.push(c);const u={match:/\\"/},h={className:"string",begin:/'/,end:/'/},b={match:/\\'/},f={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,r]},C=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],E=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"],p=["true","false"],y={match:/(\/[a-z._-]+)+/},d=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],v=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],T=["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"],R=["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:p,built_in:[...d,...v,"set","shopt",...T,...R]},contains:[E,e.SHEBANG(),A,f,_,m,y,c,u,h,b,r]}}const N1="[A-Za-z$_][0-9A-Za-z$_]*",XM=["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"],ZM=["true","false","null","undefined","NaN","Infinity"],Fw=["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"],qw=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Ww=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],JM=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],QM=[].concat(Ww,Fw,qw);function B1(e){const i=e.regex,r=(X,{after:N})=>{const z="</"+X[0].slice(1);return X.input.indexOf(z,N)!==-1},a=N1,o={begin:"<>",end:"</>"},_=/<[A-Za-z0-9\\._:-]+\s*\/>/,m={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(X,N)=>{const z=X[0].length+X.index,O=X.input[z];if(O==="<"||O===","){N.ignoreMatch();return}O===">"&&(r(X,{after:z})||N.ignoreMatch());let H;const Z=X.input.substring(z);if(H=Z.match(/^\s*=/)){N.ignoreMatch();return}if((H=Z.match(/^\s+extends\s+/))&&H.index===0){N.ignoreMatch();return}}},c={$pattern:N1,keyword:XM,literal:ZM,built_in:QM,"variable.language":JM},u="[0-9](_?[0-9])*",h=`\\.(${u})`,b="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${b})((${h})|\\.)?|(${h}))[eE][+-]?(${u})\\b`},{begin:`\\b(${b})\\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:[]},E={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"}},p={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,C]},d={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]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,E,A,x,p,{match:/\$\d+/},f];C.contains=v.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(v)});const T=[].concat(d,C.contains),R=T.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(T)}]),L={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:R},M={variants:[{match:[/class/,/\s+/,a,/\s+/,/extends/,/\s+/,i.concat(a,"(",i.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:i.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:{_:[...Fw,...qw]}},B={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},W={variants:[{match:[/function/,/\s+/,a,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[L],illegal:/%/},F={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function q(X){return i.concat("(?!",X.join("|"),")")}const I={match:i.concat(/\b/,q([...Ww,"super","import"].map(X=>`${X}\\s*\\(`)),a,i.lookahead(/\s*\(/)),className:"title.function",relevance:0},G={begin:i.concat(/\./,i.lookahead(i.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:/\(\)/},L]},P="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",V={match:[/const|var|let/,/\s+/,a,/\s*/,/=\s*/,/(async\s*)?/,i.lookahead(P)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[L]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:R,CLASS_REFERENCE:k},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),B,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,E,A,x,p,d,{match:/\$\d+/},f,k,{scope:"attr",match:a+i.lookahead(":"),relevance:0},V,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[d,e.REGEXP_MODE,{className:"function",begin:P,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:R}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:_},{begin:m.begin,"on:begin":m.isTrulyOpeningTag,end:m.end}],subLanguage:"xml",contains:[{begin:m.begin,end:m.end,skip:!0,contains:["self"]}]}]},W,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[L,e.inherit(e.TITLE_MODE,{begin:a,className:"title.function"})]},{match:/\.\.\./,relevance:0},G,{match:"\\$"+a,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[L]},I,F,M,te,{match:/\$[(.]/}]}}function e6(e){const i={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},r={match:/[{}[\],:]/,className:"punctuation",relevance:0},a=["true","false","null"],o={scope:"literal",beginKeywords:a.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:a},contains:[i,r,e.QUOTE_STRING_MODE,o,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function I1(e){const i=e.regex,r={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},a={begin:"^[-\\*]{3,}",end:"$"},o={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}]},_={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:i.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}/}]},b={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},f=e.inherit(h,{contains:[]}),C=e.inherit(b,{contains:[]});h.contains.push(C),b.contains.push(f);let E=[r,u];return[h,b,f,C].forEach(y=>{y.contains=y.contains.concat(E)}),E=E.concat(h,b),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:E},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:E}]}]},r,_,h,b,{className:"quote",begin:"^>\\s+",contains:E,end:"$"},o,a,u,m,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function j1(e){const i=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:/#/},b={begin:/\{\{/,relevance:0},f={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,b,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,u,b,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,b,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,b,h]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},C="[0-9](_?[0-9])*",E=`(\\b(${C}))?\\.(${C})|\\b(${C})\\.`,A=`\\b|${a.join("|")}`,x={className:"number",relevance:0,variants:[{begin:`(\\b(${C})|(${E}))[eE][+-]?(${C})[jJ]?(?=${A})`},{begin:`(${E})[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})`}]},p={className:"comment",begin:i.lookahead(/# type:/),end:/$/,keywords:c,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},y={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:["self",u,x,f,e.HASH_COMMENT_MODE]}]};return h.contains=[f,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"},f,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[y]},{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,y,f]}]}}const Yu="[A-Za-z$_][0-9A-Za-z$_]*",Gw=["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"],Kw=["true","false","null","undefined","NaN","Infinity"],Vw=["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"],Yw=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Xw=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Zw=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Jw=[].concat(Xw,Vw,Yw);function t6(e){const i=e.regex,r=(X,{after:N})=>{const z="</"+X[0].slice(1);return X.input.indexOf(z,N)!==-1},a=Yu,o={begin:"<>",end:"</>"},_=/<[A-Za-z0-9\\._:-]+\s*\/>/,m={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(X,N)=>{const z=X[0].length+X.index,O=X.input[z];if(O==="<"||O===","){N.ignoreMatch();return}O===">"&&(r(X,{after:z})||N.ignoreMatch());let H;const Z=X.input.substring(z);if(H=Z.match(/^\s*=/)){N.ignoreMatch();return}if((H=Z.match(/^\s+extends\s+/))&&H.index===0){N.ignoreMatch();return}}},c={$pattern:Yu,keyword:Gw,literal:Kw,built_in:Jw,"variable.language":Zw},u="[0-9](_?[0-9])*",h=`\\.(${u})`,b="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${b})((${h})|\\.)?|(${h}))[eE][+-]?(${u})\\b`},{begin:`\\b(${b})\\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:[]},E={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"}},p={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,C]},d={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]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,E,A,x,p,{match:/\$\d+/},f];C.contains=v.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(v)});const T=[].concat(d,C.contains),R=T.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(T)}]),L={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:R},M={variants:[{match:[/class/,/\s+/,a,/\s+/,/extends/,/\s+/,i.concat(a,"(",i.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:i.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:{_:[...Vw,...Yw]}},B={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},W={variants:[{match:[/function/,/\s+/,a,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[L],illegal:/%/},F={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function q(X){return i.concat("(?!",X.join("|"),")")}const I={match:i.concat(/\b/,q([...Xw,"super","import"].map(X=>`${X}\\s*\\(`)),a,i.lookahead(/\s*\(/)),className:"title.function",relevance:0},G={begin:i.concat(/\./,i.lookahead(i.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:/\(\)/},L]},P="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",V={match:[/const|var|let/,/\s+/,a,/\s*/,/=\s*/,/(async\s*)?/,i.lookahead(P)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[L]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:R,CLASS_REFERENCE:k},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),B,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,E,A,x,p,d,{match:/\$\d+/},f,k,{scope:"attr",match:a+i.lookahead(":"),relevance:0},V,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[d,e.REGEXP_MODE,{className:"function",begin:P,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:R}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:_},{begin:m.begin,"on:begin":m.isTrulyOpeningTag,end:m.end}],subLanguage:"xml",contains:[{begin:m.begin,end:m.end,skip:!0,contains:["self"]}]}]},W,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[L,e.inherit(e.TITLE_MODE,{begin:a,className:"title.function"})]},{match:/\.\.\./,relevance:0},G,{match:"\\$"+a,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[L]},I,F,M,te,{match:/\$[(.]/}]}}function z1(e){const i=e.regex,r=t6(e),a=Yu,o=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],_={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},m={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:o},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:Yu,keyword:Gw.concat(u),literal:Kw,built_in:Jw.concat(o),"variable.language":Zw},b={className:"meta",begin:"@"+a},f=(x,p,y)=>{const d=x.contains.findIndex(v=>v.label===p);if(d===-1)throw new Error("can not find mode to replace");x.contains.splice(d,1,y)};Object.assign(r.keywords,h),r.exports.PARAMS_CONTAINS.push(b);const C=r.contains.find(x=>x.scope==="attr"),E=Object.assign({},C,{match:i.concat(a,i.lookahead(/\s*\?:/))});r.exports.PARAMS_CONTAINS.push([r.exports.CLASS_REFERENCE,C,E]),r.contains=r.contains.concat([b,_,m,E]),f(r,"shebang",e.SHEBANG()),f(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 i6=/\[\[wiki:([^\]]+)\]\]/g,n6=new zw({gfm:!0,breaks:!1}),$1={ALLOWED_URI_REGEXP:/^(?:(?:https?|mailto):|[#/]|\.{0,2}\/|[^:]+$)/i,ADD_ATTR:["target","rel","data-entry-id"]},up=f6();function ho(e){const i=a6(e),r=n6.parse(i,{async:!1}),a=kl.sanitize(r,$1),o=new DOMParser().parseFromString(a,"text/html");return o6(o),l6(o),u6(o),{html:kl.sanitize(o.body.innerHTML,$1),toc:h6(o)}}function r6(e){const i=new TextEncoder().encode(e);let r="";for(const a of i)r+=String.fromCharCode(a);return btoa(r)}function s6(e){const i=atob(e),r=new Uint8Array(i.length);for(let a=0;a<i.length;a++)r[a]=i.charCodeAt(a);return new TextDecoder().decode(r)}function a6(e){return e.replace(i6,(i,r)=>{const a=r.trim();if(!a)return"";const o=Ae(a),_=encodeURIComponent(a);return`<a href="${Ir(a)}" data-entry-id="${_}">${o}</a>`})}function o6(e){const i=new Map;for(const r of e.querySelectorAll("h2, h3")){const a=r.textContent?.trim()??"",o=m6(a||"section"),_=i.get(o)??0;i.set(o,_+1),r.id=_===0?o:`${o}-${_+1}`}}function l6(e){for(const i of e.querySelectorAll("pre > code")){const r=p6(i.className),a=i.textContent??"",o=i.parentElement;if(!o)continue;if(r==="mermaid"){const m=e.createElement("div");m.className="diagram-block",m.setAttribute("data-mermaid-source",r6(a)),m.setAttribute("data-diagram-state","pending"),o.replaceWith(m);continue}const _=d6(a,r);i.innerHTML=_,i.classList.add("hljs"),o.classList.add("code-block"),o.dataset.code=a,o.insertBefore(c6(e,r||"text"),o.firstChild)}}function c6(e,i){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 o=e.createElement("span");o.className="code-block-language",o.textContent=i;const _=e.createElement("button");return _.className="copy-code",_.type="button",_.dataset.action="copy-code",_.textContent="복사",r.append(a,o,_),r}function u6(e){for(const i of e.querySelectorAll("a")){const r=i.getAttribute("href")??"";g6(r)&&(i.setAttribute("target","_blank"),i.setAttribute("rel","noopener noreferrer"))}}function h6(e){return[...e.querySelectorAll("h2, h3")].map(i=>({id:i.id,text:i.textContent?.trim()??i.id,level:i.tagName.toLowerCase()==="h2"?2:3}))}function d6(e,i){return i&&up.getLanguage(i)?up.highlight(e,{language:i}).value:up.highlightAuto(e).value}function f6(){return Cn.registerLanguage("bash",O1),Cn.registerLanguage("sh",O1),Cn.registerLanguage("javascript",B1),Cn.registerLanguage("js",B1),Cn.registerLanguage("json",e6),Cn.registerLanguage("markdown",I1),Cn.registerLanguage("md",I1),Cn.registerLanguage("python",j1),Cn.registerLanguage("py",j1),Cn.registerLanguage("typescript",z1),Cn.registerLanguage("ts",z1),Cn}function p6(e){return e.match(/language-([a-z0-9_-]+)/i)?.[1]?.toLowerCase()??null}function g6(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)&&!e.startsWith(window.location.origin)}function m6(e){return e.trim().toLowerCase().replace(/[^\p{Letter}\p{Number}]+/gu,"-").replace(/^-+|-+$/g,"")||"section"}function _6(e){return`
|
|
202
|
+
<article class="document">
|
|
203
|
+
<header class="document-header">
|
|
204
|
+
<p class="eyebrow">MANIFEST · DRYDOCK</p>
|
|
205
|
+
<h1>Conflicts</h1>
|
|
206
|
+
</header>
|
|
207
|
+
${e.length>0?`
|
|
208
|
+
<ul class="conflict-list">
|
|
209
|
+
${e.map(i=>`
|
|
210
|
+
<li>
|
|
211
|
+
<a class="conflict-list-item" href="${oL(i.id)}">
|
|
212
|
+
<span class="conflict-list-copy">
|
|
213
|
+
<strong>${Ae(i.title)}</strong>
|
|
214
|
+
<small>${Ae(i.id)}</small>
|
|
215
|
+
</span>
|
|
216
|
+
<span class="chip ${i.status==="open"?"chip-coral":"chip"}">${Ae(i.status)}</span>
|
|
217
|
+
</a>
|
|
218
|
+
</li>
|
|
219
|
+
`).join("")}
|
|
220
|
+
</ul>
|
|
221
|
+
`:'<p class="empty-state">No conflicts to display.</p>'}
|
|
222
|
+
</article>
|
|
223
|
+
`}function v6(e){const i=[hp("Current",e.current),hp("Proposed",e.proposed),hp("Raw Source",e.rawSource)].filter(Boolean).join("");return`
|
|
224
|
+
<article class="document">
|
|
225
|
+
<header class="document-header">
|
|
226
|
+
<p class="eyebrow">MANIFEST · DRYDOCK</p>
|
|
227
|
+
<h1>${Ae(e.id)}</h1>
|
|
228
|
+
<div class="meta-chips">
|
|
229
|
+
<span class="chip chip-coral">${Ae(String(e.meta.status??"unknown"))}</span>
|
|
230
|
+
</div>
|
|
231
|
+
</header>
|
|
232
|
+
<section class="conflict-meta-card">
|
|
233
|
+
<pre>${Ae(JSON.stringify(e.meta,null,2))}</pre>
|
|
234
|
+
</section>
|
|
235
|
+
${i||'<p class="empty-state">No conflicts to display.</p>'}
|
|
236
|
+
</article>
|
|
237
|
+
`}function hp(e,i){if(!i)return"";const r=ho(i);return`
|
|
238
|
+
<section class="conflict-section">
|
|
239
|
+
<h2>${Ae(e)}</h2>
|
|
240
|
+
<div class="markdown-body">${r.html}</div>
|
|
241
|
+
</section>
|
|
242
|
+
`}function b6(e){return`
|
|
243
|
+
<article class="document">
|
|
244
|
+
<header class="document-header">
|
|
245
|
+
<p class="eyebrow">MANIFEST · CODEX</p>
|
|
246
|
+
<h1>Index</h1>
|
|
247
|
+
</header>
|
|
248
|
+
<div class="markdown-body">${ho(e).html}</div>
|
|
249
|
+
</article>
|
|
250
|
+
`}function sg(e,i){try{return new Date(e).toLocaleString(i??"en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}catch{return e}}function Xu(e){const i=Date.now()-new Date(e).getTime(),r=Math.floor(i/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 o=Math.floor(a/24);return o<30?`${o} days ago`:`${Math.floor(o/30)} months ago`}const y6=`
|
|
251
|
+
<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">
|
|
252
|
+
<path d="M7 17 17 7M9 7h8v8" />
|
|
253
|
+
</svg>
|
|
254
|
+
`;function S6(e,i,r){if(!e)return"";const{frontmatter:a}=e,o=sg(a.created),_=Xu(a.created),m=sg(a.updated),c=Xu(a.updated),u=PR(e,i,r),h=a.tags.length>0?`<div class="queue-card-chips">${a.tags.map(f=>`<span class="chip chip-muted">${Ae(f)}</span>`).join("")}</div>`:'<span class="queue-dl-muted">None</span>',b=a.rawSourceRef?`<a class="manifest-link queue-raw-link" href="${Je(fw(a.rawSourceRef))}" data-raw-ref="${Je(a.rawSourceRef)}">
|
|
255
|
+
<span class="manifest-ref">${Ae(a.rawSourceRef)}</span>
|
|
256
|
+
<span class="manifest-arrow" aria-hidden="true">${y6}</span>
|
|
257
|
+
</a>`:'<span class="queue-dl-muted">None</span>';return`
|
|
258
|
+
<aside class="manifest-card">
|
|
259
|
+
<div class="manifest-header">
|
|
260
|
+
<div class="manifest-titles">
|
|
261
|
+
<p class="drydock-eyebrow">MANIFEST · CODEX</p>
|
|
262
|
+
<p class="manifest-subtitle">Document Manifest</p>
|
|
263
|
+
</div>
|
|
264
|
+
</div>
|
|
265
|
+
<dl class="queue-dl">
|
|
266
|
+
<dt class="queue-dl-key">Created</dt>
|
|
267
|
+
<dd class="queue-dl-value queue-dl-time">
|
|
268
|
+
<time datetime="${Je(a.created)}" title="${Je(o)}">
|
|
269
|
+
${Ae(o)}
|
|
270
|
+
<span class="queue-dl-relative">(${Ae(_)})</span>
|
|
271
|
+
</time>
|
|
272
|
+
</dd>
|
|
273
|
+
<dt class="queue-dl-key">Updated</dt>
|
|
274
|
+
<dd class="queue-dl-value queue-dl-time">
|
|
275
|
+
<time datetime="${Je(a.updated)}" title="${Je(m)}">
|
|
276
|
+
${Ae(m)}
|
|
277
|
+
<span class="queue-dl-relative">(${Ae(c)})</span>
|
|
278
|
+
</time>
|
|
279
|
+
</dd>
|
|
280
|
+
<dt class="queue-dl-key">Version</dt>
|
|
281
|
+
<dd class="queue-dl-value queue-dl-mono">v${a.version}</dd>
|
|
282
|
+
<dt class="queue-dl-key">Tags</dt>
|
|
283
|
+
<dd class="queue-dl-value">${h}</dd>
|
|
284
|
+
<dt class="queue-dl-key">Source</dt>
|
|
285
|
+
<dd class="queue-dl-value">${b}</dd>
|
|
286
|
+
</dl>
|
|
287
|
+
${u?`<div class="manifest-actions">${u}</div>`:""}
|
|
288
|
+
</aside>
|
|
289
|
+
`}const w6="modulepreload",C6=function(e){return"/console/"+e},H1={},x6=function(i,r,a){let o=Promise.resolve();if(r&&r.length>0){let u=function(h){return Promise.all(h.map(b=>Promise.resolve(b).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};document.getElementsByTagName("link");const m=document.querySelector("meta[property=csp-nonce]"),c=m?.nonce||m?.getAttribute("nonce");o=u(r.map(h=>{if(h=C6(h),h in H1)return;H1[h]=!0;const b=h.endsWith(".css"),f=b?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${f}`))return;const C=document.createElement("link");if(C.rel=b?"stylesheet":w6,b||(C.as="script"),C.crossOrigin="",C.href=h,c&&C.setAttribute("nonce",c),document.head.appendChild(C),b)return new Promise((E,A)=>{C.addEventListener("load",E),C.addEventListener("error",()=>A(new Error(`Unable to preload CSS for ${h}`)))})}))}function _(m){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=m,window.dispatchEvent(c),!c.defaultPrevented)throw m}return o.then(m=>{for(const c of m||[])c.status==="rejected"&&_(c.reason);return i().catch(_)})},E6=".diagram-block[data-mermaid-source]:not([data-diagram-state='rendered']):not([data-diagram-state='error'])",T6=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(","),A6=/^on/i,k6={USE_PROFILES:{svg:!0,svgFilters:!1},FORBID_TAGS:["foreignObject","script"],FORBID_ATTR:["href","xlink:href"]},P1="diagramInteractionBound",R6=/^oklch\s*\(\s*([^)]+)\s*\)$/i,L6=/^(-?\d+(?:\.\d+)?)(deg)?$/i,Tn=[25,50,75,100,125,150,200,300,400],M6=["pie1","pie2","pie3","pie4","pie5","pie6","pie7","pie8","pie9","pie10","pie11","pie12"];let dp=null,U1=!1,D6=0,O6=0,Il=null;function ps(e){const i=e.trim();if(!i)return i;const r=i4(i);return r?n4(r):i}function N6(e){if(U1)return;U1=!0,F1(e);const i=e instanceof Node?e:document.body;new MutationObserver(a=>{let o=!1;for(const _ of a)if(_.type==="childList"){Il&&!Il.trigger.isConnected&&Cl(!1);for(const m of _.addedNodes)if(m instanceof Element&&(m.matches?.(".diagram-block[data-mermaid-source]")||m.querySelector?.(".diagram-block[data-mermaid-source]"))){o=!0;break}if(o)break}o&&F1(e)}).observe(i,{childList:!0,subtree:!0})}function F1(e){const i=e.querySelectorAll(E6);for(const r of i)r.dataset.diagramHydrating!=="true"&&(r.dataset.diagramHydrating="true",r.dataset.diagramState="pending",B6(r))}async function B6(e){const i=e.getAttribute("data-mermaid-source")??"";let r="";try{r=s6(i)}catch{fp(e,"Invalid diagram source");return}if(!r.trim()){fp(e,"Empty diagram source");return}try{const a=await j6(),o=`mermaid-diagram-${++D6}`,{svg:_}=await a.render(o,r);e.innerHTML=I6(_),H6(e,_),P6(e),U6(e),e.dataset.diagramState="rendered"}catch(a){const o=a instanceof Error?a.message:String(a);fp(e,o)}}function fp(e,i){e.dataset.diagramState="error",e.textContent=`Diagram render failed: ${i}`}function I6(e){const i=(r,a)=>{A6.test(a.attrName)&&(a.keepAttr=!1)};kl.addHook("uponSanitizeAttribute",i);try{return kl.sanitize(e,k6)}finally{kl.removeHook("uponSanitizeAttribute",i)}}async function j6(){return dp||(dp=(async()=>{const e=await x6(()=>import("./mermaid.core-UWKHwZrH.js").then(r=>r.bC),[]),i=e.default??e;return i.initialize({securityLevel:"strict",htmlLabels:!1,suppressErrorRendering:!0,startOnLoad:!1,theme:"base",look:"handDrawn",themeVariables:z6(),themeCSS:$6(),flowchart:{htmlLabels:!1,useMaxWidth:!1}}),i})()),dp}function z6(){const e=getComputedStyle(document.documentElement),i=(A,x)=>{const p=e.getPropertyValue(A).trim();return ps(p||x)},r=i("--brass","#c69a4a"),a=i("--brass-bright","#e6b86a"),o=i("--brass-deep","#a0782a"),_=i("--aurora","#8bd7e6"),m=i("--aurora-deep","#1f8aa8"),c=i("--coral","#ef7c63"),u=i("--ink-deep","#1d2734"),h=i("--ink-fog","#a6afbb"),b=i("--ink-pearl","#e6e9ef"),f=i("--ink-spectral","#bcc4d0"),C=[a,r,_,c,ps("oklch(70% 0.11 68)"),m,ps("oklch(76% 0.09 205)"),o,ps("oklch(68% 0.14 30)"),h,ps("oklch(62% 0.08 228)"),ps("oklch(52% 0.05 248)")],E=Object.fromEntries(M6.map((A,x)=>[A,C[x]??u]));return{background:"transparent",primaryColor:"transparent",primaryTextColor:b,primaryBorderColor:r,secondaryColor:"transparent",secondaryTextColor:b,secondaryBorderColor:a,tertiaryColor:"transparent",tertiaryTextColor:f,tertiaryBorderColor:r,lineColor:m,edgeLabelBackground:"transparent",titleColor:a,fontFamily:"JetBrains Mono Variable, ui-monospace, monospace",mainBkg:"transparent",nodeBorder:r,clusterBkg:"transparent",clusterBorder:r,pieTitleTextColor:a,pieTitleTextSize:"19px",pieSectionTextColor:b,pieSectionTextSize:"13px",pieLegendTextColor:b,pieLegendTextSize:"14px",pieStrokeColor:o,pieStrokeWidth:"1.35px",pieOuterStrokeColor:a,pieOuterStrokeWidth:"2.5px",pieOpacity:"0.96",...E}}function $6(){const e=getComputedStyle(document.documentElement),i=(h,b)=>{const f=e.getPropertyValue(h).trim();return ps(f||b)},r=i("--brass-deep","#a0782a"),a=i("--brass-bright","#e6b86a"),o=i("--aurora-deep","#1f8aa8"),_=i("--ink-abyss","#131920"),m=ps("oklch(15% 0.04 250 / 34%)"),c=i("--surface-glass","#1d2734"),u=i("--ink-pearl","#e6e9ef");return`
|
|
290
|
+
.node rect, .node polygon, .node circle, .node ellipse, .actor, .classGroup rect {
|
|
291
|
+
stroke: ${r};
|
|
292
|
+
fill: ${c};
|
|
293
|
+
}
|
|
294
|
+
.edgePath path, .messageLine0, .messageLine1, .relation {
|
|
295
|
+
stroke: ${o};
|
|
296
|
+
}
|
|
297
|
+
.nodeLabel, .edgeLabel, .actor text, .messageText {
|
|
298
|
+
fill: ${u};
|
|
299
|
+
font-family: "Manrope Variable", "Manrope", ui-sans-serif, sans-serif;
|
|
300
|
+
}
|
|
301
|
+
.pieCircle {
|
|
302
|
+
stroke: ${r};
|
|
303
|
+
stroke-width: 1.35px;
|
|
304
|
+
opacity: 0.96;
|
|
305
|
+
filter: drop-shadow(0 0 1.5px ${m});
|
|
306
|
+
}
|
|
307
|
+
.pieOuterCircle {
|
|
308
|
+
stroke: ${a};
|
|
309
|
+
opacity: 0.7;
|
|
310
|
+
}
|
|
311
|
+
.slice, .legend text, .pieTitleText {
|
|
312
|
+
fill: ${u};
|
|
313
|
+
paint-order: stroke;
|
|
314
|
+
stroke: ${_};
|
|
315
|
+
stroke-width: 3px;
|
|
316
|
+
stroke-linejoin: round;
|
|
317
|
+
font-family: "Manrope Variable", "Manrope", ui-sans-serif, sans-serif;
|
|
318
|
+
}
|
|
319
|
+
.slice {
|
|
320
|
+
font-weight: 600;
|
|
321
|
+
letter-spacing: 0.04em;
|
|
322
|
+
font-style: italic;
|
|
323
|
+
}
|
|
324
|
+
.pieTitleText {
|
|
325
|
+
font-weight: 600;
|
|
326
|
+
letter-spacing: 0.12em;
|
|
327
|
+
font-style: italic;
|
|
328
|
+
}
|
|
329
|
+
.legend text {
|
|
330
|
+
font-weight: 500;
|
|
331
|
+
letter-spacing: 0.03em;
|
|
332
|
+
}
|
|
333
|
+
.legend rect {
|
|
334
|
+
rx: 999px;
|
|
335
|
+
ry: 999px;
|
|
336
|
+
opacity: 0.9;
|
|
337
|
+
stroke: ${_};
|
|
338
|
+
stroke-width: 1.5px;
|
|
339
|
+
paint-order: stroke;
|
|
340
|
+
filter: saturate(0.78) brightness(0.92) drop-shadow(0 0 0.55px ${a});
|
|
341
|
+
}
|
|
342
|
+
`}function H6(e,i){const r=new DOMParser().parseFromString(i,"image/svg+xml"),a=Array.from(r.querySelectorAll("a")),o=Array.from(e.querySelectorAll("a")),_=Math.min(a.length,o.length);for(let m=0;m<_;m++){const c=a[m],u=o[m];if(!c||!u)continue;const h=c.getAttribute("href")??c.getAttribute("xlink:href")??"",b=eC(h);b&&u.setAttribute("href",b)}}function P6(e){const i=e.querySelector("svg");if(!i)return;let r;try{r=i.getBBox()}catch{return}const{x:a,y:o,width:_,height:m}=r;!Number.isFinite(a)||!Number.isFinite(o)||!Number.isFinite(_)||!Number.isFinite(m)||a<0||o<0||_<=0||m<=0||i.setAttribute("viewBox",`${Za(a)} ${Za(o)} ${Za(_)} ${Za(m)}`)}function U6(e){e.tabIndex=0,e.setAttribute("aria-label","Open diagram in expanded view"),Q6(e),e.dataset[P1]!=="true"&&(e.dataset[P1]="true",e.addEventListener("click",F6),e.addEventListener("keydown",q6))}function F6(e){if(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0||Zu(e.target))return;const i=e.currentTarget;i instanceof HTMLElement&&(e.preventDefault(),Qw(i))}function q6(e){if(e.key!=="Enter"&&e.key!==" "||Zu(e.target))return;const i=e.currentTarget;i instanceof HTMLElement&&(e.preventDefault(),Qw(i))}function Qw(e){const i=e.querySelector("svg");if(!i)return;Cl(!1);const r=typeof HTMLDialogElement<"u"&&typeof HTMLDialogElement.prototype.showModal=="function",a=document.createElement(r?"dialog":"div"),o=++O6,_=`diagram-lightbox-title-${o}`;a.className="diagram-lightbox",a.setAttribute("aria-labelledby",_),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=_,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 b=document.createElement("div");b.className="diagram-lightbox__controls",b.setAttribute("aria-label","Diagram zoom controls");const f=pu("−","Zoom out","out"),C=document.createElement("span");C.className="diagram-lightbox__zoom-readout",C.setAttribute("aria-live","polite");const E=pu("+","Zoom in","in"),A=pu("Fit","Fit diagram to viewport","fit"),x=pu("Reset","Reset diagram zoom","reset");b.append(f,C,E,A,x);const p=document.createElement("div");p.className="diagram-lightbox__viewport";const y=K6(i),d=i.cloneNode(!0);d.removeAttribute("style"),Y6(d,`diagram-lightbox-svg-${o}`),p.append(d),c.append(u,b,h),m.append(c,p),a.append(m),document.body.append(a);const v=new W6(p,d,C,y);f.addEventListener("click",()=>v.zoomOut()),E.addEventListener("click",()=>v.zoomIn()),A.addEventListener("click",()=>v.fit()),x.addEventListener("click",()=>v.reset());const T=X6(a),R=k=>{(k.target===a||k.target===h)&&Cl(!0)},L=k=>{if(k.key==="Escape"){k.preventDefault(),Cl(!0);return}v.handleKeyboard(k)||k.key==="Tab"&&J6(k,a)},M={dialog:a,trigger:e,inertStates:T,onClick:R,onKeyDown:L,cleanupPanZoom:()=>v.destroy()};r&&(M.onCancel=k=>{k.preventDefault(),Cl(!0)},a.addEventListener("cancel",M.onCancel),a.showModal()),a.addEventListener("click",R),document.addEventListener("keydown",L,!0),Il=M,v.fit(),h.focus()}function pu(e,i,r){const a=document.createElement("button");return a.className="diagram-lightbox__zoom-button",a.type="button",a.dataset.zoomAction=r,a.setAttribute("aria-label",i),a.textContent=e,a}class W6{constructor(i,r,a,o){this.viewport=i,this.svg=r,this.readout=a,this.baseSize=o,this.applyZoom(this.zoomIndex),i.addEventListener("pointerdown",this.onPointerDown),i.addEventListener("pointermove",this.onPointerMove),i.addEventListener("pointerup",this.onPointerEnd),i.addEventListener("pointercancel",this.onPointerEnd),i.addEventListener("wheel",this.onWheel,{passive:!1}),i.addEventListener("dblclick",this.onDoubleClick),window.addEventListener("resize",this.onResize)}viewport;svg;readout;baseSize;zoomIndex=Tn.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,Tn.length-1))}zoomOut(){this.zoomAroundViewportCenter(Math.max(this.zoomIndex-1,0))}reset(){this.zoomAroundViewportCenter(Tn.indexOf(100))}fit(){const i=this.viewport.clientWidth||this.viewport.getBoundingClientRect().width||this.baseSize.width,r=this.viewport.clientHeight||this.viewport.getBoundingClientRect().height||this.baseSize.height,a=Math.min(i/this.baseSize.width,r/this.baseSize.height),o=Math.floor(a*100),_=Tn.findIndex(c=>c>o),m=_===-1?Tn.length-1:Math.max(0,_-1);this.applyZoom(m),this.viewport.scrollLeft=Math.max(0,(this.svgWidth-i)/2),this.viewport.scrollTop=Math.max(0,(this.svgHeight-r)/2)}handleKeyboard(i){return i.key==="+"||i.key==="="?(i.preventDefault(),this.zoomIn(),!0):i.key==="-"||i.key==="_"?(i.preventDefault(),this.zoomOut(),!0):i.key==="0"?(i.preventDefault(),this.reset(),!0):i.key.toLowerCase()==="f"?(i.preventDefault(),this.fit(),!0):!1}get svgWidth(){return this.baseSize.width*(gu(this.zoomIndex)/100)}get svgHeight(){return this.baseSize.height*(gu(this.zoomIndex)/100)}applyZoom(i){this.zoomIndex=i;const r=gu(this.zoomIndex),a=r/100;this.svg.setAttribute("width",Za(this.baseSize.width*a)),this.svg.setAttribute("height",Za(this.baseSize.height*a)),this.readout.textContent=`${r}%`}zoomAroundViewportCenter(i){const r=this.viewport.getBoundingClientRect();this.zoomAroundPoint(i,r.left+r.width/2,r.top+r.height/2)}zoomAroundPoint(i,r,a){if(i===this.zoomIndex)return;const o=this.svgWidth,_=this.svgHeight,m=this.viewport.getBoundingClientRect(),c=this.viewport.scrollLeft+r-m.left,u=this.viewport.scrollTop+a-m.top;this.applyZoom(i),this.viewport.scrollLeft=c/o*this.svgWidth-(r-m.left),this.viewport.scrollTop=u/_*this.svgHeight-(a-m.top)}onPointerDown=i=>{if(i.button!==0||Zu(i.target))return;const r=i.pointerId??1;if(this.pointers.set(r,i),this.pointers.size===2){this.pinchStart={distance:this.pointerDistance(),zoomIndex:this.zoomIndex};return}this.dragStart={x:i.clientX,y:i.clientY,scrollLeft:this.viewport.scrollLeft,scrollTop:this.viewport.scrollTop,pointerId:r},this.viewport.setPointerCapture?.(r)};onPointerMove=i=>{const r=i.pointerId??1;if(this.pointers.has(r)&&this.pointers.set(r,i),this.pinchStart&&this.pointers.size>=2){const a=this.pointerDistance()/this.pinchStart.distance,o=gu(this.pinchStart.zoomIndex)*a;this.applyZoom(V6(o));return}!this.dragStart||this.dragStart.pointerId!==r||(i.preventDefault(),this.viewport.scrollLeft=this.dragStart.scrollLeft-(i.clientX-this.dragStart.x),this.viewport.scrollTop=this.dragStart.scrollTop-(i.clientY-this.dragStart.y))};onPointerEnd=i=>{const r=i.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=i=>{if(!i.ctrlKey&&!i.metaKey)return;i.preventDefault();const r=i.deltaY<0?Math.min(this.zoomIndex+1,Tn.length-1):Math.max(this.zoomIndex-1,0);this.zoomAroundPoint(r,i.clientX,i.clientY)};onDoubleClick=i=>{Zu(i.target)||(i.preventDefault(),this.zoomAroundPoint(this.zoomIndex===Tn.indexOf(200)?Tn.indexOf(100):Tn.indexOf(200),i.clientX,i.clientY))};onResize=()=>{this.fit()};pointerDistance(){const[i,r]=Array.from(this.pointers.values());return!i||!r?1:Math.hypot(r.clientX-i.clientX,r.clientY-i.clientY)}}function G6(e){const i=q1(e.getAttribute("width")),r=q1(e.getAttribute("height"));if(i&&r)return{width:i,height:r};const a=e.getAttribute("viewBox")?.trim().split(/[\s,]+/).map(Number)??[],o=a[2],_=a[3],m=o!==void 0&&Number.isFinite(o)&&o>0?o:null,c=_!==void 0&&Number.isFinite(_)&&_>0?_:null;return{width:i??m??800,height:r??c??600}}function K6(e){const i=e.getBoundingClientRect();return i.width>0&&i.height>0?{width:i.width,height:i.height}:G6(e)}function q1(e){if(!e)return null;const i=/^(\d+(?:\.\d+)?)/.exec(e.trim());if(!i)return null;const r=Number(i[1]);return Number.isFinite(r)&&r>0?r:null}function Za(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/\.?0+$/,"")}function V6(e){let i=0,r=Number.POSITIVE_INFINITY;return Tn.forEach((a,o)=>{const _=Math.abs(a-e);_<r&&(r=_,i=o)}),i}function gu(e){return Tn[e]??Tn[0]}function Y6(e,i){const r=e.getAttribute("id")??"";e.setAttribute("id",i);const a=e.querySelector("style");!r||!a?.textContent||(a.textContent=a.textContent.split(`#${r}`).join(`#${i}`))}function Cl(e){const i=Il;i&&(i.dialog.removeEventListener("click",i.onClick),document.removeEventListener("keydown",i.onKeyDown,!0),i.onCancel&&i.dialog.removeEventListener("cancel",i.onCancel),i.cleanupPanZoom(),Z6(i.inertStates),i.dialog instanceof HTMLDialogElement&&i.dialog.open&&typeof i.dialog.close=="function"&&i.dialog.close(),i.dialog.remove(),Il=null,e&&i.trigger.isConnected&&i.trigger.focus())}function X6(e){const i=[];for(const r of Array.from(document.body.children))!(r instanceof HTMLElement)||r===e||(i.push({element:r,ariaHidden:r.getAttribute("aria-hidden"),inert:r.inert}),r.inert=!0,r.setAttribute("aria-hidden","true"));return i}function Z6(e){for(const i of e)i.element.inert=i.inert,i.ariaHidden===null?i.element.removeAttribute("aria-hidden"):i.element.setAttribute("aria-hidden",i.ariaHidden)}function J6(e,i){const r=Array.from(i.querySelectorAll(T6)).filter(t4);if(r.length===0){e.preventDefault(),i.focus();return}const a=r[0],o=r[r.length-1];!a||!o||(e.shiftKey&&document.activeElement===a?(e.preventDefault(),o.focus()):!e.shiftKey&&document.activeElement===o&&(e.preventDefault(),a.focus()))}function Q6(e){e.querySelector("a[href]")?e.removeAttribute("role"):e.setAttribute("role","button")}function Zu(e){if(!(e instanceof Element))return!1;const i=e.closest("a[href]");return!i||!(i.getAttribute("href")?.trim()??"")?!1:!e4(i)}function e4(e){return Array.from(e.children).some(i=>i.tagName.toLowerCase()==="svg")}function t4(e){return!(e.inert||e.hidden||e.getAttribute("aria-hidden")==="true"||"disabled"in e&&e.disabled)}function eC(e){const i=e.trim();if(!i||i.includes(".."))return null;if(/^[a-z][a-z0-9+.-]*:/i.test(i)){if(/^javascript:/i.test(i)||/^data:/i.test(i))return null;let a;try{a=new URL(i)}catch{return null}return a.origin!==window.location.origin?null:eC(a.pathname)}if(/^\/entry\/[^/?#]+$/.exec(i)){const a=i.slice(7);let o;try{o=decodeURIComponent(a)}catch{return null}return/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/.test(o)?`/entry/${encodeURIComponent(o)}`:null}return/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/.test(i)?`/entry/${encodeURIComponent(i)}`:null}function i4(e){const i=R6.exec(e);if(!i)return null;const r=i[1]?.trim();if(!r)return null;const a=r.indexOf("/"),o=a>=0?r.slice(0,a):r,_=a>=0?r.slice(a+1).trim():"",m=o.trim().split(/[\s,]+/).filter(Boolean);if(m.length!==3)return null;const[c,u,h]=m;if(!c||!u||!h)return null;const b=pp(c,1),f=pp(u,.4),C=r4(h);if(b===null||f===null||C===null)return null;let E=1;if(a>=0){const A=pp(_,1);if(A===null)return null;E=A}return{L:b,C:f,h:C,alpha:E}}function n4(e){const i=e.h*Math.PI/180,r=e.C*Math.cos(i),a=e.C*Math.sin(i),o=e.L,_=o+.3963377774*r+.2158037573*a,m=o-.1055613458*r-.0638541728*a,c=o-.0894841775*r-1.291485548*a,u=_**3,h=m**3,b=c**3,f=4.0767416621*u-3.3077115913*h+.2309699292*b,C=-1.2684380046*u+2.6097574011*h-.3413193965*b,E=-.0041960863*u-.7034186147*h+1.707614701*b,A=mu(gp(f)),x=mu(gp(C)),p=mu(gp(E));if(e.alpha<1){const y=mu(e.alpha);return`#${Ps(A)}${Ps(x)}${Ps(p)}${Ps(y)}`}return`#${Ps(A)}${Ps(x)}${Ps(p)}`}function pp(e,i){if(!e)return null;if(e.endsWith("%")){const a=Number(e.slice(0,-1));return Number.isFinite(a)?a/100*i:null}const r=Number(e);return Number.isFinite(r)?r:null}function r4(e){const i=L6.exec(e);if(!i)return null;const r=Number(i[1]);return Number.isFinite(r)?r:null}function gp(e){const i=Math.max(0,Math.min(1,e));return i>.0031308?1.055*Math.pow(i,1/2.4)-.055:12.92*i}function mu(e){return Math.round(Math.max(0,Math.min(1,e))*255)}function Ps(e){return e.toString(16).padStart(2,"0")}function s4(e){const i=e.tags.map(a=>`<span class="chip chip-tag">${Ae(a)}</span>`).join(""),r=o4(e);return`
|
|
343
|
+
<div class="meta-chips">
|
|
344
|
+
${i}
|
|
345
|
+
${r}
|
|
346
|
+
<span class="chip">Updated ${Ae(a4(e.updated))}</span>
|
|
347
|
+
</div>
|
|
348
|
+
`}function tC(e){return e.map(i=>`<span class="chip chip-muted">${Ae(i)}</span>`).join("")}function a4(e){const i=new Date(e);return Number.isNaN(i.getTime())?e:i.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}function o4(e){const i=l4(e);return i?`<span class="chip ${i.tone==="deprecated"?"chip-coral":i.tone==="stale"?"chip-stale":""}" title="${Je(i.title)}">${Ae(i.label)}</span>`:""}function l4(e,i=new Date){const r=e.status,a=typeof e.revalidateAfter=="string"&&!Number.isNaN(Date.parse(e.revalidateAfter))&&Date.parse(e.revalidateAfter)<i.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 c4(e,i,r){const a=u4(e,i,r);return a.length===0?"":`
|
|
349
|
+
<section class="related-list">
|
|
350
|
+
<h2>Related entries</h2>
|
|
351
|
+
<div class="related-items">
|
|
352
|
+
${a.map(o=>`
|
|
353
|
+
<a class="related-card" href="${Ir(o.entry.id)}" data-entry-id="${Je(o.entry.id)}">
|
|
354
|
+
<strong>${Ae(o.entry.title)}</strong>
|
|
355
|
+
<span>${tC(o.matchingTags)}</span>
|
|
356
|
+
</a>
|
|
357
|
+
`).join("")}
|
|
358
|
+
</div>
|
|
359
|
+
</section>
|
|
360
|
+
`}function u4(e,i,r){const a=new Set(i),o="en-US";return r.filter(_=>_.id!==e).map(_=>({entry:_,matchingTags:_.tags.filter(m=>a.has(m))})).filter(_=>_.matchingTags.length>0).sort((_,m)=>m.matchingTags.length-_.matchingTags.length||_.entry.title.localeCompare(m.entry.title,o,{sensitivity:"base",numeric:!0})).slice(0,5)}const h4=`
|
|
361
|
+
<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">
|
|
362
|
+
<path d="M5 12h14M13 6l6 6-6 6" />
|
|
363
|
+
</svg>
|
|
364
|
+
`;function d4(e,i,r=!0){const a=e.length,o=e.slice(0,6),_=e[0]??null;return`
|
|
365
|
+
<article class="document welcome">
|
|
366
|
+
<header class="welcome-title">
|
|
367
|
+
<p class="eyebrow">Fleet · Codex</p>
|
|
368
|
+
<h1>The <em>Codex</em></h1>
|
|
369
|
+
</header>
|
|
370
|
+
<div class="welcome-divider"></div>
|
|
371
|
+
<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>
|
|
372
|
+
${r?"":'<p class="error-box">No workspace is registered in this daemon. Re-run <code>fleet-wiki</code> in the target directory.</p>'}
|
|
373
|
+
<div class="workspace-meta">
|
|
374
|
+
<span class="chip chip-aurora">${a} entries</span>
|
|
375
|
+
${i?`<span class="workspace-path">${Ae(i)}</span>`:""}
|
|
376
|
+
</div>
|
|
377
|
+
${_?`
|
|
378
|
+
<a class="primary-link" href="${Je(Ir(_.id))}" data-entry-id="${Je(_.id)}">
|
|
379
|
+
<span>Open first entry — ${Ae(_.title)}</span>
|
|
380
|
+
${h4}
|
|
381
|
+
</a>
|
|
382
|
+
`:'<p class="empty-state">No wiki entries yet. Add entries with <code>wiki_ingest</code>.</p>'}
|
|
383
|
+
${o.length>0?`
|
|
384
|
+
<div class="welcome-grid">
|
|
385
|
+
${o.map(m=>`
|
|
386
|
+
<a class="welcome-card" href="${Je(Ir(m.id))}" data-entry-id="${Je(m.id)}">
|
|
387
|
+
<strong>${Ae(m.title)}</strong>
|
|
388
|
+
<span class="welcome-card-tags">${tC(m.tags.slice(0,3))}</span>
|
|
389
|
+
</a>
|
|
390
|
+
`).join("")}
|
|
391
|
+
</div>
|
|
392
|
+
`:""}
|
|
393
|
+
</article>
|
|
394
|
+
`}function f4(e,i){const r=ho(e.body);return{toc:r.toc,html:`
|
|
395
|
+
<article class="document">
|
|
396
|
+
<header class="document-header">
|
|
397
|
+
<p class="eyebrow">Wiki Entry</p>
|
|
398
|
+
<h1>${Ae(e.frontmatter.title)}</h1>
|
|
399
|
+
${s4(e.frontmatter)}
|
|
400
|
+
</header>
|
|
401
|
+
<div class="markdown-body" id="markdown-body">
|
|
402
|
+
${r.html}
|
|
403
|
+
</div>
|
|
404
|
+
${c4(e.frontmatter.id,e.frontmatter.tags,i)}
|
|
405
|
+
</article>
|
|
406
|
+
`}}function p4(){return`
|
|
407
|
+
<article class="document">
|
|
408
|
+
<p class="loading">Loading entry</p>
|
|
409
|
+
</article>
|
|
410
|
+
`}function g4(e){return`
|
|
411
|
+
<article class="document">
|
|
412
|
+
<p class="error-box">${Ae(e)}</p>
|
|
413
|
+
</article>
|
|
414
|
+
`}const Ou=new Set;let Dr="entries";const m4=`
|
|
415
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
416
|
+
<circle cx="11" cy="11" r="6.5" />
|
|
417
|
+
<path d="m20 20-3.5-3.5" />
|
|
418
|
+
</svg>
|
|
419
|
+
`,_4=`
|
|
420
|
+
<svg class="caret" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
421
|
+
<path d="m6 9 6 6 6-6" />
|
|
422
|
+
</svg>
|
|
423
|
+
`,v4=`
|
|
424
|
+
<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">
|
|
425
|
+
<path d="M6 6 18 18M18 6 6 18" />
|
|
426
|
+
</svg>
|
|
427
|
+
`,b4=`
|
|
428
|
+
<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">
|
|
429
|
+
<circle cx="12" cy="5" r="2" />
|
|
430
|
+
<path d="M12 7v14M8 11H4a8 8 0 0 0 16 0h-4" />
|
|
431
|
+
</svg>
|
|
432
|
+
`;function y4(e,i,r,a=[],o=null,_){const m=e.length,c=C4(e),u=m===0?'<p class="empty-state">No wiki entries yet.</p>':Dr==="tags"?x4(e,i):E4(e,i),h=Dr==="tags"?`Tags · ${c}`:`Entries · ${m}`,b=Dr==="tags"?"tag-tree":"entry-list",f=Dr==="tags"?"Entries by tag":"All entries",C=k4(_??(typeof window<"u"?window.location.pathname:"")),E=C.startsWith("/queue"),A=C==="/index",x=C==="/log",p=C.startsWith("/conflicts"),y=r>0?`<span class="nav-drydock-badge">${r}</span>`:"";return`
|
|
433
|
+
<aside class="sidebar" id="sidebar">
|
|
434
|
+
<div class="sidebar-header">
|
|
435
|
+
<div class="sidebar-header-actions">
|
|
436
|
+
<button class="icon-button mobile-close" type="button" data-action="toggle-nav" aria-label="Close">${v4}</button>
|
|
437
|
+
</div>
|
|
438
|
+
</div>
|
|
439
|
+
<button class="command-entry" type="button" data-action="open-command">
|
|
440
|
+
<span class="command-entry-label">${m4}<span>Search entries</span></span>
|
|
441
|
+
<kbd>⌘K</kbd>
|
|
442
|
+
</button>
|
|
443
|
+
<div class="nav-drydock-section">
|
|
444
|
+
<a class="nav-drydock-link${E?" active":""}" href="${Je(no())}">
|
|
445
|
+
<span class="nav-drydock-icon">${b4}</span>
|
|
446
|
+
<span class="nav-drydock-label">Drydock</span>
|
|
447
|
+
${y}
|
|
448
|
+
</a>
|
|
449
|
+
<a class="nav-drydock-link${A?" active":""}" href="${Je(lL())}">
|
|
450
|
+
<span class="nav-drydock-label">Index</span>
|
|
451
|
+
</a>
|
|
452
|
+
<a class="nav-drydock-link${x?" active":""}" href="${Je(pw())}">
|
|
453
|
+
<span class="nav-drydock-label">Log</span>
|
|
454
|
+
</a>
|
|
455
|
+
<a class="nav-drydock-link${p?" active":""}" href="${Je(aL())}">
|
|
456
|
+
<span class="nav-drydock-label">Conflicts</span>
|
|
457
|
+
</a>
|
|
458
|
+
</div>
|
|
459
|
+
<div class="nav-tabs" role="tablist" aria-label="Navigation mode">
|
|
460
|
+
<button class="nav-tab${Dr==="entries"?" active":""}" type="button" role="tab" aria-selected="${Dr==="entries"}" data-action="set-nav-mode" data-mode="entries">
|
|
461
|
+
Entries
|
|
462
|
+
</button>
|
|
463
|
+
<button class="nav-tab${Dr==="tags"?" active":""}" type="button" role="tab" aria-selected="${Dr==="tags"}" data-action="set-nav-mode" data-mode="tags">
|
|
464
|
+
Tags
|
|
465
|
+
</button>
|
|
466
|
+
</div>
|
|
467
|
+
<p class="nav-section-label">${h}</p>
|
|
468
|
+
<nav class="${b}" aria-label="${f}">
|
|
469
|
+
${u}
|
|
470
|
+
</nav>
|
|
471
|
+
</aside>
|
|
472
|
+
`}function S4(e){if(Ou.has(e)){Ou.delete(e);return}Ou.add(e)}function w4(e){Dr=e}function C4(e){const i=new Set;for(const r of e){if(r.tags.length===0){i.add("untagged");continue}for(const a of r.tags)i.add(a)}return i.size}function x4(e,i){return T4(e).map(a=>A4(a,i)).join("")}function E4(e,i){const r="en-US";return[...e].sort((o,_)=>o.title.localeCompare(_.title,r,{sensitivity:"base",numeric:!0})).map(o=>iC(o,i)).join("")}function T4(e){const i="en-US",r=new Map;for(const a of e){const o=a.tags.length>0?a.tags:["untagged"];for(const _ of o){const m=r.get(_)??[];m.push(a),r.set(_,m)}}return[...r.entries()].map(([a,o])=>({tag:a,entries:o.sort((_,m)=>_.title.localeCompare(m.title,i,{sensitivity:"base",numeric:!0}))})).sort((a,o)=>a.tag.localeCompare(o.tag,i,{sensitivity:"base",numeric:!0}))}function A4(e,i){const r=Ou.has(e.tag),a=r?"":e.entries.map(o=>iC(o,i)).join("");return`
|
|
473
|
+
<section class="tag-group" data-collapsed="${r?"true":"false"}">
|
|
474
|
+
<button class="tag-group-button" type="button" data-action="toggle-tag" data-tag="${Je(e.tag)}">
|
|
475
|
+
${_4}
|
|
476
|
+
<span>${e.tag==="untagged"?"Untagged":Ae(e.tag)}</span>
|
|
477
|
+
<span class="count">${e.entries.length}</span>
|
|
478
|
+
</button>
|
|
479
|
+
<div class="tag-group-list">${a}</div>
|
|
480
|
+
</section>
|
|
481
|
+
`}function iC(e,i){const r=e.id===i?" active":"",a=Je(e.title);return`
|
|
482
|
+
<a class="nav-entry${r}" href="${Ir(e.id)}" data-entry-id="${Je(e.id)}" title="${a}">
|
|
483
|
+
<span class="nav-entry-text">${Ae(e.title)}</span>
|
|
484
|
+
</a>
|
|
485
|
+
`}function k4(e){const i=e===Hn||e===`${Hn}/`?"/":e.startsWith(`${Hn}/`)?e.slice(Hn.length)||"/":e,r=i.match(/^\/w\/[^/]+(\/.*)?$/);return r?r[1]??"/":i}const R4=`
|
|
486
|
+
<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">
|
|
487
|
+
<path d="M15 18 9 12l6-6" />
|
|
488
|
+
</svg>
|
|
489
|
+
`,L4=`
|
|
490
|
+
<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">
|
|
491
|
+
<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" />
|
|
492
|
+
<path d="M9 9h6M9 13h6" />
|
|
493
|
+
</svg>
|
|
494
|
+
`;function M4(e){const i=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 — ${Ae(e.error)}</p>`:e.content?r=`<div class="markdown-body">${ho(e.content).html}</div>`:r='<p class="empty-state">Source is empty.</p>',`
|
|
495
|
+
<div class="raw-shell">
|
|
496
|
+
<header class="raw-header">
|
|
497
|
+
<a class="raw-back" href="/" data-action="navigate-home" aria-label="Back to Codex">
|
|
498
|
+
${R4}
|
|
499
|
+
<span>Codex</span>
|
|
500
|
+
</a>
|
|
501
|
+
<div class="raw-meta">
|
|
502
|
+
<span class="raw-glyph">${L4}</span>
|
|
503
|
+
<div class="raw-meta-text">
|
|
504
|
+
<p class="eyebrow">Manifest · Raw Source</p>
|
|
505
|
+
<h1 class="raw-title">${Ae(i)}</h1>
|
|
506
|
+
</div>
|
|
507
|
+
</div>
|
|
508
|
+
<div class="raw-divider"></div>
|
|
509
|
+
</header>
|
|
510
|
+
<article class="raw-document">
|
|
511
|
+
${r}
|
|
512
|
+
</article>
|
|
513
|
+
</div>
|
|
514
|
+
`}function em(e,i){const r=e==="create_wiki"||!i,a=r?"+":"↻",o=r?"CREATE":"UPDATE";return`<span class="op-badge ${r?"op-badge--create":"op-badge--update"}" aria-label="${o}">
|
|
515
|
+
<span class="op-badge-glyph" aria-hidden="true">${a}</span>
|
|
516
|
+
<span class="op-badge-label">${o}</span>
|
|
517
|
+
</span>`}function D4(e){const{tab:i,items:r,pendingCount:a,archivedCount:o,loading:_,error:m}=e;if(_&&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 — ${Ae(m)}</p></div>`;const c=r.length===0?O4(i):r.map(b=>N4(b)).join(""),u=a>0?`<span class="queue-badge">${a}</span>`:"",h=o>0?`<span class="queue-badge queue-badge--muted">${o}</span>`:"";return`
|
|
518
|
+
<div class="queue-view">
|
|
519
|
+
<div class="queue-header">
|
|
520
|
+
<p class="drydock-eyebrow">MANIFEST · DRYDOCK</p>
|
|
521
|
+
<h1 class="queue-title">Patch Queue</h1>
|
|
522
|
+
</div>
|
|
523
|
+
<div class="queue-tabs" role="tablist" aria-label="Queue tabs">
|
|
524
|
+
<a class="queue-tab${i==="pending"?" active":""}"
|
|
525
|
+
href="${Je(no("pending"))}"
|
|
526
|
+
role="tab"
|
|
527
|
+
aria-selected="${i==="pending"}">
|
|
528
|
+
Pending${u}
|
|
529
|
+
</a>
|
|
530
|
+
<a class="queue-tab${i==="archived"?" active":""}"
|
|
531
|
+
href="${Je(no("archived"))}"
|
|
532
|
+
role="tab"
|
|
533
|
+
aria-selected="${i==="archived"}">
|
|
534
|
+
Archived${h}
|
|
535
|
+
</a>
|
|
536
|
+
</div>
|
|
537
|
+
<div class="queue-list">
|
|
538
|
+
${c}
|
|
539
|
+
</div>
|
|
540
|
+
</div>
|
|
541
|
+
`}function O4(e){return`<p class="queue-empty">${e==="pending"?"No pending patches.":"No archived patches."}</p>`}function N4(e){const{id:i,meta:r,source:a,summary:o,op:_,target:m}=e,c=B4(r.status),u=Xu(r.createdAt),h=r.warnings??[],b=h.slice(0,3).map(p=>`<span class="chip chip-muted">${Ae(p)}</span>`).join(""),f=h.length>3?`<span class="chip chip-muted">+${h.length-3}</span>`:"",C=a==="archive"?`<span class="chip">${Ae(r.status)}</span>`:"",E=_?em(_,!0):"",A=o?`<p class="queue-card-summary">${Ae(o)}</p>`:"",x=m?`<span class="queue-card-target">${Ae(m)}</span>`:"";return`
|
|
542
|
+
<a class="queue-card" href="${Je(sL(i))}">
|
|
543
|
+
${A}
|
|
544
|
+
<div class="queue-card-top">
|
|
545
|
+
<span class="queue-card-id">${Ae(i)}</span>
|
|
546
|
+
${c}
|
|
547
|
+
</div>
|
|
548
|
+
<div class="queue-card-meta">
|
|
549
|
+
${E}
|
|
550
|
+
${x}
|
|
551
|
+
<span class="queue-card-time">${Ae(u)}</span>
|
|
552
|
+
${C}
|
|
553
|
+
<div class="queue-card-chips">
|
|
554
|
+
${b}${f}
|
|
555
|
+
</div>
|
|
556
|
+
</div>
|
|
557
|
+
</a>
|
|
558
|
+
`}function B4(e){return`<span class="status-dot ${e==="pending"?"status-dot--pending":e==="accepted"?"status-dot--accepted":"status-dot--rejected"}" aria-label="${Je(e)}"></span>`}const I4=`
|
|
559
|
+
<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">
|
|
560
|
+
<path d="M15 18 9 12l6-6" />
|
|
561
|
+
</svg>
|
|
562
|
+
`,j4=`
|
|
563
|
+
<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">
|
|
564
|
+
<path d="M7 17 17 7M9 7h8v8" />
|
|
565
|
+
</svg>
|
|
566
|
+
`;function z4(e){const{current:i,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 — ${Ae(a)}</p></div>`:i?$4(i,e):'<div class="queue-detail-view"><p class="empty-state">Patch not found.</p></div>'}function $4(e,i){const{patch:r,meta:a,wikiEntry:o,targetExists:_}=e,{frontmatter:m}=r,c=ho(o.body),u=em(m.op,_),h=a.rawSourceRef;return`
|
|
567
|
+
<div class="queue-detail-view">
|
|
568
|
+
<div class="queue-detail-layout">
|
|
569
|
+
<div class="queue-detail-main">
|
|
570
|
+
<a class="raw-back queue-back" href="${Je(no())}" aria-label="Back to Drydock">
|
|
571
|
+
${I4}
|
|
572
|
+
<span>Drydock</span>
|
|
573
|
+
</a>
|
|
574
|
+
<div class="queue-detail-header">
|
|
575
|
+
<p class="drydock-eyebrow">MANIFEST · PATCH</p>
|
|
576
|
+
<p class="queue-patch-id">${Ae(a.id)}</p>
|
|
577
|
+
<h1 class="queue-summary">${Ae(m.summary)}</h1>
|
|
578
|
+
${u}
|
|
579
|
+
</div>
|
|
580
|
+
<article class="document">
|
|
581
|
+
<div class="markdown-body" id="markdown-body">${c.html}</div>
|
|
582
|
+
</article>
|
|
583
|
+
</div>
|
|
584
|
+
<aside class="queue-rail">
|
|
585
|
+
${H4(e,h)}
|
|
586
|
+
${F4(c.toc)}
|
|
587
|
+
${U4(e)}
|
|
588
|
+
${P4(e,i)}
|
|
589
|
+
</aside>
|
|
590
|
+
</div>
|
|
591
|
+
</div>
|
|
592
|
+
`}function H4(e,i){const{patch:r,meta:a,targetExists:o}=e,{frontmatter:_}=r,m=em(_.op,o),c=sg(a.createdAt),u=Xu(a.createdAt),h=q4(a.status),b=a.warnings??[],f=i?`<dd class="queue-dl-value">
|
|
593
|
+
<a class="manifest-link queue-raw-link" href="${Je(fw(i))}" data-raw-ref="${Je(i)}">
|
|
594
|
+
<span class="manifest-ref">${Ae(i)}</span>
|
|
595
|
+
<span class="manifest-arrow">${j4}</span>
|
|
596
|
+
</a>
|
|
597
|
+
</dd>`:'<dd class="queue-dl-value queue-dl-muted">None</dd>',C=b.length>0?`<dt class="queue-dl-key">Warnings</dt>
|
|
598
|
+
<dd class="queue-dl-value">
|
|
599
|
+
<div class="queue-card-chips">
|
|
600
|
+
${b.map(E=>`<span class="chip chip-muted">${Ae(E)}</span>`).join("")}
|
|
601
|
+
</div>
|
|
602
|
+
</dd>`:"";return`
|
|
603
|
+
<div class="queue-rail-card">
|
|
604
|
+
<div class="queue-rail-header">
|
|
605
|
+
<p class="drydock-eyebrow">MANIFEST · PATCH</p>
|
|
606
|
+
<p class="queue-rail-subtitle">Patch Manifest</p>
|
|
607
|
+
</div>
|
|
608
|
+
<dl class="queue-dl">
|
|
609
|
+
<dt class="queue-dl-key">OP</dt>
|
|
610
|
+
<dd class="queue-dl-value">${m}</dd>
|
|
611
|
+
<dt class="queue-dl-key">Target</dt>
|
|
612
|
+
<dd class="queue-dl-value queue-dl-mono">${Ae(_.target)}</dd>
|
|
613
|
+
<dt class="queue-dl-key">Proposer</dt>
|
|
614
|
+
<dd class="queue-dl-value">${Ae(_.proposer)}</dd>
|
|
615
|
+
<dt class="queue-dl-key">Created</dt>
|
|
616
|
+
<dd class="queue-dl-value queue-dl-time">
|
|
617
|
+
<time datetime="${Je(a.createdAt)}" title="${Je(c)}">
|
|
618
|
+
${Ae(c)}
|
|
619
|
+
<span class="queue-dl-relative">(${Ae(u)})</span>
|
|
620
|
+
</time>
|
|
621
|
+
</dd>
|
|
622
|
+
<dt class="queue-dl-key">Status</dt>
|
|
623
|
+
<dd class="queue-dl-value queue-dl-status">${h}<span>${Ae(a.status)}</span></dd>
|
|
624
|
+
<dt class="queue-dl-key">Source</dt>
|
|
625
|
+
${f}
|
|
626
|
+
${C}
|
|
627
|
+
</dl>
|
|
628
|
+
</div>
|
|
629
|
+
`}function P4(e,i){const{meta:r,source:a}=e;if(r.status!=="pending"||a!=="queue")return"";const{actionPending:o,actionError:_}=i,m=o?" disabled":"",c=Je(r.id),u=_?`<p class="queue-action-error">${Ae(_)}</p>`:"";return`
|
|
630
|
+
<div class="queue-rail-card queue-actions-card">
|
|
631
|
+
<div class="queue-rail-header">
|
|
632
|
+
<p class="drydock-eyebrow">ACTIONS</p>
|
|
633
|
+
<p class="queue-rail-subtitle">Decision</p>
|
|
634
|
+
</div>
|
|
635
|
+
${o?'<span class="queue-action-spinner" aria-label="Processing"></span>':""}
|
|
636
|
+
<div class="queue-action-buttons">
|
|
637
|
+
<button class="queue-action-btn queue-action-btn--approve" type="button"
|
|
638
|
+
data-action="queue-approve" data-patch-id="${c}"${m}
|
|
639
|
+
aria-label="Approve this patch">
|
|
640
|
+
<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>
|
|
641
|
+
Approve
|
|
642
|
+
</button>
|
|
643
|
+
<button class="queue-action-btn queue-action-btn--reject" type="button"
|
|
644
|
+
data-action="queue-reject-toggle"${m}
|
|
645
|
+
aria-label="Reject this patch">
|
|
646
|
+
<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>
|
|
647
|
+
Reject
|
|
648
|
+
</button>
|
|
649
|
+
</div>
|
|
650
|
+
<form class="queue-reject-form" hidden data-action="queue-reject-submit" data-patch-id="${c}">
|
|
651
|
+
<textarea class="queue-reject-textarea" name="reason" minlength="1" maxlength="256" required placeholder="Enter rejection reason (max 256 chars)"></textarea>
|
|
652
|
+
<div class="queue-action-buttons">
|
|
653
|
+
<button class="queue-action-btn queue-action-btn--reject-submit" type="submit"${m}>Confirm</button>
|
|
654
|
+
<button class="queue-action-btn queue-action-btn--cancel" type="button" data-action="queue-reject-cancel"${m}>Cancel</button>
|
|
655
|
+
</div>
|
|
656
|
+
</form>
|
|
657
|
+
${u}
|
|
658
|
+
</div>
|
|
659
|
+
`}function U4(e){const i=e.patchSet;return!i||i.members.length===0?"":`
|
|
660
|
+
<div class="queue-rail-card">
|
|
661
|
+
<div class="queue-rail-header">
|
|
662
|
+
<p class="drydock-eyebrow">MANIFEST · DRYDOCK</p>
|
|
663
|
+
<p class="queue-rail-subtitle">Patch Set</p>
|
|
664
|
+
</div>
|
|
665
|
+
<p class="queue-patch-id">${Ae(i.id)}</p>
|
|
666
|
+
<ul class="patch-set-list">
|
|
667
|
+
${i.members.map(r=>`
|
|
668
|
+
<li class="patch-set-item">
|
|
669
|
+
<span class="patch-set-item-copy">
|
|
670
|
+
<strong>${Ae(r.summary??r.id)}</strong>
|
|
671
|
+
<small>${Ae(r.target??r.id)}</small>
|
|
672
|
+
</span>
|
|
673
|
+
<span class="chip ${r.status==="rejected"?"chip-coral":""}">${Ae(r.status??r.source)}</span>
|
|
674
|
+
</li>
|
|
675
|
+
`).join("")}
|
|
676
|
+
</ul>
|
|
677
|
+
</div>
|
|
678
|
+
`}function F4(e){return e.length===0?"":`
|
|
679
|
+
<div class="queue-rail-card queue-toc-card">
|
|
680
|
+
<div class="queue-rail-header">
|
|
681
|
+
<p class="drydock-eyebrow">CONTENTS</p>
|
|
682
|
+
</div>
|
|
683
|
+
<nav class="queue-toc-nav" aria-label="Table of contents">
|
|
684
|
+
${e.map(r=>`<a class="queue-toc-link queue-toc-level-${r.level}" href="#${Je(r.id)}">${Ae(r.text)}</a>`).join("")}
|
|
685
|
+
</nav>
|
|
686
|
+
</div>
|
|
687
|
+
`}function q4(e){return`<span class="status-dot ${e==="pending"?"status-dot--pending":e==="accepted"?"status-dot--accepted":"status-dot--rejected"}" aria-label="${Je(e)}"></span>`}function W4(e){return e.length===0?"":`
|
|
688
|
+
<nav class="toc-panel" aria-label="Table of contents">
|
|
689
|
+
<h2>Contents</h2>
|
|
690
|
+
${e.map(i=>`
|
|
691
|
+
<a class="toc-level-${i.level}" href="#${Je(i.id)}" data-toc-id="${Je(i.id)}">
|
|
692
|
+
${Ae(i.text)}
|
|
693
|
+
</a>
|
|
694
|
+
`).join("")}
|
|
695
|
+
</nav>
|
|
696
|
+
`}function G4(e){const i=e.entries.join(`
|
|
697
|
+
|
|
698
|
+
`),r=ho(i);return`
|
|
699
|
+
<article class="document">
|
|
700
|
+
<header class="document-header">
|
|
701
|
+
<p class="eyebrow">MANIFEST · DRYDOCK</p>
|
|
702
|
+
<h1>Log</h1>
|
|
703
|
+
<div class="log-controls">
|
|
704
|
+
${[10,20,50,100].map(o=>`
|
|
705
|
+
<a class="chip ${o===e.limit?"chip-tag":""}" href="${pw(o)}">${o}</a>
|
|
706
|
+
`).join("")}
|
|
707
|
+
</div>
|
|
708
|
+
</header>
|
|
709
|
+
<p class="empty-state">${`Latest ${e.limit} of ${e.totalEntries} entries`}</p>
|
|
710
|
+
<div class="markdown-body">${r.html}</div>
|
|
711
|
+
</article>
|
|
712
|
+
`}const ag=new Set,na={tab:"pending",items:[],pendingCount:0,archivedCount:0,current:null,loading:!1,error:null,actionPending:!1,actionError:null};function Ju(){return na}function K4(e){return ag.add(e),()=>ag.delete(e)}async function V4(e){Ji({tab:e,loading:!0,error:null,current:null});try{const i=await mh(e);Ji({items:i.items,pendingCount:i.pendingCount,archivedCount:i.archivedCount,loading:!1}),Ug(i.pendingCount)}catch(i){Ji({loading:!1,error:bh(i)})}}async function Y4(e){Ji({loading:!0,error:null,current:null});try{const i=await YR(e);Ji({current:i,loading:!1})}catch(i){Ji({loading:!1,error:bh(i)})}}function Us(){Ji({items:[],current:null,error:null,loading:!1,actionPending:!1,actionError:null})}async function X4(){if(na.actionPending)return;const e=na.current?.meta.id;if(e){Ji({actionPending:!0,actionError:null});try{await XR(e);const i=await mh("pending");Ji({actionPending:!1,pendingCount:i.pendingCount,archivedCount:i.archivedCount}),Ug(i.pendingCount),ea(no("archived"))}catch(i){Ji({actionPending:!1,actionError:bh(i)})}}}async function Z4(e){if(na.actionPending)return;const i=na.current?.meta.id;if(!i)return;const r=e.trim();if(!r||r.length>256){Ji({actionError:r?"Rejection reason must be 256 characters or less.":"Please enter a rejection reason."});return}Ji({actionPending:!0,actionError:null});try{await ZR(i,r);const a=await mh("pending");Ji({actionPending:!1,pendingCount:a.pendingCount,archivedCount:a.archivedCount}),Ug(a.pendingCount),ea(no("archived"))}catch(a){Ji({actionPending:!1,actionError:bh(a)})}}function Ji(e){Object.assign(na,e);for(const i of ag)i(na)}function bh(e){return e instanceof Error?e.message:String(e)}const og=new Set,gs={ref:null,content:null,loading:!1,error:null};function J4(){return gs}function Q4(e){return og.add(e),()=>og.delete(e)}async function eD(e){if(!(gs.ref===e&&gs.content!==null&&!gs.error)){Nu({ref:e,content:null,loading:!0,error:null});try{const i=await VR(e);if(gs.ref!==e)return;Nu({content:i,loading:!1})}catch(i){if(gs.ref!==e)return;Nu({loading:!1,error:tD(i)})}}}function us(){Nu({ref:null,content:null,loading:!1,error:null})}function Nu(e){Object.assign(gs,e);for(const i of og)i(gs)}function tD(e){return e instanceof Error?e.message:String(e)}let Qu,lg=!1;function iD(e,i={}){Qu=e,lg=!1,document.documentElement.lang="en",nL(),SL();const r=hL(()=>Xs()),a=Q4(()=>Xs()),o=K4(()=>Xs()),_=iL(m=>{nC(m)});return document.addEventListener("click",W1),document.addEventListener("submit",G1),N6(e),i.initialWorkspaceId&&Xp()!==i.initialWorkspaceId&&tL(h1(i.initialWorkspaceId)),nD(),{navigateToWorkspace(m){Xp()!==m&&ea(h1(m))},destroy(){r(),a(),o(),_(),document.removeEventListener("click",W1),document.removeEventListener("submit",G1),wL(),rL(),e.innerHTML=""}}}async function nD(){Xs(),await dL(),await nC(Fl())}async function nC(e){if(e.name==="entry"){Us(),us(),await fL(e.id);return}if(e.name==="raw"){Us(),await eD(e.ref);return}if(e.name==="queue"){np(),us(),await V4(e.tab);return}if(e.name==="queue-detail"){np(),us(),await Y4(e.patchId);return}if(e.name==="index-md"){Us(),us(),await pL();return}if(e.name==="log"){Us(),us(),await gL(e.limit);return}if(e.name==="conflicts"){Us(),us(),await mL();return}if(e.name==="conflict-detail"){Us(),us(),await _L(e.id);return}np(),us(),Us(),Xs()}function Xs(){const e=Fl();if(e.name==="raw"){rD();return}sD(Du(),e)}function rD(){Qu.innerHTML=`
|
|
713
|
+
${M4(J4())}
|
|
714
|
+
<div class="toast" id="toast" aria-live="polite"></div>
|
|
715
|
+
`}function sD(e,i){const r=i.name==="entry"?i.id:null,a=i.name==="queue"||i.name==="queue-detail",o=e.currentEntry?f4(e.currentEntry,e.index):null;yL(e.index,e.recentIds),Qu.innerHTML=`
|
|
716
|
+
<div class="app-shell${a?" app-shell--wide":""}">
|
|
717
|
+
<button class="mobile-menu" type="button" data-action="toggle-nav" aria-label="Open menu">
|
|
718
|
+
<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">
|
|
719
|
+
<path d="M4 7h16M4 12h16M4 17h10" />
|
|
720
|
+
</svg>
|
|
721
|
+
</button>
|
|
722
|
+
${y4(e.index,r,e.pendingPatchCount,e.workspaces,e.currentWorkspaceId,window.location.pathname)}
|
|
723
|
+
<main class="content">
|
|
724
|
+
${aD(e,i,o)}
|
|
725
|
+
</main>
|
|
726
|
+
<div class="rail">
|
|
727
|
+
${oD(e,i,o)}
|
|
728
|
+
</div>
|
|
729
|
+
</div>
|
|
730
|
+
<div class="toast" id="toast" aria-live="polite"></div>
|
|
731
|
+
`,lg?Qu.classList.add("is-revealed"):lg=!0}function aD(e,i,r){return i.name==="queue"?D4(Ju()):i.name==="queue-detail"?z4(Ju()):e.error?g4(e.error):e.loading&&!e.currentEntry&&!e.indexMarkdown&&!e.log&&!e.currentConflict?p4():i.name==="index-md"&&e.indexMarkdown?b6(e.indexMarkdown):i.name==="log"&&e.log?G4(e.log):i.name==="conflicts"?_6(e.conflicts):i.name==="conflict-detail"&&e.currentConflict?v6(e.currentConflict):e.currentEntry&&r?r.html:d4(e.index,e.health?.cwd??null,!!e.currentWorkspaceId)}function oD(e,i,r){return i.name==="queue"||i.name==="queue-detail"?"":`
|
|
732
|
+
${S6(e.currentEntry,e.index,e.currentMatchHint)}
|
|
733
|
+
${r?W4(r.toc):""}
|
|
734
|
+
`}function W1(e){const i=e.target;if(!(i instanceof Element))return;const r=i.closest("[data-action]");if(r?.dataset.action==="toggle-nav"){document.body.classList.toggle("nav-open");return}if(r?.dataset.action==="navigate-home"){if(V1(e))return;e.preventDefault(),document.body.classList.remove("nav-open"),ea(gw());return}if(r?.dataset.action==="set-nav-mode"){const m=r.dataset.mode;(m==="tags"||m==="entries")&&(w4(m),Xs());return}if(r?.dataset.action==="toggle-tag"){S4(r.dataset.tag??""),Xs();return}if(r?.dataset.action==="copy-code"){lD(r);return}if(r?.dataset.action==="copy-compact-context"){const m=Du();m.currentEntry&&Bu(ow(m.currentEntry),"Copied compact context.");return}if(r?.dataset.action==="copy-provenance-context"){const m=Du();m.currentEntry&&Bu(lw(m.currentEntry),"Copied provenance context.");return}if(r?.dataset.action==="copy-related-context"){const m=Du();m.currentEntry&&Bu(cw(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(Ju().actionPending||!confirm("Approve this patch?"))return;r.setAttribute("disabled",""),X4();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=i.closest("[data-toc-id]");if(a){e.preventDefault(),document.getElementById(a.dataset.tocId??"")?.scrollIntoView({behavior:"smooth",block:"start"});return}const o=i.closest("a");if(!o||V1(e))return;const _=cD(o);_&&(e.preventDefault(),document.body.classList.remove("nav-open"),ea(_))}function G1(e){const i=e.target;if(i instanceof HTMLFormElement&&i.dataset.action==="queue-reject-submit"){if(e.preventDefault(),Ju().actionPending)return;const r=i.querySelector("button[type='submit']");r&&(r.disabled=!0);const a=i.querySelector("textarea[name='reason']");Z4(a?.value??"")}}async function lD(e){const r=e.closest(".code-block")?.dataset.code??"";r&&await Bu(r,"Code copied.")}async function Bu(e,i){try{await navigator.clipboard.writeText(e),K1(i)}catch{K1("Failed to copy to clipboard.")}}function K1(e){const i=document.querySelector("#toast");i&&(i.textContent=e,i.classList.add("visible"),window.setTimeout(()=>i.classList.remove("visible"),1400))}function V1(e){return e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0}function cD(e){const i=e.getAttribute("href")??"",r=e.dataset.entryId;if(r)return Ir(decodeURIComponent(r));if(/^[a-z][a-z0-9+.-]*:/i.test(i)&&!i.startsWith(window.location.origin))return null;const a=new URL(i,window.location.origin);if(a.origin!==window.location.origin)return null;if(a.pathname==="/"||a.pathname==="/console/codex"||a.pathname==="/console/codex/")return gw();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 o=a.pathname.split("/").pop()??"",_=decodeURIComponent(o.replace(/\.md$/,""));return _?Ir(_):null}let Gs=null,jl=null;function uD(e,i){const r=dD();r.parentElement!==e&&e.appendChild(r),jl||(jl=iD(r,{initialWorkspaceId:i}))}function hD(e){jl?.navigateToWorkspace(e)}function Y1(){jl?.destroy(),jl=null,Gs?.parentElement&&Gs.parentElement.removeChild(Gs)}function dD(){return Gs||(Gs=document.createElement("div"),Gs.className="codex-host"),Gs}function fD({state:e,mode:i,onClose:r}){const a=U.useRef(null),o=q5(),_=U.useRef(null),m=e.theaters.find(A=>A.id===e.activeTheaterId)??null,c=m?.id??null,u=!!m?.hasWiki;U.useEffect(()=>{if(!u){Y1();return}return()=>{Y1()}},[u]),U.useEffect(()=>{!u||!a.current||!c||uD(a.current,c)},[i,u,c]),U.useEffect(()=>{!u||!c||hD(c)},[c,u]),U.useEffect(()=>{if(i==="route")return;const A=x=>{x.key!=="Escape"||CL()||(x.preventDefault(),r())};return window.addEventListener("keydown",A,!0),()=>window.removeEventListener("keydown",A,!0)},[i,r]);const h=A=>{A.preventDefault(),_.current={pointerId:A.pointerId,startX:A.clientX,startWidth:o},A.currentTarget.setPointerCapture(A.pointerId),A.currentTarget.classList.add("is-dragging")},b=A=>{const x=_.current;!x||x.pointerId!==A.pointerId||W5(x.startWidth+(x.startX-A.clientX))},f=A=>{_.current?.pointerId===A.pointerId&&(_.current=null,A.currentTarget.releasePointerCapture(A.pointerId),A.currentTarget.classList.remove("is-dragging"))},C=m?.label??"Fleet Wiki",E=u?S.jsx("div",{className:"codex-surface-host",ref:a}):S.jsx(gD,{activeTheater:m,hasTheaters:e.theaters.length>0});return i==="route"?S.jsx("section",{className:"codex-route-host","aria-label":"Codex",children:E}):S.jsx("aside",{className:"codex-side-layer",style:{"--codex-side-width":`${o}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:b,onPointerUp:f,onPointerCancel:f}),S.jsx(pD,{title:C,onClose:r}),E]})})}function pD({title:e,onClose:i}){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.jsx("button",{type:"button",className:"codex-surface-close",onClick:i,"aria-label":"Close Codex",children:"×"})]})}function gD({activeTheater:e,hasTheaters:i}){return i?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."})]})}async function mD(e){const i=await fetch("/global-settings/state",{signal:e});return await rC(i),sC(await i.json(),i.status)}async function _D(e,i){const r=await fetch("/global-settings",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:i});await rC(r);const a=await r.json();if(!a||typeof a!="object"||!("state"in a))throw new lt(r.status,"Invalid global settings mutation response");return{state:sC(a.state,r.status)}}async function rC(e){if(e.ok)return;let i=e.statusText||`HTTP ${e.status}`;try{const r=await e.json();typeof r.error=="string"&&(i=r.error)}catch{}throw new lt(e.status,i)}function sC(e,i){const r=e;if(!r||typeof r.replaceSystemPrompt!="boolean"||typeof r.enableMetaphor!="boolean")throw new lt(i,"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 vD(){return U.useSyncExternalStore(bD,X1,X1)}function X1(){return ug}function bD(e){return cg.add(e),()=>{cg.delete(e)}}async function yD(e){io({loading:!0,error:null});try{const i=await mD(e);io({loading:!1,state:i,error:null})}catch(i){if(e?.aborted)return;io({loading:!1,error:aC(i)})}}async function Z1(e,i){io({savingField:e,error:null});try{const r=await _D({[e]:i});return io({state:r.state,savingField:null,error:null}),!0}catch(r){return io({savingField:null,error:aC(r)}),!1}}function io(e){ug={...ug,...e};for(const i of cg)i()}function aC(e){return e instanceof Error?e.message:String(e)}function SD(){const e=vD(),i=e.state,r=e.savingField!==null;return U.useEffect(()=>{const a=new AbortController;return yD(a.signal),()=>a.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-card","aria-label":"Fleet global settings",children:[e.loading&&!i?S.jsx("p",{className:"global-settings-help",children:"Loading settings."}):null,i?S.jsxs(S.Fragment,{children:[S.jsx(J1,{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:i.replaceSystemPrompt,disabled:r,onToggle:()=>{Z1("replaceSystemPrompt",!i.replaceSystemPrompt)}}),S.jsx(J1,{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:i.enableMetaphor,disabled:r,onToggle:()=>{Z1("enableMetaphor",!i.enableMetaphor)}})]}):null,S.jsx("p",{className:"global-settings-foot",children:"Changes apply to newly launched sessions. Running sessions keep their current configuration until relaunched."})]})]})}function J1({title:e,help:i,onLabel:r,offLabel:a,value:o,disabled:_,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:i})]}),S.jsx("button",{type:"button",className:`global-settings-toggle ${o?"is-on":""}`,disabled:_,"aria-pressed":o,onClick:m,children:S.jsx("span",{children:o?r:a})})]})}const wD="button",CD=184,xD=320,_u=12;function tm({state:e,onSelect:i,mode:r=wD,anchor:a,viewportBounds:o,onClose:_}){const[m,c]=U.useState(r==="menu"),u=U.useRef(null),h=U.useRef(null),b=U.useRef(null),f=e.creatingTerminalSession||e.addingTheater||!e.activeTheaterId||e.agentClis.length===0,C=r==="menu"||m;U.useEffect(()=>{r==="menu"&&c(!0)},[r,a?.x,a?.y]),U.useEffect(()=>{if(!C)return;const p=d=>{u.current?.contains(d.target)||E()},y=d=>{d.key==="Escape"&&(E(),h.current?.focus())};return document.addEventListener("mousedown",p),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousedown",p),document.removeEventListener("keydown",y)}},[C]),U.useEffect(()=>{C&&b.current?.focus()},[C]);const E=()=>{c(!1),_?.()},A=async p=>{f||(c(!1),h.current?.focus(),await i(p))},x=p=>{if(p.key!=="ArrowDown"&&p.key!=="ArrowUp")return;p.preventDefault();const y=Array.from(b.current?.querySelectorAll("[role^='menuitem']")??[]);if(y.length===0)return;const d=y.indexOf(document.activeElement),v=d===-1?p.key==="ArrowDown"?0:y.length-1:(d+(p.key==="ArrowDown"?1:-1)+y.length)%y.length;y[v]?.focus()};return S.jsxs("div",{className:`operation-launch-control ${r==="menu"?"operation-launch-control--canvas":""}`,ref:u,style:a?ED(a,o):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(p=>!p),disabled:f,"aria-haspopup":"menu","aria-expanded":m,"aria-label":"Launch operation",children:S.jsx(TD,{})}):null,C?S.jsx("div",{className:"operation-launch-menu theater-menu",role:"menu","aria-label":"Launch operation",tabIndex:-1,ref:b,onKeyDown:x,children:e.agentClis.length>0?S.jsx("ul",{className:"theater-menu-list",children:e.agentClis.map(p=>S.jsx("li",{children:S.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item operation-launch-menu-item",disabled:f,onClick:()=>{A(p)},children:[S.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:oC(p.id)}),S.jsx("span",{className:"theater-menu-label",children:p.label})]})},p.id))}):S.jsx("p",{className:"theater-menu-empty",children:"No Agent CLI available."})}):null]})}function ED(e,i){return i?{left:Math.max(_u,Math.min(e.x,i.width-CD-_u)),top:Math.max(_u,Math.min(e.y,i.height-xD-_u))}:{left:e.x,top:e.y}}function TD(){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 oC(e){return e==="claude"?S.jsx(AD,{}):e==="claude-kimi"?S.jsx(kD,{}):e==="codex"?S.jsx(RD,{}):S.jsx(LD,{})}function AD(){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 kD(){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 RD(){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 LD(){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 MD=208,DD=360,vu=12;function OD({state:e,anchor:i,viewportBounds:r,onLaunchCli:a,onOpenShell:o,onResetView:_,onClose:m}){const c=U.useRef(null),u=U.useRef(null),h=e.creatingTerminalSession||e.addingTheater||!e.activeTheaterId||e.agentClis.length===0,b=!e.activeTheaterId;return U.useEffect(()=>{const f=E=>{c.current?.contains(E.target)||m()},C=E=>{E.key==="Escape"&&m()};return document.addEventListener("mousedown",f),document.addEventListener("keydown",C),()=>{document.removeEventListener("mousedown",f),document.removeEventListener("keydown",C)}},[m]),U.useEffect(()=>{u.current?.focus()},[]),S.jsx("div",{className:"operation-launch-control operation-launch-control--canvas",ref:c,style:ND(i,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(f=>S.jsx("li",{children:S.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item operation-launch-menu-item",disabled:h,onClick:()=>a(f),children:[S.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:oC(f.id)}),S.jsx("span",{className:"theater-menu-label",children:f.label})]})},f.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:b,onClick:o,children:[S.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:S.jsx(BD,{})}),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:_,children:[S.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:S.jsx(ID,{})}),S.jsx("span",{className:"theater-menu-label",children:"Reset view"})]})]})})}function ND(e,i){return i?{left:Math.max(vu,Math.min(e.x,i.width-MD-vu)),top:Math.max(vu,Math.min(e.y,i.height-DD-vu))}:{left:e.x,top:e.y}}function BD(){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 ID(){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 Q1=256,ey=176,mp=12,bu=220,lC="fleet-console.map.radarCollapsed";function jD({panels:e,shellPanels:i,viewport:r,canvasSize:a,onJump:o}){const _=U.useRef(null),m=U.useRef(!1),[c,u]=U.useState(zD);if(a.width<=0||a.height<=0||r.zoom<=0)return null;const h=[...Object.entries(e).map(([I,G])=>({id:I,kind:"op",x:G.x,y:G.y,width:G.width,height:G.height})),...Object.entries(i).map(([I,G])=>({id:I,kind:"shell",x:G.geometry.x,y:G.geometry.y,width:G.geometry.width,height:G.geometry.height}))];if(h.length===0)return null;const b=()=>{u(I=>{const G=!I;return $D(G),G})};if(c)return S.jsx("button",{type:"button",className:"canvas-minimap-fab","data-canvas-blocker":!0,onClick:b,"aria-label":"Radar 펼치기",title:"Show radar",children:S.jsx(PD,{})});const f=Q1-mp*2,C=ey-mp*2,E={x:-r.x/r.zoom,y:-r.y/r.zoom,width:a.width/r.zoom,height:a.height/r.zoom};let A=Math.min(E.x,...h.map(I=>I.x)),x=Math.min(E.y,...h.map(I=>I.y)),p=Math.max(E.x+E.width,...h.map(I=>I.x+I.width)),y=Math.max(E.y+E.height,...h.map(I=>I.y+I.height));A-=bu,x-=bu,p+=bu,y+=bu;const d=p-A,v=y-x,T=Math.min(f/d,C/v),R=(f-d*T)/2,L=(C-v*T)/2,M=I=>R+(I-A)*T,k=I=>L+(I-x)*T,B=I=>{const G=_.current?.getBoundingClientRect();if(!G)return;const te=I.clientX-G.left,P=I.clientY-G.top;o({x:A+(te-R)/T,y:x+(P-L)/T})},W=I=>{I.stopPropagation(),m.current=!0,I.currentTarget.setPointerCapture(I.pointerId),B(I)},F=I=>{m.current&&(I.stopPropagation(),B(I))},q=I=>{m.current=!1;try{I.currentTarget.releasePointerCapture(I.pointerId)}catch{}};return S.jsxs("div",{className:"canvas-minimap","data-canvas-blocker":!0,style:{width:Q1,height:ey},children:[S.jsx("span",{className:"canvas-minimap-label","aria-hidden":"true",children:"Radar"}),S.jsx("button",{type:"button",className:"canvas-minimap-toggle",onClick:b,"aria-label":"Radar 접기",title:"Collapse radar",children:S.jsx(HD,{})}),S.jsxs("div",{ref:_,className:"canvas-minimap-inner",style:{inset:mp},onPointerDown:W,onPointerMove:F,onPointerUp:q,onPointerCancel:q,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*T),height:Math.max(2,I.height*T)}},I.id)),S.jsx("div",{className:"canvas-minimap-view",style:{left:M(E.x),top:k(E.y),width:E.width*T,height:E.height*T}})]})]})}function zD(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(lC)==="true"}catch{return!1}}function $D(e){if(!(typeof window>"u"))try{window.localStorage.setItem(lC,String(e))}catch{}}function HD(){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 PD(){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 cC({jobs:e,selectedJobId:i,onSelect:r}){const a=r??uh;return S.jsx("ol",{className:"terminal-job-lines",children:e.map(o=>S.jsx(UD,{job:o,active:i===o.jobId,onSelect:a},o.jobId))})}function UD({job:e,active:i,onSelect:r}){const a=bs(e.status),o=_T(e),_=e.ownerCarrierId?`${kg(e.ownerCarrierId)} · ${Js(e.status)}`:Js(e.status);return S.jsx("li",{children:S.jsxs("button",{type:"button",className:`terminal-job-line ${i?"is-active":""}`,onClick:()=>r(e.jobId),"aria-current":i||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??Ol(e.jobId)}),S.jsx("span",{className:"terminal-job-line-meta",children:_}),o?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:o})]}):null]})})}const FD=["n","ne","e","se","s","sw","w","nw"],_p=320,vp=200;function uC({geometry:e,zoom:i,onResize:r}){const a=U.useRef(null),o=(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)},_=c=>{const u=a.current;if(!u||u.pointerId!==c.pointerId)return;c.preventDefault(),c.stopPropagation();const h=(c.clientX-u.startX)/i,b=(c.clientY-u.startY)/i;r(qD(u.geometry,u.direction,h,b))},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:FD.map(c=>S.jsx("div",{className:`canvas-panel-resize canvas-panel-resize--${c}`,onPointerDown:u=>o(c,u),onPointerMove:_,onPointerUp:m,onPointerCancel:m,"data-canvas-blocker":!0,"aria-hidden":"true"},c))})}function qD(e,i,r,a){let{x:o,y:_,width:m,height:c}=e;return i.includes("e")&&(m+=r),i.includes("s")&&(c+=a),i.includes("w")&&(o+=r,m-=r),i.includes("n")&&(_+=a,c-=a),m<_p&&(i.includes("w")&&(o-=_p-m),m=_p),c<vp&&(i.includes("n")&&(_-=vp-c),c=vp),{...e,x:o,y:_,width:m,height:c}}function WD({state:e,session:i,geometry:r,viewport:a,active:o}){const _=U.useRef(null),[m,c]=U.useState(!1),[u,h]=U.useState(""),b=U.useRef(null),f=U.useRef(!1),C=U.useRef(!1),A=hh(e,i).filter(({job:P})=>!Qn(P.status)).map(({job:P})=>P),x=A.length,p=i.status==="dormant",y=oo(i),d=p?null:x>0?"live":i.turnState==="running"?"turn":null,v=()=>{kn(i.sessionId),El(i.sessionId,r)},T=P=>{o||kn(i.sessionId),uh(P)},R=P=>{P.button===0&&(P.preventDefault(),P.stopPropagation(),v(),_.current={pointerId:P.pointerId,startX:P.clientX,startY:P.clientY,geometry:r},P.currentTarget.setPointerCapture(P.pointerId))},L=P=>{const V=_.current;!V||V.pointerId!==P.pointerId||(P.preventDefault(),P.stopPropagation(),El(i.sessionId,{...V.geometry,x:V.geometry.x+(P.clientX-V.startX)/a.zoom,y:V.geometry.y+(P.clientY-V.startY)/a.zoom}))},M=P=>{_.current?.pointerId===P.pointerId&&(P.preventDefault(),P.stopPropagation(),_.current=null,P.currentTarget.releasePointerCapture(P.pointerId))},k=P=>{P.stopPropagation()};U.useEffect(()=>{m&&(b.current?.focus(),b.current?.select())},[m]);const B=()=>{v(),C.current=!1,h(y),c(!0)},W=()=>{C.current=!0,c(!1),h("")},F=async()=>{if(!f.current){f.current=!0;try{vs(await Ag(i.sessionId,u))}catch(P){Lg(P instanceof Error?P.message:String(P))}finally{f.current=!1,C.current=!0,c(!1)}}},q=P=>{if(P.key==="Enter"){P.preventDefault(),F();return}P.key==="Escape"&&(P.preventDefault(),W())},I=P=>{P.stopPropagation(),v()},G=P=>{P.stopPropagation(),v()},te=P=>{P.stopPropagation()};return S.jsxs(S.Fragment,{children:[S.jsxs("article",{className:`canvas-panel ${o?"is-active":""} ${d?`is-running is-running--${d}`:""}`,style:{left:r.x,top:r.y,width:r.width,height:r.height,zIndex:r.zIndex},onPointerDown:v,"data-canvas-panel":!0,"aria-label":`Operation ${y}`,children:[S.jsxs("div",{className:"canvas-panel-titlebar",onPointerDown:R,onPointerMove:L,onPointerUp:M,onPointerCancel:M,"data-canvas-blocker":!0,children:[S.jsx("span",{className:Nl(i,x),"aria-hidden":"true"}),m?S.jsx("input",{ref:b,className:"canvas-panel-rename-input",value:u,"aria-label":`${y} 이름 변경`,onPointerDown:P=>P.stopPropagation(),onChange:P=>h(P.target.value),onKeyDown:q,onBlur:()=>{if(C.current){C.current=!1;return}F()}}):S.jsx("span",{className:"canvas-panel-title",onPointerDown:I,onDoubleClick:B,title:"Double-click to rename",children:y}),S.jsx("span",{className:"canvas-panel-cli",children:i.cliLabel??i.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:k,onClick:()=>{KD(i.sessionId)},"aria-label":`${p?"Forget":"Terminate"} operation ${y}`,title:p?"Forget operation":"Terminate operation",children:S.jsx(VD,{})})]}),S.jsx("div",{className:"canvas-panel-terminal",onPointerDown:G,onWheel:te,"data-canvas-blocker":!0,children:p?S.jsxs("button",{type:"button",className:"canvas-panel-dormant",onClick:()=>{GD(i.sessionId)},children:[S.jsx("span",{className:"canvas-panel-dormant-status",children:"Dormant"}),S.jsx("span",{className:"canvas-panel-dormant-action",children:"Resume"})]}):S.jsx(gh,{sessionId:i.sessionId,active:o,onExit:()=>Ul(i.sessionId)})}),S.jsx(uC,{geometry:r,zoom:a.zoom,onResize:P=>El(i.sessionId,P)})]}),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 ${y}`,children:S.jsx(cC,{jobs:A,selectedJobId:e.selectedJobId,onSelect:T})}):null]})}async function GD(e){try{const i=await ah(e);vs(i),kn(i.sessionId)}catch(i){ch(i instanceof Error?i.message:String(i))}}async function KD(e){try{await sh(e)}catch(i){lh(i instanceof Error?i.message:String(i));return}Ul(e)}function VD(){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 YD="is-animation-paused";function XD({viewport:e,backgroundAnimationEnabled:i}){const[r,a]=U.useState(()=>document.hidden);return U.useEffect(()=>{function o(){a(document.hidden)}return document.addEventListener("visibilitychange",o),()=>{document.removeEventListener("visibilitychange",o)}},[]),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`}}),i?S.jsxs("div",{className:`operations-radar${r?` ${YD}`:""}`,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 hC="fleet-console.map.shortcutsCollapsed",ty=vS.find(e=>e.title==="Map")??null;function ZD(){const[e,i]=U.useState(JD);if(!ty)return null;const r=()=>{i(a=>{const o=!a;return QD(o),o})};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(eO,{})}):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(tO,{})})]}),S.jsx("dl",{className:"map-shortcuts-list",children:ty.entries.map(a=>S.jsxs("div",{className:"map-shortcuts-entry",children:[S.jsx("dt",{className:"map-shortcuts-combos",children:a.combos.map((o,_)=>S.jsxs("span",{className:"map-shortcuts-combo",children:[_>0?S.jsx("span",{className:"map-shortcuts-or",children:"or"}):null,S.jsx("span",{className:"map-shortcuts-keyset",children:o.map(m=>S.jsx("kbd",{children:m},m))})]},o.join("+")))}),S.jsx("dd",{children:a.description})]},a.description))})]})}function JD(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(hC)==="true"}catch{return!1}}function QD(e){if(!(typeof window>"u"))try{window.localStorage.setItem(hC,String(e))}catch{}}function eO(){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 tO(){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 iO(e,i){return{x:e.x*i.zoom+i.x,y:e.y*i.zoom+i.y}}function eh(e,i){return{x:(e.x-i.x)/i.zoom,y:(e.y-i.y)/i.zoom}}function nO(e,i){return{...iO(e,i),width:e.width*i.zoom,height:e.height*i.zoom}}function rO({rect:e,viewport:i}){const r=nO(e,i);return S.jsx("div",{className:"canvas-rubber-band",style:{left:r.x,top:r.y,width:r.width,height:r.height},"aria-hidden":"true"})}const hg=new Set;let Un={},ra=null;function sO(){return U.useSyncExternalStore(dC,ry,ry)}function aO(){return U.useSyncExternalStore(dC,iy,iy)}function iy(){return ra}function th(e){ra!==e&&(ra=e,Wl())}function oO(e,i){const r=cO();return Un={...Un,[r]:{theaterId:e,geometry:i}},Wl(),r}function bp(e,i){const r=Un[e];r&&(Un={...Un,[e]:{...r,geometry:i}},Wl())}function ny(e){if(!(e in Un))return;const i={...Un};delete i[e],Un=i,ra===e&&(ra=null),Wl()}function lO(){Object.keys(Un).length===0&&ra===null||(Un={},ra=null,Wl())}function dC(e){return hg.add(e),()=>{hg.delete(e)}}function ry(){return Un}function Wl(){for(const e of hg)e()}function cO(){return`shell:${typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}`}function uO({id:e,theaterId:i,geometry:r,viewport:a,active:o}){const _=U.useRef(null),m=()=>{kn(null),th(e),bp(e,{...r,zIndex:Pl()})},c=A=>{A.button===0&&(A.preventDefault(),A.stopPropagation(),m(),_.current={pointerId:A.pointerId,startX:A.clientX,startY:A.clientY,geometry:r},A.currentTarget.setPointerCapture(A.pointerId))},u=A=>{const x=_.current;!x||x.pointerId!==A.pointerId||(A.preventDefault(),A.stopPropagation(),bp(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=>{_.current?.pointerId===A.pointerId&&(A.preventDefault(),A.stopPropagation(),_.current=null,A.currentTarget.releasePointerCapture(A.pointerId))},b=A=>{A.stopPropagation()},f=A=>{A.stopPropagation(),m()},C=A=>{A.stopPropagation()},E=()=>{ny(e),sh(e).catch(A=>{lh(A instanceof Error?A.message:String(A))})};return S.jsxs("article",{className:`canvas-panel canvas-panel--shell ${o?"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:b,onClick:E,"aria-label":"Close shell panel",title:"Close shell",children:S.jsx(hO,{})})]}),S.jsx("div",{className:"canvas-panel-terminal",onPointerDown:f,onWheel:C,"data-canvas-blocker":!0,children:S.jsx(gh,{sessionId:e,kind:"shell",theaterId:i,onExit:()=>ny(e)})}),S.jsx(uC,{geometry:r,zoom:a.zoom,onResize:A=>bp(e,A)})]})}function hO(){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 dO=.25,fO=2,pO=200,gO=150,sy=5,mO=.0018;function _O({viewport:e,disabled:i=!1,consumePointerDown:r=!1,onViewportChange:a,onZoom:o,onCreate:_,onConsumePointerDown:m,onClick:c}){const u=U.useRef(null),h=U.useRef(e),[b,f]=U.useState(null),[C,E]=U.useState(!1),[A,x]=U.useState(!1);U.useEffect(()=>{h.current=e},[e]),U.useEffect(()=>{const L=k=>{k.key==="Shift"&&x(!0),!vO(k.target)&&k.code==="Space"&&(k.preventDefault(),E(!0))},M=k=>{k.key==="Shift"&&x(!1),k.code==="Space"&&E(!1)};return window.addEventListener("keydown",L),window.addEventListener("keyup",M),()=>{window.removeEventListener("keydown",L),window.removeEventListener("keyup",M)}},[]);const p=L=>{if(i||ay(L.target)||L.button!==0&&L.button!==1)return;if(L.preventDefault(),r){m?.();return}const M=Sp(L),k=L.shiftKey&&L.button===0&&!C?"create":"pan";u.current={pointerId:L.pointerId,mode:k,startScreen:M,currentScreen:M,startViewport:h.current},L.currentTarget.setPointerCapture(L.pointerId),k==="create"&&f(yp(M,M,h.current))},y=L=>{const M=u.current;if(!M||M.pointerId!==L.pointerId)return;L.preventDefault();const k=Sp(L);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}f(yp(M.startScreen,k,h.current))},d=L=>{R(L,!0)},v=L=>{R(L,!1)},T=L=>{if(i||ay(L.target))return;L.preventDefault();const M=Sp(L),k=h.current,B=bO(k.zoom*Math.exp(-L.deltaY*mO),dO,fO),W=eh(M,k);o({x:M.x-W.x*B,y:M.y-W.y*B,zoom:B})},R=(L,M)=>{const k=u.current;if(!k||k.pointerId!==L.pointerId||(u.current=null,L.currentTarget.releasePointerCapture(L.pointerId),f(null),!M))return;const B=Math.abs(k.currentScreen.x-k.startScreen.x),W=Math.abs(k.currentScreen.y-k.startScreen.y);if(B<sy&&W<sy){c?.();return}if(k.mode!=="create")return;const F=yp(k.startScreen,k.currentScreen,h.current),q={x:F.x,y:F.y,width:Math.max(F.width,pO),height:Math.max(F.height,gO)};_(q,k.currentScreen)};return{rubberBand:b,spaceActive:C,shiftActive:A,onPointerDown:p,onPointerMove:y,onPointerUp:d,onPointerCancel:v,onWheel:T}}function yp(e,i,r){const a=eh(e,r),o=eh(i,r),_=Math.min(a.x,o.x),m=Math.min(a.y,o.y);return{x:_,y:m,width:Math.abs(a.x-o.x),height:Math.abs(a.y-o.y)}}function Sp(e){const i=e.currentTarget.getBoundingClientRect();return{x:e.clientX-i.left,y:e.clientY-i.top}}function ay(e){return e instanceof Element&&!!e.closest("[data-canvas-blocker], [data-canvas-panel]")}function vO(e){return e instanceof HTMLElement&&!!e.closest("input, textarea, select, [contenteditable='true']")}function bO(e,i,r){return Math.min(r,Math.max(i,e))}const yO="Shift-drag to create an Operation. Right-click for actions. Drag to pan; scroll to zoom.",SO=640,wO=400,CO=560,xO=360,EO={x:0,y:0,zoom:1};function TO({state:e}){const i=U.useRef(null),r=d5(),a=f5(),o=Sg(),_=sO(),m=aO(),c=VT(e),[u,h]=U.useState(null),[b,f]=U.useState(null),[C,E]=U.useState({width:0,height:0}),A=!e.activeTheaterId||e.agentClis.length===0||e.creatingTerminalSession||e.addingTheater;U.useEffect(()=>{const L=i.current;if(!L||typeof ResizeObserver>"u")return;const M=()=>E({width:L.clientWidth,height:L.clientHeight});M();const k=new ResizeObserver(M);return k.observe(L),()=>k.disconnect()},[]),U.useEffect(()=>{e.activeTerminalSessionId!==null&&th(null)},[e.activeTerminalSessionId]);const x=_O({viewport:r.viewport,disabled:A,onViewportChange:Tu,onZoom:p5,onCreate:(L,M)=>{f(null),h({rect:L,anchor:M})},consumePointerDown:u!==null||b!==null,onConsumePointerDown:()=>{h(null),f(null)},onClick:LO}),p=async L=>{if(!(!e.activeTheaterId||!u)){Hu();try{const M=await $u(e.activeTheaterId,L.id);El(M.sessionId,MO(u.rect)),Pu(M),kn(M.sessionId),h(null)}catch(M){Uu(M instanceof Error?M.message:String(M))}}},y=async L=>{const M=b?.canvasPoint;if(f(null),!(!e.activeTheaterId||!M)){Hu();try{const k=await $u(e.activeTheaterId,L.id);El(k.sessionId,ly(M,SO,wO)),Pu(k),kn(k.sessionId)}catch(k){Uu(k instanceof Error?k.message:String(k))}}},d=()=>{const L=b?.canvasPoint;if(f(null),!e.activeTheaterId||!L)return;kn(null);const M=oO(e.activeTheaterId,{...ly(L,CO,xO),zIndex:Pl()});th(M)},v=()=>{f(null),Tu({...EO})},T=L=>{if(L.target instanceof Element&&L.target.closest("[data-canvas-blocker], [data-canvas-panel]"))return;L.preventDefault();const M=i.current?.getBoundingClientRect();if(!M)return;const k={x:L.clientX-M.left,y:L.clientY-M.top};h(null),f({anchor:k,canvasPoint:eh(k,r.viewport)})},R=c.length>0||Object.keys(_).length>0;return S.jsxs("main",{className:`operations-canvas ${x.spaceActive?"is-panning":""} ${x.shiftActive?"is-creating":""}`,onPointerDown:x.onPointerDown,onPointerMove:x.onPointerMove,onPointerUp:x.onPointerUp,onPointerCancel:x.onPointerCancel,onWheel:x.onWheel,onContextMenu:T,ref:i,children:[S.jsx(XD,{viewport:r.viewport,backgroundAnimationEnabled:a}),S.jsx("button",{type:"button",className:`canvas-background-toggle canvas-maximize-toggle ${o?"is-active":""}`,onClick:v5,"data-canvas-blocker":!0,"aria-label":o?"맵 최대화 해제":"맵 최대화","aria-pressed":o,title:o?"Exit fullscreen":"Maximize map",children:o?S.jsx(RO,{}):S.jsx(kO,{})}),S.jsx("button",{type:"button",className:`canvas-background-toggle ${a?"is-active":""}`,onClick:_5,"data-canvas-blocker":!0,"aria-label":a?"배경 애니메이션 끄기":"배경 애니메이션 켜기",title:a?"Background animation: on":"Background animation: off",children:S.jsx(AO,{})}),S.jsxs("div",{className:"operations-canvas-world",style:{transform:`translate(${r.viewport.x}px, ${r.viewport.y}px) scale(${r.viewport.zoom})`},children:[c.map(L=>{const M=r.panels[L.sessionId];return M?S.jsx(WD,{state:e,session:L,geometry:M,viewport:r.viewport,active:e.activeTerminalSessionId===L.sessionId},L.sessionId):null}),Object.entries(_).map(([L,M])=>S.jsx(uO,{id:L,theaterId:M.theaterId,geometry:M.geometry,viewport:r.viewport,active:m===L},L))]}),R?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?yO:"Add a Theater from the top bar to start operations."}),e.terminalSessionError?S.jsx("p",{className:"operations-canvas-error",children:e.terminalSessionError}):null]}),x.rubberBand?S.jsx(rO,{rect:x.rubberBand,viewport:r.viewport}):null,u?S.jsx(tm,{state:e,mode:"menu",anchor:u.anchor,viewportBounds:oy(i.current),onSelect:p,onClose:()=>h(null)},`${u.anchor.x}:${u.anchor.y}`):null,b?S.jsx(OD,{state:e,anchor:b.anchor,viewportBounds:oy(i.current),onLaunchCli:L=>{y(L)},onOpenShell:d,onResetView:v,onClose:()=>f(null)},`${b.anchor.x}:${b.anchor.y}`):null,S.jsx(jD,{panels:r.panels,shellPanels:_,viewport:r.viewport,canvasSize:C,onJump:L=>Tu({x:C.width/2-L.x*r.viewport.zoom,y:C.height/2-L.y*r.viewport.zoom,zoom:r.viewport.zoom})}),R?S.jsx(ZD,{}):null]})}function AO(){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 kO(){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 RO(){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 oy(e){if(!e)return;const i=e.getBoundingClientRect();return{width:i.width,height:i.height}}function LO(){if(typeof document<"u"){const e=document.activeElement;e instanceof HTMLElement&&e.blur()}kn(null),th(null)}function MO(e){return{x:e.x,y:e.y,width:e.width,height:e.height,zIndex:0}}function ly(e,i,r){return{x:e.x,y:e.y,width:i,height:r,zIndex:0}}const DO=56;function OO(e,i){const r=U.useRef(null),a=U.useRef(!0),[o,_]=U.useState(!0),m=U.useCallback(u=>{a.current!==u&&(a.current=u,_(u))},[]);U.useEffect(()=>{const u=r.current;if(!u)return;const h=()=>{const b=u.scrollHeight-u.scrollTop-u.clientHeight;m(b<=DO)};return u.addEventListener("scroll",h,{passive:!0}),()=>u.removeEventListener("scroll",h)},[m]),U.useLayoutEffect(()=>{m(!0);const u=r.current;u&&(u.scrollTop=u.scrollHeight)},[e,m]),U.useLayoutEffect(()=>{const u=r.current;!u||!a.current||(u.scrollTop=u.scrollHeight)},[i]);const c=U.useCallback(()=>{const u=r.current;u&&(u.scrollTop=u.scrollHeight,u.focus({preventScroll:!0}),m(!0))},[m]);return{containerRef:r,pinned:o,jumpToLatest:c}}const cy=400,NO=["text","fallbackText","fallbackThought"],BO=U.memo(function({events:i}){return S.jsxs("ol",{className:"timeline","aria-label":"Raw event timeline",children:[i.length===0?S.jsx("li",{className:"timeline-empty",children:"No events observed."}):null,i.map((r,a)=>{const o=i[i.length-1-a];return o?S.jsx(IO,{event:o},o.id):null})]})}),IO=U.memo(function({event:i}){return S.jsxs("li",{className:"timeline-row",children:[S.jsx("time",{className:"timeline-time",children:tS(i.at)}),S.jsx("span",{className:"timeline-type",children:i.type}),S.jsx("code",{className:"timeline-payload",children:jO(i.event)})]})});function jO(e){const i={...e};delete i.type;for(const a of NO){const o=i[a];typeof o=="string"&&(i[a]=o.length>60?`${o.slice(0,60)}… (${o.length} chars)`:o)}const r=JSON.stringify(i);return r.length>cy?`${r.slice(0,cy)}…`:r}const zO=U.memo(function({track:i}){const r=bs(i.status),a=i.status==="stream",o=i.sentTextLength>i.text.length||i.sentThoughtLength>i.thought.length,_=i.sentTextLength+i.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:i.displayName}),i.displayCli?S.jsx("span",{className:"track-tag",children:i.displayCli}):null,i.model?S.jsx("span",{className:"track-tag track-tag--dim",children:i.model}):null,i.effort?S.jsx("span",{className:"track-tag track-tag--dim",children:i.effort}):null,S.jsx("span",{className:`track-status track-status--${r}`,children:mT(i.status)})]}),i.subtitle?S.jsx("p",{className:"track-subtitle",children:i.subtitle}):null,i.requestPreview?S.jsx($O,{preview:i.requestPreview}):null,i.thought?S.jsx(HO,{thought:i.thought,streaming:a&&!i.text}):null,S.jsx(PO,{track:i}),i.text?S.jsx("div",{className:"track-output","data-streaming":a||void 0,children:S.jsxs("pre",{className:"track-text",children:[i.text,a?S.jsx("span",{className:"stream-caret","aria-hidden":"true"}):null]})}):a||i.status==="conn"||i.status==="queued"?S.jsxs("p",{className:"track-waiting",children:[S.jsx("span",{className:"stream-caret","aria-hidden":"true"})," awaiting output"]}):null,o?S.jsxs("p",{className:"track-notice",children:["Output partially retained — ",_.toLocaleString()," chars emitted in total."]}):null,i.error?S.jsx("p",{className:"track-error",children:i.error}):null]})});function $O({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 HO({thought:e,streaming:i}){const[r,a]=U.useState(!1);return S.jsxs("div",{className:`thought-fold ${r?"is-open":""}`,children:[S.jsxs("button",{type:"button",className:"thought-toggle",onClick:()=>a(o=>!o),"aria-expanded":r,children:[S.jsx("span",{className:"thought-chevron","aria-hidden":"true",children:r?"▾":"▸"}),"reasoning",i?S.jsx("span",{className:"stream-caret stream-caret--dim","aria-hidden":"true"}):null]}),r?S.jsx("pre",{className:"thought-text",children:e}):null]})}function PO({track:e}){return e.tools.length===0?null:S.jsx("ul",{className:"tool-rail","aria-label":"Tool calls",children:e.tools.map(i=>S.jsxs("li",{className:`tool-chip tool-chip--${UO(i.status)}`,children:[S.jsx("span",{className:"tool-chip-glyph","aria-hidden":"true",children:"⚙"}),S.jsx("span",{className:"tool-chip-title",children:i.title}),i.status?S.jsx("span",{className:"tool-chip-status",children:i.status}):null]},i.key))})}function UO(e){const i=e.toLowerCase();return i.includes("error")||i.includes("fail")?"bad":i.includes("done")||i.includes("ok")||i.includes("complete")?"ok":i.includes("run")||i.includes("progress")||i.includes("stream")?"live":"idle"}function FO({job:e,timelineOpen:i}){const{containerRef:r,pinned:a,jumpToLatest:o}=OO(e?.jobId??"none",e?.lastEventId??0);return e?S.jsxs("main",{className:"stage",children:[S.jsx(qO,{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(_=>{const m=e.tracks[_];return m?S.jsx(zO,{track:m},`${e.jobId}:${_}`):null}),e.summary?S.jsx(WO,{summary:e.summary,status:e.status,error:e.error}):null]})}),a?null:S.jsx("button",{type:"button",className:"follow-button",onClick:o,children:"↓ Follow stream"})]}),S.jsxs("section",{className:`timeline-dock ${i?"is-open":""}`,children:[S.jsxs("button",{type:"button",className:"timeline-toggle",onClick:HT,"aria-expanded":i,children:[S.jsx("span",{className:"timeline-chevron","aria-hidden":"true",children:i?"▾":"▴"}),"Event timeline",S.jsx("span",{className:"timeline-count",children:e.recentEvents.length})]}),i?S.jsx(BO,{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 qO=U.memo(function({job:i}){const r=bs(i.status),a=i.startedAt?gT(i.startedAt,i.finishedAt??i.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:i.label??Ol(i.jobId)}),S.jsxs("p",{className:"job-meta",children:[S.jsx("span",{className:`job-status job-status--${r}`,children:Js(i.status)}),i.ownerCarrierId?S.jsxs("span",{children:["· ",i.ownerCarrierId]}):null,i.kind?S.jsxs("span",{children:["· ",i.kind]}):null,a?S.jsxs("span",{children:["· ",a]}):null,i.startedAt?S.jsxs("span",{children:["· started ",tS(i.startedAt)]}):null]})]})]}),S.jsx("code",{className:"job-id",title:i.jobId,children:Ol(i.jobId)})]})});function WO({summary:e,status:i,error:r}){return S.jsxs("aside",{className:`job-summary job-summary--${bs(i)}`,children:[S.jsx("p",{className:"job-summary-eyebrow",children:i==="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 fC({state:e}){const i=GT(e);return U.useEffect(()=>{const r=a=>{a.key==="Escape"&&Hf()};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[]),i?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:Hf,"aria-label":"Close job stream"}),S.jsxs("div",{className:"job-overlay-card",children:[S.jsx("button",{type:"button",className:"job-overlay-close",onClick:Hf,"aria-label":"Close job stream",children:"×"}),S.jsx(FO,{job:i,timelineOpen:e.timelineOpen})]})]}):null}function GO({state:e}){return S.jsx("div",{className:"floating-job-overlay","data-canvas-blocker":!0,children:S.jsx(fC,{state:e})})}function KO({state:e,getViewportSize:i}){const[r,a]=U.useState(!1),o=Sg(),_=Qs(e);U.useEffect(()=>{a(o)},[o]);const m=async u=>{const h=e.sessions[u];let b=u;if(h?.status==="dormant")try{const C=await ah(u);vs(C),b=C.sessionId}catch(C){ch(C instanceof Error?C.message:String(C));return}kn(b),Oy(b);const f=i();f&&Ny(b,f)},c=async u=>{if(!(e.creatingTerminalSession||e.addingTheater||!e.activeTheaterId)){Hu();try{const h=await $u(e.activeTheaterId,u.id);Pu(h),m(h.sessionId)}catch(h){Uu(h instanceof Error?h.message:String(h))}}};return r?S.jsx("aside",{className:"floating-sidebar-layer is-collapsed","data-canvas-blocker":!0,children:S.jsx("button",{type:"button",className:"floating-sidebar-collapsed-toggle",onClick:()=>a(!1),"aria-expanded":!1,"aria-label":"Operations 목록 펼치기",title:"Show Operations",children:S.jsx(JO,{})})}):S.jsx("aside",{className:"floating-sidebar-layer","data-canvas-blocker":!0,children:S.jsxs("section",{className:"floating-sidebar","aria-label":"Floating operations list",children:[S.jsxs("div",{className:"floating-sidebar-heading",children:[S.jsx("p",{className:"sidebar-eyebrow",children:"Operations"}),S.jsxs("div",{className:"floating-sidebar-actions",children:[S.jsx(tm,{state:e,onSelect:c}),S.jsx("button",{type:"button",className:"floating-sidebar-toggle",onClick:()=>a(!0),"aria-expanded":!0,"aria-label":"Operations 목록 접기",children:S.jsx(ZO,{})})]})]}),_.length>0?S.jsx("ol",{className:"floating-session-list",children:_.map(u=>{const h=e.sessions[u];return h?S.jsx(VO,{session:h,active:e.activeTerminalSessionId===u,jobs:hh(e,h),selectedJobId:e.selectedJobId,onFocus:m},u):null})}):null,e.terminalSessionError?S.jsx("p",{className:"sidebar-error",children:e.terminalSessionError}):null,_.length===0?S.jsxs("p",{className:"sidebar-empty",children:[e.activeTheaterId?"No operations in this Theater.":"No Theaters registered.",S.jsx("br",{}),e.activeTheaterId?"Drag on the canvas or use +.":"Add a Theater from the top bar."]}):null]})})}const VO=U.memo(function({session:i,active:r,jobs:a,selectedJobId:o,onFocus:_}){const[m,c]=U.useState(!1),[u,h]=U.useState(""),b=U.useRef(null),f=U.useRef(!1),C=U.useRef(!1),E=a.filter(({job:R})=>!Qn(R.status)).length,A=i.status==="dormant",x=oo(i),p=[...a].sort((R,L)=>Number(Qn(R.job.status))-Number(Qn(L.job.status)));U.useEffect(()=>{m&&(b.current?.focus(),b.current?.select())},[m]);const y=()=>{C.current=!1,h(x),c(!0)},d=()=>{C.current=!0,c(!1),h("")},v=async()=>{if(!f.current){f.current=!0;try{vs(await Ag(i.sessionId,u))}catch(R){Lg(R instanceof Error?R.message:String(R))}finally{f.current=!1,C.current=!0,c(!1)}}},T=R=>{if(R.key==="Enter"){R.preventDefault(),v();return}R.key==="Escape"&&(R.preventDefault(),d())};return S.jsxs("li",{className:`session-item ${r?"is-active":""}`,children:[S.jsxs("div",{className:"session-row-shell",children:[m?S.jsxs("div",{className:`session-row session-row-edit ${r?"is-active":""}`,children:[S.jsx("span",{className:Nl(i,E),"aria-hidden":"true"}),S.jsx("input",{ref:b,className:"session-rename-input",value:u,"aria-label":`${x} 이름 변경`,onChange:R=>h(R.target.value),onKeyDown:T,onBlur:()=>{if(C.current){C.current=!1;return}v()}})]}):S.jsxs("button",{type:"button",className:`session-row ${r?"is-active":""}`,onClick:()=>{_(i.sessionId)},onDoubleClick:y,"aria-current":r||void 0,"aria-label":`Operation ${x}`,children:[S.jsx("span",{className:Nl(i,E),"aria-hidden":"true"}),S.jsxs("span",{className:"tenant-row-text",children:[S.jsx("span",{className:"tenant-label",children:x}),A?S.jsx("span",{className:"job-row-meta",children:"Dormant"}):null]}),A?S.jsx("span",{className:"tenant-count",children:"Open"}):!r&&a.length>0?S.jsx("span",{className:"tenant-count",children:a.length}):null]}),S.jsx("button",{type:"button",className:"session-close",onClick:()=>{XO(i.sessionId)},"aria-label":`${A?"Forget":"Terminate"} operation ${x}`,title:A?"Forget operation":"Terminate operation",children:S.jsx(QO,{})})]}),r?S.jsx("ol",{className:"session-job-list",children:p.length>0?p.map(({job:R})=>S.jsx(YO,{job:R,active:R.jobId===o},R.jobId)):S.jsx("li",{className:"job-list-empty",children:"No carrier jobs in this session."})}):null]})}),YO=U.memo(function({job:i,active:r}){const a=bs(i.status);return S.jsx("li",{children:S.jsxs("button",{type:"button",className:`job-row ${r?"is-active":""}`,onClick:()=>uh(i.jobId),"aria-current":r||void 0,children:[S.jsx("span",{className:`status-dot status-dot--${a}`,"aria-hidden":"true"}),S.jsxs("span",{className:"job-row-text",children:[S.jsx("span",{className:"job-row-label",children:i.label??Ol(i.jobId)}),S.jsx("span",{className:"job-row-meta",children:i.ownerCarrierId?`${kg(i.ownerCarrierId)} · ${Js(i.status)}`:Js(i.status)})]})]})})});async function XO(e){try{await sh(e)}catch(i){lh(i instanceof Error?i.message:String(i));return}Ul(e)}function ZO(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M4 5h8M4 8h5.5M4 11h8",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"})})}function JO(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M5 4.6 9 8l-4 3.4M10.5 4.6 14 8l-3.5 3.4",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function QO(){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.4",strokeLinecap:"round"})})}function e8({creating:e,error:i,hasTheaters:r,activeTheaterId:a}){const o=r?a?"No operations in this Theater":"Choose a Theater":"Add a Theater",_=r?a?"Launch an operation from the Operations sidebar.":"Theater-scoped operations and carrier activity will appear here.":"Use the top bar Theater control to add a project root.";return S.jsxs("section",{className:"operations-landing","aria-label":"Operations workspace landing",children:[S.jsx("div",{className:"operations-landing-mark","aria-hidden":"true"}),S.jsxs("div",{children:[S.jsx("p",{className:"operations-landing-eyebrow",children:"Operation"}),S.jsx("h1",{children:o}),S.jsx("p",{children:_})]}),S.jsx("p",{className:`operations-landing-status ${e?"is-live":""}`,children:e?"Launching operation":"No terminal session selected"}),i?S.jsx("p",{className:"operations-landing-error",children:i}):null]})}function t8({state:e}){const i=Qs(e);return S.jsxs("nav",{className:"operations-sidebar","aria-label":"Operation sessions and carrier jobs",children:[S.jsxs("div",{className:"sidebar-heading",children:[S.jsx("p",{className:"sidebar-eyebrow",children:"Operations"}),S.jsx(tm,{state:e,onSelect:r=>s8(e,r)})]}),i.length>0?S.jsx("ol",{className:"session-list",children:i.map(r=>{const a=e.sessions[r];return a?S.jsx(i8,{session:a,active:e.activeTerminalSessionId===r,jobs:hh(e,a),selectedJobId:e.selectedJobId},r):null})}):null,e.terminalSessionError?S.jsx("p",{className:"sidebar-error",children:e.terminalSessionError}):null,i.length===0?S.jsxs("p",{className:"sidebar-empty",children:[e.activeTheaterId?"No operations in this Theater.":"No Theaters registered.",S.jsx("br",{}),e.activeTheaterId?"Use + to launch one here.":"Add a Theater from the top bar."]}):null]})}const i8=U.memo(function({session:i,active:r,jobs:a,selectedJobId:o}){const[_,m]=U.useState(!1),[c,u]=U.useState(""),h=U.useRef(null),b=U.useRef(!1),f=U.useRef(!1),C=a.filter(({job:R})=>!Qn(R.status)).length,E=i.status==="dormant",A=oo(i),x=[...a].sort((R,L)=>Number(Qn(R.job.status))-Number(Qn(L.job.status)));U.useEffect(()=>{_&&(h.current?.focus(),h.current?.select())},[_]);const p=()=>{f.current=!1,u(A),m(!0)},y=()=>{f.current=!0,m(!1),u("")},d=async()=>{if(!b.current){b.current=!0;try{vs(await Ag(i.sessionId,c))}catch(R){Lg(R instanceof Error?R.message:String(R))}finally{b.current=!1,f.current=!0,m(!1)}}},v=R=>{if(R.key==="Enter"){R.preventDefault(),d();return}R.key==="Escape"&&(R.preventDefault(),y())},T=async()=>{if(!E){kn(i.sessionId);return}try{const R=await ah(i.sessionId);vs(R),kn(R.sessionId)}catch(R){ch(R instanceof Error?R.message:String(R))}};return S.jsxs("li",{className:`session-item ${r?"is-active":""}`,children:[S.jsxs("div",{className:"session-row-shell",children:[_?S.jsxs("div",{className:`session-row session-row-edit ${r?"is-active":""}`,children:[S.jsx("span",{className:Nl(i,C),"aria-hidden":"true"}),S.jsx("input",{ref:h,className:"session-rename-input",value:c,"aria-label":`${A} 이름 변경`,onChange:R=>u(R.target.value),onKeyDown:v,onBlur:()=>{if(f.current){f.current=!1;return}d()}})]}):S.jsxs("button",{type:"button",className:`session-row ${r?"is-active":""}`,onClick:()=>{T()},onDoubleClick:p,"aria-current":r||void 0,"aria-label":`Operation ${A}`,children:[S.jsx("span",{className:Nl(i,C),"aria-hidden":"true"}),S.jsxs("span",{className:"tenant-row-text",children:[S.jsx("span",{className:"tenant-label",children:A}),E?S.jsx("span",{className:"job-row-meta",children:"Dormant"}):null]}),E?S.jsx("span",{className:"tenant-count",children:"Open"}):!r&&a.length>0?S.jsx("span",{className:"tenant-count",children:a.length}):null]}),S.jsx("button",{type:"button",className:"session-close",onClick:()=>{r8(i.sessionId)},"aria-label":`Terminate operation ${A}`,title:"Terminate operation",children:S.jsx(a8,{})})]}),r?S.jsx("ol",{className:"session-job-list",children:x.length>0?x.map(({job:R})=>S.jsx(n8,{job:R,active:R.jobId===o},R.jobId)):S.jsx("li",{className:"job-list-empty",children:"No carrier jobs in this session."})}):null]})}),n8=U.memo(function({job:i,active:r}){const a=bs(i.status);return S.jsx("li",{children:S.jsxs("button",{type:"button",className:`job-row ${r?"is-active":""}`,onClick:()=>uh(i.jobId),"aria-current":r||void 0,children:[S.jsx("span",{className:`status-dot status-dot--${a}`,"aria-hidden":"true"}),S.jsxs("span",{className:"job-row-text",children:[S.jsx("span",{className:"job-row-label",children:i.label??Ol(i.jobId)}),S.jsx("span",{className:"job-row-meta",children:i.ownerCarrierId?`${kg(i.ownerCarrierId)} · ${Js(i.status)}`:Js(i.status)})]})]})})});async function r8(e){try{await sh(e)}catch(i){lh(i instanceof Error?i.message:String(i));return}Ul(e)}async function s8(e,i){if(!(e.creatingTerminalSession||e.addingTheater||!e.activeTheaterId)){Hu();try{Pu(await $u(e.activeTheaterId,i.id))}catch(r){Uu(r instanceof Error?r.message:String(r))}}}function a8(){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.4",strokeLinecap:"round"})})}function o8({state:e,sessionId:i,expanded:r}){const a=e.sessions[i],o=a?hh(e,a).filter(({job:_})=>!Qn(_.status)).map(({job:_})=>_):[];return S.jsxs(S.Fragment,{children:[S.jsx("button",{type:"button",className:`terminal-zoom-toggle ${r?"is-expanded":""}`,onClick:()=>UT(i),"aria-label":r?"터미널 축소":"터미널 확대",title:r?"터미널 축소":"터미널 확대",children:r?S.jsx(c8,{}):S.jsx(l8,{})}),o.length>0?S.jsx("div",{className:"terminal-job-dock","aria-label":"Active carrier jobs in terminal",children:S.jsx(cC,{jobs:o,selectedJobId:e.selectedJobId})}):null]})}function l8(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M6.4 3.2H3.2v3.2M3.4 3.4l4.1 4.1M9.6 12.8h3.2V9.6M12.6 12.6 8.5 8.5",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function c8(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M7 7H3.8M3.8 7V3.8M3.9 7.1l4-4M9 9h3.2M12.2 9v3.2M12.1 8.9l-4 4",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function u8({state:e}){const i=e.activeTerminalSessionId&&Qs(e).includes(e.activeTerminalSessionId)?e.activeTerminalSessionId:null,r=i?XT(e,i):!1;return S.jsxs("div",{className:`console-body is-classic ${r?"is-expanded":""}`,children:[r?null:S.jsx(t8,{state:e}),S.jsx("main",{className:"operations-terminal-stage",children:i?S.jsxs(S.Fragment,{children:[S.jsx(gh,{sessionId:i,onExit:()=>Ul(i)},i),S.jsx(o8,{state:e,sessionId:i,expanded:r}),S.jsx(fC,{state:e})]}):S.jsx(e8,{creating:e.creatingTerminalSession,error:e.terminalSessionError,hasTheaters:e.theaters.length>0,activeTheaterId:e.activeTheaterId})})]})}function h8({state:e}){const i=U.useRef(null),r=Eg(),a=Qs(e),o=U.useRef(e);return o.current=e,U.useEffect(()=>{m5(e.activeTheaterId),lO()},[e.activeTheaterId]),U.useEffect(()=>{const _=m=>{if(!m.altKey||m.metaKey||m.ctrlKey||m.key!=="ArrowLeft"&&m.key!=="ArrowRight")return;const c=document.activeElement;if(c instanceof HTMLElement&&c.matches("input, textarea, [contenteditable='true']")&&!c.closest(".xterm"))return;const u=Qs(o.current);if(u.length===0)return;m.preventDefault(),m.stopImmediatePropagation();const h=jT(u,o.current.activeTerminalSessionId,m.key==="ArrowRight"?1:-1);h&&Rg(h)};return window.addEventListener("keydown",_,!0),()=>window.removeEventListener("keydown",_,!0)},[]),U.useEffect(()=>{for(const _ of a)Oy(_);g5(a)},[a]),U.useEffect(()=>{const _=e.pendingOperationFocus;if(_===null)return;if(r==="classic"){If();return}let m=!1;return(async()=>{let u=_;if(e.sessions[_]?.status==="dormant")try{const f=await ah(_);if(m)return;vs(f),kn(f.sessionId),u=f.sessionId}catch(f){m||ch(f instanceof Error?f.message:String(f)),If();return}if(m)return;const b=uy(i.current);b&&Ny(u,b),If()})(),()=>{m=!0}},[e.pendingOperationFocus,r]),r==="classic"?S.jsx(u8,{state:e}):S.jsxs("div",{className:"console-body is-canvas",ref:i,children:[S.jsx(TO,{state:e}),S.jsx(KO,{state:e,getViewportSize:()=>uy(i.current)}),S.jsx(GO,{state:e})]})}function uy(e){if(!e)return null;const i=e.getBoundingClientRect();return{width:i.width,height:i.height}}function d8(e){return{activeTheater:g8(e),readiness:p8(e,e.activeTheaterId),theaters:f8(e),connection:e.connection,connectionError:e.connectionError}}function f8(e){return e.theaters.map(i=>{const r=im(e,i.id),a=nm(e,i.id),o=rm(e,a);return{id:i.id,label:i.label,hasWiki:i.hasWiki,activeAdmiralCount:i.activeAdmiralCount,terminalSessionCount:r.length,liveJobCount:o.filter(_=>bs(_.status)==="live").length,lastActivityAt:pC([Date.parse(i.lastOpenedAt),...r.map(_=>_.createdAt),...a.map(_=>_.createdAt),...o.map(_=>_.updatedAt)]),active:i.id===e.activeTheaterId}})}function p8(e,i){const r=i?im(e,i):[],a=i?nm(e,i):[],o=rm(e,a),_=o.filter(h=>bs(h.status)==="live").length,m=o.filter(h=>Qn(h.status)&&h.status==="done").length,c=o.filter(h=>Qn(h.status)&&(h.status==="error"||h.status==="aborted")).length,u=e.activeTerminalSessionId?e.sessions[e.activeTerminalSessionId]:void 0;return{activeSessionLabel:u&&i&&u.theaterId===i?oo(u):"No active session",terminalSessionCount:r.length,liveJobCount:_,completedJobCount:m,failedJobCount:c,emptyState:m8(e,r,o)}}function g8(e){const i=e.theaters.find(_=>_.id===e.activeTheaterId);if(!i)return null;const r=im(e,i.id),a=nm(e,i.id),o=rm(e,a);return{id:i.id,label:i.label,hasWiki:i.hasWiki,activeAdmiralCount:i.activeAdmiralCount,terminalSessionCount:r.length,registeredTenantCount:a.filter(_=>_.status!=="closed").length,lastActivityAt:pC([Date.parse(i.lastOpenedAt),...r.map(_=>_.createdAt),...a.map(_=>_.createdAt),...o.map(_=>_.updatedAt)])}}function im(e,i){return e.sessionOrder.map(r=>e.sessions[r]).filter(r=>r!==void 0&&r.theaterId===i)}function nm(e,i){return e.tenants.filter(r=>r.theaterId===i)}function rm(e,i){const r=[];for(const a of i){const o=e.tenantJobs[a.tenantId];if(o)for(const _ of o.jobOrder){const m=o.jobs[_];m&&r.push(m)}}return r}function m8(e,i,r){return e.theaters.length===0?"no-theaters":i.length===0?"no-sessions":r.length===0?"no-jobs":null}function pC(e){const i=e.filter(r=>Number.isFinite(r));return i.length===0?null:Math.max(...i)}async function _8(e,i){const[r,a,o,_]=await Promise.all([yu(e,"/index",i),yu(e,"/queue?status=all",i),yu(e,"/conflicts",i),yu(e,"/log?limit=3",i)]);return{entryCount:Array.isArray(r)?r.length:0,pendingQueueCount:typeof a.pendingCount=="number"?a.pendingCount:0,archivedQueueCount:typeof a.archivedCount=="number"?a.archivedCount:0,openConflictCount:Array.isArray(o)?o.length:0,logEntryCount:typeof _.totalEntries=="number"?_.totalEntries:Array.isArray(_.entries)?_.entries.length:0,latestLogStatus:Array.isArray(_.entries)&&_.entries.length>0?"available":"empty"}}async function yu(e,i,r){const a=i.startsWith("/")?i:`/${i}`,o=await fetch(`/console/codex/w/${encodeURIComponent(e)}/api${a}`,{signal:r});if(!o.ok)throw new lt(o.status,o.statusText||`HTTP ${o.status}`);return o.json()}const Su={loading:!1,value:null,error:null},v8=15e3;function b8({state:e}){const i=d8(e),r=i.activeTheater,[a,o]=U.useState(Su),[_,m]=U.useState(Su),[c,u]=U.useState(Su);return U.useEffect(()=>{if(!r?.hasWiki){o(Su);return}const h=new AbortController;return o({loading:!0,value:null,error:null}),_8(r.id,h.signal).then(b=>o({loading:!1,value:b,error:null})).catch(b=>{h.signal.aborted||o({loading:!1,value:null,error:b instanceof Error?b.message:String(b)})}),()=>h.abort()},[r?.hasWiki,r?.id]),U.useEffect(()=>{const h=new AbortController;return m(b=>({loading:!0,value:b.value,error:null})),Ky(r?.id??null,h.signal).then(b=>m({loading:!1,value:b,error:null})).catch(b=>{h.signal.aborted||m({loading:!1,value:null,error:b instanceof Error?b.message:String(b)})}),()=>h.abort()},[r?.id]),U.useEffect(()=>{const h=new AbortController,b=()=>{u(C=>({loading:!0,value:C.value,error:null})),J5(h.signal).then(C=>u({loading:!1,value:C,error:null})).catch(C=>{h.signal.aborted||u(E=>({loading:!1,value:E.value,error:C instanceof Error?C.message:String(C)}))})};b();const f=window.setInterval(b,v8);return()=>{window.clearInterval(f),h.abort()}},[]),S.jsxs("main",{className:"welcome-page",children:[S.jsxs("header",{className:"welcome-header",children:[S.jsxs("div",{children:[S.jsx("p",{className:"bridge-kicker",children:"Bridge Readiness"}),S.jsx("h2",{children:"Welcome"})]}),S.jsx("button",{type:"button",className:"welcome-guide-button",onClick:gb,children:"Commissioning guide"})]}),S.jsxs("section",{className:"bridge-matrix","aria-labelledby":"bridge-matrix-title",children:[S.jsxs("div",{className:"bridge-section-heading",children:[S.jsx("p",{className:"bridge-kicker",children:"Theater Capability Matrix"}),S.jsx("h3",{id:"bridge-matrix-title",children:"Registered Theaters"})]}),i.theaters.length>0?S.jsxs("div",{className:"bridge-matrix-table",role:"table","aria-label":"Theater capability matrix",children:[S.jsxs("div",{className:"bridge-matrix-row bridge-matrix-head",role:"row",children:[S.jsx("span",{role:"columnheader",children:"Theater"}),S.jsx("span",{role:"columnheader",children:"Codex"}),S.jsx("span",{role:"columnheader",children:"Active"}),S.jsx("span",{role:"columnheader",children:"Terminals"}),S.jsx("span",{role:"columnheader",children:"Updated"})]}),i.theaters.map(h=>S.jsx(C8,{theater:h},h.id))]}):S.jsxs("div",{className:"bridge-matrix-empty bridge-matrix-empty--first-run",children:[S.jsx("p",{children:"No Theaters registered. Set up a project directory first, then open an Operation from that Theater."}),S.jsx("button",{type:"button",className:"bridge-matrix-empty-action",onClick:gb,children:"Set up your fleet"})]})]}),S.jsxs("section",{className:"bridge-carriers","aria-labelledby":"bridge-carriers-title",children:[S.jsxs("div",{className:"bridge-section-heading",children:[S.jsx("p",{className:"bridge-kicker",children:"Carrier Readiness Matrix"}),S.jsx("h3",{id:"bridge-carriers-title",children:"Carrier roster"})]}),S.jsx(w8,{carriers:c})]}),S.jsxs("section",{className:"bridge-knowledge","aria-labelledby":"bridge-knowledge-title",children:[S.jsxs("div",{className:"bridge-section-heading",children:[S.jsx("p",{className:"bridge-kicker",children:"Knowledge Readiness Panel"}),S.jsx("h3",{id:"bridge-knowledge-title",children:"Codex readiness"})]}),S.jsx(y8,{activeTheater:r,knowledge:a})]}),S.jsxs("section",{className:"bridge-health","aria-labelledby":"bridge-health-title",children:[S.jsxs("div",{className:"bridge-section-heading",children:[S.jsx("p",{className:"bridge-kicker",children:"System Information"}),S.jsx("h3",{id:"bridge-health-title",children:"Runtime status"})]}),S.jsx(S8,{health:_})]})]})}function y8({activeTheater:e,knowledge:i}){if(!e)return S.jsx("div",{className:"bridge-empty",children:S.jsx("p",{children:"Add a Theater to inspect Codex readiness."})});if(!e.hasWiki)return S.jsx("div",{className:"bridge-empty",children:S.jsx("p",{children:"Codex unavailable for this Theater."})});if(i.error)return S.jsx("div",{className:"bridge-empty bridge-empty--warn",children:S.jsx("p",{children:"Codex summary degraded."})});const r=i.value,a=[{label:"Entries",value:r?String(r.entryCount):"…",caption:"Indexed knowledge entries"},{label:"Pending",value:r?String(r.pendingQueueCount):"…",caption:"Drydock queue"},{label:"Archived",value:r?String(r.archivedQueueCount):"…",caption:"Archived decisions"},{label:"Conflicts",value:r?String(r.openConflictCount):"…",caption:"Open conflict files",tone:r&&r.openConflictCount>0?"warn":void 0},{label:"Log",value:r?r.latestLogStatus:i.loading?"loading":"empty",caption:r?`${r.logEntryCount} total entries`:"Latest log tail",tone:r?.latestLogStatus==="available"?"good":void 0}];return S.jsx("div",{className:"bridge-knowledge-grid",children:a.map(o=>S.jsx(gC,{metric:o},o.label))})}function S8({health:e}){const i=e.value,r=[{label:"Version",value:i?.version??"…",caption:"Console runtime"},{label:"Channel",value:i?.channel??"…",caption:"Release channel"},{label:"Port",value:i?String(i.port):"…",caption:"Loopback listener"},{label:"Codex",value:i?.wikiServerStatus??"unknown",caption:"Active Theater status",tone:i?.wikiServerStatus==="available"?"good":i?.wikiServerStatus==="unavailable"?"bad":void 0},{label:"Observer",value:i?`${i.workspaces}/${i.jobs}`:e.loading?"loading":"unknown",caption:"Workspaces / jobs"}];return S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"bridge-health-strip",children:r.map(a=>S.jsx(gC,{metric:a},a.label))}),e.error?S.jsx("p",{className:"bridge-health-error",children:"System health unavailable."}):null]})}function w8({carriers:e}){if(e.error)return S.jsx("div",{className:"bridge-empty bridge-empty--warn",children:S.jsx("p",{children:"Carrier readiness degraded."})});const i=e.value??[];return i.length===0?S.jsx("div",{className:"bridge-empty",children:S.jsx("p",{children:e.loading?"Loading carrier readiness.":"No carrier readiness entries available."})}):S.jsxs("div",{className:"bridge-carrier-table",role:"table","aria-label":"Carrier readiness matrix",children:[S.jsxs("div",{className:"bridge-carrier-row bridge-carrier-head",role:"row",children:[S.jsx("span",{role:"columnheader",children:"Carrier"}),S.jsx("span",{role:"columnheader",children:"Role"}),S.jsx("span",{role:"columnheader",children:"Model"}),S.jsx("span",{role:"columnheader",children:"Effort"}),S.jsx("span",{role:"columnheader",children:"Task Force"}),S.jsx("span",{role:"columnheader",children:"Mode"})]}),i.map(r=>S.jsxs("div",{className:"bridge-carrier-row",role:"row",children:[S.jsxs("span",{role:"cell",className:"bridge-carrier-name","data-signature":E8(r),children:[S.jsx("strong",{children:r.displayName}),S.jsx("small",{children:r.category??"unknown"})]}),S.jsx("span",{role:"cell",children:r.role??r.category??"unknown"}),S.jsx("span",{role:"cell",children:r.model||"unknown"}),S.jsx("span",{role:"cell",children:r.effort??"default"}),S.jsx("span",{role:"cell",children:r.taskForceBackendCount}),S.jsx("span",{role:"cell",children:r.subagentMode?"subagent":r.cliType||"cli"})]},r.carrierId))]})}function gC({metric:e}){return S.jsxs("article",{className:`bridge-card ${e.tone?`bridge-card--${e.tone}`:""}`,children:[S.jsx("p",{className:"bridge-card-label",children:e.label}),S.jsx("strong",{children:e.value}),S.jsx("p",{children:e.caption})]})}function C8({theater:e}){return S.jsxs("div",{className:`bridge-matrix-row ${e.active?"is-active":""}`,role:"row",children:[S.jsxs("span",{role:"cell",children:[S.jsx("span",{className:`bridge-theater-live ${e.liveJobCount>0?"is-live":""}`,"aria-hidden":"true"}),e.label]}),S.jsx("span",{role:"cell",children:e.hasWiki?"available":"unavailable"}),S.jsx("span",{role:"cell",children:e.activeAdmiralCount}),S.jsx("span",{role:"cell",children:e.terminalSessionCount}),S.jsx("span",{role:"cell",children:x8(e.lastActivityAt)})]})}function x8(e){return e?new Date(e).toLocaleString([],{month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit"}):"none"}function E8(e){return!e.subagentMode&&e.taskForceBackendCount>=2?"taskforce":e.cliType}const T8=6e3;function A8(){const e=GS(),i=Ln(),r=i.pathname,a=$l(),o=Sg(),_=Eg(),m=P5(),c=F5(),u=r.startsWith("/codex"),h=U.useRef(i),b=U.useRef(!u),f=o&&r.startsWith("/operations")&&_==="canvas",C=u&&m!=="route"&&(b.current||c),E=C?m:"route",A=b.current?h.current:{pathname:"/",search:"",hash:"",state:null,key:"codex-fallback"},x=C?A:i,p=x.pathname.startsWith("/operations");U.useEffect(()=>J3(),[]),U.useEffect(()=>{u||(h.current=i,b.current=!0)},[u,i]),U.useEffect(()=>{AT(p)},[p]),U.useEffect(()=>{const d=new AbortController;Z5(d.signal).then(R=>{NT(R),mb()}).catch(R=>{d.signal.aborted||(Pe({theaterError:R instanceof Error?R.message:String(R)}),mb())}),tT(d.signal).then(OT).catch(R=>{d.signal.aborted||Pe({terminalSessionError:R instanceof Error?R.message:String(R)})});const v=()=>{Ky(e.activeTheaterId,d.signal).then(DT).catch(()=>{})};v();const T=window.setTimeout(v,T8);return()=>{window.clearTimeout(T),d.abort()}},[]),U.useEffect(()=>{const d=v=>{window.location.pathname.includes("/codex")||(v.metaKey||v.ctrlKey)&&v.key.toLowerCase()==="k"&&(v.preventDefault(),v.stopImmediatePropagation(),zT())};return window.addEventListener("keydown",d,!0),()=>window.removeEventListener("keydown",d,!0)},[]),U.useEffect(()=>{const d=v=>{(v.metaKey||v.ctrlKey)&&v.key==="`"&&(v.preventDefault(),uS())};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[]);const y=()=>{const d=h.current;b.current?a({pathname:d.pathname,search:d.search,hash:d.hash},{state:d.state}):a("/")};return S.jsxs("div",{className:`console-shell ${f?"is-maximized":""}`,children:[S.jsx(B3,{state:e,codexMode:E}),S.jsxs(TE,{location:x,children:[S.jsx(Fs,{path:"/",element:S.jsx(b8,{state:e})}),S.jsx(Fs,{path:"/operations",element:S.jsx(h8,{state:e})}),S.jsx(Fs,{path:"/carrier-settings",element:S.jsx(kR,{})}),S.jsx(Fs,{path:"/settings",element:S.jsx(SD,{})}),S.jsx(Fs,{path:"/codex/*",element:null}),S.jsx(Fs,{path:"*",element:S.jsx(xE,{to:"/",replace:!0})})]}),u?S.jsx(fD,{state:e,mode:E,onClose:y}):null,S.jsx(y3,{state:e}),S.jsx(w3,{state:e}),S.jsx(vA,{state:e}),S.jsx(pA,{state:e}),S.jsx(M3,{open:e.connectionError!==null,tone:"error",title:"Console link interrupted",message:e.connectionError??void 0}),S.jsx(R3,{toasts:e.operationToasts})]})}kT();const hy=document.querySelector("#app");hy&&A2.createRoot(hy).render(S.jsx(U.StrictMode,{children:S.jsx(XE,{basename:"/console",children:S.jsx(A8,{})})}));export{x6 as _,k8 as a,v2 as g,yt as k,kl as p};
|