@dotobokuri/fleet-console 1.17.0 → 1.18.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 +5 -5
- package/dist/cli.d.ts +0 -2
- package/dist/cli.mjs +1055 -2270
- package/dist/client/assets/{_baseUniq-24vRkv8i.js → _baseUniq-DFEDX4NY.js} +1 -1
- package/dist/client/assets/{arc-BTiCiQ57.js → arc-CGwMrR6o.js} +1 -1
- package/dist/client/assets/{architectureDiagram-Q4EWVU46-B24oDJvB.js → architectureDiagram-Q4EWVU46-BqLyvIOK.js} +1 -1
- package/dist/client/assets/{blockDiagram-DXYQGD6D-BOAE3FdW.js → blockDiagram-DXYQGD6D-DoiPMLdv.js} +1 -1
- package/dist/client/assets/{c4Diagram-AHTNJAMY-C0W9raQx.js → c4Diagram-AHTNJAMY-DfGxDkah.js} +1 -1
- package/dist/client/assets/channel-DlT8zCVq.js +1 -0
- package/dist/client/assets/{chunk-4BX2VUAB-DvyhIkzo.js → chunk-4BX2VUAB-3zXv74oY.js} +1 -1
- package/dist/client/assets/{chunk-4TB4RGXK-CMV1UZLH.js → chunk-4TB4RGXK-MkXUmjUE.js} +1 -1
- package/dist/client/assets/{chunk-55IACEB6-CG75wbs4.js → chunk-55IACEB6-mhkgqlI_.js} +1 -1
- package/dist/client/assets/{chunk-EDXVE4YY-9CjdVkNM.js → chunk-EDXVE4YY-B0_ZDihs.js} +1 -1
- package/dist/client/assets/{chunk-FMBD7UC4-i496V3zS.js → chunk-FMBD7UC4-BQAuE4pL.js} +1 -1
- package/dist/client/assets/{chunk-OYMX7WX6-CeRfBoEk.js → chunk-OYMX7WX6-CY8Eyj9X.js} +1 -1
- package/dist/client/assets/{chunk-QZHKN3VN-D1mXQVL_.js → chunk-QZHKN3VN-CaZoMwKH.js} +1 -1
- package/dist/client/assets/{chunk-YZCP3GAM-DUXK6jpB.js → chunk-YZCP3GAM-DV1YOEUH.js} +1 -1
- package/dist/client/assets/classDiagram-6PBFFD2Q-B-UN9f9r.js +1 -0
- package/dist/client/assets/classDiagram-v2-HSJHXN6E-B-UN9f9r.js +1 -0
- package/dist/client/assets/clone-CDPRFCO0.js +1 -0
- package/dist/client/assets/{cose-bilkent-S5V4N54A-Cw97IMZH.js → cose-bilkent-S5V4N54A-Cy3v0C_N.js} +1 -1
- package/dist/client/assets/{dagre-KV5264BT-CyY9URRi.js → dagre-KV5264BT-CGJ6x_VR.js} +1 -1
- package/dist/client/assets/{diagram-5BDNPKRD-BEVj5KaK.js → diagram-5BDNPKRD-MyyXeHKQ.js} +1 -1
- package/dist/client/assets/{diagram-G4DWMVQ6-IXOT_4VL.js → diagram-G4DWMVQ6-D52Q2132.js} +1 -1
- package/dist/client/assets/{diagram-MMDJMWI5-CO2p0poL.js → diagram-MMDJMWI5-DCypusCr.js} +1 -1
- package/dist/client/assets/{diagram-TYMM5635-DvRDFMNM.js → diagram-TYMM5635-c5UBqE9-.js} +1 -1
- package/dist/client/assets/{erDiagram-SMLLAGMA-C5uteguB.js → erDiagram-SMLLAGMA-BlF0Lxy7.js} +1 -1
- package/dist/client/assets/{flowDiagram-DWJPFMVM-JekEx60D.js → flowDiagram-DWJPFMVM-lo8xyzfx.js} +1 -1
- package/dist/client/assets/{ganttDiagram-T4ZO3ILL-DRKjnKDn.js → ganttDiagram-T4ZO3ILL-BXVZMpon.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-UUTBAWPF-Dhnk3n7N.js → gitGraphDiagram-UUTBAWPF-DB1A6uYk.js} +1 -1
- package/dist/client/assets/{graph-DE-kEMug.js → graph-Ck2AX1p2.js} +1 -1
- package/dist/client/assets/index-Cf9MmpwN.css +1 -0
- package/dist/client/assets/index-DWgndVkX.js +404 -0
- package/dist/client/assets/{infoDiagram-42DDH7IO-DG9M_7T9.js → infoDiagram-42DDH7IO-NEVE42fw.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-UXIWVN3A-CiP4wnqc.js → ishikawaDiagram-UXIWVN3A-MbFr_8pL.js} +1 -1
- package/dist/client/assets/{journeyDiagram-VCZTEJTY-DklSog3d.js → journeyDiagram-VCZTEJTY-Sq2ja3q8.js} +1 -1
- package/dist/client/assets/{kanban-definition-6JOO6SKY-BVB77h52.js → kanban-definition-6JOO6SKY-C63qPhtK.js} +1 -1
- package/dist/client/assets/{layout-CAevigwv.js → layout-CFEuVj4N.js} +1 -1
- package/dist/client/assets/{linear-CB_shmWV.js → linear-B626G8Op.js} +1 -1
- package/dist/client/assets/{mermaid.core-DPLCTlKT.js → mermaid.core-BT7SVKBR.js} +4 -4
- package/dist/client/assets/{min-Cimc7NFp.js → min-MbEOApMw.js} +1 -1
- package/dist/client/assets/{mindmap-definition-QFDTVHPH-DnyowBeF.js → mindmap-definition-QFDTVHPH-DMpht5Mg.js} +1 -1
- package/dist/client/assets/{pieDiagram-DEJITSTG-B1mr5ZWu.js → pieDiagram-DEJITSTG-B4XS0haZ.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-34T5L4WZ-CJla4J4E.js → quadrantDiagram-34T5L4WZ-CReo5Ajb.js} +1 -1
- package/dist/client/assets/{requirementDiagram-MS252O5E-Bduy03Er.js → requirementDiagram-MS252O5E-A50aqG-K.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-XADWPNL6-G7I_cbR7.js → sankeyDiagram-XADWPNL6-471VOdlW.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-FGHM5R23-D4Uf0SLt.js → sequenceDiagram-FGHM5R23-BAvOyUC-.js} +1 -1
- package/dist/client/assets/{stateDiagram-FHFEXIEX-Fr0IevW-.js → stateDiagram-FHFEXIEX-gCtZrvR-.js} +1 -1
- package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-Bdb0YU66.js +1 -0
- package/dist/client/assets/{timeline-definition-GMOUNBTQ-CzR6FMOJ.js → timeline-definition-GMOUNBTQ-CTHf-uxq.js} +1 -1
- package/dist/client/assets/{vennDiagram-DHZGUBPP-CCzsRm3-.js → vennDiagram-DHZGUBPP-5gvXi0dO.js} +1 -1
- package/dist/client/assets/{wardley-RL74JXVD-C9U_HC7W.js → wardley-RL74JXVD-XR-qQTWZ.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-NUSXRM2D-BkwkDUKo.js → wardleyDiagram-NUSXRM2D-EwPsMHdt.js} +1 -1
- package/dist/client/assets/{xychartDiagram-5P7HB3ND-CZ45hysw.js → xychartDiagram-5P7HB3ND-CePwuUb7.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/fleet-plugins/diff/routes.mjs +76 -21
- package/dist/fleet-plugins/skills/routes.mjs +7 -118
- package/dist/fleet-plugins/terminal/routes.mjs +281 -974
- package/package.json +1 -1
- package/dist/client/assets/channel-yb1CkB_S.js +0 -1
- package/dist/client/assets/classDiagram-6PBFFD2Q-DgNTT8Lb.js +0 -1
- package/dist/client/assets/classDiagram-v2-HSJHXN6E-DgNTT8Lb.js +0 -1
- package/dist/client/assets/clone-BLvG1gy6.js +0 -1
- package/dist/client/assets/index-BY_CeGCl.js +0 -402
- package/dist/client/assets/index-CfNSyAUJ.css +0 -1
- package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-DXt_OYu8.js +0 -1
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
function LS(e,n){for(var i=0;i<n.length;i++){const s=n[i];if(typeof s!="string"&&!Array.isArray(s)){for(const o in s)if(o!=="default"&&!(o in e)){const f=Object.getOwnPropertyDescriptor(s,o);f&&Object.defineProperty(e,o,f.get?f:{enumerable:!0,get:()=>s[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const f of o)if(f.type==="childList")for(const g of f.addedNodes)g.tagName==="LINK"&&g.rel==="modulepreload"&&s(g)}).observe(document,{childList:!0,subtree:!0});function i(o){const f={};return o.integrity&&(f.integrity=o.integrity),o.referrerPolicy&&(f.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?f.credentials="include":o.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function s(o){if(o.ep)return;o.ep=!0;const f=i(o);fetch(o.href,f)}})();function Vg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function v9(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var n=e.default;if(typeof n=="function"){var i=function s(){var o=!1;try{o=this instanceof s}catch{}return o?Reflect.construct(n,arguments,this.constructor):n.apply(this,arguments)};i.prototype=n.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(e).forEach(function(s){var o=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(i,s,o.get?o:{enumerable:!0,get:function(){return e[s]}})}),i}var Df={exports:{}},fl={};var yb;function S5(){if(yb)return fl;yb=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function i(s,o,f){var g=null;if(f!==void 0&&(g=""+f),o.key!==void 0&&(g=""+o.key),"key"in o){f={};for(var c in o)c!=="key"&&(f[c]=o[c])}else f=o;return o=f.ref,{$$typeof:e,type:s,key:g,ref:o!==void 0?o:null,props:f}}return fl.Fragment=n,fl.jsx=i,fl.jsxs=i,fl}var Sb;function w5(){return Sb||(Sb=1,Df.exports=S5()),Df.exports}var u=w5();const x5=Vg(u),C5=LS({__proto__:null,default:x5},[u]);var jf={exports:{}},Fe={};var wb;function E5(){if(wb)return Fe;wb=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),g=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),w=Symbol.iterator;function x(D){return D===null||typeof D!="object"?null:(D=w&&D[w]||D["@@iterator"],typeof D=="function"?D:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,p={};function v(D,P,Z){this.props=D,this.context=P,this.refs=p,this.updater=Z||T}v.prototype.isReactComponent={},v.prototype.setState=function(D,P){if(typeof D!="object"&&typeof D!="function"&&D!=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,D,P,"setState")},v.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function _(){}_.prototype=v.prototype;function S(D,P,Z){this.props=D,this.context=P,this.refs=p,this.updater=Z||T}var k=S.prototype=new _;k.constructor=S,E(k,v.prototype),k.isPureReactComponent=!0;var L=Array.isArray;function R(){}var N={H:null,A:null,T:null,S:null},A=Object.prototype.hasOwnProperty;function B(D,P,Z){var ee=Z.ref;return{$$typeof:e,type:D,key:P,ref:ee!==void 0?ee:null,props:Z}}function q(D,P){return B(D.type,P,D.props)}function F(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function W(D){var P={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(Z){return P[Z]})}var I=/\/+/g;function Y(D,P){return typeof D=="object"&&D!==null&&D.key!=null?W(""+D.key):P.toString(36)}function V(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(R,R):(D.status="pending",D.then(function(P){D.status==="pending"&&(D.status="fulfilled",D.value=P)},function(P){D.status==="pending"&&(D.status="rejected",D.reason=P)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function z(D,P,Z,ee,J){var se=typeof D;(se==="undefined"||se==="boolean")&&(D=null);var X=!1;if(D===null)X=!0;else switch(se){case"bigint":case"string":case"number":X=!0;break;case"object":switch(D.$$typeof){case e:case n:X=!0;break;case b:return X=D._init,z(X(D._payload),P,Z,ee,J)}}if(X)return J=J(D),X=ee===""?"."+Y(D,0):ee,L(J)?(Z="",X!=null&&(Z=X.replace(I,"$&/")+"/"),z(J,P,Z,"",function(de){return de})):J!=null&&(F(J)&&(J=q(J,Z+(J.key==null||D&&D.key===J.key?"":(""+J.key).replace(I,"$&/")+"/")+X)),P.push(J)),1;X=0;var $=ee===""?".":ee+":";if(L(D))for(var ae=0;ae<D.length;ae++)ee=D[ae],se=$+Y(ee,ae),X+=z(ee,P,Z,se,J);else if(ae=x(D),typeof ae=="function")for(D=ae.call(D),ae=0;!(ee=D.next()).done;)ee=ee.value,se=$+Y(ee,ae++),X+=z(ee,P,Z,se,J);else if(se==="object"){if(typeof D.then=="function")return z(V(D),P,Z,ee,J);throw P=String(D),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.")}return X}function G(D,P,Z){if(D==null)return D;var ee=[],J=0;return z(D,ee,"","",function(se){return P.call(Z,se,J++)}),ee}function K(D){if(D._status===-1){var P=D._result;P=P(),P.then(function(Z){(D._status===0||D._status===-1)&&(D._status=1,D._result=Z)},function(Z){(D._status===0||D._status===-1)&&(D._status=2,D._result=Z)}),D._status===-1&&(D._status=0,D._result=P)}if(D._status===1)return D._result.default;throw D._result}var j=typeof reportError=="function"?reportError:function(D){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var P=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof D=="object"&&D!==null&&typeof D.message=="string"?String(D.message):String(D),error:D});if(!window.dispatchEvent(P))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",D);return}console.error(D)},H={map:G,forEach:function(D,P,Z){G(D,function(){P.apply(this,arguments)},Z)},count:function(D){var P=0;return G(D,function(){P++}),P},toArray:function(D){return G(D,function(P){return P})||[]},only:function(D){if(!F(D))throw Error("React.Children.only expected to receive a single React element child.");return D}};return Fe.Activity=m,Fe.Children=H,Fe.Component=v,Fe.Fragment=i,Fe.Profiler=o,Fe.PureComponent=S,Fe.StrictMode=s,Fe.Suspense=h,Fe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=N,Fe.__COMPILER_RUNTIME={__proto__:null,c:function(D){return N.H.useMemoCache(D)}},Fe.cache=function(D){return function(){return D.apply(null,arguments)}},Fe.cacheSignal=function(){return null},Fe.cloneElement=function(D,P,Z){if(D==null)throw Error("The argument must be a React element, but you passed "+D+".");var ee=E({},D.props),J=D.key;if(P!=null)for(se in P.key!==void 0&&(J=""+P.key),P)!A.call(P,se)||se==="key"||se==="__self"||se==="__source"||se==="ref"&&P.ref===void 0||(ee[se]=P[se]);var se=arguments.length-2;if(se===1)ee.children=Z;else if(1<se){for(var X=Array(se),$=0;$<se;$++)X[$]=arguments[$+2];ee.children=X}return B(D.type,J,ee)},Fe.createContext=function(D){return D={$$typeof:g,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null},D.Provider=D,D.Consumer={$$typeof:f,_context:D},D},Fe.createElement=function(D,P,Z){var ee,J={},se=null;if(P!=null)for(ee in P.key!==void 0&&(se=""+P.key),P)A.call(P,ee)&&ee!=="key"&&ee!=="__self"&&ee!=="__source"&&(J[ee]=P[ee]);var X=arguments.length-2;if(X===1)J.children=Z;else if(1<X){for(var $=Array(X),ae=0;ae<X;ae++)$[ae]=arguments[ae+2];J.children=$}if(D&&D.defaultProps)for(ee in X=D.defaultProps,X)J[ee]===void 0&&(J[ee]=X[ee]);return B(D,se,J)},Fe.createRef=function(){return{current:null}},Fe.forwardRef=function(D){return{$$typeof:c,render:D}},Fe.isValidElement=F,Fe.lazy=function(D){return{$$typeof:b,_payload:{_status:-1,_result:D},_init:K}},Fe.memo=function(D,P){return{$$typeof:d,type:D,compare:P===void 0?null:P}},Fe.startTransition=function(D){var P=N.T,Z={};N.T=Z;try{var ee=D(),J=N.S;J!==null&&J(Z,ee),typeof ee=="object"&&ee!==null&&typeof ee.then=="function"&&ee.then(R,j)}catch(se){j(se)}finally{P!==null&&Z.types!==null&&(P.types=Z.types),N.T=P}},Fe.unstable_useCacheRefresh=function(){return N.H.useCacheRefresh()},Fe.use=function(D){return N.H.use(D)},Fe.useActionState=function(D,P,Z){return N.H.useActionState(D,P,Z)},Fe.useCallback=function(D,P){return N.H.useCallback(D,P)},Fe.useContext=function(D){return N.H.useContext(D)},Fe.useDebugValue=function(){},Fe.useDeferredValue=function(D,P){return N.H.useDeferredValue(D,P)},Fe.useEffect=function(D,P){return N.H.useEffect(D,P)},Fe.useEffectEvent=function(D){return N.H.useEffectEvent(D)},Fe.useId=function(){return N.H.useId()},Fe.useImperativeHandle=function(D,P,Z){return N.H.useImperativeHandle(D,P,Z)},Fe.useInsertionEffect=function(D,P){return N.H.useInsertionEffect(D,P)},Fe.useLayoutEffect=function(D,P){return N.H.useLayoutEffect(D,P)},Fe.useMemo=function(D,P){return N.H.useMemo(D,P)},Fe.useOptimistic=function(D,P){return N.H.useOptimistic(D,P)},Fe.useReducer=function(D,P,Z){return N.H.useReducer(D,P,Z)},Fe.useRef=function(D){return N.H.useRef(D)},Fe.useState=function(D){return N.H.useState(D)},Fe.useSyncExternalStore=function(D,P,Z){return N.H.useSyncExternalStore(D,P,Z)},Fe.useTransition=function(){return N.H.useTransition()},Fe.version="19.2.7",Fe}var xb;function Yg(){return xb||(xb=1,jf.exports=E5()),jf.exports}var M=Yg();const k5=Vg(M),Ju=LS({__proto__:null,default:k5},[M]),T5="fc-operation-body";let qn=class extends Error{status;constructor(n,i){super(i),this.name="ApiError",this.status=n}};async function MS(e){const n=await fetch("/api/v1/operations/catalog",{signal:e});if(!n.ok)throw new qn(n.status,`Operation catalog request failed: ${n.status}`);const i=await n.json();return Array.isArray(i.plugins)?i.plugins.map(R5).filter(s=>s!==null):[]}function Qu(e){const n=e;if(!n||typeof n.id!="string"||typeof n.theaterId!="string"||typeof n.type!="string"||typeof n.pluginId!="string"||typeof n.title!="string"||!n.payload||typeof n.payload!="object"||Array.isArray(n.payload)||NS(n))throw new qn(500,"Invalid operation response");return n}function NS(e){return zp(e,new Set(["canonicalCwd","cwd","persona","prompt","providerSession","ticket","token","toolAllowlist","tools","transcriptPath"]))}function A5({children:e,className:n}){return u.jsx("div",{className:M5(T5,n),children:e})}function R5(e){if(!OS(e)||typeof e.id!="string"||typeof e.title!="string"||!Array.isArray(e.kinds))return null;const n=e.kinds.map(L5).filter(i=>i!==null);return n.length===0?null:{id:e.id,title:e.title,kinds:n}}function L5(e){return!OS(e)||typeof e.id!="string"||typeof e.type!="string"||typeof e.title!="string"?null:{id:e.id,type:e.type,title:e.title,...typeof e.disabled=="boolean"?{disabled:e.disabled}:{},...typeof e.disabledReason=="string"?{disabledReason:e.disabledReason}:{}}}function OS(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function zp(e,n){return!e||typeof e!="object"?!1:Array.isArray(e)?e.some(i=>zp(i,n)):Object.entries(e).some(([i,s])=>n.has(i)||zp(s,n))}function M5(...e){return e.filter(n=>!!n).join(" ")}const N5=Object.freeze(Object.defineProperty({__proto__:null,ApiError:qn,OperationBody:A5,assertOperationNode:Qu,fetchOperationCatalog:MS,hasForbiddenBrowserPayloadKey:NS},Symbol.toStringTag,{value:"Module"}));function O5(e){return e}function D5(e){return e}function DS(e=()=>{}){const n=new Set;return{api:{fetch:(i,s,o)=>fetch(If(i,s),o).then(H5),subscribe:(i,s,o)=>{const f=new EventSource(If(i,s));f.onmessage=o;const g=()=>f.close();return n.add(g),()=>{g(),n.delete(g)}},resync:e},lifecycle:{onDispose:i=>(n.add(i),()=>n.delete(i))},terminal:{requestTicket:async(i,s,o,f)=>{const g=await fetch(If(i,s),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({operationId:o}),signal:f});if(!g.ok)throw new qn(g.status,`Terminal ticket request failed: ${g.status}`);const c=await g.json();if(typeof c.ticket!="string"||typeof c.ttlMs!="number")throw new qn(g.status,"Invalid terminal ticket response");return{ticket:c.ticket,ttlMs:c.ttlMs}}},notifications:{emit:()=>{},dismiss:()=>{}},operations:{create:async i=>{const s=await fetch("/api/v1/operations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!s.ok)throw new qn(s.status,`Operation create failed: ${s.status}`);const o=await s.json();return Qu(o.operation)},rename:async(i,s)=>{const o=await fetch(`/api/v1/operations/${encodeURIComponent(i)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:s})});if(!o.ok)throw new qn(o.status,`Operation rename failed: ${o.status}`);const f=await o.json();return Qu(f.operation)},remove:async i=>{const s=await fetch(`/api/v1/operations/${encodeURIComponent(i)}`,{method:"DELETE"});if(!s.ok)throw new qn(s.status,`Operation remove failed: ${s.status}`)}},preferences:{read:(i,s)=>U5(i,s),write:(i,s)=>F5(i,s)},settings:{read:async i=>{const s=await fetch(Cb(i));if(!s.ok)throw new qn(s.status,`Plugin settings read failed: ${s.status}`);const f=(await s.json()).value;return typeof f=="object"&&f!==null&&!Array.isArray(f)?f:null},write:async(i,s)=>{const o=await fetch(Cb(i),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!o.ok)throw new qn(o.status,`Plugin settings write failed: ${o.status}`)}},status:{set:()=>{},clear:()=>{}}}}function jS(e,n){return M.useSyncExternalStore(e,n,n)}function j5(){const[e,n]=M.useState([]),i=M.useCallback(async()=>{const s=await fetch("/api/v1/operations");if(!s.ok)throw new qn(s.status,`Operations request failed: ${s.status}`);const o=await s.json();n(Array.isArray(o.operations)?o.operations.map(Qu):[])},[]);return M.useEffect(()=>{i()},[i]),{operations:e,refresh:i}}function I5(e,n){return M.useMemo(()=>({fetch:(i,s)=>e.fetch(n,i,s),subscribe:(i,s)=>e.subscribe(n,i,s)}),[e,n])}function B5(e,n){return M.useMemo(()=>({read:()=>e.read(n),write:i=>e.write(n,i)}),[e,n])}function P5(e,n,i){const[s,o]=M.useState(()=>e.read(n,i)),f=M.useCallback(g=>{o(g),e.write(n,g)},[e,n]);return[s,f]}function z5(e,n){return M.useMemo(()=>({set:i=>e.set(n,i),clear:()=>e.clear(n)}),[e,n])}async function H5(e){if(!e.ok)throw new qn(e.status,`Plugin request failed: ${e.status}`);return e}function If(e,n){if(!/^[a-z0-9][a-z0-9._-]*$/i.test(e))throw new qn(400,"Invalid plugin id");const i=n.startsWith("/")?n:`/${n}`;if(i.includes(".."))throw new qn(400,"Invalid plugin path");return`/plugins/${e}${i}`}const $5=/^[a-z0-9][a-z0-9._-]*$/;function Cb(e){if(!$5.test(e))throw new qn(400,"Invalid plugin id");return`/api/v1/settings/plugins/${encodeURIComponent(e)}`}function U5(e,n){if(typeof window>"u")return n;try{const i=window.localStorage.getItem(`fleet-plugin.${e}`);return i===null?n:JSON.parse(i)}catch{return n}}function F5(e,n){if(!(typeof window>"u"))try{window.localStorage.setItem(`fleet-plugin.${e}`,JSON.stringify(n))}catch{}}const W5=Object.freeze(Object.defineProperty({__proto__:null,React:Ju,createClientCapabilities:DS,defineOperationKind:D5,definePlugin:O5,useOperationStatus:z5,useOperations:j5,usePluginApi:I5,usePluginSettings:B5,usePluginStorage:P5,useStoreSnapshot:jS},Symbol.toStringTag,{value:"Module"}));function G5(e){return e}function q5({title:e,description:n,children:i}){return u.jsxs("section",{className:"fc-settings-card",children:[e?u.jsx("h3",{className:"fc-settings-card__title",children:e}):null,n?u.jsx("p",{className:"fc-settings-card__desc",children:n}):null,u.jsx("div",{className:"fc-settings-card__body",children:i})]})}function K5({label:e,hint:n,children:i}){const s=M.useId(),o=M.useId();return u.jsxs("div",{className:"fc-settings-row",role:"group","aria-labelledby":s,"aria-describedby":n?o:void 0,children:[u.jsxs("div",{className:"fc-settings-row__copy",children:[u.jsx("div",{className:"fc-settings-row__label",id:s,children:e}),n?u.jsx("div",{className:"fc-settings-row__hint",id:o,children:n}):null]}),u.jsx("div",{className:"fc-settings-row__control",children:i})]})}function V5({checked:e,onChange:n,label:i,disabled:s=!1}){const o=M.useId();return u.jsxs("label",{className:"fc-settings-toggle",htmlFor:o,children:[u.jsx("input",{id:o,className:"fc-settings-toggle__input",type:"checkbox",checked:e,disabled:s,"aria-label":i?void 0:"Toggle setting",onChange:f=>n(f.currentTarget.checked)}),u.jsx("span",{className:"fc-settings-toggle__control","aria-hidden":"true"}),i?u.jsx("span",{className:"fc-settings-toggle__label",children:i}):null]})}function Y5({value:e,options:n,onChange:i,label:s,disabled:o=!1}){const f=M.useId(),g=u.jsx("select",{id:f,className:"fc-settings-select__control",value:e,disabled:o,"aria-label":s?void 0:"Select setting",onChange:c=>i(c.currentTarget.value),children:n.map(c=>u.jsx("option",{value:c.value,children:c.label},c.value))});return s?u.jsxs("label",{className:"fc-settings-select",htmlFor:f,children:[u.jsx("span",{className:"fc-settings-select__label",children:s}),g]}):u.jsx("div",{className:"fc-settings-select",children:g})}function X5({label:e,hint:n,children:i}){const s=M.useId(),o=M.useId();return u.jsxs("div",{className:"fc-settings-field",role:"group","aria-labelledby":s,"aria-describedby":n?o:void 0,children:[u.jsx("div",{className:"fc-settings-field__label",id:s,children:e}),n?u.jsx("div",{className:"fc-settings-field__hint",id:o,children:n}):null,u.jsx("div",{className:"fc-settings-field__control",children:i})]})}const Z5=Object.freeze(Object.defineProperty({__proto__:null,SettingsCard:q5,SettingsField:X5,SettingsRow:K5,SettingsSelect:Y5,SettingsToggle:V5,defineSettingsSection:G5},Symbol.toStringTag,{value:"Module"}));function J5(e){return e}const Q5=Object.freeze(Object.defineProperty({__proto__:null,defineNotificationKind:J5},Symbol.toStringTag,{value:"Module"})),ek=u.jsx("div",{className:"fc-plugin-error",children:"Plugin failed to render."});class Xg extends M.Component{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(n){this.props.onError?.(n)}render(){return this.state.hasError?this.props.fallback??ek:this.props.children}}const tk=Object.freeze(Object.defineProperty({__proto__:null,PluginErrorBoundary:Xg,React:Ju,default:Ju},Symbol.toStringTag,{value:"Module"}));var Bf={exports:{}},pl={},Pf={exports:{}},zf={};var Eb;function nk(){return Eb||(Eb=1,(function(e){function n(z,G){var K=z.length;z.push(G);e:for(;0<K;){var j=K-1>>>1,H=z[j];if(0<o(H,G))z[j]=G,z[K]=H,K=j;else break e}}function i(z){return z.length===0?null:z[0]}function s(z){if(z.length===0)return null;var G=z[0],K=z.pop();if(K!==G){z[0]=K;e:for(var j=0,H=z.length,D=H>>>1;j<D;){var P=2*(j+1)-1,Z=z[P],ee=P+1,J=z[ee];if(0>o(Z,K))ee<H&&0>o(J,Z)?(z[j]=J,z[ee]=K,j=ee):(z[j]=Z,z[P]=K,j=P);else if(ee<H&&0>o(J,K))z[j]=J,z[ee]=K,j=ee;else break e}}return G}function o(z,G){var K=z.sortIndex-G.sortIndex;return K!==0?K:z.id-G.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;e.unstable_now=function(){return f.now()}}else{var g=Date,c=g.now();e.unstable_now=function(){return g.now()-c}}var h=[],d=[],b=1,m=null,w=3,x=!1,T=!1,E=!1,p=!1,v=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;function k(z){for(var G=i(d);G!==null;){if(G.callback===null)s(d);else if(G.startTime<=z)s(d),G.sortIndex=G.expirationTime,n(h,G);else break;G=i(d)}}function L(z){if(E=!1,k(z),!T)if(i(h)!==null)T=!0,R||(R=!0,W());else{var G=i(d);G!==null&&V(L,G.startTime-z)}}var R=!1,N=-1,A=5,B=-1;function q(){return p?!0:!(e.unstable_now()-B<A)}function F(){if(p=!1,R){var z=e.unstable_now();B=z;var G=!0;try{e:{T=!1,E&&(E=!1,_(N),N=-1),x=!0;var K=w;try{t:{for(k(z),m=i(h);m!==null&&!(m.expirationTime>z&&q());){var j=m.callback;if(typeof j=="function"){m.callback=null,w=m.priorityLevel;var H=j(m.expirationTime<=z);if(z=e.unstable_now(),typeof H=="function"){m.callback=H,k(z),G=!0;break t}m===i(h)&&s(h),k(z)}else s(h);m=i(h)}if(m!==null)G=!0;else{var D=i(d);D!==null&&V(L,D.startTime-z),G=!1}}break e}finally{m=null,w=K,x=!1}G=void 0}}finally{G?W():R=!1}}}var W;if(typeof S=="function")W=function(){S(F)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,Y=I.port2;I.port1.onmessage=F,W=function(){Y.postMessage(null)}}else W=function(){v(F,0)};function V(z,G){N=v(function(){z(e.unstable_now())},G)}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(z){z.callback=null},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return w},e.unstable_next=function(z){switch(w){case 1:case 2:case 3:var G=3;break;default:G=w}var K=w;w=G;try{return z()}finally{w=K}},e.unstable_requestPaint=function(){p=!0},e.unstable_runWithPriority=function(z,G){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var K=w;w=z;try{return G()}finally{w=K}},e.unstable_scheduleCallback=function(z,G,K){var j=e.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?j+K:j):K=j,z){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=K+H,z={id:b++,callback:G,priorityLevel:z,startTime:K,expirationTime:H,sortIndex:-1},K>j?(z.sortIndex=K,n(d,z),i(h)===null&&z===i(d)&&(E?(_(N),N=-1):E=!0,V(L,K-j))):(z.sortIndex=H,n(h,z),T||x||(T=!0,R||(R=!0,W()))),z},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(z){var G=w;return function(){var K=w;w=G;try{return z.apply(this,arguments)}finally{w=K}}}})(zf)),zf}var kb;function ik(){return kb||(kb=1,Pf.exports=nk()),Pf.exports}var Hf={exports:{}},Hn={};var Tb;function rk(){if(Tb)return Hn;Tb=1;var e=Yg();function n(h){var d="https://react.dev/errors/"+h;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)d+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+h+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var s={d:{f:i,r:function(){throw Error(n(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for("react.portal");function f(h,d,b){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:m==null?null:""+m,children:h,containerInfo:d,implementation:b}}var g=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(h,d){if(h==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return Hn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,Hn.createPortal=function(h,d){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(n(299));return f(h,d,null,b)},Hn.flushSync=function(h){var d=g.T,b=s.p;try{if(g.T=null,s.p=2,h)return h()}finally{g.T=d,s.p=b,s.d.f()}},Hn.preconnect=function(h,d){typeof h=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,s.d.C(h,d))},Hn.prefetchDNS=function(h){typeof h=="string"&&s.d.D(h)},Hn.preinit=function(h,d){if(typeof h=="string"&&d&&typeof d.as=="string"){var b=d.as,m=c(b,d.crossOrigin),w=typeof d.integrity=="string"?d.integrity:void 0,x=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;b==="style"?s.d.S(h,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:m,integrity:w,fetchPriority:x}):b==="script"&&s.d.X(h,{crossOrigin:m,integrity:w,fetchPriority:x,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Hn.preinitModule=function(h,d){if(typeof h=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var b=c(d.as,d.crossOrigin);s.d.M(h,{crossOrigin:b,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&s.d.M(h)},Hn.preload=function(h,d){if(typeof h=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var b=d.as,m=c(b,d.crossOrigin);s.d.L(h,b,{crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},Hn.preloadModule=function(h,d){if(typeof h=="string")if(d){var b=c(d.as,d.crossOrigin);s.d.m(h,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:b,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else s.d.m(h)},Hn.requestFormReset=function(h){s.d.r(h)},Hn.unstable_batchedUpdates=function(h,d){return h(d)},Hn.useFormState=function(h,d,b){return g.H.useFormState(h,d,b)},Hn.useFormStatus=function(){return g.H.useHostTransitionStatus()},Hn.version="19.2.7",Hn}var Ab;function IS(){if(Ab)return Hf.exports;Ab=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Hf.exports=rk(),Hf.exports}var Rb;function sk(){if(Rb)return pl;Rb=1;var e=ik(),n=Yg(),i=IS();function s(t){var r="https://react.dev/errors/"+t;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)r+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+t+"; visit "+r+" 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 f(t){var r=t,a=t;if(t.alternate)for(;r.return;)r=r.return;else{t=r;do r=t,(r.flags&4098)!==0&&(a=r.return),t=r.return;while(t)}return r.tag===3?a:null}function g(t){if(t.tag===13){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function c(t){if(t.tag===31){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function h(t){if(f(t)!==t)throw Error(s(188))}function d(t){var r=t.alternate;if(!r){if(r=f(t),r===null)throw Error(s(188));return r!==t?null:t}for(var a=t,l=r;;){var y=a.return;if(y===null)break;var C=y.alternate;if(C===null){if(l=y.return,l!==null){a=l;continue}break}if(y.child===C.child){for(C=y.child;C;){if(C===a)return h(y),t;if(C===l)return h(y),r;C=C.sibling}throw Error(s(188))}if(a.return!==l.return)a=y,l=C;else{for(var O=!1,U=y.child;U;){if(U===a){O=!0,a=y,l=C;break}if(U===l){O=!0,l=y,a=C;break}U=U.sibling}if(!O){for(U=C.child;U;){if(U===a){O=!0,a=C,l=y;break}if(U===l){O=!0,l=C,a=y;break}U=U.sibling}if(!O)throw Error(s(189))}}if(a.alternate!==l)throw Error(s(190))}if(a.tag!==3)throw Error(s(188));return a.stateNode.current===a?t:r}function b(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t;for(t=t.child;t!==null;){if(r=b(t),r!==null)return r;t=t.sibling}return null}var m=Object.assign,w=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),S=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),q=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function W(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 Y(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 E:return"Fragment";case v:return"Profiler";case p:return"StrictMode";case L:return"Suspense";case R:return"SuspenseList";case B:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case T:return"Portal";case S:return t.displayName||"Context";case _:return(t._context.displayName||"Context")+".Consumer";case k:var r=t.render;return t=t.displayName,t||(t=r.displayName||r.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case N:return r=t.displayName||null,r!==null?r:Y(t.type)||"Memo";case A:r=t._payload,t=t._init;try{return Y(t(r))}catch{}}return null}var V=Array.isArray,z=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K={pending:!1,data:null,method:null,action:null},j=[],H=-1;function D(t){return{current:t}}function P(t){0>H||(t.current=j[H],j[H]=null,H--)}function Z(t,r){H++,j[H]=t.current,t.current=r}var ee=D(null),J=D(null),se=D(null),X=D(null);function $(t,r){switch(Z(se,r),Z(J,t),Z(ee,null),r.nodeType){case 9:case 11:t=(t=r.documentElement)&&(t=t.namespaceURI)?F0(t):0;break;default:if(t=r.tagName,r=r.namespaceURI)r=F0(r),t=W0(r,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}P(ee),Z(ee,t)}function ae(){P(ee),P(J),P(se)}function de(t){t.memoizedState!==null&&Z(X,t);var r=ee.current,a=W0(r,t.type);r!==a&&(Z(J,t),Z(ee,a))}function we(t){J.current===t&&(P(ee),P(J)),X.current===t&&(P(X),cl._currentValue=K)}var ye,Ne;function Oe(t){if(ye===void 0)try{throw Error()}catch(a){var r=a.stack.trim().match(/\n( *(at )?)/);ye=r&&r[1]||"",Ne=-1<a.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+ye+t+Ne}var Ge=!1;function vt(t,r){if(!t||Ge)return"";Ge=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(r){var me=function(){throw Error()};if(Object.defineProperty(me.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(me,[])}catch(he){var ue=he}Reflect.construct(t,[],me)}else{try{me.call()}catch(he){ue=he}t.call(me.prototype)}}else{try{throw Error()}catch(he){ue=he}(me=t())&&typeof me.catch=="function"&&me.catch(function(){})}}catch(he){if(he&&ue&&typeof he.stack=="string")return[he.stack,ue.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var C=l.DetermineComponentFrameRoot(),O=C[0],U=C[1];if(O&&U){var ne=O.split(`
|
|
4
|
+
`),ce=U.split(`
|
|
5
|
+
`);for(y=l=0;l<ne.length&&!ne[l].includes("DetermineComponentFrameRoot");)l++;for(;y<ce.length&&!ce[y].includes("DetermineComponentFrameRoot");)y++;if(l===ne.length||y===ce.length)for(l=ne.length-1,y=ce.length-1;1<=l&&0<=y&&ne[l]!==ce[y];)y--;for(;1<=l&&0<=y;l--,y--)if(ne[l]!==ce[y]){if(l!==1||y!==1)do if(l--,y--,0>y||ne[l]!==ce[y]){var fe=`
|
|
6
|
+
`+ne[l].replace(" at new "," at ");return t.displayName&&fe.includes("<anonymous>")&&(fe=fe.replace("<anonymous>",t.displayName)),fe}while(1<=l&&0<=y);break}}}finally{Ge=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?Oe(a):""}function Le(t,r){switch(t.tag){case 26:case 27:case 5:return Oe(t.type);case 16:return Oe("Lazy");case 13:return t.child!==r&&r!==null?Oe("Suspense Fallback"):Oe("Suspense");case 19:return Oe("SuspenseList");case 0:case 15:return vt(t.type,!1);case 11:return vt(t.type.render,!1);case 1:return vt(t.type,!0);case 31:return Oe("Activity");default:return""}}function Rt(t){try{var r="",a=null;do r+=Le(t,a),a=t,t=t.return;while(t);return r}catch(l){return`
|
|
7
|
+
Error generating stack: `+l.message+`
|
|
8
|
+
`+l.stack}}var Xt=Object.prototype.hasOwnProperty,vn=e.unstable_scheduleCallback,on=e.unstable_cancelCallback,kn=e.unstable_shouldYield,Zt=e.unstable_requestPaint,ut=e.unstable_now,Lt=e.unstable_getCurrentPriorityLevel,Ct=e.unstable_ImmediatePriority,Ft=e.unstable_UserBlockingPriority,Kt=e.unstable_NormalPriority,Jn=e.unstable_LowPriority,bn=e.unstable_IdlePriority,Pn=e.log,dt=e.unstable_setDisableYieldValue,Tn=null,ve=null;function $e(t){if(typeof Pn=="function"&&dt(t),ve&&typeof ve.setStrictMode=="function")try{ve.setStrictMode(Tn,t)}catch{}}var Je=Math.clz32?Math.clz32:ln,at=Math.log,Ve=Math.LN2;function ln(t){return t>>>=0,t===0?32:31-(at(t)/Ve|0)|0}var Dt=256,An=262144,Un=4194304;function jt(t){var r=t&42;if(r!==0)return r;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 te(t,r,a){var l=t.pendingLanes;if(l===0)return 0;var y=0,C=t.suspendedLanes,O=t.pingedLanes;t=t.warmLanes;var U=l&134217727;return U!==0?(l=U&~C,l!==0?y=jt(l):(O&=U,O!==0?y=jt(O):a||(a=U&~t,a!==0&&(y=jt(a))))):(U=l&~C,U!==0?y=jt(U):O!==0?y=jt(O):a||(a=l&~t,a!==0&&(y=jt(a)))),y===0?0:r!==0&&r!==y&&(r&C)===0&&(C=y&-y,a=r&-r,C>=a||C===32&&(a&4194048)!==0)?r:y}function pe(t,r){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&r)===0}function Se(t,r){switch(t){case 1:case 2:case 4:case 8:case 64:return r+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 r+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 je(){var t=Un;return Un<<=1,(Un&62914560)===0&&(Un=4194304),t}function bt(t){for(var r=[],a=0;31>a;a++)r.push(t);return r}function ht(t,r){t.pendingLanes|=r,r!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function ke(t,r,a,l,y,C){var O=t.pendingLanes;t.pendingLanes=a,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=a,t.entangledLanes&=a,t.errorRecoveryDisabledLanes&=a,t.shellSuspendCounter=0;var U=t.entanglements,ne=t.expirationTimes,ce=t.hiddenUpdates;for(a=O&~a;0<a;){var fe=31-Je(a),me=1<<fe;U[fe]=0,ne[fe]=-1;var ue=ce[fe];if(ue!==null)for(ce[fe]=null,fe=0;fe<ue.length;fe++){var he=ue[fe];he!==null&&(he.lane&=-536870913)}a&=~me}l!==0&&Ce(t,l,0),C!==0&&y===0&&t.tag!==0&&(t.suspendedLanes|=C&~(O&~r))}function Ce(t,r,a){t.pendingLanes|=r,t.suspendedLanes&=~r;var l=31-Je(r);t.entangledLanes|=r,t.entanglements[l]=t.entanglements[l]|1073741824|a&261930}function Pe(t,r){var a=t.entangledLanes|=r;for(t=t.entanglements;a;){var l=31-Je(a),y=1<<l;y&r|t[l]&r&&(t[l]|=r),a&=~y}}function Vt(t,r){var a=r&-r;return a=(a&42)!==0?1:nt(a),(a&(t.suspendedLanes|r))!==0?0:a}function nt(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 Rn(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function dr(){var t=G.p;return t!==0?t:(t=window.event,t===void 0?32:fb(t.type))}function fr(t,r){var a=G.p;try{return G.p=t,r()}finally{G.p=a}}var Qn=Math.random().toString(36).slice(2),It="__reactFiber$"+Qn,Nt="__reactProps$"+Qn,Fi="__reactContainer$"+Qn,Fr="__reactEvents$"+Qn,la="__reactListeners$"+Qn,pr="__reactHandles$"+Qn,As="__reactResources$"+Qn,er="__reactMarker$"+Qn;function De(t){delete t[It],delete t[Nt],delete t[Fr],delete t[la],delete t[pr]}function Q(t){var r=t[It];if(r)return r;for(var a=t.parentNode;a;){if(r=a[Fi]||a[It]){if(a=r.alternate,r.child!==null||a!==null&&a.child!==null)for(t=Z0(t);t!==null;){if(a=t[It])return a;t=Z0(t)}return r}t=a,a=t.parentNode}return null}function _e(t){if(t=t[It]||t[Fi]){var r=t.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return t}return null}function Ee(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t.stateNode;throw Error(s(33))}function ot(t){var r=t[As];return r||(r=t[As]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Qe(t){t[er]=!0}var Bt=new Set,Jt={};function Qt(t,r){be(t,r),be(t+"Capture",r)}function be(t,r){for(Jt[t]=r,t=0;t<r.length;t++)Bt.add(r[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]*$"),Ie={},ft={};function Wt(t){return Xt.call(ft,t)?!0:Xt.call(Ie,t)?!1:Me.test(t)?ft[t]=!0:(Ie[t]=!0,!1)}function zn(t,r,a){if(Wt(r))if(a===null)t.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":t.removeAttribute(r);return;case"boolean":var l=r.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){t.removeAttribute(r);return}}t.setAttribute(r,""+a)}}function hi(t,r,a){if(a===null)t.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(r);return}t.setAttribute(r,""+a)}}function ei(t,r,a,l){if(l===null)t.removeAttribute(a);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttributeNS(r,a,""+l)}}function Ot(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function di(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function rc(t,r,a){var l=Object.getOwnPropertyDescriptor(t.constructor.prototype,r);if(!t.hasOwnProperty(r)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var y=l.get,C=l.set;return Object.defineProperty(t,r,{configurable:!0,get:function(){return y.call(this)},set:function(O){a=""+O,C.call(this,O)}}),Object.defineProperty(t,r,{enumerable:l.enumerable}),{getValue:function(){return a},setValue:function(O){a=""+O},stopTracking:function(){t._valueTracker=null,delete t[r]}}}}function ca(t){if(!t._valueTracker){var r=di(t)?"checked":"value";t._valueTracker=rc(t,r,""+t[r])}}function wo(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var a=r.getValue(),l="";return t&&(l=di(t)?t.checked?"true":"false":t.value),t=l,t!==a?(r.setValue(t),!0):!1}function ua(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 Nh=/[\n"\\]/g;function ti(t){return t.replace(Nh,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function xo(t,r,a,l,y,C,O,U){t.name="",O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?t.type=O:t.removeAttribute("type"),r!=null?O==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+Ot(r)):t.value!==""+Ot(r)&&(t.value=""+Ot(r)):O!=="submit"&&O!=="reset"||t.removeAttribute("value"),r!=null?ha(t,O,Ot(r)):a!=null?ha(t,O,Ot(a)):l!=null&&t.removeAttribute("value"),y==null&&C!=null&&(t.defaultChecked=!!C),y!=null&&(t.checked=y&&typeof y!="function"&&typeof y!="symbol"),U!=null&&typeof U!="function"&&typeof U!="symbol"&&typeof U!="boolean"?t.name=""+Ot(U):t.removeAttribute("name")}function Rs(t,r,a,l,y,C,O,U){if(C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(t.type=C),r!=null||a!=null){if(!(C!=="submit"&&C!=="reset"||r!=null)){ca(t);return}a=a!=null?""+Ot(a):"",r=r!=null?""+Ot(r):a,U||r===t.value||(t.value=r),t.defaultValue=r}l=l??y,l=typeof l!="function"&&typeof l!="symbol"&&!!l,t.checked=U?t.checked:!!l,t.defaultChecked=!!l,O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(t.name=O),ca(t)}function ha(t,r,a){r==="number"&&ua(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function Ln(t,r,a,l){if(t=t.options,r){r={};for(var y=0;y<a.length;y++)r["$"+a[y]]=!0;for(a=0;a<t.length;a++)y=r.hasOwnProperty("$"+t[a].value),t[a].selected!==y&&(t[a].selected=y),y&&l&&(t[a].defaultSelected=!0)}else{for(a=""+Ot(a),r=null,y=0;y<t.length;y++){if(t[y].value===a){t[y].selected=!0,l&&(t[y].defaultSelected=!0);return}r!==null||t[y].disabled||(r=t[y])}r!==null&&(r.selected=!0)}}function sc(t,r,a){if(r!=null&&(r=""+Ot(r),r!==t.value&&(t.value=r),a==null)){t.defaultValue!==r&&(t.defaultValue=r);return}t.defaultValue=a!=null?""+Ot(a):""}function da(t,r,a,l){if(r==null){if(l!=null){if(a!=null)throw Error(s(92));if(V(l)){if(1<l.length)throw Error(s(93));l=l[0]}a=l}a==null&&(a=""),r=a}a=Ot(r),t.defaultValue=a,l=t.textContent,l===a&&l!==""&&l!==null&&(t.value=l),ca(t)}function Ue(t,r){if(r){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=r;return}}t.textContent=r}var ac=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 hn(t,r,a){var l=r.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?l?t.setProperty(r,""):r==="float"?t.cssFloat="":t[r]="":l?t.setProperty(r,a):typeof a!="number"||a===0||ac.has(r)?r==="float"?t.cssFloat=a:t[r]=(""+a).trim():t[r]=a+"px"}function yt(t,r,a){if(r!=null&&typeof r!="object")throw Error(s(62));if(t=t.style,a!=null){for(var l in a)!a.hasOwnProperty(l)||r!=null&&r.hasOwnProperty(l)||(l.indexOf("--")===0?t.setProperty(l,""):l==="float"?t.cssFloat="":t[l]="");for(var y in r)l=r[y],r.hasOwnProperty(y)&&a[y]!==l&&hn(t,y,l)}else for(var C in r)r.hasOwnProperty(C)&&hn(t,C,r[C])}function Wr(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 gr=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"]]),Co=/^[\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 Gr(t){return Co.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function xe(){}var Ae=null;function We(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var it=null,Yt=null;function Ti(t){var r=_e(t);if(r&&(t=r.stateNode)){var a=t[Nt]||null;e:switch(t=r.stateNode,r.type){case"input":if(xo(t,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),r=a.name,a.type==="radio"&&r!=null){for(a=t;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+ti(""+r)+'"][type="radio"]'),r=0;r<a.length;r++){var l=a[r];if(l!==t&&l.form===t.form){var y=l[Nt]||null;if(!y)throw Error(s(90));xo(l,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(r=0;r<a.length;r++)l=a[r],l.form===t.form&&wo(l)}break e;case"textarea":sc(t,a.value,a.defaultValue);break e;case"select":r=a.value,r!=null&&Ln(t,!!a.multiple,r,!1)}}}var Eo=!1;function oc(t,r,a){if(Eo)return t(r,a);Eo=!0;try{var l=t(r);return l}finally{if(Eo=!1,(it!==null||Yt!==null)&&(Vc(),it&&(r=it,t=Yt,Yt=it=null,Ti(r),t)))for(r=0;r<t.length;r++)Ti(t[r])}}function ko(t,r){var a=t.stateNode;if(a===null)return null;var l=a[Nt]||null;if(l===null)return null;a=l[r];e:switch(r){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(a&&typeof a!="function")throw Error(s(231,r,typeof a));return a}var mr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Oh=!1;if(mr)try{var To={};Object.defineProperty(To,"passive",{get:function(){Oh=!0}}),window.addEventListener("test",To,To),window.removeEventListener("test",To,To)}catch{Oh=!1}var qr=null,Dh=null,lc=null;function Wm(){if(lc)return lc;var t,r=Dh,a=r.length,l,y="value"in qr?qr.value:qr.textContent,C=y.length;for(t=0;t<a&&r[t]===y[t];t++);var O=a-t;for(l=1;l<=O&&r[a-l]===y[C-l];l++);return lc=y.slice(t,1<l?1-l:void 0)}function cc(t){var r=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&r===13&&(t=13)):t=r,t===10&&(t=13),32<=t||t===13?t:0}function uc(){return!0}function Gm(){return!1}function ni(t){function r(a,l,y,C,O){this._reactName=a,this._targetInst=y,this.type=l,this.nativeEvent=C,this.target=O,this.currentTarget=null;for(var U in t)t.hasOwnProperty(U)&&(a=t[U],this[U]=a?a(C):C[U]);return this.isDefaultPrevented=(C.defaultPrevented!=null?C.defaultPrevented:C.returnValue===!1)?uc:Gm,this.isPropagationStopped=Gm,this}return m(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=uc)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=uc)},persist:function(){},isPersistent:uc}),r}var Ls={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},hc=ni(Ls),Ao=m({},Ls,{view:0,detail:0}),b2=ni(Ao),jh,Ih,Ro,dc=m({},Ao,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ph,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!==Ro&&(Ro&&t.type==="mousemove"?(jh=t.screenX-Ro.screenX,Ih=t.screenY-Ro.screenY):Ih=jh=0,Ro=t),jh)},movementY:function(t){return"movementY"in t?t.movementY:Ih}}),qm=ni(dc),y2=m({},dc,{dataTransfer:0}),S2=ni(y2),w2=m({},Ao,{relatedTarget:0}),Bh=ni(w2),x2=m({},Ls,{animationName:0,elapsedTime:0,pseudoElement:0}),C2=ni(x2),E2=m({},Ls,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),k2=ni(E2),T2=m({},Ls,{data:0}),Km=ni(T2),A2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},R2={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"},L2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function M2(t){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(t):(t=L2[t])?!!r[t]:!1}function Ph(){return M2}var N2=m({},Ao,{key:function(t){if(t.key){var r=A2[t.key]||t.key;if(r!=="Unidentified")return r}return t.type==="keypress"?(t=cc(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?R2[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ph,charCode:function(t){return t.type==="keypress"?cc(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?cc(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),O2=ni(N2),D2=m({},dc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Vm=ni(D2),j2=m({},Ao,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ph}),I2=ni(j2),B2=m({},Ls,{propertyName:0,elapsedTime:0,pseudoElement:0}),P2=ni(B2),z2=m({},dc,{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}),H2=ni(z2),$2=m({},Ls,{newState:0,oldState:0}),U2=ni($2),F2=[9,13,27,32],zh=mr&&"CompositionEvent"in window,Lo=null;mr&&"documentMode"in document&&(Lo=document.documentMode);var W2=mr&&"TextEvent"in window&&!Lo,Ym=mr&&(!zh||Lo&&8<Lo&&11>=Lo),Xm=" ",Zm=!1;function Jm(t,r){switch(t){case"keyup":return F2.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Qm(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var fa=!1;function G2(t,r){switch(t){case"compositionend":return Qm(r);case"keypress":return r.which!==32?null:(Zm=!0,Xm);case"textInput":return t=r.data,t===Xm&&Zm?null:t;default:return null}}function q2(t,r){if(fa)return t==="compositionend"||!zh&&Jm(t,r)?(t=Wm(),lc=Dh=qr=null,fa=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Ym&&r.locale!=="ko"?null:r.data;default:return null}}var K2={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 e_(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!K2[t.type]:r==="textarea"}function t_(t,r,a,l){it?Yt?Yt.push(l):Yt=[l]:it=l,r=tu(r,"onChange"),0<r.length&&(a=new hc("onChange","change",null,a,l),t.push({event:a,listeners:r}))}var Mo=null,No=null;function V2(t){B0(t,0)}function fc(t){var r=Ee(t);if(wo(r))return t}function n_(t,r){if(t==="change")return r}var i_=!1;if(mr){var Hh;if(mr){var $h="oninput"in document;if(!$h){var r_=document.createElement("div");r_.setAttribute("oninput","return;"),$h=typeof r_.oninput=="function"}Hh=$h}else Hh=!1;i_=Hh&&(!document.documentMode||9<document.documentMode)}function s_(){Mo&&(Mo.detachEvent("onpropertychange",a_),No=Mo=null)}function a_(t){if(t.propertyName==="value"&&fc(No)){var r=[];t_(r,No,t,We(t)),oc(V2,r)}}function Y2(t,r,a){t==="focusin"?(s_(),Mo=r,No=a,Mo.attachEvent("onpropertychange",a_)):t==="focusout"&&s_()}function X2(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return fc(No)}function Z2(t,r){if(t==="click")return fc(r)}function J2(t,r){if(t==="input"||t==="change")return fc(r)}function Q2(t,r){return t===r&&(t!==0||1/t===1/r)||t!==t&&r!==r}var fi=typeof Object.is=="function"?Object.is:Q2;function Oo(t,r){if(fi(t,r))return!0;if(typeof t!="object"||t===null||typeof r!="object"||r===null)return!1;var a=Object.keys(t),l=Object.keys(r);if(a.length!==l.length)return!1;for(l=0;l<a.length;l++){var y=a[l];if(!Xt.call(r,y)||!fi(t[y],r[y]))return!1}return!0}function o_(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function l_(t,r){var a=o_(t);t=0;for(var l;a;){if(a.nodeType===3){if(l=t+a.textContent.length,t<=r&&l>=r)return{node:a,offset:r-t};t=l}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=o_(a)}}function c_(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?c_(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function u_(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var r=ua(t.document);r instanceof t.HTMLIFrameElement;){try{var a=typeof r.contentWindow.location.href=="string"}catch{a=!1}if(a)t=r.contentWindow;else break;r=ua(t.document)}return r}function Uh(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r&&(r==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||r==="textarea"||t.contentEditable==="true")}var eE=mr&&"documentMode"in document&&11>=document.documentMode,pa=null,Fh=null,Do=null,Wh=!1;function h_(t,r,a){var l=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Wh||pa==null||pa!==ua(l)||(l=pa,"selectionStart"in l&&Uh(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}),Do&&Oo(Do,l)||(Do=l,l=tu(Fh,"onSelect"),0<l.length&&(r=new hc("onSelect","select",null,r,a),t.push({event:r,listeners:l}),r.target=pa)))}function Ms(t,r){var a={};return a[t.toLowerCase()]=r.toLowerCase(),a["Webkit"+t]="webkit"+r,a["Moz"+t]="moz"+r,a}var ga={animationend:Ms("Animation","AnimationEnd"),animationiteration:Ms("Animation","AnimationIteration"),animationstart:Ms("Animation","AnimationStart"),transitionrun:Ms("Transition","TransitionRun"),transitionstart:Ms("Transition","TransitionStart"),transitioncancel:Ms("Transition","TransitionCancel"),transitionend:Ms("Transition","TransitionEnd")},Gh={},d_={};mr&&(d_=document.createElement("div").style,"AnimationEvent"in window||(delete ga.animationend.animation,delete ga.animationiteration.animation,delete ga.animationstart.animation),"TransitionEvent"in window||delete ga.transitionend.transition);function Ns(t){if(Gh[t])return Gh[t];if(!ga[t])return t;var r=ga[t],a;for(a in r)if(r.hasOwnProperty(a)&&a in d_)return Gh[t]=r[a];return t}var f_=Ns("animationend"),p_=Ns("animationiteration"),g_=Ns("animationstart"),tE=Ns("transitionrun"),nE=Ns("transitionstart"),iE=Ns("transitioncancel"),m_=Ns("transitionend"),__=new Map,qh="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(" ");qh.push("scrollEnd");function Wi(t,r){__.set(t,r),Qt(r,[t])}var pc=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=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(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},Ai=[],ma=0,Kh=0;function gc(){for(var t=ma,r=Kh=ma=0;r<t;){var a=Ai[r];Ai[r++]=null;var l=Ai[r];Ai[r++]=null;var y=Ai[r];Ai[r++]=null;var C=Ai[r];if(Ai[r++]=null,l!==null&&y!==null){var O=l.pending;O===null?y.next=y:(y.next=O.next,O.next=y),l.pending=y}C!==0&&v_(a,y,C)}}function mc(t,r,a,l){Ai[ma++]=t,Ai[ma++]=r,Ai[ma++]=a,Ai[ma++]=l,Kh|=l,t.lanes|=l,t=t.alternate,t!==null&&(t.lanes|=l)}function Vh(t,r,a,l){return mc(t,r,a,l),_c(t)}function Os(t,r){return mc(t,null,null,r),_c(t)}function v_(t,r,a){t.lanes|=a;var l=t.alternate;l!==null&&(l.lanes|=a);for(var y=!1,C=t.return;C!==null;)C.childLanes|=a,l=C.alternate,l!==null&&(l.childLanes|=a),C.tag===22&&(t=C.stateNode,t===null||t._visibility&1||(y=!0)),t=C,C=C.return;return t.tag===3?(C=t.stateNode,y&&r!==null&&(y=31-Je(a),t=C.hiddenUpdates,l=t[y],l===null?t[y]=[r]:l.push(r),r.lane=a|536870912),C):null}function _c(t){if(50<nl)throw nl=0,rf=null,Error(s(185));for(var r=t.return;r!==null;)t=r,r=t.return;return t.tag===3?t.stateNode:null}var _a={};function rE(t,r,a,l){this.tag=t,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,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 pi(t,r,a,l){return new rE(t,r,a,l)}function Yh(t){return t=t.prototype,!(!t||!t.isReactComponent)}function _r(t,r){var a=t.alternate;return a===null?(a=pi(t.tag,r,t.key,t.mode),a.elementType=t.elementType,a.type=t.type,a.stateNode=t.stateNode,a.alternate=t,t.alternate=a):(a.pendingProps=r,a.type=t.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=t.flags&65011712,a.childLanes=t.childLanes,a.lanes=t.lanes,a.child=t.child,a.memoizedProps=t.memoizedProps,a.memoizedState=t.memoizedState,a.updateQueue=t.updateQueue,r=t.dependencies,a.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},a.sibling=t.sibling,a.index=t.index,a.ref=t.ref,a.refCleanup=t.refCleanup,a}function b_(t,r){t.flags&=65011714;var a=t.alternate;return a===null?(t.childLanes=0,t.lanes=r,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=a.childLanes,t.lanes=a.lanes,t.child=a.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=a.memoizedProps,t.memoizedState=a.memoizedState,t.updateQueue=a.updateQueue,t.type=a.type,r=a.dependencies,t.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),t}function vc(t,r,a,l,y,C){var O=0;if(l=t,typeof t=="function")Yh(t)&&(O=1);else if(typeof t=="string")O=c5(t,a,ee.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case B:return t=pi(31,a,r,y),t.elementType=B,t.lanes=C,t;case E:return Ds(a.children,y,C,r);case p:O=8,y|=24;break;case v:return t=pi(12,a,r,y|2),t.elementType=v,t.lanes=C,t;case L:return t=pi(13,a,r,y),t.elementType=L,t.lanes=C,t;case R:return t=pi(19,a,r,y),t.elementType=R,t.lanes=C,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case S:O=10;break e;case _:O=9;break e;case k:O=11;break e;case N:O=14;break e;case A:O=16,l=null;break e}O=29,a=Error(s(130,t===null?"null":typeof t,"")),l=null}return r=pi(O,a,r,y),r.elementType=t,r.type=l,r.lanes=C,r}function Ds(t,r,a,l){return t=pi(7,t,l,r),t.lanes=a,t}function Xh(t,r,a){return t=pi(6,t,null,r),t.lanes=a,t}function y_(t){var r=pi(18,null,null,0);return r.stateNode=t,r}function Zh(t,r,a){return r=pi(4,t.children!==null?t.children:[],t.key,r),r.lanes=a,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}var S_=new WeakMap;function Ri(t,r){if(typeof t=="object"&&t!==null){var a=S_.get(t);return a!==void 0?a:(r={value:t,source:r,stack:Rt(r)},S_.set(t,r),r)}return{value:t,source:r,stack:Rt(r)}}var va=[],ba=0,bc=null,jo=0,Li=[],Mi=0,Kr=null,tr=1,nr="";function vr(t,r){va[ba++]=jo,va[ba++]=bc,bc=t,jo=r}function w_(t,r,a){Li[Mi++]=tr,Li[Mi++]=nr,Li[Mi++]=Kr,Kr=t;var l=tr;t=nr;var y=32-Je(l)-1;l&=~(1<<y),a+=1;var C=32-Je(r)+y;if(30<C){var O=y-y%5;C=(l&(1<<O)-1).toString(32),l>>=O,y-=O,tr=1<<32-Je(r)+y|a<<y|l,nr=C+t}else tr=1<<C|a<<y|l,nr=t}function Jh(t){t.return!==null&&(vr(t,1),w_(t,1,0))}function Qh(t){for(;t===bc;)bc=va[--ba],va[ba]=null,jo=va[--ba],va[ba]=null;for(;t===Kr;)Kr=Li[--Mi],Li[Mi]=null,nr=Li[--Mi],Li[Mi]=null,tr=Li[--Mi],Li[Mi]=null}function x_(t,r){Li[Mi++]=tr,Li[Mi++]=nr,Li[Mi++]=Kr,tr=r.id,nr=r.overflow,Kr=t}var Mn=null,Pt=null,lt=!1,Vr=null,Ni=!1,ed=Error(s(519));function Yr(t){var r=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Io(Ri(r,t)),ed}function C_(t){var r=t.stateNode,a=t.type,l=t.memoizedProps;switch(r[It]=t,r[Nt]=l,a){case"dialog":tt("cancel",r),tt("close",r);break;case"iframe":case"object":case"embed":tt("load",r);break;case"video":case"audio":for(a=0;a<rl.length;a++)tt(rl[a],r);break;case"source":tt("error",r);break;case"img":case"image":case"link":tt("error",r),tt("load",r);break;case"details":tt("toggle",r);break;case"input":tt("invalid",r),Rs(r,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":tt("invalid",r);break;case"textarea":tt("invalid",r),da(r,l.value,l.defaultValue,l.children)}a=l.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||r.textContent===""+a||l.suppressHydrationWarning===!0||$0(r.textContent,a)?(l.popover!=null&&(tt("beforetoggle",r),tt("toggle",r)),l.onScroll!=null&&tt("scroll",r),l.onScrollEnd!=null&&tt("scrollend",r),l.onClick!=null&&(r.onclick=xe),r=!0):r=!1,r||Yr(t,!0)}function E_(t){for(Mn=t.return;Mn;)switch(Mn.tag){case 5:case 31:case 13:Ni=!1;return;case 27:case 3:Ni=!0;return;default:Mn=Mn.return}}function ya(t){if(t!==Mn)return!1;if(!lt)return E_(t),lt=!0,!1;var r=t.tag,a;if((a=r!==3&&r!==27)&&((a=r===5)&&(a=t.type,a=!(a!=="form"&&a!=="button")||bf(t.type,t.memoizedProps)),a=!a),a&&Pt&&Yr(t),E_(t),r===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));Pt=X0(t)}else if(r===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));Pt=X0(t)}else r===27?(r=Pt,cs(t.type)?(t=Cf,Cf=null,Pt=t):Pt=r):Pt=Mn?Di(t.stateNode.nextSibling):null;return!0}function js(){Pt=Mn=null,lt=!1}function td(){var t=Vr;return t!==null&&(ai===null?ai=t:ai.push.apply(ai,t),Vr=null),t}function Io(t){Vr===null?Vr=[t]:Vr.push(t)}var nd=D(null),Is=null,br=null;function Xr(t,r,a){Z(nd,r._currentValue),r._currentValue=a}function yr(t){t._currentValue=nd.current,P(nd)}function id(t,r,a){for(;t!==null;){var l=t.alternate;if((t.childLanes&r)!==r?(t.childLanes|=r,l!==null&&(l.childLanes|=r)):l!==null&&(l.childLanes&r)!==r&&(l.childLanes|=r),t===a)break;t=t.return}}function rd(t,r,a,l){var y=t.child;for(y!==null&&(y.return=t);y!==null;){var C=y.dependencies;if(C!==null){var O=y.child;C=C.firstContext;e:for(;C!==null;){var U=C;C=y;for(var ne=0;ne<r.length;ne++)if(U.context===r[ne]){C.lanes|=a,U=C.alternate,U!==null&&(U.lanes|=a),id(C.return,a,t),l||(O=null);break e}C=U.next}}else if(y.tag===18){if(O=y.return,O===null)throw Error(s(341));O.lanes|=a,C=O.alternate,C!==null&&(C.lanes|=a),id(O,a,t),O=null}else O=y.child;if(O!==null)O.return=y;else for(O=y;O!==null;){if(O===t){O=null;break}if(y=O.sibling,y!==null){y.return=O.return,O=y;break}O=O.return}y=O}}function Sa(t,r,a,l){t=null;for(var y=r,C=!1;y!==null;){if(!C){if((y.flags&524288)!==0)C=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var O=y.alternate;if(O===null)throw Error(s(387));if(O=O.memoizedProps,O!==null){var U=y.type;fi(y.pendingProps.value,O.value)||(t!==null?t.push(U):t=[U])}}else if(y===X.current){if(O=y.alternate,O===null)throw Error(s(387));O.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(t!==null?t.push(cl):t=[cl])}y=y.return}t!==null&&rd(r,t,a,l),r.flags|=262144}function yc(t){for(t=t.firstContext;t!==null;){if(!fi(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Bs(t){Is=t,br=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Nn(t){return k_(Is,t)}function Sc(t,r){return Is===null&&Bs(t),k_(t,r)}function k_(t,r){var a=r._currentValue;if(r={context:r,memoizedValue:a,next:null},br===null){if(t===null)throw Error(s(308));br=r,t.dependencies={lanes:0,firstContext:r},t.flags|=524288}else br=br.next=r;return a}var sE=typeof AbortController<"u"?AbortController:function(){var t=[],r=this.signal={aborted:!1,addEventListener:function(a,l){t.push(l)}};this.abort=function(){r.aborted=!0,t.forEach(function(a){return a()})}},aE=e.unstable_scheduleCallback,oE=e.unstable_NormalPriority,dn={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function sd(){return{controller:new sE,data:new Map,refCount:0}}function Bo(t){t.refCount--,t.refCount===0&&aE(oE,function(){t.controller.abort()})}var Po=null,ad=0,wa=0,xa=null;function lE(t,r){if(Po===null){var a=Po=[];ad=0,wa=uf(),xa={status:"pending",value:void 0,then:function(l){a.push(l)}}}return ad++,r.then(T_,T_),r}function T_(){if(--ad===0&&Po!==null){xa!==null&&(xa.status="fulfilled");var t=Po;Po=null,wa=0,xa=null;for(var r=0;r<t.length;r++)(0,t[r])()}}function cE(t,r){var a=[],l={status:"pending",value:null,reason:null,then:function(y){a.push(y)}};return t.then(function(){l.status="fulfilled",l.value=r;for(var y=0;y<a.length;y++)(0,a[y])(r)},function(y){for(l.status="rejected",l.reason=y,y=0;y<a.length;y++)(0,a[y])(void 0)}),l}var A_=z.S;z.S=function(t,r){h0=ut(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&lE(t,r),A_!==null&&A_(t,r)};var Ps=D(null);function od(){var t=Ps.current;return t!==null?t:Mt.pooledCache}function wc(t,r){r===null?Z(Ps,Ps.current):Z(Ps,r.pool)}function R_(){var t=od();return t===null?null:{parent:dn._currentValue,pool:t}}var Ca=Error(s(460)),ld=Error(s(474)),xc=Error(s(542)),Cc={then:function(){}};function L_(t){return t=t.status,t==="fulfilled"||t==="rejected"}function M_(t,r,a){switch(a=t[a],a===void 0?t.push(r):a!==r&&(r.then(xe,xe),r=a),r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,O_(t),t;default:if(typeof r.status=="string")r.then(xe,xe);else{if(t=Mt,t!==null&&100<t.shellSuspendCounter)throw Error(s(482));t=r,t.status="pending",t.then(function(l){if(r.status==="pending"){var y=r;y.status="fulfilled",y.value=l}},function(l){if(r.status==="pending"){var y=r;y.status="rejected",y.reason=l}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,O_(t),t}throw Hs=r,Ca}}function zs(t){try{var r=t._init;return r(t._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Hs=a,Ca):a}}var Hs=null;function N_(){if(Hs===null)throw Error(s(459));var t=Hs;return Hs=null,t}function O_(t){if(t===Ca||t===xc)throw Error(s(483))}var Ea=null,zo=0;function Ec(t){var r=zo;return zo+=1,Ea===null&&(Ea=[]),M_(Ea,t,r)}function Ho(t,r){r=r.props.ref,t.ref=r!==void 0?r:null}function kc(t,r){throw r.$$typeof===w?Error(s(525)):(t=Object.prototype.toString.call(r),Error(s(31,t==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":t)))}function D_(t){function r(re,ie){if(t){var le=re.deletions;le===null?(re.deletions=[ie],re.flags|=16):le.push(ie)}}function a(re,ie){if(!t)return null;for(;ie!==null;)r(re,ie),ie=ie.sibling;return null}function l(re){for(var ie=new Map;re!==null;)re.key!==null?ie.set(re.key,re):ie.set(re.index,re),re=re.sibling;return ie}function y(re,ie){return re=_r(re,ie),re.index=0,re.sibling=null,re}function C(re,ie,le){return re.index=le,t?(le=re.alternate,le!==null?(le=le.index,le<ie?(re.flags|=67108866,ie):le):(re.flags|=67108866,ie)):(re.flags|=1048576,ie)}function O(re){return t&&re.alternate===null&&(re.flags|=67108866),re}function U(re,ie,le,ge){return ie===null||ie.tag!==6?(ie=Xh(le,re.mode,ge),ie.return=re,ie):(ie=y(ie,le),ie.return=re,ie)}function ne(re,ie,le,ge){var Be=le.type;return Be===E?fe(re,ie,le.props.children,ge,le.key):ie!==null&&(ie.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===A&&zs(Be)===ie.type)?(ie=y(ie,le.props),Ho(ie,le),ie.return=re,ie):(ie=vc(le.type,le.key,le.props,null,re.mode,ge),Ho(ie,le),ie.return=re,ie)}function ce(re,ie,le,ge){return ie===null||ie.tag!==4||ie.stateNode.containerInfo!==le.containerInfo||ie.stateNode.implementation!==le.implementation?(ie=Zh(le,re.mode,ge),ie.return=re,ie):(ie=y(ie,le.children||[]),ie.return=re,ie)}function fe(re,ie,le,ge,Be){return ie===null||ie.tag!==7?(ie=Ds(le,re.mode,ge,Be),ie.return=re,ie):(ie=y(ie,le),ie.return=re,ie)}function me(re,ie,le){if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return ie=Xh(""+ie,re.mode,le),ie.return=re,ie;if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case x:return le=vc(ie.type,ie.key,ie.props,null,re.mode,le),Ho(le,ie),le.return=re,le;case T:return ie=Zh(ie,re.mode,le),ie.return=re,ie;case A:return ie=zs(ie),me(re,ie,le)}if(V(ie)||W(ie))return ie=Ds(ie,re.mode,le,null),ie.return=re,ie;if(typeof ie.then=="function")return me(re,Ec(ie),le);if(ie.$$typeof===S)return me(re,Sc(re,ie),le);kc(re,ie)}return null}function ue(re,ie,le,ge){var Be=ie!==null?ie.key:null;if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return Be!==null?null:U(re,ie,""+le,ge);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case x:return le.key===Be?ne(re,ie,le,ge):null;case T:return le.key===Be?ce(re,ie,le,ge):null;case A:return le=zs(le),ue(re,ie,le,ge)}if(V(le)||W(le))return Be!==null?null:fe(re,ie,le,ge,null);if(typeof le.then=="function")return ue(re,ie,Ec(le),ge);if(le.$$typeof===S)return ue(re,ie,Sc(re,le),ge);kc(re,le)}return null}function he(re,ie,le,ge,Be){if(typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint")return re=re.get(le)||null,U(ie,re,""+ge,Be);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case x:return re=re.get(ge.key===null?le:ge.key)||null,ne(ie,re,ge,Be);case T:return re=re.get(ge.key===null?le:ge.key)||null,ce(ie,re,ge,Be);case A:return ge=zs(ge),he(re,ie,le,ge,Be)}if(V(ge)||W(ge))return re=re.get(le)||null,fe(ie,re,ge,Be,null);if(typeof ge.then=="function")return he(re,ie,le,Ec(ge),Be);if(ge.$$typeof===S)return he(re,ie,le,Sc(ie,ge),Be);kc(ie,ge)}return null}function Te(re,ie,le,ge){for(var Be=null,pt=null,Re=ie,Ye=ie=0,st=null;Re!==null&&Ye<le.length;Ye++){Re.index>Ye?(st=Re,Re=null):st=Re.sibling;var gt=ue(re,Re,le[Ye],ge);if(gt===null){Re===null&&(Re=st);break}t&&Re&>.alternate===null&&r(re,Re),ie=C(gt,ie,Ye),pt===null?Be=gt:pt.sibling=gt,pt=gt,Re=st}if(Ye===le.length)return a(re,Re),lt&&vr(re,Ye),Be;if(Re===null){for(;Ye<le.length;Ye++)Re=me(re,le[Ye],ge),Re!==null&&(ie=C(Re,ie,Ye),pt===null?Be=Re:pt.sibling=Re,pt=Re);return lt&&vr(re,Ye),Be}for(Re=l(Re);Ye<le.length;Ye++)st=he(Re,re,Ye,le[Ye],ge),st!==null&&(t&&st.alternate!==null&&Re.delete(st.key===null?Ye:st.key),ie=C(st,ie,Ye),pt===null?Be=st:pt.sibling=st,pt=st);return t&&Re.forEach(function(ps){return r(re,ps)}),lt&&vr(re,Ye),Be}function He(re,ie,le,ge){if(le==null)throw Error(s(151));for(var Be=null,pt=null,Re=ie,Ye=ie=0,st=null,gt=le.next();Re!==null&&!gt.done;Ye++,gt=le.next()){Re.index>Ye?(st=Re,Re=null):st=Re.sibling;var ps=ue(re,Re,gt.value,ge);if(ps===null){Re===null&&(Re=st);break}t&&Re&&ps.alternate===null&&r(re,Re),ie=C(ps,ie,Ye),pt===null?Be=ps:pt.sibling=ps,pt=ps,Re=st}if(gt.done)return a(re,Re),lt&&vr(re,Ye),Be;if(Re===null){for(;!gt.done;Ye++,gt=le.next())gt=me(re,gt.value,ge),gt!==null&&(ie=C(gt,ie,Ye),pt===null?Be=gt:pt.sibling=gt,pt=gt);return lt&&vr(re,Ye),Be}for(Re=l(Re);!gt.done;Ye++,gt=le.next())gt=he(Re,re,Ye,gt.value,ge),gt!==null&&(t&>.alternate!==null&&Re.delete(gt.key===null?Ye:gt.key),ie=C(gt,ie,Ye),pt===null?Be=gt:pt.sibling=gt,pt=gt);return t&&Re.forEach(function(y5){return r(re,y5)}),lt&&vr(re,Ye),Be}function Tt(re,ie,le,ge){if(typeof le=="object"&&le!==null&&le.type===E&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case x:e:{for(var Be=le.key;ie!==null;){if(ie.key===Be){if(Be=le.type,Be===E){if(ie.tag===7){a(re,ie.sibling),ge=y(ie,le.props.children),ge.return=re,re=ge;break e}}else if(ie.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===A&&zs(Be)===ie.type){a(re,ie.sibling),ge=y(ie,le.props),Ho(ge,le),ge.return=re,re=ge;break e}a(re,ie);break}else r(re,ie);ie=ie.sibling}le.type===E?(ge=Ds(le.props.children,re.mode,ge,le.key),ge.return=re,re=ge):(ge=vc(le.type,le.key,le.props,null,re.mode,ge),Ho(ge,le),ge.return=re,re=ge)}return O(re);case T:e:{for(Be=le.key;ie!==null;){if(ie.key===Be)if(ie.tag===4&&ie.stateNode.containerInfo===le.containerInfo&&ie.stateNode.implementation===le.implementation){a(re,ie.sibling),ge=y(ie,le.children||[]),ge.return=re,re=ge;break e}else{a(re,ie);break}else r(re,ie);ie=ie.sibling}ge=Zh(le,re.mode,ge),ge.return=re,re=ge}return O(re);case A:return le=zs(le),Tt(re,ie,le,ge)}if(V(le))return Te(re,ie,le,ge);if(W(le)){if(Be=W(le),typeof Be!="function")throw Error(s(150));return le=Be.call(le),He(re,ie,le,ge)}if(typeof le.then=="function")return Tt(re,ie,Ec(le),ge);if(le.$$typeof===S)return Tt(re,ie,Sc(re,le),ge);kc(re,le)}return typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint"?(le=""+le,ie!==null&&ie.tag===6?(a(re,ie.sibling),ge=y(ie,le),ge.return=re,re=ge):(a(re,ie),ge=Xh(le,re.mode,ge),ge.return=re,re=ge),O(re)):a(re,ie)}return function(re,ie,le,ge){try{zo=0;var Be=Tt(re,ie,le,ge);return Ea=null,Be}catch(Re){if(Re===Ca||Re===xc)throw Re;var pt=pi(29,Re,null,re.mode);return pt.lanes=ge,pt.return=re,pt}}}var $s=D_(!0),j_=D_(!1),Zr=!1;function cd(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ud(t,r){t=t.updateQueue,r.updateQueue===t&&(r.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Jr(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Qr(t,r,a){var l=t.updateQueue;if(l===null)return null;if(l=l.shared,(_t&2)!==0){var y=l.pending;return y===null?r.next=r:(r.next=y.next,y.next=r),l.pending=r,r=_c(t),v_(t,null,a),r}return mc(t,l,r,a),_c(t)}function $o(t,r,a){if(r=r.updateQueue,r!==null&&(r=r.shared,(a&4194048)!==0)){var l=r.lanes;l&=t.pendingLanes,a|=l,r.lanes=a,Pe(t,a)}}function hd(t,r){var a=t.updateQueue,l=t.alternate;if(l!==null&&(l=l.updateQueue,a===l)){var y=null,C=null;if(a=a.firstBaseUpdate,a!==null){do{var O={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};C===null?y=C=O:C=C.next=O,a=a.next}while(a!==null);C===null?y=C=r:C=C.next=r}else y=C=r;a={baseState:l.baseState,firstBaseUpdate:y,lastBaseUpdate:C,shared:l.shared,callbacks:l.callbacks},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=r:t.next=r,a.lastBaseUpdate=r}var dd=!1;function Uo(){if(dd){var t=xa;if(t!==null)throw t}}function Fo(t,r,a,l){dd=!1;var y=t.updateQueue;Zr=!1;var C=y.firstBaseUpdate,O=y.lastBaseUpdate,U=y.shared.pending;if(U!==null){y.shared.pending=null;var ne=U,ce=ne.next;ne.next=null,O===null?C=ce:O.next=ce,O=ne;var fe=t.alternate;fe!==null&&(fe=fe.updateQueue,U=fe.lastBaseUpdate,U!==O&&(U===null?fe.firstBaseUpdate=ce:U.next=ce,fe.lastBaseUpdate=ne))}if(C!==null){var me=y.baseState;O=0,fe=ce=ne=null,U=C;do{var ue=U.lane&-536870913,he=ue!==U.lane;if(he?(rt&ue)===ue:(l&ue)===ue){ue!==0&&ue===wa&&(dd=!0),fe!==null&&(fe=fe.next={lane:0,tag:U.tag,payload:U.payload,callback:null,next:null});e:{var Te=t,He=U;ue=r;var Tt=a;switch(He.tag){case 1:if(Te=He.payload,typeof Te=="function"){me=Te.call(Tt,me,ue);break e}me=Te;break e;case 3:Te.flags=Te.flags&-65537|128;case 0:if(Te=He.payload,ue=typeof Te=="function"?Te.call(Tt,me,ue):Te,ue==null)break e;me=m({},me,ue);break e;case 2:Zr=!0}}ue=U.callback,ue!==null&&(t.flags|=64,he&&(t.flags|=8192),he=y.callbacks,he===null?y.callbacks=[ue]:he.push(ue))}else he={lane:ue,tag:U.tag,payload:U.payload,callback:U.callback,next:null},fe===null?(ce=fe=he,ne=me):fe=fe.next=he,O|=ue;if(U=U.next,U===null){if(U=y.shared.pending,U===null)break;he=U,U=he.next,he.next=null,y.lastBaseUpdate=he,y.shared.pending=null}}while(!0);fe===null&&(ne=me),y.baseState=ne,y.firstBaseUpdate=ce,y.lastBaseUpdate=fe,C===null&&(y.shared.lanes=0),rs|=O,t.lanes=O,t.memoizedState=me}}function I_(t,r){if(typeof t!="function")throw Error(s(191,t));t.call(r)}function B_(t,r){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;t<a.length;t++)I_(a[t],r)}var ka=D(null),Tc=D(0);function P_(t,r){t=Rr,Z(Tc,t),Z(ka,r),Rr=t|r.baseLanes}function fd(){Z(Tc,Rr),Z(ka,ka.current)}function pd(){Rr=Tc.current,P(ka),P(Tc)}var gi=D(null),Oi=null;function es(t){var r=t.alternate;Z(cn,cn.current&1),Z(gi,t),Oi===null&&(r===null||ka.current!==null||r.memoizedState!==null)&&(Oi=t)}function gd(t){Z(cn,cn.current),Z(gi,t),Oi===null&&(Oi=t)}function z_(t){t.tag===22?(Z(cn,cn.current),Z(gi,t),Oi===null&&(Oi=t)):ts()}function ts(){Z(cn,cn.current),Z(gi,gi.current)}function mi(t){P(gi),Oi===t&&(Oi=null),P(cn)}var cn=D(0);function Ac(t){for(var r=t;r!==null;){if(r.tag===13){var a=r.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||wf(a)||xf(a)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var Sr=0,qe=null,Et=null,fn=null,Rc=!1,Ta=!1,Us=!1,Lc=0,Wo=0,Aa=null,uE=0;function en(){throw Error(s(321))}function md(t,r){if(r===null)return!1;for(var a=0;a<r.length&&a<t.length;a++)if(!fi(t[a],r[a]))return!1;return!0}function _d(t,r,a,l,y,C){return Sr=C,qe=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,z.H=t===null||t.memoizedState===null?wv:Nd,Us=!1,C=a(l,y),Us=!1,Ta&&(C=$_(r,a,l,y)),H_(t),C}function H_(t){z.H=Ko;var r=Et!==null&&Et.next!==null;if(Sr=0,fn=Et=qe=null,Rc=!1,Wo=0,Aa=null,r)throw Error(s(300));t===null||pn||(t=t.dependencies,t!==null&&yc(t)&&(pn=!0))}function $_(t,r,a,l){qe=t;var y=0;do{if(Ta&&(Aa=null),Wo=0,Ta=!1,25<=y)throw Error(s(301));if(y+=1,fn=Et=null,t.updateQueue!=null){var C=t.updateQueue;C.lastEffect=null,C.events=null,C.stores=null,C.memoCache!=null&&(C.memoCache.index=0)}z.H=xv,C=r(a,l)}while(Ta);return C}function hE(){var t=z.H,r=t.useState()[0];return r=typeof r.then=="function"?Go(r):r,t=t.useState()[0],(Et!==null?Et.memoizedState:null)!==t&&(qe.flags|=1024),r}function vd(){var t=Lc!==0;return Lc=0,t}function bd(t,r,a){r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~a}function yd(t){if(Rc){for(t=t.memoizedState;t!==null;){var r=t.queue;r!==null&&(r.pending=null),t=t.next}Rc=!1}Sr=0,fn=Et=qe=null,Ta=!1,Wo=Lc=0,Aa=null}function Fn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return fn===null?qe.memoizedState=fn=t:fn=fn.next=t,fn}function un(){if(Et===null){var t=qe.alternate;t=t!==null?t.memoizedState:null}else t=Et.next;var r=fn===null?qe.memoizedState:fn.next;if(r!==null)fn=r,Et=t;else{if(t===null)throw qe.alternate===null?Error(s(467)):Error(s(310));Et=t,t={memoizedState:Et.memoizedState,baseState:Et.baseState,baseQueue:Et.baseQueue,queue:Et.queue,next:null},fn===null?qe.memoizedState=fn=t:fn=fn.next=t}return fn}function Mc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Go(t){var r=Wo;return Wo+=1,Aa===null&&(Aa=[]),t=M_(Aa,t,r),r=qe,(fn===null?r.memoizedState:fn.next)===null&&(r=r.alternate,z.H=r===null||r.memoizedState===null?wv:Nd),t}function Nc(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Go(t);if(t.$$typeof===S)return Nn(t)}throw Error(s(438,String(t)))}function Sd(t){var r=null,a=qe.updateQueue;if(a!==null&&(r=a.memoCache),r==null){var l=qe.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(r={data:l.data.map(function(y){return y.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),a===null&&(a=Mc(),qe.updateQueue=a),a.memoCache=r,a=r.data[r.index],a===void 0)for(a=r.data[r.index]=Array(t),l=0;l<t;l++)a[l]=q;return r.index++,a}function wr(t,r){return typeof r=="function"?r(t):r}function Oc(t){var r=un();return wd(r,Et,t)}function wd(t,r,a){var l=t.queue;if(l===null)throw Error(s(311));l.lastRenderedReducer=a;var y=t.baseQueue,C=l.pending;if(C!==null){if(y!==null){var O=y.next;y.next=C.next,C.next=O}r.baseQueue=y=C,l.pending=null}if(C=t.baseState,y===null)t.memoizedState=C;else{r=y.next;var U=O=null,ne=null,ce=r,fe=!1;do{var me=ce.lane&-536870913;if(me!==ce.lane?(rt&me)===me:(Sr&me)===me){var ue=ce.revertLane;if(ue===0)ne!==null&&(ne=ne.next={lane:0,revertLane:0,gesture:null,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null}),me===wa&&(fe=!0);else if((Sr&ue)===ue){ce=ce.next,ue===wa&&(fe=!0);continue}else me={lane:0,revertLane:ce.revertLane,gesture:null,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null},ne===null?(U=ne=me,O=C):ne=ne.next=me,qe.lanes|=ue,rs|=ue;me=ce.action,Us&&a(C,me),C=ce.hasEagerState?ce.eagerState:a(C,me)}else ue={lane:me,revertLane:ce.revertLane,gesture:ce.gesture,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null},ne===null?(U=ne=ue,O=C):ne=ne.next=ue,qe.lanes|=me,rs|=me;ce=ce.next}while(ce!==null&&ce!==r);if(ne===null?O=C:ne.next=U,!fi(C,t.memoizedState)&&(pn=!0,fe&&(a=xa,a!==null)))throw a;t.memoizedState=C,t.baseState=O,t.baseQueue=ne,l.lastRenderedState=C}return y===null&&(l.lanes=0),[t.memoizedState,l.dispatch]}function xd(t){var r=un(),a=r.queue;if(a===null)throw Error(s(311));a.lastRenderedReducer=t;var l=a.dispatch,y=a.pending,C=r.memoizedState;if(y!==null){a.pending=null;var O=y=y.next;do C=t(C,O.action),O=O.next;while(O!==y);fi(C,r.memoizedState)||(pn=!0),r.memoizedState=C,r.baseQueue===null&&(r.baseState=C),a.lastRenderedState=C}return[C,l]}function U_(t,r,a){var l=qe,y=un(),C=lt;if(C){if(a===void 0)throw Error(s(407));a=a()}else a=r();var O=!fi((Et||y).memoizedState,a);if(O&&(y.memoizedState=a,pn=!0),y=y.queue,kd(G_.bind(null,l,y,t),[t]),y.getSnapshot!==r||O||fn!==null&&fn.memoizedState.tag&1){if(l.flags|=2048,Ra(9,{destroy:void 0},W_.bind(null,l,y,a,r),null),Mt===null)throw Error(s(349));C||(Sr&127)!==0||F_(l,r,a)}return a}function F_(t,r,a){t.flags|=16384,t={getSnapshot:r,value:a},r=qe.updateQueue,r===null?(r=Mc(),qe.updateQueue=r,r.stores=[t]):(a=r.stores,a===null?r.stores=[t]:a.push(t))}function W_(t,r,a,l){r.value=a,r.getSnapshot=l,q_(r)&&K_(t)}function G_(t,r,a){return a(function(){q_(r)&&K_(t)})}function q_(t){var r=t.getSnapshot;t=t.value;try{var a=r();return!fi(t,a)}catch{return!0}}function K_(t){var r=Os(t,2);r!==null&&oi(r,t,2)}function Cd(t){var r=Fn();if(typeof t=="function"){var a=t;if(t=a(),Us){$e(!0);try{a()}finally{$e(!1)}}}return r.memoizedState=r.baseState=t,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:wr,lastRenderedState:t},r}function V_(t,r,a,l){return t.baseState=a,wd(t,Et,typeof l=="function"?l:wr)}function dE(t,r,a,l,y){if(Ic(t))throw Error(s(485));if(t=r.action,t!==null){var C={payload:y,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(O){C.listeners.push(O)}};z.T!==null?a(!0):C.isTransition=!1,l(C),a=r.pending,a===null?(C.next=r.pending=C,Y_(r,C)):(C.next=a.next,r.pending=a.next=C)}}function Y_(t,r){var a=r.action,l=r.payload,y=t.state;if(r.isTransition){var C=z.T,O={};z.T=O;try{var U=a(y,l),ne=z.S;ne!==null&&ne(O,U),X_(t,r,U)}catch(ce){Ed(t,r,ce)}finally{C!==null&&O.types!==null&&(C.types=O.types),z.T=C}}else try{C=a(y,l),X_(t,r,C)}catch(ce){Ed(t,r,ce)}}function X_(t,r,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(l){Z_(t,r,l)},function(l){return Ed(t,r,l)}):Z_(t,r,a)}function Z_(t,r,a){r.status="fulfilled",r.value=a,J_(r),t.state=a,r=t.pending,r!==null&&(a=r.next,a===r?t.pending=null:(a=a.next,r.next=a,Y_(t,a)))}function Ed(t,r,a){var l=t.pending;if(t.pending=null,l!==null){l=l.next;do r.status="rejected",r.reason=a,J_(r),r=r.next;while(r!==l)}t.action=null}function J_(t){t=t.listeners;for(var r=0;r<t.length;r++)(0,t[r])()}function Q_(t,r){return r}function ev(t,r){if(lt){var a=Mt.formState;if(a!==null){e:{var l=qe;if(lt){if(Pt){t:{for(var y=Pt,C=Ni;y.nodeType!==8;){if(!C){y=null;break t}if(y=Di(y.nextSibling),y===null){y=null;break t}}C=y.data,y=C==="F!"||C==="F"?y:null}if(y){Pt=Di(y.nextSibling),l=y.data==="F!";break e}}Yr(l)}l=!1}l&&(r=a[0])}}return a=Fn(),a.memoizedState=a.baseState=r,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Q_,lastRenderedState:r},a.queue=l,a=bv.bind(null,qe,l),l.dispatch=a,l=Cd(!1),C=Md.bind(null,qe,!1,l.queue),l=Fn(),y={state:r,dispatch:null,action:t,pending:null},l.queue=y,a=dE.bind(null,qe,y,C,a),y.dispatch=a,l.memoizedState=t,[r,a,!1]}function tv(t){var r=un();return nv(r,Et,t)}function nv(t,r,a){if(r=wd(t,r,Q_)[0],t=Oc(wr)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var l=Go(r)}catch(O){throw O===Ca?xc:O}else l=r;r=un();var y=r.queue,C=y.dispatch;return a!==r.memoizedState&&(qe.flags|=2048,Ra(9,{destroy:void 0},fE.bind(null,y,a),null)),[l,C,t]}function fE(t,r){t.action=r}function iv(t){var r=un(),a=Et;if(a!==null)return nv(r,a,t);un(),r=r.memoizedState,a=un();var l=a.queue.dispatch;return a.memoizedState=t,[r,l,!1]}function Ra(t,r,a,l){return t={tag:t,create:a,deps:l,inst:r,next:null},r=qe.updateQueue,r===null&&(r=Mc(),qe.updateQueue=r),a=r.lastEffect,a===null?r.lastEffect=t.next=t:(l=a.next,a.next=t,t.next=l,r.lastEffect=t),t}function rv(){return un().memoizedState}function Dc(t,r,a,l){var y=Fn();qe.flags|=t,y.memoizedState=Ra(1|r,{destroy:void 0},a,l===void 0?null:l)}function jc(t,r,a,l){var y=un();l=l===void 0?null:l;var C=y.memoizedState.inst;Et!==null&&l!==null&&md(l,Et.memoizedState.deps)?y.memoizedState=Ra(r,C,a,l):(qe.flags|=t,y.memoizedState=Ra(1|r,C,a,l))}function sv(t,r){Dc(8390656,8,t,r)}function kd(t,r){jc(2048,8,t,r)}function pE(t){qe.flags|=4;var r=qe.updateQueue;if(r===null)r=Mc(),qe.updateQueue=r,r.events=[t];else{var a=r.events;a===null?r.events=[t]:a.push(t)}}function av(t){var r=un().memoizedState;return pE({ref:r,nextImpl:t}),function(){if((_t&2)!==0)throw Error(s(440));return r.impl.apply(void 0,arguments)}}function ov(t,r){return jc(4,2,t,r)}function lv(t,r){return jc(4,4,t,r)}function cv(t,r){if(typeof r=="function"){t=t();var a=r(t);return function(){typeof a=="function"?a():r(null)}}if(r!=null)return t=t(),r.current=t,function(){r.current=null}}function uv(t,r,a){a=a!=null?a.concat([t]):null,jc(4,4,cv.bind(null,r,t),a)}function Td(){}function hv(t,r){var a=un();r=r===void 0?null:r;var l=a.memoizedState;return r!==null&&md(r,l[1])?l[0]:(a.memoizedState=[t,r],t)}function dv(t,r){var a=un();r=r===void 0?null:r;var l=a.memoizedState;if(r!==null&&md(r,l[1]))return l[0];if(l=t(),Us){$e(!0);try{t()}finally{$e(!1)}}return a.memoizedState=[l,r],l}function Ad(t,r,a){return a===void 0||(Sr&1073741824)!==0&&(rt&261930)===0?t.memoizedState=r:(t.memoizedState=a,t=f0(),qe.lanes|=t,rs|=t,a)}function fv(t,r,a,l){return fi(a,r)?a:ka.current!==null?(t=Ad(t,a,l),fi(t,r)||(pn=!0),t):(Sr&42)===0||(Sr&1073741824)!==0&&(rt&261930)===0?(pn=!0,t.memoizedState=a):(t=f0(),qe.lanes|=t,rs|=t,r)}function pv(t,r,a,l,y){var C=G.p;G.p=C!==0&&8>C?C:8;var O=z.T,U={};z.T=U,Md(t,!1,r,a);try{var ne=y(),ce=z.S;if(ce!==null&&ce(U,ne),ne!==null&&typeof ne=="object"&&typeof ne.then=="function"){var fe=cE(ne,l);qo(t,r,fe,bi(t))}else qo(t,r,l,bi(t))}catch(me){qo(t,r,{then:function(){},status:"rejected",reason:me},bi())}finally{G.p=C,O!==null&&U.types!==null&&(O.types=U.types),z.T=O}}function gE(){}function Rd(t,r,a,l){if(t.tag!==5)throw Error(s(476));var y=gv(t).queue;pv(t,y,r,K,a===null?gE:function(){return mv(t),a(l)})}function gv(t){var r=t.memoizedState;if(r!==null)return r;r={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:wr,lastRenderedState:K},next:null};var a={};return r.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:wr,lastRenderedState:a},next:null},t.memoizedState=r,t=t.alternate,t!==null&&(t.memoizedState=r),r}function mv(t){var r=gv(t);r.next===null&&(r=t.alternate.memoizedState),qo(t,r.next.queue,{},bi())}function Ld(){return Nn(cl)}function _v(){return un().memoizedState}function vv(){return un().memoizedState}function mE(t){for(var r=t.return;r!==null;){switch(r.tag){case 24:case 3:var a=bi();t=Jr(a);var l=Qr(r,t,a);l!==null&&(oi(l,r,a),$o(l,r,a)),r={cache:sd()},t.payload=r;return}r=r.return}}function _E(t,r,a){var l=bi();a={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Ic(t)?yv(r,a):(a=Vh(t,r,a,l),a!==null&&(oi(a,t,l),Sv(a,r,l)))}function bv(t,r,a){var l=bi();qo(t,r,a,l)}function qo(t,r,a,l){var y={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Ic(t))yv(r,y);else{var C=t.alternate;if(t.lanes===0&&(C===null||C.lanes===0)&&(C=r.lastRenderedReducer,C!==null))try{var O=r.lastRenderedState,U=C(O,a);if(y.hasEagerState=!0,y.eagerState=U,fi(U,O))return mc(t,r,y,0),Mt===null&&gc(),!1}catch{}if(a=Vh(t,r,y,l),a!==null)return oi(a,t,l),Sv(a,r,l),!0}return!1}function Md(t,r,a,l){if(l={lane:2,revertLane:uf(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Ic(t)){if(r)throw Error(s(479))}else r=Vh(t,a,l,2),r!==null&&oi(r,t,2)}function Ic(t){var r=t.alternate;return t===qe||r!==null&&r===qe}function yv(t,r){Ta=Rc=!0;var a=t.pending;a===null?r.next=r:(r.next=a.next,a.next=r),t.pending=r}function Sv(t,r,a){if((a&4194048)!==0){var l=r.lanes;l&=t.pendingLanes,a|=l,r.lanes=a,Pe(t,a)}}var Ko={readContext:Nn,use:Nc,useCallback:en,useContext:en,useEffect:en,useImperativeHandle:en,useLayoutEffect:en,useInsertionEffect:en,useMemo:en,useReducer:en,useRef:en,useState:en,useDebugValue:en,useDeferredValue:en,useTransition:en,useSyncExternalStore:en,useId:en,useHostTransitionStatus:en,useFormState:en,useActionState:en,useOptimistic:en,useMemoCache:en,useCacheRefresh:en};Ko.useEffectEvent=en;var wv={readContext:Nn,use:Nc,useCallback:function(t,r){return Fn().memoizedState=[t,r===void 0?null:r],t},useContext:Nn,useEffect:sv,useImperativeHandle:function(t,r,a){a=a!=null?a.concat([t]):null,Dc(4194308,4,cv.bind(null,r,t),a)},useLayoutEffect:function(t,r){return Dc(4194308,4,t,r)},useInsertionEffect:function(t,r){Dc(4,2,t,r)},useMemo:function(t,r){var a=Fn();r=r===void 0?null:r;var l=t();if(Us){$e(!0);try{t()}finally{$e(!1)}}return a.memoizedState=[l,r],l},useReducer:function(t,r,a){var l=Fn();if(a!==void 0){var y=a(r);if(Us){$e(!0);try{a(r)}finally{$e(!1)}}}else y=r;return l.memoizedState=l.baseState=y,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:y},l.queue=t,t=t.dispatch=_E.bind(null,qe,t),[l.memoizedState,t]},useRef:function(t){var r=Fn();return t={current:t},r.memoizedState=t},useState:function(t){t=Cd(t);var r=t.queue,a=bv.bind(null,qe,r);return r.dispatch=a,[t.memoizedState,a]},useDebugValue:Td,useDeferredValue:function(t,r){var a=Fn();return Ad(a,t,r)},useTransition:function(){var t=Cd(!1);return t=pv.bind(null,qe,t.queue,!0,!1),Fn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,r,a){var l=qe,y=Fn();if(lt){if(a===void 0)throw Error(s(407));a=a()}else{if(a=r(),Mt===null)throw Error(s(349));(rt&127)!==0||F_(l,r,a)}y.memoizedState=a;var C={value:a,getSnapshot:r};return y.queue=C,sv(G_.bind(null,l,C,t),[t]),l.flags|=2048,Ra(9,{destroy:void 0},W_.bind(null,l,C,a,r),null),a},useId:function(){var t=Fn(),r=Mt.identifierPrefix;if(lt){var a=nr,l=tr;a=(l&~(1<<32-Je(l)-1)).toString(32)+a,r="_"+r+"R_"+a,a=Lc++,0<a&&(r+="H"+a.toString(32)),r+="_"}else a=uE++,r="_"+r+"r_"+a.toString(32)+"_";return t.memoizedState=r},useHostTransitionStatus:Ld,useFormState:ev,useActionState:ev,useOptimistic:function(t){var r=Fn();r.memoizedState=r.baseState=t;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=a,r=Md.bind(null,qe,!0,a),a.dispatch=r,[t,r]},useMemoCache:Sd,useCacheRefresh:function(){return Fn().memoizedState=mE.bind(null,qe)},useEffectEvent:function(t){var r=Fn(),a={impl:t};return r.memoizedState=a,function(){if((_t&2)!==0)throw Error(s(440));return a.impl.apply(void 0,arguments)}}},Nd={readContext:Nn,use:Nc,useCallback:hv,useContext:Nn,useEffect:kd,useImperativeHandle:uv,useInsertionEffect:ov,useLayoutEffect:lv,useMemo:dv,useReducer:Oc,useRef:rv,useState:function(){return Oc(wr)},useDebugValue:Td,useDeferredValue:function(t,r){var a=un();return fv(a,Et.memoizedState,t,r)},useTransition:function(){var t=Oc(wr)[0],r=un().memoizedState;return[typeof t=="boolean"?t:Go(t),r]},useSyncExternalStore:U_,useId:_v,useHostTransitionStatus:Ld,useFormState:tv,useActionState:tv,useOptimistic:function(t,r){var a=un();return V_(a,Et,t,r)},useMemoCache:Sd,useCacheRefresh:vv};Nd.useEffectEvent=av;var xv={readContext:Nn,use:Nc,useCallback:hv,useContext:Nn,useEffect:kd,useImperativeHandle:uv,useInsertionEffect:ov,useLayoutEffect:lv,useMemo:dv,useReducer:xd,useRef:rv,useState:function(){return xd(wr)},useDebugValue:Td,useDeferredValue:function(t,r){var a=un();return Et===null?Ad(a,t,r):fv(a,Et.memoizedState,t,r)},useTransition:function(){var t=xd(wr)[0],r=un().memoizedState;return[typeof t=="boolean"?t:Go(t),r]},useSyncExternalStore:U_,useId:_v,useHostTransitionStatus:Ld,useFormState:iv,useActionState:iv,useOptimistic:function(t,r){var a=un();return Et!==null?V_(a,Et,t,r):(a.baseState=t,[t,a.queue.dispatch])},useMemoCache:Sd,useCacheRefresh:vv};xv.useEffectEvent=av;function Od(t,r,a,l){r=t.memoizedState,a=a(l,r),a=a==null?r:m({},r,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var Dd={enqueueSetState:function(t,r,a){t=t._reactInternals;var l=bi(),y=Jr(l);y.payload=r,a!=null&&(y.callback=a),r=Qr(t,y,l),r!==null&&(oi(r,t,l),$o(r,t,l))},enqueueReplaceState:function(t,r,a){t=t._reactInternals;var l=bi(),y=Jr(l);y.tag=1,y.payload=r,a!=null&&(y.callback=a),r=Qr(t,y,l),r!==null&&(oi(r,t,l),$o(r,t,l))},enqueueForceUpdate:function(t,r){t=t._reactInternals;var a=bi(),l=Jr(a);l.tag=2,r!=null&&(l.callback=r),r=Qr(t,l,a),r!==null&&(oi(r,t,a),$o(r,t,a))}};function Cv(t,r,a,l,y,C,O){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(l,C,O):r.prototype&&r.prototype.isPureReactComponent?!Oo(a,l)||!Oo(y,C):!0}function Ev(t,r,a,l){t=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(a,l),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(a,l),r.state!==t&&Dd.enqueueReplaceState(r,r.state,null)}function Fs(t,r){var a=r;if("ref"in r){a={};for(var l in r)l!=="ref"&&(a[l]=r[l])}if(t=t.defaultProps){a===r&&(a=m({},a));for(var y in t)a[y]===void 0&&(a[y]=t[y])}return a}function kv(t){pc(t)}function Tv(t){console.error(t)}function Av(t){pc(t)}function Bc(t,r){try{var a=t.onUncaughtError;a(r.value,{componentStack:r.stack})}catch(l){setTimeout(function(){throw l})}}function Rv(t,r,a){try{var l=t.onCaughtError;l(a.value,{componentStack:a.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function jd(t,r,a){return a=Jr(a),a.tag=3,a.payload={element:null},a.callback=function(){Bc(t,r)},a}function Lv(t){return t=Jr(t),t.tag=3,t}function Mv(t,r,a,l){var y=a.type.getDerivedStateFromError;if(typeof y=="function"){var C=l.value;t.payload=function(){return y(C)},t.callback=function(){Rv(r,a,l)}}var O=a.stateNode;O!==null&&typeof O.componentDidCatch=="function"&&(t.callback=function(){Rv(r,a,l),typeof y!="function"&&(ss===null?ss=new Set([this]):ss.add(this));var U=l.stack;this.componentDidCatch(l.value,{componentStack:U!==null?U:""})})}function vE(t,r,a,l,y){if(a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(r=a.alternate,r!==null&&Sa(r,a,y,!0),a=gi.current,a!==null){switch(a.tag){case 31:case 13:return Oi===null?Yc():a.alternate===null&&tn===0&&(tn=3),a.flags&=-257,a.flags|=65536,a.lanes=y,l===Cc?a.flags|=16384:(r=a.updateQueue,r===null?a.updateQueue=new Set([l]):r.add(l),of(t,l,y)),!1;case 22:return a.flags|=65536,l===Cc?a.flags|=16384:(r=a.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([l])},a.updateQueue=r):(a=r.retryQueue,a===null?r.retryQueue=new Set([l]):a.add(l)),of(t,l,y)),!1}throw Error(s(435,a.tag))}return of(t,l,y),Yc(),!1}if(lt)return r=gi.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=y,l!==ed&&(t=Error(s(422),{cause:l}),Io(Ri(t,a)))):(l!==ed&&(r=Error(s(423),{cause:l}),Io(Ri(r,a))),t=t.current.alternate,t.flags|=65536,y&=-y,t.lanes|=y,l=Ri(l,a),y=jd(t.stateNode,l,y),hd(t,y),tn!==4&&(tn=2)),!1;var C=Error(s(520),{cause:l});if(C=Ri(C,a),tl===null?tl=[C]:tl.push(C),tn!==4&&(tn=2),r===null)return!0;l=Ri(l,a),a=r;do{switch(a.tag){case 3:return a.flags|=65536,t=y&-y,a.lanes|=t,t=jd(a.stateNode,l,t),hd(a,t),!1;case 1:if(r=a.type,C=a.stateNode,(a.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||C!==null&&typeof C.componentDidCatch=="function"&&(ss===null||!ss.has(C))))return a.flags|=65536,y&=-y,a.lanes|=y,y=Lv(y),Mv(y,t,a,l),hd(a,y),!1}a=a.return}while(a!==null);return!1}var Id=Error(s(461)),pn=!1;function On(t,r,a,l){r.child=t===null?j_(r,null,a,l):$s(r,t.child,a,l)}function Nv(t,r,a,l,y){a=a.render;var C=r.ref;if("ref"in l){var O={};for(var U in l)U!=="ref"&&(O[U]=l[U])}else O=l;return Bs(r),l=_d(t,r,a,O,C,y),U=vd(),t!==null&&!pn?(bd(t,r,y),xr(t,r,y)):(lt&&U&&Jh(r),r.flags|=1,On(t,r,l,y),r.child)}function Ov(t,r,a,l,y){if(t===null){var C=a.type;return typeof C=="function"&&!Yh(C)&&C.defaultProps===void 0&&a.compare===null?(r.tag=15,r.type=C,Dv(t,r,C,l,y)):(t=vc(a.type,null,l,r,r.mode,y),t.ref=r.ref,t.return=r,r.child=t)}if(C=t.child,!Wd(t,y)){var O=C.memoizedProps;if(a=a.compare,a=a!==null?a:Oo,a(O,l)&&t.ref===r.ref)return xr(t,r,y)}return r.flags|=1,t=_r(C,l),t.ref=r.ref,t.return=r,r.child=t}function Dv(t,r,a,l,y){if(t!==null){var C=t.memoizedProps;if(Oo(C,l)&&t.ref===r.ref)if(pn=!1,r.pendingProps=l=C,Wd(t,y))(t.flags&131072)!==0&&(pn=!0);else return r.lanes=t.lanes,xr(t,r,y)}return Bd(t,r,a,l,y)}function jv(t,r,a,l){var y=l.children,C=t!==null?t.memoizedState:null;if(t===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((r.flags&128)!==0){if(C=C!==null?C.baseLanes|a:a,t!==null){for(l=r.child=t.child,y=0;l!==null;)y=y|l.lanes|l.childLanes,l=l.sibling;l=y&~C}else l=0,r.child=null;return Iv(t,r,C,a,l)}if((a&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},t!==null&&wc(r,C!==null?C.cachePool:null),C!==null?P_(r,C):fd(),z_(r);else return l=r.lanes=536870912,Iv(t,r,C!==null?C.baseLanes|a:a,a,l)}else C!==null?(wc(r,C.cachePool),P_(r,C),ts(),r.memoizedState=null):(t!==null&&wc(r,null),fd(),ts());return On(t,r,y,a),r.child}function Vo(t,r){return t!==null&&t.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function Iv(t,r,a,l,y){var C=od();return C=C===null?null:{parent:dn._currentValue,pool:C},r.memoizedState={baseLanes:a,cachePool:C},t!==null&&wc(r,null),fd(),z_(r),t!==null&&Sa(t,r,l,!0),r.childLanes=y,null}function Pc(t,r){return r=Hc({mode:r.mode,children:r.children},t.mode),r.ref=t.ref,t.child=r,r.return=t,r}function Bv(t,r,a){return $s(r,t.child,null,a),t=Pc(r,r.pendingProps),t.flags|=2,mi(r),r.memoizedState=null,t}function bE(t,r,a){var l=r.pendingProps,y=(r.flags&128)!==0;if(r.flags&=-129,t===null){if(lt){if(l.mode==="hidden")return t=Pc(r,l),r.lanes=536870912,Vo(null,t);if(gd(r),(t=Pt)?(t=Y0(t,Ni),t=t!==null&&t.data==="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:Kr!==null?{id:tr,overflow:nr}:null,retryLane:536870912,hydrationErrors:null},a=y_(t),a.return=r,r.child=a,Mn=r,Pt=null)):t=null,t===null)throw Yr(r);return r.lanes=536870912,null}return Pc(r,l)}var C=t.memoizedState;if(C!==null){var O=C.dehydrated;if(gd(r),y)if(r.flags&256)r.flags&=-257,r=Bv(t,r,a);else if(r.memoizedState!==null)r.child=t.child,r.flags|=128,r=null;else throw Error(s(558));else if(pn||Sa(t,r,a,!1),y=(a&t.childLanes)!==0,pn||y){if(l=Mt,l!==null&&(O=Vt(l,a),O!==0&&O!==C.retryLane))throw C.retryLane=O,Os(t,O),oi(l,t,O),Id;Yc(),r=Bv(t,r,a)}else t=C.treeContext,Pt=Di(O.nextSibling),Mn=r,lt=!0,Vr=null,Ni=!1,t!==null&&x_(r,t),r=Pc(r,l),r.flags|=4096;return r}return t=_r(t.child,{mode:l.mode,children:l.children}),t.ref=r.ref,r.child=t,t.return=r,t}function zc(t,r){var a=r.ref;if(a===null)t!==null&&t.ref!==null&&(r.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(s(284));(t===null||t.ref!==a)&&(r.flags|=4194816)}}function Bd(t,r,a,l,y){return Bs(r),a=_d(t,r,a,l,void 0,y),l=vd(),t!==null&&!pn?(bd(t,r,y),xr(t,r,y)):(lt&&l&&Jh(r),r.flags|=1,On(t,r,a,y),r.child)}function Pv(t,r,a,l,y,C){return Bs(r),r.updateQueue=null,a=$_(r,l,a,y),H_(t),l=vd(),t!==null&&!pn?(bd(t,r,C),xr(t,r,C)):(lt&&l&&Jh(r),r.flags|=1,On(t,r,a,C),r.child)}function zv(t,r,a,l,y){if(Bs(r),r.stateNode===null){var C=_a,O=a.contextType;typeof O=="object"&&O!==null&&(C=Nn(O)),C=new a(l,C),r.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,C.updater=Dd,r.stateNode=C,C._reactInternals=r,C=r.stateNode,C.props=l,C.state=r.memoizedState,C.refs={},cd(r),O=a.contextType,C.context=typeof O=="object"&&O!==null?Nn(O):_a,C.state=r.memoizedState,O=a.getDerivedStateFromProps,typeof O=="function"&&(Od(r,a,O,l),C.state=r.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof C.getSnapshotBeforeUpdate=="function"||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(O=C.state,typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount(),O!==C.state&&Dd.enqueueReplaceState(C,C.state,null),Fo(r,l,C,y),Uo(),C.state=r.memoizedState),typeof C.componentDidMount=="function"&&(r.flags|=4194308),l=!0}else if(t===null){C=r.stateNode;var U=r.memoizedProps,ne=Fs(a,U);C.props=ne;var ce=C.context,fe=a.contextType;O=_a,typeof fe=="object"&&fe!==null&&(O=Nn(fe));var me=a.getDerivedStateFromProps;fe=typeof me=="function"||typeof C.getSnapshotBeforeUpdate=="function",U=r.pendingProps!==U,fe||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(U||ce!==O)&&Ev(r,C,l,O),Zr=!1;var ue=r.memoizedState;C.state=ue,Fo(r,l,C,y),Uo(),ce=r.memoizedState,U||ue!==ce||Zr?(typeof me=="function"&&(Od(r,a,me,l),ce=r.memoizedState),(ne=Zr||Cv(r,a,ne,l,ue,ce,O))?(fe||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount()),typeof C.componentDidMount=="function"&&(r.flags|=4194308)):(typeof C.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=l,r.memoizedState=ce),C.props=l,C.state=ce,C.context=O,l=ne):(typeof C.componentDidMount=="function"&&(r.flags|=4194308),l=!1)}else{C=r.stateNode,ud(t,r),O=r.memoizedProps,fe=Fs(a,O),C.props=fe,me=r.pendingProps,ue=C.context,ce=a.contextType,ne=_a,typeof ce=="object"&&ce!==null&&(ne=Nn(ce)),U=a.getDerivedStateFromProps,(ce=typeof U=="function"||typeof C.getSnapshotBeforeUpdate=="function")||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(O!==me||ue!==ne)&&Ev(r,C,l,ne),Zr=!1,ue=r.memoizedState,C.state=ue,Fo(r,l,C,y),Uo();var he=r.memoizedState;O!==me||ue!==he||Zr||t!==null&&t.dependencies!==null&&yc(t.dependencies)?(typeof U=="function"&&(Od(r,a,U,l),he=r.memoizedState),(fe=Zr||Cv(r,a,fe,l,ue,he,ne)||t!==null&&t.dependencies!==null&&yc(t.dependencies))?(ce||typeof C.UNSAFE_componentWillUpdate!="function"&&typeof C.componentWillUpdate!="function"||(typeof C.componentWillUpdate=="function"&&C.componentWillUpdate(l,he,ne),typeof C.UNSAFE_componentWillUpdate=="function"&&C.UNSAFE_componentWillUpdate(l,he,ne)),typeof C.componentDidUpdate=="function"&&(r.flags|=4),typeof C.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof C.componentDidUpdate!="function"||O===t.memoizedProps&&ue===t.memoizedState||(r.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||O===t.memoizedProps&&ue===t.memoizedState||(r.flags|=1024),r.memoizedProps=l,r.memoizedState=he),C.props=l,C.state=he,C.context=ne,l=fe):(typeof C.componentDidUpdate!="function"||O===t.memoizedProps&&ue===t.memoizedState||(r.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||O===t.memoizedProps&&ue===t.memoizedState||(r.flags|=1024),l=!1)}return C=l,zc(t,r),l=(r.flags&128)!==0,C||l?(C=r.stateNode,a=l&&typeof a.getDerivedStateFromError!="function"?null:C.render(),r.flags|=1,t!==null&&l?(r.child=$s(r,t.child,null,y),r.child=$s(r,null,a,y)):On(t,r,a,y),r.memoizedState=C.state,t=r.child):t=xr(t,r,y),t}function Hv(t,r,a,l){return js(),r.flags|=256,On(t,r,a,l),r.child}var Pd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function zd(t){return{baseLanes:t,cachePool:R_()}}function Hd(t,r,a){return t=t!==null?t.childLanes&~a:0,r&&(t|=vi),t}function $v(t,r,a){var l=r.pendingProps,y=!1,C=(r.flags&128)!==0,O;if((O=C)||(O=t!==null&&t.memoizedState===null?!1:(cn.current&2)!==0),O&&(y=!0,r.flags&=-129),O=(r.flags&32)!==0,r.flags&=-33,t===null){if(lt){if(y?es(r):ts(),(t=Pt)?(t=Y0(t,Ni),t=t!==null&&t.data!=="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:Kr!==null?{id:tr,overflow:nr}:null,retryLane:536870912,hydrationErrors:null},a=y_(t),a.return=r,r.child=a,Mn=r,Pt=null)):t=null,t===null)throw Yr(r);return xf(t)?r.lanes=32:r.lanes=536870912,null}var U=l.children;return l=l.fallback,y?(ts(),y=r.mode,U=Hc({mode:"hidden",children:U},y),l=Ds(l,y,a,null),U.return=r,l.return=r,U.sibling=l,r.child=U,l=r.child,l.memoizedState=zd(a),l.childLanes=Hd(t,O,a),r.memoizedState=Pd,Vo(null,l)):(es(r),$d(r,U))}var ne=t.memoizedState;if(ne!==null&&(U=ne.dehydrated,U!==null)){if(C)r.flags&256?(es(r),r.flags&=-257,r=Ud(t,r,a)):r.memoizedState!==null?(ts(),r.child=t.child,r.flags|=128,r=null):(ts(),U=l.fallback,y=r.mode,l=Hc({mode:"visible",children:l.children},y),U=Ds(U,y,a,null),U.flags|=2,l.return=r,U.return=r,l.sibling=U,r.child=l,$s(r,t.child,null,a),l=r.child,l.memoizedState=zd(a),l.childLanes=Hd(t,O,a),r.memoizedState=Pd,r=Vo(null,l));else if(es(r),xf(U)){if(O=U.nextSibling&&U.nextSibling.dataset,O)var ce=O.dgst;O=ce,l=Error(s(419)),l.stack="",l.digest=O,Io({value:l,source:null,stack:null}),r=Ud(t,r,a)}else if(pn||Sa(t,r,a,!1),O=(a&t.childLanes)!==0,pn||O){if(O=Mt,O!==null&&(l=Vt(O,a),l!==0&&l!==ne.retryLane))throw ne.retryLane=l,Os(t,l),oi(O,t,l),Id;wf(U)||Yc(),r=Ud(t,r,a)}else wf(U)?(r.flags|=192,r.child=t.child,r=null):(t=ne.treeContext,Pt=Di(U.nextSibling),Mn=r,lt=!0,Vr=null,Ni=!1,t!==null&&x_(r,t),r=$d(r,l.children),r.flags|=4096);return r}return y?(ts(),U=l.fallback,y=r.mode,ne=t.child,ce=ne.sibling,l=_r(ne,{mode:"hidden",children:l.children}),l.subtreeFlags=ne.subtreeFlags&65011712,ce!==null?U=_r(ce,U):(U=Ds(U,y,a,null),U.flags|=2),U.return=r,l.return=r,l.sibling=U,r.child=l,Vo(null,l),l=r.child,U=t.child.memoizedState,U===null?U=zd(a):(y=U.cachePool,y!==null?(ne=dn._currentValue,y=y.parent!==ne?{parent:ne,pool:ne}:y):y=R_(),U={baseLanes:U.baseLanes|a,cachePool:y}),l.memoizedState=U,l.childLanes=Hd(t,O,a),r.memoizedState=Pd,Vo(t.child,l)):(es(r),a=t.child,t=a.sibling,a=_r(a,{mode:"visible",children:l.children}),a.return=r,a.sibling=null,t!==null&&(O=r.deletions,O===null?(r.deletions=[t],r.flags|=16):O.push(t)),r.child=a,r.memoizedState=null,a)}function $d(t,r){return r=Hc({mode:"visible",children:r},t.mode),r.return=t,t.child=r}function Hc(t,r){return t=pi(22,t,null,r),t.lanes=0,t}function Ud(t,r,a){return $s(r,t.child,null,a),t=$d(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function Uv(t,r,a){t.lanes|=r;var l=t.alternate;l!==null&&(l.lanes|=r),id(t.return,r,a)}function Fd(t,r,a,l,y,C){var O=t.memoizedState;O===null?t.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:l,tail:a,tailMode:y,treeForkCount:C}:(O.isBackwards=r,O.rendering=null,O.renderingStartTime=0,O.last=l,O.tail=a,O.tailMode=y,O.treeForkCount=C)}function Fv(t,r,a){var l=r.pendingProps,y=l.revealOrder,C=l.tail;l=l.children;var O=cn.current,U=(O&2)!==0;if(U?(O=O&1|2,r.flags|=128):O&=1,Z(cn,O),On(t,r,l,a),l=lt?jo:0,!U&&t!==null&&(t.flags&128)!==0)e:for(t=r.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Uv(t,a,r);else if(t.tag===19)Uv(t,a,r);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===r)break e;for(;t.sibling===null;){if(t.return===null||t.return===r)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(y){case"forwards":for(a=r.child,y=null;a!==null;)t=a.alternate,t!==null&&Ac(t)===null&&(y=a),a=a.sibling;a=y,a===null?(y=r.child,r.child=null):(y=a.sibling,a.sibling=null),Fd(r,!1,y,a,C,l);break;case"backwards":case"unstable_legacy-backwards":for(a=null,y=r.child,r.child=null;y!==null;){if(t=y.alternate,t!==null&&Ac(t)===null){r.child=y;break}t=y.sibling,y.sibling=a,a=y,y=t}Fd(r,!0,a,null,C,l);break;case"together":Fd(r,!1,null,null,void 0,l);break;default:r.memoizedState=null}return r.child}function xr(t,r,a){if(t!==null&&(r.dependencies=t.dependencies),rs|=r.lanes,(a&r.childLanes)===0)if(t!==null){if(Sa(t,r,a,!1),(a&r.childLanes)===0)return null}else return null;if(t!==null&&r.child!==t.child)throw Error(s(153));if(r.child!==null){for(t=r.child,a=_r(t,t.pendingProps),r.child=a,a.return=r;t.sibling!==null;)t=t.sibling,a=a.sibling=_r(t,t.pendingProps),a.return=r;a.sibling=null}return r.child}function Wd(t,r){return(t.lanes&r)!==0?!0:(t=t.dependencies,!!(t!==null&&yc(t)))}function yE(t,r,a){switch(r.tag){case 3:$(r,r.stateNode.containerInfo),Xr(r,dn,t.memoizedState.cache),js();break;case 27:case 5:de(r);break;case 4:$(r,r.stateNode.containerInfo);break;case 10:Xr(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,gd(r),null;break;case 13:var l=r.memoizedState;if(l!==null)return l.dehydrated!==null?(es(r),r.flags|=128,null):(a&r.child.childLanes)!==0?$v(t,r,a):(es(r),t=xr(t,r,a),t!==null?t.sibling:null);es(r);break;case 19:var y=(t.flags&128)!==0;if(l=(a&r.childLanes)!==0,l||(Sa(t,r,a,!1),l=(a&r.childLanes)!==0),y){if(l)return Fv(t,r,a);r.flags|=128}if(y=r.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),Z(cn,cn.current),l)break;return null;case 22:return r.lanes=0,jv(t,r,a,r.pendingProps);case 24:Xr(r,dn,t.memoizedState.cache)}return xr(t,r,a)}function Wv(t,r,a){if(t!==null)if(t.memoizedProps!==r.pendingProps)pn=!0;else{if(!Wd(t,a)&&(r.flags&128)===0)return pn=!1,yE(t,r,a);pn=(t.flags&131072)!==0}else pn=!1,lt&&(r.flags&1048576)!==0&&w_(r,jo,r.index);switch(r.lanes=0,r.tag){case 16:e:{var l=r.pendingProps;if(t=zs(r.elementType),r.type=t,typeof t=="function")Yh(t)?(l=Fs(t,l),r.tag=1,r=zv(null,r,t,l,a)):(r.tag=0,r=Bd(null,r,t,l,a));else{if(t!=null){var y=t.$$typeof;if(y===k){r.tag=11,r=Nv(null,r,t,l,a);break e}else if(y===N){r.tag=14,r=Ov(null,r,t,l,a);break e}}throw r=Y(t)||t,Error(s(306,r,""))}}return r;case 0:return Bd(t,r,r.type,r.pendingProps,a);case 1:return l=r.type,y=Fs(l,r.pendingProps),zv(t,r,l,y,a);case 3:e:{if($(r,r.stateNode.containerInfo),t===null)throw Error(s(387));l=r.pendingProps;var C=r.memoizedState;y=C.element,ud(t,r),Fo(r,l,null,a);var O=r.memoizedState;if(l=O.cache,Xr(r,dn,l),l!==C.cache&&rd(r,[dn],a,!0),Uo(),l=O.element,C.isDehydrated)if(C={element:l,isDehydrated:!1,cache:O.cache},r.updateQueue.baseState=C,r.memoizedState=C,r.flags&256){r=Hv(t,r,l,a);break e}else if(l!==y){y=Ri(Error(s(424)),r),Io(y),r=Hv(t,r,l,a);break e}else for(t=r.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,Pt=Di(t.firstChild),Mn=r,lt=!0,Vr=null,Ni=!0,a=j_(r,null,l,a),r.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(js(),l===y){r=xr(t,r,a);break e}On(t,r,l,a)}r=r.child}return r;case 26:return zc(t,r),t===null?(a=tb(r.type,null,r.pendingProps,null))?r.memoizedState=a:lt||(a=r.type,t=r.pendingProps,l=nu(se.current).createElement(a),l[It]=r,l[Nt]=t,Dn(l,a,t),Qe(l),r.stateNode=l):r.memoizedState=tb(r.type,t.memoizedProps,r.pendingProps,t.memoizedState),null;case 27:return de(r),t===null&<&&(l=r.stateNode=J0(r.type,r.pendingProps,se.current),Mn=r,Ni=!0,y=Pt,cs(r.type)?(Cf=y,Pt=Di(l.firstChild)):Pt=y),On(t,r,r.pendingProps.children,a),zc(t,r),t===null&&(r.flags|=4194304),r.child;case 5:return t===null&<&&((y=l=Pt)&&(l=XE(l,r.type,r.pendingProps,Ni),l!==null?(r.stateNode=l,Mn=r,Pt=Di(l.firstChild),Ni=!1,y=!0):y=!1),y||Yr(r)),de(r),y=r.type,C=r.pendingProps,O=t!==null?t.memoizedProps:null,l=C.children,bf(y,C)?l=null:O!==null&&bf(y,O)&&(r.flags|=32),r.memoizedState!==null&&(y=_d(t,r,hE,null,null,a),cl._currentValue=y),zc(t,r),On(t,r,l,a),r.child;case 6:return t===null&<&&((t=a=Pt)&&(a=ZE(a,r.pendingProps,Ni),a!==null?(r.stateNode=a,Mn=r,Pt=null,t=!0):t=!1),t||Yr(r)),null;case 13:return $v(t,r,a);case 4:return $(r,r.stateNode.containerInfo),l=r.pendingProps,t===null?r.child=$s(r,null,l,a):On(t,r,l,a),r.child;case 11:return Nv(t,r,r.type,r.pendingProps,a);case 7:return On(t,r,r.pendingProps,a),r.child;case 8:return On(t,r,r.pendingProps.children,a),r.child;case 12:return On(t,r,r.pendingProps.children,a),r.child;case 10:return l=r.pendingProps,Xr(r,r.type,l.value),On(t,r,l.children,a),r.child;case 9:return y=r.type._context,l=r.pendingProps.children,Bs(r),y=Nn(y),l=l(y),r.flags|=1,On(t,r,l,a),r.child;case 14:return Ov(t,r,r.type,r.pendingProps,a);case 15:return Dv(t,r,r.type,r.pendingProps,a);case 19:return Fv(t,r,a);case 31:return bE(t,r,a);case 22:return jv(t,r,a,r.pendingProps);case 24:return Bs(r),l=Nn(dn),t===null?(y=od(),y===null&&(y=Mt,C=sd(),y.pooledCache=C,C.refCount++,C!==null&&(y.pooledCacheLanes|=a),y=C),r.memoizedState={parent:l,cache:y},cd(r),Xr(r,dn,y)):((t.lanes&a)!==0&&(ud(t,r),Fo(r,null,null,a),Uo()),y=t.memoizedState,C=r.memoizedState,y.parent!==l?(y={parent:l,cache:l},r.memoizedState=y,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=y),Xr(r,dn,l)):(l=C.cache,Xr(r,dn,l),l!==y.cache&&rd(r,[dn],a,!0))),On(t,r,r.pendingProps.children,a),r.child;case 29:throw r.pendingProps}throw Error(s(156,r.tag))}function Cr(t){t.flags|=4}function Gd(t,r,a,l,y){if((r=(t.mode&32)!==0)&&(r=!1),r){if(t.flags|=16777216,(y&335544128)===y)if(t.stateNode.complete)t.flags|=8192;else if(_0())t.flags|=8192;else throw Hs=Cc,ld}else t.flags&=-16777217}function Gv(t,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!ab(r))if(_0())t.flags|=8192;else throw Hs=Cc,ld}function $c(t,r){r!==null&&(t.flags|=4),t.flags&16384&&(r=t.tag!==22?je():536870912,t.lanes|=r,Oa|=r)}function Yo(t,r){if(!lt)switch(t.tailMode){case"hidden":r=t.tail;for(var a=null;r!==null;)r.alternate!==null&&(a=r),r=r.sibling;a===null?t.tail=null:a.sibling=null;break;case"collapsed":a=t.tail;for(var l=null;a!==null;)a.alternate!==null&&(l=a),a=a.sibling;l===null?r||t.tail===null?t.tail=null:t.tail.sibling=null:l.sibling=null}}function zt(t){var r=t.alternate!==null&&t.alternate.child===t.child,a=0,l=0;if(r)for(var y=t.child;y!==null;)a|=y.lanes|y.childLanes,l|=y.subtreeFlags&65011712,l|=y.flags&65011712,y.return=t,y=y.sibling;else for(y=t.child;y!==null;)a|=y.lanes|y.childLanes,l|=y.subtreeFlags,l|=y.flags,y.return=t,y=y.sibling;return t.subtreeFlags|=l,t.childLanes=a,r}function SE(t,r,a){var l=r.pendingProps;switch(Qh(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return zt(r),null;case 1:return zt(r),null;case 3:return a=r.stateNode,l=null,t!==null&&(l=t.memoizedState.cache),r.memoizedState.cache!==l&&(r.flags|=2048),yr(dn),ae(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(t===null||t.child===null)&&(ya(r)?Cr(r):t===null||t.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,td())),zt(r),null;case 26:var y=r.type,C=r.memoizedState;return t===null?(Cr(r),C!==null?(zt(r),Gv(r,C)):(zt(r),Gd(r,y,null,l,a))):C?C!==t.memoizedState?(Cr(r),zt(r),Gv(r,C)):(zt(r),r.flags&=-16777217):(t=t.memoizedProps,t!==l&&Cr(r),zt(r),Gd(r,y,t,l,a)),null;case 27:if(we(r),a=se.current,y=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==l&&Cr(r);else{if(!l){if(r.stateNode===null)throw Error(s(166));return zt(r),null}t=ee.current,ya(r)?C_(r):(t=J0(y,l,a),r.stateNode=t,Cr(r))}return zt(r),null;case 5:if(we(r),y=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==l&&Cr(r);else{if(!l){if(r.stateNode===null)throw Error(s(166));return zt(r),null}if(C=ee.current,ya(r))C_(r);else{var O=nu(se.current);switch(C){case 1:C=O.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:C=O.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":C=O.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":C=O.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":C=O.createElement("div"),C.innerHTML="<script><\/script>",C=C.removeChild(C.firstChild);break;case"select":C=typeof l.is=="string"?O.createElement("select",{is:l.is}):O.createElement("select"),l.multiple?C.multiple=!0:l.size&&(C.size=l.size);break;default:C=typeof l.is=="string"?O.createElement(y,{is:l.is}):O.createElement(y)}}C[It]=r,C[Nt]=l;e:for(O=r.child;O!==null;){if(O.tag===5||O.tag===6)C.appendChild(O.stateNode);else if(O.tag!==4&&O.tag!==27&&O.child!==null){O.child.return=O,O=O.child;continue}if(O===r)break e;for(;O.sibling===null;){if(O.return===null||O.return===r)break e;O=O.return}O.sibling.return=O.return,O=O.sibling}r.stateNode=C;e:switch(Dn(C,y,l),y){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Cr(r)}}return zt(r),Gd(r,r.type,t===null?null:t.memoizedProps,r.pendingProps,a),null;case 6:if(t&&r.stateNode!=null)t.memoizedProps!==l&&Cr(r);else{if(typeof l!="string"&&r.stateNode===null)throw Error(s(166));if(t=se.current,ya(r)){if(t=r.stateNode,a=r.memoizedProps,l=null,y=Mn,y!==null)switch(y.tag){case 27:case 5:l=y.memoizedProps}t[It]=r,t=!!(t.nodeValue===a||l!==null&&l.suppressHydrationWarning===!0||$0(t.nodeValue,a)),t||Yr(r,!0)}else t=nu(t).createTextNode(l),t[It]=r,r.stateNode=t}return zt(r),null;case 31:if(a=r.memoizedState,t===null||t.memoizedState!==null){if(l=ya(r),a!==null){if(t===null){if(!l)throw Error(s(318));if(t=r.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(557));t[It]=r}else js(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;zt(r),t=!1}else a=td(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),t=!0;if(!t)return r.flags&256?(mi(r),r):(mi(r),null);if((r.flags&128)!==0)throw Error(s(558))}return zt(r),null;case 13:if(l=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(y=ya(r),l!==null&&l.dehydrated!==null){if(t===null){if(!y)throw Error(s(318));if(y=r.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(s(317));y[It]=r}else js(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;zt(r),y=!1}else y=td(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=y),y=!0;if(!y)return r.flags&256?(mi(r),r):(mi(r),null)}return mi(r),(r.flags&128)!==0?(r.lanes=a,r):(a=l!==null,t=t!==null&&t.memoizedState!==null,a&&(l=r.child,y=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(y=l.alternate.memoizedState.cachePool.pool),C=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(C=l.memoizedState.cachePool.pool),C!==y&&(l.flags|=2048)),a!==t&&a&&(r.child.flags|=8192),$c(r,r.updateQueue),zt(r),null);case 4:return ae(),t===null&&pf(r.stateNode.containerInfo),zt(r),null;case 10:return yr(r.type),zt(r),null;case 19:if(P(cn),l=r.memoizedState,l===null)return zt(r),null;if(y=(r.flags&128)!==0,C=l.rendering,C===null)if(y)Yo(l,!1);else{if(tn!==0||t!==null&&(t.flags&128)!==0)for(t=r.child;t!==null;){if(C=Ac(t),C!==null){for(r.flags|=128,Yo(l,!1),t=C.updateQueue,r.updateQueue=t,$c(r,t),r.subtreeFlags=0,t=a,a=r.child;a!==null;)b_(a,t),a=a.sibling;return Z(cn,cn.current&1|2),lt&&vr(r,l.treeForkCount),r.child}t=t.sibling}l.tail!==null&&ut()>qc&&(r.flags|=128,y=!0,Yo(l,!1),r.lanes=4194304)}else{if(!y)if(t=Ac(C),t!==null){if(r.flags|=128,y=!0,t=t.updateQueue,r.updateQueue=t,$c(r,t),Yo(l,!0),l.tail===null&&l.tailMode==="hidden"&&!C.alternate&&!lt)return zt(r),null}else 2*ut()-l.renderingStartTime>qc&&a!==536870912&&(r.flags|=128,y=!0,Yo(l,!1),r.lanes=4194304);l.isBackwards?(C.sibling=r.child,r.child=C):(t=l.last,t!==null?t.sibling=C:r.child=C,l.last=C)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=ut(),t.sibling=null,a=cn.current,Z(cn,y?a&1|2:a&1),lt&&vr(r,l.treeForkCount),t):(zt(r),null);case 22:case 23:return mi(r),pd(),l=r.memoizedState!==null,t!==null?t.memoizedState!==null!==l&&(r.flags|=8192):l&&(r.flags|=8192),l?(a&536870912)!==0&&(r.flags&128)===0&&(zt(r),r.subtreeFlags&6&&(r.flags|=8192)):zt(r),a=r.updateQueue,a!==null&&$c(r,a.retryQueue),a=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),l=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),l!==a&&(r.flags|=2048),t!==null&&P(Ps),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),r.memoizedState.cache!==a&&(r.flags|=2048),yr(dn),zt(r),null;case 25:return null;case 30:return null}throw Error(s(156,r.tag))}function wE(t,r){switch(Qh(r),r.tag){case 1:return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return yr(dn),ae(),t=r.flags,(t&65536)!==0&&(t&128)===0?(r.flags=t&-65537|128,r):null;case 26:case 27:case 5:return we(r),null;case 31:if(r.memoizedState!==null){if(mi(r),r.alternate===null)throw Error(s(340));js()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 13:if(mi(r),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(s(340));js()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return P(cn),null;case 4:return ae(),null;case 10:return yr(r.type),null;case 22:case 23:return mi(r),pd(),t!==null&&P(Ps),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 24:return yr(dn),null;case 25:return null;default:return null}}function qv(t,r){switch(Qh(r),r.tag){case 3:yr(dn),ae();break;case 26:case 27:case 5:we(r);break;case 4:ae();break;case 31:r.memoizedState!==null&&mi(r);break;case 13:mi(r);break;case 19:P(cn);break;case 10:yr(r.type);break;case 22:case 23:mi(r),pd(),t!==null&&P(Ps);break;case 24:yr(dn)}}function Xo(t,r){try{var a=r.updateQueue,l=a!==null?a.lastEffect:null;if(l!==null){var y=l.next;a=y;do{if((a.tag&t)===t){l=void 0;var C=a.create,O=a.inst;l=C(),O.destroy=l}a=a.next}while(a!==y)}}catch(U){wt(r,r.return,U)}}function ns(t,r,a){try{var l=r.updateQueue,y=l!==null?l.lastEffect:null;if(y!==null){var C=y.next;l=C;do{if((l.tag&t)===t){var O=l.inst,U=O.destroy;if(U!==void 0){O.destroy=void 0,y=r;var ne=a,ce=U;try{ce()}catch(fe){wt(y,ne,fe)}}}l=l.next}while(l!==C)}}catch(fe){wt(r,r.return,fe)}}function Kv(t){var r=t.updateQueue;if(r!==null){var a=t.stateNode;try{B_(r,a)}catch(l){wt(t,t.return,l)}}}function Vv(t,r,a){a.props=Fs(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(l){wt(t,r,l)}}function Zo(t,r){try{var a=t.ref;if(a!==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 a=="function"?t.refCleanup=a(l):a.current=l}}catch(y){wt(t,r,y)}}function ir(t,r){var a=t.ref,l=t.refCleanup;if(a!==null)if(typeof l=="function")try{l()}catch(y){wt(t,r,y)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(y){wt(t,r,y)}else a.current=null}function Yv(t){var r=t.type,a=t.memoizedProps,l=t.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":a.autoFocus&&l.focus();break e;case"img":a.src?l.src=a.src:a.srcSet&&(l.srcset=a.srcSet)}}catch(y){wt(t,t.return,y)}}function qd(t,r,a){try{var l=t.stateNode;WE(l,t.type,a,r),l[Nt]=r}catch(y){wt(t,t.return,y)}}function Xv(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&cs(t.type)||t.tag===4}function Kd(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Xv(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&&cs(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 Vd(t,r,a){var l=t.tag;if(l===5||l===6)t=t.stateNode,r?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(t,r):(r=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,r.appendChild(t),a=a._reactRootContainer,a!=null||r.onclick!==null||(r.onclick=xe));else if(l!==4&&(l===27&&cs(t.type)&&(a=t.stateNode,r=null),t=t.child,t!==null))for(Vd(t,r,a),t=t.sibling;t!==null;)Vd(t,r,a),t=t.sibling}function Uc(t,r,a){var l=t.tag;if(l===5||l===6)t=t.stateNode,r?a.insertBefore(t,r):a.appendChild(t);else if(l!==4&&(l===27&&cs(t.type)&&(a=t.stateNode),t=t.child,t!==null))for(Uc(t,r,a),t=t.sibling;t!==null;)Uc(t,r,a),t=t.sibling}function Zv(t){var r=t.stateNode,a=t.memoizedProps;try{for(var l=t.type,y=r.attributes;y.length;)r.removeAttributeNode(y[0]);Dn(r,l,a),r[It]=t,r[Nt]=a}catch(C){wt(t,t.return,C)}}var Er=!1,gn=!1,Yd=!1,Jv=typeof WeakSet=="function"?WeakSet:Set,Sn=null;function xE(t,r){if(t=t.containerInfo,_f=cu,t=u_(t),Uh(t)){if("selectionStart"in t)var a={start:t.selectionStart,end:t.selectionEnd};else e:{a=(a=t.ownerDocument)&&a.defaultView||window;var l=a.getSelection&&a.getSelection();if(l&&l.rangeCount!==0){a=l.anchorNode;var y=l.anchorOffset,C=l.focusNode;l=l.focusOffset;try{a.nodeType,C.nodeType}catch{a=null;break e}var O=0,U=-1,ne=-1,ce=0,fe=0,me=t,ue=null;t:for(;;){for(var he;me!==a||y!==0&&me.nodeType!==3||(U=O+y),me!==C||l!==0&&me.nodeType!==3||(ne=O+l),me.nodeType===3&&(O+=me.nodeValue.length),(he=me.firstChild)!==null;)ue=me,me=he;for(;;){if(me===t)break t;if(ue===a&&++ce===y&&(U=O),ue===C&&++fe===l&&(ne=O),(he=me.nextSibling)!==null)break;me=ue,ue=me.parentNode}me=he}a=U===-1||ne===-1?null:{start:U,end:ne}}else a=null}a=a||{start:0,end:0}}else a=null;for(vf={focusedElem:t,selectionRange:a},cu=!1,Sn=r;Sn!==null;)if(r=Sn,t=r.child,(r.subtreeFlags&1028)!==0&&t!==null)t.return=r,Sn=t;else for(;Sn!==null;){switch(r=Sn,C=r.alternate,t=r.flags,r.tag){case 0:if((t&4)!==0&&(t=r.updateQueue,t=t!==null?t.events:null,t!==null))for(a=0;a<t.length;a++)y=t[a],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&C!==null){t=void 0,a=r,y=C.memoizedProps,C=C.memoizedState,l=a.stateNode;try{var Te=Fs(a.type,y);t=l.getSnapshotBeforeUpdate(Te,C),l.__reactInternalSnapshotBeforeUpdate=t}catch(He){wt(a,a.return,He)}}break;case 3:if((t&1024)!==0){if(t=r.stateNode.containerInfo,a=t.nodeType,a===9)Sf(t);else if(a===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Sf(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(s(163))}if(t=r.sibling,t!==null){t.return=r.return,Sn=t;break}Sn=r.return}}function Qv(t,r,a){var l=a.flags;switch(a.tag){case 0:case 11:case 15:Tr(t,a),l&4&&Xo(5,a);break;case 1:if(Tr(t,a),l&4)if(t=a.stateNode,r===null)try{t.componentDidMount()}catch(O){wt(a,a.return,O)}else{var y=Fs(a.type,r.memoizedProps);r=r.memoizedState;try{t.componentDidUpdate(y,r,t.__reactInternalSnapshotBeforeUpdate)}catch(O){wt(a,a.return,O)}}l&64&&Kv(a),l&512&&Zo(a,a.return);break;case 3:if(Tr(t,a),l&64&&(t=a.updateQueue,t!==null)){if(r=null,a.child!==null)switch(a.child.tag){case 27:case 5:r=a.child.stateNode;break;case 1:r=a.child.stateNode}try{B_(t,r)}catch(O){wt(a,a.return,O)}}break;case 27:r===null&&l&4&&Zv(a);case 26:case 5:Tr(t,a),r===null&&l&4&&Yv(a),l&512&&Zo(a,a.return);break;case 12:Tr(t,a);break;case 31:Tr(t,a),l&4&&n0(t,a);break;case 13:Tr(t,a),l&4&&i0(t,a),l&64&&(t=a.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(a=NE.bind(null,a),JE(t,a))));break;case 22:if(l=a.memoizedState!==null||Er,!l){r=r!==null&&r.memoizedState!==null||gn,y=Er;var C=gn;Er=l,(gn=r)&&!C?Ar(t,a,(a.subtreeFlags&8772)!==0):Tr(t,a),Er=y,gn=C}break;case 30:break;default:Tr(t,a)}}function e0(t){var r=t.alternate;r!==null&&(t.alternate=null,e0(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&De(r)),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 Gt=null,ii=!1;function kr(t,r,a){for(a=a.child;a!==null;)t0(t,r,a),a=a.sibling}function t0(t,r,a){if(ve&&typeof ve.onCommitFiberUnmount=="function")try{ve.onCommitFiberUnmount(Tn,a)}catch{}switch(a.tag){case 26:gn||ir(a,r),kr(t,r,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:gn||ir(a,r);var l=Gt,y=ii;cs(a.type)&&(Gt=a.stateNode,ii=!1),kr(t,r,a),al(a.stateNode),Gt=l,ii=y;break;case 5:gn||ir(a,r);case 6:if(l=Gt,y=ii,Gt=null,kr(t,r,a),Gt=l,ii=y,Gt!==null)if(ii)try{(Gt.nodeType===9?Gt.body:Gt.nodeName==="HTML"?Gt.ownerDocument.body:Gt).removeChild(a.stateNode)}catch(C){wt(a,r,C)}else try{Gt.removeChild(a.stateNode)}catch(C){wt(a,r,C)}break;case 18:Gt!==null&&(ii?(t=Gt,K0(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,a.stateNode),$a(t)):K0(Gt,a.stateNode));break;case 4:l=Gt,y=ii,Gt=a.stateNode.containerInfo,ii=!0,kr(t,r,a),Gt=l,ii=y;break;case 0:case 11:case 14:case 15:ns(2,a,r),gn||ns(4,a,r),kr(t,r,a);break;case 1:gn||(ir(a,r),l=a.stateNode,typeof l.componentWillUnmount=="function"&&Vv(a,r,l)),kr(t,r,a);break;case 21:kr(t,r,a);break;case 22:gn=(l=gn)||a.memoizedState!==null,kr(t,r,a),gn=l;break;default:kr(t,r,a)}}function n0(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{$a(t)}catch(a){wt(r,r.return,a)}}}function i0(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{$a(t)}catch(a){wt(r,r.return,a)}}function CE(t){switch(t.tag){case 31:case 13:case 19:var r=t.stateNode;return r===null&&(r=t.stateNode=new Jv),r;case 22:return t=t.stateNode,r=t._retryCache,r===null&&(r=t._retryCache=new Jv),r;default:throw Error(s(435,t.tag))}}function Fc(t,r){var a=CE(t);r.forEach(function(l){if(!a.has(l)){a.add(l);var y=OE.bind(null,t,l);l.then(y,y)}})}function ri(t,r){var a=r.deletions;if(a!==null)for(var l=0;l<a.length;l++){var y=a[l],C=t,O=r,U=O;e:for(;U!==null;){switch(U.tag){case 27:if(cs(U.type)){Gt=U.stateNode,ii=!1;break e}break;case 5:Gt=U.stateNode,ii=!1;break e;case 3:case 4:Gt=U.stateNode.containerInfo,ii=!0;break e}U=U.return}if(Gt===null)throw Error(s(160));t0(C,O,y),Gt=null,ii=!1,C=y.alternate,C!==null&&(C.return=null),y.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)r0(r,t),r=r.sibling}var Gi=null;function r0(t,r){var a=t.alternate,l=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:ri(r,t),si(t),l&4&&(ns(3,t,t.return),Xo(3,t),ns(5,t,t.return));break;case 1:ri(r,t),si(t),l&512&&(gn||a===null||ir(a,a.return)),l&64&&Er&&(t=t.updateQueue,t!==null&&(l=t.callbacks,l!==null&&(a=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=a===null?l:a.concat(l))));break;case 26:var y=Gi;if(ri(r,t),si(t),l&512&&(gn||a===null||ir(a,a.return)),l&4){var C=a!==null?a.memoizedState:null;if(l=t.memoizedState,a===null)if(l===null)if(t.stateNode===null){e:{l=t.type,a=t.memoizedProps,y=y.ownerDocument||y;t:switch(l){case"title":C=y.getElementsByTagName("title")[0],(!C||C[er]||C[It]||C.namespaceURI==="http://www.w3.org/2000/svg"||C.hasAttribute("itemprop"))&&(C=y.createElement(l),y.head.insertBefore(C,y.querySelector("head > title"))),Dn(C,l,a),C[It]=t,Qe(C),l=C;break e;case"link":var O=rb("link","href",y).get(l+(a.href||""));if(O){for(var U=0;U<O.length;U++)if(C=O[U],C.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&C.getAttribute("rel")===(a.rel==null?null:a.rel)&&C.getAttribute("title")===(a.title==null?null:a.title)&&C.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){O.splice(U,1);break t}}C=y.createElement(l),Dn(C,l,a),y.head.appendChild(C);break;case"meta":if(O=rb("meta","content",y).get(l+(a.content||""))){for(U=0;U<O.length;U++)if(C=O[U],C.getAttribute("content")===(a.content==null?null:""+a.content)&&C.getAttribute("name")===(a.name==null?null:a.name)&&C.getAttribute("property")===(a.property==null?null:a.property)&&C.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&C.getAttribute("charset")===(a.charSet==null?null:a.charSet)){O.splice(U,1);break t}}C=y.createElement(l),Dn(C,l,a),y.head.appendChild(C);break;default:throw Error(s(468,l))}C[It]=t,Qe(C),l=C}t.stateNode=l}else sb(y,t.type,t.stateNode);else t.stateNode=ib(y,l,t.memoizedProps);else C!==l?(C===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):C.count--,l===null?sb(y,t.type,t.stateNode):ib(y,l,t.memoizedProps)):l===null&&t.stateNode!==null&&qd(t,t.memoizedProps,a.memoizedProps)}break;case 27:ri(r,t),si(t),l&512&&(gn||a===null||ir(a,a.return)),a!==null&&l&4&&qd(t,t.memoizedProps,a.memoizedProps);break;case 5:if(ri(r,t),si(t),l&512&&(gn||a===null||ir(a,a.return)),t.flags&32){y=t.stateNode;try{Ue(y,"")}catch(Te){wt(t,t.return,Te)}}l&4&&t.stateNode!=null&&(y=t.memoizedProps,qd(t,y,a!==null?a.memoizedProps:y)),l&1024&&(Yd=!0);break;case 6:if(ri(r,t),si(t),l&4){if(t.stateNode===null)throw Error(s(162));l=t.memoizedProps,a=t.stateNode;try{a.nodeValue=l}catch(Te){wt(t,t.return,Te)}}break;case 3:if(su=null,y=Gi,Gi=iu(r.containerInfo),ri(r,t),Gi=y,si(t),l&4&&a!==null&&a.memoizedState.isDehydrated)try{$a(r.containerInfo)}catch(Te){wt(t,t.return,Te)}Yd&&(Yd=!1,s0(t));break;case 4:l=Gi,Gi=iu(t.stateNode.containerInfo),ri(r,t),si(t),Gi=l;break;case 12:ri(r,t),si(t);break;case 31:ri(r,t),si(t),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,Fc(t,l)));break;case 13:ri(r,t),si(t),t.child.flags&8192&&t.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Gc=ut()),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,Fc(t,l)));break;case 22:y=t.memoizedState!==null;var ne=a!==null&&a.memoizedState!==null,ce=Er,fe=gn;if(Er=ce||y,gn=fe||ne,ri(r,t),gn=fe,Er=ce,si(t),l&8192)e:for(r=t.stateNode,r._visibility=y?r._visibility&-2:r._visibility|1,y&&(a===null||ne||Er||gn||Ws(t)),a=null,r=t;;){if(r.tag===5||r.tag===26){if(a===null){ne=a=r;try{if(C=ne.stateNode,y)O=C.style,typeof O.setProperty=="function"?O.setProperty("display","none","important"):O.display="none";else{U=ne.stateNode;var me=ne.memoizedProps.style,ue=me!=null&&me.hasOwnProperty("display")?me.display:null;U.style.display=ue==null||typeof ue=="boolean"?"":(""+ue).trim()}}catch(Te){wt(ne,ne.return,Te)}}}else if(r.tag===6){if(a===null){ne=r;try{ne.stateNode.nodeValue=y?"":ne.memoizedProps}catch(Te){wt(ne,ne.return,Te)}}}else if(r.tag===18){if(a===null){ne=r;try{var he=ne.stateNode;y?V0(he,!0):V0(ne.stateNode,!1)}catch(Te){wt(ne,ne.return,Te)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===t)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break e;for(;r.sibling===null;){if(r.return===null||r.return===t)break e;a===r&&(a=null),r=r.return}a===r&&(a=null),r.sibling.return=r.return,r=r.sibling}l&4&&(l=t.updateQueue,l!==null&&(a=l.retryQueue,a!==null&&(l.retryQueue=null,Fc(t,a))));break;case 19:ri(r,t),si(t),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,Fc(t,l)));break;case 30:break;case 21:break;default:ri(r,t),si(t)}}function si(t){var r=t.flags;if(r&2){try{for(var a,l=t.return;l!==null;){if(Xv(l)){a=l;break}l=l.return}if(a==null)throw Error(s(160));switch(a.tag){case 27:var y=a.stateNode,C=Kd(t);Uc(t,C,y);break;case 5:var O=a.stateNode;a.flags&32&&(Ue(O,""),a.flags&=-33);var U=Kd(t);Uc(t,U,O);break;case 3:case 4:var ne=a.stateNode.containerInfo,ce=Kd(t);Vd(t,ce,ne);break;default:throw Error(s(161))}}catch(fe){wt(t,t.return,fe)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function s0(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var r=t;s0(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),t=t.sibling}}function Tr(t,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)Qv(t,r.alternate,r),r=r.sibling}function Ws(t){for(t=t.child;t!==null;){var r=t;switch(r.tag){case 0:case 11:case 14:case 15:ns(4,r,r.return),Ws(r);break;case 1:ir(r,r.return);var a=r.stateNode;typeof a.componentWillUnmount=="function"&&Vv(r,r.return,a),Ws(r);break;case 27:al(r.stateNode);case 26:case 5:ir(r,r.return),Ws(r);break;case 22:r.memoizedState===null&&Ws(r);break;case 30:Ws(r);break;default:Ws(r)}t=t.sibling}}function Ar(t,r,a){for(a=a&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var l=r.alternate,y=t,C=r,O=C.flags;switch(C.tag){case 0:case 11:case 15:Ar(y,C,a),Xo(4,C);break;case 1:if(Ar(y,C,a),l=C,y=l.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(ce){wt(l,l.return,ce)}if(l=C,y=l.updateQueue,y!==null){var U=l.stateNode;try{var ne=y.shared.hiddenCallbacks;if(ne!==null)for(y.shared.hiddenCallbacks=null,y=0;y<ne.length;y++)I_(ne[y],U)}catch(ce){wt(l,l.return,ce)}}a&&O&64&&Kv(C),Zo(C,C.return);break;case 27:Zv(C);case 26:case 5:Ar(y,C,a),a&&l===null&&O&4&&Yv(C),Zo(C,C.return);break;case 12:Ar(y,C,a);break;case 31:Ar(y,C,a),a&&O&4&&n0(y,C);break;case 13:Ar(y,C,a),a&&O&4&&i0(y,C);break;case 22:C.memoizedState===null&&Ar(y,C,a),Zo(C,C.return);break;case 30:break;default:Ar(y,C,a)}r=r.sibling}}function Xd(t,r){var a=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),t=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(t=r.memoizedState.cachePool.pool),t!==a&&(t!=null&&t.refCount++,a!=null&&Bo(a))}function Zd(t,r){t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&Bo(t))}function qi(t,r,a,l){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)a0(t,r,a,l),r=r.sibling}function a0(t,r,a,l){var y=r.flags;switch(r.tag){case 0:case 11:case 15:qi(t,r,a,l),y&2048&&Xo(9,r);break;case 1:qi(t,r,a,l);break;case 3:qi(t,r,a,l),y&2048&&(t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&Bo(t)));break;case 12:if(y&2048){qi(t,r,a,l),t=r.stateNode;try{var C=r.memoizedProps,O=C.id,U=C.onPostCommit;typeof U=="function"&&U(O,r.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(ne){wt(r,r.return,ne)}}else qi(t,r,a,l);break;case 31:qi(t,r,a,l);break;case 13:qi(t,r,a,l);break;case 23:break;case 22:C=r.stateNode,O=r.alternate,r.memoizedState!==null?C._visibility&2?qi(t,r,a,l):Jo(t,r):C._visibility&2?qi(t,r,a,l):(C._visibility|=2,La(t,r,a,l,(r.subtreeFlags&10256)!==0||!1)),y&2048&&Xd(O,r);break;case 24:qi(t,r,a,l),y&2048&&Zd(r.alternate,r);break;default:qi(t,r,a,l)}}function La(t,r,a,l,y){for(y=y&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var C=t,O=r,U=a,ne=l,ce=O.flags;switch(O.tag){case 0:case 11:case 15:La(C,O,U,ne,y),Xo(8,O);break;case 23:break;case 22:var fe=O.stateNode;O.memoizedState!==null?fe._visibility&2?La(C,O,U,ne,y):Jo(C,O):(fe._visibility|=2,La(C,O,U,ne,y)),y&&ce&2048&&Xd(O.alternate,O);break;case 24:La(C,O,U,ne,y),y&&ce&2048&&Zd(O.alternate,O);break;default:La(C,O,U,ne,y)}r=r.sibling}}function Jo(t,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var a=t,l=r,y=l.flags;switch(l.tag){case 22:Jo(a,l),y&2048&&Xd(l.alternate,l);break;case 24:Jo(a,l),y&2048&&Zd(l.alternate,l);break;default:Jo(a,l)}r=r.sibling}}var Qo=8192;function Ma(t,r,a){if(t.subtreeFlags&Qo)for(t=t.child;t!==null;)o0(t,r,a),t=t.sibling}function o0(t,r,a){switch(t.tag){case 26:Ma(t,r,a),t.flags&Qo&&t.memoizedState!==null&&u5(a,Gi,t.memoizedState,t.memoizedProps);break;case 5:Ma(t,r,a);break;case 3:case 4:var l=Gi;Gi=iu(t.stateNode.containerInfo),Ma(t,r,a),Gi=l;break;case 22:t.memoizedState===null&&(l=t.alternate,l!==null&&l.memoizedState!==null?(l=Qo,Qo=16777216,Ma(t,r,a),Qo=l):Ma(t,r,a));break;default:Ma(t,r,a)}}function l0(t){var r=t.alternate;if(r!==null&&(t=r.child,t!==null)){r.child=null;do r=t.sibling,t.sibling=null,t=r;while(t!==null)}}function el(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var a=0;a<r.length;a++){var l=r[a];Sn=l,u0(l,t)}l0(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)c0(t),t=t.sibling}function c0(t){switch(t.tag){case 0:case 11:case 15:el(t),t.flags&2048&&ns(9,t,t.return);break;case 3:el(t);break;case 12:el(t);break;case 22:var r=t.stateNode;t.memoizedState!==null&&r._visibility&2&&(t.return===null||t.return.tag!==13)?(r._visibility&=-3,Wc(t)):el(t);break;default:el(t)}}function Wc(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var a=0;a<r.length;a++){var l=r[a];Sn=l,u0(l,t)}l0(t)}for(t=t.child;t!==null;){switch(r=t,r.tag){case 0:case 11:case 15:ns(8,r,r.return),Wc(r);break;case 22:a=r.stateNode,a._visibility&2&&(a._visibility&=-3,Wc(r));break;default:Wc(r)}t=t.sibling}}function u0(t,r){for(;Sn!==null;){var a=Sn;switch(a.tag){case 0:case 11:case 15:ns(8,a,r);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var l=a.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:Bo(a.memoizedState.cache)}if(l=a.child,l!==null)l.return=a,Sn=l;else e:for(a=t;Sn!==null;){l=Sn;var y=l.sibling,C=l.return;if(e0(l),l===a){Sn=null;break e}if(y!==null){y.return=C,Sn=y;break e}Sn=C}}}var EE={getCacheForType:function(t){var r=Nn(dn),a=r.data.get(t);return a===void 0&&(a=t(),r.data.set(t,a)),a},cacheSignal:function(){return Nn(dn).controller.signal}},kE=typeof WeakMap=="function"?WeakMap:Map,_t=0,Mt=null,et=null,rt=0,St=0,_i=null,is=!1,Na=!1,Jd=!1,Rr=0,tn=0,rs=0,Gs=0,Qd=0,vi=0,Oa=0,tl=null,ai=null,ef=!1,Gc=0,h0=0,qc=1/0,Kc=null,ss=null,yn=0,as=null,Da=null,Lr=0,tf=0,nf=null,d0=null,nl=0,rf=null;function bi(){return(_t&2)!==0&&rt!==0?rt&-rt:z.T!==null?uf():dr()}function f0(){if(vi===0)if((rt&536870912)===0||lt){var t=An;An<<=1,(An&3932160)===0&&(An=262144),vi=t}else vi=536870912;return t=gi.current,t!==null&&(t.flags|=32),vi}function oi(t,r,a){(t===Mt&&(St===2||St===9)||t.cancelPendingCommit!==null)&&(ja(t,0),os(t,rt,vi,!1)),ht(t,a),((_t&2)===0||t!==Mt)&&(t===Mt&&((_t&2)===0&&(Gs|=a),tn===4&&os(t,rt,vi,!1)),rr(t))}function p0(t,r,a){if((_t&6)!==0)throw Error(s(327));var l=!a&&(r&127)===0&&(r&t.expiredLanes)===0||pe(t,r),y=l?RE(t,r):af(t,r,!0),C=l;do{if(y===0){Na&&!l&&os(t,r,0,!1);break}else{if(a=t.current.alternate,C&&!TE(a)){y=af(t,r,!1),C=!1;continue}if(y===2){if(C=r,t.errorRecoveryDisabledLanes&C)var O=0;else O=t.pendingLanes&-536870913,O=O!==0?O:O&536870912?536870912:0;if(O!==0){r=O;e:{var U=t;y=tl;var ne=U.current.memoizedState.isDehydrated;if(ne&&(ja(U,O).flags|=256),O=af(U,O,!1),O!==2){if(Jd&&!ne){U.errorRecoveryDisabledLanes|=C,Gs|=C,y=4;break e}C=ai,ai=y,C!==null&&(ai===null?ai=C:ai.push.apply(ai,C))}y=O}if(C=!1,y!==2)continue}}if(y===1){ja(t,0),os(t,r,0,!0);break}e:{switch(l=t,C=y,C){case 0:case 1:throw Error(s(345));case 4:if((r&4194048)!==r)break;case 6:os(l,r,vi,!is);break e;case 2:ai=null;break;case 3:case 5:break;default:throw Error(s(329))}if((r&62914560)===r&&(y=Gc+300-ut(),10<y)){if(os(l,r,vi,!is),te(l,0,!0)!==0)break e;Lr=r,l.timeoutHandle=G0(g0.bind(null,l,a,ai,Kc,ef,r,vi,Gs,Oa,is,C,"Throttled",-0,0),y);break e}g0(l,a,ai,Kc,ef,r,vi,Gs,Oa,is,C,null,-0,0)}}break}while(!0);rr(t)}function g0(t,r,a,l,y,C,O,U,ne,ce,fe,me,ue,he){if(t.timeoutHandle=-1,me=r.subtreeFlags,me&8192||(me&16785408)===16785408){me={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:xe},o0(r,C,me);var Te=(C&62914560)===C?Gc-ut():(C&4194048)===C?h0-ut():0;if(Te=h5(me,Te),Te!==null){Lr=C,t.cancelPendingCommit=Te(x0.bind(null,t,r,C,a,l,y,O,U,ne,fe,me,null,ue,he)),os(t,C,O,!ce);return}}x0(t,r,C,a,l,y,O,U,ne)}function TE(t){for(var r=t;;){var a=r.tag;if((a===0||a===11||a===15)&&r.flags&16384&&(a=r.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var l=0;l<a.length;l++){var y=a[l],C=y.getSnapshot;y=y.value;try{if(!fi(C(),y))return!1}catch{return!1}}if(a=r.child,r.subtreeFlags&16384&&a!==null)a.return=r,r=a;else{if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function os(t,r,a,l){r&=~Qd,r&=~Gs,t.suspendedLanes|=r,t.pingedLanes&=~r,l&&(t.warmLanes|=r),l=t.expirationTimes;for(var y=r;0<y;){var C=31-Je(y),O=1<<C;l[C]=-1,y&=~O}a!==0&&Ce(t,a,r)}function Vc(){return(_t&6)===0?(il(0),!1):!0}function sf(){if(et!==null){if(St===0)var t=et.return;else t=et,br=Is=null,yd(t),Ea=null,zo=0,t=et;for(;t!==null;)qv(t.alternate,t),t=t.return;et=null}}function ja(t,r){var a=t.timeoutHandle;a!==-1&&(t.timeoutHandle=-1,KE(a)),a=t.cancelPendingCommit,a!==null&&(t.cancelPendingCommit=null,a()),Lr=0,sf(),Mt=t,et=a=_r(t.current,null),rt=r,St=0,_i=null,is=!1,Na=pe(t,r),Jd=!1,Oa=vi=Qd=Gs=rs=tn=0,ai=tl=null,ef=!1,(r&8)!==0&&(r|=r&32);var l=t.entangledLanes;if(l!==0)for(t=t.entanglements,l&=r;0<l;){var y=31-Je(l),C=1<<y;r|=t[y],l&=~C}return Rr=r,gc(),a}function m0(t,r){qe=null,z.H=Ko,r===Ca||r===xc?(r=N_(),St=3):r===ld?(r=N_(),St=4):St=r===Id?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,_i=r,et===null&&(tn=1,Bc(t,Ri(r,t.current)))}function _0(){var t=gi.current;return t===null?!0:(rt&4194048)===rt?Oi===null:(rt&62914560)===rt||(rt&536870912)!==0?t===Oi:!1}function v0(){var t=z.H;return z.H=Ko,t===null?Ko:t}function b0(){var t=z.A;return z.A=EE,t}function Yc(){tn=4,is||(rt&4194048)!==rt&&gi.current!==null||(Na=!0),(rs&134217727)===0&&(Gs&134217727)===0||Mt===null||os(Mt,rt,vi,!1)}function af(t,r,a){var l=_t;_t|=2;var y=v0(),C=b0();(Mt!==t||rt!==r)&&(Kc=null,ja(t,r)),r=!1;var O=tn;e:do try{if(St!==0&&et!==null){var U=et,ne=_i;switch(St){case 8:sf(),O=6;break e;case 3:case 2:case 9:case 6:gi.current===null&&(r=!0);var ce=St;if(St=0,_i=null,Ia(t,U,ne,ce),a&&Na){O=0;break e}break;default:ce=St,St=0,_i=null,Ia(t,U,ne,ce)}}AE(),O=tn;break}catch(fe){m0(t,fe)}while(!0);return r&&t.shellSuspendCounter++,br=Is=null,_t=l,z.H=y,z.A=C,et===null&&(Mt=null,rt=0,gc()),O}function AE(){for(;et!==null;)y0(et)}function RE(t,r){var a=_t;_t|=2;var l=v0(),y=b0();Mt!==t||rt!==r?(Kc=null,qc=ut()+500,ja(t,r)):Na=pe(t,r);e:do try{if(St!==0&&et!==null){r=et;var C=_i;t:switch(St){case 1:St=0,_i=null,Ia(t,r,C,1);break;case 2:case 9:if(L_(C)){St=0,_i=null,S0(r);break}r=function(){St!==2&&St!==9||Mt!==t||(St=7),rr(t)},C.then(r,r);break e;case 3:St=7;break e;case 4:St=5;break e;case 7:L_(C)?(St=0,_i=null,S0(r)):(St=0,_i=null,Ia(t,r,C,7));break;case 5:var O=null;switch(et.tag){case 26:O=et.memoizedState;case 5:case 27:var U=et;if(O?ab(O):U.stateNode.complete){St=0,_i=null;var ne=U.sibling;if(ne!==null)et=ne;else{var ce=U.return;ce!==null?(et=ce,Xc(ce)):et=null}break t}}St=0,_i=null,Ia(t,r,C,5);break;case 6:St=0,_i=null,Ia(t,r,C,6);break;case 8:sf(),tn=6;break e;default:throw Error(s(462))}}LE();break}catch(fe){m0(t,fe)}while(!0);return br=Is=null,z.H=l,z.A=y,_t=a,et!==null?0:(Mt=null,rt=0,gc(),tn)}function LE(){for(;et!==null&&!kn();)y0(et)}function y0(t){var r=Wv(t.alternate,t,Rr);t.memoizedProps=t.pendingProps,r===null?Xc(t):et=r}function S0(t){var r=t,a=r.alternate;switch(r.tag){case 15:case 0:r=Pv(a,r,r.pendingProps,r.type,void 0,rt);break;case 11:r=Pv(a,r,r.pendingProps,r.type.render,r.ref,rt);break;case 5:yd(r);default:qv(a,r),r=et=b_(r,Rr),r=Wv(a,r,Rr)}t.memoizedProps=t.pendingProps,r===null?Xc(t):et=r}function Ia(t,r,a,l){br=Is=null,yd(r),Ea=null,zo=0;var y=r.return;try{if(vE(t,y,r,a,rt)){tn=1,Bc(t,Ri(a,t.current)),et=null;return}}catch(C){if(y!==null)throw et=y,C;tn=1,Bc(t,Ri(a,t.current)),et=null;return}r.flags&32768?(lt||l===1?t=!0:Na||(rt&536870912)!==0?t=!1:(is=t=!0,(l===2||l===9||l===3||l===6)&&(l=gi.current,l!==null&&l.tag===13&&(l.flags|=16384))),w0(r,t)):Xc(r)}function Xc(t){var r=t;do{if((r.flags&32768)!==0){w0(r,is);return}t=r.return;var a=SE(r.alternate,r,Rr);if(a!==null){et=a;return}if(r=r.sibling,r!==null){et=r;return}et=r=t}while(r!==null);tn===0&&(tn=5)}function w0(t,r){do{var a=wE(t.alternate,t);if(a!==null){a.flags&=32767,et=a;return}if(a=t.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!r&&(t=t.sibling,t!==null)){et=t;return}et=t=a}while(t!==null);tn=6,et=null}function x0(t,r,a,l,y,C,O,U,ne){t.cancelPendingCommit=null;do Zc();while(yn!==0);if((_t&6)!==0)throw Error(s(327));if(r!==null){if(r===t.current)throw Error(s(177));if(C=r.lanes|r.childLanes,C|=Kh,ke(t,a,C,O,U,ne),t===Mt&&(et=Mt=null,rt=0),Da=r,as=t,Lr=a,tf=C,nf=y,d0=l,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,DE(Kt,function(){return A0(),null})):(t.callbackNode=null,t.callbackPriority=0),l=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||l){l=z.T,z.T=null,y=G.p,G.p=2,O=_t,_t|=4;try{xE(t,r,a)}finally{_t=O,G.p=y,z.T=l}}yn=1,C0(),E0(),k0()}}function C0(){if(yn===1){yn=0;var t=as,r=Da,a=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||a){a=z.T,z.T=null;var l=G.p;G.p=2;var y=_t;_t|=4;try{r0(r,t);var C=vf,O=u_(t.containerInfo),U=C.focusedElem,ne=C.selectionRange;if(O!==U&&U&&U.ownerDocument&&c_(U.ownerDocument.documentElement,U)){if(ne!==null&&Uh(U)){var ce=ne.start,fe=ne.end;if(fe===void 0&&(fe=ce),"selectionStart"in U)U.selectionStart=ce,U.selectionEnd=Math.min(fe,U.value.length);else{var me=U.ownerDocument||document,ue=me&&me.defaultView||window;if(ue.getSelection){var he=ue.getSelection(),Te=U.textContent.length,He=Math.min(ne.start,Te),Tt=ne.end===void 0?He:Math.min(ne.end,Te);!he.extend&&He>Tt&&(O=Tt,Tt=He,He=O);var re=l_(U,He),ie=l_(U,Tt);if(re&&ie&&(he.rangeCount!==1||he.anchorNode!==re.node||he.anchorOffset!==re.offset||he.focusNode!==ie.node||he.focusOffset!==ie.offset)){var le=me.createRange();le.setStart(re.node,re.offset),he.removeAllRanges(),He>Tt?(he.addRange(le),he.extend(ie.node,ie.offset)):(le.setEnd(ie.node,ie.offset),he.addRange(le))}}}}for(me=[],he=U;he=he.parentNode;)he.nodeType===1&&me.push({element:he,left:he.scrollLeft,top:he.scrollTop});for(typeof U.focus=="function"&&U.focus(),U=0;U<me.length;U++){var ge=me[U];ge.element.scrollLeft=ge.left,ge.element.scrollTop=ge.top}}cu=!!_f,vf=_f=null}finally{_t=y,G.p=l,z.T=a}}t.current=r,yn=2}}function E0(){if(yn===2){yn=0;var t=as,r=Da,a=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||a){a=z.T,z.T=null;var l=G.p;G.p=2;var y=_t;_t|=4;try{Qv(t,r.alternate,r)}finally{_t=y,G.p=l,z.T=a}}yn=3}}function k0(){if(yn===4||yn===3){yn=0,Zt();var t=as,r=Da,a=Lr,l=d0;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?yn=5:(yn=0,Da=as=null,T0(t,t.pendingLanes));var y=t.pendingLanes;if(y===0&&(ss=null),Rn(a),r=r.stateNode,ve&&typeof ve.onCommitFiberRoot=="function")try{ve.onCommitFiberRoot(Tn,r,void 0,(r.current.flags&128)===128)}catch{}if(l!==null){r=z.T,y=G.p,G.p=2,z.T=null;try{for(var C=t.onRecoverableError,O=0;O<l.length;O++){var U=l[O];C(U.value,{componentStack:U.stack})}}finally{z.T=r,G.p=y}}(Lr&3)!==0&&Zc(),rr(t),y=t.pendingLanes,(a&261930)!==0&&(y&42)!==0?t===rf?nl++:(nl=0,rf=t):nl=0,il(0)}}function T0(t,r){(t.pooledCacheLanes&=r)===0&&(r=t.pooledCache,r!=null&&(t.pooledCache=null,Bo(r)))}function Zc(){return C0(),E0(),k0(),A0()}function A0(){if(yn!==5)return!1;var t=as,r=tf;tf=0;var a=Rn(Lr),l=z.T,y=G.p;try{G.p=32>a?32:a,z.T=null,a=nf,nf=null;var C=as,O=Lr;if(yn=0,Da=as=null,Lr=0,(_t&6)!==0)throw Error(s(331));var U=_t;if(_t|=4,c0(C.current),a0(C,C.current,O,a),_t=U,il(0,!1),ve&&typeof ve.onPostCommitFiberRoot=="function")try{ve.onPostCommitFiberRoot(Tn,C)}catch{}return!0}finally{G.p=y,z.T=l,T0(t,r)}}function R0(t,r,a){r=Ri(a,r),r=jd(t.stateNode,r,2),t=Qr(t,r,2),t!==null&&(ht(t,2),rr(t))}function wt(t,r,a){if(t.tag===3)R0(t,t,a);else for(;r!==null;){if(r.tag===3){R0(r,t,a);break}else if(r.tag===1){var l=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(ss===null||!ss.has(l))){t=Ri(a,t),a=Lv(2),l=Qr(r,a,2),l!==null&&(Mv(a,l,r,t),ht(l,2),rr(l));break}}r=r.return}}function of(t,r,a){var l=t.pingCache;if(l===null){l=t.pingCache=new kE;var y=new Set;l.set(r,y)}else y=l.get(r),y===void 0&&(y=new Set,l.set(r,y));y.has(a)||(Jd=!0,y.add(a),t=ME.bind(null,t,r,a),r.then(t,t))}function ME(t,r,a){var l=t.pingCache;l!==null&&l.delete(r),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,Mt===t&&(rt&a)===a&&(tn===4||tn===3&&(rt&62914560)===rt&&300>ut()-Gc?(_t&2)===0&&ja(t,0):Qd|=a,Oa===rt&&(Oa=0)),rr(t)}function L0(t,r){r===0&&(r=je()),t=Os(t,r),t!==null&&(ht(t,r),rr(t))}function NE(t){var r=t.memoizedState,a=0;r!==null&&(a=r.retryLane),L0(t,a)}function OE(t,r){var a=0;switch(t.tag){case 31:case 13:var l=t.stateNode,y=t.memoizedState;y!==null&&(a=y.retryLane);break;case 19:l=t.stateNode;break;case 22:l=t.stateNode._retryCache;break;default:throw Error(s(314))}l!==null&&l.delete(r),L0(t,a)}function DE(t,r){return vn(t,r)}var Jc=null,Ba=null,lf=!1,Qc=!1,cf=!1,ls=0;function rr(t){t!==Ba&&t.next===null&&(Ba===null?Jc=Ba=t:Ba=Ba.next=t),Qc=!0,lf||(lf=!0,IE())}function il(t,r){if(!cf&&Qc){cf=!0;do for(var a=!1,l=Jc;l!==null;){if(t!==0){var y=l.pendingLanes;if(y===0)var C=0;else{var O=l.suspendedLanes,U=l.pingedLanes;C=(1<<31-Je(42|t)+1)-1,C&=y&~(O&~U),C=C&201326741?C&201326741|1:C?C|2:0}C!==0&&(a=!0,D0(l,C))}else C=rt,C=te(l,l===Mt?C:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(C&3)===0||pe(l,C)||(a=!0,D0(l,C));l=l.next}while(a);cf=!1}}function jE(){M0()}function M0(){Qc=lf=!1;var t=0;ls!==0&&qE()&&(t=ls);for(var r=ut(),a=null,l=Jc;l!==null;){var y=l.next,C=N0(l,r);C===0?(l.next=null,a===null?Jc=y:a.next=y,y===null&&(Ba=a)):(a=l,(t!==0||(C&3)!==0)&&(Qc=!0)),l=y}yn!==0&&yn!==5||il(t),ls!==0&&(ls=0)}function N0(t,r){for(var a=t.suspendedLanes,l=t.pingedLanes,y=t.expirationTimes,C=t.pendingLanes&-62914561;0<C;){var O=31-Je(C),U=1<<O,ne=y[O];ne===-1?((U&a)===0||(U&l)!==0)&&(y[O]=Se(U,r)):ne<=r&&(t.expiredLanes|=U),C&=~U}if(r=Mt,a=rt,a=te(t,t===r?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l=t.callbackNode,a===0||t===r&&(St===2||St===9)||t.cancelPendingCommit!==null)return l!==null&&l!==null&&on(l),t.callbackNode=null,t.callbackPriority=0;if((a&3)===0||pe(t,a)){if(r=a&-a,r===t.callbackPriority)return r;switch(l!==null&&on(l),Rn(a)){case 2:case 8:a=Ft;break;case 32:a=Kt;break;case 268435456:a=bn;break;default:a=Kt}return l=O0.bind(null,t),a=vn(a,l),t.callbackPriority=r,t.callbackNode=a,r}return l!==null&&l!==null&&on(l),t.callbackPriority=2,t.callbackNode=null,2}function O0(t,r){if(yn!==0&&yn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var a=t.callbackNode;if(Zc()&&t.callbackNode!==a)return null;var l=rt;return l=te(t,t===Mt?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l===0?null:(p0(t,l,r),N0(t,ut()),t.callbackNode!=null&&t.callbackNode===a?O0.bind(null,t):null)}function D0(t,r){if(Zc())return null;p0(t,r,!0)}function IE(){VE(function(){(_t&6)!==0?vn(Ct,jE):M0()})}function uf(){if(ls===0){var t=wa;t===0&&(t=Dt,Dt<<=1,(Dt&261888)===0&&(Dt=256)),ls=t}return ls}function j0(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Gr(""+t)}function I0(t,r){var a=r.ownerDocument.createElement("input");return a.name=r.name,a.value=r.value,t.id&&a.setAttribute("form",t.id),r.parentNode.insertBefore(a,r),t=new FormData(t),a.parentNode.removeChild(a),t}function BE(t,r,a,l,y){if(r==="submit"&&a&&a.stateNode===y){var C=j0((y[Nt]||null).action),O=l.submitter;O&&(r=(r=O[Nt]||null)?j0(r.formAction):O.getAttribute("formAction"),r!==null&&(C=r,O=null));var U=new hc("action","action",null,l,y);t.push({event:U,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(ls!==0){var ne=O?I0(y,O):new FormData(y);Rd(a,{pending:!0,data:ne,method:y.method,action:C},null,ne)}}else typeof C=="function"&&(U.preventDefault(),ne=O?I0(y,O):new FormData(y),Rd(a,{pending:!0,data:ne,method:y.method,action:C},C,ne))},currentTarget:y}]})}}for(var hf=0;hf<qh.length;hf++){var df=qh[hf],PE=df.toLowerCase(),zE=df[0].toUpperCase()+df.slice(1);Wi(PE,"on"+zE)}Wi(f_,"onAnimationEnd"),Wi(p_,"onAnimationIteration"),Wi(g_,"onAnimationStart"),Wi("dblclick","onDoubleClick"),Wi("focusin","onFocus"),Wi("focusout","onBlur"),Wi(tE,"onTransitionRun"),Wi(nE,"onTransitionStart"),Wi(iE,"onTransitionCancel"),Wi(m_,"onTransitionEnd"),be("onMouseEnter",["mouseout","mouseover"]),be("onMouseLeave",["mouseout","mouseover"]),be("onPointerEnter",["pointerout","pointerover"]),be("onPointerLeave",["pointerout","pointerover"]),Qt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Qt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Qt("onBeforeInput",["compositionend","keypress","textInput","paste"]),Qt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Qt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Qt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var rl="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(" "),HE=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(rl));function B0(t,r){r=(r&4)!==0;for(var a=0;a<t.length;a++){var l=t[a],y=l.event;l=l.listeners;e:{var C=void 0;if(r)for(var O=l.length-1;0<=O;O--){var U=l[O],ne=U.instance,ce=U.currentTarget;if(U=U.listener,ne!==C&&y.isPropagationStopped())break e;C=U,y.currentTarget=ce;try{C(y)}catch(fe){pc(fe)}y.currentTarget=null,C=ne}else for(O=0;O<l.length;O++){if(U=l[O],ne=U.instance,ce=U.currentTarget,U=U.listener,ne!==C&&y.isPropagationStopped())break e;C=U,y.currentTarget=ce;try{C(y)}catch(fe){pc(fe)}y.currentTarget=null,C=ne}}}}function tt(t,r){var a=r[Fr];a===void 0&&(a=r[Fr]=new Set);var l=t+"__bubble";a.has(l)||(P0(r,t,2,!1),a.add(l))}function ff(t,r,a){var l=0;r&&(l|=4),P0(a,t,l,r)}var eu="_reactListening"+Math.random().toString(36).slice(2);function pf(t){if(!t[eu]){t[eu]=!0,Bt.forEach(function(a){a!=="selectionchange"&&(HE.has(a)||ff(a,!1,t),ff(a,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[eu]||(r[eu]=!0,ff("selectionchange",!1,r))}}function P0(t,r,a,l){switch(fb(r)){case 2:var y=p5;break;case 8:y=g5;break;default:y=Rf}a=y.bind(null,r,a,t),y=void 0,!Oh||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(y=!0),l?y!==void 0?t.addEventListener(r,a,{capture:!0,passive:y}):t.addEventListener(r,a,!0):y!==void 0?t.addEventListener(r,a,{passive:y}):t.addEventListener(r,a,!1)}function gf(t,r,a,l,y){var C=l;if((r&1)===0&&(r&2)===0&&l!==null)e:for(;;){if(l===null)return;var O=l.tag;if(O===3||O===4){var U=l.stateNode.containerInfo;if(U===y)break;if(O===4)for(O=l.return;O!==null;){var ne=O.tag;if((ne===3||ne===4)&&O.stateNode.containerInfo===y)return;O=O.return}for(;U!==null;){if(O=Q(U),O===null)return;if(ne=O.tag,ne===5||ne===6||ne===26||ne===27){l=C=O;continue e}U=U.parentNode}}l=l.return}oc(function(){var ce=C,fe=We(a),me=[];e:{var ue=__.get(t);if(ue!==void 0){var he=hc,Te=t;switch(t){case"keypress":if(cc(a)===0)break e;case"keydown":case"keyup":he=O2;break;case"focusin":Te="focus",he=Bh;break;case"focusout":Te="blur",he=Bh;break;case"beforeblur":case"afterblur":he=Bh;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":he=qm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":he=S2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":he=I2;break;case f_:case p_:case g_:he=C2;break;case m_:he=P2;break;case"scroll":case"scrollend":he=b2;break;case"wheel":he=H2;break;case"copy":case"cut":case"paste":he=k2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":he=Vm;break;case"toggle":case"beforetoggle":he=U2}var He=(r&4)!==0,Tt=!He&&(t==="scroll"||t==="scrollend"),re=He?ue!==null?ue+"Capture":null:ue;He=[];for(var ie=ce,le;ie!==null;){var ge=ie;if(le=ge.stateNode,ge=ge.tag,ge!==5&&ge!==26&&ge!==27||le===null||re===null||(ge=ko(ie,re),ge!=null&&He.push(sl(ie,ge,le))),Tt)break;ie=ie.return}0<He.length&&(ue=new he(ue,Te,null,a,fe),me.push({event:ue,listeners:He}))}}if((r&7)===0){e:{if(ue=t==="mouseover"||t==="pointerover",he=t==="mouseout"||t==="pointerout",ue&&a!==Ae&&(Te=a.relatedTarget||a.fromElement)&&(Q(Te)||Te[Fi]))break e;if((he||ue)&&(ue=fe.window===fe?fe:(ue=fe.ownerDocument)?ue.defaultView||ue.parentWindow:window,he?(Te=a.relatedTarget||a.toElement,he=ce,Te=Te?Q(Te):null,Te!==null&&(Tt=f(Te),He=Te.tag,Te!==Tt||He!==5&&He!==27&&He!==6)&&(Te=null)):(he=null,Te=ce),he!==Te)){if(He=qm,ge="onMouseLeave",re="onMouseEnter",ie="mouse",(t==="pointerout"||t==="pointerover")&&(He=Vm,ge="onPointerLeave",re="onPointerEnter",ie="pointer"),Tt=he==null?ue:Ee(he),le=Te==null?ue:Ee(Te),ue=new He(ge,ie+"leave",he,a,fe),ue.target=Tt,ue.relatedTarget=le,ge=null,Q(fe)===ce&&(He=new He(re,ie+"enter",Te,a,fe),He.target=le,He.relatedTarget=Tt,ge=He),Tt=ge,he&&Te)t:{for(He=$E,re=he,ie=Te,le=0,ge=re;ge;ge=He(ge))le++;ge=0;for(var Be=ie;Be;Be=He(Be))ge++;for(;0<le-ge;)re=He(re),le--;for(;0<ge-le;)ie=He(ie),ge--;for(;le--;){if(re===ie||ie!==null&&re===ie.alternate){He=re;break t}re=He(re),ie=He(ie)}He=null}else He=null;he!==null&&z0(me,ue,he,He,!1),Te!==null&&Tt!==null&&z0(me,Tt,Te,He,!0)}}e:{if(ue=ce?Ee(ce):window,he=ue.nodeName&&ue.nodeName.toLowerCase(),he==="select"||he==="input"&&ue.type==="file")var pt=n_;else if(e_(ue))if(i_)pt=J2;else{pt=X2;var Re=Y2}else he=ue.nodeName,!he||he.toLowerCase()!=="input"||ue.type!=="checkbox"&&ue.type!=="radio"?ce&&Wr(ce.elementType)&&(pt=n_):pt=Z2;if(pt&&(pt=pt(t,ce))){t_(me,pt,a,fe);break e}Re&&Re(t,ue,ce),t==="focusout"&&ce&&ue.type==="number"&&ce.memoizedProps.value!=null&&ha(ue,"number",ue.value)}switch(Re=ce?Ee(ce):window,t){case"focusin":(e_(Re)||Re.contentEditable==="true")&&(pa=Re,Fh=ce,Do=null);break;case"focusout":Do=Fh=pa=null;break;case"mousedown":Wh=!0;break;case"contextmenu":case"mouseup":case"dragend":Wh=!1,h_(me,a,fe);break;case"selectionchange":if(eE)break;case"keydown":case"keyup":h_(me,a,fe)}var Ye;if(zh)e:{switch(t){case"compositionstart":var st="onCompositionStart";break e;case"compositionend":st="onCompositionEnd";break e;case"compositionupdate":st="onCompositionUpdate";break e}st=void 0}else fa?Jm(t,a)&&(st="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(st="onCompositionStart");st&&(Ym&&a.locale!=="ko"&&(fa||st!=="onCompositionStart"?st==="onCompositionEnd"&&fa&&(Ye=Wm()):(qr=fe,Dh="value"in qr?qr.value:qr.textContent,fa=!0)),Re=tu(ce,st),0<Re.length&&(st=new Km(st,t,null,a,fe),me.push({event:st,listeners:Re}),Ye?st.data=Ye:(Ye=Qm(a),Ye!==null&&(st.data=Ye)))),(Ye=W2?G2(t,a):q2(t,a))&&(st=tu(ce,"onBeforeInput"),0<st.length&&(Re=new Km("onBeforeInput","beforeinput",null,a,fe),me.push({event:Re,listeners:st}),Re.data=Ye)),BE(me,t,ce,a,fe)}B0(me,r)})}function sl(t,r,a){return{instance:t,listener:r,currentTarget:a}}function tu(t,r){for(var a=r+"Capture",l=[];t!==null;){var y=t,C=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||C===null||(y=ko(t,a),y!=null&&l.unshift(sl(t,y,C)),y=ko(t,r),y!=null&&l.push(sl(t,y,C))),t.tag===3)return l;t=t.return}return[]}function $E(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function z0(t,r,a,l,y){for(var C=r._reactName,O=[];a!==null&&a!==l;){var U=a,ne=U.alternate,ce=U.stateNode;if(U=U.tag,ne!==null&&ne===l)break;U!==5&&U!==26&&U!==27||ce===null||(ne=ce,y?(ce=ko(a,C),ce!=null&&O.unshift(sl(a,ce,ne))):y||(ce=ko(a,C),ce!=null&&O.push(sl(a,ce,ne)))),a=a.return}O.length!==0&&t.push({event:r,listeners:O})}var UE=/\r\n?/g,FE=/\u0000|\uFFFD/g;function H0(t){return(typeof t=="string"?t:""+t).replace(UE,`
|
|
9
|
+
`).replace(FE,"")}function $0(t,r){return r=H0(r),H0(t)===r}function kt(t,r,a,l,y,C){switch(a){case"children":typeof l=="string"?r==="body"||r==="textarea"&&l===""||Ue(t,l):(typeof l=="number"||typeof l=="bigint")&&r!=="body"&&Ue(t,""+l);break;case"className":hi(t,"class",l);break;case"tabIndex":hi(t,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":hi(t,a,l);break;case"style":yt(t,l,C);break;case"data":if(r!=="object"){hi(t,"data",l);break}case"src":case"href":if(l===""&&(r!=="a"||a!=="href")){t.removeAttribute(a);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(a);break}l=Gr(""+l),t.setAttribute(a,l);break;case"action":case"formAction":if(typeof l=="function"){t.setAttribute(a,"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 C=="function"&&(a==="formAction"?(r!=="input"&&kt(t,r,"name",y.name,y,null),kt(t,r,"formEncType",y.formEncType,y,null),kt(t,r,"formMethod",y.formMethod,y,null),kt(t,r,"formTarget",y.formTarget,y,null)):(kt(t,r,"encType",y.encType,y,null),kt(t,r,"method",y.method,y,null),kt(t,r,"target",y.target,y,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(a);break}l=Gr(""+l),t.setAttribute(a,l);break;case"onClick":l!=null&&(t.onclick=xe);break;case"onScroll":l!=null&&tt("scroll",t);break;case"onScrollEnd":l!=null&&tt("scrollend",t);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(a=l.__html,a!=null){if(y.children!=null)throw Error(s(60));t.innerHTML=a}}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}a=Gr(""+l),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);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(a,""+l):t.removeAttribute(a);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(a,""):t.removeAttribute(a);break;case"capture":case"download":l===!0?t.setAttribute(a,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(a,l):t.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?t.setAttribute(a,l):t.removeAttribute(a);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?t.removeAttribute(a):t.setAttribute(a,l);break;case"popover":tt("beforetoggle",t),tt("toggle",t),zn(t,"popover",l);break;case"xlinkActuate":ei(t,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":ei(t,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":ei(t,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":ei(t,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":ei(t,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":ei(t,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":ei(t,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":ei(t,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":ei(t,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":zn(t,"is",l);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=gr.get(a)||a,zn(t,a,l))}}function mf(t,r,a,l,y,C){switch(a){case"style":yt(t,l,C);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(a=l.__html,a!=null){if(y.children!=null)throw Error(s(60));t.innerHTML=a}}break;case"children":typeof l=="string"?Ue(t,l):(typeof l=="number"||typeof l=="bigint")&&Ue(t,""+l);break;case"onScroll":l!=null&&tt("scroll",t);break;case"onScrollEnd":l!=null&&tt("scrollend",t);break;case"onClick":l!=null&&(t.onclick=xe);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Jt.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(y=a.endsWith("Capture"),r=a.slice(2,y?a.length-7:void 0),C=t[Nt]||null,C=C!=null?C[a]:null,typeof C=="function"&&t.removeEventListener(r,C,y),typeof l=="function")){typeof C!="function"&&C!==null&&(a in t?t[a]=null:t.hasAttribute(a)&&t.removeAttribute(a)),t.addEventListener(r,l,y);break e}a in t?t[a]=l:l===!0?t.setAttribute(a,""):zn(t,a,l)}}}function Dn(t,r,a){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":tt("error",t),tt("load",t);var l=!1,y=!1,C;for(C in a)if(a.hasOwnProperty(C)){var O=a[C];if(O!=null)switch(C){case"src":l=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:kt(t,r,C,O,a,null)}}y&&kt(t,r,"srcSet",a.srcSet,a,null),l&&kt(t,r,"src",a.src,a,null);return;case"input":tt("invalid",t);var U=C=O=y=null,ne=null,ce=null;for(l in a)if(a.hasOwnProperty(l)){var fe=a[l];if(fe!=null)switch(l){case"name":y=fe;break;case"type":O=fe;break;case"checked":ne=fe;break;case"defaultChecked":ce=fe;break;case"value":C=fe;break;case"defaultValue":U=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(s(137,r));break;default:kt(t,r,l,fe,a,null)}}Rs(t,C,U,ne,ce,O,y,!1);return;case"select":tt("invalid",t),l=O=C=null;for(y in a)if(a.hasOwnProperty(y)&&(U=a[y],U!=null))switch(y){case"value":C=U;break;case"defaultValue":O=U;break;case"multiple":l=U;default:kt(t,r,y,U,a,null)}r=C,a=O,t.multiple=!!l,r!=null?Ln(t,!!l,r,!1):a!=null&&Ln(t,!!l,a,!0);return;case"textarea":tt("invalid",t),C=y=l=null;for(O in a)if(a.hasOwnProperty(O)&&(U=a[O],U!=null))switch(O){case"value":l=U;break;case"defaultValue":y=U;break;case"children":C=U;break;case"dangerouslySetInnerHTML":if(U!=null)throw Error(s(91));break;default:kt(t,r,O,U,a,null)}da(t,l,y,C);return;case"option":for(ne in a)a.hasOwnProperty(ne)&&(l=a[ne],l!=null)&&(ne==="selected"?t.selected=l&&typeof l!="function"&&typeof l!="symbol":kt(t,r,ne,l,a,null));return;case"dialog":tt("beforetoggle",t),tt("toggle",t),tt("cancel",t),tt("close",t);break;case"iframe":case"object":tt("load",t);break;case"video":case"audio":for(l=0;l<rl.length;l++)tt(rl[l],t);break;case"image":tt("error",t),tt("load",t);break;case"details":tt("toggle",t);break;case"embed":case"source":case"link":tt("error",t),tt("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(ce in a)if(a.hasOwnProperty(ce)&&(l=a[ce],l!=null))switch(ce){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:kt(t,r,ce,l,a,null)}return;default:if(Wr(r)){for(fe in a)a.hasOwnProperty(fe)&&(l=a[fe],l!==void 0&&mf(t,r,fe,l,a,void 0));return}}for(U in a)a.hasOwnProperty(U)&&(l=a[U],l!=null&&kt(t,r,U,l,a,null))}function WE(t,r,a,l){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,C=null,O=null,U=null,ne=null,ce=null,fe=null;for(he in a){var me=a[he];if(a.hasOwnProperty(he)&&me!=null)switch(he){case"checked":break;case"value":break;case"defaultValue":ne=me;default:l.hasOwnProperty(he)||kt(t,r,he,null,l,me)}}for(var ue in l){var he=l[ue];if(me=a[ue],l.hasOwnProperty(ue)&&(he!=null||me!=null))switch(ue){case"type":C=he;break;case"name":y=he;break;case"checked":ce=he;break;case"defaultChecked":fe=he;break;case"value":O=he;break;case"defaultValue":U=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(s(137,r));break;default:he!==me&&kt(t,r,ue,he,l,me)}}xo(t,O,U,ne,ce,fe,C,y);return;case"select":he=O=U=ue=null;for(C in a)if(ne=a[C],a.hasOwnProperty(C)&&ne!=null)switch(C){case"value":break;case"multiple":he=ne;default:l.hasOwnProperty(C)||kt(t,r,C,null,l,ne)}for(y in l)if(C=l[y],ne=a[y],l.hasOwnProperty(y)&&(C!=null||ne!=null))switch(y){case"value":ue=C;break;case"defaultValue":U=C;break;case"multiple":O=C;default:C!==ne&&kt(t,r,y,C,l,ne)}r=U,a=O,l=he,ue!=null?Ln(t,!!a,ue,!1):!!l!=!!a&&(r!=null?Ln(t,!!a,r,!0):Ln(t,!!a,a?[]:"",!1));return;case"textarea":he=ue=null;for(U in a)if(y=a[U],a.hasOwnProperty(U)&&y!=null&&!l.hasOwnProperty(U))switch(U){case"value":break;case"children":break;default:kt(t,r,U,null,l,y)}for(O in l)if(y=l[O],C=a[O],l.hasOwnProperty(O)&&(y!=null||C!=null))switch(O){case"value":ue=y;break;case"defaultValue":he=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(s(91));break;default:y!==C&&kt(t,r,O,y,l,C)}sc(t,ue,he);return;case"option":for(var Te in a)ue=a[Te],a.hasOwnProperty(Te)&&ue!=null&&!l.hasOwnProperty(Te)&&(Te==="selected"?t.selected=!1:kt(t,r,Te,null,l,ue));for(ne in l)ue=l[ne],he=a[ne],l.hasOwnProperty(ne)&&ue!==he&&(ue!=null||he!=null)&&(ne==="selected"?t.selected=ue&&typeof ue!="function"&&typeof ue!="symbol":kt(t,r,ne,ue,l,he));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 He in a)ue=a[He],a.hasOwnProperty(He)&&ue!=null&&!l.hasOwnProperty(He)&&kt(t,r,He,null,l,ue);for(ce in l)if(ue=l[ce],he=a[ce],l.hasOwnProperty(ce)&&ue!==he&&(ue!=null||he!=null))switch(ce){case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(s(137,r));break;default:kt(t,r,ce,ue,l,he)}return;default:if(Wr(r)){for(var Tt in a)ue=a[Tt],a.hasOwnProperty(Tt)&&ue!==void 0&&!l.hasOwnProperty(Tt)&&mf(t,r,Tt,void 0,l,ue);for(fe in l)ue=l[fe],he=a[fe],!l.hasOwnProperty(fe)||ue===he||ue===void 0&&he===void 0||mf(t,r,fe,ue,l,he);return}}for(var re in a)ue=a[re],a.hasOwnProperty(re)&&ue!=null&&!l.hasOwnProperty(re)&&kt(t,r,re,null,l,ue);for(me in l)ue=l[me],he=a[me],!l.hasOwnProperty(me)||ue===he||ue==null&&he==null||kt(t,r,me,ue,l,he)}function U0(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function GE(){if(typeof performance.getEntriesByType=="function"){for(var t=0,r=0,a=performance.getEntriesByType("resource"),l=0;l<a.length;l++){var y=a[l],C=y.transferSize,O=y.initiatorType,U=y.duration;if(C&&U&&U0(O)){for(O=0,U=y.responseEnd,l+=1;l<a.length;l++){var ne=a[l],ce=ne.startTime;if(ce>U)break;var fe=ne.transferSize,me=ne.initiatorType;fe&&U0(me)&&(ne=ne.responseEnd,O+=fe*(ne<U?1:(U-ce)/(ne-ce)))}if(--l,r+=8*(C+O)/(y.duration/1e3),t++,10<t)break}}if(0<t)return r/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var _f=null,vf=null;function nu(t){return t.nodeType===9?t:t.ownerDocument}function F0(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 W0(t,r){if(t===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&r==="foreignObject"?0:t}function bf(t,r){return t==="textarea"||t==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var yf=null;function qE(){var t=window.event;return t&&t.type==="popstate"?t===yf?!1:(yf=t,!0):(yf=null,!1)}var G0=typeof setTimeout=="function"?setTimeout:void 0,KE=typeof clearTimeout=="function"?clearTimeout:void 0,q0=typeof Promise=="function"?Promise:void 0,VE=typeof queueMicrotask=="function"?queueMicrotask:typeof q0<"u"?function(t){return q0.resolve(null).then(t).catch(YE)}:G0;function YE(t){setTimeout(function(){throw t})}function cs(t){return t==="head"}function K0(t,r){var a=r,l=0;do{var y=a.nextSibling;if(t.removeChild(a),y&&y.nodeType===8)if(a=y.data,a==="/$"||a==="/&"){if(l===0){t.removeChild(y),$a(r);return}l--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")l++;else if(a==="html")al(t.ownerDocument.documentElement);else if(a==="head"){a=t.ownerDocument.head,al(a);for(var C=a.firstChild;C;){var O=C.nextSibling,U=C.nodeName;C[er]||U==="SCRIPT"||U==="STYLE"||U==="LINK"&&C.rel.toLowerCase()==="stylesheet"||a.removeChild(C),C=O}}else a==="body"&&al(t.ownerDocument.body);a=y}while(a);$a(r)}function V0(t,r){var a=t;t=0;do{var l=a.nextSibling;if(a.nodeType===1?r?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(r?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),l&&l.nodeType===8)if(a=l.data,a==="/$"){if(t===0)break;t--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||t++;a=l}while(a)}function Sf(t){var r=t.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var a=r;switch(r=r.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Sf(a),De(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}t.removeChild(a)}}function XE(t,r,a,l){for(;t.nodeType===1;){var y=a;if(t.nodeName.toLowerCase()!==r.toLowerCase()){if(!l&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(l){if(!t[er])switch(r){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(C=t.getAttribute("rel"),C==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(C!==y.rel||t.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||t.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||t.getAttribute("title")!==(y.title==null?null:y.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(C=t.getAttribute("src"),(C!==(y.src==null?null:y.src)||t.getAttribute("type")!==(y.type==null?null:y.type)||t.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&C&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(r==="input"&&t.type==="hidden"){var C=y.name==null?null:""+y.name;if(y.type==="hidden"&&t.getAttribute("name")===C)return t}else return t;if(t=Di(t.nextSibling),t===null)break}return null}function ZE(t,r,a){if(r==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=Di(t.nextSibling),t===null))return null;return t}function Y0(t,r){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!r||(t=Di(t.nextSibling),t===null))return null;return t}function wf(t){return t.data==="$?"||t.data==="$~"}function xf(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function JE(t,r){var a=t.ownerDocument;if(t.data==="$~")t._reactRetry=r;else if(t.data!=="$?"||a.readyState!=="loading")r();else{var l=function(){r(),a.removeEventListener("DOMContentLoaded",l)};a.addEventListener("DOMContentLoaded",l),t._reactRetry=l}}function Di(t){for(;t!=null;t=t.nextSibling){var r=t.nodeType;if(r===1||r===3)break;if(r===8){if(r=t.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return t}var Cf=null;function X0(t){t=t.nextSibling;for(var r=0;t;){if(t.nodeType===8){var a=t.data;if(a==="/$"||a==="/&"){if(r===0)return Di(t.nextSibling);r--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||r++}t=t.nextSibling}return null}function Z0(t){t=t.previousSibling;for(var r=0;t;){if(t.nodeType===8){var a=t.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(r===0)return t;r--}else a!=="/$"&&a!=="/&"||r++}t=t.previousSibling}return null}function J0(t,r,a){switch(r=nu(a),t){case"html":if(t=r.documentElement,!t)throw Error(s(452));return t;case"head":if(t=r.head,!t)throw Error(s(453));return t;case"body":if(t=r.body,!t)throw Error(s(454));return t;default:throw Error(s(451))}}function al(t){for(var r=t.attributes;r.length;)t.removeAttributeNode(r[0]);De(t)}var ji=new Map,Q0=new Set;function iu(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Mr=G.d;G.d={f:QE,r:e5,D:t5,C:n5,L:i5,m:r5,X:a5,S:s5,M:o5};function QE(){var t=Mr.f(),r=Vc();return t||r}function e5(t){var r=_e(t);r!==null&&r.tag===5&&r.type==="form"?mv(r):Mr.r(t)}var Pa=typeof document>"u"?null:document;function eb(t,r,a){var l=Pa;if(l&&typeof r=="string"&&r){var y=ti(r);y='link[rel="'+t+'"][href="'+y+'"]',typeof a=="string"&&(y+='[crossorigin="'+a+'"]'),Q0.has(y)||(Q0.add(y),t={rel:t,crossOrigin:a,href:r},l.querySelector(y)===null&&(r=l.createElement("link"),Dn(r,"link",t),Qe(r),l.head.appendChild(r)))}}function t5(t){Mr.D(t),eb("dns-prefetch",t,null)}function n5(t,r){Mr.C(t,r),eb("preconnect",t,r)}function i5(t,r,a){Mr.L(t,r,a);var l=Pa;if(l&&t&&r){var y='link[rel="preload"][as="'+ti(r)+'"]';r==="image"&&a&&a.imageSrcSet?(y+='[imagesrcset="'+ti(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(y+='[imagesizes="'+ti(a.imageSizes)+'"]')):y+='[href="'+ti(t)+'"]';var C=y;switch(r){case"style":C=za(t);break;case"script":C=Ha(t)}ji.has(C)||(t=m({rel:"preload",href:r==="image"&&a&&a.imageSrcSet?void 0:t,as:r},a),ji.set(C,t),l.querySelector(y)!==null||r==="style"&&l.querySelector(ol(C))||r==="script"&&l.querySelector(ll(C))||(r=l.createElement("link"),Dn(r,"link",t),Qe(r),l.head.appendChild(r)))}}function r5(t,r){Mr.m(t,r);var a=Pa;if(a&&t){var l=r&&typeof r.as=="string"?r.as:"script",y='link[rel="modulepreload"][as="'+ti(l)+'"][href="'+ti(t)+'"]',C=y;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":C=Ha(t)}if(!ji.has(C)&&(t=m({rel:"modulepreload",href:t},r),ji.set(C,t),a.querySelector(y)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(ll(C)))return}l=a.createElement("link"),Dn(l,"link",t),Qe(l),a.head.appendChild(l)}}}function s5(t,r,a){Mr.S(t,r,a);var l=Pa;if(l&&t){var y=ot(l).hoistableStyles,C=za(t);r=r||"default";var O=y.get(C);if(!O){var U={loading:0,preload:null};if(O=l.querySelector(ol(C)))U.loading=5;else{t=m({rel:"stylesheet",href:t,"data-precedence":r},a),(a=ji.get(C))&&Ef(t,a);var ne=O=l.createElement("link");Qe(ne),Dn(ne,"link",t),ne._p=new Promise(function(ce,fe){ne.onload=ce,ne.onerror=fe}),ne.addEventListener("load",function(){U.loading|=1}),ne.addEventListener("error",function(){U.loading|=2}),U.loading|=4,ru(O,r,l)}O={type:"stylesheet",instance:O,count:1,state:U},y.set(C,O)}}}function a5(t,r){Mr.X(t,r);var a=Pa;if(a&&t){var l=ot(a).hoistableScripts,y=Ha(t),C=l.get(y);C||(C=a.querySelector(ll(y)),C||(t=m({src:t,async:!0},r),(r=ji.get(y))&&kf(t,r),C=a.createElement("script"),Qe(C),Dn(C,"link",t),a.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},l.set(y,C))}}function o5(t,r){Mr.M(t,r);var a=Pa;if(a&&t){var l=ot(a).hoistableScripts,y=Ha(t),C=l.get(y);C||(C=a.querySelector(ll(y)),C||(t=m({src:t,async:!0,type:"module"},r),(r=ji.get(y))&&kf(t,r),C=a.createElement("script"),Qe(C),Dn(C,"link",t),a.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},l.set(y,C))}}function tb(t,r,a,l){var y=(y=se.current)?iu(y):null;if(!y)throw Error(s(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(r=za(a.href),a=ot(y).hoistableStyles,l=a.get(r),l||(l={type:"style",instance:null,count:0,state:null},a.set(r,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){t=za(a.href);var C=ot(y).hoistableStyles,O=C.get(t);if(O||(y=y.ownerDocument||y,O={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},C.set(t,O),(C=y.querySelector(ol(t)))&&!C._p&&(O.instance=C,O.state.loading=5),ji.has(t)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},ji.set(t,a),C||l5(y,t,a,O.state))),r&&l===null)throw Error(s(528,""));return O}if(r&&l!==null)throw Error(s(529,""));return null;case"script":return r=a.async,a=a.src,typeof a=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Ha(a),a=ot(y).hoistableScripts,l=a.get(r),l||(l={type:"script",instance:null,count:0,state:null},a.set(r,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,t))}}function za(t){return'href="'+ti(t)+'"'}function ol(t){return'link[rel="stylesheet"]['+t+"]"}function nb(t){return m({},t,{"data-precedence":t.precedence,precedence:null})}function l5(t,r,a,l){t.querySelector('link[rel="preload"][as="style"]['+r+"]")?l.loading=1:(r=t.createElement("link"),l.preload=r,r.addEventListener("load",function(){return l.loading|=1}),r.addEventListener("error",function(){return l.loading|=2}),Dn(r,"link",a),Qe(r),t.head.appendChild(r))}function Ha(t){return'[src="'+ti(t)+'"]'}function ll(t){return"script[async]"+t}function ib(t,r,a){if(r.count++,r.instance===null)switch(r.type){case"style":var l=t.querySelector('style[data-href~="'+ti(a.href)+'"]');if(l)return r.instance=l,Qe(l),l;var y=m({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return l=(t.ownerDocument||t).createElement("style"),Qe(l),Dn(l,"style",y),ru(l,a.precedence,t),r.instance=l;case"stylesheet":y=za(a.href);var C=t.querySelector(ol(y));if(C)return r.state.loading|=4,r.instance=C,Qe(C),C;l=nb(a),(y=ji.get(y))&&Ef(l,y),C=(t.ownerDocument||t).createElement("link"),Qe(C);var O=C;return O._p=new Promise(function(U,ne){O.onload=U,O.onerror=ne}),Dn(C,"link",l),r.state.loading|=4,ru(C,a.precedence,t),r.instance=C;case"script":return C=Ha(a.src),(y=t.querySelector(ll(C)))?(r.instance=y,Qe(y),y):(l=a,(y=ji.get(C))&&(l=m({},a),kf(l,y)),t=t.ownerDocument||t,y=t.createElement("script"),Qe(y),Dn(y,"link",l),t.head.appendChild(y),r.instance=y);case"void":return null;default:throw Error(s(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(l=r.instance,r.state.loading|=4,ru(l,a.precedence,t));return r.instance}function ru(t,r,a){for(var l=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=l.length?l[l.length-1]:null,C=y,O=0;O<l.length;O++){var U=l[O];if(U.dataset.precedence===r)C=U;else if(C!==y)break}C?C.parentNode.insertBefore(t,C.nextSibling):(r=a.nodeType===9?a.head:a,r.insertBefore(t,r.firstChild))}function Ef(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.title==null&&(t.title=r.title)}function kf(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.integrity==null&&(t.integrity=r.integrity)}var su=null;function rb(t,r,a){if(su===null){var l=new Map,y=su=new Map;y.set(a,l)}else y=su,l=y.get(a),l||(l=new Map,y.set(a,l));if(l.has(t))return l;for(l.set(t,null),a=a.getElementsByTagName(t),y=0;y<a.length;y++){var C=a[y];if(!(C[er]||C[It]||t==="link"&&C.getAttribute("rel")==="stylesheet")&&C.namespaceURI!=="http://www.w3.org/2000/svg"){var O=C.getAttribute(r)||"";O=t+O;var U=l.get(O);U?U.push(C):l.set(O,[C])}}return l}function sb(t,r,a){t=t.ownerDocument||t,t.head.insertBefore(a,r==="title"?t.querySelector("head > title"):null)}function c5(t,r,a){if(a===1||r.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;return r.rel==="stylesheet"?(t=r.disabled,typeof r.precedence=="string"&&t==null):!0;case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function ab(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function u5(t,r,a,l){if(a.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var y=za(l.href),C=r.querySelector(ol(y));if(C){r=C._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(t.count++,t=au.bind(t),r.then(t,t)),a.state.loading|=4,a.instance=C,Qe(C);return}C=r.ownerDocument||r,l=nb(l),(y=ji.get(y))&&Ef(l,y),C=C.createElement("link"),Qe(C);var O=C;O._p=new Promise(function(U,ne){O.onload=U,O.onerror=ne}),Dn(C,"link",l),a.instance=C}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(a,r),(r=a.state.preload)&&(a.state.loading&3)===0&&(t.count++,a=au.bind(t),r.addEventListener("load",a),r.addEventListener("error",a))}}var Tf=0;function h5(t,r){return t.stylesheets&&t.count===0&&lu(t,t.stylesheets),0<t.count||0<t.imgCount?function(a){var l=setTimeout(function(){if(t.stylesheets&&lu(t,t.stylesheets),t.unsuspend){var C=t.unsuspend;t.unsuspend=null,C()}},6e4+r);0<t.imgBytes&&Tf===0&&(Tf=62500*GE());var y=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&lu(t,t.stylesheets),t.unsuspend)){var C=t.unsuspend;t.unsuspend=null,C()}},(t.imgBytes>Tf?50:800)+r);return t.unsuspend=a,function(){t.unsuspend=null,clearTimeout(l),clearTimeout(y)}}:null}function au(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)lu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var ou=null;function lu(t,r){t.stylesheets=null,t.unsuspend!==null&&(t.count++,ou=new Map,r.forEach(d5,t),ou=null,au.call(t))}function d5(t,r){if(!(r.state.loading&4)){var a=ou.get(t);if(a)var l=a.get(null);else{a=new Map,ou.set(t,a);for(var y=t.querySelectorAll("link[data-precedence],style[data-precedence]"),C=0;C<y.length;C++){var O=y[C];(O.nodeName==="LINK"||O.getAttribute("media")!=="not all")&&(a.set(O.dataset.precedence,O),l=O)}l&&a.set(null,l)}y=r.instance,O=y.getAttribute("data-precedence"),C=a.get(O)||l,C===l&&a.set(null,y),a.set(O,y),this.count++,l=au.bind(this),y.addEventListener("load",l),y.addEventListener("error",l),C?C.parentNode.insertBefore(y,C.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(y,t.firstChild)),r.state.loading|=4}}var cl={$$typeof:S,Provider:null,Consumer:null,_currentValue:K,_currentValue2:K,_threadCount:0};function f5(t,r,a,l,y,C,O,U,ne){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=bt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=bt(0),this.hiddenUpdates=bt(null),this.identifierPrefix=l,this.onUncaughtError=y,this.onCaughtError=C,this.onRecoverableError=O,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ne,this.incompleteTransitions=new Map}function ob(t,r,a,l,y,C,O,U,ne,ce,fe,me){return t=new f5(t,r,a,O,ne,ce,fe,me,U),r=1,C===!0&&(r|=24),C=pi(3,null,null,r),t.current=C,C.stateNode=t,r=sd(),r.refCount++,t.pooledCache=r,r.refCount++,C.memoizedState={element:l,isDehydrated:a,cache:r},cd(C),t}function lb(t){return t?(t=_a,t):_a}function cb(t,r,a,l,y,C){y=lb(y),l.context===null?l.context=y:l.pendingContext=y,l=Jr(r),l.payload={element:a},C=C===void 0?null:C,C!==null&&(l.callback=C),a=Qr(t,l,r),a!==null&&(oi(a,t,r),$o(a,t,r))}function ub(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<r?a:r}}function Af(t,r){ub(t,r),(t=t.alternate)&&ub(t,r)}function hb(t){if(t.tag===13||t.tag===31){var r=Os(t,67108864);r!==null&&oi(r,t,67108864),Af(t,67108864)}}function db(t){if(t.tag===13||t.tag===31){var r=bi();r=nt(r);var a=Os(t,r);a!==null&&oi(a,t,r),Af(t,r)}}var cu=!0;function p5(t,r,a,l){var y=z.T;z.T=null;var C=G.p;try{G.p=2,Rf(t,r,a,l)}finally{G.p=C,z.T=y}}function g5(t,r,a,l){var y=z.T;z.T=null;var C=G.p;try{G.p=8,Rf(t,r,a,l)}finally{G.p=C,z.T=y}}function Rf(t,r,a,l){if(cu){var y=Lf(l);if(y===null)gf(t,r,l,uu,a),pb(t,l);else if(_5(y,t,r,a,l))l.stopPropagation();else if(pb(t,l),r&4&&-1<m5.indexOf(t)){for(;y!==null;){var C=_e(y);if(C!==null)switch(C.tag){case 3:if(C=C.stateNode,C.current.memoizedState.isDehydrated){var O=jt(C.pendingLanes);if(O!==0){var U=C;for(U.pendingLanes|=2,U.entangledLanes|=2;O;){var ne=1<<31-Je(O);U.entanglements[1]|=ne,O&=~ne}rr(C),(_t&6)===0&&(qc=ut()+500,il(0))}}break;case 31:case 13:U=Os(C,2),U!==null&&oi(U,C,2),Vc(),Af(C,2)}if(C=Lf(l),C===null&&gf(t,r,l,uu,a),C===y)break;y=C}y!==null&&l.stopPropagation()}else gf(t,r,l,null,a)}}function Lf(t){return t=We(t),Mf(t)}var uu=null;function Mf(t){if(uu=null,t=Q(t),t!==null){var r=f(t);if(r===null)t=null;else{var a=r.tag;if(a===13){if(t=g(r),t!==null)return t;t=null}else if(a===31){if(t=c(r),t!==null)return t;t=null}else if(a===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;t=null}else r!==t&&(t=null)}}return uu=t,null}function fb(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(Lt()){case Ct:return 2;case Ft:return 8;case Kt:case Jn:return 32;case bn:return 268435456;default:return 32}default:return 32}}var Nf=!1,us=null,hs=null,ds=null,ul=new Map,hl=new Map,fs=[],m5="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 pb(t,r){switch(t){case"focusin":case"focusout":us=null;break;case"dragenter":case"dragleave":hs=null;break;case"mouseover":case"mouseout":ds=null;break;case"pointerover":case"pointerout":ul.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":hl.delete(r.pointerId)}}function dl(t,r,a,l,y,C){return t===null||t.nativeEvent!==C?(t={blockedOn:r,domEventName:a,eventSystemFlags:l,nativeEvent:C,targetContainers:[y]},r!==null&&(r=_e(r),r!==null&&hb(r)),t):(t.eventSystemFlags|=l,r=t.targetContainers,y!==null&&r.indexOf(y)===-1&&r.push(y),t)}function _5(t,r,a,l,y){switch(r){case"focusin":return us=dl(us,t,r,a,l,y),!0;case"dragenter":return hs=dl(hs,t,r,a,l,y),!0;case"mouseover":return ds=dl(ds,t,r,a,l,y),!0;case"pointerover":var C=y.pointerId;return ul.set(C,dl(ul.get(C)||null,t,r,a,l,y)),!0;case"gotpointercapture":return C=y.pointerId,hl.set(C,dl(hl.get(C)||null,t,r,a,l,y)),!0}return!1}function gb(t){var r=Q(t.target);if(r!==null){var a=f(r);if(a!==null){if(r=a.tag,r===13){if(r=g(a),r!==null){t.blockedOn=r,fr(t.priority,function(){db(a)});return}}else if(r===31){if(r=c(a),r!==null){t.blockedOn=r,fr(t.priority,function(){db(a)});return}}else if(r===3&&a.stateNode.current.memoizedState.isDehydrated){t.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}t.blockedOn=null}function hu(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var a=Lf(t.nativeEvent);if(a===null){a=t.nativeEvent;var l=new a.constructor(a.type,a);Ae=l,a.target.dispatchEvent(l),Ae=null}else return r=_e(a),r!==null&&hb(r),t.blockedOn=a,!1;r.shift()}return!0}function mb(t,r,a){hu(t)&&a.delete(r)}function v5(){Nf=!1,us!==null&&hu(us)&&(us=null),hs!==null&&hu(hs)&&(hs=null),ds!==null&&hu(ds)&&(ds=null),ul.forEach(mb),hl.forEach(mb)}function du(t,r){t.blockedOn===r&&(t.blockedOn=null,Nf||(Nf=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,v5)))}var fu=null;function _b(t){fu!==t&&(fu=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){fu===t&&(fu=null);for(var r=0;r<t.length;r+=3){var a=t[r],l=t[r+1],y=t[r+2];if(typeof l!="function"){if(Mf(l||a)===null)continue;break}var C=_e(a);C!==null&&(t.splice(r,3),r-=3,Rd(C,{pending:!0,data:y,method:a.method,action:l},l,y))}}))}function $a(t){function r(ne){return du(ne,t)}us!==null&&du(us,t),hs!==null&&du(hs,t),ds!==null&&du(ds,t),ul.forEach(r),hl.forEach(r);for(var a=0;a<fs.length;a++){var l=fs[a];l.blockedOn===t&&(l.blockedOn=null)}for(;0<fs.length&&(a=fs[0],a.blockedOn===null);)gb(a),a.blockedOn===null&&fs.shift();if(a=(t.ownerDocument||t).$$reactFormReplay,a!=null)for(l=0;l<a.length;l+=3){var y=a[l],C=a[l+1],O=y[Nt]||null;if(typeof C=="function")O||_b(a);else if(O){var U=null;if(C&&C.hasAttribute("formAction")){if(y=C,O=C[Nt]||null)U=O.formAction;else if(Mf(y)!==null)continue}else U=O.action;typeof U=="function"?a[l+1]=U:(a.splice(l,3),l-=3),_b(a)}}}function vb(){function t(C){C.canIntercept&&C.info==="react-transition"&&C.intercept({handler:function(){return new Promise(function(O){return y=O})},focusReset:"manual",scroll:"manual"})}function r(){y!==null&&(y(),y=null),l||setTimeout(a,20)}function a(){if(!l&&!navigation.transition){var C=navigation.currentEntry;C&&C.url!=null&&navigation.navigate(C.url,{state:C.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,y=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(a,100),function(){l=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),y!==null&&(y(),y=null)}}}function Of(t){this._internalRoot=t}pu.prototype.render=Of.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(s(409));var a=r.current,l=bi();cb(a,l,t,r,null,null)},pu.prototype.unmount=Of.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;cb(t.current,2,null,t,null,null),Vc(),r[Fi]=null}};function pu(t){this._internalRoot=t}pu.prototype.unstable_scheduleHydration=function(t){if(t){var r=dr();t={blockedOn:null,target:t,priority:r};for(var a=0;a<fs.length&&r!==0&&r<fs[a].priority;a++);fs.splice(a,0,t),a===0&&gb(t)}};var bb=n.version;if(bb!=="19.2.7")throw Error(s(527,bb,"19.2.7"));G.findDOMNode=function(t){var r=t._reactInternals;if(r===void 0)throw typeof t.render=="function"?Error(s(188)):(t=Object.keys(t).join(","),Error(s(268,t)));return t=d(r),t=t!==null?b(t):null,t=t===null?null:t.stateNode,t};var b5={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var gu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!gu.isDisabled&&gu.supportsFiber)try{Tn=gu.inject(b5),ve=gu}catch{}}return pl.createRoot=function(t,r){if(!o(t))throw Error(s(299));var a=!1,l="",y=kv,C=Tv,O=Av;return r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(l=r.identifierPrefix),r.onUncaughtError!==void 0&&(y=r.onUncaughtError),r.onCaughtError!==void 0&&(C=r.onCaughtError),r.onRecoverableError!==void 0&&(O=r.onRecoverableError)),r=ob(t,1,!1,null,null,a,l,null,y,C,O,vb),t[Fi]=r.current,pf(t),new Of(r)},pl.hydrateRoot=function(t,r,a){if(!o(t))throw Error(s(299));var l=!1,y="",C=kv,O=Tv,U=Av,ne=null;return a!=null&&(a.unstable_strictMode===!0&&(l=!0),a.identifierPrefix!==void 0&&(y=a.identifierPrefix),a.onUncaughtError!==void 0&&(C=a.onUncaughtError),a.onCaughtError!==void 0&&(O=a.onCaughtError),a.onRecoverableError!==void 0&&(U=a.onRecoverableError),a.formState!==void 0&&(ne=a.formState)),r=ob(t,1,!0,r,a??null,l,y,ne,C,O,U,vb),r.context=lb(null),a=r.current,l=bi(),l=nt(l),y=Jr(l),y.callback=null,Qr(a,y,l),a=l,r.current.lanes=a,ht(r,a),rr(r),t[Fi]=r.current,pf(t),new pu(r)},pl.version="19.2.7",pl}var Lb;function ak(){if(Lb)return Bf.exports;Lb=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Bf.exports=sk(),Bf.exports}var ok=ak();var Mb="popstate";function Nb(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function lk(e={}){function n(s,o){let f=o.state?.masked,{pathname:g,search:c,hash:h}=f||s.location;return Hp("",{pathname:g,search:c,hash:h},o.state&&o.state.usr||null,o.state&&o.state.key||"default",f?{pathname:s.location.pathname,search:s.location.search,hash:s.location.hash}:void 0)}function i(s,o){return typeof o=="string"?o:Ul(o)}return uk(n,i,null,e)}function qt(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function Zi(e,n){if(!e){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function ck(){return Math.random().toString(36).substring(2,10)}function Ob(e,n){return{usr:e.state,key:e.key,idx:n,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Hp(e,n,i=null,s,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof n=="string"?_o(n):n,state:i,key:n&&n.key||s||ck(),mask:o}}function Ul({pathname:e="/",search:n="",hash:i=""}){return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),i&&i!=="#"&&(e+=i.charAt(0)==="#"?i:"#"+i),e}function _o(e){let n={};if(e){let i=e.indexOf("#");i>=0&&(n.hash=e.substring(i),e=e.substring(0,i));let s=e.indexOf("?");s>=0&&(n.search=e.substring(s),e=e.substring(0,s)),e&&(n.pathname=e)}return n}function uk(e,n,i,s={}){let{window:o=document.defaultView,v5Compat:f=!1}=s,g=o.history,c="POP",h=null,d=b();d==null&&(d=0,g.replaceState({...g.state,idx:d},""));function b(){return(g.state||{idx:null}).idx}function m(){c="POP";let p=b(),v=p==null?null:p-d;d=p,h&&h({action:c,location:E.location,delta:v})}function w(p,v){c="PUSH";let _=Nb(p)?p:Hp(E.location,p,v);d=b()+1;let S=Ob(_,d),k=E.createHref(_.mask||_);try{g.pushState(S,"",k)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;o.location.assign(k)}f&&h&&h({action:c,location:E.location,delta:1})}function x(p,v){c="REPLACE";let _=Nb(p)?p:Hp(E.location,p,v);d=b();let S=Ob(_,d),k=E.createHref(_.mask||_);g.replaceState(S,"",k),f&&h&&h({action:c,location:E.location,delta:0})}function T(p){return hk(o,p)}let E={get action(){return c},get location(){return e(o,g)},listen(p){if(h)throw new Error("A history only accepts one active listener");return o.addEventListener(Mb,m),h=p,()=>{o.removeEventListener(Mb,m),h=null}},createHref(p){return n(o,p)},createURL:T,encodeLocation(p){let v=T(p);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:w,replace:x,go(p){return g.go(p)}};return E}function hk(e,n,i=!1){let s="http://localhost";e&&(s=e.location.origin!=="null"?e.location.origin:e.location.href),qt(s,"No window.location.(origin|href) available to create URL");let o=typeof n=="string"?n:Ul(n);return o=o.replace(/ $/,"%20"),!i&&o.startsWith("//")&&(o=s+o),new URL(o,s)}function BS(e,n,i="/"){return dk(e,n,i,!1)}function dk(e,n,i,s,o){let f=typeof n=="string"?_o(n):n,g=Hr(f.pathname||"/",i);if(g==null)return null;let c=fk(e),h=null,d=Ek(g);for(let b=0;h==null&&b<c.length;++b)h=xk(c[b],d,s);return h}function fk(e){let n=PS(e);return pk(n),n}function PS(e,n=[],i=[],s="",o=!1){let f=(g,c,h=o,d)=>{let b={relativePath:d===void 0?g.path||"":d,caseSensitive:g.caseSensitive===!0,childrenIndex:c,route:g};if(b.relativePath.startsWith("/")){if(!b.relativePath.startsWith(s)&&h)return;qt(b.relativePath.startsWith(s),`Absolute route path "${b.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),b.relativePath=b.relativePath.slice(s.length)}let m=Xi([s,b.relativePath]),w=i.concat(b);g.children&&g.children.length>0&&(qt(g.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),PS(g.children,n,w,m,h)),!(g.path==null&&!g.index)&&n.push({path:m,score:Sk(m,g.index),routesMeta:w})};return e.forEach((g,c)=>{if(g.path===""||!g.path?.includes("?"))f(g,c);else for(let h of zS(g.path))f(g,c,!0,h)}),n}function zS(e){let n=e.split("/");if(n.length===0)return[];let[i,...s]=n,o=i.endsWith("?"),f=i.replace(/\?$/,"");if(s.length===0)return o?[f,""]:[f];let g=zS(s.join("/")),c=[];return c.push(...g.map(h=>h===""?f:[f,h].join("/"))),o&&c.push(...g),c.map(h=>e.startsWith("/")&&h===""?"/":h)}function pk(e){e.sort((n,i)=>n.score!==i.score?i.score-n.score:wk(n.routesMeta.map(s=>s.childrenIndex),i.routesMeta.map(s=>s.childrenIndex)))}var gk=/^:[\w-]+$/,mk=3,_k=2,vk=1,bk=10,yk=-2,Db=e=>e==="*";function Sk(e,n){let i=e.split("/"),s=i.length;return i.some(Db)&&(s+=yk),n&&(s+=_k),i.filter(o=>!Db(o)).reduce((o,f)=>o+(gk.test(f)?mk:f===""?vk:bk),s)}function wk(e,n){return e.length===n.length&&e.slice(0,-1).every((s,o)=>s===n[o])?e[e.length-1]-n[n.length-1]:0}function xk(e,n,i=!1){let{routesMeta:s}=e,o={},f="/",g=[];for(let c=0;c<s.length;++c){let h=s[c],d=c===s.length-1,b=f==="/"?n:n.slice(f.length)||"/",m=eh({path:h.relativePath,caseSensitive:h.caseSensitive,end:d},b),w=h.route;if(!m&&d&&i&&!s[s.length-1].route.index&&(m=eh({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},b)),!m)return null;Object.assign(o,m.params),g.push({params:o,pathname:Xi([f,m.pathname]),pathnameBase:Rk(Xi([f,m.pathnameBase])),route:w}),m.pathnameBase!=="/"&&(f=Xi([f,m.pathnameBase]))}return g}function eh(e,n){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[i,s]=Ck(e.path,e.caseSensitive,e.end),o=n.match(i);if(!o)return null;let f=o[0],g=f.replace(/(.)\/+$/,"$1"),c=o.slice(1);return{params:s.reduce((d,{paramName:b,isOptional:m},w)=>{if(b==="*"){let T=c[w]||"";g=f.slice(0,f.length-T.length).replace(/(.)\/+$/,"$1")}const x=c[w];return m&&!x?d[b]=void 0:d[b]=(x||"").replace(/%2F/g,"/"),d},{}),pathname:f,pathnameBase:g,pattern:e}}function Ck(e,n=!1,i=!0){Zi(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 s=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(g,c,h,d,b)=>{if(s.push({paramName:c,isOptional:h!=null}),h){let m=b.charAt(d+g.length);return m&&m!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(s.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,n?void 0:"i"),s]}function Ek(e){try{return e.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return Zi(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${n}).`),e}}function Hr(e,n){if(n==="/")return e;if(!e.toLowerCase().startsWith(n.toLowerCase()))return null;let i=n.endsWith("/")?n.length-1:n.length,s=e.charAt(i);return s&&s!=="/"?null:e.slice(i)||"/"}var kk=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Tk(e,n="/"){let{pathname:i,search:s="",hash:o=""}=typeof e=="string"?_o(e):e,f;return i?(i=HS(i),i.startsWith("/")?f=jb(i.substring(1),"/"):f=jb(i,n)):f=n,{pathname:f,search:Lk(s),hash:Mk(o)}}function jb(e,n){let i=th(n).split("/");return e.split("/").forEach(o=>{o===".."?i.length>1&&i.pop():o!=="."&&i.push(o)}),i.length>1?i.join("/"):"/"}function $f(e,n,i,s){return`Cannot include a '${e}' character in a manually specified \`to.${n}\` field [${JSON.stringify(s)}]. Please separate it out to the \`to.${i}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Ak(e){return e.filter((n,i)=>i===0||n.route.path&&n.route.path.length>0)}function Zg(e){let n=Ak(e);return n.map((i,s)=>s===n.length-1?i.pathname:i.pathnameBase)}function vh(e,n,i,s=!1){let o;typeof e=="string"?o=_o(e):(o={...e},qt(!o.pathname||!o.pathname.includes("?"),$f("?","pathname","search",o)),qt(!o.pathname||!o.pathname.includes("#"),$f("#","pathname","hash",o)),qt(!o.search||!o.search.includes("#"),$f("#","search","hash",o)));let f=e===""||o.pathname==="",g=f?"/":o.pathname,c;if(g==null)c=i;else{let m=n.length-1;if(!s&&g.startsWith("..")){let w=g.split("/");for(;w[0]==="..";)w.shift(),m-=1;o.pathname=w.join("/")}c=m>=0?n[m]:"/"}let h=Tk(o,c),d=g&&g!=="/"&&g.endsWith("/"),b=(f||g===".")&&i.endsWith("/");return!h.pathname.endsWith("/")&&(d||b)&&(h.pathname+="/"),h}var HS=e=>e.replace(/\/\/+/g,"/"),Xi=e=>HS(e.join("/")),th=e=>e.replace(/\/+$/,""),Rk=e=>th(e).replace(/^\/*/,"/"),Lk=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Mk=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Nk=class{constructor(e,n,i,s=!1){this.status=e,this.statusText=n||"",this.internal=s,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function Ok(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Dk(e){let n=e.map(i=>i.route.path).filter(Boolean);return Xi(n)||"/"}var $S=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function US(e,n){let i=e;if(typeof i!="string"||!kk.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let s=i,o=!1;if($S)try{let f=new URL(window.location.href),g=i.startsWith("//")?new URL(f.protocol+i):new URL(i),c=Hr(g.pathname,n);g.origin===f.origin&&c!=null?i=c+g.search+g.hash:o=!0}catch{Zi(!1,`<Link to="${i}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:s,isExternal:o,to:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var FS=["POST","PUT","PATCH","DELETE"];new Set(FS);var jk=["GET",...FS];new Set(jk);var vo=M.createContext(null);vo.displayName="DataRouter";var bh=M.createContext(null);bh.displayName="DataRouterState";var WS=M.createContext(!1);function Ik(){return M.useContext(WS)}var GS=M.createContext({isTransitioning:!1});GS.displayName="ViewTransition";var Bk=M.createContext(new Map);Bk.displayName="Fetchers";var Pk=M.createContext(null);Pk.displayName="Await";var ki=M.createContext(null);ki.displayName="Navigation";var ec=M.createContext(null);ec.displayName="Location";var ur=M.createContext({outlet:null,matches:[],isDataRoute:!1});ur.displayName="Route";var Jg=M.createContext(null);Jg.displayName="RouteError";var qS="REACT_ROUTER_ERROR",zk="REDIRECT",Hk="ROUTE_ERROR_RESPONSE";function $k(e){if(e.startsWith(`${qS}:${zk}:{`))try{let n=JSON.parse(e.slice(28));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.location=="string"&&typeof n.reloadDocument=="boolean"&&typeof n.replace=="boolean")return n}catch{}}function Uk(e){if(e.startsWith(`${qS}:${Hk}:{`))try{let n=JSON.parse(e.slice(40));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string")return new Nk(n.status,n.statusText,n.data)}catch{}}function Fk(e,{relative:n}={}){qt(bo(),"useHref() may be used only in the context of a <Router> component.");let{basename:i,navigator:s}=M.useContext(ki),{hash:o,pathname:f,search:g}=tc(e,{relative:n}),c=f;return i!=="/"&&(c=f==="/"?i:Xi([i,f])),s.createHref({pathname:c,search:g,hash:o})}function bo(){return M.useContext(ec)!=null}function Ui(){return qt(bo(),"useLocation() may be used only in the context of a <Router> component."),M.useContext(ec).location}var KS="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function VS(e){M.useContext(ki).static||M.useLayoutEffect(e)}function yh(){let{isDataRoute:e}=M.useContext(ur);return e?nT():Wk()}function Wk(){qt(bo(),"useNavigate() may be used only in the context of a <Router> component.");let e=M.useContext(vo),{basename:n,navigator:i}=M.useContext(ki),{matches:s}=M.useContext(ur),{pathname:o}=Ui(),f=JSON.stringify(Zg(s)),g=M.useRef(!1);return VS(()=>{g.current=!0}),M.useCallback((h,d={})=>{if(Zi(g.current,KS),!g.current)return;if(typeof h=="number"){i.go(h);return}let b=vh(h,JSON.parse(f),o,d.relative==="path");e==null&&n!=="/"&&(b.pathname=b.pathname==="/"?n:Xi([n,b.pathname])),(d.replace?i.replace:i.push)(b,d.state,d)},[n,i,f,o,e])}M.createContext(null);function tc(e,{relative:n}={}){let{matches:i}=M.useContext(ur),{pathname:s}=Ui(),o=JSON.stringify(Zg(i));return M.useMemo(()=>vh(e,JSON.parse(o),s,n==="path"),[e,o,s,n])}function Gk(e,n){return YS(e,n)}function YS(e,n,i){qt(bo(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=M.useContext(ki),{matches:o}=M.useContext(ur),f=o[o.length-1],g=f?f.params:{},c=f?f.pathname:"/",h=f?f.pathnameBase:"/",d=f&&f.route;{let p=d&&d.path||"";ZS(c,!d||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=Ui(),m;if(n){let p=typeof n=="string"?_o(n):n;qt(h==="/"||p.pathname?.startsWith(h),`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 "${h}" but pathname "${p.pathname}" was given in the \`location\` prop.`),m=p}else m=b;let w=m.pathname||"/",x=w;if(h!=="/"){let p=h.replace(/^\//,"").split("/");x="/"+w.replace(/^\//,"").split("/").slice(p.length).join("/")}let T=i&&i.state.matches.length?i.state.matches.map(p=>Object.assign(p,{route:i.manifest[p.route.id]||p.route})):BS(e,{pathname:x});Zi(d||T!=null,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),Zi(T==null||T[T.length-1].route.element!==void 0||T[T.length-1].route.Component!==void 0||T[T.length-1].route.lazy!==void 0,`Matched leaf route at location "${m.pathname}${m.search}${m.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 E=Xk(T&&T.map(p=>Object.assign({},p,{params:Object.assign({},g,p.params),pathname:Xi([h,s.encodeLocation?s.encodeLocation(p.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:p.pathname]),pathnameBase:p.pathnameBase==="/"?h:Xi([h,s.encodeLocation?s.encodeLocation(p.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:p.pathnameBase])})),o,i);return n&&E?M.createElement(ec.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...m},navigationType:"POP"}},E):E}function qk(){let e=tT(),n=Ok(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),i=e instanceof Error?e.stack:null,s="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:s},f={padding:"2px 4px",backgroundColor:s},g=null;return console.error("Error handled by React Router default ErrorBoundary:",e),g=M.createElement(M.Fragment,null,M.createElement("p",null,"💿 Hey developer 👋"),M.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",M.createElement("code",{style:f},"ErrorBoundary")," or"," ",M.createElement("code",{style:f},"errorElement")," prop on your route.")),M.createElement(M.Fragment,null,M.createElement("h2",null,"Unexpected Application Error!"),M.createElement("h3",{style:{fontStyle:"italic"}},n),i?M.createElement("pre",{style:o},i):null,g)}var Kk=M.createElement(qk,null),XS=class extends M.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){this.props.onError?this.props.onError(e,n):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const i=Uk(e.digest);i&&(e=i)}let n=e!==void 0?M.createElement(ur.Provider,{value:this.props.routeContext},M.createElement(Jg.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?M.createElement(Vk,{error:e},n):n}};XS.contextType=WS;var Uf=new WeakMap;function Vk({children:e,error:n}){let{basename:i}=M.useContext(ki);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let s=$k(n.digest);if(s){let o=Uf.get(n);if(o)throw o;let f=US(s.location,i);if($S&&!Uf.get(n))if(f.isExternal||s.reloadDocument)window.location.href=f.absoluteURL||f.to;else{const g=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(f.to,{replace:s.replace}));throw Uf.set(n,g),g}return M.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f.absoluteURL||f.to}`})}}return e}function Yk({routeContext:e,match:n,children:i}){let s=M.useContext(vo);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),M.createElement(ur.Provider,{value:e},i)}function Xk(e,n=[],i){let s=i?.state;if(e==null){if(!s)return null;if(s.errors)e=s.matches;else if(n.length===0&&!s.initialized&&s.matches.length>0)e=s.matches;else return null}let o=e,f=s?.errors;if(f!=null){let b=o.findIndex(m=>m.route.id&&f?.[m.route.id]!==void 0);qt(b>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(f).join(",")}`),o=o.slice(0,Math.min(o.length,b+1))}let g=!1,c=-1;if(i&&s){g=s.renderFallback;for(let b=0;b<o.length;b++){let m=o[b];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(c=b),m.route.id){let{loaderData:w,errors:x}=s,T=m.route.loader&&!w.hasOwnProperty(m.route.id)&&(!x||x[m.route.id]===void 0);if(m.route.lazy||T){i.isStatic&&(g=!0),c>=0?o=o.slice(0,c+1):o=[o[0]];break}}}}let h=i?.onError,d=s&&h?(b,m)=>{h(b,{location:s.location,params:s.matches?.[0]?.params??{},pattern:Dk(s.matches),errorInfo:m})}:void 0;return o.reduceRight((b,m,w)=>{let x,T=!1,E=null,p=null;s&&(x=f&&m.route.id?f[m.route.id]:void 0,E=m.route.errorElement||Kk,g&&(c<0&&w===0?(ZS("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),T=!0,p=null):c===w&&(T=!0,p=m.route.hydrateFallbackElement||null)));let v=n.concat(o.slice(0,w+1)),_=()=>{let S;return x?S=E:T?S=p:m.route.Component?S=M.createElement(m.route.Component,null):m.route.element?S=m.route.element:S=b,M.createElement(Yk,{match:m,routeContext:{outlet:b,matches:v,isDataRoute:s!=null},children:S})};return s&&(m.route.ErrorBoundary||m.route.errorElement||w===0)?M.createElement(XS,{location:s.location,revalidation:s.revalidation,component:E,error:x,children:_(),routeContext:{outlet:null,matches:v,isDataRoute:!0},onError:d}):_()},null)}function Qg(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Zk(e){let n=M.useContext(vo);return qt(n,Qg(e)),n}function Jk(e){let n=M.useContext(bh);return qt(n,Qg(e)),n}function Qk(e){let n=M.useContext(ur);return qt(n,Qg(e)),n}function em(e){let n=Qk(e),i=n.matches[n.matches.length-1];return qt(i.route.id,`${e} can only be used on routes that contain a unique "id"`),i.route.id}function eT(){return em("useRouteId")}function tT(){let e=M.useContext(Jg),n=Jk("useRouteError"),i=em("useRouteError");return e!==void 0?e:n.errors?.[i]}function nT(){let{router:e}=Zk("useNavigate"),n=em("useNavigate"),i=M.useRef(!1);return VS(()=>{i.current=!0}),M.useCallback(async(o,f={})=>{Zi(i.current,KS),i.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:n,...f}))},[e,n])}var Ib={};function ZS(e,n,i){!n&&!Ib[e]&&(Ib[e]=!0,Zi(!1,i))}M.memo(iT);function iT({routes:e,manifest:n,future:i,state:s,isStatic:o,onError:f}){return YS(e,void 0,{manifest:n,state:s,isStatic:o,onError:f})}function Bb({to:e,replace:n,state:i,relative:s}){qt(bo(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=M.useContext(ki);Zi(!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:f}=M.useContext(ur),{pathname:g}=Ui(),c=yh(),h=vh(e,Zg(f),g,s==="path"),d=JSON.stringify(h);return M.useEffect(()=>{c(JSON.parse(d),{replace:n,state:i,relative:s})},[c,d,s,n,i]),null}function Ka(e){qt(!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 rT({basename:e="/",children:n=null,location:i,navigationType:s="POP",navigator:o,static:f=!1,useTransitions:g}){qt(!bo(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),h=M.useMemo(()=>({basename:c,navigator:o,static:f,useTransitions:g,future:{}}),[c,o,f,g]);typeof i=="string"&&(i=_o(i));let{pathname:d="/",search:b="",hash:m="",state:w=null,key:x="default",mask:T}=i,E=M.useMemo(()=>{let p=Hr(d,c);return p==null?null:{location:{pathname:p,search:b,hash:m,state:w,key:x,mask:T},navigationType:s}},[c,d,b,m,w,x,s,T]);return Zi(E!=null,`<Router basename="${c}"> is not able to match the URL "${d}${b}${m}" because it does not start with the basename, so the <Router> won't render anything.`),E==null?null:M.createElement(ki.Provider,{value:h},M.createElement(ec.Provider,{children:n,value:E}))}function sT({children:e,location:n}){return Gk($p(e),n)}function $p(e,n=[]){let i=[];return M.Children.forEach(e,(s,o)=>{if(!M.isValidElement(s))return;let f=[...n,o];if(s.type===M.Fragment){i.push.apply(i,$p(s.props.children,f));return}qt(s.type===Ka,`[${typeof s.type=="string"?s.type:s.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),qt(!s.props.index||!s.props.children,"An index route cannot have child routes.");let g={id:s.props.id||f.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,middleware:s.props.middleware,loader:s.props.loader,action:s.props.action,hydrateFallbackElement:s.props.hydrateFallbackElement,HydrateFallback:s.props.HydrateFallback,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.hasErrorBoundary===!0||s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(g.children=$p(s.props.children,f)),i.push(g)}),i}var Bu="get",Pu="application/x-www-form-urlencoded";function Sh(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function aT(e){return Sh(e)&&e.tagName.toLowerCase()==="button"}function oT(e){return Sh(e)&&e.tagName.toLowerCase()==="form"}function lT(e){return Sh(e)&&e.tagName.toLowerCase()==="input"}function cT(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function uT(e,n){return e.button===0&&(!n||n==="_self")&&!cT(e)}var mu=null;function hT(){if(mu===null)try{new FormData(document.createElement("form"),0),mu=!1}catch{mu=!0}return mu}var dT=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ff(e){return e!=null&&!dT.has(e)?(Zi(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Pu}"`),null):e}function fT(e,n){let i,s,o,f,g;if(oT(e)){let c=e.getAttribute("action");s=c?Hr(c,n):null,i=e.getAttribute("method")||Bu,o=Ff(e.getAttribute("enctype"))||Pu,f=new FormData(e)}else if(aT(e)||lT(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 h=e.getAttribute("formaction")||c.getAttribute("action");if(s=h?Hr(h,n):null,i=e.getAttribute("formmethod")||c.getAttribute("method")||Bu,o=Ff(e.getAttribute("formenctype"))||Ff(c.getAttribute("enctype"))||Pu,f=new FormData(c,e),!hT()){let{name:d,type:b,value:m}=e;if(b==="image"){let w=d?`${d}.`:"";f.append(`${w}x`,"0"),f.append(`${w}y`,"0")}else d&&f.append(d,m)}}else{if(Sh(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');i=Bu,s=null,o=Pu,g=e}return f&&o==="text/plain"&&(g=f,f=void 0),{action:s,method:i.toLowerCase(),encType:o,formData:f,body:g}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function tm(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function JS(e,n,i,s){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return i?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${s}`:o.pathname=`${o.pathname}.${s}`:o.pathname==="/"?o.pathname=`_root.${s}`:n&&Hr(o.pathname,n)==="/"?o.pathname=`${th(n)}/_root.${s}`:o.pathname=`${th(o.pathname)}.${s}`,o}async function pT(e,n){if(e.id in n)return n[e.id];try{let i=await import(e.module);return n[e.id]=i,i}catch(i){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(i),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function gT(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 mT(e,n,i){let s=await Promise.all(e.map(async o=>{let f=n.routes[o.route.id];if(f){let g=await pT(f,i);return g.links?g.links():[]}return[]}));return yT(s.flat(1).filter(gT).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function Pb(e,n,i,s,o,f){let g=(h,d)=>i[d]?h.route.id!==i[d].route.id:!0,c=(h,d)=>i[d].pathname!==h.pathname||i[d].route.path?.endsWith("*")&&i[d].params["*"]!==h.params["*"];return f==="assets"?n.filter((h,d)=>g(h,d)||c(h,d)):f==="data"?n.filter((h,d)=>{let b=s.routes[h.route.id];if(!b||!b.hasLoader)return!1;if(g(h,d)||c(h,d))return!0;if(h.route.shouldRevalidate){let m=h.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:i[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof m=="boolean")return m}return!0}):[]}function _T(e,n,{includeHydrateFallback:i}={}){return vT(e.map(s=>{let o=n.routes[s.route.id];if(!o)return[];let f=[o.module];return o.clientActionModule&&(f=f.concat(o.clientActionModule)),o.clientLoaderModule&&(f=f.concat(o.clientLoaderModule)),i&&o.hydrateFallbackModule&&(f=f.concat(o.hydrateFallbackModule)),o.imports&&(f=f.concat(o.imports)),f}).flat(1))}function vT(e){return[...new Set(e)]}function bT(e){let n={},i=Object.keys(e).sort();for(let s of i)n[s]=e[s];return n}function yT(e,n){let i=new Set;return new Set(n),e.reduce((s,o)=>{let f=JSON.stringify(bT(o));return i.has(f)||(i.add(f),s.push({key:f,link:o})),s},[])}function nm(){let e=M.useContext(vo);return tm(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function ST(){let e=M.useContext(bh);return tm(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var im=M.createContext(void 0);im.displayName="FrameworkContext";function rm(){let e=M.useContext(im);return tm(e,"You must render this element inside a <HydratedRouter> element"),e}function wT(e,n){let i=M.useContext(im),[s,o]=M.useState(!1),[f,g]=M.useState(!1),{onFocus:c,onBlur:h,onMouseEnter:d,onMouseLeave:b,onTouchStart:m}=n,w=M.useRef(null);M.useEffect(()=>{if(e==="render"&&g(!0),e==="viewport"){let E=v=>{v.forEach(_=>{g(_.isIntersecting)})},p=new IntersectionObserver(E,{threshold:.5});return w.current&&p.observe(w.current),()=>{p.disconnect()}}},[e]),M.useEffect(()=>{if(s){let E=setTimeout(()=>{g(!0)},100);return()=>{clearTimeout(E)}}},[s]);let x=()=>{o(!0)},T=()=>{o(!1),g(!1)};return i?e!=="intent"?[f,w,{}]:[f,w,{onFocus:gl(c,x),onBlur:gl(h,T),onMouseEnter:gl(d,x),onMouseLeave:gl(b,T),onTouchStart:gl(m,x)}]:[!1,w,{}]}function gl(e,n){return i=>{e&&e(i),i.defaultPrevented||n(i)}}function xT({page:e,...n}){let i=Ik(),{router:s}=nm(),o=M.useMemo(()=>BS(s.routes,e,s.basename),[s.routes,e,s.basename]);return o?i?M.createElement(ET,{page:e,matches:o,...n}):M.createElement(kT,{page:e,matches:o,...n}):null}function CT(e){let{manifest:n,routeModules:i}=rm(),[s,o]=M.useState([]);return M.useEffect(()=>{let f=!1;return mT(e,n,i).then(g=>{f||o(g)}),()=>{f=!0}},[e,n,i]),s}function ET({page:e,matches:n,...i}){let s=Ui(),{future:o}=rm(),{basename:f}=nm(),g=M.useMemo(()=>{if(e===s.pathname+s.search+s.hash)return[];let c=JS(e,f,o.v8_trailingSlashAwareDataRequests,"rsc"),h=!1,d=[];for(let b of n)typeof b.route.shouldRevalidate=="function"?h=!0:d.push(b.route.id);return h&&d.length>0&&c.searchParams.set("_routes",d.join(",")),[c.pathname+c.search]},[f,o.v8_trailingSlashAwareDataRequests,e,s,n]);return M.createElement(M.Fragment,null,g.map(c=>M.createElement("link",{key:c,rel:"prefetch",as:"fetch",href:c,...i})))}function kT({page:e,matches:n,...i}){let s=Ui(),{future:o,manifest:f,routeModules:g}=rm(),{basename:c}=nm(),{loaderData:h,matches:d}=ST(),b=M.useMemo(()=>Pb(e,n,d,f,s,"data"),[e,n,d,f,s]),m=M.useMemo(()=>Pb(e,n,d,f,s,"assets"),[e,n,d,f,s]),w=M.useMemo(()=>{if(e===s.pathname+s.search+s.hash)return[];let E=new Set,p=!1;if(n.forEach(_=>{let S=f.routes[_.route.id];!S||!S.hasLoader||(!b.some(k=>k.route.id===_.route.id)&&_.route.id in h&&g[_.route.id]?.shouldRevalidate||S.hasClientLoader?p=!0:E.add(_.route.id))}),E.size===0)return[];let v=JS(e,c,o.v8_trailingSlashAwareDataRequests,"data");return p&&E.size>0&&v.searchParams.set("_routes",n.filter(_=>E.has(_.route.id)).map(_=>_.route.id).join(",")),[v.pathname+v.search]},[c,o.v8_trailingSlashAwareDataRequests,h,s,f,b,n,e,g]),x=M.useMemo(()=>_T(m,f),[m,f]),T=CT(m);return M.createElement(M.Fragment,null,w.map(E=>M.createElement("link",{key:E,rel:"prefetch",as:"fetch",href:E,...i})),x.map(E=>M.createElement("link",{key:E,rel:"modulepreload",href:E,...i})),T.map(({key:E,link:p})=>M.createElement("link",{key:E,nonce:i.nonce,...p,crossOrigin:p.crossOrigin??i.crossOrigin})))}function TT(...e){return n=>{e.forEach(i=>{typeof i=="function"?i(n):i!=null&&(i.current=n)})}}var AT=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{AT&&(window.__reactRouterVersion="7.17.0")}catch{}function RT({basename:e,children:n,useTransitions:i,window:s}){let o=M.useRef();o.current==null&&(o.current=lk({window:s,v5Compat:!0}));let f=o.current,[g,c]=M.useState({action:f.action,location:f.location}),h=M.useCallback(d=>{i===!1?c(d):M.startTransition(()=>c(d))},[i]);return M.useLayoutEffect(()=>f.listen(h),[f,h]),M.createElement(rT,{basename:e,children:n,location:g.location,navigationType:g.action,navigator:f,useTransitions:i})}var QS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Fl=M.forwardRef(function({onClick:n,discover:i="render",prefetch:s="none",relative:o,reloadDocument:f,replace:g,mask:c,state:h,target:d,to:b,preventScrollReset:m,viewTransition:w,defaultShouldRevalidate:x,...T},E){let{basename:p,navigator:v,useTransitions:_}=M.useContext(ki),S=typeof b=="string"&&QS.test(b),k=US(b,p);b=k.to;let L=Fk(b,{relative:o}),R=Ui(),N=null;if(c){let V=vh(c,[],R.mask?R.mask.pathname:"/",!0);p!=="/"&&(V.pathname=V.pathname==="/"?p:Xi([p,V.pathname])),N=v.createHref(V)}let[A,B,q]=wT(s,T),F=NT(b,{replace:g,mask:c,state:h,target:d,preventScrollReset:m,relative:o,viewTransition:w,defaultShouldRevalidate:x,useTransitions:_});function W(V){n&&n(V),V.defaultPrevented||F(V)}let I=!(k.isExternal||f),Y=M.createElement("a",{...T,...q,href:(I?N:void 0)||k.absoluteURL||L,onClick:I?W:n,ref:TT(E,B),target:d,"data-discover":!S&&i==="render"?"true":void 0});return A&&!S?M.createElement(M.Fragment,null,Y,M.createElement(xT,{page:L})):Y});Fl.displayName="Link";var Up=M.forwardRef(function({"aria-current":n="page",caseSensitive:i=!1,className:s="",end:o=!1,style:f,to:g,viewTransition:c,children:h,...d},b){let m=tc(g,{relative:d.relative}),w=Ui(),x=M.useContext(bh),{navigator:T,basename:E}=M.useContext(ki),p=x!=null&&BT(m)&&c===!0,v=T.encodeLocation?T.encodeLocation(m).pathname:m.pathname,_=w.pathname,S=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;i||(_=_.toLowerCase(),S=S?S.toLowerCase():null,v=v.toLowerCase()),S&&E&&(S=Hr(S,E)||S);const k=v!=="/"&&v.endsWith("/")?v.length-1:v.length;let L=_===v||!o&&_.startsWith(v)&&_.charAt(k)==="/",R=S!=null&&(S===v||!o&&S.startsWith(v)&&S.charAt(v.length)==="/"),N={isActive:L,isPending:R,isTransitioning:p},A=L?n:void 0,B;typeof s=="function"?B=s(N):B=[s,L?"active":null,R?"pending":null,p?"transitioning":null].filter(Boolean).join(" ");let q=typeof f=="function"?f(N):f;return M.createElement(Fl,{...d,"aria-current":A,className:B,ref:b,style:q,to:g,viewTransition:c},typeof h=="function"?h(N):h)});Up.displayName="NavLink";var LT=M.forwardRef(({discover:e="render",fetcherKey:n,navigate:i,reloadDocument:s,replace:o,state:f,method:g=Bu,action:c,onSubmit:h,relative:d,preventScrollReset:b,viewTransition:m,defaultShouldRevalidate:w,...x},T)=>{let{useTransitions:E}=M.useContext(ki),p=jT(),v=IT(c,{relative:d}),_=g.toLowerCase()==="get"?"get":"post",S=typeof c=="string"&&QS.test(c),k=L=>{if(h&&h(L),L.defaultPrevented)return;L.preventDefault();let R=L.nativeEvent.submitter,N=R?.getAttribute("formmethod")||g,A=()=>p(R||L.currentTarget,{fetcherKey:n,method:N,navigate:i,replace:o,state:f,relative:d,preventScrollReset:b,viewTransition:m,defaultShouldRevalidate:w});E&&i!==!1?M.startTransition(()=>A()):A()};return M.createElement("form",{ref:T,method:_,action:v,onSubmit:s?h:k,...x,"data-discover":!S&&e==="render"?"true":void 0})});LT.displayName="Form";function MT(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ew(e){let n=M.useContext(vo);return qt(n,MT(e)),n}function NT(e,{target:n,replace:i,mask:s,state:o,preventScrollReset:f,relative:g,viewTransition:c,defaultShouldRevalidate:h,useTransitions:d}={}){let b=yh(),m=Ui(),w=tc(e,{relative:g});return M.useCallback(x=>{if(uT(x,n)){x.preventDefault();let T=i!==void 0?i:Ul(m)===Ul(w),E=()=>b(e,{replace:T,mask:s,state:o,preventScrollReset:f,relative:g,viewTransition:c,defaultShouldRevalidate:h});d?M.startTransition(()=>E()):E()}},[m,b,w,i,s,o,n,e,f,g,c,h,d])}var OT=0,DT=()=>`__${String(++OT)}__`;function jT(){let{router:e}=ew("useSubmit"),{basename:n}=M.useContext(ki),i=eT(),s=e.fetch,o=e.navigate;return M.useCallback(async(f,g={})=>{let{action:c,method:h,encType:d,formData:b,body:m}=fT(f,n);if(g.navigate===!1){let w=g.fetcherKey||DT();await s(w,i,g.action||c,{defaultShouldRevalidate:g.defaultShouldRevalidate,preventScrollReset:g.preventScrollReset,formData:b,body:m,formMethod:g.method||h,formEncType:g.encType||d,flushSync:g.flushSync})}else await o(g.action||c,{defaultShouldRevalidate:g.defaultShouldRevalidate,preventScrollReset:g.preventScrollReset,formData:b,body:m,formMethod:g.method||h,formEncType:g.encType||d,replace:g.replace,state:g.state,fromRouteId:i,flushSync:g.flushSync,viewTransition:g.viewTransition})},[s,o,n,i])}function IT(e,{relative:n}={}){let{basename:i}=M.useContext(ki),s=M.useContext(ur);qt(s,"useFormAction must be used inside a RouteContext");let[o]=s.matches.slice(-1),f={...tc(e||".",{relative:n})},g=Ui();if(e==null){f.search=g.search;let c=new URLSearchParams(f.search),h=c.getAll("index");if(h.some(b=>b==="")){c.delete("index"),h.filter(m=>m).forEach(m=>c.append("index",m));let b=c.toString();f.search=b?`?${b}`:""}}return(!e||e===".")&&o.route.index&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),i!=="/"&&(f.pathname=f.pathname==="/"?i:Xi([i,f.pathname])),Ul(f)}function BT(e,{relative:n}={}){let i=M.useContext(GS);qt(i!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=ew("useViewTransitionState"),o=tc(e,{relative:n});if(!i.isTransitioning)return!1;let f=Hr(i.currentLocation.pathname,s)||i.currentLocation.pathname,g=Hr(i.nextLocation.pathname,s)||i.nextLocation.pathname;return eh(o.pathname,g)!=null||eh(o.pathname,f)!=null}var Cs=IS();const PT="fleet-console.canvas.",sm="fleet-console.canvas.backgroundAnimation",am="fleet-console.canvas.perimeterAnimation",tw="fleet-console.canvas.maximized",zT=400,Fp=640,Wp=400,zb=40,Hb=96,HT=.25,$T=1,Wf=.2,$b=.5,UT=.001,Ja={x:0,y:0,zoom:1},ro={viewport:Ja,operations:{},operationOrder:[],operationAccent:{},minimized:[],collapsedGroups:[]},Gp=new Set,qp=new Set,Kp=new Set,Vp=new Set,Yp=new Set,Wl=new Map;let Ci=null,Es=null,Ke=ro,so=_A(),ao=yA(),Il=xA(),Yn=null,ws=Ja,Js=null,nh=0;function om(e){return Gp.add(e),()=>{Gp.delete(e)}}function ho(){return Ke}function Xp(){return Yn}function FT(){return Ci}function nw(){return M.useSyncExternalStore(om,ho,ho)}function WT(){return M.useSyncExternalStore(rA,Fb,Fb)}function GT(){return M.useSyncExternalStore(sA,Wb,Wb)}function iw(){return M.useSyncExternalStore(aA,Gb,Gb)}function rw(){return M.useSyncExternalStore(oA,qb,qb)}function sw(){return M.useSyncExternalStore(om,Kb,Kb)}function Ei(e){Ke={viewport:e.viewport??Ke.viewport,operations:e.operations??Ke.operations,operationOrder:e.operationOrder??Ke.operationOrder,operationAccent:e.operationAccent??Ke.operationAccent,minimized:e.minimized??Ke.minimized,collapsedGroups:e.collapsedGroups??Ke.collapsedGroups},fA(),ow()}function qT(e){const n=Ke.collapsedGroups.includes(e)?Ke.collapsedGroups.filter(i=>i!==e):[...Ke.collapsedGroups,e];Ei({collapsedGroups:n})}function KT(){return M.useSyncExternalStore(om,Vb,Vb)}function Zp(e){cm();const n=um(e);ws=n,Ei({viewport:n})}function aw(e){const n=um(e);if(typeof window>"u"||typeof window.requestAnimationFrame!="function"||dA()){Zp(n);return}ws=n,Js===null&&(Js=window.requestAnimationFrame(uw))}function Jp(e,n){const i=ia();Ei({operations:{...Ke.operations,[e]:{...hm(n,i),zIndex:i}}})}function VT(e){Ke.minimized.includes(e)||(Yn===e&&fo(),Ei({minimized:[...Ke.minimized,e]}))}function YT(e){if(!Ke.minimized.includes(e))return;Yn===e&&fo();const n=Ke.minimized.filter(o=>o!==e),i=Ke.operations[e];if(!i){Ei({minimized:n});return}const s=ia();Ei({minimized:n,operations:{...Ke.operations,[e]:{...i,zIndex:s}}})}function Gf(e){Ei({operationOrder:fw(e)})}function ia(){return nh+=1,nh}function XT(e){const n=Ke.operations[e];if(n)return n;const i=Object.keys(Ke.operations).length,s={x:i*zb,y:i*zb,width:Fp,height:Wp,zIndex:ia()};return Ei({operations:{...Ke.operations,[e]:s}}),s}function ZT(e){const n=new Set(e),i={};let s=!1;for(const[b,m]of Object.entries(Ke.operations))n.has(b)?i[b]=m:s=!0;const o=Ke.minimized.filter(b=>n.has(b)),f=o.length!==Ke.minimized.length,g=Ke.operationOrder.filter(b=>n.has(b)),c=g.length!==Ke.operationOrder.length,h=Object.fromEntries(Object.entries(Ke.operationAccent).filter(([b])=>n.has(b))),d=Object.keys(h).length!==Object.keys(Ke.operationAccent).length;Yn&&(!n.has(Yn)||o.includes(Yn))&&fo(),(s||f||c||d)&&Ei({operations:i,minimized:o,operationOrder:g,operationAccent:h})}function JT(e){pA(),cm(),cA(),Ci=e,Ke=e?mA(e):ro;const n=e?Wl.get(e)??null:null,i=Yn!==n;Yn=n,ws=Ke.viewport,nh=Math.max(nh,pw(Ke.operations)),ow(),i&&lm()}function Ub(e,n){const i=Ke.operations[e];if(!i)return;const s=Math.max(HT,Math.min($T,Math.min((n.width-Hb)/i.width,(n.height-Hb)/i.height))),o={x:n.width/2-(i.x+i.width/2)*s,y:n.height/2-(i.y+i.height/2)*s,zoom:s};cm(),ws=o;const f=ia(),g=Ke.minimized.includes(e);Ei({viewport:o,operations:{...Ke.operations,[e]:{...hm(i,f),zIndex:f}},...g?{minimized:Ke.minimized.filter(c=>c!==e)}:{}})}function QT(){so=!so,bA(so),lw()}function eA(){ao=!ao,wA(ao),cw()}function tA(e){e==="local"&&(so&&!vA()&&(so=!1,lw()),ao&&!SA()&&(ao=!1,cw()))}function nA(){iA(!Il)}function iA(e){Il!==e&&(Il=e,CA(Il),lA())}function Bl(e){Ci&&Wl.set(Ci,e);const n=uA(e),i=!hA(Ke.minimized,n),s=Yn!==e;s&&(Yn=e),i&&Ei({minimized:n}),s&&lm()}function fo(){Ci&&Wl.delete(Ci),Yn!==null&&(Yn=null,lm())}function rA(e){return qp.add(e),()=>{qp.delete(e)}}function Fb(){return so}function sA(e){return Kp.add(e),()=>{Kp.delete(e)}}function Wb(){return ao}function ow(){for(const e of Gp)e()}function lw(){for(const e of qp)e()}function cw(){for(const e of Kp)e()}function aA(e){return Vp.add(e),()=>{Vp.delete(e)}}function Gb(){return Il}function oA(e){return Yp.add(e),()=>{Yp.delete(e)}}function qb(){return Yn}function Kb(){return Ke.minimized}function Vb(){return Ke.collapsedGroups}function lA(){for(const e of Vp)e()}function lm(){for(const e of Yp)e()}function cA(){Ci&&(Yn?Wl.set(Ci,Yn):Wl.delete(Ci))}function uA(e){return Object.keys(Ke.operations).filter(n=>n!==e)}function hA(e,n){return e.length===n.length&&e.every((i,s)=>i===n[s])}function uw(){const e=Ke.viewport,n=ws.x-e.x,i=ws.y-e.y,s=ws.zoom-e.zoom;if(Math.abs(n)<$b&&Math.abs(i)<$b&&Math.abs(s)<UT){Js=null,Ei({viewport:ws});return}Ei({viewport:{x:e.x+n*Wf,y:e.y+i*Wf,zoom:e.zoom+s*Wf}}),Js=typeof window<"u"?window.requestAnimationFrame(uw):null}function cm(){Js===null||typeof window>"u"||(window.cancelAnimationFrame(Js),Js=null)}function dA(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function fA(){!Ci||typeof window>"u"||(gA(),Es=window.setTimeout(()=>{Es=null,hw(Ci,Ke)},zT))}function pA(){!Es||!Ci||typeof window>"u"||(window.clearTimeout(Es),Es=null,hw(Ci,Ke))}function gA(){!Es||typeof window>"u"||(window.clearTimeout(Es),Es=null)}function mA(e){if(typeof window>"u")return ro;try{const n=window.localStorage.getItem(dw(e));if(!n)return ro;const i=JSON.parse(n);return EA(i)}catch{return ro}}function hw(e,n){if(!(!e||typeof window>"u"))try{window.localStorage.setItem(dw(e),JSON.stringify(n))}catch{}}function _A(){if(typeof window>"u")return!0;try{const e=window.localStorage.getItem(sm);return e===null?!0:e==="true"}catch{return!0}}function vA(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(sm)!==null}catch{return!1}}function bA(e){if(!(typeof window>"u"))try{window.localStorage.setItem(sm,String(e))}catch{}}function yA(){if(typeof window>"u")return!0;try{const e=window.localStorage.getItem(am);return e===null?!0:e==="true"}catch{return!0}}function SA(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(am)!==null}catch{return!1}}function wA(e){if(!(typeof window>"u"))try{window.localStorage.setItem(am,String(e))}catch{}}function xA(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(tw)==="true"}catch{return!1}}function CA(e){if(!(typeof window>"u"))try{window.localStorage.setItem(tw,String(e))}catch{}}function dw(e){return`${PT}${e}`}function EA(e){if(!po(e))return ro;const n=AA(e.operations);return{viewport:um(e.viewport),operations:n,operationOrder:fw(e.operationOrder),operationAccent:kA(e.operationAccent),minimized:TA(e.minimized,n),collapsedGroups:LA(e.collapsedGroups)}}function fw(e){if(!Array.isArray(e))return[];const n=new Set,i=[];for(const s of e)typeof s!="string"||n.has(s)||(n.add(s),i.push(s));return i}function kA(e){if(!po(e))return{};const n={};for(const[i,s]of Object.entries(e))typeof s=="string"&&(n[i]=s);return n}function TA(e,n){if(!Array.isArray(e))return[];const i=new Set,s=[];for(const o of e)typeof o!="string"||i.has(o)||!(o in n)||(i.add(o),s.push(o));return s}function um(e){if(!po(e))return Ja;const n=Pl(e.x,Ja.x),i=Pl(e.y,Ja.y),s=Qp(e.zoom,Ja.zoom);return{x:n,y:i,zoom:s}}function AA(e){if(!po(e))return{};const n={};for(const[i,s]of Object.entries(e))po(s)&&(n[i]=hm(s,RA(n)));return n}function hm(e,n){return po(e)?{x:Pl(e.x,0),y:Pl(e.y,0),width:Qp(e.width,Fp),height:Qp(e.height,Wp),zIndex:Pl(e.zIndex,n)}:{x:0,y:0,width:Fp,height:Wp,zIndex:n}}function RA(e){return pw(e)+1}function pw(e){return Math.max(0,...Object.values(e).map(n=>n.zIndex))}function Pl(e,n){return typeof e=="number"&&Number.isFinite(e)?e:n}function Qp(e,n){return typeof e=="number"&&Number.isFinite(e)&&e>0?e:n}function po(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function LA(e){if(!Array.isArray(e))return[];const n=new Set,i=[];for(const s of e)typeof s!="string"||n.has(s)||(n.add(s),i.push(s));return i}const MA=["canonicalCwd","cwd","providerSession","ticket","token","transcriptPath"];class ct extends Error{status;constructor(n,i){super(i),this.name="ApiError",this.status=n}}async function NA(e){const n=await fetch("/api/v1/theaters",{signal:e});await ui(n);const i=await n.json();if(!Array.isArray(i.theaters))throw new ct(n.status,"Invalid Theater response");return{theaters:i.theaters.map(s=>yw(s,n.status))}}async function OA(e,n){const i=e?`?theaterId=${encodeURIComponent(e)}`:"",s=await fetch(`/api/v1/status${i}`,{signal:n});return await ui(s),zA(await s.json(),s.status)}async function gw(e={}){const n=e.force?"?force=true":"",i=await fetch(`/api/v1/updates/release-notes${n}`,{signal:e.signal});return await ui(i),$A(await i.json(),i.status)}async function DA(e){const n=await fetch("/api/v1/updates/apply",{method:"POST",signal:e});return await ui(n),HA(await n.json(),n.status)}async function mw(e,n){const i=await fetch("/api/v1/theaters",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({folderGrantId:e}),signal:n});await ui(i);const s=await i.json();return yw(s,i.status)}async function jA(e,n){const i=await fetch("/api/v1/theaters/folder-listings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e}),signal:n});return await ui(i),GA(await i.json(),i.status)}async function _w(e,n){const i=await fetch("/api/v1/theaters/folder-grants",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e}),signal:n});await ui(i);const s=await i.json();if(typeof s.folderGrantId!="string")throw new ct(i.status,"Invalid folder grant response");return s.folderGrantId}async function IA(e,n){const i=await fetch(`/api/v1/theaters/${encodeURIComponent(e)}`,{method:"DELETE",signal:n});await ui(i)}async function Si(e,n){const i=e?`?theaterId=${encodeURIComponent(e)}`:"",s=await fetch(`/api/v1/operations${i}`,{signal:n});await ui(s);const o=await s.json();if(!Array.isArray(o.operations))throw new ct(s.status,"Invalid operations response");return o.operations.map(f=>bw(f,s.status))}async function Rl(e,n){const s=await fetch("/api/v1/operations/groups",{signal:n});await ui(s);const o=await s.json();if(!Array.isArray(o.groups))throw new ct(s.status,"Invalid groups response");return o.groups.map(f=>dm(f,s.status))}async function BA(e,n){const i=await fetch("/api/v1/operations/groups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:n});await ui(i);const s=await i.json();return dm(s.group,i.status)}async function Yb(e,n,i){const s=await fetch(`/api/v1/operations/groups/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:i});await ui(s);const o=await s.json();return dm(o.group,s.status)}async function PA(e,n){const i=await fetch(`/api/v1/operations/groups/${encodeURIComponent(e)}`,{method:"DELETE",signal:n});await ui(i)}async function vw(e,n,i){return zu(e,{title:n},i)}async function zu(e,n,i){const s=await fetch(`/api/v1/operations/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:i});await ui(s);const o=await s.json();return bw(o.operation,s.status)}function bw(e,n){const i=e;if(!i||typeof i.id!="string"||typeof i.theaterId!="string"||typeof i.type!="string"||typeof i.pluginId!="string"||typeof i.title!="string"||!i.payload||typeof i.payload!="object"||Array.isArray(i.payload)||!i.ts||typeof i.ts.createdAt!="number"||typeof i.ts.updatedAt!="number"||Gl(i)||Gl(i.payload))throw new ct(n,"Invalid operation response");return{id:i.id,theaterId:i.theaterId,type:i.type,pluginId:i.pluginId,title:i.title,payload:i.payload,geometry:i.geometry??null,accent:typeof i.accent=="string"?i.accent:null,groupId:i.groupId===null?null:typeof i.groupId=="string"?i.groupId:void 0,ts:i.ts}}function dm(e,n){const i=e;if(!i||typeof i.id!="string"||typeof i.theaterId!="string"||typeof i.name!="string"||typeof i.color!="string"||typeof i.order!="number"||typeof i.createdAt!="number")throw new ct(n,"Invalid group response");return{id:i.id,theaterId:i.theaterId,name:i.name,color:i.color,order:i.order,createdAt:i.createdAt}}function yw(e,n){const i=e;if(!i||typeof i.id!="string"||typeof i.label!="string"||typeof i.createdAt!="string"||typeof i.lastOpenedAt!="string"||typeof i.hasWiki!="boolean"||typeof i.activeAdmiralCount!="number"||Gl(i))throw new ct(n,"Invalid Theater response");return i}function zA(e,n){const i=e;if(!i||typeof i.workspaces!="number"||typeof i.version!="string"||i.channel!=="stable"&&i.channel!=="local"&&i.channel!=="unknown"||typeof i.updateAvailable!="boolean"||typeof i.port!="number"||i.portMode!=="dynamic"&&i.portMode!=="static"||i.requestedPort!==null&&typeof i.requestedPort!="number"||typeof i.effectivePort!="number"||typeof i.portHonored!="boolean"||i.wikiServerStatus!=="available"&&i.wikiServerStatus!=="unavailable"&&i.wikiServerStatus!=="unknown")throw new ct(n,"Invalid status response");return{workspaces:i.workspaces,version:i.version,channel:i.channel,updateAvailable:i.updateAvailable,latestVersion:typeof i.latestVersion=="string"?i.latestVersion:void 0,port:i.port,portMode:i.portMode,requestedPort:i.requestedPort,effectivePort:i.effectivePort,portHonored:i.portHonored,wikiServerStatus:i.wikiServerStatus}}function HA(e,n){const i=e;if(!i||i.status!=="accepted")throw new ct(n,"Invalid update response");return{status:"accepted"}}function $A(e,n){const i=e;if(!i||!Array.isArray(i.notes)||i.sourceRef!=="main"||typeof i.fetchedAt!="number"||typeof i.stale!="boolean"||"url"in i||"token"in i||"path"in i)throw new ct(n,"Invalid release notes response");return{notes:i.notes.map(s=>UA(s,n)),sourceRef:"main",fetchedAt:i.fetchedAt,stale:i.stale}}function UA(e,n){const i=e;if(!i||typeof i.version!="string"||i.date!==null&&typeof i.date!="string"||!Array.isArray(i.sections))throw new ct(n,"Invalid release notes response");return{version:i.version,date:i.date,sections:i.sections.map(s=>FA(s,n))}}function FA(e,n){const i=e;if(!i||i.heading!=="Added"&&i.heading!=="Changed"&&i.heading!=="Fixed"&&i.heading!=="Removed"&&i.heading!=="Breaking Changes"||!Array.isArray(i.items))throw new ct(n,"Invalid release notes response");return{heading:i.heading,items:i.items.map(s=>WA(s,n))}}function WA(e,n){const i=e;if(!i||!Array.isArray(i.packageTags)||!i.packageTags.every(s=>typeof s=="string")||typeof i.text!="string")throw new ct(n,"Invalid release notes response");return{packageTags:i.packageTags,text:i.text}}function GA(e,n){const i=e;if(!i||typeof i.path!="string"||i.parentPath!==null&&typeof i.parentPath!="string"||!Array.isArray(i.roots)||!Array.isArray(i.entries)||Gl(i))throw new ct(n,"Invalid folder list response");return{path:i.path,parentPath:i.parentPath??null,roots:i.roots.filter(s=>typeof s=="string"),entries:i.entries.map(s=>qA(s,n)),truncated:i.truncated===!0?!0:void 0}}function qA(e,n){const i=e;if(!i||typeof i.name!="string"||typeof i.path!="string"||i.kind!=="dir"||typeof i.accessible!="boolean"||Gl(i))throw new ct(n,"Invalid folder entry response");return{name:i.name,path:i.path,kind:"dir",accessible:i.accessible}}function Gl(e){if(!e||typeof e!="object")return!1;const n=e;return MA.some(i=>i in n)}async function ui(e){if(e.ok)return;let n=`${e.status} ${e.statusText}`;try{const i=await e.json();typeof i.error=="string"?n=i.error:typeof i.message=="string"&&(n=i.message)}catch{}throw new ct(e.status,n)}const KA="__unassigned__";function VA(e){const n=new Map(e.theaters.map(s=>[s.id,s])),i=[];for(const s of e.operations)s.theaterId&&i.push(ZA(s,n.get(s.theaterId)));return i}function YA(e,n){const i=Sw(n);return i.length===0?e:e.filter(s=>{const o=JA(s);return i.every(f=>o.includes(f))})}function XA(e){const n=[],i=new Map;for(const s of e){const o=s.theaterId??KA,f=i.get(o);if(f!==void 0){const g=n[f];g&&(n[f]={...g,entries:[...g.entries,s]});continue}i.set(o,n.length),n.push({theaterId:s.theaterId,theaterLabel:s.theaterLabel,entries:[s]})}return n}function Sw(e){return e.trim().toLocaleLowerCase().split(/\s+/).filter(Boolean)}function ZA(e,n){return{operationId:e.id,theaterId:e.theaterId,theaterLabel:n?.label??e.theaterId,operationName:e.title,pluginId:e.pluginId,status:"operation"}}function JA(e){return[e.operationName,e.theaterLabel,e.pluginId].join(" ").toLocaleLowerCase()}const eg="fleet-console.activeTheaterId",ww="fleet-console.commissioningSeen",xw="fleet-console.whatsNewSeenVersion",Cw="fleet-console.notificationPreferences",Ew=1,QA="maritime",_u={globalMute:!1,dnd:!1,mutedTheaterIds:{}},tg=new Set;let Xb=0,ng=null,ze={connection:"connecting",connectionError:null,activeTheme:QA,version:"",updateAvailable:!1,latestVersion:null,portMode:"dynamic",requestedPort:null,effectivePort:0,portHonored:!0,theaters:[],operations:[],operationsHydrated:!1,groups:[],activeTheaterId:null,activeOperationId:null,operationStatus:{},addingTheater:!1,theaterError:null,operationsViewActive:!1,operationSearchOpen:!1,whatsNewOpen:!1,releaseNotes:[],releaseNotesLoading:!1,releaseNotesError:null,releaseNotesSourceRef:null,releaseNotesFetchedAt:null,releaseNotesStale:!1,automaticWhatsNewVersion:null,selectedReleaseNoteKey:null,onboardingOpen:!1,bootstrapped:!1,pendingOperationFocus:null,operationNotifications:{},notificationPreferences:ER(),codexReader:null,codexReaderExpanded:!1};function ig(){return ze}function eR(e){return tg.add(e),()=>{tg.delete(e)}}function Ze(e){ze={...ze,...e},SR()}function tR(e){ze.operationsViewActive!==e&&Ze({operationsViewActive:e})}function kw(e){iR(e),Ze({activeTheme:e})}function nR(e){tA(e.channel),Ze({version:e.version,updateAvailable:e.updateAvailable,latestVersion:e.latestVersion??null,portMode:e.portMode,requestedPort:e.requestedPort,effectivePort:e.effectivePort,portHonored:e.portHonored,...Iw({...ze,version:e.version})})}function Tw(){Ze({releaseNotesLoading:!0,releaseNotesError:null})}function Aw(e){const n={...ze,releaseNotes:e.notes,releaseNotesLoading:!1,releaseNotesError:null,releaseNotesSourceRef:e.sourceRef,releaseNotesFetchedAt:e.fetchedAt,releaseNotesStale:e.stale,selectedReleaseNoteKey:ze.selectedReleaseNoteKey&&Pw(e.notes,ze.selectedReleaseNoteKey)?ze.selectedReleaseNoteKey:Bw(e.notes)};Ze({releaseNotes:n.releaseNotes,releaseNotesLoading:n.releaseNotesLoading,releaseNotesError:n.releaseNotesError,releaseNotesSourceRef:n.releaseNotesSourceRef,releaseNotesFetchedAt:n.releaseNotesFetchedAt,releaseNotesStale:n.releaseNotesStale,...Iw(n)})}function Rw(e){Ze({releaseNotesLoading:!1,releaseNotesError:e})}function iR(e){if(!(typeof document>"u")){if(e==="maritime"){document.documentElement.removeAttribute("data-theme");return}document.documentElement.setAttribute("data-theme",e)}}function rR(e){const n=jw(e,ze.activeTheaterId);Ze({theaters:e,activeTheaterId:n})}function sR(e){rR(e.theaters)}function wi(e){Ze({operations:e,operationsHydrated:!0})}function aR(e){const n=ze.operations.findIndex(s=>s.id===e.id);if(n===-1)return;const i=[...ze.operations];i[n]=e,Ze({operations:i})}function Ll(e){Ze({groups:e})}function oR(e){xh(e),Ze({activeTheaterId:e})}function or(e){ze.activeOperationId!==e&&Ze({activeOperationId:e})}function lR(e,n){if(n==="idle"){Lw(e);return}ze.operationStatus[e]!==n&&Ze({operationStatus:{...ze.operationStatus,[e]:n}})}function Lw(e){if(!(e in ze.operationStatus))return;const n={...ze.operationStatus};delete n[e],Ze({operationStatus:n})}function cR(e){if(!e.operationId)return;const n=ze.operations.find(g=>g.id===e.operationId);if(!n)return;const i=n.theaterId??null,s=ze.theaters.find(g=>g.id===i)?.label??i??"Unknown",o=n.title,f=xR(e.kind);Xb+=1,Ze({operationNotifications:{...ze.operationNotifications,[e.operationId]:{kind:f,operationId:e.operationId,theaterId:i,theaterLabel:s,operationLabel:o,lastRaisedSeq:Xb}}})}function Mw(){Ze({addingTheater:!0,theaterError:null})}function Nw(e){const n=[e,...ze.theaters.filter(i=>i.id!==e.id)];xh(e.id),Ze({theaters:n,activeTheaterId:e.id,addingTheater:!1,theaterError:null})}function uR(){Ze({addingTheater:!1,theaterError:null})}function rg(e){Ze({addingTheater:!1,theaterError:e})}function wh(e){const n=ze.operations.find(i=>i.id===e);n&&(xh(n.theaterId),Ze({activeTheaterId:n.theaterId,activeOperationId:e,pendingOperationFocus:e,operationNotifications:Dw(ze.operationNotifications,e)}),window.dispatchEvent(new CustomEvent("fleet-console:focus-operation",{detail:{operationId:e}})))}function Zb(){ze.pendingOperationFocus!==null&&Ze({pendingOperationFocus:null})}function hR(e,n,i){if(e.length===0)return null;const s=n?e.indexOf(n):-1,o=s===-1?i>0?0:e.length-1:(s+i+e.length)%e.length;return e[o]??null}function Ow(e,n){if(n.length===0)return[...e].sort(sg);const i=new Map(n.map((s,o)=>[s,o]));return[...e].sort((s,o)=>{const f=i.get(s.id),g=i.get(o.id);return f!==void 0&&g!==void 0?f-g:f!==void 0?-1:g!==void 0?1:sg(s,o)})}function dR(e,n,i,s=[]){const o=Ow(e,i),f=new Set(s),g=[...n].sort((h,d)=>h.order-d.order||h.createdAt-d.createdAt),c=new Map;for(const h of g)c.set(h.id,[]);c.set(null,[]);for(const h of o){const d=h.groupId??null;d!==null&&c.has(d)?c.get(d).push(h):c.get(null).push(h)}return[...g.filter(h=>!f.has(h.id)).flatMap(h=>c.get(h.id)??[]),...c.get(null)??[]]}function sg(e,n){return e.ts.createdAt-n.ts.createdAt||e.id.localeCompare(n.id)}function qf(){Ze({operationSearchOpen:!1})}function fR(){Ze({operationSearchOpen:!ze.operationSearchOpen})}function pR(){ze.releaseNotes.length===0||ze.whatsNewOpen||Ze({whatsNewOpen:!0,selectedReleaseNoteKey:ze.selectedReleaseNoteKey??Bw(ze.releaseNotes)})}function vu(){ze.whatsNewOpen&&(ze.automaticWhatsNewVersion&&RR(ze.automaticWhatsNewVersion),Ze({whatsNewOpen:!1,automaticWhatsNewVersion:null}))}function Jb(e){Pw(ze.releaseNotes,e)&&Ze({selectedReleaseNoteKey:e})}function ml(){TR(!0),ze.onboardingOpen&&Ze({onboardingOpen:!1})}function Br(e){Ze({codexReader:e,codexReaderExpanded:!1})}function Hu(){ze.codexReader!==null&&Ze({codexReaderExpanded:!0})}function gR(){Ze({codexReaderExpanded:!1})}function Qb(){Ze({codexReader:null,codexReaderExpanded:!1})}function e1(){if(ze.bootstrapped)return;const e=ze.theaters.length===0&&!kR();Ze({bootstrapped:!0,onboardingOpen:e?!0:ze.onboardingOpen})}function t1(e){const n=ze.theaters.filter(g=>g.id!==e),i=jw(n,ze.activeTheaterId===e?null:ze.activeTheaterId),s=wR(ze.operationNotifications,e),o=new Set(ze.operations.filter(g=>g.theaterId===e).map(g=>g.id)),f=ze.activeOperationId&&o.has(ze.activeOperationId)?null:ze.activeOperationId;xh(i),Ze({theaters:n,activeTheaterId:i,activeOperationId:f,operationNotifications:s})}function mR(e){const n=Dw(ze.operationNotifications,e);n!==ze.operationNotifications&&Ze({operationNotifications:n})}function _R(e){const n={...ze.notificationPreferences,globalMute:e};pm(n),Ze({notificationPreferences:n})}function vR(e){const n={...ze.notificationPreferences,dnd:e};pm(n),Ze({notificationPreferences:n})}function bR(e){const n={...ze.notificationPreferences.mutedTheaterIds};n[e]?delete n[e]:n[e]=!0;const i={...ze.notificationPreferences,mutedTheaterIds:n};pm(i),Ze({notificationPreferences:i})}function yR(e){return VA(e)}function SR(){for(const e of tg)e()}function Dw(e,n){if(!e[n])return e;const i={...e};return delete i[n],i}function wR(e,n){let i=!1;const s={};for(const[o,f]of Object.entries(e)){if(f.theaterId===n){i=!0;continue}s[o]=f}return i?s:e}function jw(e,n){const i=new Set(e.map(o=>o.id)),s=CR();return s&&i.has(s)?s:n&&i.has(n)?n:e[0]?.id??null}function xR(e){const n=e.toLowerCase();return n==="ended"||n.includes(".end")||n.includes("done")?"ended":"input-waiting"}function Iw(e){const n=e.releaseNotes.findIndex(s=>s.version!=="Unreleased"),i=n>=0?e.releaseNotes[n]:void 0;return!i||!e.version||i.version!==e.version||AR()===i.version?{whatsNewOpen:e.whatsNewOpen,automaticWhatsNewVersion:e.automaticWhatsNewVersion,selectedReleaseNoteKey:e.selectedReleaseNoteKey}:{whatsNewOpen:!0,automaticWhatsNewVersion:i.version,selectedReleaseNoteKey:fm(i.version,n)}}function Bw(e){return e[0]?fm(e[0].version,0):null}function Pw(e,n){return e.some((i,s)=>fm(i.version,s)===n)}function fm(e,n){return`${e}:${n}`}function CR(){if(typeof window>"u")return null;try{return window.localStorage.getItem(eg)}catch{return null}}function xh(e){if(!(typeof window>"u"))try{e?window.localStorage.setItem(eg,e):window.localStorage.removeItem(eg)}catch{}}function ER(){if(typeof window>"u")return _u;try{const e=window.localStorage.getItem(Cw);if(!e)return _u;const n=JSON.parse(e);return LR(n)?{globalMute:n.preferences.globalMute,dnd:n.preferences.dnd,mutedTheaterIds:n.preferences.mutedTheaterIds}:_u}catch{return _u}}function kR(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(ww)==="1"}catch{return!1}}function TR(e){if(!(typeof window>"u"))try{e&&window.localStorage.setItem(ww,"1")}catch{}}function AR(){if(ng!==null)return ng;if(typeof window>"u")return null;try{return window.localStorage.getItem(xw)}catch{return null}}function RR(e){if(ng=e,!(typeof window>"u"))try{window.localStorage.setItem(xw,e)}catch{}}function pm(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Cw,JSON.stringify({version:Ew,preferences:e}))}catch{}}function LR(e){if(!e||typeof e!="object")return!1;const n=e;if(n.version!==Ew||!n.preferences||typeof n.preferences!="object")return!1;const i=n.preferences;return typeof i.globalMute=="boolean"&&typeof i.dnd=="boolean"&&!!i.mutedTheaterIds&&typeof i.mutedTheaterIds=="object"}const bu="directory-browser-sectors";function zw({open:e,onCancel:n,onConfirm:i}){const[s,o]=M.useState(null),[f,g]=M.useState(null),[c,h]=M.useState(null),[d,b]=M.useState(""),[m,w]=M.useState(""),[x,T]=M.useState(0),E=M.useRef(null),p=M.useRef(null),v=async(V,z)=>{g(V),h(null),b(""),T(0);try{const G=await jA(V,z);o(G)}catch(G){if(G instanceof DOMException&&G.name==="AbortError")return;h(G instanceof ct?G.message:String(G))}finally{g(null)}};M.useEffect(()=>{if(!e)return;const V=new AbortController;return v(null,V.signal),()=>V.abort()},[e]),M.useEffect(()=>{e&&E.current?.focus()},[e,s?.path]);const _=s?.entries??[],S=M.useMemo(()=>{const V=d.trim().toLowerCase();return V===""?_:_.filter(z=>z.name.toLowerCase().includes(V))},[_,d]),k=M.useMemo(()=>s?MR(s):[],[s]),L=s?n1(s.path):null,R=s?.roots??[],N=R.length>1,A=S.length===0?-1:Math.min(x,S.length-1);if(M.useEffect(()=>{if(A<0)return;p.current?.querySelector(`[data-index="${A}"]`)?.scrollIntoView({block:"nearest"})},[A,s?.path]),!e)return null;const B=V=>{V.accessible&&f===null&&v(V.path)},q=()=>{s?.parentPath!=null&&f===null&&v(s.parentPath)},F=()=>{const V=m.trim();V!==""&&f===null&&v(V)},W=s?.path??null,I=A>=0?`${bu}-${A}`:void 0,Y=V=>{switch(V.key){case"Escape":d!==""?b(""):n();return;case"ArrowDown":V.preventDefault(),T(z=>Math.min(z+1,Math.max(S.length-1,0)));return;case"ArrowUp":V.preventDefault(),T(z=>Math.max(z-1,0));return;case"Enter":{V.preventDefault();const z=S[A];z&&B(z);return}case"Backspace":d===""&&(V.preventDefault(),q());return;default:return}};return Cs.createPortal(u.jsxs("div",{className:"directory-browser-overlay",role:"presentation",children:[u.jsx("button",{type:"button",className:"directory-browser-scrim","aria-label":"Close",onClick:n}),u.jsxs("section",{className:"directory-browser-card",role:"dialog","aria-modal":"true","aria-label":"Establish Theater of Operations",onKeyDown:Y,children:[u.jsxs("header",{className:"directory-browser-header",children:[u.jsx("span",{className:"directory-browser-sigil","aria-hidden":"true",children:u.jsx(DR,{})}),u.jsxs("div",{className:"directory-browser-heading",children:[u.jsx("span",{className:"directory-browser-kicker",children:"Theater of Operations"}),u.jsx("h2",{children:"Establish Theater"})]}),u.jsx("button",{type:"button",className:"directory-browser-close",onClick:n,"aria-label":"Close",children:"×"})]}),N?u.jsxs("div",{className:"directory-browser-roots",role:"group","aria-label":"Drives",children:[u.jsx("span",{className:"directory-browser-kicker",children:"Stations"}),u.jsx("div",{className:"directory-browser-root-chips",children:R.map(V=>{const z=L!=null&&n1(V)===L;return u.jsx("button",{type:"button",className:`directory-browser-root-chip ${z?"is-active":""}`,"aria-current":z?"location":void 0,disabled:f!==null,title:V,onClick:()=>{f===null&&v(V)},onKeyDown:G=>G.stopPropagation(),children:OR(V)},V)})})]}):null,u.jsx("nav",{className:"directory-browser-course","aria-label":"Path",children:k.map((V,z)=>{const G=z===k.length-1;return u.jsxs("span",{className:"directory-browser-course-seg",children:[z>0?u.jsx("span",{className:"directory-browser-course-sep","aria-hidden":"true",children:"›"}):null,u.jsx("button",{type:"button",className:`directory-browser-crumb ${G?"is-current":""}`,"aria-current":G?"location":void 0,disabled:G||f!==null,title:V.path,onClick:()=>{v(V.path)},children:V.label})]},V.path)})}),u.jsxs("div",{className:"directory-browser-toolbar",children:[u.jsxs("div",{className:"directory-browser-filter",children:[u.jsx("span",{className:"directory-browser-filter-glyph","aria-hidden":"true",children:u.jsx(IR,{})}),u.jsx("input",{ref:E,type:"text",className:"directory-browser-filter-input",placeholder:"Filter sectors…","aria-label":"Filter folders","aria-controls":bu,value:d,spellCheck:!1,autoComplete:"off",onChange:V=>{b(V.target.value),T(0)}})]}),u.jsxs("button",{type:"button",className:"directory-browser-up",disabled:s?.parentPath==null||f!==null,title:"Up one sector (Backspace)",onClick:q,children:[u.jsx(BR,{}),u.jsx("span",{children:"Up"})]})]}),u.jsxs("div",{className:"directory-browser-jump",children:[u.jsx("input",{type:"text",className:"directory-browser-jump-input",placeholder:"Or jump to a path — e.g. D:\\\\projects","aria-label":"Jump to absolute path",value:m,spellCheck:!1,autoComplete:"off",onChange:V=>w(V.target.value),onKeyDown:V=>{V.stopPropagation(),V.key==="Enter"&&(V.preventDefault(),F())}}),u.jsx("button",{type:"button",className:"directory-browser-jump-button",disabled:m.trim()===""||f!==null,onClick:F,onKeyDown:V=>V.stopPropagation(),children:"Go"})]}),c?u.jsx("p",{className:"directory-browser-error",role:"alert",children:c}):null,u.jsx("div",{className:"directory-browser-list",id:bu,role:"listbox","aria-label":"Folders","aria-busy":f!==null,"aria-activedescendant":I,ref:p,children:f!==null?u.jsxs("p",{className:"directory-browser-state is-live",children:[u.jsx("span",{className:"directory-browser-scan-dot","aria-hidden":"true"}),"Scouting…"]}):S.length===0?u.jsx("p",{className:"directory-browser-state",children:d!==""?"No sectors match the filter.":"No sectors to advance into."}):S.map((V,z)=>u.jsxs("div",{id:`${bu}-${z}`,"data-index":z,role:"option","aria-selected":z===A,"aria-disabled":!V.accessible,className:`directory-browser-sector ${z===A?"is-active":""} ${V.accessible?"":"is-locked"}`,title:V.path,onClick:()=>{T(z),B(V)},children:[u.jsx("span",{className:"directory-browser-sector-glyph","aria-hidden":"true",children:u.jsx(jR,{})}),u.jsx("span",{className:"directory-browser-sector-name",children:V.name}),V.accessible?u.jsx("span",{className:"directory-browser-sector-advance","aria-hidden":"true",children:"›"}):u.jsxs("span",{className:"directory-browser-sector-lock",children:[u.jsx(PR,{})," Locked"]})]},V.path))}),s?.truncated?u.jsx("p",{className:"directory-browser-note",children:"Charting first 500 sectors only."}):null,u.jsxs("footer",{className:"directory-browser-actions",children:[u.jsxs("div",{className:"directory-browser-target",children:[u.jsx("span",{className:"directory-browser-target-label",children:"Theater Root"}),u.jsx("span",{className:"directory-browser-target-path",title:W??"",children:W??"Scouting…"})]}),u.jsxs("div",{className:"directory-browser-buttons",children:[u.jsx("button",{type:"button",className:"directory-browser-button",onClick:n,children:"Cancel"}),u.jsx("button",{type:"button",className:"directory-browser-button is-primary",disabled:W===null||f!==null,onClick:()=>W&&i(W),children:"Establish Theater"})]})]})]})]}),document.body)}function MR(e){if(NR(e)==="/"){const g=[{label:"/",path:"/"}];let c="";for(const h of e.path.split("/").filter(Boolean))c+=`/${h}`,g.push({label:h,path:c});return g}const i=/^([A-Za-z]:)\\?/.exec(e.path),s=i?`${i[1]}\\`:e.roots[0]??"C:\\",o=[{label:s,path:s}];let f=s.replace(/\\$/,"");for(const g of e.path.slice(s.length).split("\\").filter(Boolean))f+=`\\${g}`,o.push({label:g,path:f});return o}function NR(e){return e.roots.some(n=>/^[A-Za-z]:\\$/.test(n))||/^[A-Za-z]:\\/.test(e.path)?"\\":"/"}function n1(e){return/^([A-Za-z]:)\\?/.exec(e)?.[1]?.toLowerCase()??null}function OR(e){return e.replace(/[\\/]+$/,"")||e}function DR(){return u.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[u.jsx("circle",{cx:"10",cy:"10",r:"6.6",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),u.jsx("circle",{cx:"10",cy:"10",r:"2.1",fill:"currentColor"}),u.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 jR(){return u.jsx("svg",{viewBox:"0 0 18 18","aria-hidden":"true",children:u.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 IR(){return u.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[u.jsx("circle",{cx:"7",cy:"7",r:"4.2",fill:"none",stroke:"currentColor",strokeWidth:"1.3"}),u.jsx("path",{d:"M10.2 10.2 13.5 13.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]})}function BR(){return u.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:u.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 PR(){return u.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[u.jsx("rect",{x:"3.6",y:"7",width:"8.8",height:"6.2",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),u.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 zR=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function HR({state:e}){const[n,i]=M.useState(!1),s=M.useRef(null),o=M.useRef(null),f=M.useRef(null),g=e.theaters.length>0;if(M.useEffect(()=>{if(e.onboardingOpen)return s.current=document.activeElement,o.current?.focus(),()=>{const b=s.current;s.current=null,b?.focus?.()}},[e.onboardingOpen]),M.useEffect(()=>{if(!e.onboardingOpen)return;const b=m=>{n||(m.key==="Escape"?(m.preventDefault(),ml()):m.key==="Tab"&&$R(m,f.current),m.stopImmediatePropagation())};return window.addEventListener("keydown",b,!0),()=>window.removeEventListener("keydown",b,!0)},[n,e.onboardingOpen]),!e.onboardingOpen)return null;const c=()=>{i(!0)},h=()=>{i(!1)},d=async b=>{i(!1),Mw();try{const m=await _w(b),w=await mw(m);Nw(w)}catch(m){rg(m instanceof Error?m.message:String(m))}};return u.jsxs("div",{className:"commissioning-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"commissioning-title",children:[u.jsx("button",{type:"button",className:"commissioning-scrim",onClick:ml,"aria-label":"Close Commissioning guide"}),u.jsxs("section",{className:"commissioning-card",ref:f,children:[u.jsxs("header",{className:"commissioning-header",children:[u.jsx("span",{className:"commissioning-eyebrow",children:"COMMISSIONING · FLEET CONSOLE"}),u.jsx("h2",{id:"commissioning-title",children:"Bring your fleet online"}),u.jsx("p",{children:"Three steps to go from an empty bridge to live carrier operations."})]}),u.jsxs("ol",{className:"commissioning-steps",children:[u.jsxs("li",{className:`commissioning-step commissioning-step--primary ${g?"is-complete":"is-current"}`,children:[u.jsx("span",{className:"commissioning-step-node","aria-hidden":"true",children:g?"✓":"01"}),u.jsxs("div",{className:"commissioning-step-body",children:[u.jsx("h3",{children:"Register a Theater"}),u.jsx("p",{children:"A Theater is a project directory the fleet operates in. Choose the folder you want to work from."}),g?u.jsx(Fl,{ref:b=>{o.current=b},className:"commissioning-primary-action",to:"/operations",onClick:ml,children:"Go to Operations →"}):u.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?u.jsx("p",{className:"commissioning-error",role:"alert",children:e.theaterError}):null]})]}),u.jsxs("li",{className:"commissioning-step",children:[u.jsx("span",{className:"commissioning-step-node","aria-hidden":"true",children:"02"}),u.jsxs("div",{className:"commissioning-step-body",children:[u.jsx("h3",{children:"Open an Operation"}),u.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."}),u.jsx(Fl,{className:"commissioning-secondary-link",to:"/operations",onClick:ml,children:"Go to Operations"})]})]}),u.jsxs("li",{className:"commissioning-step",children:[u.jsx("span",{className:"commissioning-step-node","aria-hidden":"true",children:"03"}),u.jsxs("div",{className:"commissioning-step-body",children:[u.jsx("h3",{children:"Observe carriers"}),u.jsx("p",{children:"Carriers are specialist agents your Admiral dispatches. Their sorties stream here in real time as they run."})]})]})]}),u.jsxs("footer",{className:"commissioning-footer",children:[u.jsx("p",{children:"Theaters with a Fleet Wiki knowledge root also unlock Codex — your decision log and reference library."}),u.jsx("button",{type:"button",className:"commissioning-skip",onClick:ml,children:"Skip for now"})]})]}),u.jsx(zw,{open:n,onCancel:h,onConfirm:d})]})}function $R(e,n){if(!n)return;const i=Array.from(n.querySelectorAll(zR)),s=i[0],o=i[i.length-1];!s||!o||(e.shiftKey&&document.activeElement===s?(e.preventDefault(),o.focus()):!e.shiftKey&&document.activeElement===o&&(e.preventDefault(),s.focus()))}const UR="a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex='-1'])",i1="operation-search-listbox",Hw="__unassigned__";function FR({state:e}){const n=yh(),[i,s]=M.useState(""),[o,f]=M.useState(0),g=M.useRef(null),c=M.useRef(null),h=M.useRef(null),d=M.useRef(new Map),b=M.useMemo(()=>yR(e),[e]),m=M.useMemo(()=>YA(b,i),[b,i]),w=M.useMemo(()=>XA(m),[m]),x=M.useMemo(()=>Sw(i),[i]),T=r1(o,m.length),E=m[T]?s1(m[T].operationId):void 0;if(M.useEffect(()=>{if(!e.operationSearchOpen)return;h.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const _=document.body.style.overflow;return document.body.style.overflow="hidden",window.setTimeout(()=>g.current?.focus(),0),()=>{document.body.style.overflow=_,h.current?.focus()}},[e.operationSearchOpen]),M.useEffect(()=>{if(!e.operationSearchOpen){s(""),f(0);return}f(0)},[e.operationSearchOpen,i]),M.useEffect(()=>{if(!e.operationSearchOpen)return;const _=m[T];_&&d.current.get(_.operationId)?.scrollIntoView({block:"nearest"})},[T,m,e.operationSearchOpen]),!e.operationSearchOpen)return null;const p=_=>{wh(_),n("/operations"),qf()},v=_=>{if(_.key==="Escape"){_.preventDefault(),qf();return}if(_.key==="ArrowDown"||_.key==="ArrowUp"){_.preventDefault(),f(S=>r1(S+(_.key==="ArrowDown"?1:-1),m.length));return}if(_.key==="Enter"){const S=m[T];if(!S)return;_.preventDefault(),p(S.operationId);return}_.key==="Tab"&&KR(_,c.current)};return u.jsx("div",{className:"operation-search-overlay",onMouseDown:_=>{_.target===_.currentTarget&&qf()},children:u.jsxs("section",{ref:c,className:"operation-search-card",role:"dialog","aria-modal":"true","aria-label":"Operation quick search",tabIndex:-1,onKeyDown:v,children:[u.jsxs("div",{className:"operation-search-field",children:[u.jsx(VR,{}),u.jsx("input",{ref:g,id:"operation-search-input",type:"search",value:i,onChange:_=>s(_.target.value),placeholder:"Search Operations across Theaters",autoComplete:"off",role:"combobox","aria-expanded":!0,"aria-controls":i1,"aria-activedescendant":E,"aria-autocomplete":"list",spellCheck:!1}),u.jsx("kbd",{children:"esc"})]}),u.jsx("div",{id:i1,className:"operation-search-results",role:"listbox","aria-label":"Operation results",children:w.length>0?w.map(_=>{const S=GR(_.theaterId);return u.jsxs("section",{className:"operation-search-section",role:"group","aria-labelledby":S,children:[u.jsx("h2",{id:S,className:"operation-search-section-heading",children:Kf(_.theaterLabel,x)}),_.entries.map(k=>{const L=m.indexOf(k),R=L===T;return u.jsxs("button",{id:s1(k.operationId),ref:N=>{N?d.current.set(k.operationId,N):d.current.delete(k.operationId)},type:"button",className:`operation-search-result ${R?"is-active":""}`,role:"option","aria-selected":R,onMouseEnter:()=>f(L),onClick:()=>p(k.operationId),children:[u.jsxs("span",{className:"operation-search-result-text",children:[u.jsx("strong",{children:Kf(k.operationName,x)}),u.jsx("small",{children:WR(k)})]}),u.jsx("span",{className:"operation-search-theater",children:Kf(k.theaterLabel,x)})]},k.operationId)})]},_.theaterId??Hw)}):u.jsx("p",{className:"operation-search-empty",children:"No matching Operations."})})]})})}function r1(e,n){return n<=0?0:Math.max(0,Math.min(e,n-1))}function WR(e){return[e.pluginId,e.status].filter(Boolean).join(" · ")}function GR(e){return`operation-search-heading-${$w(e??Hw)}`}function s1(e){return`operation-search-option-${$w(e)}`}function $w(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-")}function Kf(e,n){if(n.length===0)return e;const i=[];let s=0;for(;s<e.length;){const o=qR(e,n,s);if(!o){i.push(e.slice(s));break}o.start>s&&i.push(e.slice(s,o.start)),i.push(u.jsx("mark",{children:e.slice(o.start,o.end)},`${o.start}-${o.end}`)),s=o.end}return i}function qR(e,n,i){const s=e.toLocaleLowerCase();let o=null;for(const f of n){const g=s.indexOf(f,i);g!==-1&&(!o||g<o.start)&&(o={start:g,end:g+f.length})}return o}function KR(e,n){if(!n)return;const i=Array.from(n.querySelectorAll(UR)).filter(f=>f.offsetParent!==null);if(i.length===0)return;const s=i[0],o=i[i.length-1];if(e.shiftKey&&document.activeElement===s){e.preventDefault(),o?.focus();return}!e.shiftKey&&document.activeElement===o&&(e.preventDefault(),s?.focus())}function VR(){return u.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:u.jsx("path",{d:"m14.2 14.2 3 3M8.9 15.2a6.3 6.3 0 1 1 0-12.6 6.3 6.3 0 0 1 0 12.6Z",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function YR({open:e,title:n,message:i,tone:s="info",onDismiss:o}){return e?u.jsx("div",{className:"app-toast-host",children:u.jsxs("div",{className:`app-toast app-toast--${s}`,role:"status","aria-live":"polite",children:[u.jsx("span",{className:"app-toast-dot","aria-hidden":"true"}),u.jsxs("div",{className:"app-toast-body",children:[u.jsx("p",{className:"app-toast-title",children:n}),i?u.jsx("p",{className:"app-toast-message",children:i}):null]}),o?u.jsx("button",{type:"button",className:"app-toast-close",onClick:o,"aria-label":"Dismiss notification",children:"×"}):null]})}):null}function XR({state:e}){if(e.releaseNotesLoading||e.releaseNotes.length===0||e.releaseNotesError&&!e.releaseNotesStale)return null;const n=e.releaseNotes.find(s=>s.version===e.version),i=n&&e.version?` v${n.version}`:"";return u.jsx("button",{type:"button",className:"topbar-whatsnew-button",onMouseDown:s=>s.preventDefault(),onClick:pR,"aria-label":`What's new${i}`,title:`What's new${i}`,children:u.jsx("span",{children:"What's new"})})}const ZR=1400,JR="https://github.com/sbluemin/fleet-harness",QR="https://github.com/sbluemin/fleet-harness/stargazers",e3="https://api.github.com/repos/sbluemin/fleet-harness",gm="fleet-console.github-stars",t3=360*60*1e3;function n3({state:e}){const n=e.connectionError!==null,i=Ui().pathname,s=i.startsWith("/carrier-settings")?u.jsx(o1,{}):i.startsWith("/settings")?u.jsx(a1,{}):i.startsWith("/operations")?u.jsx(b3,{}):u.jsx(v3,{});return u.jsxs("header",{className:"topbar",children:[u.jsxs("div",{className:"topbar-lead",children:[u.jsxs(Fl,{className:"topbar-brand",to:"/operations","aria-label":"Operations로 이동",children:[u.jsx("span",{className:`topbar-sigil ${n?"is-alert":""}`,"aria-hidden":"true",title:e.connectionError??void 0,children:s}),u.jsxs("h1",{className:"topbar-title",children:["Fleet",u.jsx("span",{className:"topbar-title-thin",children:"Console"})]})]}),u.jsxs("span",{className:"topbar-preview-badge",children:[u.jsx("span",{className:"topbar-preview-label",children:"Research Preview"}),e.version?u.jsxs("span",{className:"topbar-preview-version",children:["v",e.version]}):null]}),u.jsx(l3,{}),u.jsx(XR,{state:e})]}),u.jsx(o3,{state:e}),u.jsxs("div",{className:"topbar-meta",children:[e.updateAvailable?u.jsx(i3,{latestVersion:e.latestVersion}):null,u.jsxs(Up,{to:"/carrier-settings",className:({isActive:o})=>`topbar-nav-link ${o?"is-active":""}`,title:"Carrier settings",children:[u.jsx("span",{className:"topbar-nav-icon","aria-hidden":"true",children:u.jsx(o1,{})}),u.jsx("span",{children:"Carriers"})]}),u.jsxs(Up,{to:"/settings",className:({isActive:o})=>`topbar-nav-link ${o?"is-active":""}`,title:"Settings",children:[u.jsx("span",{className:"topbar-nav-icon","aria-hidden":"true",children:u.jsx(a1,{})}),u.jsx("span",{children:"Settings"})]})]})]})}function i3({latestVersion:e}){const[n,i]=M.useState("idle"),[s,o]=M.useState(null),f=M.useRef(null),g=r3(n,s,e);M.useEffect(()=>()=>{f.current!==null&&window.clearTimeout(f.current)},[]);const c=async()=>{if(!g.disabled){f.current!==null&&(window.clearTimeout(f.current),f.current=null),i("applying"),o(null);try{if((await DA()).status!=="accepted"){i("error"),o("invalid_response");return}i("accepted"),f.current=window.setTimeout(()=>{f.current=null,i("completed")},ZR)}catch(h){const d=h instanceof ct?h.message:"network_error";o(d),i(a3(d)?"blocked":"error")}}};return u.jsx("button",{type:"button",className:`topbar-update-badge topbar-update-badge--${g.tone}`,onClick:c,disabled:g.disabled,title:g.title,"aria-live":"polite",children:g.label})}function r3(e,n,i){const s=i?`최신 버전 ${i}`:"업데이트 가능";return e==="applying"?{label:"요청 중",title:"업데이트 적용 요청을 보내는 중입니다.",tone:"live",disabled:!0}:e==="accepted"?{label:"업데이트 중",title:"서버가 곧 재시작되고 새 창에서 콘솔을 엽니다.",tone:"live",disabled:!0}:e==="completed"?{label:"완료: 새 창에서 계속",title:"새 창에서 재시작된 콘솔을 계속 사용하세요.",tone:"live",disabled:!0}:e==="blocked"?s3(n):e==="error"?{label:"재시도",title:"업데이트 요청에 실패했습니다. 다시 시도할 수 있습니다.",tone:"error",disabled:!1}:{label:"Update available",title:s,tone:"warn",disabled:!1}}function s3(e){return e==="local_channel"?{label:"로컬 빌드",title:"로컬 개발 빌드는 콘솔에서 업데이트하지 않습니다.",tone:"blocked",disabled:!0}:e==="update_already_in_progress"?{label:"이미 진행 중",title:"다른 업데이트 적용이 이미 진행 중입니다.",tone:"blocked",disabled:!0}:e==="update_not_available"?{label:"업데이트 없음",title:"서버 재확인 결과 적용할 업데이트가 없습니다.",tone:"blocked",disabled:!0}:{label:"콘솔 준비 안 됨",title:"콘솔이 업데이트를 시작할 준비가 되지 않았습니다. 잠시 뒤 다시 시도하세요.",tone:"error",disabled:!1}}function a3(e){return e==="local_channel"||e==="update_already_in_progress"||e==="update_not_available"}function o3({state:e}){const[n,i]=M.useState(!1),[s,o]=M.useState(!1),f=M.useRef(null),g=M.useRef(null),c=M.useRef(null),h=e.theaters.find(p=>p.id===e.activeTheaterId)??null,d=h?.label??(e.theaters.length===0?"No Theaters":"Theater");M.useEffect(()=>{if(!n)return;const p=_=>{f.current?.contains(_.target)||i(!1)},v=_=>{_.key==="Escape"&&(i(!1),g.current?.focus())};return document.addEventListener("mousedown",p),document.addEventListener("keydown",v),()=>{document.removeEventListener("mousedown",p),document.removeEventListener("keydown",v)}},[n]),M.useEffect(()=>{if(!n)return;const p=c.current;if(!p)return;(p.querySelector('[data-active="true"]')??p.querySelector("[role^='menuitem']"))?.focus()},[n]);const b=p=>{oR(p),i(!1),g.current?.focus()},m=async()=>{i(!1),o(!0)},w=()=>{o(!1),uR()},x=async p=>{o(!1),Mw();try{const v=await _w(p),_=await mw(v);Nw(_)}catch(v){rg(v instanceof Error?v.message:String(v))}},T=async()=>{if(h){i(!1);try{await IA(h.id),t1(h.id)}catch(p){if(p instanceof ct&&p.status===404){t1(h.id);return}rg(p instanceof Error?p.message:String(p))}}},E=p=>{if(p.key!=="ArrowDown"&&p.key!=="ArrowUp")return;p.preventDefault();const v=Array.from(c.current?.querySelectorAll("[role^='menuitem']")??[]);if(v.length===0)return;const _=v.indexOf(document.activeElement),S=p.key==="ArrowDown"?1:-1,k=(_+S+v.length)%v.length;v[k]?.focus()};return u.jsxs("div",{className:"theater-control",ref:f,children:[u.jsx("span",{className:"theater-eyebrow","aria-hidden":"true",children:"Theater"}),u.jsxs("button",{type:"button",ref:g,className:`theater-trigger ${n?"is-open":""}`,"aria-haspopup":"menu","aria-expanded":n,"aria-label":"Theater",title:h?.label??e.theaterError??void 0,onClick:()=>i(p=>!p),children:[u.jsx("span",{className:"theater-trigger-sigil","aria-hidden":"true",children:u.jsx(p3,{})}),u.jsx("span",{className:"theater-trigger-label",children:d}),u.jsx("span",{className:"theater-trigger-caret","aria-hidden":"true",children:u.jsx(g3,{})})]}),n?u.jsxs("div",{className:"theater-menu",role:"menu","aria-label":"Theater",ref:c,onKeyDown:E,children:[e.theaters.length>0?u.jsx("ul",{className:"theater-menu-list",children:e.theaters.map(p=>{const v=p.id===e.activeTheaterId;return u.jsx("li",{children:u.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":v,"data-active":v?"true":void 0,className:`theater-menu-item ${v?"is-active":""}`,title:p.label,onClick:()=>b(p.id),children:[u.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:v?u.jsx(m3,{}):null}),u.jsx("span",{className:"theater-menu-label",children:p.label})]})},p.id)})}):u.jsx("p",{className:"theater-menu-empty",children:"No Theaters yet."}),u.jsx("div",{className:"theater-menu-divider",role:"separator"}),h?u.jsxs(u.Fragment,{children:[u.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item theater-menu-forget",onClick:T,children:[u.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:u.jsx(_3,{})}),u.jsx("span",{className:"theater-menu-label",children:"Forget Theater"})]}),u.jsx("div",{className:"theater-menu-divider",role:"separator"})]}):null,u.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item theater-menu-add",disabled:e.addingTheater,onClick:m,children:[u.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:u.jsx(y3,{})}),u.jsx("span",{className:"theater-menu-label",children:e.addingTheater?"Adding Theater…":"Add Theater…"})]}),e.theaterError?u.jsx("p",{className:"theater-menu-error",children:e.theaterError}):null]}):null,u.jsx(zw,{open:s,onCancel:w,onConfirm:x})]})}function l3(){const e=c3(),n=e.count!==null;return u.jsxs("div",{className:"topbar-github",role:"group","aria-label":"GitHub",children:[u.jsx("a",{className:"topbar-github-link",href:JR,target:"_blank",rel:"noopener noreferrer","aria-label":"GitHub 저장소 열기",title:"GitHub 저장소",children:u.jsx(S3,{})}),u.jsxs("a",{className:"topbar-github-stars",href:QR,target:"_blank",rel:"noopener noreferrer","aria-label":n?`GitHub 스타 ${e.count.toLocaleString()}개 — 스타 누르기`:"GitHub에서 스타 누르기",title:"GitHub에서 스타 누르기",children:[u.jsx(w3,{}),n?u.jsx("span",{className:"topbar-github-stars-count",children:f3(e.count)}):null]})]})}function c3(){const[e,n]=M.useState(()=>{const i=u3();return i===null?{count:null,status:"idle"}:{count:i,status:"ready"}});return M.useEffect(()=>{if(h3())return;let i=!1;return n(s=>s.status==="ready"?s:{...s,status:"loading"}),fetch(e3,{headers:{Accept:"application/vnd.github+json"}}).then(s=>s.ok?s.json():Promise.reject(new Error(`status ${s.status}`))).then(s=>{if(i)return;const o=typeof s.stargazers_count=="number"?s.stargazers_count:null;if(o===null){n(f=>({count:f.count,status:f.count===null?"error":"ready"}));return}d3(o),n({count:o,status:"ready"})}).catch(()=>{i||n(s=>({count:s.count,status:s.count===null?"error":"ready"}))}),()=>{i=!0}},[]),e}function u3(){try{const e=window.localStorage.getItem(gm);if(!e)return null;const n=JSON.parse(e);return typeof n.count=="number"?n.count:null}catch{return null}}function h3(){try{const e=window.localStorage.getItem(gm);if(!e)return!1;const n=JSON.parse(e);return typeof n.at=="number"&&Date.now()-n.at<t3}catch{return!1}}function d3(e){try{window.localStorage.setItem(gm,JSON.stringify({count:e,at:Date.now()}))}catch{}}function f3(e){if(e<1e3)return String(e);const n=e/1e3;return n<10?`${n.toFixed(1)}k`:`${Math.round(n)}k`}function p3(){return u.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[u.jsx("circle",{cx:"8",cy:"3.2",r:"1.5",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),u.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 g3(){return u.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:u.jsx("path",{d:"M4.5 6.5 8 10l3.5-3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})})}function m3(){return u.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:u.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 _3(){return u.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:u.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 v3(){return u.jsxs("svg",{viewBox:"0 0 16 16",width:"16",height:"16",children:[u.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"}),u.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 b3(){return u.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[u.jsx("circle",{cx:"8",cy:"8",r:"5.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),u.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"}),u.jsx("circle",{cx:"8",cy:"8",r:"1.1",fill:"currentColor"})]})}function a1(){return u.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[u.jsx("path",{d:"M3 4.4h10M3 8h10M3 11.6h10",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"}),u.jsx("circle",{cx:"6.2",cy:"4.4",r:"1.3",fill:"var(--surface-glass-strong)",stroke:"currentColor",strokeWidth:"1.2"}),u.jsx("circle",{cx:"10",cy:"8",r:"1.3",fill:"var(--surface-glass-strong)",stroke:"currentColor",strokeWidth:"1.2"}),u.jsx("circle",{cx:"7.4",cy:"11.6",r:"1.3",fill:"var(--surface-glass-strong)",stroke:"currentColor",strokeWidth:"1.2"})]})}function o1(){return u.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[u.jsx("circle",{cx:"4",cy:"4.2",r:"1.15",fill:"currentColor"}),u.jsx("circle",{cx:"4",cy:"8",r:"1.15",fill:"currentColor"}),u.jsx("circle",{cx:"4",cy:"11.8",r:"1.15",fill:"currentColor"}),u.jsx("path",{d:"M7.2 4.2h6M7.2 8h6M7.2 11.8h6",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function y3(){return u.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:u.jsx("path",{d:"M8 3.4v9.2M3.4 8h9.2",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function S3(){return u.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:u.jsx("path",{fill:"currentColor",d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82a7.65 7.65 0 0 1 2-.27c.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z"})})}function w3(){return u.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:u.jsx("path",{d:"M8 2.2 9.41 6.26 13.71 6.35 10.28 8.94 11.53 13.05 8 10.6 4.47 13.05 5.72 8.94 2.29 6.35 6.59 6.26Z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"})})}const x3=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(","),_l=10;function C3({state:e}){const n=M.useRef(null),i=M.useRef(null),s=M.useRef(null),o=!e.bootstrapped||e.onboardingOpen||e.operationSearchOpen;if(e.whatsNewOpen&&!o&&n.current===null&&(n.current=document.activeElement),M.useEffect(()=>{if(!e.whatsNewOpen||o)return;const E=p=>{p.key==="Escape"?(p.preventDefault(),vu()):p.key==="Tab"&&T3(p,s.current),p.stopImmediatePropagation()};return i.current?.focus(),window.addEventListener("keydown",E,!0),()=>{window.removeEventListener("keydown",E,!0);const p=n.current;n.current=null,p?.focus?.()}},[e.whatsNewOpen,o]),!e.whatsNewOpen||o||e.releaseNotes.length===0)return null;const f=e.selectedReleaseNoteKey??Ua(e.releaseNotes[0]?.version??"",0),g=e.releaseNotes.findIndex((E,p)=>Ua(E.version,p)===f),c=e.releaseNotes[g]??e.releaseNotes[0],h=Ua(c.version,g>=0?g:0),d=()=>{Tw(),gw({force:!0}).then(Aw).catch(E=>Rw(E instanceof Error?E.message:String(E)))},b=Math.max(1,Math.ceil(e.releaseNotes.length/_l)),m=Math.min(b-1,Math.floor((g>=0?g:0)/_l)),w=m*_l,x=e.releaseNotes.slice(w,w+_l),T=E=>{const p=m+E;if(p<0||p>=b)return;const v=p*_l,_=e.releaseNotes[v];_&&Jb(Ua(_.version,v))};return u.jsxs("div",{className:"whatsnew-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"whatsnew-title",children:[u.jsx("button",{type:"button",className:"whatsnew-scrim",onClick:vu,"aria-label":"Close What's new"}),u.jsxs("section",{className:"whatsnew-card",ref:s,children:[u.jsxs("header",{className:"whatsnew-header",children:[u.jsxs("div",{className:"whatsnew-heading-row",children:[u.jsx("h2",{id:"whatsnew-title",children:"What's new"}),u.jsxs("span",{className:"whatsnew-version-badge",children:["v",c.version]})]}),u.jsxs("div",{className:"whatsnew-meta-row",children:[c.date?u.jsxs("time",{className:"whatsnew-date",dateTime:c.date,children:["Released ",c.date]}):u.jsx("span",{className:"whatsnew-date",children:"Unreleased"}),e.releaseNotesStale?u.jsx("span",{className:"whatsnew-stale",children:"Stale"}):null]})]}),u.jsx("button",{ref:i,type:"button",className:"whatsnew-close",onClick:vu,"aria-label":"Close What's new",children:"x"}),u.jsxs("div",{className:"whatsnew-body",children:[u.jsxs("div",{className:"whatsnew-version-selector",children:[u.jsx("select",{"aria-label":"Release version",value:h,onChange:E=>Jb(E.currentTarget.value),children:x.map((E,p)=>{const v=w+p;return u.jsxs("option",{value:Ua(E.version,v),children:[E.version==="Unreleased"?"Unreleased":`v${E.version}`,E.date?` · ${E.date}`:""]},Ua(E.version,v))})}),b>1?u.jsxs("div",{className:"whatsnew-pagination",children:[u.jsx("button",{type:"button",className:"whatsnew-page-button",onClick:()=>T(-1),disabled:m===0,"aria-label":"Newer versions",children:"‹"}),u.jsxs("span",{className:"whatsnew-page-status",children:[m+1," / ",b]}),u.jsx("button",{type:"button",className:"whatsnew-page-button",onClick:()=>T(1),disabled:m>=b-1,"aria-label":"Older versions",children:"›"})]}):null,u.jsx("button",{type:"button",className:"whatsnew-refresh",onClick:d,disabled:e.releaseNotesLoading,children:e.releaseNotesLoading?"Refreshing":"Refresh"})]}),e.releaseNotesError?u.jsx("p",{className:"whatsnew-error",children:"Release notes could not be refreshed."}):null,c.sections.map((E,p)=>u.jsx(E3,{section:E,index:p},E.heading))]}),u.jsx("footer",{className:"whatsnew-footer",children:u.jsx("button",{type:"button",className:"whatsnew-done",onClick:vu,children:"Close"})})]})]})}function E3({section:e,index:n}){const i=e.heading.toLowerCase().replaceAll(" ","-"),s={"--whatsnew-delay":`${n*55}ms`};return u.jsxs("section",{className:`whatsnew-section whatsnew-section--${i}`,style:s,children:[u.jsx("h3",{children:u.jsx("span",{className:"whatsnew-section-chip",children:e.heading})}),u.jsx("ul",{children:e.items.map((o,f)=>u.jsx("li",{children:u.jsx(k3,{item:o})},`${o.text}:${f}`))})]})}function k3({item:e}){return u.jsxs(u.Fragment,{children:[e.packageTags.map((n,i)=>u.jsx("span",{className:`whatsnew-package-chip whatsnew-package-chip--${i%2===0?"brass":"aurora"}`,children:n},`${n}:${i}`)),u.jsx("span",{children:e.text})]})}function Ua(e,n){return`${e}:${n}`}function T3(e,n){if(!n)return;const i=Array.from(n.querySelectorAll(x3)),s=i[0],o=i[i.length-1];!s||!o||(e.shiftKey&&document.activeElement===s?(e.preventDefault(),o.focus()):!e.shiftKey&&document.activeElement===o&&(e.preventDefault(),s.focus()))}function $r(){return M.useSyncExternalStore(eR,ig,ig)}function Ch(e=()=>{}){return{...DS(e),notifications:{emit:i=>cR(i),dismiss:i=>mR(i)},status:{set:(i,s)=>lR(i,s),clear:i=>Lw(i)}}}const l1=250,A3=5e3,c1=1,R3=1013,L3=4e3,M3=4001;function N3(e){const n=new AbortController,i=new TextEncoder;let s=l1,o=null,f=null,g=null,c=!1;const h=()=>{f?.dispose(),f=null},d=(w,x)=>{g={cols:w,rows:x},o?.readyState===c1&&o.send(JSON.stringify({type:"resize",cols:w,rows:x}))},b=async()=>{for(;!n.signal.aborted;){e.onStatus?.("connecting");try{const{ticket:w}=await D3(e.ticketPath,e.operationId,n.signal);if(n.signal.aborted)return;await m(O3(w,e.location,e.wsPath),e),s=l1}catch(w){if(n.signal.aborted)return;e.onStatus?.("connecting",w instanceof Error?w.message:String(w))}await I3(s,n.signal),s=Math.min(s*2,A3)}},m=async(w,x)=>{await new Promise((T,E)=>{const p=(x.webSocketFactory??j3)(w);o=p,p.binaryType="arraybuffer",p.onopen=()=>{x.onStatus?.("live"),h(),f=x.terminal.onData(v=>{p.readyState===c1&&p.send(i.encode(v))}),g&&d(g.cols,g.rows)},p.onmessage=v=>{v.data instanceof ArrayBuffer&&x.terminal.write(new Uint8Array(v.data))},p.onerror=()=>{E(new Error("Terminal WebSocket error"))},p.onclose=v=>{h(),o===p&&(o=null);const _=v?.code;_===L3?(n.abort(),x.onStatus?.("closed","terminal_replaced")):_===M3?(n.abort(),x.onStatus?.("closed","terminal_closed"),x.onExit?.()):_===R3&&(n.abort(),x.onStatus?.("closed","terminal_unavailable")),T()}})};return{start:()=>{c||(c=!0,b())},resize:d,dispose:()=>{n.abort(),h(),e.onStatus?.("closed"),o?.close(),o=null}}}function O3(e,n=window.location,i){return`${n.protocol==="https:"?"wss":"ws"}://${n.host}${i}?ticket=${encodeURIComponent(e)}`}async function D3(e,n,i){const s=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({operationId:n}),signal:i});if(!s.ok)throw new Error(`Terminal ticket request failed: ${s.status}`);const o=await s.json();if(typeof o.ticket!="string"||typeof o.ttlMs!="number")throw new Error("Invalid terminal ticket response");return{ticket:o.ticket,ttlMs:o.ttlMs}}function j3(e){return new WebSocket(e)}async function I3(e,n){await new Promise(i=>{const s=()=>{clearTimeout(o),n.removeEventListener("abort",s),i()},o=setTimeout(s,e);n.addEventListener("abort",s)})}var Vf={exports:{}},u1;function B3(){return u1||(u1=1,(function(e,n){(function(i,s){e.exports=s()})(self,(()=>(()=>{var i={};return(()=>{var s=i;Object.defineProperty(s,"__esModule",{value:!0}),s.FitAddon=void 0,s.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 f=this._terminal._core;this._terminal.rows===o.rows&&this._terminal.cols===o.cols||(f._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,f=o._renderService.dimensions;if(f.css.cell.width===0||f.css.cell.height===0)return;const g=this._terminal.options.scrollback===0?0:o.viewport.scrollBarWidth,c=window.getComputedStyle(this._terminal.element.parentElement),h=parseInt(c.getPropertyValue("height")),d=Math.max(0,parseInt(c.getPropertyValue("width"))),b=window.getComputedStyle(this._terminal.element),m=h-(parseInt(b.getPropertyValue("padding-top"))+parseInt(b.getPropertyValue("padding-bottom"))),w=d-(parseInt(b.getPropertyValue("padding-right"))+parseInt(b.getPropertyValue("padding-left")))-g;return{cols:Math.max(2,Math.floor(w/f.css.cell.width)),rows:Math.max(1,Math.floor(m/f.css.cell.height))}}}})(),i})()))})(Vf)),Vf.exports}var P3=B3(),$u={exports:{}},z3=$u.exports,h1;function H3(){return h1||(h1=1,(function(e,n){(function(i,s){e.exports=s()})(z3,(()=>(()=>{var i={433:(g,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeV11=void 0;const d=h(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]],m=[[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]],w=[[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]],x=[[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 T;function E(p,v){let _,S=0,k=v.length-1;if(p<v[0][0]||p>v[k][1])return!1;for(;k>=S;)if(_=S+k>>1,p>v[_][1])S=_+1;else{if(!(p<v[_][0]))return!0;k=_-1}return!1}c.UnicodeV11=class{constructor(){if(this.version="11",!T){T=new Uint8Array(65536),T.fill(1),T[0]=0,T.fill(0,1,32),T.fill(0,127,160);for(let p=0;p<b.length;++p)T.fill(0,b[p][0],b[p][1]+1);for(let p=0;p<w.length;++p)T.fill(2,w[p][0],w[p][1]+1)}}wcwidth(p){return p<32?0:p<127?1:p<65536?T[p]:E(p,m)?0:E(p,x)?2:1}charProperties(p,v){let _=this.wcwidth(p),S=_===0&&v!==0;if(S){const k=d.UnicodeService.extractWidth(v);k===0?S=!1:k>_&&(_=k)}return d.UnicodeService.createPropertyValue(0,_,S)}}},345:(g,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=h=>(this._listeners.push(h),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===h)return void this._listeners.splice(d,1)}}})),this._event}fire(h,d){const b=[];for(let m=0;m<this._listeners.length;m++)b.push(this._listeners[m]);for(let m=0;m<b.length;m++)b[m].call(void 0,h,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},c.forwardEvent=function(h,d){return h((b=>d.fire(b)))},c.runAndSubscribe=function(h,d){return d(void 0),h((b=>d(b)))}},490:(g,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeV6=void 0;const d=h(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]],m=[[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 w;c.UnicodeV6=class{constructor(){if(this.version="6",!w){w=new Uint8Array(65536),w.fill(1),w[0]=0,w.fill(0,1,32),w.fill(0,127,160),w.fill(2,4352,4448),w[9001]=2,w[9002]=2,w.fill(2,11904,42192),w[12351]=1,w.fill(2,44032,55204),w.fill(2,63744,64256),w.fill(2,65040,65050),w.fill(2,65072,65136),w.fill(2,65280,65377),w.fill(2,65504,65511);for(let x=0;x<b.length;++x)w.fill(0,b[x][0],b[x][1]+1)}}wcwidth(x){return x<32?0:x<127?1:x<65536?w[x]:(function(T,E){let p,v=0,_=E.length-1;if(T<E[0][0]||T>E[_][1])return!1;for(;_>=v;)if(p=v+_>>1,T>E[p][1])v=p+1;else{if(!(T<E[p][0]))return!0;_=p-1}return!1})(x,m)?0:x>=131072&&x<=196605||x>=196608&&x<=262141?2:1}charProperties(x,T){let E=this.wcwidth(x),p=E===0&&T!==0;if(p){const v=d.UnicodeService.extractWidth(T);v===0?p=!1:v>E&&(E=v)}return d.UnicodeService.createPropertyValue(0,E,p)}}},938:(g,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeService=void 0;const d=h(345),b=h(490);class m{static extractShouldJoin(x){return(1&x)!=0}static extractWidth(x){return x>>1&3}static extractCharKind(x){return x>>3}static createPropertyValue(x,T,E=!1){return(16777215&x)<<3|(3&T)<<1|(E?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const x=new b.UnicodeV6;this.register(x),this._active=x.version,this._activeProvider=x}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(x){if(!this._providers[x])throw new Error(`unknown Unicode version "${x}"`);this._active=x,this._activeProvider=this._providers[x],this._onChange.fire(x)}register(x){this._providers[x.version]=x}wcwidth(x){return this._activeProvider.wcwidth(x)}getStringCellWidth(x){let T=0,E=0;const p=x.length;for(let v=0;v<p;++v){let _=x.charCodeAt(v);if(55296<=_&&_<=56319){if(++v>=p)return T+this.wcwidth(_);const L=x.charCodeAt(v);56320<=L&&L<=57343?_=1024*(_-55296)+L-56320+65536:T+=this.wcwidth(L)}const S=this.charProperties(_,E);let k=m.extractWidth(S);m.extractShouldJoin(S)&&(k-=m.extractWidth(E)),T+=k,E=S}return T}charProperties(x,T){return this._activeProvider.charProperties(x,T)}}c.UnicodeService=m}},s={};function o(g){var c=s[g];if(c!==void 0)return c.exports;var h=s[g]={exports:{}};return i[g](h,h.exports,o),h.exports}var f={};return(()=>{var g=f;Object.defineProperty(g,"__esModule",{value:!0}),g.Unicode11Addon=void 0;const c=o(433);g.Unicode11Addon=class{activate(h){h.unicode.register(new c.UnicodeV11)}dispose(){}}})(),f})()))})($u)),$u.exports}var $3=H3();var U3=(e,n,i,s)=>{for(var o=n,f=e.length-1,g;f>=0;f--)(g=e[f])&&(o=g(o)||o);return o},F3=(e,n)=>(i,s)=>n(i,s,e),W3=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?d1.isErrorNoTelemetry(e)?new d1(e.message+`
|
|
12
|
+
|
|
13
|
+
`+e.stack):new Error(e.message+`
|
|
14
|
+
|
|
15
|
+
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(n=>{n(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},G3=new W3;function Yf(e){q3(e)||G3.onUnexpectedError(e)}var ag="Canceled";function q3(e){return e instanceof K3?!0:e instanceof Error&&e.name===ag&&e.message===ag}var K3=class extends Error{constructor(){super(ag),this.name=this.message}},d1=class og extends Error{constructor(n){super(n),this.name="CodeExpectedError"}static fromError(n){if(n instanceof og)return n;let i=new og;return i.message=n.message,i.stack=n.stack,i}static isErrorNoTelemetry(n){return n.name==="CodeExpectedError"}},V3;(e=>{function n(f){return f<0}e.isLessThan=n;function i(f){return f<=0}e.isLessThanOrEqual=i;function s(f){return f>0}e.isGreaterThan=s;function o(f){return f===0}e.isNeitherLessOrGreaterThan=o,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(V3||={});function Y3(e,n){let i=this,s=!1,o;return function(){return s||(s=!0,n||(o=e.apply(i,arguments))),o}}var Uw;(e=>{function n(k){return k&&typeof k=="object"&&typeof k[Symbol.iterator]=="function"}e.is=n;let i=Object.freeze([]);function s(){return i}e.empty=s;function*o(k){yield k}e.single=o;function f(k){return n(k)?k:o(k)}e.wrap=f;function g(k){return k||i}e.from=g;function*c(k){for(let L=k.length-1;L>=0;L--)yield k[L]}e.reverse=c;function h(k){return!k||k[Symbol.iterator]().next().done===!0}e.isEmpty=h;function d(k){return k[Symbol.iterator]().next().value}e.first=d;function b(k,L){let R=0;for(let N of k)if(L(N,R++))return!0;return!1}e.some=b;function m(k,L){for(let R of k)if(L(R))return R}e.find=m;function*w(k,L){for(let R of k)L(R)&&(yield R)}e.filter=w;function*x(k,L){let R=0;for(let N of k)yield L(N,R++)}e.map=x;function*T(k,L){let R=0;for(let N of k)yield*L(N,R++)}e.flatMap=T;function*E(...k){for(let L of k)yield*L}e.concat=E;function p(k,L,R){let N=R;for(let A of k)N=L(N,A);return N}e.reduce=p;function*v(k,L,R=k.length){for(L<0&&(L+=k.length),R<0?R+=k.length:R>k.length&&(R=k.length);L<R;L++)yield k[L]}e.slice=v;function _(k,L=Number.POSITIVE_INFINITY){let R=[];if(L===0)return[R,k];let N=k[Symbol.iterator]();for(let A=0;A<L;A++){let B=N.next();if(B.done)return[R,e.empty()];R.push(B.value)}return[R,{[Symbol.iterator](){return N}}]}e.consume=_;async function S(k){let L=[];for await(let R of k)L.push(R);return Promise.resolve(L)}e.asyncToArray=S})(Uw||={});function Fw(e){if(Uw.is(e)){let n=[];for(let i of e)if(i)try{i.dispose()}catch(s){n.push(s)}if(n.length===1)throw n[0];if(n.length>1)throw new AggregateError(n,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function Ww(...e){return $n(()=>Fw(e))}function $n(e){return{dispose:Y3(()=>{e()})}}var Gw=class qw{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{Fw(this._toDispose)}finally{this._toDispose.clear()}}add(n){if(!n)return n;if(n===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?qw.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(n),n}delete(n){if(n){if(n===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(n),n.dispose()}}deleteAndLeak(n){n&&this._toDispose.has(n)&&(this._toDispose.delete(n),void 0)}};Gw.DISABLE_DISPOSED_WARNING=!1;var oo=Gw,Ji=class{constructor(){this._store=new oo,this._store}dispose(){this._store.dispose()}_register(n){if(n===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(n)}};Ji.None=Object.freeze({dispose(){}});var vl=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(n){this._isDisposed||n===this._value||(this._value?.dispose(),this._value=n)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let n=this._value;return this._value=void 0,n}},mm=typeof process<"u"&&"title"in process,Eh=mm?"node":navigator.userAgent,X3=mm?"node":navigator.platform,Z3=Eh.includes("Firefox"),J3=Eh.includes("Edge"),Kw=/^((?!chrome|android).)*safari/i.test(Eh);function Q3(){if(!Kw)return 0;let e=Eh.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}X3.indexOf("Linux")>=0;var eL="",xn=0,Cn=0,En=0,an=0,Bi={css:"#00000000",rgba:0},Kn;(e=>{function n(o,f,g,c){return c!==void 0?`#${qs(o)}${qs(f)}${qs(g)}${qs(c)}`:`#${qs(o)}${qs(f)}${qs(g)}`}e.toCss=n;function i(o,f,g,c=255){return(o<<24|f<<16|g<<8|c)>>>0}e.toRgba=i;function s(o,f,g,c){return{css:e.toCss(o,f,g,c),rgba:e.toRgba(o,f,g,c)}}e.toColor=s})(Kn||={});var Ml;(e=>{function n(h,d){if(an=(d.rgba&255)/255,an===1)return{css:d.css,rgba:d.rgba};let b=d.rgba>>24&255,m=d.rgba>>16&255,w=d.rgba>>8&255,x=h.rgba>>24&255,T=h.rgba>>16&255,E=h.rgba>>8&255;xn=x+Math.round((b-x)*an),Cn=T+Math.round((m-T)*an),En=E+Math.round((w-E)*an);let p=Kn.toCss(xn,Cn,En),v=Kn.toRgba(xn,Cn,En);return{css:p,rgba:v}}e.blend=n;function i(h){return(h.rgba&255)===255}e.isOpaque=i;function s(h,d,b){let m=Qs.ensureContrastRatio(h.rgba,d.rgba,b);if(m)return Kn.toColor(m>>24&255,m>>16&255,m>>8&255)}e.ensureContrastRatio=s;function o(h){let d=(h.rgba|255)>>>0;return[xn,Cn,En]=Qs.toChannels(d),{css:Kn.toCss(xn,Cn,En),rgba:d}}e.opaque=o;function f(h,d){return an=Math.round(d*255),[xn,Cn,En]=Qs.toChannels(h.rgba),{css:Kn.toCss(xn,Cn,En,an),rgba:Kn.toRgba(xn,Cn,En,an)}}e.opacity=f;function g(h,d){return an=h.rgba&255,f(h,an*d/255)}e.multiplyOpacity=g;function c(h){return[h.rgba>>24&255,h.rgba>>16&255,h.rgba>>8&255]}e.toColorRGB=c})(Ml||={});var tL;(e=>{let n,i;try{let o=document.createElement("canvas");o.width=1,o.height=1;let f=o.getContext("2d",{willReadFrequently:!0});f&&(n=f,n.globalCompositeOperation="copy",i=n.createLinearGradient(0,0,1,1))}catch{}function s(o){if(o.match(/#[\da-f]{3,8}/i))switch(o.length){case 4:return xn=parseInt(o.slice(1,2).repeat(2),16),Cn=parseInt(o.slice(2,3).repeat(2),16),En=parseInt(o.slice(3,4).repeat(2),16),Kn.toColor(xn,Cn,En);case 5:return xn=parseInt(o.slice(1,2).repeat(2),16),Cn=parseInt(o.slice(2,3).repeat(2),16),En=parseInt(o.slice(3,4).repeat(2),16),an=parseInt(o.slice(4,5).repeat(2),16),Kn.toColor(xn,Cn,En,an);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 f=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(f)return xn=parseInt(f[1]),Cn=parseInt(f[2]),En=parseInt(f[3]),an=Math.round((f[5]===void 0?1:parseFloat(f[5]))*255),Kn.toColor(xn,Cn,En,an);if(!n||!i)throw new Error("css.toColor: Unsupported css format");if(n.fillStyle=i,n.fillStyle=o,typeof n.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(n.fillRect(0,0,1,1),[xn,Cn,En,an]=n.getImageData(0,0,1,1).data,an!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Kn.toRgba(xn,Cn,En,an),css:o}}e.toColor=s})(tL||={});var Wn;(e=>{function n(s){return i(s>>16&255,s>>8&255,s&255)}e.relativeLuminance=n;function i(s,o,f){let g=s/255,c=o/255,h=f/255,d=g<=.03928?g/12.92:Math.pow((g+.055)/1.055,2.4),b=c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4),m=h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4);return d*.2126+b*.7152+m*.0722}e.relativeLuminance2=i})(Wn||={});var Qs;(e=>{function n(g,c){if(an=(c&255)/255,an===1)return c;let h=c>>24&255,d=c>>16&255,b=c>>8&255,m=g>>24&255,w=g>>16&255,x=g>>8&255;return xn=m+Math.round((h-m)*an),Cn=w+Math.round((d-w)*an),En=x+Math.round((b-x)*an),Kn.toRgba(xn,Cn,En)}e.blend=n;function i(g,c,h){let d=Wn.relativeLuminance(g>>8),b=Wn.relativeLuminance(c>>8);if(Nr(d,b)<h){if(b<d){let x=s(g,c,h),T=Nr(d,Wn.relativeLuminance(x>>8));if(T<h){let E=o(g,c,h),p=Nr(d,Wn.relativeLuminance(E>>8));return T>p?x:E}return x}let m=o(g,c,h),w=Nr(d,Wn.relativeLuminance(m>>8));if(w<h){let x=s(g,c,h),T=Nr(d,Wn.relativeLuminance(x>>8));return w>T?m:x}return m}}e.ensureContrastRatio=i;function s(g,c,h){let d=g>>24&255,b=g>>16&255,m=g>>8&255,w=c>>24&255,x=c>>16&255,T=c>>8&255,E=Nr(Wn.relativeLuminance2(w,x,T),Wn.relativeLuminance2(d,b,m));for(;E<h&&(w>0||x>0||T>0);)w-=Math.max(0,Math.ceil(w*.1)),x-=Math.max(0,Math.ceil(x*.1)),T-=Math.max(0,Math.ceil(T*.1)),E=Nr(Wn.relativeLuminance2(w,x,T),Wn.relativeLuminance2(d,b,m));return(w<<24|x<<16|T<<8|255)>>>0}e.reduceLuminance=s;function o(g,c,h){let d=g>>24&255,b=g>>16&255,m=g>>8&255,w=c>>24&255,x=c>>16&255,T=c>>8&255,E=Nr(Wn.relativeLuminance2(w,x,T),Wn.relativeLuminance2(d,b,m));for(;E<h&&(w<255||x<255||T<255);)w=Math.min(255,w+Math.ceil((255-w)*.1)),x=Math.min(255,x+Math.ceil((255-x)*.1)),T=Math.min(255,T+Math.ceil((255-T)*.1)),E=Nr(Wn.relativeLuminance2(w,x,T),Wn.relativeLuminance2(d,b,m));return(w<<24|x<<16|T<<8|255)>>>0}e.increaseLuminance=o;function f(g){return[g>>24&255,g>>16&255,g>>8&255,g&255]}e.toChannels=f})(Qs||={});function qs(e){let n=e.toString(16);return n.length<2?"0"+n:n}function Nr(e,n){return e<n?(n+.05)/(e+.05):(e+.05)/(n+.05)}function mn(e){if(!e)throw new Error("value must not be falsy");return e}function _m(e){return 57508<=e&&e<=57558}function nL(e){return 57520<=e&&e<=57527}function iL(e){return 57344<=e&&e<=63743}function rL(e){return 9472<=e&&e<=9631}function sL(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 aL(e,n,i,s){return n===1&&i>Math.ceil(s*1.5)&&e!==void 0&&e>255&&!sL(e)&&!_m(e)&&!iL(e)}function Vw(e){return _m(e)||rL(e)}function oL(){return{css:{canvas:yu(),cell:yu()},device:{canvas:yu(),cell:yu(),char:{width:0,height:0,left:0,top:0}}}}function yu(){return{width:0,height:0}}function lL(e,n,i=0){return(e-(Math.round(n)*2-i))%(Math.round(n)*2)}var jn=0,wn=0,sr=!1,Or=!1,Su=!1,li,Xf=0,cL=class{constructor(e,n,i,s,o,f){this._terminal=e,this._optionService=n,this._selectionRenderModel=i,this._decorationService=s,this._coreBrowserService=o,this._themeService=f,this.result={fg:0,bg:0,ext:0}}resolve(e,n,i,s){if(this.result.bg=e.bg,this.result.fg=e.fg,this.result.ext=e.bg&268435456?e.extended.ext:0,wn=0,jn=0,Or=!1,sr=!1,Su=!1,li=this._themeService.colors,Xf=0,e.getCode()!==0&&e.extended.underlineStyle===4){let o=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));Xf=n*s%(Math.round(o)*2)}if(this._decorationService.forEachDecorationAtCell(n,i,"bottom",o=>{o.backgroundColorRGB&&(wn=o.backgroundColorRGB.rgba>>8&16777215,Or=!0),o.foregroundColorRGB&&(jn=o.foregroundColorRGB.rgba>>8&16777215,sr=!0)}),Su=this._selectionRenderModel.isCellSelected(this._terminal,n,i),Su){if(this.result.fg&67108864||(this.result.bg&50331648)!==0){if(this.result.fg&67108864)switch(this.result.fg&50331648){case 16777216:case 33554432:wn=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:wn=(this.result.fg&16777215)<<8|255;break;default:wn=this._themeService.colors.foreground.rgba}else switch(this.result.bg&50331648){case 16777216:case 33554432:wn=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:wn=(this.result.bg&16777215)<<8|255;break}wn=Qs.blend(wn,(this._coreBrowserService.isFocused?li.selectionBackgroundOpaque:li.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}else wn=(this._coreBrowserService.isFocused?li.selectionBackgroundOpaque:li.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(Or=!0,li.selectionForeground&&(jn=li.selectionForeground.rgba>>8&16777215,sr=!0),Vw(e.getCode())){if(this.result.fg&67108864&&(this.result.bg&50331648)===0)jn=(this._coreBrowserService.isFocused?li.selectionBackgroundOpaque:li.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(this.result.fg&67108864)switch(this.result.bg&50331648){case 16777216:case 33554432:jn=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:jn=(this.result.bg&16777215)<<8|255;break}else switch(this.result.fg&50331648){case 16777216:case 33554432:jn=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:jn=(this.result.fg&16777215)<<8|255;break;default:jn=this._themeService.colors.foreground.rgba}jn=Qs.blend(jn,(this._coreBrowserService.isFocused?li.selectionBackgroundOpaque:li.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}sr=!0}}this._decorationService.forEachDecorationAtCell(n,i,"top",o=>{o.backgroundColorRGB&&(wn=o.backgroundColorRGB.rgba>>8&16777215,Or=!0),o.foregroundColorRGB&&(jn=o.foregroundColorRGB.rgba>>8&16777215,sr=!0)}),Or&&(Su?wn=e.bg&-16777216&-134217729|wn|50331648:wn=e.bg&-16777216|wn|50331648),sr&&(jn=e.fg&-16777216&-67108865|jn|50331648),this.result.fg&67108864&&(Or&&!sr&&((this.result.bg&50331648)===0?jn=this.result.fg&-134217728|li.background.rgba>>8&16777215&16777215|50331648:jn=this.result.fg&-134217728|this.result.bg&67108863,sr=!0),!Or&&sr&&((this.result.fg&50331648)===0?wn=this.result.bg&-67108864|li.foreground.rgba>>8&16777215&16777215|50331648:wn=this.result.bg&-67108864|this.result.fg&67108863,Or=!0)),li=void 0,this.result.bg=Or?wn:this.result.bg,this.result.fg=sr?jn:this.result.fg,this.result.ext&=536870911,this.result.ext|=Xf<<29&3758096384}},uL=.5,Yw=Z3||J3?"bottom":"ideographic",hL={"▀":[{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}]},dL={"░":[[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]]},fL={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(e,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"║":{1:(e,n)=>`M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╒":{1:(e,n)=>`M.5,1 L.5,${.5-n} L1,${.5-n} M.5,${.5+n} L1,${.5+n}`},"╓":{1:(e,n)=>`M${.5-e},1 L${.5-e},.5 L1,.5 M${.5+e},.5 L${.5+e},1`},"╔":{1:(e,n)=>`M1,${.5-n} L${.5-e},${.5-n} L${.5-e},1 M1,${.5+n} L${.5+e},${.5+n} L${.5+e},1`},"╕":{1:(e,n)=>`M0,${.5-n} L.5,${.5-n} L.5,1 M0,${.5+n} L.5,${.5+n}`},"╖":{1:(e,n)=>`M${.5+e},1 L${.5+e},.5 L0,.5 M${.5-e},.5 L${.5-e},1`},"╗":{1:(e,n)=>`M0,${.5+n} L${.5-e},${.5+n} L${.5-e},1 M0,${.5-n} L${.5+e},${.5-n} L${.5+e},1`},"╘":{1:(e,n)=>`M.5,0 L.5,${.5+n} L1,${.5+n} M.5,${.5-n} L1,${.5-n}`},"╙":{1:(e,n)=>`M1,.5 L${.5-e},.5 L${.5-e},0 M${.5+e},.5 L${.5+e},0`},"╚":{1:(e,n)=>`M1,${.5-n} L${.5+e},${.5-n} L${.5+e},0 M1,${.5+n} L${.5-e},${.5+n} L${.5-e},0`},"╛":{1:(e,n)=>`M0,${.5+n} L.5,${.5+n} L.5,0 M0,${.5-n} L.5,${.5-n}`},"╜":{1:(e,n)=>`M0,.5 L${.5+e},.5 L${.5+e},0 M${.5-e},.5 L${.5-e},0`},"╝":{1:(e,n)=>`M0,${.5-n} L${.5-e},${.5-n} L${.5-e},0 M0,${.5+n} L${.5+e},${.5+n} L${.5+e},0`},"╞":{1:(e,n)=>`M.5,0 L.5,1 M.5,${.5-n} L1,${.5-n} M.5,${.5+n} L1,${.5+n}`},"╟":{1:(e,n)=>`M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1 M${.5+e},.5 L1,.5`},"╠":{1:(e,n)=>`M${.5-e},0 L${.5-e},1 M1,${.5+n} L${.5+e},${.5+n} L${.5+e},1 M1,${.5-n} L${.5+e},${.5-n} L${.5+e},0`},"╡":{1:(e,n)=>`M.5,0 L.5,1 M0,${.5-n} L.5,${.5-n} M0,${.5+n} L.5,${.5+n}`},"╢":{1:(e,n)=>`M0,.5 L${.5-e},.5 M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╣":{1:(e,n)=>`M${.5+e},0 L${.5+e},1 M0,${.5+n} L${.5-e},${.5+n} L${.5-e},1 M0,${.5-n} L${.5-e},${.5-n} L${.5-e},0`},"╤":{1:(e,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n} M.5,${.5+n} L.5,1`},"╥":{1:(e,n)=>`M0,.5 L1,.5 M${.5-e},.5 L${.5-e},1 M${.5+e},.5 L${.5+e},1`},"╦":{1:(e,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L${.5-e},${.5+n} L${.5-e},1 M1,${.5+n} L${.5+e},${.5+n} L${.5+e},1`},"╧":{1:(e,n)=>`M.5,0 L.5,${.5-n} M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"╨":{1:(e,n)=>`M0,.5 L1,.5 M${.5-e},.5 L${.5-e},0 M${.5+e},.5 L${.5+e},0`},"╩":{1:(e,n)=>`M0,${.5+n} L1,${.5+n} M0,${.5-n} L${.5-e},${.5-n} L${.5-e},0 M1,${.5-n} L${.5+e},${.5-n} L${.5+e},0`},"╪":{1:(e,n)=>`M.5,0 L.5,1 M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"╫":{1:(e,n)=>`M0,.5 L1,.5 M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╬":{1:(e,n)=>`M0,${.5+n} L${.5-e},${.5+n} L${.5-e},1 M1,${.5+n} L${.5+e},${.5+n} L${.5+e},1 M0,${.5-n} L${.5-e},${.5-n} L${.5-e},0 M1,${.5-n} L${.5+e},${.5-n} L${.5+e},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(e,n)=>`M.5,1 L.5,${.5+n/.15*.5} C.5,${.5+n/.15*.5},.5,.5,1,.5`},"╮":{1:(e,n)=>`M.5,1 L.5,${.5+n/.15*.5} C.5,${.5+n/.15*.5},.5,.5,0,.5`},"╯":{1:(e,n)=>`M.5,0 L.5,${.5-n/.15*.5} C.5,${.5-n/.15*.5},.5,.5,0,.5`},"╰":{1:(e,n)=>`M.5,0 L.5,${.5-n/.15*.5} C.5,${.5-n/.15*.5},.5,.5,1,.5`}},ql={"":{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}};ql[""]=ql[""];ql[""]=ql[""];function pL(e,n,i,s,o,f,g,c){let h=hL[n];if(h)return gL(e,h,i,s,o,f),!0;let d=dL[n];if(d)return mL(e,d,i,s,o,f),!0;let b=fL[n];if(b)return _L(e,b,i,s,o,f,c),!0;let m=ql[n];return m?(vL(e,m,i,s,o,f,g,c),!0):!1}function gL(e,n,i,s,o,f){for(let g=0;g<n.length;g++){let c=n[g],h=o/8,d=f/8;e.fillRect(i+c.x*h,s+c.y*d,c.w*h,c.h*d)}}var f1=new Map;function mL(e,n,i,s,o,f){let g=f1.get(n);g||(g=new Map,f1.set(n,g));let c=e.fillStyle;if(typeof c!="string")throw new Error(`Unexpected fillStyle type "${c}"`);let h=g.get(c);if(!h){let d=n[0].length,b=n.length,m=e.canvas.ownerDocument.createElement("canvas");m.width=d,m.height=b;let w=mn(m.getContext("2d")),x=new ImageData(d,b),T,E,p,v;if(c.startsWith("#"))T=parseInt(c.slice(1,3),16),E=parseInt(c.slice(3,5),16),p=parseInt(c.slice(5,7),16),v=c.length>7&&parseInt(c.slice(7,9),16)||1;else if(c.startsWith("rgba"))[T,E,p,v]=c.substring(5,c.length-1).split(",").map(_=>parseFloat(_));else throw new Error(`Unexpected fillStyle color format "${c}" when drawing pattern glyph`);for(let _=0;_<b;_++)for(let S=0;S<d;S++)x.data[(_*d+S)*4]=T,x.data[(_*d+S)*4+1]=E,x.data[(_*d+S)*4+2]=p,x.data[(_*d+S)*4+3]=n[_][S]*(v*255);w.putImageData(x,0,0),h=mn(e.createPattern(m,null)),g.set(c,h)}e.fillStyle=h,e.fillRect(i,s,o,f)}function _L(e,n,i,s,o,f,g){e.strokeStyle=e.fillStyle;for(let[c,h]of Object.entries(n)){e.beginPath(),e.lineWidth=g*Number.parseInt(c);let d;if(typeof h=="function"){let b=.15/f*o;d=h(.15,b)}else d=h;for(let b of d.split(" ")){let m=b[0],w=Xw[m];if(!w){console.error(`Could not find drawing instructions for "${m}"`);continue}let x=b.substring(1).split(",");!x[0]||!x[1]||w(e,Zw(x,o,f,i,s,!0,g))}e.stroke(),e.closePath()}}function vL(e,n,i,s,o,f,g,c){let h=new Path2D;h.rect(i,s,o,f),e.clip(h),e.beginPath();let d=g/12;e.lineWidth=c*d;for(let b of n.d.split(" ")){let m=b[0],w=Xw[m];if(!w){console.error(`Could not find drawing instructions for "${m}"`);continue}let x=b.substring(1).split(",");!x[0]||!x[1]||w(e,Zw(x,o,f,i,s,!1,c,(n.leftPadding??0)*(d/2),(n.rightPadding??0)*(d/2)))}n.type===1?(e.strokeStyle=e.fillStyle,e.stroke()):e.fill(),e.closePath()}function p1(e,n,i=0){return Math.max(Math.min(e,n),i)}var Xw={C:(e,n)=>e.bezierCurveTo(n[0],n[1],n[2],n[3],n[4],n[5]),L:(e,n)=>e.lineTo(n[0],n[1]),M:(e,n)=>e.moveTo(n[0],n[1])};function Zw(e,n,i,s,o,f,g,c=0,h=0){let d=e.map(b=>parseFloat(b)||parseInt(b));if(d.length<2)throw new Error("Too few arguments for instruction");for(let b=0;b<d.length;b+=2)d[b]*=n-c*g-h*g,f&&d[b]!==0&&(d[b]=p1(Math.round(d[b]+.5)-.5,n,0)),d[b]+=s+c*g;for(let b=1;b<d.length;b+=2)d[b]*=i,f&&d[b]!==0&&(d[b]=p1(Math.round(d[b]+.5)-.5,i,0)),d[b]+=o;return d}var g1=class{constructor(){this._data={}}set(e,n,i){this._data[e]||(this._data[e]={}),this._data[e][n]=i}get(e,n){return this._data[e]?this._data[e][n]:void 0}clear(){this._data={}}},m1=class{constructor(){this._data=new g1}set(e,n,i,s,o){this._data.get(e,n)||this._data.set(e,n,new g1),this._data.get(e,n).set(i,s,o)}get(e,n,i,s){return this._data.get(e,n)?.get(i,s)}clear(){this._data.clear()}},Jw=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(e){this._idleCallback=void 0;let n=0,i=0,s=e.timeRemaining(),o=0;for(;this._i<this._tasks.length;){if(n=performance.now(),this._tasks[this._i]()||this._i++,n=Math.max(1,performance.now()-n),i=Math.max(n,i),o=e.timeRemaining(),i*1.5>o){s-n<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(s-n))}ms`),this._start();return}s=o}this.clear()}},bL=class extends Jw{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let n=performance.now()+e;return{timeRemaining:()=>Math.max(0,n-performance.now())}}},yL=class extends Jw{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},SL=!mm&&"requestIdleCallback"in window?yL:bL,Qa=class Qw{constructor(){this.fg=0,this.bg=0,this.extended=new ex}static toColorRGB(n){return[n>>>16&255,n>>>8&255,n&255]}static fromColorRGB(n){return(n[0]&255)<<16|(n[1]&255)<<8|n[2]&255}clone(){let n=new Qw;return n.fg=this.fg,n.bg=this.bg,n.extended=this.extended.clone(),n}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},ex=class tx{constructor(n=0,i=0){this._ext=0,this._urlId=0,this._ext=n,this._urlId=i}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(n){this._ext=n}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(n){this._ext&=-469762049,this._ext|=n<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(n){this._ext&=-67108864,this._ext|=n&67108863}get urlId(){return this._urlId}set urlId(n){this._urlId=n}get underlineVariantOffset(){let n=(this._ext&3758096384)>>29;return n<0?n^4294967288:n}set underlineVariantOffset(n){this._ext&=536870911,this._ext|=n<<29&3758096384}clone(){return new tx(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},wL=globalThis.performance&&typeof globalThis.performance.now=="function",xL=class nx{static create(n){return new nx(n)}constructor(n){this._now=wL&&n===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},Pr;(e=>{e.None=()=>Ji.None;function n(W,I){return m(W,()=>{},0,void 0,!0,void 0,I)}e.defer=n;function i(W){return(I,Y=null,V)=>{let z=!1,G;return G=W(K=>{if(!z)return G?G.dispose():z=!0,I.call(Y,K)},null,V),z&&G.dispose(),G}}e.once=i;function s(W,I,Y){return d((V,z=null,G)=>W(K=>V.call(z,I(K)),null,G),Y)}e.map=s;function o(W,I,Y){return d((V,z=null,G)=>W(K=>{I(K),V.call(z,K)},null,G),Y)}e.forEach=o;function f(W,I,Y){return d((V,z=null,G)=>W(K=>I(K)&&V.call(z,K),null,G),Y)}e.filter=f;function g(W){return W}e.signal=g;function c(...W){return(I,Y=null,V)=>{let z=Ww(...W.map(G=>G(K=>I.call(Y,K))));return b(z,V)}}e.any=c;function h(W,I,Y,V){let z=Y;return s(W,G=>(z=I(z,G),z),V)}e.reduce=h;function d(W,I){let Y,V={onWillAddFirstListener(){Y=W(z.fire,z)},onDidRemoveLastListener(){Y?.dispose()}},z=new $t(V);return I?.add(z),z.event}function b(W,I){return I instanceof Array?I.push(W):I&&I.add(W),W}function m(W,I,Y=100,V=!1,z=!1,G,K){let j,H,D,P=0,Z,ee={leakWarningThreshold:G,onWillAddFirstListener(){j=W(se=>{P++,H=I(H,se),V&&!D&&(J.fire(H),H=void 0),Z=()=>{let X=H;H=void 0,D=void 0,(!V||P>1)&&J.fire(X),P=0},typeof Y=="number"?(clearTimeout(D),D=setTimeout(Z,Y)):D===void 0&&(D=0,queueMicrotask(Z))})},onWillRemoveListener(){z&&P>0&&Z?.()},onDidRemoveLastListener(){Z=void 0,j.dispose()}},J=new $t(ee);return K?.add(J),J.event}e.debounce=m;function w(W,I=0,Y){return e.debounce(W,(V,z)=>V?(V.push(z),V):[z],I,void 0,!0,void 0,Y)}e.accumulate=w;function x(W,I=(V,z)=>V===z,Y){let V=!0,z;return f(W,G=>{let K=V||!I(G,z);return V=!1,z=G,K},Y)}e.latch=x;function T(W,I,Y){return[e.filter(W,I,Y),e.filter(W,V=>!I(V),Y)]}e.split=T;function E(W,I=!1,Y=[],V){let z=Y.slice(),G=W(H=>{z?z.push(H):j.fire(H)});V&&V.add(G);let K=()=>{z?.forEach(H=>j.fire(H)),z=null},j=new $t({onWillAddFirstListener(){G||(G=W(H=>j.fire(H)),V&&V.add(G))},onDidAddFirstListener(){z&&(I?setTimeout(K):K())},onDidRemoveLastListener(){G&&G.dispose(),G=null}});return V&&V.add(j),j.event}e.buffer=E;function p(W,I){return(Y,V,z)=>{let G=I(new _);return W(function(K){let j=G.evaluate(K);j!==v&&Y.call(V,j)},void 0,z)}}e.chain=p;let v=Symbol("HaltChainable");class _{constructor(){this.steps=[]}map(I){return this.steps.push(I),this}forEach(I){return this.steps.push(Y=>(I(Y),Y)),this}filter(I){return this.steps.push(Y=>I(Y)?Y:v),this}reduce(I,Y){let V=Y;return this.steps.push(z=>(V=I(V,z),V)),this}latch(I=(Y,V)=>Y===V){let Y=!0,V;return this.steps.push(z=>{let G=Y||!I(z,V);return Y=!1,V=z,G?z:v}),this}evaluate(I){for(let Y of this.steps)if(I=Y(I),I===v)break;return I}}function S(W,I,Y=V=>V){let V=(...j)=>K.fire(Y(...j)),z=()=>W.on(I,V),G=()=>W.removeListener(I,V),K=new $t({onWillAddFirstListener:z,onDidRemoveLastListener:G});return K.event}e.fromNodeEventEmitter=S;function k(W,I,Y=V=>V){let V=(...j)=>K.fire(Y(...j)),z=()=>W.addEventListener(I,V),G=()=>W.removeEventListener(I,V),K=new $t({onWillAddFirstListener:z,onDidRemoveLastListener:G});return K.event}e.fromDOMEventEmitter=k;function L(W){return new Promise(I=>i(W)(I))}e.toPromise=L;function R(W){let I=new $t;return W.then(Y=>{I.fire(Y)},()=>{I.fire(void 0)}).finally(()=>{I.dispose()}),I.event}e.fromPromise=R;function N(W,I){return W(Y=>I.fire(Y))}e.forward=N;function A(W,I,Y){return I(Y),W(V=>I(V))}e.runAndSubscribe=A;class B{constructor(I,Y){this._observable=I,this._counter=0,this._hasChanged=!1;let V={onWillAddFirstListener:()=>{I.addObserver(this)},onDidRemoveLastListener:()=>{I.removeObserver(this)}};this.emitter=new $t(V),Y&&Y.add(this.emitter)}beginUpdate(I){this._counter++}handlePossibleChange(I){}handleChange(I,Y){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 q(W,I){return new B(W,I).emitter.event}e.fromObservable=q;function F(W){return(I,Y,V)=>{let z=0,G=!1,K={beginUpdate(){z++},endUpdate(){z--,z===0&&(W.reportChanges(),G&&(G=!1,I.call(Y)))},handlePossibleChange(){},handleChange(){G=!0}};W.addObserver(K),W.reportChanges();let j={dispose(){W.removeObserver(K)}};return V instanceof oo?V.add(j):Array.isArray(V)&&V.push(j),j}}e.fromObservableLight=F})(Pr||={});var lg=class cg{constructor(n){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${n}_${cg._idPool++}`,cg.all.add(this)}start(n){this._stopWatch=new xL,this.listenerCount=n}stop(){if(this._stopWatch){let n=this._stopWatch.elapsed();this.durations.push(n),this.elapsedOverall+=n,this.invocationCount+=1,this._stopWatch=void 0}}};lg.all=new Set,lg._idPool=0;var CL=lg,EL=-1,ix=class rx{constructor(n,i,s=(rx._idPool++).toString(16).padStart(3,"0")){this._errorHandler=n,this.threshold=i,this.name=s,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(n,i){let s=this.threshold;if(s<=0||i<s)return;this._stacks||(this._stacks=new Map);let o=this._stacks.get(n.value)||0;if(this._stacks.set(n.value,o+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=s*.5;let[f,g]=this.getMostFrequentStack(),c=`[${this.name}] potential listener LEAK detected, having ${i} listeners already. MOST frequent listener (${g}):`;console.warn(c),console.warn(f);let h=new AL(c,f);this._errorHandler(h)}return()=>{let f=this._stacks.get(n.value)||0;this._stacks.set(n.value,f-1)}}getMostFrequentStack(){if(!this._stacks)return;let n,i=0;for(let[s,o]of this._stacks)(!n||i<o)&&(n=[s,o],i=o);return n}};ix._idPool=1;var kL=ix,TL=class sx{constructor(n){this.value=n}static create(){let n=new Error;return new sx(n.stack??"")}print(){console.warn(this.value.split(`
|
|
16
|
+
`).slice(2).join(`
|
|
17
|
+
`))}},AL=class extends Error{constructor(e,n){super(e),this.name="ListenerLeakError",this.stack=n}},RL=class extends Error{constructor(e,n){super(e),this.name="ListenerRefusalError",this.stack=n}},LL=0,Zf=class{constructor(n){this.value=n,this.id=LL++}},ML=2,NL,$t=class{constructor(n){this._size=0,this._options=n,this._leakageMon=this._options?.leakWarningThreshold?new kL(n?.onListenerError??Yf,this._options?.leakWarningThreshold??EL):void 0,this._perfMon=this._options?._profName?new CL(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??=(n,i,s)=>{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 h=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],d=new RL(`${c}. HINT: Stack shows most frequent listener (${h[1]}-times)`,h[0]);return(this._options?.onListenerError||Yf)(d),Ji.None}if(this._disposed)return Ji.None;i&&(n=n.bind(i));let o=new Zf(n),f;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o.stack=TL.create(),f=this._leakageMon.check(o.stack,this._size+1)),this._listeners?this._listeners instanceof Zf?(this._deliveryQueue??=new OL,this._listeners=[this._listeners,o]):this._listeners.push(o):(this._options?.onWillAddFirstListener?.(this),this._listeners=o,this._options?.onDidAddFirstListener?.(this)),this._size++;let g=$n(()=>{f?.(),this._removeListener(o)});return s instanceof oo?s.add(g):Array.isArray(s)&&s.push(g),g},this._event}_removeListener(n){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 i=this._listeners,s=i.indexOf(n);if(s===-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--,i[s]=void 0;let o=this._deliveryQueue.current===this;if(this._size*ML<=i.length){let f=0;for(let g=0;g<i.length;g++)i[g]?i[f++]=i[g]:o&&(this._deliveryQueue.end--,f<this._deliveryQueue.i&&this._deliveryQueue.i--);i.length=f}}_deliver(n,i){if(!n)return;let s=this._options?.onListenerError||Yf;if(!s){n.value(i);return}try{n.value(i)}catch(o){s(o)}}_deliverQueue(n){let i=n.current._listeners;for(;n.i<n.end;)this._deliver(i[n.i++],n.value);n.reset()}fire(n){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof Zf)this._deliver(this._listeners,n);else{let i=this._deliveryQueue;i.enqueue(this,n,this._listeners.length),this._deliverQueue(i)}this._perfMon?.stop()}hasListeners(){return this._size>0}},OL=class{constructor(){this.i=-1,this.end=0}enqueue(e,n,i){this.i=0,this.end=i,this.current=e,this.value=n}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},_1={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}},bl=2,yl,_s=class Va{constructor(n,i,s){this._document=n,this._config=i,this._unicodeService=s,this._didWarmUp=!1,this._cacheMap=new m1,this._cacheMapCombined=new m1,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new Qa,this._textureSize=512,this._onAddTextureAtlasCanvas=new $t,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new $t,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=ax(n,this._config.deviceCellWidth*4+bl*2,this._config.deviceCellHeight+bl*2),this._tmpCtx=mn(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}get pages(){return this._pages}dispose(){this._tmpCanvas.remove();for(let n of this.pages)n.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){let n=new SL;for(let i=33;i<126;i++)n.enqueue(()=>{if(!this._cacheMap.get(i,0,0,0)){let s=this._drawToCache(i,0,0,0,!1,void 0);this._cacheMap.set(i,0,0,0,s)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(!(this._pages[0].currentRow.x===0&&this._pages[0].currentRow.y===0)){for(let n of this._pages)n.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(Va.maxAtlasPages&&this._pages.length>=Math.max(4,Va.maxAtlasPages)){let i=this._pages.filter(d=>d.canvas.width*2<=(Va.maxTextureSize||4096)).sort((d,b)=>b.canvas.width!==d.canvas.width?b.canvas.width-d.canvas.width:b.percentageUsed-d.percentageUsed),s=-1,o=0;for(let d=0;d<i.length;d++)if(i[d].canvas.width!==o)s=d,o=i[d].canvas.width;else if(d-s===3)break;let f=i.slice(s,s+4),g=f.map(d=>d.glyphs[0].texturePage).sort((d,b)=>d>b?1:-1),c=this.pages.length-f.length,h=this._mergePages(f,c);h.version++;for(let d=g.length-1;d>=0;d--)this._deletePage(g[d]);this.pages.push(h),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(h.canvas)}let n=new Jf(this._document,this._textureSize);return this._pages.push(n),this._activePages.push(n),this._onAddTextureAtlasCanvas.fire(n.canvas),n}_mergePages(n,i){let s=n[0].canvas.width*2,o=new Jf(this._document,s,n);for(let[f,g]of n.entries()){let c=f*g.canvas.width%s,h=Math.floor(f/2)*g.canvas.height;o.ctx.drawImage(g.canvas,c,h);for(let b of g.glyphs)b.texturePage=i,b.sizeClipSpace.x=b.size.x/s,b.sizeClipSpace.y=b.size.y/s,b.texturePosition.x+=c,b.texturePosition.y+=h,b.texturePositionClipSpace.x=b.texturePosition.x/s,b.texturePositionClipSpace.y=b.texturePosition.y/s;this._onRemoveTextureAtlasCanvas.fire(g.canvas);let d=this._activePages.indexOf(g);d!==-1&&this._activePages.splice(d,1)}return o}_deletePage(n){this._pages.splice(n,1);for(let i=n;i<this._pages.length;i++){let s=this._pages[i];for(let o of s.glyphs)o.texturePage--;s.version++}}getRasterizedGlyphCombinedChar(n,i,s,o,f,g){return this._getFromCacheMap(this._cacheMapCombined,n,i,s,o,f,g)}getRasterizedGlyph(n,i,s,o,f,g){return this._getFromCacheMap(this._cacheMap,n,i,s,o,f,g)}_getFromCacheMap(n,i,s,o,f,g,c){return yl=n.get(i,s,o,f),yl||(yl=this._drawToCache(i,s,o,f,g,c),n.set(i,s,o,f,yl)),yl}_getColorFromAnsiIndex(n){if(n>=this._config.colors.ansi.length)throw new Error("No color found for idx "+n);return this._config.colors.ansi[n]}_getBackgroundColor(n,i,s,o){if(this._config.allowTransparency)return Bi;let f;switch(n){case 16777216:case 33554432:f=this._getColorFromAnsiIndex(i);break;case 50331648:let g=Qa.toColorRGB(i);f=Kn.toColor(g[0],g[1],g[2]);break;default:s?f=Ml.opaque(this._config.colors.foreground):f=this._config.colors.background;break}return this._config.allowTransparency||(f=Ml.opaque(f)),f}_getForegroundColor(n,i,s,o,f,g,c,h,d,b){let m=this._getMinimumContrastColor(n,i,s,o,f,g,c,d,h,b);if(m)return m;let w;switch(f){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&d&&g<8&&(g+=8),w=this._getColorFromAnsiIndex(g);break;case 50331648:let x=Qa.toColorRGB(g);w=Kn.toColor(x[0],x[1],x[2]);break;default:c?w=this._config.colors.background:w=this._config.colors.foreground}return this._config.allowTransparency&&(w=Ml.opaque(w)),h&&(w=Ml.multiplyOpacity(w,uL)),w}_resolveBackgroundRgba(n,i,s){switch(n){case 16777216:case 33554432:return this._getColorFromAnsiIndex(i).rgba;case 50331648:return i<<8;default:return s?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(n,i,s,o){switch(n){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&o&&i<8&&(i+=8),this._getColorFromAnsiIndex(i).rgba;case 50331648:return i<<8;default:return s?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(n,i,s,o,f,g,c,h,d,b){if(this._config.minimumContrastRatio===1||b)return;let m=this._getContrastCache(d),w=m.getColor(n,o);if(w!==void 0)return w||void 0;let x=this._resolveBackgroundRgba(i,s,c),T=this._resolveForegroundRgba(f,g,c,h),E=Qs.ensureContrastRatio(x,T,this._config.minimumContrastRatio/(d?2:1));if(!E){m.setColor(n,o,null);return}let p=Kn.toColor(E>>24&255,E>>16&255,E>>8&255);return m.setColor(n,o,p),p}_getContrastCache(n){return n?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(n,i,s,o,f,g){let c=typeof n=="number"?String.fromCharCode(n):n;g&&this._tmpCanvas.parentElement!==g&&(this._tmpCanvas.style.display="none",g.append(this._tmpCanvas));let h=Math.min(this._config.deviceCellWidth*Math.max(c.length,2)+bl*2,this._config.deviceMaxTextureSize);this._tmpCanvas.width<h&&(this._tmpCanvas.width=h);let d=Math.min(this._config.deviceCellHeight+bl*4,this._textureSize);if(this._tmpCanvas.height<d&&(this._tmpCanvas.height=d),this._tmpCtx.save(),this._workAttributeData.fg=s,this._workAttributeData.bg=i,this._workAttributeData.extended.ext=o,!!this._workAttributeData.isInvisible())return _1;let b=!!this._workAttributeData.isBold(),m=!!this._workAttributeData.isInverse(),w=!!this._workAttributeData.isDim(),x=!!this._workAttributeData.isItalic(),T=!!this._workAttributeData.isUnderline(),E=!!this._workAttributeData.isStrikethrough(),p=!!this._workAttributeData.isOverline(),v=this._workAttributeData.getFgColor(),_=this._workAttributeData.getFgColorMode(),S=this._workAttributeData.getBgColor(),k=this._workAttributeData.getBgColorMode();if(m){let H=v;v=S,S=H;let D=_;_=k,k=D}let L=this._getBackgroundColor(k,S,m,w);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=L.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";let R=b?this._config.fontWeightBold:this._config.fontWeight,N=x?"italic":"";this._tmpCtx.font=`${N} ${R} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=Yw;let A=c.length===1&&_m(c.charCodeAt(0)),B=c.length===1&&nL(c.charCodeAt(0)),q=this._getForegroundColor(i,k,S,s,_,v,m,w,b,Vw(c.charCodeAt(0)));this._tmpCtx.fillStyle=q.css;let F=B?0:bl*2,W=!1;this._config.customGlyphs!==!1&&(W=pL(this._tmpCtx,c,F,F,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let I=!A,Y;if(typeof n=="number"?Y=this._unicodeService.wcwidth(n):Y=this._unicodeService.getStringCellWidth(n),T){this._tmpCtx.save();let H=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),D=H%2===1?.5:0;if(this._tmpCtx.lineWidth=H,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())I=!1,this._tmpCtx.strokeStyle=`rgb(${Qa.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{I=!1;let X=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&X<8&&(X+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(X).css}this._tmpCtx.beginPath();let P=F,Z=Math.ceil(F+this._config.deviceCharHeight)-D-(f?H*2:0),ee=Z+H,J=Z+H*2,se=this._workAttributeData.getUnderlineVariantOffset();for(let X=0;X<Y;X++){this._tmpCtx.save();let $=P+X*this._config.deviceCellWidth,ae=P+(X+1)*this._config.deviceCellWidth,de=$+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo($,Z),this._tmpCtx.lineTo(ae,Z),this._tmpCtx.moveTo($,J),this._tmpCtx.lineTo(ae,J);break;case 3:let we=H<=1?J:Math.ceil(F+this._config.deviceCharHeight-H/2)-D,ye=H<=1?Z:Math.ceil(F+this._config.deviceCharHeight+H/2)-D,Ne=new Path2D;Ne.rect($,Z,this._config.deviceCellWidth,J-Z),this._tmpCtx.clip(Ne),this._tmpCtx.moveTo($-this._config.deviceCellWidth/2,ee),this._tmpCtx.bezierCurveTo($-this._config.deviceCellWidth/2,ye,$,ye,$,ee),this._tmpCtx.bezierCurveTo($,we,de,we,de,ee),this._tmpCtx.bezierCurveTo(de,ye,ae,ye,ae,ee),this._tmpCtx.bezierCurveTo(ae,we,ae+this._config.deviceCellWidth/2,we,ae+this._config.deviceCellWidth/2,ee);break;case 4:let Oe=se===0?0:se>=H?H*2-se:H-se;se>=H||Oe===0?(this._tmpCtx.setLineDash([Math.round(H),Math.round(H)]),this._tmpCtx.moveTo($+Oe,Z),this._tmpCtx.lineTo(ae,Z)):(this._tmpCtx.setLineDash([Math.round(H),Math.round(H)]),this._tmpCtx.moveTo($,Z),this._tmpCtx.lineTo($+Oe,Z),this._tmpCtx.moveTo($+Oe+H,Z),this._tmpCtx.lineTo(ae,Z)),se=lL(ae-$,H,se);break;case 5:let Ge=.6,vt=.3,Le=ae-$,Rt=Math.floor(Ge*Le),Xt=Math.floor(vt*Le),vn=Le-Rt-Xt;this._tmpCtx.setLineDash([Rt,Xt,vn]),this._tmpCtx.moveTo($,Z),this._tmpCtx.lineTo(ae,Z);break;default:this._tmpCtx.moveTo($,Z),this._tmpCtx.lineTo(ae,Z);break}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!W&&this._config.fontSize>=12&&!this._config.allowTransparency&&c!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";let X=this._tmpCtx.measureText(c);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in X&&X.actualBoundingBoxDescent>0){this._tmpCtx.save();let $=new Path2D;$.rect(P,Z-Math.ceil(H/2),this._config.deviceCellWidth*Y,J-Z+Math.ceil(H/2)),this._tmpCtx.clip($),this._tmpCtx.lineWidth=this._config.devicePixelRatio*3,this._tmpCtx.strokeStyle=L.css,this._tmpCtx.strokeText(c,F,F+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(p){let H=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),D=H%2===1?.5:0;this._tmpCtx.lineWidth=H,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(F,F+D),this._tmpCtx.lineTo(F+this._config.deviceCharWidth*Y,F+D),this._tmpCtx.stroke()}if(W||this._tmpCtx.fillText(c,F,F+this._config.deviceCharHeight),c==="_"&&!this._config.allowTransparency){let H=Qf(this._tmpCtx.getImageData(F,F,this._config.deviceCellWidth,this._config.deviceCellHeight),L,q,I);if(H)for(let D=1;D<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=L.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(c,F,F+this._config.deviceCharHeight-D),H=Qf(this._tmpCtx.getImageData(F,F,this._config.deviceCellWidth,this._config.deviceCellHeight),L,q,I),!!H);D++);}if(E){let H=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),D=this._tmpCtx.lineWidth%2===1?.5:0;this._tmpCtx.lineWidth=H,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(F,F+Math.floor(this._config.deviceCharHeight/2)-D),this._tmpCtx.lineTo(F+this._config.deviceCharWidth*Y,F+Math.floor(this._config.deviceCharHeight/2)-D),this._tmpCtx.stroke()}this._tmpCtx.restore();let V=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height),z;if(this._config.allowTransparency?z=DL(V):z=Qf(V,L,q,I),z)return _1;let G=this._findGlyphBoundingBox(V,this._workBoundingBox,h,B,W,F),K,j;for(;;){if(this._activePages.length===0){let H=this._createNewPage();K=H,j=H.currentRow,j.height=G.size.y;break}K=this._activePages[this._activePages.length-1],j=K.currentRow;for(let H of this._activePages)G.size.y<=H.currentRow.height&&(K=H,j=H.currentRow);for(let H=this._activePages.length-1;H>=0;H--)for(let D of this._activePages[H].fixedRows)D.height<=j.height&&G.size.y<=D.height&&(K=this._activePages[H],j=D);if(G.size.x>this._textureSize){this._overflowSizePage||(this._overflowSizePage=new Jf(this._document,this._config.deviceMaxTextureSize),this.pages.push(this._overflowSizePage),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(this._overflowSizePage.canvas)),K=this._overflowSizePage,j=this._overflowSizePage.currentRow,j.x+G.size.x>=K.canvas.width&&(j.x=0,j.y+=j.height,j.height=0);break}if(j.y+G.size.y>=K.canvas.height||j.height>G.size.y+2){let H=!1;if(K.currentRow.y+K.currentRow.height+G.size.y>=K.canvas.height){let D;for(let P of this._activePages)if(P.currentRow.y+P.currentRow.height+G.size.y<P.canvas.height){D=P;break}if(D)K=D;else if(Va.maxAtlasPages&&this._pages.length>=Va.maxAtlasPages&&j.y+G.size.y<=K.canvas.height&&j.height>=G.size.y&&j.x+G.size.x<=K.canvas.width)H=!0;else{let P=this._createNewPage();K=P,j=P.currentRow,j.height=G.size.y,H=!0}}H||(K.currentRow.height>0&&K.fixedRows.push(K.currentRow),j={x:0,y:K.currentRow.y+K.currentRow.height,height:G.size.y},K.fixedRows.push(j),K.currentRow={x:0,y:j.y+j.height,height:0})}if(j.x+G.size.x<=K.canvas.width)break;j===K.currentRow?(j.x=0,j.y+=j.height,j.height=0):K.fixedRows.splice(K.fixedRows.indexOf(j),1)}return G.texturePage=this._pages.indexOf(K),G.texturePosition.x=j.x,G.texturePosition.y=j.y,G.texturePositionClipSpace.x=j.x/K.canvas.width,G.texturePositionClipSpace.y=j.y/K.canvas.height,G.sizeClipSpace.x/=K.canvas.width,G.sizeClipSpace.y/=K.canvas.height,j.height=Math.max(j.height,G.size.y),j.x+=G.size.x,K.ctx.putImageData(V,G.texturePosition.x-this._workBoundingBox.left,G.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,G.size.x,G.size.y),K.addGlyph(G),K.version++,G}_findGlyphBoundingBox(n,i,s,o,f,g){i.top=0;let c=o?this._config.deviceCellHeight:this._tmpCanvas.height,h=o?this._config.deviceCellWidth:s,d=!1;for(let b=0;b<c;b++){for(let m=0;m<h;m++){let w=b*this._tmpCanvas.width*4+m*4+3;if(n.data[w]!==0){i.top=b,d=!0;break}}if(d)break}i.left=0,d=!1;for(let b=0;b<g+h;b++){for(let m=0;m<c;m++){let w=m*this._tmpCanvas.width*4+b*4+3;if(n.data[w]!==0){i.left=b,d=!0;break}}if(d)break}i.right=h,d=!1;for(let b=g+h-1;b>=g;b--){for(let m=0;m<c;m++){let w=m*this._tmpCanvas.width*4+b*4+3;if(n.data[w]!==0){i.right=b,d=!0;break}}if(d)break}i.bottom=c,d=!1;for(let b=c-1;b>=0;b--){for(let m=0;m<h;m++){let w=b*this._tmpCanvas.width*4+m*4+3;if(n.data[w]!==0){i.bottom=b,d=!0;break}}if(d)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:i.right-i.left+1,y:i.bottom-i.top+1},sizeClipSpace:{x:i.right-i.left+1,y:i.bottom-i.top+1},offset:{x:-i.left+g+(o||f?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-i.top+g+(o||f?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}},Jf=class{constructor(e,n,i){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],i)for(let s of i)this._glyphs.push(...s.glyphs),this._usedPixels+=s._usedPixels;this.canvas=ax(e,n,n),this.ctx=mn(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 Qf(e,n,i,s){let o=n.rgba>>>24,f=n.rgba>>>16&255,g=n.rgba>>>8&255,c=i.rgba>>>24,h=i.rgba>>>16&255,d=i.rgba>>>8&255,b=Math.floor((Math.abs(o-c)+Math.abs(f-h)+Math.abs(g-d))/12),m=!0;for(let w=0;w<e.data.length;w+=4)e.data[w]===o&&e.data[w+1]===f&&e.data[w+2]===g||s&&Math.abs(e.data[w]-o)+Math.abs(e.data[w+1]-f)+Math.abs(e.data[w+2]-g)<b?e.data[w+3]=0:m=!1;return m}function DL(e){for(let n=0;n<e.data.length;n+=4)if(e.data[n+3]>0)return!1;return!0}function ax(e,n,i){let s=e.createElement("canvas");return s.width=n,s.height=i,s}function jL(e,n,i,s,o,f,g,c){let h={foreground:f.foreground,background:f.background,cursor:Bi,cursorAccent:Bi,selectionForeground:Bi,selectionBackgroundTransparent:Bi,selectionBackgroundOpaque:Bi,selectionInactiveBackgroundTransparent:Bi,selectionInactiveBackgroundOpaque:Bi,overviewRulerBorder:Bi,scrollbarSliderBackground:Bi,scrollbarSliderHoverBackground:Bi,scrollbarSliderActiveBackground:Bi,ansi:f.ansi.slice(),contrastCache:f.contrastCache,halfContrastCache:f.halfContrastCache};return{customGlyphs:o.customGlyphs,devicePixelRatio:g,deviceMaxTextureSize:c,letterSpacing:o.letterSpacing,lineHeight:o.lineHeight,deviceCellWidth:e,deviceCellHeight:n,deviceCharWidth:i,deviceCharHeight:s,fontFamily:o.fontFamily,fontSize:o.fontSize,fontWeight:o.fontWeight,fontWeightBold:o.fontWeightBold,allowTransparency:o.allowTransparency,drawBoldTextInBrightColors:o.drawBoldTextInBrightColors,minimumContrastRatio:o.minimumContrastRatio,colors:h}}function v1(e,n){for(let i=0;i<e.colors.ansi.length;i++)if(e.colors.ansi[i].rgba!==n.colors.ansi[i].rgba)return!1;return e.devicePixelRatio===n.devicePixelRatio&&e.customGlyphs===n.customGlyphs&&e.lineHeight===n.lineHeight&&e.letterSpacing===n.letterSpacing&&e.fontFamily===n.fontFamily&&e.fontSize===n.fontSize&&e.fontWeight===n.fontWeight&&e.fontWeightBold===n.fontWeightBold&&e.allowTransparency===n.allowTransparency&&e.deviceCharWidth===n.deviceCharWidth&&e.deviceCharHeight===n.deviceCharHeight&&e.drawBoldTextInBrightColors===n.drawBoldTextInBrightColors&&e.minimumContrastRatio===n.minimumContrastRatio&&e.colors.foreground.rgba===n.colors.foreground.rgba&&e.colors.background.rgba===n.colors.background.rgba}function IL(e){return(e&50331648)===16777216||(e&50331648)===33554432}var Hi=[];function ox(e,n,i,s,o,f,g,c,h){let d=jL(s,o,f,g,n,i,c,h);for(let w=0;w<Hi.length;w++){let x=Hi[w],T=x.ownedBy.indexOf(e);if(T>=0){if(v1(x.config,d))return x.atlas;x.ownedBy.length===1?(x.atlas.dispose(),Hi.splice(w,1)):x.ownedBy.splice(T,1);break}}for(let w=0;w<Hi.length;w++){let x=Hi[w];if(v1(x.config,d))return x.ownedBy.push(e),x.atlas}let b=e._core,m={atlas:new _s(document,d,b.unicodeService),config:d,ownedBy:[e]};return Hi.push(m),m.atlas}function b1(e){for(let n=0;n<Hi.length;n++){let i=Hi[n].ownedBy.indexOf(e);if(i!==-1){Hi[n].ownedBy.length===1?(Hi[n].atlas.dispose(),Hi.splice(n,1)):Hi[n].ownedBy.splice(i,1);break}}}var wu=600,BL=class{constructor(e,n){this._renderCallback=e,this._coreBrowserService=n,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})))}_restartInterval(e=wu){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){let n=wu-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,n>0){this._restartInterval(n);return}}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){let n=wu-(Date.now()-this._animationTimeRestarted);this._animationTimeRestarted=void 0,this._restartInterval(n);return}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},wu)},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 y1(e,n,i){let s=new n.ResizeObserver(o=>{let f=o.find(h=>h.target===e);if(!f)return;if(!("devicePixelContentBoxSize"in f)){s?.disconnect(),s=void 0;return}let g=f.devicePixelContentBoxSize[0].inlineSize,c=f.devicePixelContentBoxSize[0].blockSize;g>0&&c>0&&i(g,c)});try{s.observe(e,{box:["device-pixel-content-box"]})}catch{s.disconnect(),s=void 0}return $n(()=>s?.disconnect())}function PL(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}var S1=class lx extends Qa{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new ex,this.combinedData=""}static fromCharData(n){let i=new lx;return i.setFromCharData(n),i}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?PL(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(n){this.fg=n[0],this.bg=0;let i=!1;if(n[1].length>2)i=!0;else if(n[1].length===2){let s=n[1].charCodeAt(0);if(55296<=s&&s<=56319){let o=n[1].charCodeAt(1);56320<=o&&o<=57343?this.content=(s-55296)*1024+o-56320+65536|n[2]<<22:i=!0}else i=!0}else this.content=n[1].charCodeAt(0)|n[2]<<22;i&&(this.combinedData=n[1],this.content=2097152|n[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},cx=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]);function ux(e,n,i){let s=mn(e.createProgram());if(e.attachShader(s,mn(w1(e,e.VERTEX_SHADER,n))),e.attachShader(s,mn(w1(e,e.FRAGMENT_SHADER,i))),e.linkProgram(s),e.getProgramParameter(s,e.LINK_STATUS))return s;console.error(e.getProgramInfoLog(s)),e.deleteProgram(s)}function w1(e,n,i){let s=mn(e.createShader(n));if(e.shaderSource(s,i),e.compileShader(s),e.getShaderParameter(s,e.COMPILE_STATUS))return s;console.error(e.getShaderInfoLog(s)),e.deleteShader(s)}function zL(e,n){let i=Math.min(e.length*2,n),s=new Float32Array(i);for(let o=0;o<e.length;o++)s[o]=e[o];return s}var HL=class{constructor(e){this.texture=e,this.version=-1}},$L=`#version 300 es
|
|
18
|
+
layout (location = 0) in vec2 a_unitquad;
|
|
19
|
+
layout (location = 1) in vec2 a_cellpos;
|
|
20
|
+
layout (location = 2) in vec2 a_offset;
|
|
21
|
+
layout (location = 3) in vec2 a_size;
|
|
22
|
+
layout (location = 4) in float a_texpage;
|
|
23
|
+
layout (location = 5) in vec2 a_texcoord;
|
|
24
|
+
layout (location = 6) in vec2 a_texsize;
|
|
25
|
+
|
|
26
|
+
uniform mat4 u_projection;
|
|
27
|
+
uniform vec2 u_resolution;
|
|
28
|
+
|
|
29
|
+
out vec2 v_texcoord;
|
|
30
|
+
flat out int v_texpage;
|
|
31
|
+
|
|
32
|
+
void main() {
|
|
33
|
+
vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
|
|
34
|
+
gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
|
|
35
|
+
v_texpage = int(a_texpage);
|
|
36
|
+
v_texcoord = a_texcoord + a_unitquad * a_texsize;
|
|
37
|
+
}`;function UL(e){let n="";for(let i=1;i<e;i++)n+=` else if (v_texpage == ${i}) { outColor = texture(u_texture[${i}], v_texcoord); }`;return`#version 300 es
|
|
38
|
+
precision lowp float;
|
|
39
|
+
|
|
40
|
+
in vec2 v_texcoord;
|
|
41
|
+
flat in int v_texpage;
|
|
42
|
+
|
|
43
|
+
uniform sampler2D u_texture[${e}];
|
|
44
|
+
|
|
45
|
+
out vec4 outColor;
|
|
46
|
+
|
|
47
|
+
void main() {
|
|
48
|
+
if (v_texpage == 0) {
|
|
49
|
+
outColor = texture(u_texture[0], v_texcoord);
|
|
50
|
+
} ${n}
|
|
51
|
+
}`}var vs=11,Fa=vs*Float32Array.BYTES_PER_ELEMENT,FL=2,nn=0,Ht,ep=0,Sl=0,WL=class extends Ji{constructor(e,n,i,s){super(),this._terminal=e,this._gl=n,this._dimensions=i,this._optionsService=s,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};let o=this._gl;_s.maxAtlasPages===void 0&&(_s.maxAtlasPages=Math.min(32,mn(o.getParameter(o.MAX_TEXTURE_IMAGE_UNITS))),_s.maxTextureSize=mn(o.getParameter(o.MAX_TEXTURE_SIZE))),this._program=mn(ux(o,$L,UL(_s.maxAtlasPages))),this._register($n(()=>o.deleteProgram(this._program))),this._projectionLocation=mn(o.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=mn(o.getUniformLocation(this._program,"u_resolution")),this._textureLocation=mn(o.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=o.createVertexArray(),o.bindVertexArray(this._vertexArrayObject);let f=new Float32Array([0,0,1,0,0,1,1,1]),g=o.createBuffer();this._register($n(()=>o.deleteBuffer(g))),o.bindBuffer(o.ARRAY_BUFFER,g),o.bufferData(o.ARRAY_BUFFER,f,o.STATIC_DRAW),o.enableVertexAttribArray(0),o.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);let c=new Uint8Array([0,1,2,3]),h=o.createBuffer();this._register($n(()=>o.deleteBuffer(h))),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,h),o.bufferData(o.ELEMENT_ARRAY_BUFFER,c,o.STATIC_DRAW),this._attributesBuffer=mn(o.createBuffer()),this._register($n(()=>o.deleteBuffer(this._attributesBuffer))),o.bindBuffer(o.ARRAY_BUFFER,this._attributesBuffer),o.enableVertexAttribArray(2),o.vertexAttribPointer(2,2,o.FLOAT,!1,Fa,0),o.vertexAttribDivisor(2,1),o.enableVertexAttribArray(3),o.vertexAttribPointer(3,2,o.FLOAT,!1,Fa,2*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(3,1),o.enableVertexAttribArray(4),o.vertexAttribPointer(4,1,o.FLOAT,!1,Fa,4*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(4,1),o.enableVertexAttribArray(5),o.vertexAttribPointer(5,2,o.FLOAT,!1,Fa,5*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(5,1),o.enableVertexAttribArray(6),o.vertexAttribPointer(6,2,o.FLOAT,!1,Fa,7*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(6,1),o.enableVertexAttribArray(1),o.vertexAttribPointer(1,2,o.FLOAT,!1,Fa,9*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(1,1),o.useProgram(this._program);let d=new Int32Array(_s.maxAtlasPages);for(let b=0;b<_s.maxAtlasPages;b++)d[b]=b;o.uniform1iv(this._textureLocation,d),o.uniformMatrix4fv(this._projectionLocation,!1,cx),this._atlasTextures=[];for(let b=0;b<_s.maxAtlasPages;b++){let m=new HL(mn(o.createTexture()));this._register($n(()=>o.deleteTexture(m.texture))),o.activeTexture(o.TEXTURE0+b),o.bindTexture(o.TEXTURE_2D,m.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]=m}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,n,i,s,o,f,g,c,h){this._updateCell(this._vertices.attributes,e,n,i,s,o,f,g,c,h)}_updateCell(e,n,i,s,o,f,g,c,h,d){if(nn=(i*this._terminal.cols+n)*vs,s===0||s===void 0){e.fill(0,nn,nn+vs-1-FL);return}this._atlas&&(c&&c.length>1?Ht=this._atlas.getRasterizedGlyphCombinedChar(c,o,f,g,!1,this._terminal.element):Ht=this._atlas.getRasterizedGlyph(s,o,f,g,!1,this._terminal.element),ep=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),o!==d&&Ht.offset.x>ep?(Sl=Ht.offset.x-ep,e[nn]=-(Ht.offset.x-Sl)+this._dimensions.device.char.left,e[nn+1]=-Ht.offset.y+this._dimensions.device.char.top,e[nn+2]=(Ht.size.x-Sl)/this._dimensions.device.canvas.width,e[nn+3]=Ht.size.y/this._dimensions.device.canvas.height,e[nn+4]=Ht.texturePage,e[nn+5]=Ht.texturePositionClipSpace.x+Sl/this._atlas.pages[Ht.texturePage].canvas.width,e[nn+6]=Ht.texturePositionClipSpace.y,e[nn+7]=Ht.sizeClipSpace.x-Sl/this._atlas.pages[Ht.texturePage].canvas.width,e[nn+8]=Ht.sizeClipSpace.y):(e[nn]=-Ht.offset.x+this._dimensions.device.char.left,e[nn+1]=-Ht.offset.y+this._dimensions.device.char.top,e[nn+2]=Ht.size.x/this._dimensions.device.canvas.width,e[nn+3]=Ht.size.y/this._dimensions.device.canvas.height,e[nn+4]=Ht.texturePage,e[nn+5]=Ht.texturePositionClipSpace.x,e[nn+6]=Ht.texturePositionClipSpace.y,e[nn+7]=Ht.sizeClipSpace.x,e[nn+8]=Ht.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&aL(s,h,Ht.size.x,this._dimensions.device.cell.width)&&(e[nn+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width))}clear(){let e=this._terminal,n=e.cols*e.rows*vs;this._vertices.count!==n?this._vertices.attributes=new Float32Array(n):this._vertices.attributes.fill(0);let i=0;for(;i<this._vertices.attributesBuffers.length;i++)this._vertices.count!==n?this._vertices.attributesBuffers[i]=new Float32Array(n):this._vertices.attributesBuffers[i].fill(0);this._vertices.count=n,i=0;for(let s=0;s<e.rows;s++)for(let o=0;o<e.cols;o++)this._vertices.attributes[i+9]=o/e.cols,this._vertices.attributes[i+10]=s/e.rows,i+=vs}handleResize(){let e=this._gl;e.useProgram(this._program),e.viewport(0,0,e.canvas.width,e.canvas.height),e.uniform2f(this._resolutionLocation,e.canvas.width,e.canvas.height),this.clear()}render(e){if(!this._atlas)return;let n=this._gl;n.useProgram(this._program),n.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;let i=this._vertices.attributesBuffers[this._activeBuffer],s=0;for(let o=0;o<e.lineLengths.length;o++){let f=o*this._terminal.cols*vs,g=this._vertices.attributes.subarray(f,f+e.lineLengths[o]*vs);i.set(g,s),s+=g.length}n.bindBuffer(n.ARRAY_BUFFER,this._attributesBuffer),n.bufferData(n.ARRAY_BUFFER,i.subarray(0,s),n.STREAM_DRAW);for(let o=0;o<this._atlas.pages.length;o++)this._atlas.pages[o].version!==this._atlasTextures[o].version&&this._bindAtlasPageTexture(n,this._atlas,o);n.drawElementsInstanced(n.TRIANGLE_STRIP,4,n.UNSIGNED_BYTE,0,s/vs)}setAtlas(e){this._atlas=e;for(let n of this._atlasTextures)n.version=-1}_bindAtlasPageTexture(e,n,i){e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,this._atlasTextures[i].texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n.pages[i].canvas),e.generateMipmap(e.TEXTURE_2D),this._atlasTextures[i].version=n.pages[i].version}setDimensions(e){this._dimensions=e}},GL=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,n,i,s=!1){if(this.selectionStart=n,this.selectionEnd=i,!n||!i||n[0]===i[0]&&n[1]===i[1]){this.clear();return}let o=e.buffers.active.ydisp,f=n[1]-o,g=i[1]-o,c=Math.max(f,0),h=Math.min(g,e.rows-1);if(c>=e.rows||h<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=s,this.viewportStartRow=f,this.viewportEndRow=g,this.viewportCappedStartRow=c,this.viewportCappedEndRow=h,this.startCol=n[0],this.endCol=i[0]}isCellSelected(e,n,i){return this.hasSelection?(i-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?n>=this.startCol&&i>=this.viewportCappedStartRow&&n<this.endCol&&i<=this.viewportCappedEndRow:n<this.startCol&&i>=this.viewportCappedStartRow&&n>=this.endCol&&i<=this.viewportCappedEndRow:i>this.viewportStartRow&&i<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&i===this.viewportStartRow&&n>=this.startCol&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportEndRow&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportStartRow&&n>=this.startCol):!1}};function qL(){return new GL}var ih=4,Uu=1,Fu=2,tp=3,KL=2147483648,VL=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=qL()}resize(e,n){let i=e*n*ih;i!==this.cells.length&&(this.cells=new Uint32Array(i),this.lineLengths=new Uint32Array(n))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}},YL=`#version 300 es
|
|
52
|
+
layout (location = 0) in vec2 a_position;
|
|
53
|
+
layout (location = 1) in vec2 a_size;
|
|
54
|
+
layout (location = 2) in vec4 a_color;
|
|
55
|
+
layout (location = 3) in vec2 a_unitquad;
|
|
56
|
+
|
|
57
|
+
uniform mat4 u_projection;
|
|
58
|
+
|
|
59
|
+
out vec4 v_color;
|
|
60
|
+
|
|
61
|
+
void main() {
|
|
62
|
+
vec2 zeroToOne = a_position + (a_unitquad * a_size);
|
|
63
|
+
gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
|
|
64
|
+
v_color = a_color;
|
|
65
|
+
}`,XL=`#version 300 es
|
|
66
|
+
precision lowp float;
|
|
67
|
+
|
|
68
|
+
in vec4 v_color;
|
|
69
|
+
|
|
70
|
+
out vec4 outColor;
|
|
71
|
+
|
|
72
|
+
void main() {
|
|
73
|
+
outColor = v_color;
|
|
74
|
+
}`,Ir=8,np=Ir*Float32Array.BYTES_PER_ELEMENT,ZL=20*Ir,x1=class{constructor(){this.attributes=new Float32Array(ZL),this.count=0}},Dr=0,C1=0,E1=0,k1=0,T1=0,A1=0,R1=0,JL=class extends Ji{constructor(e,n,i,s){super(),this._terminal=e,this._gl=n,this._dimensions=i,this._themeService=s,this._vertices=new x1,this._verticesCursor=new x1;let o=this._gl;this._program=mn(ux(o,YL,XL)),this._register($n(()=>o.deleteProgram(this._program))),this._projectionLocation=mn(o.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=o.createVertexArray(),o.bindVertexArray(this._vertexArrayObject);let f=new Float32Array([0,0,1,0,0,1,1,1]),g=o.createBuffer();this._register($n(()=>o.deleteBuffer(g))),o.bindBuffer(o.ARRAY_BUFFER,g),o.bufferData(o.ARRAY_BUFFER,f,o.STATIC_DRAW),o.enableVertexAttribArray(3),o.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let c=new Uint8Array([0,1,2,3]),h=o.createBuffer();this._register($n(()=>o.deleteBuffer(h))),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,h),o.bufferData(o.ELEMENT_ARRAY_BUFFER,c,o.STATIC_DRAW),this._attributesBuffer=mn(o.createBuffer()),this._register($n(()=>o.deleteBuffer(this._attributesBuffer))),o.bindBuffer(o.ARRAY_BUFFER,this._attributesBuffer),o.enableVertexAttribArray(0),o.vertexAttribPointer(0,2,o.FLOAT,!1,np,0),o.vertexAttribDivisor(0,1),o.enableVertexAttribArray(1),o.vertexAttribPointer(1,2,o.FLOAT,!1,np,2*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(1,1),o.enableVertexAttribArray(2),o.vertexAttribPointer(2,4,o.FLOAT,!1,np,4*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(2,1),this._updateCachedColors(s.colors),this._register(this._themeService.onChangeColors(d=>{this._updateCachedColors(d),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(e){let n=this._gl;n.useProgram(this._program),n.bindVertexArray(this._vertexArrayObject),n.uniformMatrix4fv(this._projectionLocation,!1,cx),n.bindBuffer(n.ARRAY_BUFFER,this._attributesBuffer),n.bufferData(n.ARRAY_BUFFER,e.attributes,n.DYNAMIC_DRAW),n.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,n.UNSIGNED_BYTE,0,e.count)}handleResize(){this._updateViewportRectangle()}setDimensions(e){this._dimensions=e}_updateCachedColors(e){this._bgFloat=this._colorToFloat32Array(e.background),this._cursorFloat=this._colorToFloat32Array(e.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(e){let n=this._terminal,i=this._vertices,s=1,o,f,g,c,h,d,b,m,w,x,T;for(o=0;o<n.rows;o++){for(g=-1,c=0,h=0,d=!1,f=0;f<n.cols;f++)b=(o*n.cols+f)*ih,m=e.cells[b+Uu],w=e.cells[b+Fu],x=!!(w&67108864),(m!==c||w!==h&&(d||x))&&((c!==0||d&&h!==0)&&(T=s++*Ir,this._updateRectangle(i,T,h,c,g,f,o)),g=f,c=m,h=w,d=x);(c!==0||d&&h!==0)&&(T=s++*Ir,this._updateRectangle(i,T,h,c,g,n.cols,o))}i.count=s}updateCursor(e){let n=this._verticesCursor,i=e.cursor;if(!i||i.style==="block"){n.count=0;return}let s,o=0;(i.style==="bar"||i.style==="outline")&&(s=o++*Ir,this._addRectangleFloat(n.attributes,s,i.x*this._dimensions.device.cell.width,i.y*this._dimensions.device.cell.height,i.style==="bar"?i.dpr*i.cursorWidth:i.dpr,this._dimensions.device.cell.height,this._cursorFloat)),(i.style==="underline"||i.style==="outline")&&(s=o++*Ir,this._addRectangleFloat(n.attributes,s,i.x*this._dimensions.device.cell.width,(i.y+1)*this._dimensions.device.cell.height-i.dpr,i.width*this._dimensions.device.cell.width,i.dpr,this._cursorFloat)),i.style==="outline"&&(s=o++*Ir,this._addRectangleFloat(n.attributes,s,i.x*this._dimensions.device.cell.width,i.y*this._dimensions.device.cell.height,i.width*this._dimensions.device.cell.width,i.dpr,this._cursorFloat),s=o++*Ir,this._addRectangleFloat(n.attributes,s,(i.x+i.width)*this._dimensions.device.cell.width-i.dpr,i.y*this._dimensions.device.cell.height,i.dpr,this._dimensions.device.cell.height,this._cursorFloat)),n.count=o}_updateRectangle(e,n,i,s,o,f,g){if(i&67108864)switch(i&50331648){case 16777216:case 33554432:Dr=this._themeService.colors.ansi[i&255].rgba;break;case 50331648:Dr=(i&16777215)<<8;break;default:Dr=this._themeService.colors.foreground.rgba}else switch(s&50331648){case 16777216:case 33554432:Dr=this._themeService.colors.ansi[s&255].rgba;break;case 50331648:Dr=(s&16777215)<<8;break;default:Dr=this._themeService.colors.background.rgba}e.attributes.length<n+4&&(e.attributes=zL(e.attributes,this._terminal.rows*this._terminal.cols*Ir)),C1=o*this._dimensions.device.cell.width,E1=g*this._dimensions.device.cell.height,k1=(Dr>>24&255)/255,T1=(Dr>>16&255)/255,A1=(Dr>>8&255)/255,R1=1,this._addRectangle(e.attributes,n,C1,E1,(f-o)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,k1,T1,A1,R1)}_addRectangle(e,n,i,s,o,f,g,c,h,d){e[n]=i/this._dimensions.device.canvas.width,e[n+1]=s/this._dimensions.device.canvas.height,e[n+2]=o/this._dimensions.device.canvas.width,e[n+3]=f/this._dimensions.device.canvas.height,e[n+4]=g,e[n+5]=c,e[n+6]=h,e[n+7]=d}_addRectangleFloat(e,n,i,s,o,f,g){e[n]=i/this._dimensions.device.canvas.width,e[n+1]=s/this._dimensions.device.canvas.height,e[n+2]=o/this._dimensions.device.canvas.width,e[n+3]=f/this._dimensions.device.canvas.height,e[n+4]=g[0],e[n+5]=g[1],e[n+6]=g[2],e[n+7]=g[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])}},QL=class extends Ji{constructor(e,n,i,s,o,f,g,c){super(),this._container=n,this._alpha=o,this._coreBrowserService=f,this._optionsService=g,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-${i}-layer`),this._canvas.style.zIndex=s.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(h=>{this._refreshCharAtlas(e,h),this.reset(e)})),this._register($n(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=mn(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(e){}handleFocus(e){}handleCursorMove(e){}handleGridChanged(e,n,i){}handleSelectionChanged(e,n,i,s=!1){}_setTransparency(e,n){if(n===this._alpha)return;let i=this._canvas;this._alpha=n,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,i),this._refreshCharAtlas(e,this._themeService.colors),this.handleGridChanged(e,0,e.rows-1)}_refreshCharAtlas(e,n){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=ox(e,this._optionsService.rawOptions,n,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(e,n){this._deviceCellWidth=n.device.cell.width,this._deviceCellHeight=n.device.cell.height,this._deviceCharWidth=n.device.char.width,this._deviceCharHeight=n.device.char.height,this._deviceCharLeft=n.device.char.left,this._deviceCharTop=n.device.char.top,this._canvas.width=n.device.canvas.width,this._canvas.height=n.device.canvas.height,this._canvas.style.width=`${n.css.canvas.width}px`,this._canvas.style.height=`${n.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(e,this._themeService.colors)}_fillBottomLineAtCells(e,n,i=1){this._ctx.fillRect(e*this._deviceCellWidth,(n+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,i*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(e,n,i,s){this._alpha?this._ctx.clearRect(e*this._deviceCellWidth,n*this._deviceCellHeight,i*this._deviceCellWidth,s*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(e*this._deviceCellWidth,n*this._deviceCellHeight,i*this._deviceCellWidth,s*this._deviceCellHeight))}_fillCharTrueColor(e,n,i,s){this._ctx.font=this._getFont(e,!1,!1),this._ctx.textBaseline=Yw,this._clipCell(i,s,n.getWidth()),this._ctx.fillText(n.getChars(),i*this._deviceCellWidth+this._deviceCharLeft,s*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(e,n,i){this._ctx.beginPath(),this._ctx.rect(e*this._deviceCellWidth,n*this._deviceCellHeight,i*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(e,n,i){let s=n?e.options.fontWeightBold:e.options.fontWeight;return`${i?"italic":""} ${s} ${e.options.fontSize*this._coreBrowserService.dpr}px ${e.options.fontFamily}`}},eM=class extends QL{constructor(e,n,i,s,o,f,g){super(i,e,"link",n,!0,o,f,g),this._register(s.onShowLinkUnderline(c=>this._handleShowLinkUnderline(c))),this._register(s.onHideLinkUnderline(c=>this._handleHideLinkUnderline(c)))}resize(e,n){super.resize(e,n),this._state=void 0}reset(e){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let e=this._state.y2-this._state.y1-1;e>0&&this._clearCells(0,this._state.y1+1,this._state.cols,e),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(e){if(e.fg===257?this._ctx.fillStyle=this._themeService.colors.background.css:e.fg!==void 0&&IL(e.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[e.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,e.y1===e.y2)this._fillBottomLineAtCells(e.x1,e.y1,e.x2-e.x1);else{this._fillBottomLineAtCells(e.x1,e.y1,e.cols-e.x1);for(let n=e.y1+1;n<e.y2;n++)this._fillBottomLineAtCells(0,n,e.cols);this._fillBottomLineAtCells(0,e.y2,e.x2)}this._state=e}_handleHideLinkUnderline(e){this._clearCurrentLink()}},Ys=typeof window=="object"?window:globalThis,ug=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new $t,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new $t,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(n){return this.mapWindowIdToZoomLevel.get(this.getWindowId(n))??0}setZoomLevel(n,i){if(this.getZoomLevel(i)===n)return;let s=this.getWindowId(i);this.mapWindowIdToZoomLevel.set(s,n),this._onDidChangeZoomLevel.fire(s)}getZoomFactor(n){return this.mapWindowIdToZoomFactor.get(this.getWindowId(n))??1}setZoomFactor(n,i){this.mapWindowIdToZoomFactor.set(this.getWindowId(i),n)}setFullscreen(n,i){if(this.isFullscreen(i)===n)return;let s=this.getWindowId(i);this.mapWindowIdToFullScreen.set(s,n),this._onDidChangeFullscreen.fire(s)}isFullscreen(n){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(n))}getWindowId(n){return n.vscodeWindowId}};ug.INSTANCE=new ug;var hx=ug;function tM(e,n,i){typeof n=="string"&&(n=e.matchMedia(n)),n.addEventListener("change",i)}hx.INSTANCE.onDidChangeZoomLevel;hx.INSTANCE.onDidChangeFullscreen;var yo=typeof navigator=="object"?navigator.userAgent:"";yo.indexOf("Firefox")>=0;yo.indexOf("AppleWebKit")>=0;var nM=yo.indexOf("Chrome")>=0;!nM&&yo.indexOf("Safari")>=0;yo.indexOf("Electron/")>=0;yo.indexOf("Android")>=0;var ip=!1;if(typeof Ys.matchMedia=="function"){let e=Ys.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),n=Ys.matchMedia("(display-mode: fullscreen)");ip=e.matches,tM(Ys,e,({matches:i})=>{ip&&n.matches||(ip=i)})}var eo="en",rp=!1,dx=!1,xu,Wu=eo,L1=eo,iM,jr,ea=globalThis,yi;typeof ea.vscode<"u"&&typeof ea.vscode.process<"u"?yi=ea.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(yi=process);var rM=typeof yi?.versions?.electron=="string",sM=rM&&yi?.type==="renderer";if(typeof yi=="object"){yi.platform,yi.platform,rp=yi.platform==="linux",rp&&yi.env.SNAP&&yi.env.SNAP_REVISION,yi.env.CI||yi.env.BUILD_ARTIFACTSTAGINGDIRECTORY,xu=eo,Wu=eo;let e=yi.env.VSCODE_NLS_CONFIG;if(e)try{let n=JSON.parse(e);xu=n.userLocale,L1=n.osLocale,Wu=n.resolvedLanguage||eo,iM=n.languagePack?.translationsConfigFile}catch{}dx=!0}else typeof navigator=="object"&&!sM?(jr=navigator.userAgent,jr.indexOf("Windows")>=0,jr.indexOf("Macintosh")>=0,(jr.indexOf("Macintosh")>=0||jr.indexOf("iPad")>=0||jr.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,rp=jr.indexOf("Linux")>=0,jr?.indexOf("Mobi")>=0,Wu=globalThis._VSCODE_NLS_LANGUAGE||eo,xu=navigator.language.toLowerCase(),L1=xu):console.error("Unable to resolve platform.");var M1=dx,cr=jr,gs=Wu,aM;(e=>{function n(){return gs}e.value=n;function i(){return gs.length===2?gs==="en":gs.length>=3?gs[0]==="e"&&gs[1]==="n"&&gs[2]==="-":!1}e.isDefaultVariant=i;function s(){return gs==="en"}e.isDefault=s})(aM||={});var oM=typeof ea.postMessage=="function"&&!ea.importScripts;(()=>{if(oM){let e=[];ea.addEventListener("message",i=>{if(i.data&&i.data.vscodeScheduleAsyncWork)for(let s=0,o=e.length;s<o;s++){let f=e[s];if(f.id===i.data.vscodeScheduleAsyncWork){e.splice(s,1),f.callback();return}}});let n=0;return i=>{let s=++n;e.push({id:s,callback:i}),ea.postMessage({vscodeScheduleAsyncWork:s},"*")}}return e=>setTimeout(e)})();var lM=!!(cr&&cr.indexOf("Chrome")>=0);cr&&cr.indexOf("Firefox")>=0;!lM&&cr&&cr.indexOf("Safari")>=0;cr&&cr.indexOf("Edg/")>=0;cr&&cr.indexOf("Android")>=0;var Wa=typeof navigator=="object"?navigator:{};M1||document.queryCommandSupported&&document.queryCommandSupported("copy")||Wa&&Wa.clipboard&&Wa.clipboard.writeText,M1||Wa&&Wa.clipboard&&Wa.clipboard.readText;var vm=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,n){this._keyCodeToStr[e]=n,this._strToKeyCode[n.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},sp=new vm,N1=new vm,O1=new vm;new Array(230);var cM;(e=>{function n(c){return sp.keyCodeToStr(c)}e.toString=n;function i(c){return sp.strToKeyCode(c)}e.fromString=i;function s(c){return N1.keyCodeToStr(c)}e.toUserSettingsUS=s;function o(c){return O1.keyCodeToStr(c)}e.toUserSettingsGeneral=o;function f(c){return N1.strToKeyCode(c)||O1.strToKeyCode(c)}e.fromUserSettings=f;function g(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 sp.keyCodeToStr(c)}e.toElectronAccelerator=g})(cM||={});var fx=Object.freeze(function(e,n){let i=setTimeout(e.bind(n),0);return{dispose(){clearTimeout(i)}}}),uM;(e=>{function n(i){return i===e.None||i===e.Cancelled||i instanceof hM?!0:!i||typeof i!="object"?!1:typeof i.isCancellationRequested=="boolean"&&typeof i.onCancellationRequested=="function"}e.isCancellationToken=n,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Pr.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:fx})})(uM||={});var hM=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?fx:(this._emitter||(this._emitter=new $t),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},dM;(e=>{async function n(s){let o,f=await Promise.all(s.map(g=>g.then(c=>c,c=>{o||(o=c)})));if(typeof o<"u")throw o;return f}e.settled=n;function i(s){return new Promise(async(o,f)=>{try{await s(o,f)}catch(g){f(g)}})}e.withAsyncBody=i})(dM||={});var D1=class Pi{static fromArray(n){return new Pi(i=>{i.emitMany(n)})}static fromPromise(n){return new Pi(async i=>{i.emitMany(await n)})}static fromPromises(n){return new Pi(async i=>{await Promise.all(n.map(async s=>i.emitOne(await s)))})}static merge(n){return new Pi(async i=>{await Promise.all(n.map(async s=>{for await(let o of s)i.emitOne(o)}))})}constructor(n,i){this._state=0,this._results=[],this._error=null,this._onReturn=i,this._onStateChanged=new $t,queueMicrotask(async()=>{let s={emitOne:o=>this.emitOne(o),emitMany:o=>this.emitMany(o),reject:o=>this.reject(o)};try{await Promise.resolve(n(s)),this.resolve()}catch(o){this.reject(o)}finally{s.emitOne=void 0,s.emitMany=void 0,s.reject=void 0}})}[Symbol.asyncIterator](){let n=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(n<this._results.length)return{done:!1,value:this._results[n++]};if(this._state===1)return{done:!0,value:void 0};await Pr.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(n,i){return new Pi(async s=>{for await(let o of n)s.emitOne(i(o))})}map(n){return Pi.map(this,n)}static filter(n,i){return new Pi(async s=>{for await(let o of n)i(o)&&s.emitOne(o)})}filter(n){return Pi.filter(this,n)}static coalesce(n){return Pi.filter(n,i=>!!i)}coalesce(){return Pi.coalesce(this)}static async toPromise(n){let i=[];for await(let s of n)i.push(s);return i}toPromise(){return Pi.toPromise(this)}emitOne(n){this._state===0&&(this._results.push(n),this._onStateChanged.fire())}emitMany(n){this._state===0&&(this._results=this._results.concat(n),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(n){this._state===0&&(this._state=2,this._error=n,this._onStateChanged.fire())}};D1.EMPTY=D1.fromArray([]);var{getWindow:fM}=(function(){let e=new Map,n={window:Ys,disposables:new oo};e.set(Ys.vscodeWindowId,n);let i=new $t,s=new $t,o=new $t;function f(g,c){return(typeof g=="number"?e.get(g):void 0)??(c?n:void 0)}return{onDidRegisterWindow:i.event,onWillUnregisterWindow:o.event,onDidUnregisterWindow:s.event,registerWindow(g){if(e.has(g.vscodeWindowId))return Ji.None;let c=new oo,h={window:g,disposables:c.add(new oo)};return e.set(g.vscodeWindowId,h),c.add($n(()=>{e.delete(g.vscodeWindowId),s.fire(g)})),c.add(hg(g,gM.BEFORE_UNLOAD,()=>{o.fire(g)})),i.fire(h),c},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(g){return g.vscodeWindowId},hasWindow(g){return e.has(g)},getWindowById:f,getWindow(g){let c=g;if(c?.ownerDocument?.defaultView)return c.ownerDocument.defaultView.window;let h=g;return h?.view?h.view.window:Ys},getDocument(g){return fM(g).document}}})(),pM=class{constructor(e,n,i,s){this._node=e,this._type=n,this._handler=i,this._options=s||!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 hg(e,n,i,s){return new pM(e,n,i,s)}var gM={BEFORE_UNLOAD:"beforeunload"},mM=class extends Ji{constructor(e,n,i,s,o,f,g,c,h){super(),this._terminal=e,this._characterJoinerService=n,this._charSizeService=i,this._coreBrowserService=s,this._coreService=o,this._decorationService=f,this._optionsService=g,this._themeService=c,this._cursorBlinkStateManager=new vl,this._charAtlasDisposable=this._register(new vl),this._observerDisposable=this._register(new vl),this._model=new VL,this._workCell=new S1,this._workCell2=new S1,this._rectangleRenderer=this._register(new vl),this._glyphRenderer=this._register(new vl),this._onChangeTextureAtlas=this._register(new $t),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new $t),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new $t),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new $t),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new $t),this.onContextLoss=this._onContextLoss.event,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");let d={antialias:!1,depth:!1,preserveDrawingBuffer:h};if(this._gl=this._canvas.getContext("webgl2",d),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this._register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new cL(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new eM(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,g,this._themeService)],this.dimensions=oL(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(g.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(hg(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(hg(this._canvas,"webglcontextrestored",b=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,b1(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=y1(this._canvas,this._coreBrowserService.window,(b,m)=>this._setCanvasDevicePixelDimensions(b,m)),this._register(this._coreBrowserService.onWindowChange(b=>{this._observerDisposable.value=y1(this._canvas,b,(m,w)=>this._setCanvasDevicePixelDimensions(m,w))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register($n(()=>{for(let b of this._renderLayers)b.dispose();this._canvas.parentElement?.removeChild(this._canvas),b1(this._terminal)}))}get textureAtlas(){return this._charAtlas?.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(e,n){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(let i of this._renderLayers)i.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,this._rectangleRenderer.value?.setDimensions(this.dimensions),this._rectangleRenderer.value?.handleResize(),this._glyphRenderer.value?.setDimensions(this.dimensions),this._glyphRenderer.value?.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(let e of this._renderLayers)e.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(let e of this._renderLayers)e.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(e,n,i){for(let s of this._renderLayers)s.handleSelectionChanged(this._terminal,e,n,i);this._model.selection.update(this._core,e,n,i),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 JL(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new WL(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=ox(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=Ww(Pr.forward(e.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),Pr.forward(e.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=e,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(e){this._model.clear(),e&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(let e of this._renderLayers)e.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(e,n){if(!this._isAttached)if(this._core.screenElement?.isConnected&&this._charSizeService.width&&this._charSizeService.height)this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0;else return;for(let i of this._renderLayers)i.handleGridChanged(this._terminal,e,n);!this._glyphRenderer.value||!this._rectangleRenderer.value||(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(e,n),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible)&&this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._coreService.decPrivateModes.cursorBlink??this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new BL(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(e,n){let i=this._core,s=this._workCell,o,f,g,c,h,d,b=0,m=!0,w,x,T,E,p,v,_,S,k;e=j1(e,i.rows-1,0),n=j1(n,i.rows-1,0);let L=this._coreService.decPrivateModes.cursorStyle??i.options.cursorStyle??"block",R=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,N=R-i.buffer.ydisp,A=Math.min(this._terminal.buffer.active.cursorX,i.cols-1),B=-1,q=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let F=!1;for(f=e;f<=n;f++)for(g=f+i.buffer.ydisp,c=i.buffer.lines.get(g),this._model.lineLengths[f]=0,T=R===g,b=0,h=this._characterJoinerService.getJoinedCharacters(g),S=0;S<i.cols;S++){if(o=this._cellColorResolver.result.bg,c.loadCell(S,s),S===0&&(o=this._cellColorResolver.result.bg),d=!1,m=S>=b,w=S,h.length>0&&S===h[0][0]&&m){x=h.shift();let W=this._model.selection.isCellSelected(this._terminal,x[0],g);for(_=x[0]+1;_<x[1];_++)m&&=W===this._model.selection.isCellSelected(this._terminal,_,g);m&&=!T||A<x[0]||A>=x[1],m?(d=!0,s=new _M(s,c.translateToString(!0,x[0],x[1]),x[1]-x[0]),w=x[1]-1):b=x[1]}if(E=s.getChars(),p=s.getCode(),_=(f*i.cols+S)*ih,this._cellColorResolver.resolve(s,S,g,this.dimensions.device.cell.width),q&&g===R&&(S===A&&(this._model.cursor={x:A,y:N,width:s.getWidth(),style:this._coreBrowserService.isFocused?L:i.options.cursorInactiveStyle,cursorWidth:i.options.cursorWidth,dpr:this._devicePixelRatio},B=A+s.getWidth()-1),S>=A&&S<=B&&(this._coreBrowserService.isFocused&&L==="block"||this._coreBrowserService.isFocused===!1&&i.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[f]=S+1),!(this._model.cells[_]===p&&this._model.cells[_+Uu]===this._cellColorResolver.result.bg&&this._model.cells[_+Fu]===this._cellColorResolver.result.fg&&this._model.cells[_+tp]===this._cellColorResolver.result.ext)&&(F=!0,E.length>1&&(p|=KL),this._model.cells[_]=p,this._model.cells[_+Uu]=this._cellColorResolver.result.bg,this._model.cells[_+Fu]=this._cellColorResolver.result.fg,this._model.cells[_+tp]=this._cellColorResolver.result.ext,v=s.getWidth(),this._glyphRenderer.value.updateCell(S,f,p,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,E,v,o),d)){for(s=this._workCell,S++;S<=w;S++)k=(f*i.cols+S)*ih,this._glyphRenderer.value.updateCell(S,f,0,0,0,0,eL,0,0),this._model.cells[k]=0,this._model.cells[k+Uu]=this._cellColorResolver.result.bg,this._model.cells[k+Fu]=this._cellColorResolver.result.fg,this._model.cells[k+tp]=this._cellColorResolver.result.ext;S--}}F&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){!this._charSizeService.width||!this._charSizeService.height||(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(e,n){this._canvas.width===e&&this._canvas.height===n||(this._canvas.width=e,this._canvas.height=n,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let e=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:e,end:e})}},_M=class extends Qa{constructor(e,n,i){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=n,this._width=i}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 j1(e,n,i=0){return Math.max(Math.min(e,n),i)}var I1="di$target",B1="di$dependencies",ap=new Map;function hr(e){if(ap.has(e))return ap.get(e);let n=function(i,s,o){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");vM(n,i,o)};return n._id=e,ap.set(e,n),n}function vM(e,n,i){n[I1]===n?n[B1].push({id:e,index:i}):(n[B1]=[{id:e,index:i}],n[I1]=n)}hr("BufferService");hr("CoreMouseService");hr("CoreService");hr("CharsetService");hr("InstantiationService");hr("LogService");var bM=hr("OptionsService");hr("OscLinkService");hr("UnicodeService");hr("DecorationService");var yM={trace:0,debug:1,info:2,warn:3,error:4,off:5},SM="xterm.js: ",P1=class extends Ji{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=yM[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let n=0;n<e.length;n++)typeof e[n]=="function"&&(e[n]=e[n]())}_log(e,n,i){this._evalLazyOptionalParams(i),e.call(console,(this._optionsService.options.logger?"":SM)+n,...i)}trace(e,...n){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,n)}debug(e,...n){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,n)}info(e,...n){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,n)}warn(e,...n){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,n)}error(e,...n){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,n)}};P1=U3([F3(0,bM)],P1);var wM=class extends Ji{constructor(e){if(Kw&&Q3()<16){let n={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",n))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=e,this._onChangeTextureAtlas=this._register(new $t),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new $t),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new $t),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new $t),this.onContextLoss=this._onContextLoss.event}activate(e){let n=e._core;if(!e.element){this._register(n.onWillOpen(()=>this.activate(e)));return}this._terminal=e;let i=n.coreService,s=n.optionsService,o=n,f=o._renderService,g=o._characterJoinerService,c=o._charSizeService,h=o._coreBrowserService,d=o._decorationService;o._logService;let b=o._themeService;this._renderer=this._register(new mM(e,g,c,h,i,d,s,b,this._preserveDrawingBuffer)),this._register(Pr.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(Pr.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(Pr.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(Pr.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),f.setRenderer(this._renderer),this._register($n(()=>{if(this._terminal._core._store._isDisposed)return;let m=this._terminal._core._renderService;m.setRenderer(this._terminal._core._createRenderer()),m.handleResize(e.cols,e.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}},op={exports:{}},z1;function xM(){return z1||(z1=1,(function(e,n){(function(i,s){e.exports=s()})(globalThis,(()=>(()=>{var i={4567:function(g,c,h){var d=this&&this.__decorate||function(_,S,k,L){var R,N=arguments.length,A=N<3?S:L===null?L=Object.getOwnPropertyDescriptor(S,k):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(_,S,k,L);else for(var B=_.length-1;B>=0;B--)(R=_[B])&&(A=(N<3?R(A):N>3?R(S,k,A):R(S,k))||A);return N>3&&A&&Object.defineProperty(S,k,A),A},b=this&&this.__param||function(_,S){return function(k,L){S(k,L,_)}};Object.defineProperty(c,"__esModule",{value:!0}),c.AccessibilityManager=void 0;const m=h(9042),w=h(9924),x=h(844),T=h(4725),E=h(2585),p=h(3656);let v=c.AccessibilityManager=class extends x.Disposable{constructor(_,S,k,L){super(),this._terminal=_,this._coreBrowserService=k,this._renderService=L,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let R=0;R<this._terminal.rows;R++)this._rowElements[R]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[R]);if(this._topBoundaryFocusListener=R=>this._handleBoundaryFocus(R,0),this._bottomBoundaryFocusListener=R=>this._handleBoundaryFocus(R,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new w.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((R=>this._handleResize(R.rows)))),this.register(this._terminal.onRender((R=>this._refreshRows(R.start,R.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((R=>this._handleChar(R)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
75
|
+
`)))),this.register(this._terminal.onA11yTab((R=>this._handleTab(R)))),this.register(this._terminal.onKey((R=>this._handleKey(R.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,p.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,x.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(_){for(let S=0;S<_;S++)this._handleChar(" ")}_handleChar(_){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==_&&(this._charsToAnnounce+=_):this._charsToAnnounce+=_,_===`
|
|
76
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=m.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(_){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(_)||this._charsToConsume.push(_)}_refreshRows(_,S){this._liveRegionDebouncer.refresh(_,S,this._terminal.rows)}_renderRows(_,S){const k=this._terminal.buffer,L=k.lines.length.toString();for(let R=_;R<=S;R++){const N=k.lines.get(k.ydisp+R),A=[],B=N?.translateToString(!0,void 0,void 0,A)||"",q=(k.ydisp+R+1).toString(),F=this._rowElements[R];F&&(B.length===0?(F.innerText=" ",this._rowColumns.set(F,[0,1])):(F.textContent=B,this._rowColumns.set(F,A)),F.setAttribute("aria-posinset",q),F.setAttribute("aria-setsize",L))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(_,S){const k=_.target,L=this._rowElements[S===0?1:this._rowElements.length-2];if(k.getAttribute("aria-posinset")===(S===0?"1":`${this._terminal.buffer.lines.length}`)||_.relatedTarget!==L)return;let R,N;if(S===0?(R=k,N=this._rowElements.pop(),this._rowContainer.removeChild(N)):(R=this._rowElements.shift(),N=k,this._rowContainer.removeChild(R)),R.removeEventListener("focus",this._topBoundaryFocusListener),N.removeEventListener("focus",this._bottomBoundaryFocusListener),S===0){const A=this._createAccessibilityTreeNode();this._rowElements.unshift(A),this._rowContainer.insertAdjacentElement("afterbegin",A)}else{const A=this._createAccessibilityTreeNode();this._rowElements.push(A),this._rowContainer.appendChild(A)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(S===0?-1:1),this._rowElements[S===0?1:this._rowElements.length-2].focus(),_.preventDefault(),_.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;const _=document.getSelection();if(!_)return;if(_.isCollapsed)return void(this._rowContainer.contains(_.anchorNode)&&this._terminal.clearSelection());if(!_.anchorNode||!_.focusNode)return void console.error("anchorNode and/or focusNode are null");let S={node:_.anchorNode,offset:_.anchorOffset},k={node:_.focusNode,offset:_.focusOffset};if((S.node.compareDocumentPosition(k.node)&Node.DOCUMENT_POSITION_PRECEDING||S.node===k.node&&S.offset>k.offset)&&([S,k]=[k,S]),S.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(S={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(S.node))return;const L=this._rowElements.slice(-1)[0];if(k.node.compareDocumentPosition(L)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(k={node:L,offset:L.textContent?.length??0}),!this._rowContainer.contains(k.node))return;const R=({node:B,offset:q})=>{const F=B instanceof Text?B.parentNode:B;let W=parseInt(F?.getAttribute("aria-posinset"),10)-1;if(isNaN(W))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 Y=q<I.length?I[q]:I.slice(-1)[0]+1;return Y>=this._terminal.cols&&(++W,Y=0),{row:W,column:Y}},N=R(S),A=R(k);if(N&&A){if(N.row>A.row||N.row===A.row&&N.column>=A.column)throw new Error("invalid range");this._terminal.select(N.column,N.row,(A.row-N.row)*this._terminal.cols-N.column+A.column)}}_handleResize(_){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let S=this._rowContainer.children.length;S<this._terminal.rows;S++)this._rowElements[S]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[S]);for(;this._rowElements.length>_;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const _=this._coreBrowserService.mainDocument.createElement("div");return _.setAttribute("role","listitem"),_.tabIndex=-1,this._refreshRowDimensions(_),_}_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 _=0;_<this._terminal.rows;_++)this._refreshRowDimensions(this._rowElements[_])}}_refreshRowDimensions(_){_.style.height=`${this._renderService.dimensions.css.cell.height}px`}};c.AccessibilityManager=v=d([b(1,E.IInstantiationService),b(2,T.ICoreBrowserService),b(3,T.IRenderService)],v)},3614:(g,c)=>{function h(w){return w.replace(/\r?\n/g,"\r")}function d(w,x){return x?"\x1B[200~"+w+"\x1B[201~":w}function b(w,x,T,E){w=d(w=h(w),T.decPrivateModes.bracketedPasteMode&&E.rawOptions.ignoreBracketedPasteMode!==!0),T.triggerDataEvent(w,!0),x.value=""}function m(w,x,T){const E=T.getBoundingClientRect(),p=w.clientX-E.left-10,v=w.clientY-E.top-10;x.style.width="20px",x.style.height="20px",x.style.left=`${p}px`,x.style.top=`${v}px`,x.style.zIndex="1000",x.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=h,c.bracketTextForPaste=d,c.copyHandler=function(w,x){w.clipboardData&&w.clipboardData.setData("text/plain",x.selectionText),w.preventDefault()},c.handlePasteEvent=function(w,x,T,E){w.stopPropagation(),w.clipboardData&&b(w.clipboardData.getData("text/plain"),x,T,E)},c.paste=b,c.moveTextAreaUnderMouseCursor=m,c.rightClickHandler=function(w,x,T,E,p){m(w,x,T),p&&E.rightClickSelect(w),x.value=E.selectionText,x.select()}},7239:(g,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ColorContrastCache=void 0;const d=h(1505);c.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(b,m,w){this._css.set(b,m,w)}getCss(b,m){return this._css.get(b,m)}setColor(b,m,w){this._color.set(b,m,w)}getColor(b,m){return this._color.get(b,m)}clear(){this._color.clear(),this._css.clear()}}},3656:(g,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.addDisposableDomListener=void 0,c.addDisposableDomListener=function(h,d,b,m){h.addEventListener(d,b,m);let w=!1;return{dispose:()=>{w||(w=!0,h.removeEventListener(d,b,m))}}}},3551:function(g,c,h){var d=this&&this.__decorate||function(v,_,S,k){var L,R=arguments.length,N=R<3?_:k===null?k=Object.getOwnPropertyDescriptor(_,S):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(v,_,S,k);else for(var A=v.length-1;A>=0;A--)(L=v[A])&&(N=(R<3?L(N):R>3?L(_,S,N):L(_,S))||N);return R>3&&N&&Object.defineProperty(_,S,N),N},b=this&&this.__param||function(v,_){return function(S,k){_(S,k,v)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Linkifier=void 0;const m=h(3656),w=h(8460),x=h(844),T=h(2585),E=h(4725);let p=c.Linkifier=class extends x.Disposable{get currentLink(){return this._currentLink}constructor(v,_,S,k,L){super(),this._element=v,this._mouseService=_,this._renderService=S,this._bufferService=k,this._linkProviderService=L,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new w.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new w.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,x.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,x.toDisposable)((()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,m.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,m.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,m.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,m.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(v){this._lastMouseEvent=v;const _=this._positionFromMouseEvent(v,this._element,this._mouseService);if(!_)return;this._isMouseOut=!1;const S=v.composedPath();for(let k=0;k<S.length;k++){const L=S[k];if(L.classList.contains("xterm"))break;if(L.classList.contains("xterm-hover"))return}this._lastBufferCell&&_.x===this._lastBufferCell.x&&_.y===this._lastBufferCell.y||(this._handleHover(_),this._lastBufferCell=_)}_handleHover(v){if(this._activeLine!==v.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(v,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,v)||(this._clearCurrentLink(),this._askForLink(v,!0))}_askForLink(v,_){this._activeProviderReplies&&_||(this._activeProviderReplies?.forEach((k=>{k?.forEach((L=>{L.link.dispose&&L.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=v.y);let S=!1;for(const[k,L]of this._linkProviderService.linkProviders.entries())_?this._activeProviderReplies?.get(k)&&(S=this._checkLinkProviderResult(k,v,S)):L.provideLinks(v.y,(R=>{if(this._isMouseOut)return;const N=R?.map((A=>({link:A})));this._activeProviderReplies?.set(k,N),S=this._checkLinkProviderResult(k,v,S),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(v.y,this._activeProviderReplies)}))}_removeIntersectingLinks(v,_){const S=new Set;for(let k=0;k<_.size;k++){const L=_.get(k);if(L)for(let R=0;R<L.length;R++){const N=L[R],A=N.link.range.start.y<v?0:N.link.range.start.x,B=N.link.range.end.y>v?this._bufferService.cols:N.link.range.end.x;for(let q=A;q<=B;q++){if(S.has(q)){L.splice(R--,1);break}S.add(q)}}}}_checkLinkProviderResult(v,_,S){if(!this._activeProviderReplies)return S;const k=this._activeProviderReplies.get(v);let L=!1;for(let R=0;R<v;R++)this._activeProviderReplies.has(R)&&!this._activeProviderReplies.get(R)||(L=!0);if(!L&&k){const R=k.find((N=>this._linkAtPosition(N.link,_)));R&&(S=!0,this._handleNewLink(R))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!S)for(let R=0;R<this._activeProviderReplies.size;R++){const N=this._activeProviderReplies.get(R)?.find((A=>this._linkAtPosition(A.link,_)));if(N){S=!0,this._handleNewLink(N);break}}return S}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(v){if(!this._currentLink)return;const _=this._positionFromMouseEvent(v,this._element,this._mouseService);_&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,_)&&this._currentLink.link.activate(v,this._currentLink.link.text)}_clearCurrentLink(v,_){this._currentLink&&this._lastMouseEvent&&(!v||!_||this._currentLink.link.range.start.y>=v&&this._currentLink.link.range.end.y<=_)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,x.disposeArray)(this._linkCacheDisposables))}_handleNewLink(v){if(!this._lastMouseEvent)return;const _=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);_&&this._linkAtPosition(v.link,_)&&(this._currentLink=v,this._currentLink.state={decorations:{underline:v.link.decorations===void 0||v.link.decorations.underline,pointerCursor:v.link.decorations===void 0||v.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,v.link,this._lastMouseEvent),v.link.decorations={},Object.defineProperties(v.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:S=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==S&&(this._currentLink.state.decorations.pointerCursor=S,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",S))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:S=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==S&&(this._currentLink.state.decorations.underline=S,this._currentLink.state.isHovered&&this._fireUnderlineEvent(v.link,S))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((S=>{if(!this._currentLink)return;const k=S.start===0?0:S.start+1+this._bufferService.buffer.ydisp,L=this._bufferService.buffer.ydisp+1+S.end;if(this._currentLink.link.range.start.y>=k&&this._currentLink.link.range.end.y<=L&&(this._clearCurrentLink(k,L),this._lastMouseEvent)){const R=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);R&&this._askForLink(R,!1)}}))))}_linkHover(v,_,S){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(_,!0),this._currentLink.state.decorations.pointerCursor&&v.classList.add("xterm-cursor-pointer")),_.hover&&_.hover(S,_.text)}_fireUnderlineEvent(v,_){const S=v.range,k=this._bufferService.buffer.ydisp,L=this._createLinkUnderlineEvent(S.start.x-1,S.start.y-k-1,S.end.x,S.end.y-k-1,void 0);(_?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(L)}_linkLeave(v,_,S){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(_,!1),this._currentLink.state.decorations.pointerCursor&&v.classList.remove("xterm-cursor-pointer")),_.leave&&_.leave(S,_.text)}_linkAtPosition(v,_){const S=v.range.start.y*this._bufferService.cols+v.range.start.x,k=v.range.end.y*this._bufferService.cols+v.range.end.x,L=_.y*this._bufferService.cols+_.x;return S<=L&&L<=k}_positionFromMouseEvent(v,_,S){const k=S.getCoords(v,_,this._bufferService.cols,this._bufferService.rows);if(k)return{x:k[0],y:k[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(v,_,S,k,L){return{x1:v,y1:_,x2:S,y2:k,cols:this._bufferService.cols,fg:L}}};c.Linkifier=p=d([b(1,E.IMouseService),b(2,E.IRenderService),b(3,T.IBufferService),b(4,E.ILinkProviderService)],p)},9042:(g,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(g,c,h){var d=this&&this.__decorate||function(E,p,v,_){var S,k=arguments.length,L=k<3?p:_===null?_=Object.getOwnPropertyDescriptor(p,v):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(E,p,v,_);else for(var R=E.length-1;R>=0;R--)(S=E[R])&&(L=(k<3?S(L):k>3?S(p,v,L):S(p,v))||L);return k>3&&L&&Object.defineProperty(p,v,L),L},b=this&&this.__param||function(E,p){return function(v,_){p(v,_,E)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OscLinkProvider=void 0;const m=h(511),w=h(2585);let x=c.OscLinkProvider=class{constructor(E,p,v){this._bufferService=E,this._optionsService=p,this._oscLinkService=v}provideLinks(E,p){const v=this._bufferService.buffer.lines.get(E-1);if(!v)return void p(void 0);const _=[],S=this._optionsService.rawOptions.linkHandler,k=new m.CellData,L=v.getTrimmedLength();let R=-1,N=-1,A=!1;for(let B=0;B<L;B++)if(N!==-1||v.hasContent(B)){if(v.loadCell(B,k),k.hasExtendedAttrs()&&k.extended.urlId){if(N===-1){N=B,R=k.extended.urlId;continue}A=k.extended.urlId!==R}else N!==-1&&(A=!0);if(A||N!==-1&&B===L-1){const q=this._oscLinkService.getLinkData(R)?.uri;if(q){const F={start:{x:N+1,y:E},end:{x:B+(A||B!==L-1?0:1),y:E}};let W=!1;if(!S?.allowNonHttpProtocols)try{const I=new URL(q);["http:","https:"].includes(I.protocol)||(W=!0)}catch{W=!0}W||_.push({text:q,range:F,activate:(I,Y)=>S?S.activate(I,Y,F):T(0,Y),hover:(I,Y)=>S?.hover?.(I,Y,F),leave:(I,Y)=>S?.leave?.(I,Y,F)})}A=!1,k.hasExtendedAttrs()&&k.extended.urlId?(N=B,R=k.extended.urlId):(N=-1,R=-1)}}p(_)}};function T(E,p){if(confirm(`Do you want to navigate to ${p}?
|
|
77
|
+
|
|
78
|
+
WARNING: This link could potentially be dangerous`)){const v=window.open();if(v){try{v.opener=null}catch{}v.location.href=p}else console.warn("Opening link blocked as opener could not be cleared")}}c.OscLinkProvider=x=d([b(0,w.IBufferService),b(1,w.IOptionsService),b(2,w.IOscLinkService)],x)},6193:(g,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.RenderDebouncer=void 0,c.RenderDebouncer=class{constructor(h,d){this._renderCallback=h,this._coreBrowserService=d,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(h){return this._refreshCallbacks.push(h),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(h,d,b){this._rowCount=b,h=h!==void 0?h:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,h):h,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d,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 h=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(h,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const h of this._refreshCallbacks)h(0);this._refreshCallbacks=[]}}},3236:(g,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Terminal=void 0;const d=h(3614),b=h(3656),m=h(3551),w=h(9042),x=h(3730),T=h(1680),E=h(3107),p=h(5744),v=h(2950),_=h(1296),S=h(428),k=h(4269),L=h(5114),R=h(8934),N=h(3230),A=h(9312),B=h(4725),q=h(6731),F=h(8055),W=h(8969),I=h(8460),Y=h(844),V=h(6114),z=h(8437),G=h(2584),K=h(7399),j=h(5941),H=h(9074),D=h(2585),P=h(5435),Z=h(4567),ee=h(779);class J extends W.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(X={}){super(X),this.browser=V,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new Y.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(H.DecorationService),this._instantiationService.setService(D.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ee.LinkProviderService),this._instantiationService.setService(B.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(x.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows((($,ae)=>this.refresh($,ae)))),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,Y.toDisposable)((()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)})))}_handleColorEvent(X){if(this._themeService)for(const $ of X){let ae,de="";switch($.index){case 256:ae="foreground",de="10";break;case 257:ae="background",de="11";break;case 258:ae="cursor",de="12";break;default:ae="ansi",de="4;"+$.index}switch($.type){case 0:const we=F.color.toColorRGB(ae==="ansi"?this._themeService.colors.ansi[$.index]:this._themeService.colors[ae]);this.coreService.triggerDataEvent(`${G.C0.ESC}]${de};${(0,j.toRgbString)(we)}${G.C1_ESCAPED.ST}`);break;case 1:if(ae==="ansi")this._themeService.modifyColors((ye=>ye.ansi[$.index]=F.channels.toColor(...$.color)));else{const ye=ae;this._themeService.modifyColors((Ne=>Ne[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(X){X?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Z.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(X){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(G.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(G.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 X=this.buffer.ybase+this.buffer.y,$=this.buffer.lines.get(X);if(!$)return;const ae=Math.min(this.buffer.x,this.cols-1),de=this._renderService.dimensions.css.cell.height,we=$.getWidth(ae),ye=this._renderService.dimensions.css.cell.width*we,Ne=this.buffer.y*this._renderService.dimensions.css.cell.height,Oe=ae*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Oe+"px",this.textarea.style.top=Ne+"px",this.textarea.style.width=ye+"px",this.textarea.style.height=de+"px",this.textarea.style.lineHeight=de+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,b.addDisposableDomListener)(this.element,"copy",($=>{this.hasSelection()&&(0,d.copyHandler)($,this._selectionService)})));const X=$=>(0,d.handlePasteEvent)($,this.textarea,this.coreService,this.optionsService);this.register((0,b.addDisposableDomListener)(this.textarea,"paste",X)),this.register((0,b.addDisposableDomListener)(this.element,"paste",X)),V.isFirefox?this.register((0,b.addDisposableDomListener)(this.element,"mousedown",($=>{$.button===2&&(0,d.rightClickHandler)($,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,b.addDisposableDomListener)(this.element,"contextmenu",($=>{(0,d.rightClickHandler)($,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),V.isLinux&&this.register((0,b.addDisposableDomListener)(this.element,"auxclick",($=>{$.button===1&&(0,d.moveTextAreaUnderMouseCursor)($,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,b.addDisposableDomListener)(this.textarea,"keyup",(X=>this._keyUp(X)),!0)),this.register((0,b.addDisposableDomListener)(this.textarea,"keydown",(X=>this._keyDown(X)),!0)),this.register((0,b.addDisposableDomListener)(this.textarea,"keypress",(X=>this._keyPress(X)),!0)),this.register((0,b.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,b.addDisposableDomListener)(this.textarea,"compositionupdate",(X=>this._compositionHelper.compositionupdate(X)))),this.register((0,b.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,b.addDisposableDomListener)(this.textarea,"input",(X=>this._inputEvent(X)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(X){if(!X)throw new Error("Terminal requires a parent element.");if(X.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=X.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"),X.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",(ae=>this.updateCursorStyle(ae)))),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",w.promptLabel),V.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(L.CoreBrowserService,this.textarea,X.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",(ae=>this._handleTextAreaFocus(ae)))),this.register((0,b.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(S.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(B.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(q.ThemeService),this._instantiationService.setService(B.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(k.CharacterJoinerService),this._instantiationService.setService(B.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(N.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(B.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((ae=>this._onRender.fire(ae)))),this.onResize((ae=>this._renderService.resize(ae.cols,ae.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(v.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(R.MouseService),this._instantiationService.setService(B.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(m.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(T.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((ae=>this.scrollLines(ae.amount,ae.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(A.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(B.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((ae=>this.scrollLines(ae.amount,ae.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((ae=>this._renderService.handleSelectionChanged(ae.start,ae.end,ae.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((ae=>{this.textarea.value=ae,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((ae=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,b.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(E.BufferDecorationRenderer,this.screenElement)),this.register((0,b.addDisposableDomListener)(this.element,"mousedown",(ae=>this._selectionService.handleMouseDown(ae)))),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",(ae=>this._handleScreenReaderModeOptionChange(ae)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(p.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ae=>{!this._overviewRulerRenderer&&ae&&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(_.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const X=this,$=this.element;function ae(ye){const Ne=X._mouseService.getMouseReportCoords(ye,X.screenElement);if(!Ne)return!1;let Oe,Ge;switch(ye.overrideType||ye.type){case"mousemove":Ge=32,ye.buttons===void 0?(Oe=3,ye.button!==void 0&&(Oe=ye.button<3?ye.button:3)):Oe=1&ye.buttons?0:4&ye.buttons?1:2&ye.buttons?2:3;break;case"mouseup":Ge=0,Oe=ye.button<3?ye.button:3;break;case"mousedown":Ge=1,Oe=ye.button<3?ye.button:3;break;case"wheel":if(X._customWheelEventHandler&&X._customWheelEventHandler(ye)===!1||X.viewport.getLinesScrolled(ye)===0)return!1;Ge=ye.deltaY<0?0:1,Oe=4;break;default:return!1}return!(Ge===void 0||Oe===void 0||Oe>4)&&X.coreMouseService.triggerMouseEvent({col:Ne.col,row:Ne.row,x:Ne.x,y:Ne.y,button:Oe,action:Ge,ctrl:ye.ctrlKey,alt:ye.altKey,shift:ye.shiftKey})}const de={mouseup:null,wheel:null,mousedrag:null,mousemove:null},we={mouseup:ye=>(ae(ye),ye.buttons||(this._document.removeEventListener("mouseup",de.mouseup),de.mousedrag&&this._document.removeEventListener("mousemove",de.mousedrag)),this.cancel(ye)),wheel:ye=>(ae(ye),this.cancel(ye,!0)),mousedrag:ye=>{ye.buttons&&ae(ye)},mousemove:ye=>{ye.buttons||ae(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?de.mousemove||($.addEventListener("mousemove",we.mousemove),de.mousemove=we.mousemove):($.removeEventListener("mousemove",de.mousemove),de.mousemove=null),16&ye?de.wheel||($.addEventListener("wheel",we.wheel,{passive:!1}),de.wheel=we.wheel):($.removeEventListener("wheel",de.wheel),de.wheel=null),2&ye?de.mouseup||(de.mouseup=we.mouseup):(this._document.removeEventListener("mouseup",de.mouseup),de.mouseup=null),4&ye?de.mousedrag||(de.mousedrag=we.mousedrag):(this._document.removeEventListener("mousemove",de.mousedrag),de.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 ae(ye),de.mouseup&&this._document.addEventListener("mouseup",de.mouseup),de.mousedrag&&this._document.addEventListener("mousemove",de.mousedrag),this.cancel(ye)}))),this.register((0,b.addDisposableDomListener)($,"wheel",(ye=>{if(!de.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(ye)===!1)return!1;if(!this.buffer.hasScrollback){const Ne=this.viewport.getLinesScrolled(ye);if(Ne===0)return;const Oe=G.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(ye.deltaY<0?"A":"B");let Ge="";for(let vt=0;vt<Math.abs(Ne);vt++)Ge+=Oe;return this.coreService.triggerDataEvent(Ge,!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(X,$){this._renderService?.refreshRows(X,$)}updateCursorStyle(X){this._selectionService?.shouldColumnSelect(X)?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(X,$,ae=0){ae===1?(super.scrollLines(X,$,ae),this.refresh(0,this.rows-1)):this.viewport?.scrollLines(X)}paste(X){(0,d.paste)(X,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(X){this._customKeyEventHandler=X}attachCustomWheelEventHandler(X){this._customWheelEventHandler=X}registerLinkProvider(X){return this._linkProviderService.registerLinkProvider(X)}registerCharacterJoiner(X){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const $=this._characterJoinerService.register(X);return this.refresh(0,this.rows-1),$}deregisterCharacterJoiner(X){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(X)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(X){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+X)}registerDecoration(X){return this._decorationService.registerDecoration(X)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(X,$,ae){this._selectionService.setSelection(X,$,ae)}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(X,$){this._selectionService?.selectLines(X,$)}_keyDown(X){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1)return!1;const $=this.browser.isMac&&this.options.macOptionIsMeta&&X.altKey;if(!$&&!this._compositionHelper.keydown(X))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;$||X.key!=="Dead"&&X.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ae=(0,K.evaluateKeyboardEvent)(X,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(X),ae.type===3||ae.type===2){const de=this.rows-1;return this.scrollLines(ae.type===2?-de:de),this.cancel(X,!0)}return ae.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,X)||(ae.cancel&&this.cancel(X,!0),!ae.key||!!(X.key&&!X.ctrlKey&&!X.altKey&&!X.metaKey&&X.key.length===1&&X.key.charCodeAt(0)>=65&&X.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ae.key!==G.C0.ETX&&ae.key!==G.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ae.key,domEvent:X}),this._showCursor(),this.coreService.triggerDataEvent(ae.key,!0),!this.optionsService.rawOptions.screenReaderMode||X.altKey||X.ctrlKey?this.cancel(X,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(X,$){const ae=X.isMac&&!this.options.macOptionIsMeta&&$.altKey&&!$.ctrlKey&&!$.metaKey||X.isWindows&&$.altKey&&$.ctrlKey&&!$.metaKey||X.isWindows&&$.getModifierState("AltGraph");return $.type==="keypress"?ae:ae&&(!$.keyCode||$.keyCode>47)}_keyUp(X){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1||((function($){return $.keyCode===16||$.keyCode===17||$.keyCode===18})(X)||this.focus(),this.updateCursorStyle(X),this._keyPressHandled=!1)}_keyPress(X){let $;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1)return!1;if(this.cancel(X),X.charCode)$=X.charCode;else if(X.which===null||X.which===void 0)$=X.keyCode;else{if(X.which===0||X.charCode===0)return!1;$=X.which}return!(!$||(X.altKey||X.ctrlKey||X.metaKey)&&!this._isThirdLevelShift(this.browser,X)||($=String.fromCharCode($),this._onKey.fire({key:$,domEvent:X}),this._showCursor(),this.coreService.triggerDataEvent($,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(X){if(X.data&&X.inputType==="insertText"&&(!X.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const $=X.data;return this.coreService.triggerDataEvent($,!0),this.cancel(X),!0}return!1}resize(X,$){X!==this.cols||$!==this.rows?super.resize(X,$):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(X,$){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 X=1;X<this.rows;X++)this.buffer.lines.push(this.buffer.getBlankLine(z.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 X=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this.viewport?.reset(),this._customKeyEventHandler=X,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(G.C0.ESC+"[I"):this.coreService.triggerDataEvent(G.C0.ESC+"[O")}_reportWindowsOptions(X){if(this._renderService)switch(X){case P.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const $=this._renderService.dimensions.css.canvas.width.toFixed(0),ae=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${G.C0.ESC}[4;${ae};${$}t`);break;case P.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const de=this._renderService.dimensions.css.cell.width.toFixed(0),we=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${G.C0.ESC}[6;${we};${de}t`)}}cancel(X,$){if(this.options.cancelEvents||$)return X.preventDefault(),X.stopPropagation(),!1}}c.Terminal=J},9924:(g,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.TimeBasedDebouncer=void 0,c.TimeBasedDebouncer=class{constructor(h,d=1e3){this._renderCallback=h,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(h,d,b){this._rowCount=b,h=h!==void 0?h:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,h):h,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d;const m=Date.now();if(m-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=m,this._innerRefresh();else if(!this._additionalRefreshRequested){const w=m-this._lastRefreshMs,x=this._debounceThresholdMS-w;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),x)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const h=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(h,d)}}},1680:function(g,c,h){var d=this&&this.__decorate||function(v,_,S,k){var L,R=arguments.length,N=R<3?_:k===null?k=Object.getOwnPropertyDescriptor(_,S):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(v,_,S,k);else for(var A=v.length-1;A>=0;A--)(L=v[A])&&(N=(R<3?L(N):R>3?L(_,S,N):L(_,S))||N);return R>3&&N&&Object.defineProperty(_,S,N),N},b=this&&this.__param||function(v,_){return function(S,k){_(S,k,v)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Viewport=void 0;const m=h(3656),w=h(4725),x=h(8460),T=h(844),E=h(2585);let p=c.Viewport=class extends T.Disposable{constructor(v,_,S,k,L,R,N,A){super(),this._viewportElement=v,this._scrollArea=_,this._bufferService=S,this._optionsService=k,this._charSizeService=L,this._renderService=R,this._coreBrowserService=N,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 x.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,m.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(A.colors),this.register(A.onChangeColors((B=>this._handleThemeChange(B)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(v){this._viewportElement.style.backgroundColor=v.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(v){if(v)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const _=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==_&&(this._lastRecordedBufferHeight=_,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const v=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==v&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=v),this._refreshAnimationFrame=null}syncScrollArea(v=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(v);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(v)}_handleScroll(v){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const _=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:_,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const v=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(v*(this._smoothScrollState.target-this._smoothScrollState.origin)),v<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(v,_){const S=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(_<0&&this._viewportElement.scrollTop!==0||_>0&&S<this._lastRecordedBufferHeight)||(v.cancelable&&v.preventDefault(),!1)}handleWheel(v){const _=this._getPixelsScrolled(v);return _!==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+_:this._smoothScrollState.target+=_,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=_,this._bubbleScroll(v,_))}scrollLines(v){if(v!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const _=v*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+_,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:v,suppressScrollEvent:!1})}_getPixelsScrolled(v){if(v.deltaY===0||v.shiftKey)return 0;let _=this._applyScrollModifier(v.deltaY,v);return v.deltaMode===WheelEvent.DOM_DELTA_LINE?_*=this._currentRowHeight:v.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(_*=this._currentRowHeight*this._bufferService.rows),_}getBufferElements(v,_){let S,k="";const L=[],R=_??this._bufferService.buffer.lines.length,N=this._bufferService.buffer.lines;for(let A=v;A<R;A++){const B=N.get(A);if(!B)continue;const q=N.get(A+1)?.isWrapped;if(k+=B.translateToString(!q),!q||A===N.length-1){const F=document.createElement("div");F.textContent=k,L.push(F),k.length>0&&(S=F),k=""}}return{bufferElements:L,cursorElement:S}}getLinesScrolled(v){if(v.deltaY===0||v.shiftKey)return 0;let _=this._applyScrollModifier(v.deltaY,v);return v.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(_/=this._currentRowHeight+0,this._wheelPartialScroll+=_,_=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):v.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(_*=this._bufferService.rows),_}_applyScrollModifier(v,_){const S=this._optionsService.rawOptions.fastScrollModifier;return S==="alt"&&_.altKey||S==="ctrl"&&_.ctrlKey||S==="shift"&&_.shiftKey?v*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:v*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(v){this._lastTouchY=v.touches[0].pageY}handleTouchMove(v){const _=this._lastTouchY-v.touches[0].pageY;return this._lastTouchY=v.touches[0].pageY,_!==0&&(this._viewportElement.scrollTop+=_,this._bubbleScroll(v,_))}};c.Viewport=p=d([b(2,E.IBufferService),b(3,E.IOptionsService),b(4,w.ICharSizeService),b(5,w.IRenderService),b(6,w.ICoreBrowserService),b(7,w.IThemeService)],p)},3107:function(g,c,h){var d=this&&this.__decorate||function(E,p,v,_){var S,k=arguments.length,L=k<3?p:_===null?_=Object.getOwnPropertyDescriptor(p,v):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(E,p,v,_);else for(var R=E.length-1;R>=0;R--)(S=E[R])&&(L=(k<3?S(L):k>3?S(p,v,L):S(p,v))||L);return k>3&&L&&Object.defineProperty(p,v,L),L},b=this&&this.__param||function(E,p){return function(v,_){p(v,_,E)}};Object.defineProperty(c,"__esModule",{value:!0}),c.BufferDecorationRenderer=void 0;const m=h(4725),w=h(844),x=h(2585);let T=c.BufferDecorationRenderer=class extends w.Disposable{constructor(E,p,v,_,S){super(),this._screenElement=E,this._bufferService=p,this._coreBrowserService=v,this._decorationService=_,this._renderService=S,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((k=>this._removeDecoration(k)))),this.register((0,w.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 E of this._decorationService.decorations)this._renderDecoration(E);this._dimensionsChanged=!1}_renderDecoration(E){this._refreshStyle(E),this._dimensionsChanged&&this._refreshXPosition(E)}_createElement(E){const p=this._coreBrowserService.mainDocument.createElement("div");p.classList.add("xterm-decoration"),p.classList.toggle("xterm-decoration-top-layer",E?.options?.layer==="top"),p.style.width=`${Math.round((E.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,p.style.height=(E.options.height||1)*this._renderService.dimensions.css.cell.height+"px",p.style.top=(E.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 v=E.options.x??0;return v&&v>this._bufferService.cols&&(p.style.display="none"),this._refreshXPosition(E,p),p}_refreshStyle(E){const p=E.marker.line-this._bufferService.buffers.active.ydisp;if(p<0||p>=this._bufferService.rows)E.element&&(E.element.style.display="none",E.onRenderEmitter.fire(E.element));else{let v=this._decorationElements.get(E);v||(v=this._createElement(E),E.element=v,this._decorationElements.set(E,v),this._container.appendChild(v),E.onDispose((()=>{this._decorationElements.delete(E),v.remove()}))),v.style.top=p*this._renderService.dimensions.css.cell.height+"px",v.style.display=this._altBufferIsActive?"none":"block",E.onRenderEmitter.fire(v)}}_refreshXPosition(E,p=E.element){if(!p)return;const v=E.options.x??0;(E.options.anchor||"left")==="right"?p.style.right=v?v*this._renderService.dimensions.css.cell.width+"px":"":p.style.left=v?v*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(E){this._decorationElements.get(E)?.remove(),this._decorationElements.delete(E),E.dispose()}};c.BufferDecorationRenderer=T=d([b(1,x.IBufferService),b(2,m.ICoreBrowserService),b(3,x.IDecorationService),b(4,m.IRenderService)],T)},5871:(g,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(h){if(h.options.overviewRulerOptions){for(const d of this._zones)if(d.color===h.options.overviewRulerOptions.color&&d.position===h.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,h.marker.line))return;if(this._lineAdjacentToZone(d,h.marker.line,h.options.overviewRulerOptions.position))return void this._addLineToZone(d,h.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=h.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=h.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=h.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=h.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:h.options.overviewRulerOptions.color,position:h.options.overviewRulerOptions.position,startBufferLine:h.marker.line,endBufferLine:h.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(h){this._linePadding=h}_lineIntersectsZone(h,d){return d>=h.startBufferLine&&d<=h.endBufferLine}_lineAdjacentToZone(h,d,b){return d>=h.startBufferLine-this._linePadding[b||"full"]&&d<=h.endBufferLine+this._linePadding[b||"full"]}_addLineToZone(h,d){h.startBufferLine=Math.min(h.startBufferLine,d),h.endBufferLine=Math.max(h.endBufferLine,d)}}},5744:function(g,c,h){var d=this&&this.__decorate||function(S,k,L,R){var N,A=arguments.length,B=A<3?k:R===null?R=Object.getOwnPropertyDescriptor(k,L):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(S,k,L,R);else for(var q=S.length-1;q>=0;q--)(N=S[q])&&(B=(A<3?N(B):A>3?N(k,L,B):N(k,L))||B);return A>3&&B&&Object.defineProperty(k,L,B),B},b=this&&this.__param||function(S,k){return function(L,R){k(L,R,S)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OverviewRulerRenderer=void 0;const m=h(5871),w=h(4725),x=h(844),T=h(2585),E={full:0,left:0,center:0,right:0},p={full:0,left:0,center:0,right:0},v={full:0,left:0,center:0,right:0};let _=c.OverviewRulerRenderer=class extends x.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(S,k,L,R,N,A,B){super(),this._viewportElement=S,this._screenElement=k,this._bufferService=L,this._decorationService=R,this._renderService=N,this._optionsService=A,this._coreBrowserService=B,this._colorZoneStore=new m.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 q=this._canvas.getContext("2d");if(!q)throw new Error("Ctx cannot be null");this._ctx=q,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,x.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 S=Math.floor(this._canvas.width/3),k=Math.ceil(this._canvas.width/3);p.full=this._canvas.width,p.left=S,p.center=k,p.right=S,this._refreshDrawHeightConstants(),v.full=0,v.left=0,v.center=p.left,v.right=p.left+p.center}_refreshDrawHeightConstants(){E.full=Math.round(2*this._coreBrowserService.dpr);const S=this._canvas.height/this._bufferService.buffer.lines.length,k=Math.round(Math.max(Math.min(S,12),6)*this._coreBrowserService.dpr);E.left=k,E.center=k,E.right=k}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*E.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*E.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*E.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*E.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 k of this._decorationService.decorations)this._colorZoneStore.addDecoration(k);this._ctx.lineWidth=1;const S=this._colorZoneStore.zones;for(const k of S)k.position!=="full"&&this._renderColorZone(k);for(const k of S)k.position==="full"&&this._renderColorZone(k);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(S){this._ctx.fillStyle=S.color,this._ctx.fillRect(v[S.position||"full"],Math.round((this._canvas.height-1)*(S.startBufferLine/this._bufferService.buffers.active.lines.length)-E[S.position||"full"]/2),p[S.position||"full"],Math.round((this._canvas.height-1)*((S.endBufferLine-S.startBufferLine)/this._bufferService.buffers.active.lines.length)+E[S.position||"full"]))}_queueRefresh(S,k){this._shouldUpdateDimensions=S||this._shouldUpdateDimensions,this._shouldUpdateAnchor=k||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};c.OverviewRulerRenderer=_=d([b(2,T.IBufferService),b(3,T.IDecorationService),b(4,w.IRenderService),b(5,T.IOptionsService),b(6,w.ICoreBrowserService)],_)},2950:function(g,c,h){var d=this&&this.__decorate||function(E,p,v,_){var S,k=arguments.length,L=k<3?p:_===null?_=Object.getOwnPropertyDescriptor(p,v):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(E,p,v,_);else for(var R=E.length-1;R>=0;R--)(S=E[R])&&(L=(k<3?S(L):k>3?S(p,v,L):S(p,v))||L);return k>3&&L&&Object.defineProperty(p,v,L),L},b=this&&this.__param||function(E,p){return function(v,_){p(v,_,E)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CompositionHelper=void 0;const m=h(4725),w=h(2585),x=h(2584);let T=c.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(E,p,v,_,S,k){this._textarea=E,this._compositionView=p,this._bufferService=v,this._optionsService=_,this._coreService=S,this._renderService=k,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(E){this._compositionView.textContent=E.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(E){if(this._isComposing||this._isSendingComposition){if(E.keyCode===229||E.keyCode===16||E.keyCode===17||E.keyCode===18)return!1;this._finalizeComposition(!1)}return E.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(E){if(this._compositionView.classList.remove("active"),this._isComposing=!1,E){const p={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let v;this._isSendingComposition=!1,p.start+=this._dataAlreadySent.length,v=this._isComposing?this._textarea.value.substring(p.start,p.end):this._textarea.value.substring(p.start),v.length>0&&this._coreService.triggerDataEvent(v,!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 E=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const p=this._textarea.value,v=p.replace(E,"");this._dataAlreadySent=v,p.length>E.length?this._coreService.triggerDataEvent(v,!0):p.length<E.length?this._coreService.triggerDataEvent(`${x.C0.DEL}`,!0):p.length===E.length&&p!==E&&this._coreService.triggerDataEvent(p,!0)}}),0)}updateCompositionElements(E){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const p=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),v=this._renderService.dimensions.css.cell.height,_=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,S=p*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=S+"px",this._compositionView.style.top=_+"px",this._compositionView.style.height=v+"px",this._compositionView.style.lineHeight=v+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const k=this._compositionView.getBoundingClientRect();this._textarea.style.left=S+"px",this._textarea.style.top=_+"px",this._textarea.style.width=Math.max(k.width,1)+"px",this._textarea.style.height=Math.max(k.height,1)+"px",this._textarea.style.lineHeight=k.height+"px"}E||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};c.CompositionHelper=T=d([b(2,w.IBufferService),b(3,w.IOptionsService),b(4,w.ICoreService),b(5,m.IRenderService)],T)},9806:(g,c)=>{function h(d,b,m){const w=m.getBoundingClientRect(),x=d.getComputedStyle(m),T=parseInt(x.getPropertyValue("padding-left")),E=parseInt(x.getPropertyValue("padding-top"));return[b.clientX-w.left-T,b.clientY-w.top-E]}Object.defineProperty(c,"__esModule",{value:!0}),c.getCoords=c.getCoordsRelativeToElement=void 0,c.getCoordsRelativeToElement=h,c.getCoords=function(d,b,m,w,x,T,E,p,v){if(!T)return;const _=h(d,b,m);return _?(_[0]=Math.ceil((_[0]+(v?E/2:0))/E),_[1]=Math.ceil(_[1]/p),_[0]=Math.min(Math.max(_[0],1),w+(v?1:0)),_[1]=Math.min(Math.max(_[1],1),x),_):void 0}},9504:(g,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.moveToCellSequence=void 0;const d=h(2584);function b(p,v,_,S){const k=p-m(p,_),L=v-m(v,_),R=Math.abs(k-L)-(function(N,A,B){let q=0;const F=N-m(N,B),W=A-m(A,B);for(let I=0;I<Math.abs(F-W);I++){const Y=w(N,A)==="A"?-1:1;B.buffer.lines.get(F+Y*I)?.isWrapped&&q++}return q})(p,v,_);return E(R,T(w(p,v),S))}function m(p,v){let _=0,S=v.buffer.lines.get(p),k=S?.isWrapped;for(;k&&p>=0&&p<v.rows;)_++,S=v.buffer.lines.get(--p),k=S?.isWrapped;return _}function w(p,v){return p>v?"A":"B"}function x(p,v,_,S,k,L){let R=p,N=v,A="";for(;R!==_||N!==S;)R+=k?1:-1,k&&R>L.cols-1?(A+=L.buffer.translateBufferLineToString(N,!1,p,R),R=0,p=0,N++):!k&&R<0&&(A+=L.buffer.translateBufferLineToString(N,!1,0,p+1),R=L.cols-1,p=R,N--);return A+L.buffer.translateBufferLineToString(N,!1,p,R)}function T(p,v){const _=v?"O":"[";return d.C0.ESC+_+p}function E(p,v){p=Math.floor(p);let _="";for(let S=0;S<p;S++)_+=v;return _}c.moveToCellSequence=function(p,v,_,S){const k=_.buffer.x,L=_.buffer.y;if(!_.buffer.hasScrollback)return(function(A,B,q,F,W,I){return b(B,F,W,I).length===0?"":E(x(A,B,A,B-m(B,W),!1,W).length,T("D",I))})(k,L,0,v,_,S)+b(L,v,_,S)+(function(A,B,q,F,W,I){let Y;Y=b(B,F,W,I).length>0?F-m(F,W):B;const V=F,z=(function(G,K,j,H,D,P){let Z;return Z=b(j,H,D,P).length>0?H-m(H,D):K,G<j&&Z<=H||G>=j&&Z<H?"C":"D"})(A,B,q,F,W,I);return E(x(A,Y,q,V,z==="C",W).length,T(z,I))})(k,L,p,v,_,S);let R;if(L===v)return R=k>p?"D":"C",E(Math.abs(k-p),T(R,S));R=L>v?"D":"C";const N=Math.abs(L-v);return E((function(A,B){return B.cols-A})(L>v?p:k,_)+(N-1)*_.cols+1+((L>v?k:p)-1),T(R,S))}},1296:function(g,c,h){var d=this&&this.__decorate||function(I,Y,V,z){var G,K=arguments.length,j=K<3?Y:z===null?z=Object.getOwnPropertyDescriptor(Y,V):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(I,Y,V,z);else for(var H=I.length-1;H>=0;H--)(G=I[H])&&(j=(K<3?G(j):K>3?G(Y,V,j):G(Y,V))||j);return K>3&&j&&Object.defineProperty(Y,V,j),j},b=this&&this.__param||function(I,Y){return function(V,z){Y(V,z,I)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRenderer=void 0;const m=h(3787),w=h(2550),x=h(2223),T=h(6171),E=h(6052),p=h(4725),v=h(8055),_=h(8460),S=h(844),k=h(2585),L="xterm-dom-renderer-owner-",R="xterm-rows",N="xterm-fg-",A="xterm-bg-",B="xterm-focus",q="xterm-selection";let F=1,W=c.DomRenderer=class extends S.Disposable{constructor(I,Y,V,z,G,K,j,H,D,P,Z,ee,J){super(),this._terminal=I,this._document=Y,this._element=V,this._screenElement=z,this._viewportElement=G,this._helperContainer=K,this._linkifier2=j,this._charSizeService=D,this._optionsService=P,this._bufferService=Z,this._coreBrowserService=ee,this._themeService=J,this._terminalClass=F++,this._rowElements=[],this._selectionRenderModel=(0,E.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new _.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(R),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(q),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,T.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((se=>this._injectCss(se)))),this._injectCss(this._themeService.colors),this._rowFactory=H.createInstance(m.DomRendererRowFactory,document),this._element.classList.add(L+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((se=>this._handleLinkHover(se)))),this.register(this._linkifier2.onHideLinkUnderline((se=>this._handleLinkLeave(se)))),this.register((0,S.toDisposable)((()=>{this._element.classList.remove(L+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new w.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 V of this._rowElements)V.style.width=`${this.dimensions.css.canvas.width}px`,V.style.height=`${this.dimensions.css.cell.height}px`,V.style.lineHeight=`${this.dimensions.css.cell.height}px`,V.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const Y=`${this._terminalSelector} .${R} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=Y,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 Y=`${this._terminalSelector} .${R} { color: ${I.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;Y+=`${this._terminalSelector} .${R} .xterm-dim { color: ${v.color.multiplyOpacity(I.foreground,.5).css};}`,Y+=`${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 V=`blink_underline_${this._terminalClass}`,z=`blink_bar_${this._terminalClass}`,G=`blink_block_${this._terminalClass}`;Y+=`@keyframes ${V} { 50% { border-bottom-style: hidden; }}`,Y+=`@keyframes ${z} { 50% { box-shadow: none; }}`,Y+=`@keyframes ${G} { 0% { background-color: ${I.cursor.css}; color: ${I.cursorAccent.css}; } 50% { background-color: inherit; color: ${I.cursor.css}; }}`,Y+=`${this._terminalSelector} .${R}.${B} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${V} 1s step-end infinite;}${this._terminalSelector} .${R}.${B} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${z} 1s step-end infinite;}${this._terminalSelector} .${R}.${B} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${G} 1s step-end infinite;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block { background-color: ${I.cursor.css}; color: ${I.cursorAccent.css};}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${I.cursor.css} !important; color: ${I.cursorAccent.css} !important;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${I.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${I.cursor.css} inset;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${I.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,Y+=`${this._terminalSelector} .${q} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${q} div { position: absolute; background-color: ${I.selectionBackgroundOpaque.css};}${this._terminalSelector} .${q} div { position: absolute; background-color: ${I.selectionInactiveBackgroundOpaque.css};}`;for(const[K,j]of I.ansi.entries())Y+=`${this._terminalSelector} .${N}${K} { color: ${j.css}; }${this._terminalSelector} .${N}${K}.xterm-dim { color: ${v.color.multiplyOpacity(j,.5).css}; }${this._terminalSelector} .${A}${K} { background-color: ${j.css}; }`;Y+=`${this._terminalSelector} .${N}${x.INVERTED_DEFAULT_COLOR} { color: ${v.color.opaque(I.background).css}; }${this._terminalSelector} .${N}${x.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${v.color.multiplyOpacity(v.color.opaque(I.background),.5).css}; }${this._terminalSelector} .${A}${x.INVERTED_DEFAULT_COLOR} { background-color: ${I.foreground.css}; }`,this._themeStyleElement.textContent=Y}_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,Y){for(let V=this._rowElements.length;V<=Y;V++){const z=this._document.createElement("div");this._rowContainer.appendChild(z),this._rowElements.push(z)}for(;this._rowElements.length>Y;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(I,Y){this._refreshRowElements(I,Y),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,Y,V){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(I,Y,V),this.renderRows(0,this._bufferService.rows-1),!I||!Y)return;this._selectionRenderModel.update(this._terminal,I,Y,V);const z=this._selectionRenderModel.viewportStartRow,G=this._selectionRenderModel.viewportEndRow,K=this._selectionRenderModel.viewportCappedStartRow,j=this._selectionRenderModel.viewportCappedEndRow;if(K>=this._bufferService.rows||j<0)return;const H=this._document.createDocumentFragment();if(V){const D=I[0]>Y[0];H.appendChild(this._createSelectionElement(K,D?Y[0]:I[0],D?I[0]:Y[0],j-K+1))}else{const D=z===K?I[0]:0,P=K===G?Y[0]:this._bufferService.cols;H.appendChild(this._createSelectionElement(K,D,P));const Z=j-K-1;if(H.appendChild(this._createSelectionElement(K+1,0,this._bufferService.cols,Z)),K!==j){const ee=G===j?Y[0]:this._bufferService.cols;H.appendChild(this._createSelectionElement(j,0,ee))}}this._selectionContainer.appendChild(H)}_createSelectionElement(I,Y,V,z=1){const G=this._document.createElement("div"),K=Y*this.dimensions.css.cell.width;let j=this.dimensions.css.cell.width*(V-Y);return K+j>this.dimensions.css.canvas.width&&(j=this.dimensions.css.canvas.width-K),G.style.height=z*this.dimensions.css.cell.height+"px",G.style.top=I*this.dimensions.css.cell.height+"px",G.style.left=`${K}px`,G.style.width=`${j}px`,G}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,Y){const V=this._bufferService.buffer,z=V.ybase+V.y,G=Math.min(V.x,this._bufferService.cols-1),K=this._optionsService.rawOptions.cursorBlink,j=this._optionsService.rawOptions.cursorStyle,H=this._optionsService.rawOptions.cursorInactiveStyle;for(let D=I;D<=Y;D++){const P=D+V.ydisp,Z=this._rowElements[D],ee=V.lines.get(P);if(!Z||!ee)break;Z.replaceChildren(...this._rowFactory.createRow(ee,P,P===z,j,H,G,K,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${L}${this._terminalClass}`}_handleLinkHover(I){this._setCellUnderline(I.x1,I.x2,I.y1,I.y2,I.cols,!0)}_handleLinkLeave(I){this._setCellUnderline(I.x1,I.x2,I.y1,I.y2,I.cols,!1)}_setCellUnderline(I,Y,V,z,G,K){V<0&&(I=0),z<0&&(Y=0);const j=this._bufferService.rows-1;V=Math.max(Math.min(V,j),0),z=Math.max(Math.min(z,j),0),G=Math.min(G,this._bufferService.cols);const H=this._bufferService.buffer,D=H.ybase+H.y,P=Math.min(H.x,G-1),Z=this._optionsService.rawOptions.cursorBlink,ee=this._optionsService.rawOptions.cursorStyle,J=this._optionsService.rawOptions.cursorInactiveStyle;for(let se=V;se<=z;++se){const X=se+H.ydisp,$=this._rowElements[se],ae=H.lines.get(X);if(!$||!ae)break;$.replaceChildren(...this._rowFactory.createRow(ae,X,X===D,ee,J,P,Z,this.dimensions.css.cell.width,this._widthCache,K?se===V?I:0:-1,K?(se===z?Y:G)-1:-1))}}};c.DomRenderer=W=d([b(7,k.IInstantiationService),b(8,p.ICharSizeService),b(9,k.IOptionsService),b(10,k.IBufferService),b(11,p.ICoreBrowserService),b(12,p.IThemeService)],W)},3787:function(g,c,h){var d=this&&this.__decorate||function(R,N,A,B){var q,F=arguments.length,W=F<3?N:B===null?B=Object.getOwnPropertyDescriptor(N,A):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")W=Reflect.decorate(R,N,A,B);else for(var I=R.length-1;I>=0;I--)(q=R[I])&&(W=(F<3?q(W):F>3?q(N,A,W):q(N,A))||W);return F>3&&W&&Object.defineProperty(N,A,W),W},b=this&&this.__param||function(R,N){return function(A,B){N(A,B,R)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRendererRowFactory=void 0;const m=h(2223),w=h(643),x=h(511),T=h(2585),E=h(8055),p=h(4725),v=h(4269),_=h(6171),S=h(3734);let k=c.DomRendererRowFactory=class{constructor(R,N,A,B,q,F,W){this._document=R,this._characterJoinerService=N,this._optionsService=A,this._coreBrowserService=B,this._coreService=q,this._decorationService=F,this._themeService=W,this._workCell=new x.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(R,N,A){this._selectionStart=R,this._selectionEnd=N,this._columnSelectMode=A}createRow(R,N,A,B,q,F,W,I,Y,V,z){const G=[],K=this._characterJoinerService.getJoinedCharacters(N),j=this._themeService.colors;let H,D=R.getNoBgTrimmedLength();A&&D<F+1&&(D=F+1);let P=0,Z="",ee=0,J=0,se=0,X=!1,$=0,ae=!1,de=0;const we=[],ye=V!==-1&&z!==-1;for(let Ne=0;Ne<D;Ne++){R.loadCell(Ne,this._workCell);let Oe=this._workCell.getWidth();if(Oe===0)continue;let Ge=!1,vt=Ne,Le=this._workCell;if(K.length>0&&Ne===K[0][0]){Ge=!0;const dt=K.shift();Le=new v.JoinedCellData(this._workCell,R.translateToString(!0,dt[0],dt[1]),dt[1]-dt[0]),vt=dt[1]-1,Oe=Le.getWidth()}const Rt=this._isCellInSelection(Ne,N),Xt=A&&Ne===F,vn=ye&&Ne>=V&&Ne<=z;let on=!1;this._decorationService.forEachDecorationAtCell(Ne,N,void 0,(dt=>{on=!0}));let kn=Le.getChars()||w.WHITESPACE_CELL_CHAR;if(kn===" "&&(Le.isUnderline()||Le.isOverline())&&(kn=" "),de=Oe*I-Y.get(kn,Le.isBold(),Le.isItalic()),H){if(P&&(Rt&&ae||!Rt&&!ae&&Le.bg===ee)&&(Rt&&ae&&j.selectionForeground||Le.fg===J)&&Le.extended.ext===se&&vn===X&&de===$&&!Xt&&!Ge&&!on){Le.isInvisible()?Z+=w.WHITESPACE_CELL_CHAR:Z+=kn,P++;continue}P&&(H.textContent=Z),H=this._document.createElement("span"),P=0,Z=""}else H=this._document.createElement("span");if(ee=Le.bg,J=Le.fg,se=Le.extended.ext,X=vn,$=de,ae=Rt,Ge&&F>=Ne&&F<=vt&&(F=Ne),!this._coreService.isCursorHidden&&Xt&&this._coreService.isCursorInitialized){if(we.push("xterm-cursor"),this._coreBrowserService.isFocused)W&&we.push("xterm-cursor-blink"),we.push(B==="bar"?"xterm-cursor-bar":B==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(q)switch(q){case"outline":we.push("xterm-cursor-outline");break;case"block":we.push("xterm-cursor-block");break;case"bar":we.push("xterm-cursor-bar");break;case"underline":we.push("xterm-cursor-underline")}}if(Le.isBold()&&we.push("xterm-bold"),Le.isItalic()&&we.push("xterm-italic"),Le.isDim()&&we.push("xterm-dim"),Z=Le.isInvisible()?w.WHITESPACE_CELL_CHAR:Le.getChars()||w.WHITESPACE_CELL_CHAR,Le.isUnderline()&&(we.push(`xterm-underline-${Le.extended.underlineStyle}`),Z===" "&&(Z=" "),!Le.isUnderlineColorDefault()))if(Le.isUnderlineColorRGB())H.style.textDecorationColor=`rgb(${S.AttributeData.toColorRGB(Le.getUnderlineColor()).join(",")})`;else{let dt=Le.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Le.isBold()&&dt<8&&(dt+=8),H.style.textDecorationColor=j.ansi[dt].css}Le.isOverline()&&(we.push("xterm-overline"),Z===" "&&(Z=" ")),Le.isStrikethrough()&&we.push("xterm-strikethrough"),vn&&(H.style.textDecoration="underline");let Zt=Le.getFgColor(),ut=Le.getFgColorMode(),Lt=Le.getBgColor(),Ct=Le.getBgColorMode();const Ft=!!Le.isInverse();if(Ft){const dt=Zt;Zt=Lt,Lt=dt;const Tn=ut;ut=Ct,Ct=Tn}let Kt,Jn,bn,Pn=!1;switch(this._decorationService.forEachDecorationAtCell(Ne,N,void 0,(dt=>{dt.options.layer!=="top"&&Pn||(dt.backgroundColorRGB&&(Ct=50331648,Lt=dt.backgroundColorRGB.rgba>>8&16777215,Kt=dt.backgroundColorRGB),dt.foregroundColorRGB&&(ut=50331648,Zt=dt.foregroundColorRGB.rgba>>8&16777215,Jn=dt.foregroundColorRGB),Pn=dt.options.layer==="top")})),!Pn&&Rt&&(Kt=this._coreBrowserService.isFocused?j.selectionBackgroundOpaque:j.selectionInactiveBackgroundOpaque,Lt=Kt.rgba>>8&16777215,Ct=50331648,Pn=!0,j.selectionForeground&&(ut=50331648,Zt=j.selectionForeground.rgba>>8&16777215,Jn=j.selectionForeground)),Pn&&we.push("xterm-decoration-top"),Ct){case 16777216:case 33554432:bn=j.ansi[Lt],we.push(`xterm-bg-${Lt}`);break;case 50331648:bn=E.channels.toColor(Lt>>16,Lt>>8&255,255&Lt),this._addStyle(H,`background-color:#${L((Lt>>>0).toString(16),"0",6)}`);break;default:Ft?(bn=j.foreground,we.push(`xterm-bg-${m.INVERTED_DEFAULT_COLOR}`)):bn=j.background}switch(Kt||Le.isDim()&&(Kt=E.color.multiplyOpacity(bn,.5)),ut){case 16777216:case 33554432:Le.isBold()&&Zt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Zt+=8),this._applyMinimumContrast(H,bn,j.ansi[Zt],Le,Kt,void 0)||we.push(`xterm-fg-${Zt}`);break;case 50331648:const dt=E.channels.toColor(Zt>>16&255,Zt>>8&255,255&Zt);this._applyMinimumContrast(H,bn,dt,Le,Kt,Jn)||this._addStyle(H,`color:#${L(Zt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(H,bn,j.foreground,Le,Kt,Jn)||Ft&&we.push(`xterm-fg-${m.INVERTED_DEFAULT_COLOR}`)}we.length&&(H.className=we.join(" "),we.length=0),Xt||Ge||on?H.textContent=Z:P++,de!==this.defaultSpacing&&(H.style.letterSpacing=`${de}px`),G.push(H),Ne=vt}return H&&P&&(H.textContent=Z),G}_applyMinimumContrast(R,N,A,B,q,F){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,_.treatGlyphAsBackgroundColor)(B.getCode()))return!1;const W=this._getContrastCache(B);let I;if(q||F||(I=W.getColor(N.rgba,A.rgba)),I===void 0){const Y=this._optionsService.rawOptions.minimumContrastRatio/(B.isDim()?2:1);I=E.color.ensureContrastRatio(q||N,F||A,Y),W.setColor((q||N).rgba,(F||A).rgba,I??null)}return!!I&&(this._addStyle(R,`color:${I.css}`),!0)}_getContrastCache(R){return R.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(R,N){R.setAttribute("style",`${R.getAttribute("style")||""}${N};`)}_isCellInSelection(R,N){const A=this._selectionStart,B=this._selectionEnd;return!(!A||!B)&&(this._columnSelectMode?A[0]<=B[0]?R>=A[0]&&N>=A[1]&&R<B[0]&&N<=B[1]:R<A[0]&&N>=A[1]&&R>=B[0]&&N<=B[1]:N>A[1]&&N<B[1]||A[1]===B[1]&&N===A[1]&&R>=A[0]&&R<B[0]||A[1]<B[1]&&N===B[1]&&R<B[0]||A[1]<B[1]&&N===A[1]&&R>=A[0])}};function L(R,N,A){for(;R.length<A;)R=N+R;return R}c.DomRendererRowFactory=k=d([b(1,p.ICharacterJoinerService),b(2,T.IOptionsService),b(3,p.ICoreBrowserService),b(4,T.ICoreService),b(5,T.IDecorationService),b(6,p.IThemeService)],k)},2550:(g,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.WidthCache=void 0,c.WidthCache=class{constructor(h,d){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=h.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=h.createElement("span");b.classList.add("xterm-char-measure-element");const m=h.createElement("span");m.classList.add("xterm-char-measure-element"),m.style.fontWeight="bold";const w=h.createElement("span");w.classList.add("xterm-char-measure-element"),w.style.fontStyle="italic";const x=h.createElement("span");x.classList.add("xterm-char-measure-element"),x.style.fontWeight="bold",x.style.fontStyle="italic",this._measureElements=[b,m,w,x],this._container.appendChild(b),this._container.appendChild(m),this._container.appendChild(w),this._container.appendChild(x),d.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(h,d,b,m){h===this._font&&d===this._fontSize&&b===this._weight&&m===this._weightBold||(this._font=h,this._fontSize=d,this._weight=b,this._weightBold=m,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${b}`,this._measureElements[1].style.fontWeight=`${m}`,this._measureElements[2].style.fontWeight=`${b}`,this._measureElements[3].style.fontWeight=`${m}`,this.clear())}get(h,d,b){let m=0;if(!d&&!b&&h.length===1&&(m=h.charCodeAt(0))<256){if(this._flat[m]!==-9999)return this._flat[m];const T=this._measure(h,0);return T>0&&(this._flat[m]=T),T}let w=h;d&&(w+="B"),b&&(w+="I");let x=this._holey.get(w);if(x===void 0){let T=0;d&&(T|=1),b&&(T|=2),x=this._measure(h,T),x>0&&this._holey.set(w,x)}return x}_measure(h,d){const b=this._measureElements[d];return b.textContent=h.repeat(32),b.offsetWidth/32}}},2223:(g,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.TEXT_BASELINE=c.DIM_OPACITY=c.INVERTED_DEFAULT_COLOR=void 0;const d=h(6114);c.INVERTED_DEFAULT_COLOR=257,c.DIM_OPACITY=.5,c.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(g,c)=>{function h(b){return 57508<=b&&b<=57558}function d(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=h,c.isRestrictedPowerlineGlyph=function(b){return 57520<=b&&b<=57527},c.isEmoji=d,c.allowRescaling=function(b,m,w,x){return m===1&&w>Math.ceil(1.5*x)&&b!==void 0&&b>255&&!d(b)&&!h(b)&&!(function(T){return 57344<=T&&T<=63743})(b)},c.treatGlyphAsBackgroundColor=function(b){return h(b)||(function(m){return 9472<=m&&m<=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,m,w=0){return(b-(2*Math.round(m)-w))%(2*Math.round(m))}},6052:(g,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.createSelectionRenderModel=void 0;class h{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,m,w,x=!1){if(this.selectionStart=m,this.selectionEnd=w,!m||!w||m[0]===w[0]&&m[1]===w[1])return void this.clear();const T=b.buffers.active.ydisp,E=m[1]-T,p=w[1]-T,v=Math.max(E,0),_=Math.min(p,b.rows-1);v>=b.rows||_<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=x,this.viewportStartRow=E,this.viewportEndRow=p,this.viewportCappedStartRow=v,this.viewportCappedEndRow=_,this.startCol=m[0],this.endCol=w[0])}isCellSelected(b,m,w){return!!this.hasSelection&&(w-=b.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?m>=this.startCol&&w>=this.viewportCappedStartRow&&m<this.endCol&&w<=this.viewportCappedEndRow:m<this.startCol&&w>=this.viewportCappedStartRow&&m>=this.endCol&&w<=this.viewportCappedEndRow:w>this.viewportStartRow&&w<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&w===this.viewportStartRow&&m>=this.startCol&&m<this.endCol||this.viewportStartRow<this.viewportEndRow&&w===this.viewportEndRow&&m<this.endCol||this.viewportStartRow<this.viewportEndRow&&w===this.viewportStartRow&&m>=this.startCol)}}c.createSelectionRenderModel=function(){return new h}},456:(g,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.SelectionModel=void 0,c.SelectionModel=class{constructor(h){this._bufferService=h,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 h=this.selectionStart[0]+this.selectionStartLength;return h>this._bufferService.cols?h%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(h/this._bufferService.cols)-1]:[h%this._bufferService.cols,this.selectionStart[1]+Math.floor(h/this._bufferService.cols)]:[h,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const h=this.selectionStart[0]+this.selectionStartLength;return h>this._bufferService.cols?[h%this._bufferService.cols,this.selectionStart[1]+Math.floor(h/this._bufferService.cols)]:[Math.max(h,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const h=this.selectionStart,d=this.selectionEnd;return!(!h||!d)&&(h[1]>d[1]||h[1]===d[1]&&h[0]>d[0])}handleTrim(h){return this.selectionStart&&(this.selectionStart[1]-=h),this.selectionEnd&&(this.selectionEnd[1]-=h),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(g,c,h){var d=this&&this.__decorate||function(_,S,k,L){var R,N=arguments.length,A=N<3?S:L===null?L=Object.getOwnPropertyDescriptor(S,k):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(_,S,k,L);else for(var B=_.length-1;B>=0;B--)(R=_[B])&&(A=(N<3?R(A):N>3?R(S,k,A):R(S,k))||A);return N>3&&A&&Object.defineProperty(S,k,A),A},b=this&&this.__param||function(_,S){return function(k,L){S(k,L,_)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CharSizeService=void 0;const m=h(2585),w=h(8460),x=h(844);let T=c.CharSizeService=class extends x.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(_,S,k){super(),this._optionsService=k,this.width=0,this.height=0,this._onCharSizeChange=this.register(new w.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new v(this._optionsService))}catch{this._measureStrategy=this.register(new p(_,S,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const _=this._measureStrategy.measure();_.width===this.width&&_.height===this.height||(this.width=_.width,this.height=_.height,this._onCharSizeChange.fire())}};c.CharSizeService=T=d([b(2,m.IOptionsService)],T);class E extends x.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(S,k){S!==void 0&&S>0&&k!==void 0&&k>0&&(this._result.width=S,this._result.height=k)}}class p extends E{constructor(S,k,L){super(),this._document=S,this._parentElement=k,this._optionsService=L,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class v extends E{constructor(S){super(),this._optionsService=S,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const k=this._ctx.measureText("W");if(!("width"in k&&"fontBoundingBoxAscent"in k&&"fontBoundingBoxDescent"in k))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const S=this._ctx.measureText("W");return this._validateAndSet(S.width,S.fontBoundingBoxAscent+S.fontBoundingBoxDescent),this._result}}},4269:function(g,c,h){var d=this&&this.__decorate||function(v,_,S,k){var L,R=arguments.length,N=R<3?_:k===null?k=Object.getOwnPropertyDescriptor(_,S):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(v,_,S,k);else for(var A=v.length-1;A>=0;A--)(L=v[A])&&(N=(R<3?L(N):R>3?L(_,S,N):L(_,S))||N);return R>3&&N&&Object.defineProperty(_,S,N),N},b=this&&this.__param||function(v,_){return function(S,k){_(S,k,v)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CharacterJoinerService=c.JoinedCellData=void 0;const m=h(3734),w=h(643),x=h(511),T=h(2585);class E extends m.AttributeData{constructor(_,S,k){super(),this.content=0,this.combinedData="",this.fg=_.fg,this.bg=_.bg,this.combinedData=S,this._width=k}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(_){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}c.JoinedCellData=E;let p=c.CharacterJoinerService=class px{constructor(_){this._bufferService=_,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new x.CellData}register(_){const S={id:this._nextCharacterJoinerId++,handler:_};return this._characterJoiners.push(S),S.id}deregister(_){for(let S=0;S<this._characterJoiners.length;S++)if(this._characterJoiners[S].id===_)return this._characterJoiners.splice(S,1),!0;return!1}getJoinedCharacters(_){if(this._characterJoiners.length===0)return[];const S=this._bufferService.buffer.lines.get(_);if(!S||S.length===0)return[];const k=[],L=S.translateToString(!0);let R=0,N=0,A=0,B=S.getFg(0),q=S.getBg(0);for(let F=0;F<S.getTrimmedLength();F++)if(S.loadCell(F,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==B||this._workCell.bg!==q){if(F-R>1){const W=this._getJoinedRanges(L,A,N,S,R);for(let I=0;I<W.length;I++)k.push(W[I])}R=F,A=N,B=this._workCell.fg,q=this._workCell.bg}N+=this._workCell.getChars().length||w.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-R>1){const F=this._getJoinedRanges(L,A,N,S,R);for(let W=0;W<F.length;W++)k.push(F[W])}return k}_getJoinedRanges(_,S,k,L,R){const N=_.substring(S,k);let A=[];try{A=this._characterJoiners[0].handler(N)}catch(B){console.error(B)}for(let B=1;B<this._characterJoiners.length;B++)try{const q=this._characterJoiners[B].handler(N);for(let F=0;F<q.length;F++)px._mergeRanges(A,q[F])}catch(q){console.error(q)}return this._stringRangesToCellRanges(A,L,R),A}_stringRangesToCellRanges(_,S,k){let L=0,R=!1,N=0,A=_[L];if(A){for(let B=k;B<this._bufferService.cols;B++){const q=S.getWidth(B),F=S.getString(B).length||w.WHITESPACE_CELL_CHAR.length;if(q!==0){if(!R&&A[0]<=N&&(A[0]=B,R=!0),A[1]<=N){if(A[1]=B,A=_[++L],!A)break;A[0]<=N?(A[0]=B,R=!0):R=!1}N+=F}}A&&(A[1]=this._bufferService.cols)}}static _mergeRanges(_,S){let k=!1;for(let L=0;L<_.length;L++){const R=_[L];if(k){if(S[1]<=R[0])return _[L-1][1]=S[1],_;if(S[1]<=R[1])return _[L-1][1]=Math.max(S[1],R[1]),_.splice(L,1),_;_.splice(L,1),L--}else{if(S[1]<=R[0])return _.splice(L,0,S),_;if(S[1]<=R[1])return R[0]=Math.min(S[0],R[0]),_;S[0]<R[1]&&(R[0]=Math.min(S[0],R[0]),k=!0)}}return k?_[_.length-1][1]=S[1]:_.push(S),_}};c.CharacterJoinerService=p=d([b(0,T.IBufferService)],p)},5114:(g,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CoreBrowserService=void 0;const d=h(844),b=h(8460),m=h(3656);class w extends d.Disposable{constructor(E,p,v){super(),this._textarea=E,this._window=p,this.mainDocument=v,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new x(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((_=>this._screenDprMonitor.setWindow(_)))),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(E){this._window!==E&&(this._window=E,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=w;class x extends d.Disposable{constructor(E){super(),this._parentWindow=E,this._windowResizeListener=this.register(new d.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,d.toDisposable)((()=>this.clearListener())))}setWindow(E){this._parentWindow=E,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,m.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:(g,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.LinkProviderService=void 0;const d=h(844);class b extends d.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,d.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(w){return this.linkProviders.push(w),{dispose:()=>{const x=this.linkProviders.indexOf(w);x!==-1&&this.linkProviders.splice(x,1)}}}}c.LinkProviderService=b},8934:function(g,c,h){var d=this&&this.__decorate||function(T,E,p,v){var _,S=arguments.length,k=S<3?E:v===null?v=Object.getOwnPropertyDescriptor(E,p):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(T,E,p,v);else for(var L=T.length-1;L>=0;L--)(_=T[L])&&(k=(S<3?_(k):S>3?_(E,p,k):_(E,p))||k);return S>3&&k&&Object.defineProperty(E,p,k),k},b=this&&this.__param||function(T,E){return function(p,v){E(p,v,T)}};Object.defineProperty(c,"__esModule",{value:!0}),c.MouseService=void 0;const m=h(4725),w=h(9806);let x=c.MouseService=class{constructor(T,E){this._renderService=T,this._charSizeService=E}getCoords(T,E,p,v,_){return(0,w.getCoords)(window,T,E,p,v,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,_)}getMouseReportCoords(T,E){const p=(0,w.getCoordsRelativeToElement)(window,T,E);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=x=d([b(0,m.IRenderService),b(1,m.ICharSizeService)],x)},3230:function(g,c,h){var d=this&&this.__decorate||function(_,S,k,L){var R,N=arguments.length,A=N<3?S:L===null?L=Object.getOwnPropertyDescriptor(S,k):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(_,S,k,L);else for(var B=_.length-1;B>=0;B--)(R=_[B])&&(A=(N<3?R(A):N>3?R(S,k,A):R(S,k))||A);return N>3&&A&&Object.defineProperty(S,k,A),A},b=this&&this.__param||function(_,S){return function(k,L){S(k,L,_)}};Object.defineProperty(c,"__esModule",{value:!0}),c.RenderService=void 0;const m=h(6193),w=h(4725),x=h(8460),T=h(844),E=h(7226),p=h(2585);let v=c.RenderService=class extends T.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(_,S,k,L,R,N,A,B){super(),this._rowCount=_,this._charSizeService=L,this._renderer=this.register(new T.MutableDisposable),this._pausedResizeTask=new E.DebouncedIdleTask,this._observerDisposable=this.register(new T.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 x.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new x.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new x.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new x.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new m.RenderDebouncer(((q,F)=>this._renderRows(q,F)),A),this.register(this._renderDebouncer),this.register(A.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(N.onResize((()=>this._fullRefresh()))),this.register(N.buffers.onBufferActivate((()=>this._renderer.value?.clear()))),this.register(k.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(R.onDecorationRegistered((()=>this._fullRefresh()))),this.register(R.onDecorationRemoved((()=>this._fullRefresh()))),this.register(k.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(N.cols,N.rows),this._fullRefresh()}))),this.register(k.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(N.buffer.y,N.buffer.y,!0)))),this.register(B.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(A.window,S),this.register(A.onWindowChange((q=>this._registerIntersectionObserver(q,S))))}_registerIntersectionObserver(_,S){if("IntersectionObserver"in _){const k=new _.IntersectionObserver((L=>this._handleIntersectionChange(L[L.length-1])),{threshold:0});k.observe(S),this._observerDisposable.value=(0,T.toDisposable)((()=>k.disconnect()))}}_handleIntersectionChange(_){this._isPaused=_.isIntersecting===void 0?_.intersectionRatio===0:!_.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(_,S,k=!1){this._isPaused?this._needsFullRefresh=!0:(k||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(_,S,this._rowCount))}_renderRows(_,S){this._renderer.value&&(_=Math.min(_,this._rowCount-1),S=Math.min(S,this._rowCount-1),this._renderer.value.renderRows(_,S),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:_,end:S}),this._onRender.fire({start:_,end:S}),this._isNextRenderRedrawOnly=!0)}resize(_,S){this._rowCount=S,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(_){this._renderer.value=_,this._renderer.value&&(this._renderer.value.onRequestRedraw((S=>this.refreshRows(S.start,S.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(_){return this._renderDebouncer.addRefreshCallback(_)}_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(_,S){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value?.handleResize(_,S))):this._renderer.value.handleResize(_,S),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(_,S,k){this._selectionState.start=_,this._selectionState.end=S,this._selectionState.columnSelectMode=k,this._renderer.value?.handleSelectionChanged(_,S,k)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};c.RenderService=v=d([b(2,p.IOptionsService),b(3,w.ICharSizeService),b(4,p.IDecorationService),b(5,p.IBufferService),b(6,w.ICoreBrowserService),b(7,w.IThemeService)],v)},9312:function(g,c,h){var d=this&&this.__decorate||function(A,B,q,F){var W,I=arguments.length,Y=I<3?B:F===null?F=Object.getOwnPropertyDescriptor(B,q):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Y=Reflect.decorate(A,B,q,F);else for(var V=A.length-1;V>=0;V--)(W=A[V])&&(Y=(I<3?W(Y):I>3?W(B,q,Y):W(B,q))||Y);return I>3&&Y&&Object.defineProperty(B,q,Y),Y},b=this&&this.__param||function(A,B){return function(q,F){B(q,F,A)}};Object.defineProperty(c,"__esModule",{value:!0}),c.SelectionService=void 0;const m=h(9806),w=h(9504),x=h(456),T=h(4725),E=h(8460),p=h(844),v=h(6114),_=h(4841),S=h(511),k=h(2585),L=" ",R=new RegExp(L,"g");let N=c.SelectionService=class extends p.Disposable{constructor(A,B,q,F,W,I,Y,V,z){super(),this._element=A,this._screenElement=B,this._linkifier=q,this._bufferService=F,this._coreService=W,this._mouseService=I,this._optionsService=Y,this._renderService=V,this._coreBrowserService=z,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new S.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new E.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new E.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new E.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new E.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=G=>this._handleMouseMove(G),this._mouseUpListener=G=>this._handleMouseUp(G),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((G=>this._handleTrim(G))),this.register(this._bufferService.buffers.onBufferActivate((G=>this._handleBufferActivate(G)))),this.enable(),this._model=new x.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 A=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!(!A||!B||A[0]===B[0]&&A[1]===B[1])}get selectionText(){const A=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;if(!A||!B)return"";const q=this._bufferService.buffer,F=[];if(this._activeSelectionMode===3){if(A[0]===B[0])return"";const W=A[0]<B[0]?A[0]:B[0],I=A[0]<B[0]?B[0]:A[0];for(let Y=A[1];Y<=B[1];Y++){const V=q.translateBufferLineToString(Y,!0,W,I);F.push(V)}}else{const W=A[1]===B[1]?B[0]:void 0;F.push(q.translateBufferLineToString(A[1],!0,A[0],W));for(let I=A[1]+1;I<=B[1]-1;I++){const Y=q.lines.get(I),V=q.translateBufferLineToString(I,!0);Y?.isWrapped?F[F.length-1]+=V:F.push(V)}if(A[1]!==B[1]){const I=q.lines.get(B[1]),Y=q.translateBufferLineToString(B[1],!0,0,B[0]);I&&I.isWrapped?F[F.length-1]+=Y:F.push(Y)}}return F.map((W=>W.replace(R," "))).join(v.isWindows?`\r
|
|
79
|
+
`:`
|
|
80
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(A){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),v.isLinux&&A&&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(A){const B=this._getMouseBufferCoords(A),q=this._model.finalSelectionStart,F=this._model.finalSelectionEnd;return!!(q&&F&&B)&&this._areCoordsInSelection(B,q,F)}isCellInSelection(A,B){const q=this._model.finalSelectionStart,F=this._model.finalSelectionEnd;return!(!q||!F)&&this._areCoordsInSelection([A,B],q,F)}_areCoordsInSelection(A,B,q){return A[1]>B[1]&&A[1]<q[1]||B[1]===q[1]&&A[1]===B[1]&&A[0]>=B[0]&&A[0]<q[0]||B[1]<q[1]&&A[1]===q[1]&&A[0]<q[0]||B[1]<q[1]&&A[1]===B[1]&&A[0]>=B[0]}_selectWordAtCursor(A,B){const q=this._linkifier.currentLink?.link?.range;if(q)return this._model.selectionStart=[q.start.x-1,q.start.y-1],this._model.selectionStartLength=(0,_.getRangeLength)(q,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const F=this._getMouseBufferCoords(A);return!!F&&(this._selectWordAt(F,B),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(A,B){this._model.clearSelection(),A=Math.max(A,0),B=Math.min(B,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,A],this._model.selectionEnd=[this._bufferService.cols,B],this.refresh(),this._onSelectionChange.fire()}_handleTrim(A){this._model.handleTrim(A)&&this.refresh()}_getMouseBufferCoords(A){const B=this._mouseService.getCoords(A,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(B)return B[0]--,B[1]--,B[1]+=this._bufferService.buffer.ydisp,B}_getMouseEventScrollAmount(A){let B=(0,m.getCoordsRelativeToElement)(this._coreBrowserService.window,A,this._screenElement)[1];const q=this._renderService.dimensions.css.canvas.height;return B>=0&&B<=q?0:(B>q&&(B-=q),B=Math.min(Math.max(B,-50),50),B/=50,B/Math.abs(B)+Math.round(14*B))}shouldForceSelection(A){return v.isMac?A.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:A.shiftKey}handleMouseDown(A){if(this._mouseDownTimeStamp=A.timeStamp,(A.button!==2||!this.hasSelection)&&A.button===0){if(!this._enabled){if(!this.shouldForceSelection(A))return;A.stopPropagation()}A.preventDefault(),this._dragScrollAmount=0,this._enabled&&A.shiftKey?this._handleIncrementalClick(A):A.detail===1?this._handleSingleClick(A):A.detail===2?this._handleDoubleClick(A):A.detail===3&&this._handleTripleClick(A),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(A){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(A))}_handleSingleClick(A){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(A)?3:0,this._model.selectionStart=this._getMouseBufferCoords(A),!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(A){this._selectWordAtCursor(A,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(A){const B=this._getMouseBufferCoords(A);B&&(this._activeSelectionMode=2,this._selectLineAt(B[1]))}shouldColumnSelect(A){return A.altKey&&!(v.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(A){if(A.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(A),!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(A),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const q=this._bufferService.buffer;if(this._model.selectionEnd[1]<q.lines.length){const F=q.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 A=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(A.ydisp+this._bufferService.rows,A.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=A.ydisp),this.refresh()}}_handleMouseUp(A){const B=A.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&B<500&&A.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const q=this._mouseService.getCoords(A,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(q&&q[0]!==void 0&&q[1]!==void 0){const F=(0,w.moveToCellSequence)(q[0]-1,q[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(F,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const A=this._model.finalSelectionStart,B=this._model.finalSelectionEnd,q=!(!A||!B||A[0]===B[0]&&A[1]===B[1]);q?A&&B&&(this._oldSelectionStart&&this._oldSelectionEnd&&A[0]===this._oldSelectionStart[0]&&A[1]===this._oldSelectionStart[1]&&B[0]===this._oldSelectionEnd[0]&&B[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(A,B,q)):this._oldHasSelection&&this._fireOnSelectionChange(A,B,q)}_fireOnSelectionChange(A,B,q){this._oldSelectionStart=A,this._oldSelectionEnd=B,this._oldHasSelection=q,this._onSelectionChange.fire()}_handleBufferActivate(A){this.clearSelection(),this._trimListener.dispose(),this._trimListener=A.activeBuffer.lines.onTrim((B=>this._handleTrim(B)))}_convertViewportColToCharacterIndex(A,B){let q=B;for(let F=0;B>=F;F++){const W=A.loadCell(F,this._workCell).getChars().length;this._workCell.getWidth()===0?q--:W>1&&B!==F&&(q+=W-1)}return q}setSelection(A,B,q){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[A,B],this._model.selectionStartLength=q,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(A){this._isClickInSelection(A)||(this._selectWordAtCursor(A,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(A,B,q=!0,F=!0){if(A[0]>=this._bufferService.cols)return;const W=this._bufferService.buffer,I=W.lines.get(A[1]);if(!I)return;const Y=W.translateBufferLineToString(A[1],!1);let V=this._convertViewportColToCharacterIndex(I,A[0]),z=V;const G=A[0]-V;let K=0,j=0,H=0,D=0;if(Y.charAt(V)===" "){for(;V>0&&Y.charAt(V-1)===" ";)V--;for(;z<Y.length&&Y.charAt(z+1)===" ";)z++}else{let ee=A[0],J=A[0];I.getWidth(ee)===0&&(K++,ee--),I.getWidth(J)===2&&(j++,J++);const se=I.getString(J).length;for(se>1&&(D+=se-1,z+=se-1);ee>0&&V>0&&!this._isCharWordSeparator(I.loadCell(ee-1,this._workCell));){I.loadCell(ee-1,this._workCell);const X=this._workCell.getChars().length;this._workCell.getWidth()===0?(K++,ee--):X>1&&(H+=X-1,V-=X-1),V--,ee--}for(;J<I.length&&z+1<Y.length&&!this._isCharWordSeparator(I.loadCell(J+1,this._workCell));){I.loadCell(J+1,this._workCell);const X=this._workCell.getChars().length;this._workCell.getWidth()===2?(j++,J++):X>1&&(D+=X-1,z+=X-1),z++,J++}}z++;let P=V+G-K+H,Z=Math.min(this._bufferService.cols,z-V+K+j-H-D);if(B||Y.slice(V,z).trim()!==""){if(q&&P===0&&I.getCodePoint(0)!==32){const ee=W.lines.get(A[1]-1);if(ee&&I.isWrapped&&ee.getCodePoint(this._bufferService.cols-1)!==32){const J=this._getWordAt([this._bufferService.cols-1,A[1]-1],!1,!0,!1);if(J){const se=this._bufferService.cols-J.start;P-=se,Z+=se}}}if(F&&P+Z===this._bufferService.cols&&I.getCodePoint(this._bufferService.cols-1)!==32){const ee=W.lines.get(A[1]+1);if(ee?.isWrapped&&ee.getCodePoint(0)!==32){const J=this._getWordAt([0,A[1]+1],!1,!1,!0);J&&(Z+=J.length)}}return{start:P,length:Z}}}_selectWordAt(A,B){const q=this._getWordAt(A,B);if(q){for(;q.start<0;)q.start+=this._bufferService.cols,A[1]--;this._model.selectionStart=[q.start,A[1]],this._model.selectionStartLength=q.length}}_selectToWordAt(A){const B=this._getWordAt(A,!0);if(B){let q=A[1];for(;B.start<0;)B.start+=this._bufferService.cols,q--;if(!this._model.areSelectionValuesReversed())for(;B.start+B.length>this._bufferService.cols;)B.length-=this._bufferService.cols,q++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?B.start:B.start+B.length,q]}}_isCharWordSeparator(A){return A.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(A.getChars())>=0}_selectLineAt(A){const B=this._bufferService.buffer.getWrappedRangeForLine(A),q={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,_.getRangeLength)(q,this._bufferService.cols)}};c.SelectionService=N=d([b(3,k.IBufferService),b(4,k.ICoreService),b(5,T.IMouseService),b(6,k.IOptionsService),b(7,T.IRenderService),b(8,T.ICoreBrowserService)],N)},4725:(g,c,h)=>{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 d=h(8343);c.ICharSizeService=(0,d.createDecorator)("CharSizeService"),c.ICoreBrowserService=(0,d.createDecorator)("CoreBrowserService"),c.IMouseService=(0,d.createDecorator)("MouseService"),c.IRenderService=(0,d.createDecorator)("RenderService"),c.ISelectionService=(0,d.createDecorator)("SelectionService"),c.ICharacterJoinerService=(0,d.createDecorator)("CharacterJoinerService"),c.IThemeService=(0,d.createDecorator)("ThemeService"),c.ILinkProviderService=(0,d.createDecorator)("LinkProviderService")},6731:function(g,c,h){var d=this&&this.__decorate||function(N,A,B,q){var F,W=arguments.length,I=W<3?A:q===null?q=Object.getOwnPropertyDescriptor(A,B):q;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(N,A,B,q);else for(var Y=N.length-1;Y>=0;Y--)(F=N[Y])&&(I=(W<3?F(I):W>3?F(A,B,I):F(A,B))||I);return W>3&&I&&Object.defineProperty(A,B,I),I},b=this&&this.__param||function(N,A){return function(B,q){A(B,q,N)}};Object.defineProperty(c,"__esModule",{value:!0}),c.ThemeService=c.DEFAULT_ANSI_COLORS=void 0;const m=h(7239),w=h(8055),x=h(8460),T=h(844),E=h(2585),p=w.css.toColor("#ffffff"),v=w.css.toColor("#000000"),_=w.css.toColor("#ffffff"),S=w.css.toColor("#000000"),k={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};c.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const N=[w.css.toColor("#2e3436"),w.css.toColor("#cc0000"),w.css.toColor("#4e9a06"),w.css.toColor("#c4a000"),w.css.toColor("#3465a4"),w.css.toColor("#75507b"),w.css.toColor("#06989a"),w.css.toColor("#d3d7cf"),w.css.toColor("#555753"),w.css.toColor("#ef2929"),w.css.toColor("#8ae234"),w.css.toColor("#fce94f"),w.css.toColor("#729fcf"),w.css.toColor("#ad7fa8"),w.css.toColor("#34e2e2"),w.css.toColor("#eeeeec")],A=[0,95,135,175,215,255];for(let B=0;B<216;B++){const q=A[B/36%6|0],F=A[B/6%6|0],W=A[B%6];N.push({css:w.channels.toCss(q,F,W),rgba:w.channels.toRgba(q,F,W)})}for(let B=0;B<24;B++){const q=8+10*B;N.push({css:w.channels.toCss(q,q,q),rgba:w.channels.toRgba(q,q,q)})}return N})());let L=c.ThemeService=class extends T.Disposable{get colors(){return this._colors}constructor(N){super(),this._optionsService=N,this._contrastCache=new m.ColorContrastCache,this._halfContrastCache=new m.ColorContrastCache,this._onChangeColors=this.register(new x.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:p,background:v,cursor:_,cursorAccent:S,selectionForeground:void 0,selectionBackgroundTransparent:k,selectionBackgroundOpaque:w.color.blend(v,k),selectionInactiveBackgroundTransparent:k,selectionInactiveBackgroundOpaque:w.color.blend(v,k),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(N={}){const A=this._colors;if(A.foreground=R(N.foreground,p),A.background=R(N.background,v),A.cursor=R(N.cursor,_),A.cursorAccent=R(N.cursorAccent,S),A.selectionBackgroundTransparent=R(N.selectionBackground,k),A.selectionBackgroundOpaque=w.color.blend(A.background,A.selectionBackgroundTransparent),A.selectionInactiveBackgroundTransparent=R(N.selectionInactiveBackground,A.selectionBackgroundTransparent),A.selectionInactiveBackgroundOpaque=w.color.blend(A.background,A.selectionInactiveBackgroundTransparent),A.selectionForeground=N.selectionForeground?R(N.selectionForeground,w.NULL_COLOR):void 0,A.selectionForeground===w.NULL_COLOR&&(A.selectionForeground=void 0),w.color.isOpaque(A.selectionBackgroundTransparent)&&(A.selectionBackgroundTransparent=w.color.opacity(A.selectionBackgroundTransparent,.3)),w.color.isOpaque(A.selectionInactiveBackgroundTransparent)&&(A.selectionInactiveBackgroundTransparent=w.color.opacity(A.selectionInactiveBackgroundTransparent,.3)),A.ansi=c.DEFAULT_ANSI_COLORS.slice(),A.ansi[0]=R(N.black,c.DEFAULT_ANSI_COLORS[0]),A.ansi[1]=R(N.red,c.DEFAULT_ANSI_COLORS[1]),A.ansi[2]=R(N.green,c.DEFAULT_ANSI_COLORS[2]),A.ansi[3]=R(N.yellow,c.DEFAULT_ANSI_COLORS[3]),A.ansi[4]=R(N.blue,c.DEFAULT_ANSI_COLORS[4]),A.ansi[5]=R(N.magenta,c.DEFAULT_ANSI_COLORS[5]),A.ansi[6]=R(N.cyan,c.DEFAULT_ANSI_COLORS[6]),A.ansi[7]=R(N.white,c.DEFAULT_ANSI_COLORS[7]),A.ansi[8]=R(N.brightBlack,c.DEFAULT_ANSI_COLORS[8]),A.ansi[9]=R(N.brightRed,c.DEFAULT_ANSI_COLORS[9]),A.ansi[10]=R(N.brightGreen,c.DEFAULT_ANSI_COLORS[10]),A.ansi[11]=R(N.brightYellow,c.DEFAULT_ANSI_COLORS[11]),A.ansi[12]=R(N.brightBlue,c.DEFAULT_ANSI_COLORS[12]),A.ansi[13]=R(N.brightMagenta,c.DEFAULT_ANSI_COLORS[13]),A.ansi[14]=R(N.brightCyan,c.DEFAULT_ANSI_COLORS[14]),A.ansi[15]=R(N.brightWhite,c.DEFAULT_ANSI_COLORS[15]),N.extendedAnsi){const B=Math.min(A.ansi.length-16,N.extendedAnsi.length);for(let q=0;q<B;q++)A.ansi[q+16]=R(N.extendedAnsi[q],c.DEFAULT_ANSI_COLORS[q+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(N){this._restoreColor(N),this._onChangeColors.fire(this.colors)}_restoreColor(N){if(N!==void 0)switch(N){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[N]=this._restoreColors.ansi[N]}else for(let A=0;A<this._restoreColors.ansi.length;++A)this._colors.ansi[A]=this._restoreColors.ansi[A]}modifyColors(N){N(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function R(N,A){if(N!==void 0)try{return w.css.toColor(N)}catch{}return A}c.ThemeService=L=d([b(0,E.IOptionsService)],L)},6349:(g,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CircularList=void 0;const d=h(8460),b=h(844);class m extends b.Disposable{constructor(x){super(),this._maxLength=x,this.onDeleteEmitter=this.register(new d.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new d.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new d.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(x){if(this._maxLength===x)return;const T=new Array(x);for(let E=0;E<Math.min(x,this.length);E++)T[E]=this._array[this._getCyclicIndex(E)];this._array=T,this._maxLength=x,this._startIndex=0}get length(){return this._length}set length(x){if(x>this._length)for(let T=this._length;T<x;T++)this._array[T]=void 0;this._length=x}get(x){return this._array[this._getCyclicIndex(x)]}set(x,T){this._array[this._getCyclicIndex(x)]=T}push(x){this._array[this._getCyclicIndex(this._length)]=x,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(x,T,...E){if(T){for(let p=x;p<this._length-T;p++)this._array[this._getCyclicIndex(p)]=this._array[this._getCyclicIndex(p+T)];this._length-=T,this.onDeleteEmitter.fire({index:x,amount:T})}for(let p=this._length-1;p>=x;p--)this._array[this._getCyclicIndex(p+E.length)]=this._array[this._getCyclicIndex(p)];for(let p=0;p<E.length;p++)this._array[this._getCyclicIndex(x+p)]=E[p];if(E.length&&this.onInsertEmitter.fire({index:x,amount:E.length}),this._length+E.length>this._maxLength){const p=this._length+E.length-this._maxLength;this._startIndex+=p,this._length=this._maxLength,this.onTrimEmitter.fire(p)}else this._length+=E.length}trimStart(x){x>this._length&&(x=this._length),this._startIndex+=x,this._length-=x,this.onTrimEmitter.fire(x)}shiftElements(x,T,E){if(!(T<=0)){if(x<0||x>=this._length)throw new Error("start argument out of range");if(x+E<0)throw new Error("Cannot shift elements in list beyond index 0");if(E>0){for(let v=T-1;v>=0;v--)this.set(x+v+E,this.get(x+v));const p=x+T+E-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<T;p++)this.set(x+p+E,this.get(x+p))}}_getCyclicIndex(x){return(this._startIndex+x)%this._maxLength}}c.CircularList=m},1439:(g,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.clone=void 0,c.clone=function h(d,b=5){if(typeof d!="object")return d;const m=Array.isArray(d)?[]:{};for(const w in d)m[w]=b<=1?d[w]:d[w]&&h(d[w],b-1);return m}},8055:(g,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 h=0,d=0,b=0,m=0;var w,x,T,E,p;function v(S){const k=S.toString(16);return k.length<2?"0"+k:k}function _(S,k){return S<k?(k+.05)/(S+.05):(S+.05)/(k+.05)}c.NULL_COLOR={css:"#00000000",rgba:0},(function(S){S.toCss=function(k,L,R,N){return N!==void 0?`#${v(k)}${v(L)}${v(R)}${v(N)}`:`#${v(k)}${v(L)}${v(R)}`},S.toRgba=function(k,L,R,N=255){return(k<<24|L<<16|R<<8|N)>>>0},S.toColor=function(k,L,R,N){return{css:S.toCss(k,L,R,N),rgba:S.toRgba(k,L,R,N)}}})(w||(c.channels=w={})),(function(S){function k(L,R){return m=Math.round(255*R),[h,d,b]=p.toChannels(L.rgba),{css:w.toCss(h,d,b,m),rgba:w.toRgba(h,d,b,m)}}S.blend=function(L,R){if(m=(255&R.rgba)/255,m===1)return{css:R.css,rgba:R.rgba};const N=R.rgba>>24&255,A=R.rgba>>16&255,B=R.rgba>>8&255,q=L.rgba>>24&255,F=L.rgba>>16&255,W=L.rgba>>8&255;return h=q+Math.round((N-q)*m),d=F+Math.round((A-F)*m),b=W+Math.round((B-W)*m),{css:w.toCss(h,d,b),rgba:w.toRgba(h,d,b)}},S.isOpaque=function(L){return(255&L.rgba)==255},S.ensureContrastRatio=function(L,R,N){const A=p.ensureContrastRatio(L.rgba,R.rgba,N);if(A)return w.toColor(A>>24&255,A>>16&255,A>>8&255)},S.opaque=function(L){const R=(255|L.rgba)>>>0;return[h,d,b]=p.toChannels(R),{css:w.toCss(h,d,b),rgba:R}},S.opacity=k,S.multiplyOpacity=function(L,R){return m=255&L.rgba,k(L,m*R/255)},S.toColorRGB=function(L){return[L.rgba>>24&255,L.rgba>>16&255,L.rgba>>8&255]}})(x||(c.color=x={})),(function(S){let k,L;try{const R=document.createElement("canvas");R.width=1,R.height=1;const N=R.getContext("2d",{willReadFrequently:!0});N&&(k=N,k.globalCompositeOperation="copy",L=k.createLinearGradient(0,0,1,1))}catch{}S.toColor=function(R){if(R.match(/#[\da-f]{3,8}/i))switch(R.length){case 4:return h=parseInt(R.slice(1,2).repeat(2),16),d=parseInt(R.slice(2,3).repeat(2),16),b=parseInt(R.slice(3,4).repeat(2),16),w.toColor(h,d,b);case 5:return h=parseInt(R.slice(1,2).repeat(2),16),d=parseInt(R.slice(2,3).repeat(2),16),b=parseInt(R.slice(3,4).repeat(2),16),m=parseInt(R.slice(4,5).repeat(2),16),w.toColor(h,d,b,m);case 7:return{css:R,rgba:(parseInt(R.slice(1),16)<<8|255)>>>0};case 9:return{css:R,rgba:parseInt(R.slice(1),16)>>>0}}const N=R.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(N)return h=parseInt(N[1]),d=parseInt(N[2]),b=parseInt(N[3]),m=Math.round(255*(N[5]===void 0?1:parseFloat(N[5]))),w.toColor(h,d,b,m);if(!k||!L)throw new Error("css.toColor: Unsupported css format");if(k.fillStyle=L,k.fillStyle=R,typeof k.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(k.fillRect(0,0,1,1),[h,d,b,m]=k.getImageData(0,0,1,1).data,m!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:w.toRgba(h,d,b,m),css:R}}})(T||(c.css=T={})),(function(S){function k(L,R,N){const A=L/255,B=R/255,q=N/255;return .2126*(A<=.03928?A/12.92:Math.pow((A+.055)/1.055,2.4))+.7152*(B<=.03928?B/12.92:Math.pow((B+.055)/1.055,2.4))+.0722*(q<=.03928?q/12.92:Math.pow((q+.055)/1.055,2.4))}S.relativeLuminance=function(L){return k(L>>16&255,L>>8&255,255&L)},S.relativeLuminance2=k})(E||(c.rgb=E={})),(function(S){function k(R,N,A){const B=R>>24&255,q=R>>16&255,F=R>>8&255;let W=N>>24&255,I=N>>16&255,Y=N>>8&255,V=_(E.relativeLuminance2(W,I,Y),E.relativeLuminance2(B,q,F));for(;V<A&&(W>0||I>0||Y>0);)W-=Math.max(0,Math.ceil(.1*W)),I-=Math.max(0,Math.ceil(.1*I)),Y-=Math.max(0,Math.ceil(.1*Y)),V=_(E.relativeLuminance2(W,I,Y),E.relativeLuminance2(B,q,F));return(W<<24|I<<16|Y<<8|255)>>>0}function L(R,N,A){const B=R>>24&255,q=R>>16&255,F=R>>8&255;let W=N>>24&255,I=N>>16&255,Y=N>>8&255,V=_(E.relativeLuminance2(W,I,Y),E.relativeLuminance2(B,q,F));for(;V<A&&(W<255||I<255||Y<255);)W=Math.min(255,W+Math.ceil(.1*(255-W))),I=Math.min(255,I+Math.ceil(.1*(255-I))),Y=Math.min(255,Y+Math.ceil(.1*(255-Y))),V=_(E.relativeLuminance2(W,I,Y),E.relativeLuminance2(B,q,F));return(W<<24|I<<16|Y<<8|255)>>>0}S.blend=function(R,N){if(m=(255&N)/255,m===1)return N;const A=N>>24&255,B=N>>16&255,q=N>>8&255,F=R>>24&255,W=R>>16&255,I=R>>8&255;return h=F+Math.round((A-F)*m),d=W+Math.round((B-W)*m),b=I+Math.round((q-I)*m),w.toRgba(h,d,b)},S.ensureContrastRatio=function(R,N,A){const B=E.relativeLuminance(R>>8),q=E.relativeLuminance(N>>8);if(_(B,q)<A){if(q<B){const I=k(R,N,A),Y=_(B,E.relativeLuminance(I>>8));if(Y<A){const V=L(R,N,A);return Y>_(B,E.relativeLuminance(V>>8))?I:V}return I}const F=L(R,N,A),W=_(B,E.relativeLuminance(F>>8));if(W<A){const I=k(R,N,A);return W>_(B,E.relativeLuminance(I>>8))?F:I}return F}},S.reduceLuminance=k,S.increaseLuminance=L,S.toChannels=function(R){return[R>>24&255,R>>16&255,R>>8&255,255&R]}})(p||(c.rgba=p={})),c.toPaddedHex=v,c.contrastRatio=_},8969:(g,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CoreTerminal=void 0;const d=h(844),b=h(2585),m=h(4348),w=h(7866),x=h(744),T=h(7302),E=h(6975),p=h(8460),v=h(1753),_=h(1480),S=h(7994),k=h(9282),L=h(5435),R=h(5981),N=h(2660);let A=!1;class B extends d.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 W in F)this.optionsService.options[W]=F[W]}constructor(F){super(),this._windowsWrappingHeuristics=this.register(new d.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 m.InstantiationService,this.optionsService=this.register(new T.OptionsService(F)),this._instantiationService.setService(b.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(x.BufferService)),this._instantiationService.setService(b.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(w.LogService)),this._instantiationService.setService(b.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(E.CoreService)),this._instantiationService.setService(b.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(v.CoreMouseService)),this._instantiationService.setService(b.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(_.UnicodeService)),this._instantiationService.setService(b.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(S.CharsetService),this._instantiationService.setService(b.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(N.OscLinkService),this._instantiationService.setService(b.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new L.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,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((W=>{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((W=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new R.WriteBuffer(((W,I)=>this._inputHandler.parse(W,I)))),this.register((0,p.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(F,W){this._writeBuffer.write(F,W)}writeSync(F,W){this._logService.logLevel<=b.LogLevelEnum.WARN&&!A&&(this._logService.warn("writeSync is unreliable and will be removed soon."),A=!0),this._writeBuffer.writeSync(F,W)}input(F,W=!0){this.coreService.triggerDataEvent(F,W)}resize(F,W){isNaN(F)||isNaN(W)||(F=Math.max(F,x.MINIMUM_COLS),W=Math.max(W,x.MINIMUM_ROWS),this._bufferService.resize(F,W))}scroll(F,W=!1){this._bufferService.scroll(F,W)}scrollLines(F,W,I){this._bufferService.scrollLines(F,W,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 W=F-this._bufferService.buffer.ydisp;W!==0&&this.scrollLines(W)}registerEscHandler(F,W){return this._inputHandler.registerEscHandler(F,W)}registerDcsHandler(F,W){return this._inputHandler.registerDcsHandler(F,W)}registerCsiHandler(F,W){return this._inputHandler.registerCsiHandler(F,W)}registerOscHandler(F,W){return this._inputHandler.registerOscHandler(F,W)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let F=!1;const W=this.optionsService.rawOptions.windowsPty;W&&W.buildNumber!==void 0&&W.buildNumber!==void 0?F=W.backend==="conpty"&&W.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(k.updateWindowsModeWrappedState.bind(null,this._bufferService))),F.push(this.registerCsiHandler({final:"H"},(()=>((0,k.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)((()=>{for(const W of F)W.dispose()}))}}}c.CoreTerminal=B},8460:(g,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=h=>(this._listeners.push(h),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===h)return void this._listeners.splice(d,1)}}})),this._event}fire(h,d){const b=[];for(let m=0;m<this._listeners.length;m++)b.push(this._listeners[m]);for(let m=0;m<b.length;m++)b[m].call(void 0,h,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},c.forwardEvent=function(h,d){return h((b=>d.fire(b)))},c.runAndSubscribe=function(h,d){return d(void 0),h((b=>d(b)))}},5435:function(g,c,h){var d=this&&this.__decorate||function(K,j,H,D){var P,Z=arguments.length,ee=Z<3?j:D===null?D=Object.getOwnPropertyDescriptor(j,H):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ee=Reflect.decorate(K,j,H,D);else for(var J=K.length-1;J>=0;J--)(P=K[J])&&(ee=(Z<3?P(ee):Z>3?P(j,H,ee):P(j,H))||ee);return Z>3&&ee&&Object.defineProperty(j,H,ee),ee},b=this&&this.__param||function(K,j){return function(H,D){j(H,D,K)}};Object.defineProperty(c,"__esModule",{value:!0}),c.InputHandler=c.WindowsOptionsReportType=void 0;const m=h(2584),w=h(7116),x=h(2015),T=h(844),E=h(482),p=h(8437),v=h(8460),_=h(643),S=h(511),k=h(3734),L=h(2585),R=h(1480),N=h(6242),A=h(6351),B=h(5941),q={"(":0,")":1,"*":2,"+":3,"-":1,".":2},F=131072;function W(K,j){if(K>24)return j.setWinLines||!1;switch(K){case 1:return!!j.restoreWin;case 2:return!!j.minimizeWin;case 3:return!!j.setWinPosition;case 4:return!!j.setWinSizePixels;case 5:return!!j.raiseWin;case 6:return!!j.lowerWin;case 7:return!!j.refreshWin;case 8:return!!j.setWinSizeChars;case 9:return!!j.maximizeWin;case 10:return!!j.fullscreenWin;case 11:return!!j.getWinState;case 13:return!!j.getWinPosition;case 14:return!!j.getWinSizePixels;case 15:return!!j.getScreenSizePixels;case 16:return!!j.getCellSizePixels;case 18:return!!j.getWinSizeChars;case 19:return!!j.getScreenSizeChars;case 20:return!!j.getIconTitle;case 21:return!!j.getWinTitle;case 22:return!!j.pushTitle;case 23:return!!j.popTitle;case 24:return!!j.setWinLines}return!1}var I;(function(K){K[K.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",K[K.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(I||(c.WindowsOptionsReportType=I={}));let Y=0;class V extends T.Disposable{getAttrData(){return this._curAttrData}constructor(j,H,D,P,Z,ee,J,se,X=new x.EscapeSequenceParser){super(),this._bufferService=j,this._charsetService=H,this._coreService=D,this._logService=P,this._optionsService=Z,this._oscLinkService=ee,this._coreMouseService=J,this._unicodeService=se,this._parser=X,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new E.StringToUtf32,this._utf8Decoder=new E.Utf8ToUtf32,this._workCell=new S.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 v.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new v.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new v.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new v.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new v.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new v.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new v.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new v.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new v.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new v.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new v.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new v.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new v.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new z(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(($=>this._activeBuffer=$.activeBuffer))),this._parser.setCsiHandlerFallback((($,ae)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString($),params:ae.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((($,ae,de)=>{this._logService.debug("Unknown OSC code: ",{identifier:$,action:ae,data:de})})),this._parser.setDcsHandlerFallback((($,ae,de)=>{ae==="HOOK"&&(de=de.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString($),action:ae,payload:de})})),this._parser.setPrintHandler((($,ae,de)=>this.print($,ae,de))),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(m.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(m.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(m.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(m.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(m.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(m.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(m.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(m.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(m.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(m.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(m.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(m.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new N.OscHandler(($=>(this.setTitle($),this.setIconName($),!0)))),this._parser.registerOscHandler(1,new N.OscHandler(($=>this.setIconName($)))),this._parser.registerOscHandler(2,new N.OscHandler(($=>this.setTitle($)))),this._parser.registerOscHandler(4,new N.OscHandler(($=>this.setOrReportIndexedColor($)))),this._parser.registerOscHandler(8,new N.OscHandler(($=>this.setHyperlink($)))),this._parser.registerOscHandler(10,new N.OscHandler(($=>this.setOrReportFgColor($)))),this._parser.registerOscHandler(11,new N.OscHandler(($=>this.setOrReportBgColor($)))),this._parser.registerOscHandler(12,new N.OscHandler(($=>this.setOrReportCursorColor($)))),this._parser.registerOscHandler(104,new N.OscHandler(($=>this.restoreIndexedColor($)))),this._parser.registerOscHandler(110,new N.OscHandler(($=>this.restoreFgColor($)))),this._parser.registerOscHandler(111,new N.OscHandler(($=>this.restoreBgColor($)))),this._parser.registerOscHandler(112,new N.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 w.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 A.DcsHandler((($,ae)=>this.requestStatusString($,ae))))}_preserveStack(j,H,D,P){this._parseStack.paused=!0,this._parseStack.cursorStartX=j,this._parseStack.cursorStartY=H,this._parseStack.decodedLength=D,this._parseStack.position=P}_logSlowResolvingAsync(j){this._logService.logLevel<=L.LogLevelEnum.WARN&&Promise.race([j,new Promise(((H,D)=>setTimeout((()=>D("#SLOW_TIMEOUT")),5e3)))]).catch((H=>{if(H!=="#SLOW_TIMEOUT")throw H;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(j,H){let D,P=this._activeBuffer.x,Z=this._activeBuffer.y,ee=0;const J=this._parseStack.paused;if(J){if(D=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,H))return this._logSlowResolvingAsync(D),D;P=this._parseStack.cursorStartX,Z=this._parseStack.cursorStartY,this._parseStack.paused=!1,j.length>F&&(ee=this._parseStack.position+F)}if(this._logService.logLevel<=L.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof j=="string"?` "${j}"`:` "${Array.prototype.map.call(j,($=>String.fromCharCode($))).join("")}"`),typeof j=="string"?j.split("").map(($=>$.charCodeAt(0))):j),this._parseBuffer.length<j.length&&this._parseBuffer.length<F&&(this._parseBuffer=new Uint32Array(Math.min(j.length,F))),J||this._dirtyRowTracker.clearRange(),j.length>F)for(let $=ee;$<j.length;$+=F){const ae=$+F<j.length?$+F:j.length,de=typeof j=="string"?this._stringDecoder.decode(j.substring($,ae),this._parseBuffer):this._utf8Decoder.decode(j.subarray($,ae),this._parseBuffer);if(D=this._parser.parse(this._parseBuffer,de))return this._preserveStack(P,Z,de,$),this._logSlowResolvingAsync(D),D}else if(!J){const $=typeof j=="string"?this._stringDecoder.decode(j,this._parseBuffer):this._utf8Decoder.decode(j,this._parseBuffer);if(D=this._parser.parse(this._parseBuffer,$))return this._preserveStack(P,Z,$,0),this._logSlowResolvingAsync(D),D}this._activeBuffer.x===P&&this._activeBuffer.y===Z||this._onCursorMove.fire();const se=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),X=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);X<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(X,this._bufferService.rows-1),Math.min(se,this._bufferService.rows-1))}print(j,H,D){let P,Z;const ee=this._charsetService.charset,J=this._optionsService.rawOptions.screenReaderMode,se=this._bufferService.cols,X=this._coreService.decPrivateModes.wraparound,$=this._coreService.modes.insertMode,ae=this._curAttrData;let de=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&D-H>0&&de.getWidth(this._activeBuffer.x-1)===2&&de.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ae);let we=this._parser.precedingJoinState;for(let ye=H;ye<D;++ye){if(P=j[ye],P<127&&ee){const vt=ee[String.fromCharCode(P)];vt&&(P=vt.charCodeAt(0))}const Ne=this._unicodeService.charProperties(P,we);Z=R.UnicodeService.extractWidth(Ne);const Oe=R.UnicodeService.extractShouldJoin(Ne),Ge=Oe?R.UnicodeService.extractWidth(we):0;if(we=Ne,J&&this._onA11yChar.fire((0,E.stringFromCodePoint)(P)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+Z-Ge>se){if(X){const vt=de;let Le=this._activeBuffer.x-Ge;for(this._activeBuffer.x=Ge,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),de=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Ge>0&&de instanceof p.BufferLine&&de.copyCellsFrom(vt,Le,0,Ge,!1);Le<se;)vt.setCellFromCodepoint(Le++,0,1,ae)}else if(this._activeBuffer.x=se-1,Z===2)continue}if(Oe&&this._activeBuffer.x){const vt=de.getWidth(this._activeBuffer.x-1)?1:2;de.addCodepointToCell(this._activeBuffer.x-vt,P,Z);for(let Le=Z-Ge;--Le>=0;)de.setCellFromCodepoint(this._activeBuffer.x++,0,0,ae)}else if($&&(de.insertCells(this._activeBuffer.x,Z-Ge,this._activeBuffer.getNullCell(ae)),de.getWidth(se-1)===2&&de.setCellFromCodepoint(se-1,_.NULL_CELL_CODE,_.NULL_CELL_WIDTH,ae)),de.setCellFromCodepoint(this._activeBuffer.x++,P,Z,ae),Z>0)for(;--Z;)de.setCellFromCodepoint(this._activeBuffer.x++,0,0,ae)}this._parser.precedingJoinState=we,this._activeBuffer.x<se&&D-H>0&&de.getWidth(this._activeBuffer.x)===0&&!de.hasContent(this._activeBuffer.x)&&de.setCellFromCodepoint(this._activeBuffer.x,0,1,ae),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(j,H){return j.final!=="t"||j.prefix||j.intermediates?this._parser.registerCsiHandler(j,H):this._parser.registerCsiHandler(j,(D=>!W(D.params[0],this._optionsService.rawOptions.windowOptions)||H(D)))}registerDcsHandler(j,H){return this._parser.registerDcsHandler(j,new A.DcsHandler(H))}registerEscHandler(j,H){return this._parser.registerEscHandler(j,H)}registerOscHandler(j,H){return this._parser.registerOscHandler(j,new N.OscHandler(H))}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 j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);j.hasWidth(this._activeBuffer.x)&&!j.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const j=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-j),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(j=this._bufferService.cols-1){this._activeBuffer.x=Math.min(j,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(j,H){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=j,this._activeBuffer.y=this._activeBuffer.scrollTop+H):(this._activeBuffer.x=j,this._activeBuffer.y=H),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(j,H){this._restrictCursor(),this._setCursor(this._activeBuffer.x+j,this._activeBuffer.y+H)}cursorUp(j){const H=this._activeBuffer.y-this._activeBuffer.scrollTop;return H>=0?this._moveCursor(0,-Math.min(H,j.params[0]||1)):this._moveCursor(0,-(j.params[0]||1)),!0}cursorDown(j){const H=this._activeBuffer.scrollBottom-this._activeBuffer.y;return H>=0?this._moveCursor(0,Math.min(H,j.params[0]||1)):this._moveCursor(0,j.params[0]||1),!0}cursorForward(j){return this._moveCursor(j.params[0]||1,0),!0}cursorBackward(j){return this._moveCursor(-(j.params[0]||1),0),!0}cursorNextLine(j){return this.cursorDown(j),this._activeBuffer.x=0,!0}cursorPrecedingLine(j){return this.cursorUp(j),this._activeBuffer.x=0,!0}cursorCharAbsolute(j){return this._setCursor((j.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(j){return this._setCursor(j.length>=2?(j.params[1]||1)-1:0,(j.params[0]||1)-1),!0}charPosAbsolute(j){return this._setCursor((j.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(j){return this._moveCursor(j.params[0]||1,0),!0}linePosAbsolute(j){return this._setCursor(this._activeBuffer.x,(j.params[0]||1)-1),!0}vPositionRelative(j){return this._moveCursor(0,j.params[0]||1),!0}hVPosition(j){return this.cursorPosition(j),!0}tabClear(j){const H=j.params[0];return H===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:H===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(j){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let H=j.params[0]||1;for(;H--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(j){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let H=j.params[0]||1;for(;H--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(j){const H=j.params[0];return H===1&&(this._curAttrData.bg|=536870912),H!==2&&H!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(j,H,D,P=!1,Z=!1){const ee=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);ee.replaceCells(H,D,this._activeBuffer.getNullCell(this._eraseAttrData()),Z),P&&(ee.isWrapped=!1)}_resetBufferLine(j,H=!1){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);D&&(D.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),H),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+j),D.isWrapped=!1)}eraseInDisplay(j,H=!1){let D;switch(this._restrictCursor(this._bufferService.cols),j.params[0]){case 0:for(D=this._activeBuffer.y,this._dirtyRowTracker.markDirty(D),this._eraseInBufferLine(D++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,H);D<this._bufferService.rows;D++)this._resetBufferLine(D,H);this._dirtyRowTracker.markDirty(D);break;case 1:for(D=this._activeBuffer.y,this._dirtyRowTracker.markDirty(D),this._eraseInBufferLine(D,0,this._activeBuffer.x+1,!0,H),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(D+1).isWrapped=!1);D--;)this._resetBufferLine(D,H);this._dirtyRowTracker.markDirty(0);break;case 2:for(D=this._bufferService.rows,this._dirtyRowTracker.markDirty(D-1);D--;)this._resetBufferLine(D,H);this._dirtyRowTracker.markDirty(0);break;case 3:const P=this._activeBuffer.lines.length-this._bufferService.rows;P>0&&(this._activeBuffer.lines.trimStart(P),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-P,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-P,0),this._onScroll.fire(0))}return!0}eraseInLine(j,H=!1){switch(this._restrictCursor(this._bufferService.cols),j.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,H);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,H);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,H)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(j){this._restrictCursor();let H=j.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=this._activeBuffer.ybase+this._activeBuffer.y,P=this._bufferService.rows-1-this._activeBuffer.scrollBottom,Z=this._bufferService.rows-1+this._activeBuffer.ybase-P+1;for(;H--;)this._activeBuffer.lines.splice(Z-1,1),this._activeBuffer.lines.splice(D,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(j){this._restrictCursor();let H=j.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=this._activeBuffer.ybase+this._activeBuffer.y;let P;for(P=this._bufferService.rows-1-this._activeBuffer.scrollBottom,P=this._bufferService.rows-1+this._activeBuffer.ybase-P;H--;)this._activeBuffer.lines.splice(D,1),this._activeBuffer.lines.splice(P,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(j){this._restrictCursor();const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return H&&(H.insertCells(this._activeBuffer.x,j.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(j){this._restrictCursor();const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return H&&(H.deleteCells(this._activeBuffer.x,j.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(j){let H=j.params[0]||1;for(;H--;)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(j){let H=j.params[0]||1;for(;H--;)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(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const H=j.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);P.deleteCells(0,H,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const H=j.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);P.insertCells(0,H,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const H=j.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);P.insertCells(this._activeBuffer.x,H,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const H=j.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);P.deleteCells(this._activeBuffer.x,H,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(j){this._restrictCursor();const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return H&&(H.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(j.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(j){const H=this._parser.precedingJoinState;if(!H)return!0;const D=j.params[0]||1,P=R.UnicodeService.extractWidth(H),Z=this._activeBuffer.x-P,ee=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(Z),J=new Uint32Array(ee.length*D);let se=0;for(let $=0;$<ee.length;){const ae=ee.codePointAt($)||0;J[se++]=ae,$+=ae>65535?2:1}let X=se;for(let $=1;$<D;++$)J.copyWithin(X,0,se),X+=se;return this.print(J,0,X),!0}sendDeviceAttributesPrimary(j){return j.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(m.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(m.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(j){return j.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(m.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(m.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(j.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(m.C0.ESC+"[>83;40003;0c")),!0}_is(j){return(this._optionsService.rawOptions.termName+"").indexOf(j)===0}setMode(j){for(let H=0;H<j.length;H++)switch(j.params[H]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(j){for(let H=0;H<j.length;H++)switch(j.params[H]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,w.DEFAULT_CHARSET),this._charsetService.setgCharset(1,w.DEFAULT_CHARSET),this._charsetService.setgCharset(2,w.DEFAULT_CHARSET),this._charsetService.setgCharset(3,w.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(j){for(let H=0;H<j.length;H++)switch(j.params[H]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(j){for(let H=0;H<j.length;H++)switch(j.params[H]){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(),j.params[H]===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(j,H){const D=this._coreService.decPrivateModes,{activeProtocol:P,activeEncoding:Z}=this._coreMouseService,ee=this._coreService,{buffers:J,cols:se}=this._bufferService,{active:X,alt:$}=J,ae=this._optionsService.rawOptions,de=Oe=>Oe?1:2,we=j.params[0];return ye=we,Ne=H?we===2?4:we===4?de(ee.modes.insertMode):we===12?3:we===20?de(ae.convertEol):0:we===1?de(D.applicationCursorKeys):we===3?ae.windowOptions.setWinLines?se===80?2:se===132?1:0:0:we===6?de(D.origin):we===7?de(D.wraparound):we===8?3:we===9?de(P==="X10"):we===12?de(ae.cursorBlink):we===25?de(!ee.isCursorHidden):we===45?de(D.reverseWraparound):we===66?de(D.applicationKeypad):we===67?4:we===1e3?de(P==="VT200"):we===1002?de(P==="DRAG"):we===1003?de(P==="ANY"):we===1004?de(D.sendFocus):we===1005?4:we===1006?de(Z==="SGR"):we===1015?4:we===1016?de(Z==="SGR_PIXELS"):we===1048?1:we===47||we===1047||we===1049?de(X===$):we===2004?de(D.bracketedPasteMode):0,ee.triggerDataEvent(`${m.C0.ESC}[${H?"":"?"}${ye};${Ne}$y`),!0;var ye,Ne}_updateAttrColor(j,H,D,P,Z){return H===2?(j|=50331648,j&=-16777216,j|=k.AttributeData.fromColorRGB([D,P,Z])):H===5&&(j&=-50331904,j|=33554432|255&D),j}_extractColor(j,H,D){const P=[0,0,-1,0,0,0];let Z=0,ee=0;do{if(P[ee+Z]=j.params[H+ee],j.hasSubParams(H+ee)){const J=j.getSubParams(H+ee);let se=0;do P[1]===5&&(Z=1),P[ee+se+1+Z]=J[se];while(++se<J.length&&se+ee+1+Z<P.length);break}if(P[1]===5&&ee+Z>=2||P[1]===2&&ee+Z>=5)break;P[1]&&(Z=1)}while(++ee+H<j.length&&ee+Z<P.length);for(let J=2;J<P.length;++J)P[J]===-1&&(P[J]=0);switch(P[0]){case 38:D.fg=this._updateAttrColor(D.fg,P[1],P[3],P[4],P[5]);break;case 48:D.bg=this._updateAttrColor(D.bg,P[1],P[3],P[4],P[5]);break;case 58:D.extended=D.extended.clone(),D.extended.underlineColor=this._updateAttrColor(D.extended.underlineColor,P[1],P[3],P[4],P[5])}return ee}_processUnderline(j,H){H.extended=H.extended.clone(),(!~j||j>5)&&(j=1),H.extended.underlineStyle=j,H.fg|=268435456,j===0&&(H.fg&=-268435457),H.updateExtended()}_processSGR0(j){j.fg=p.DEFAULT_ATTR_DATA.fg,j.bg=p.DEFAULT_ATTR_DATA.bg,j.extended=j.extended.clone(),j.extended.underlineStyle=0,j.extended.underlineColor&=-67108864,j.updateExtended()}charAttributes(j){if(j.length===1&&j.params[0]===0)return this._processSGR0(this._curAttrData),!0;const H=j.length;let D;const P=this._curAttrData;for(let Z=0;Z<H;Z++)D=j.params[Z],D>=30&&D<=37?(P.fg&=-50331904,P.fg|=16777216|D-30):D>=40&&D<=47?(P.bg&=-50331904,P.bg|=16777216|D-40):D>=90&&D<=97?(P.fg&=-50331904,P.fg|=16777224|D-90):D>=100&&D<=107?(P.bg&=-50331904,P.bg|=16777224|D-100):D===0?this._processSGR0(P):D===1?P.fg|=134217728:D===3?P.bg|=67108864:D===4?(P.fg|=268435456,this._processUnderline(j.hasSubParams(Z)?j.getSubParams(Z)[0]:1,P)):D===5?P.fg|=536870912:D===7?P.fg|=67108864:D===8?P.fg|=1073741824:D===9?P.fg|=2147483648:D===2?P.bg|=134217728:D===21?this._processUnderline(2,P):D===22?(P.fg&=-134217729,P.bg&=-134217729):D===23?P.bg&=-67108865:D===24?(P.fg&=-268435457,this._processUnderline(0,P)):D===25?P.fg&=-536870913:D===27?P.fg&=-67108865:D===28?P.fg&=-1073741825:D===29?P.fg&=2147483647:D===39?(P.fg&=-67108864,P.fg|=16777215&p.DEFAULT_ATTR_DATA.fg):D===49?(P.bg&=-67108864,P.bg|=16777215&p.DEFAULT_ATTR_DATA.bg):D===38||D===48||D===58?Z+=this._extractColor(j,Z,P):D===53?P.bg|=1073741824:D===55?P.bg&=-1073741825:D===59?(P.extended=P.extended.clone(),P.extended.underlineColor=-1,P.updateExtended()):D===100?(P.fg&=-67108864,P.fg|=16777215&p.DEFAULT_ATTR_DATA.fg,P.bg&=-67108864,P.bg|=16777215&p.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",D);return!0}deviceStatus(j){switch(j.params[0]){case 5:this._coreService.triggerDataEvent(`${m.C0.ESC}[0n`);break;case 6:const H=this._activeBuffer.y+1,D=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${m.C0.ESC}[${H};${D}R`)}return!0}deviceStatusPrivate(j){if(j.params[0]===6){const H=this._activeBuffer.y+1,D=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${m.C0.ESC}[?${H};${D}R`)}return!0}softReset(j){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(j){const H=j.params[0]||1;switch(H){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const D=H%2==1;return this._optionsService.options.cursorBlink=D,!0}setScrollRegion(j){const H=j.params[0]||1;let D;return(j.length<2||(D=j.params[1])>this._bufferService.rows||D===0)&&(D=this._bufferService.rows),D>H&&(this._activeBuffer.scrollTop=H-1,this._activeBuffer.scrollBottom=D-1,this._setCursor(0,0)),!0}windowOptions(j){if(!W(j.params[0],this._optionsService.rawOptions.windowOptions))return!0;const H=j.length>1?j.params[1]:0;switch(j.params[0]){case 14:H!==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(`${m.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:H!==0&&H!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),H!==0&&H!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:H!==0&&H!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),H!==0&&H!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(j){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(j){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(j){return this._windowTitle=j,this._onTitleChange.fire(j),!0}setIconName(j){return this._iconName=j,!0}setOrReportIndexedColor(j){const H=[],D=j.split(";");for(;D.length>1;){const P=D.shift(),Z=D.shift();if(/^\d+$/.exec(P)){const ee=parseInt(P);if(G(ee))if(Z==="?")H.push({type:0,index:ee});else{const J=(0,B.parseColor)(Z);J&&H.push({type:1,index:ee,color:J})}}}return H.length&&this._onColor.fire(H),!0}setHyperlink(j){const H=j.split(";");return!(H.length<2)&&(H[1]?this._createHyperlink(H[0],H[1]):!H[0]&&this._finishHyperlink())}_createHyperlink(j,H){this._getCurrentLinkId()&&this._finishHyperlink();const D=j.split(":");let P;const Z=D.findIndex((ee=>ee.startsWith("id=")));return Z!==-1&&(P=D[Z].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:P,uri:H}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(j,H){const D=j.split(";");for(let P=0;P<D.length&&!(H>=this._specialColors.length);++P,++H)if(D[P]==="?")this._onColor.fire([{type:0,index:this._specialColors[H]}]);else{const Z=(0,B.parseColor)(D[P]);Z&&this._onColor.fire([{type:1,index:this._specialColors[H],color:Z}])}return!0}setOrReportFgColor(j){return this._setOrReportSpecialColor(j,0)}setOrReportBgColor(j){return this._setOrReportSpecialColor(j,1)}setOrReportCursorColor(j){return this._setOrReportSpecialColor(j,2)}restoreIndexedColor(j){if(!j)return this._onColor.fire([{type:2}]),!0;const H=[],D=j.split(";");for(let P=0;P<D.length;++P)if(/^\d+$/.exec(D[P])){const Z=parseInt(D[P]);G(Z)&&H.push({type:2,index:Z})}return H.length&&this._onColor.fire(H),!0}restoreFgColor(j){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(j){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(j){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,w.DEFAULT_CHARSET),!0}selectCharset(j){return j.length!==2?(this.selectDefaultCharset(),!0):(j[0]==="/"||this._charsetService.setgCharset(q[j[0]],w.CHARSETS[j[1]]||w.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 j=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,j,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(j){return this._charsetService.setgLevel(j),!0}screenAlignmentPattern(){const j=new S.CellData;j.content=4194373,j.fg=this._curAttrData.fg,j.bg=this._curAttrData.bg,this._setCursor(0,0);for(let H=0;H<this._bufferService.rows;++H){const D=this._activeBuffer.ybase+this._activeBuffer.y+H,P=this._activeBuffer.lines.get(D);P&&(P.fill(j),P.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(j,H){const D=this._bufferService.buffer,P=this._optionsService.rawOptions;return(Z=>(this._coreService.triggerDataEvent(`${m.C0.ESC}${Z}${m.C0.ESC}\\`),!0))(j==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:j==='"p'?'P1$r61;1"p':j==="r"?`P1$r${D.scrollTop+1};${D.scrollBottom+1}r`:j==="m"?"P1$r0m":j===" q"?`P1$r${{block:2,underline:4,bar:6}[P.cursorStyle]-(P.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(j,H){this._dirtyRowTracker.markRangeDirty(j,H)}}c.InputHandler=V;let z=class{constructor(K){this._bufferService=K,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(K){K<this.start?this.start=K:K>this.end&&(this.end=K)}markRangeDirty(K,j){K>j&&(Y=K,K=j,j=Y),K<this.start&&(this.start=K),j>this.end&&(this.end=j)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function G(K){return 0<=K&&K<256}z=d([b(0,L.IBufferService)],z)},844:(g,c)=>{function h(d){for(const b of d)b.dispose();d.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 d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const b=this._disposables.indexOf(d);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(d){this._isDisposed||d===this._value||(this._value?.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},c.toDisposable=function(d){return{dispose:d}},c.disposeArray=h,c.getDisposeArrayDisposable=function(d){return{dispose:()=>h(d)}}},1505:(g,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.FourKeyMap=c.TwoKeyMap=void 0;class h{constructor(){this._data={}}set(b,m,w){this._data[b]||(this._data[b]={}),this._data[b][m]=w}get(b,m){return this._data[b]?this._data[b][m]:void 0}clear(){this._data={}}}c.TwoKeyMap=h,c.FourKeyMap=class{constructor(){this._data=new h}set(d,b,m,w,x){this._data.get(d,b)||this._data.set(d,b,new h),this._data.get(d,b).set(m,w,x)}get(d,b,m,w){return this._data.get(d,b)?.get(m,w)}clear(){this._data.clear()}}},6114:(g,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 h=c.isNode?"node":navigator.userAgent,d=c.isNode?"node":navigator.platform;c.isFirefox=h.includes("Firefox"),c.isLegacyEdge=h.includes("Edge"),c.isSafari=/^((?!chrome|android).)*safari/i.test(h),c.getSafariVersion=function(){if(!c.isSafari)return 0;const b=h.match(/Version\/(\d+)/);return b===null||b.length<2?0:parseInt(b[1])},c.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),c.isIpad=d==="iPad",c.isIphone=d==="iPhone",c.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),c.isLinux=d.indexOf("Linux")>=0,c.isChromeOS=/\bCrOS\b/.test(h)},6106:(g,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.SortedList=void 0;let h=0;c.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(h=this._search(this._getKey(d)),this._array.splice(h,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const b=this._getKey(d);if(b===void 0||(h=this._search(b),h===-1)||this._getKey(this._array[h])!==b)return!1;do if(this._array[h]===d)return this._array.splice(h,1),!0;while(++h<this._array.length&&this._getKey(this._array[h])===b);return!1}*getKeyIterator(d){if(this._array.length!==0&&(h=this._search(d),!(h<0||h>=this._array.length)&&this._getKey(this._array[h])===d))do yield this._array[h];while(++h<this._array.length&&this._getKey(this._array[h])===d)}forEachByKey(d,b){if(this._array.length!==0&&(h=this._search(d),!(h<0||h>=this._array.length)&&this._getKey(this._array[h])===d))do b(this._array[h]);while(++h<this._array.length&&this._getKey(this._array[h])===d)}values(){return[...this._array].values()}_search(d){let b=0,m=this._array.length-1;for(;m>=b;){let w=b+m>>1;const x=this._getKey(this._array[w]);if(x>d)m=w-1;else{if(!(x<d)){for(;w>0&&this._getKey(this._array[w-1])===d;)w--;return w}b=w+1}}return b}}},7226:(g,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DebouncedIdleTask=c.IdleTaskQueue=c.PriorityTaskQueue=void 0;const d=h(6114);class b{constructor(){this._tasks=[],this._i=0}enqueue(x){this._tasks.push(x),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(x){this._idleCallback=void 0;let T=0,E=0,p=x.timeRemaining(),v=0;for(;this._i<this._tasks.length;){if(T=Date.now(),this._tasks[this._i]()||this._i++,T=Math.max(1,Date.now()-T),E=Math.max(T,E),v=x.timeRemaining(),1.5*E>v)return p-T<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(p-T))}ms`),void this._start();p=v}this.clear()}}class m extends b{_requestCallback(x){return setTimeout((()=>x(this._createDeadline(16))))}_cancelCallback(x){clearTimeout(x)}_createDeadline(x){const T=Date.now()+x;return{timeRemaining:()=>Math.max(0,T-Date.now())}}}c.PriorityTaskQueue=m,c.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends b{_requestCallback(w){return requestIdleCallback(w)}_cancelCallback(w){cancelIdleCallback(w)}}:m,c.DebouncedIdleTask=class{constructor(){this._queue=new c.IdleTaskQueue}set(w){this._queue.clear(),this._queue.enqueue(w)}flush(){this._queue.flush()}}},9282:(g,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.updateWindowsModeWrappedState=void 0;const d=h(643);c.updateWindowsModeWrappedState=function(b){const m=b.buffer.lines.get(b.buffer.ybase+b.buffer.y-1),w=m?.get(b.cols-1),x=b.buffer.lines.get(b.buffer.ybase+b.buffer.y);x&&w&&(x.isWrapped=w[d.CHAR_DATA_CODE_INDEX]!==d.NULL_CELL_CODE&&w[d.CHAR_DATA_CODE_INDEX]!==d.WHITESPACE_CELL_CODE)}},3734:(g,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ExtendedAttrs=c.AttributeData=void 0;class h{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(m){return[m>>>16&255,m>>>8&255,255&m]}static fromColorRGB(m){return(255&m[0])<<16|(255&m[1])<<8|255&m[2]}clone(){const m=new h;return m.fg=this.fg,m.bg=this.bg,m.extended=this.extended.clone(),m}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=h;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(m){this._ext=m}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(m){this._ext&=-469762049,this._ext|=m<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(m){this._ext&=-67108864,this._ext|=67108863&m}get urlId(){return this._urlId}set urlId(m){this._urlId=m}get underlineVariantOffset(){const m=(3758096384&this._ext)>>29;return m<0?4294967288^m:m}set underlineVariantOffset(m){this._ext&=536870911,this._ext|=m<<29&3758096384}constructor(m=0,w=0){this._ext=0,this._urlId=0,this._ext=m,this._urlId=w}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}c.ExtendedAttrs=d},9092:(g,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Buffer=c.MAX_BUFFER_SIZE=void 0;const d=h(6349),b=h(7226),m=h(3734),w=h(8437),x=h(4634),T=h(511),E=h(643),p=h(4863),v=h(7116);c.MAX_BUFFER_SIZE=4294967295,c.Buffer=class{constructor(_,S,k){this._hasScrollback=_,this._optionsService=S,this._bufferService=k,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=w.DEFAULT_ATTR_DATA.clone(),this.savedCharset=v.DEFAULT_CHARSET,this.markers=[],this._nullCell=T.CellData.fromCharData([0,E.NULL_CELL_CHAR,E.NULL_CELL_WIDTH,E.NULL_CELL_CODE]),this._whitespaceCell=T.CellData.fromCharData([0,E.WHITESPACE_CELL_CHAR,E.WHITESPACE_CELL_WIDTH,E.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 d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(_){return _?(this._nullCell.fg=_.fg,this._nullCell.bg=_.bg,this._nullCell.extended=_.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new m.ExtendedAttrs),this._nullCell}getWhitespaceCell(_){return _?(this._whitespaceCell.fg=_.fg,this._whitespaceCell.bg=_.bg,this._whitespaceCell.extended=_.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new m.ExtendedAttrs),this._whitespaceCell}getBlankLine(_,S){return new w.BufferLine(this._bufferService.cols,this.getNullCell(_),S)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const _=this.ybase+this.y-this.ydisp;return _>=0&&_<this._rows}_getCorrectBufferLength(_){if(!this._hasScrollback)return _;const S=_+this._optionsService.rawOptions.scrollback;return S>c.MAX_BUFFER_SIZE?c.MAX_BUFFER_SIZE:S}fillViewportRows(_){if(this.lines.length===0){_===void 0&&(_=w.DEFAULT_ATTR_DATA);let S=this._rows;for(;S--;)this.lines.push(this.getBlankLine(_))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(_,S){const k=this.getNullCell(w.DEFAULT_ATTR_DATA);let L=0;const R=this._getCorrectBufferLength(S);if(R>this.lines.maxLength&&(this.lines.maxLength=R),this.lines.length>0){if(this._cols<_)for(let A=0;A<this.lines.length;A++)L+=+this.lines.get(A).resize(_,k);let N=0;if(this._rows<S)for(let A=this._rows;A<S;A++)this.lines.length<S+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new w.BufferLine(_,k)):this.ybase>0&&this.lines.length<=this.ybase+this.y+N+1?(this.ybase--,N++,this.ydisp>0&&this.ydisp--):this.lines.push(new w.BufferLine(_,k)));else for(let A=this._rows;A>S;A--)this.lines.length>S+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(R<this.lines.maxLength){const A=this.lines.length-R;A>0&&(this.lines.trimStart(A),this.ybase=Math.max(this.ybase-A,0),this.ydisp=Math.max(this.ydisp-A,0),this.savedY=Math.max(this.savedY-A,0)),this.lines.maxLength=R}this.x=Math.min(this.x,_-1),this.y=Math.min(this.y,S-1),N&&(this.y+=N),this.savedX=Math.min(this.savedX,_-1),this.scrollTop=0}if(this.scrollBottom=S-1,this._isReflowEnabled&&(this._reflow(_,S),this._cols>_))for(let N=0;N<this.lines.length;N++)L+=+this.lines.get(N).resize(_,k);this._cols=_,this._rows=S,this._memoryCleanupQueue.clear(),L>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let _=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,_=!1);let S=0;for(;this._memoryCleanupPosition<this.lines.length;)if(S+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),S>100)return!0;return _}get _isReflowEnabled(){const _=this._optionsService.rawOptions.windowsPty;return _&&_.buildNumber?this._hasScrollback&&_.backend==="conpty"&&_.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(_,S){this._cols!==_&&(_>this._cols?this._reflowLarger(_,S):this._reflowSmaller(_,S))}_reflowLarger(_,S){const k=(0,x.reflowLargerGetLinesToRemove)(this.lines,this._cols,_,this.ybase+this.y,this.getNullCell(w.DEFAULT_ATTR_DATA));if(k.length>0){const L=(0,x.reflowLargerCreateNewLayout)(this.lines,k);(0,x.reflowLargerApplyNewLayout)(this.lines,L.layout),this._reflowLargerAdjustViewport(_,S,L.countRemoved)}}_reflowLargerAdjustViewport(_,S,k){const L=this.getNullCell(w.DEFAULT_ATTR_DATA);let R=k;for(;R-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<S&&this.lines.push(new w.BufferLine(_,L))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-k,0)}_reflowSmaller(_,S){const k=this.getNullCell(w.DEFAULT_ATTR_DATA),L=[];let R=0;for(let N=this.lines.length-1;N>=0;N--){let A=this.lines.get(N);if(!A||!A.isWrapped&&A.getTrimmedLength()<=_)continue;const B=[A];for(;A.isWrapped&&N>0;)A=this.lines.get(--N),B.unshift(A);const q=this.ybase+this.y;if(q>=N&&q<N+B.length)continue;const F=B[B.length-1].getTrimmedLength(),W=(0,x.reflowSmallerGetNewLineLengths)(B,this._cols,_),I=W.length-B.length;let Y;Y=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 V=[];for(let D=0;D<I;D++){const P=this.getBlankLine(w.DEFAULT_ATTR_DATA,!0);V.push(P)}V.length>0&&(L.push({start:N+B.length+R,newLines:V}),R+=V.length),B.push(...V);let z=W.length-1,G=W[z];G===0&&(z--,G=W[z]);let K=B.length-I-1,j=F;for(;K>=0;){const D=Math.min(j,G);if(B[z]===void 0)break;if(B[z].copyCellsFrom(B[K],j-D,G-D,D,!0),G-=D,G===0&&(z--,G=W[z]),j-=D,j===0){K--;const P=Math.max(K,0);j=(0,x.getWrappedLineTrimmedLength)(B,P,this._cols)}}for(let D=0;D<B.length;D++)W[D]<_&&B[D].setCell(W[D],k);let H=I-Y;for(;H-- >0;)this.ybase===0?this.y<S-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+R)-S&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+I,this.ybase+S-1)}if(L.length>0){const N=[],A=[];for(let z=0;z<this.lines.length;z++)A.push(this.lines.get(z));const B=this.lines.length;let q=B-1,F=0,W=L[F];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+R);let I=0;for(let z=Math.min(this.lines.maxLength-1,B+R-1);z>=0;z--)if(W&&W.start>q+I){for(let G=W.newLines.length-1;G>=0;G--)this.lines.set(z--,W.newLines[G]);z++,N.push({index:q+1,amount:W.newLines.length}),I+=W.newLines.length,W=L[++F]}else this.lines.set(z,A[q--]);let Y=0;for(let z=N.length-1;z>=0;z--)N[z].index+=Y,this.lines.onInsertEmitter.fire(N[z]),Y+=N[z].amount;const V=Math.max(0,B+R-this.lines.maxLength);V>0&&this.lines.onTrimEmitter.fire(V)}}translateBufferLineToString(_,S,k=0,L){const R=this.lines.get(_);return R?R.translateToString(S,k,L):""}getWrappedRangeForLine(_){let S=_,k=_;for(;S>0&&this.lines.get(S).isWrapped;)S--;for(;k+1<this.lines.length&&this.lines.get(k+1).isWrapped;)k++;return{first:S,last:k}}setupTabStops(_){for(_!=null?this.tabs[_]||(_=this.prevStop(_)):(this.tabs={},_=0);_<this._cols;_+=this._optionsService.rawOptions.tabStopWidth)this.tabs[_]=!0}prevStop(_){for(_==null&&(_=this.x);!this.tabs[--_]&&_>0;);return _>=this._cols?this._cols-1:_<0?0:_}nextStop(_){for(_==null&&(_=this.x);!this.tabs[++_]&&_<this._cols;);return _>=this._cols?this._cols-1:_<0?0:_}clearMarkers(_){this._isClearing=!0;for(let S=0;S<this.markers.length;S++)this.markers[S].line===_&&(this.markers[S].dispose(),this.markers.splice(S--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let _=0;_<this.markers.length;_++)this.markers[_].dispose(),this.markers.splice(_--,1);this._isClearing=!1}addMarker(_){const S=new p.Marker(_);return this.markers.push(S),S.register(this.lines.onTrim((k=>{S.line-=k,S.line<0&&S.dispose()}))),S.register(this.lines.onInsert((k=>{S.line>=k.index&&(S.line+=k.amount)}))),S.register(this.lines.onDelete((k=>{S.line>=k.index&&S.line<k.index+k.amount&&S.dispose(),S.line>k.index&&(S.line-=k.amount)}))),S.register(S.onDispose((()=>this._removeMarker(S)))),S}_removeMarker(_){this._isClearing||this.markers.splice(this.markers.indexOf(_),1)}}},8437:(g,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferLine=c.DEFAULT_ATTR_DATA=void 0;const d=h(3734),b=h(511),m=h(643),w=h(482);c.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let x=0;class T{constructor(p,v,_=!1){this.isWrapped=_,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*p);const S=v||b.CellData.fromCharData([0,m.NULL_CELL_CHAR,m.NULL_CELL_WIDTH,m.NULL_CELL_CODE]);for(let k=0;k<p;++k)this.setCell(k,S);this.length=p}get(p){const v=this._data[3*p+0],_=2097151&v;return[this._data[3*p+1],2097152&v?this._combined[p]:_?(0,w.stringFromCodePoint)(_):"",v>>22,2097152&v?this._combined[p].charCodeAt(this._combined[p].length-1):_]}set(p,v){this._data[3*p+1]=v[m.CHAR_DATA_ATTR_INDEX],v[m.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[p]=v[1],this._data[3*p+0]=2097152|p|v[m.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*p+0]=v[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|v[m.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 v=this._data[3*p+0];return 2097152&v?this._combined[p].charCodeAt(this._combined[p].length-1):2097151&v}isCombined(p){return 2097152&this._data[3*p+0]}getString(p){const v=this._data[3*p+0];return 2097152&v?this._combined[p]:2097151&v?(0,w.stringFromCodePoint)(2097151&v):""}isProtected(p){return 536870912&this._data[3*p+2]}loadCell(p,v){return x=3*p,v.content=this._data[x+0],v.fg=this._data[x+1],v.bg=this._data[x+2],2097152&v.content&&(v.combinedData=this._combined[p]),268435456&v.bg&&(v.extended=this._extendedAttrs[p]),v}setCell(p,v){2097152&v.content&&(this._combined[p]=v.combinedData),268435456&v.bg&&(this._extendedAttrs[p]=v.extended),this._data[3*p+0]=v.content,this._data[3*p+1]=v.fg,this._data[3*p+2]=v.bg}setCellFromCodepoint(p,v,_,S){268435456&S.bg&&(this._extendedAttrs[p]=S.extended),this._data[3*p+0]=v|_<<22,this._data[3*p+1]=S.fg,this._data[3*p+2]=S.bg}addCodepointToCell(p,v,_){let S=this._data[3*p+0];2097152&S?this._combined[p]+=(0,w.stringFromCodePoint)(v):2097151&S?(this._combined[p]=(0,w.stringFromCodePoint)(2097151&S)+(0,w.stringFromCodePoint)(v),S&=-2097152,S|=2097152):S=v|4194304,_&&(S&=-12582913,S|=_<<22),this._data[3*p+0]=S}insertCells(p,v,_){if((p%=this.length)&&this.getWidth(p-1)===2&&this.setCellFromCodepoint(p-1,0,1,_),v<this.length-p){const S=new b.CellData;for(let k=this.length-p-v-1;k>=0;--k)this.setCell(p+v+k,this.loadCell(p+k,S));for(let k=0;k<v;++k)this.setCell(p+k,_)}else for(let S=p;S<this.length;++S)this.setCell(S,_);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,_)}deleteCells(p,v,_){if(p%=this.length,v<this.length-p){const S=new b.CellData;for(let k=0;k<this.length-p-v;++k)this.setCell(p+k,this.loadCell(p+v+k,S));for(let k=this.length-v;k<this.length;++k)this.setCell(k,_)}else for(let S=p;S<this.length;++S)this.setCell(S,_);p&&this.getWidth(p-1)===2&&this.setCellFromCodepoint(p-1,0,1,_),this.getWidth(p)!==0||this.hasContent(p)||this.setCellFromCodepoint(p,0,1,_)}replaceCells(p,v,_,S=!1){if(S)for(p&&this.getWidth(p-1)===2&&!this.isProtected(p-1)&&this.setCellFromCodepoint(p-1,0,1,_),v<this.length&&this.getWidth(v-1)===2&&!this.isProtected(v)&&this.setCellFromCodepoint(v,0,1,_);p<v&&p<this.length;)this.isProtected(p)||this.setCell(p,_),p++;else for(p&&this.getWidth(p-1)===2&&this.setCellFromCodepoint(p-1,0,1,_),v<this.length&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v,0,1,_);p<v&&p<this.length;)this.setCell(p++,_)}resize(p,v){if(p===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const _=3*p;if(p>this.length){if(this._data.buffer.byteLength>=4*_)this._data=new Uint32Array(this._data.buffer,0,_);else{const S=new Uint32Array(_);S.set(this._data),this._data=S}for(let S=this.length;S<p;++S)this.setCell(S,v)}else{this._data=this._data.subarray(0,_);const S=Object.keys(this._combined);for(let L=0;L<S.length;L++){const R=parseInt(S[L],10);R>=p&&delete this._combined[R]}const k=Object.keys(this._extendedAttrs);for(let L=0;L<k.length;L++){const R=parseInt(k[L],10);R>=p&&delete this._extendedAttrs[R]}}return this.length=p,4*_*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,v=!1){if(v)for(let _=0;_<this.length;++_)this.isProtected(_)||this.setCell(_,p);else{this._combined={},this._extendedAttrs={};for(let _=0;_<this.length;++_)this.setCell(_,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 v in p._combined)this._combined[v]=p._combined[v];this._extendedAttrs={};for(const v in p._extendedAttrs)this._extendedAttrs[v]=p._extendedAttrs[v];this.isWrapped=p.isWrapped}clone(){const p=new T(0);p._data=new Uint32Array(this._data),p.length=this.length;for(const v in this._combined)p._combined[v]=this._combined[v];for(const v in this._extendedAttrs)p._extendedAttrs[v]=this._extendedAttrs[v];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,v,_,S,k){const L=p._data;if(k)for(let N=S-1;N>=0;N--){for(let A=0;A<3;A++)this._data[3*(_+N)+A]=L[3*(v+N)+A];268435456&L[3*(v+N)+2]&&(this._extendedAttrs[_+N]=p._extendedAttrs[v+N])}else for(let N=0;N<S;N++){for(let A=0;A<3;A++)this._data[3*(_+N)+A]=L[3*(v+N)+A];268435456&L[3*(v+N)+2]&&(this._extendedAttrs[_+N]=p._extendedAttrs[v+N])}const R=Object.keys(p._combined);for(let N=0;N<R.length;N++){const A=parseInt(R[N],10);A>=v&&(this._combined[A-v+_]=p._combined[A])}}translateToString(p,v,_,S){v=v??0,_=_??this.length,p&&(_=Math.min(_,this.getTrimmedLength())),S&&(S.length=0);let k="";for(;v<_;){const L=this._data[3*v+0],R=2097151&L,N=2097152&L?this._combined[v]:R?(0,w.stringFromCodePoint)(R):m.WHITESPACE_CELL_CHAR;if(k+=N,S)for(let A=0;A<N.length;++A)S.push(v);v+=L>>22||1}return S&&S.push(v),k}}c.BufferLine=T},4841:(g,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.getRangeLength=void 0,c.getRangeLength=function(h,d){if(h.start.y>h.end.y)throw new Error(`Buffer range end (${h.end.x}, ${h.end.y}) cannot be before start (${h.start.x}, ${h.start.y})`);return d*(h.end.y-h.start.y)+(h.end.x-h.start.x+1)}},4634:(g,c)=>{function h(d,b,m){if(b===d.length-1)return d[b].getTrimmedLength();const w=!d[b].hasContent(m-1)&&d[b].getWidth(m-1)===1,x=d[b+1].getWidth(0)===2;return w&&x?m-1:m}Object.defineProperty(c,"__esModule",{value:!0}),c.getWrappedLineTrimmedLength=c.reflowSmallerGetNewLineLengths=c.reflowLargerApplyNewLayout=c.reflowLargerCreateNewLayout=c.reflowLargerGetLinesToRemove=void 0,c.reflowLargerGetLinesToRemove=function(d,b,m,w,x){const T=[];for(let E=0;E<d.length-1;E++){let p=E,v=d.get(++p);if(!v.isWrapped)continue;const _=[d.get(E)];for(;p<d.length&&v.isWrapped;)_.push(v),v=d.get(++p);if(w>=E&&w<p){E+=_.length-1;continue}let S=0,k=h(_,S,b),L=1,R=0;for(;L<_.length;){const A=h(_,L,b),B=A-R,q=m-k,F=Math.min(B,q);_[S].copyCellsFrom(_[L],R,k,F,!1),k+=F,k===m&&(S++,k=0),R+=F,R===A&&(L++,R=0),k===0&&S!==0&&_[S-1].getWidth(m-1)===2&&(_[S].copyCellsFrom(_[S-1],m-1,k++,1,!1),_[S-1].setCell(m-1,x))}_[S].replaceCells(k,m,x);let N=0;for(let A=_.length-1;A>0&&(A>S||_[A].getTrimmedLength()===0);A--)N++;N>0&&(T.push(E+_.length-N),T.push(N)),E+=_.length-1}return T},c.reflowLargerCreateNewLayout=function(d,b){const m=[];let w=0,x=b[w],T=0;for(let E=0;E<d.length;E++)if(x===E){const p=b[++w];d.onDeleteEmitter.fire({index:E-T,amount:p}),E+=p-1,T+=p,x=b[++w]}else m.push(E);return{layout:m,countRemoved:T}},c.reflowLargerApplyNewLayout=function(d,b){const m=[];for(let w=0;w<b.length;w++)m.push(d.get(b[w]));for(let w=0;w<m.length;w++)d.set(w,m[w]);d.length=b.length},c.reflowSmallerGetNewLineLengths=function(d,b,m){const w=[],x=d.map(((v,_)=>h(d,_,b))).reduce(((v,_)=>v+_));let T=0,E=0,p=0;for(;p<x;){if(x-p<m){w.push(x-p);break}T+=m;const v=h(d,E,b);T>v&&(T-=v,E++);const _=d[E].getWidth(T-1)===2;_&&T--;const S=_?m-1:m;w.push(S),p+=S}return w},c.getWrappedLineTrimmedLength=h},5295:(g,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferSet=void 0;const d=h(8460),b=h(844),m=h(9092);class w extends b.Disposable{constructor(T,E){super(),this._optionsService=T,this._bufferService=E,this._onBufferActivate=this.register(new d.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new m.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new m.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(T){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(T),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(T,E){this._normal.resize(T,E),this._alt.resize(T,E),this.setupTabStops(T)}setupTabStops(T){this._normal.setupTabStops(T),this._alt.setupTabStops(T)}}c.BufferSet=w},511:(g,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CellData=void 0;const d=h(482),b=h(643),m=h(3734);class w extends m.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new m.ExtendedAttrs,this.combinedData=""}static fromCharData(T){const E=new w;return E.setFromCharData(T),E}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(T){this.fg=T[b.CHAR_DATA_ATTR_INDEX],this.bg=0;let E=!1;if(T[b.CHAR_DATA_CHAR_INDEX].length>2)E=!0;else if(T[b.CHAR_DATA_CHAR_INDEX].length===2){const p=T[b.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=p&&p<=56319){const v=T[b.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=v&&v<=57343?this.content=1024*(p-55296)+v-56320+65536|T[b.CHAR_DATA_WIDTH_INDEX]<<22:E=!0}else E=!0}else this.content=T[b.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|T[b.CHAR_DATA_WIDTH_INDEX]<<22;E&&(this.combinedData=T[b.CHAR_DATA_CHAR_INDEX],this.content=2097152|T[b.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}c.CellData=w},643:(g,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:(g,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Marker=void 0;const d=h(8460),b=h(844);class m{get id(){return this._id}constructor(x){this.line=x,this.isDisposed=!1,this._disposables=[],this._id=m._nextId++,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,b.disposeArray)(this._disposables),this._disposables.length=0)}register(x){return this._disposables.push(x),x}}c.Marker=m,m._nextId=1},7116:(g,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:(g,c)=>{var h,d,b;Object.defineProperty(c,"__esModule",{value:!0}),c.C1_ESCAPED=c.C1=c.C0=void 0,(function(m){m.NUL="\0",m.SOH="",m.STX="",m.ETX="",m.EOT="",m.ENQ="",m.ACK="",m.BEL="\x07",m.BS="\b",m.HT=" ",m.LF=`
|
|
81
|
+
`,m.VT="\v",m.FF="\f",m.CR="\r",m.SO="",m.SI="",m.DLE="",m.DC1="",m.DC2="",m.DC3="",m.DC4="",m.NAK="",m.SYN="",m.ETB="",m.CAN="",m.EM="",m.SUB="",m.ESC="\x1B",m.FS="",m.GS="",m.RS="",m.US="",m.SP=" ",m.DEL=""})(h||(c.C0=h={})),(function(m){m.PAD="",m.HOP="",m.BPH="",m.NBH="",m.IND="",m.NEL="
",m.SSA="",m.ESA="",m.HTS="",m.HTJ="",m.VTS="",m.PLD="",m.PLU="",m.RI="",m.SS2="",m.SS3="",m.DCS="",m.PU1="",m.PU2="",m.STS="",m.CCH="",m.MW="",m.SPA="",m.EPA="",m.SOS="",m.SGCI="",m.SCI="",m.CSI="",m.ST="",m.OSC="",m.PM="",m.APC=""})(d||(c.C1=d={})),(function(m){m.ST=`${h.ESC}\\`})(b||(c.C1_ESCAPED=b={}))},7399:(g,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.evaluateKeyboardEvent=void 0;const d=h(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(m,w,x,T){const E={type:0,cancel:!1,key:void 0},p=(m.shiftKey?1:0)|(m.altKey?2:0)|(m.ctrlKey?4:0)|(m.metaKey?8:0);switch(m.keyCode){case 0:m.key==="UIKeyInputUpArrow"?E.key=w?d.C0.ESC+"OA":d.C0.ESC+"[A":m.key==="UIKeyInputLeftArrow"?E.key=w?d.C0.ESC+"OD":d.C0.ESC+"[D":m.key==="UIKeyInputRightArrow"?E.key=w?d.C0.ESC+"OC":d.C0.ESC+"[C":m.key==="UIKeyInputDownArrow"&&(E.key=w?d.C0.ESC+"OB":d.C0.ESC+"[B");break;case 8:E.key=m.ctrlKey?"\b":d.C0.DEL,m.altKey&&(E.key=d.C0.ESC+E.key);break;case 9:if(m.shiftKey){E.key=d.C0.ESC+"[Z";break}E.key=d.C0.HT,E.cancel=!0;break;case 13:E.key=m.altKey?d.C0.ESC+d.C0.CR:d.C0.CR,E.cancel=!0;break;case 27:E.key=d.C0.ESC,m.altKey&&(E.key=d.C0.ESC+d.C0.ESC),E.cancel=!0;break;case 37:if(m.metaKey)break;p?(E.key=d.C0.ESC+"[1;"+(p+1)+"D",E.key===d.C0.ESC+"[1;3D"&&(E.key=d.C0.ESC+(x?"b":"[1;5D"))):E.key=w?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(m.metaKey)break;p?(E.key=d.C0.ESC+"[1;"+(p+1)+"C",E.key===d.C0.ESC+"[1;3C"&&(E.key=d.C0.ESC+(x?"f":"[1;5C"))):E.key=w?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(m.metaKey)break;p?(E.key=d.C0.ESC+"[1;"+(p+1)+"A",x||E.key!==d.C0.ESC+"[1;3A"||(E.key=d.C0.ESC+"[1;5A")):E.key=w?d.C0.ESC+"OA":d.C0.ESC+"[A";break;case 40:if(m.metaKey)break;p?(E.key=d.C0.ESC+"[1;"+(p+1)+"B",x||E.key!==d.C0.ESC+"[1;3B"||(E.key=d.C0.ESC+"[1;5B")):E.key=w?d.C0.ESC+"OB":d.C0.ESC+"[B";break;case 45:m.shiftKey||m.ctrlKey||(E.key=d.C0.ESC+"[2~");break;case 46:E.key=p?d.C0.ESC+"[3;"+(p+1)+"~":d.C0.ESC+"[3~";break;case 36:E.key=p?d.C0.ESC+"[1;"+(p+1)+"H":w?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:E.key=p?d.C0.ESC+"[1;"+(p+1)+"F":w?d.C0.ESC+"OF":d.C0.ESC+"[F";break;case 33:m.shiftKey?E.type=2:m.ctrlKey?E.key=d.C0.ESC+"[5;"+(p+1)+"~":E.key=d.C0.ESC+"[5~";break;case 34:m.shiftKey?E.type=3:m.ctrlKey?E.key=d.C0.ESC+"[6;"+(p+1)+"~":E.key=d.C0.ESC+"[6~";break;case 112:E.key=p?d.C0.ESC+"[1;"+(p+1)+"P":d.C0.ESC+"OP";break;case 113:E.key=p?d.C0.ESC+"[1;"+(p+1)+"Q":d.C0.ESC+"OQ";break;case 114:E.key=p?d.C0.ESC+"[1;"+(p+1)+"R":d.C0.ESC+"OR";break;case 115:E.key=p?d.C0.ESC+"[1;"+(p+1)+"S":d.C0.ESC+"OS";break;case 116:E.key=p?d.C0.ESC+"[15;"+(p+1)+"~":d.C0.ESC+"[15~";break;case 117:E.key=p?d.C0.ESC+"[17;"+(p+1)+"~":d.C0.ESC+"[17~";break;case 118:E.key=p?d.C0.ESC+"[18;"+(p+1)+"~":d.C0.ESC+"[18~";break;case 119:E.key=p?d.C0.ESC+"[19;"+(p+1)+"~":d.C0.ESC+"[19~";break;case 120:E.key=p?d.C0.ESC+"[20;"+(p+1)+"~":d.C0.ESC+"[20~";break;case 121:E.key=p?d.C0.ESC+"[21;"+(p+1)+"~":d.C0.ESC+"[21~";break;case 122:E.key=p?d.C0.ESC+"[23;"+(p+1)+"~":d.C0.ESC+"[23~";break;case 123:E.key=p?d.C0.ESC+"[24;"+(p+1)+"~":d.C0.ESC+"[24~";break;default:if(!m.ctrlKey||m.shiftKey||m.altKey||m.metaKey)if(x&&!T||!m.altKey||m.metaKey)!x||m.altKey||m.ctrlKey||m.shiftKey||!m.metaKey?m.key&&!m.ctrlKey&&!m.altKey&&!m.metaKey&&m.keyCode>=48&&m.key.length===1?E.key=m.key:m.key&&m.ctrlKey&&(m.key==="_"&&(E.key=d.C0.US),m.key==="@"&&(E.key=d.C0.NUL)):m.keyCode===65&&(E.type=1);else{const v=b[m.keyCode],_=v?.[m.shiftKey?1:0];if(_)E.key=d.C0.ESC+_;else if(m.keyCode>=65&&m.keyCode<=90){const S=m.ctrlKey?m.keyCode-64:m.keyCode+32;let k=String.fromCharCode(S);m.shiftKey&&(k=k.toUpperCase()),E.key=d.C0.ESC+k}else if(m.keyCode===32)E.key=d.C0.ESC+(m.ctrlKey?d.C0.NUL:" ");else if(m.key==="Dead"&&m.code.startsWith("Key")){let S=m.code.slice(3,4);m.shiftKey||(S=S.toLowerCase()),E.key=d.C0.ESC+S,E.cancel=!0}}else m.keyCode>=65&&m.keyCode<=90?E.key=String.fromCharCode(m.keyCode-64):m.keyCode===32?E.key=d.C0.NUL:m.keyCode>=51&&m.keyCode<=55?E.key=String.fromCharCode(m.keyCode-51+27):m.keyCode===56?E.key=d.C0.DEL:m.keyCode===219?E.key=d.C0.ESC:m.keyCode===220?E.key=d.C0.FS:m.keyCode===221&&(E.key=d.C0.GS)}return E}},482:(g,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Utf8ToUtf32=c.StringToUtf32=c.utf32ToString=c.stringFromCodePoint=void 0,c.stringFromCodePoint=function(h){return h>65535?(h-=65536,String.fromCharCode(55296+(h>>10))+String.fromCharCode(h%1024+56320)):String.fromCharCode(h)},c.utf32ToString=function(h,d=0,b=h.length){let m="";for(let w=d;w<b;++w){let x=h[w];x>65535?(x-=65536,m+=String.fromCharCode(55296+(x>>10))+String.fromCharCode(x%1024+56320)):m+=String.fromCharCode(x)}return m},c.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(h,d){const b=h.length;if(!b)return 0;let m=0,w=0;if(this._interim){const x=h.charCodeAt(w++);56320<=x&&x<=57343?d[m++]=1024*(this._interim-55296)+x-56320+65536:(d[m++]=this._interim,d[m++]=x),this._interim=0}for(let x=w;x<b;++x){const T=h.charCodeAt(x);if(55296<=T&&T<=56319){if(++x>=b)return this._interim=T,m;const E=h.charCodeAt(x);56320<=E&&E<=57343?d[m++]=1024*(T-55296)+E-56320+65536:(d[m++]=T,d[m++]=E)}else T!==65279&&(d[m++]=T)}return m}},c.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(h,d){const b=h.length;if(!b)return 0;let m,w,x,T,E=0,p=0,v=0;if(this.interim[0]){let k=!1,L=this.interim[0];L&=(224&L)==192?31:(240&L)==224?15:7;let R,N=0;for(;(R=63&this.interim[++N])&&N<4;)L<<=6,L|=R;const A=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,B=A-N;for(;v<B;){if(v>=b)return 0;if(R=h[v++],(192&R)!=128){v--,k=!0;break}this.interim[N++]=R,L<<=6,L|=63&R}k||(A===2?L<128?v--:d[E++]=L:A===3?L<2048||L>=55296&&L<=57343||L===65279||(d[E++]=L):L<65536||L>1114111||(d[E++]=L)),this.interim.fill(0)}const _=b-4;let S=v;for(;S<b;){for(;!(!(S<_)||128&(m=h[S])||128&(w=h[S+1])||128&(x=h[S+2])||128&(T=h[S+3]));)d[E++]=m,d[E++]=w,d[E++]=x,d[E++]=T,S+=4;if(m=h[S++],m<128)d[E++]=m;else if((224&m)==192){if(S>=b)return this.interim[0]=m,E;if(w=h[S++],(192&w)!=128){S--;continue}if(p=(31&m)<<6|63&w,p<128){S--;continue}d[E++]=p}else if((240&m)==224){if(S>=b)return this.interim[0]=m,E;if(w=h[S++],(192&w)!=128){S--;continue}if(S>=b)return this.interim[0]=m,this.interim[1]=w,E;if(x=h[S++],(192&x)!=128){S--;continue}if(p=(15&m)<<12|(63&w)<<6|63&x,p<2048||p>=55296&&p<=57343||p===65279)continue;d[E++]=p}else if((248&m)==240){if(S>=b)return this.interim[0]=m,E;if(w=h[S++],(192&w)!=128){S--;continue}if(S>=b)return this.interim[0]=m,this.interim[1]=w,E;if(x=h[S++],(192&x)!=128){S--;continue}if(S>=b)return this.interim[0]=m,this.interim[1]=w,this.interim[2]=x,E;if(T=h[S++],(192&T)!=128){S--;continue}if(p=(7&m)<<18|(63&w)<<12|(63&x)<<6|63&T,p<65536||p>1114111)continue;d[E++]=p}}return E}}},225:(g,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeV6=void 0;const d=h(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]],m=[[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 w;c.UnicodeV6=class{constructor(){if(this.version="6",!w){w=new Uint8Array(65536),w.fill(1),w[0]=0,w.fill(0,1,32),w.fill(0,127,160),w.fill(2,4352,4448),w[9001]=2,w[9002]=2,w.fill(2,11904,42192),w[12351]=1,w.fill(2,44032,55204),w.fill(2,63744,64256),w.fill(2,65040,65050),w.fill(2,65072,65136),w.fill(2,65280,65377),w.fill(2,65504,65511);for(let x=0;x<b.length;++x)w.fill(0,b[x][0],b[x][1]+1)}}wcwidth(x){return x<32?0:x<127?1:x<65536?w[x]:(function(T,E){let p,v=0,_=E.length-1;if(T<E[0][0]||T>E[_][1])return!1;for(;_>=v;)if(p=v+_>>1,T>E[p][1])v=p+1;else{if(!(T<E[p][0]))return!0;_=p-1}return!1})(x,m)?0:x>=131072&&x<=196605||x>=196608&&x<=262141?2:1}charProperties(x,T){let E=this.wcwidth(x),p=E===0&&T!==0;if(p){const v=d.UnicodeService.extractWidth(T);v===0?p=!1:v>E&&(E=v)}return d.UnicodeService.createPropertyValue(0,E,p)}}},5981:(g,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.WriteBuffer=void 0;const d=h(8460),b=h(844);class m extends b.Disposable{constructor(x){super(),this._action=x,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(x,T){if(T!==void 0&&this._syncCalls>T)return void(this._syncCalls=0);if(this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let E;for(this._isSyncWriting=!0;E=this._writeBuffer.shift();){this._action(E);const p=this._callbacks.shift();p&&p()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(x,T){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+=x.length,this._writeBuffer.push(x),this._callbacks.push(T),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(T)}_innerWrite(x=0,T=!0){const E=x||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const p=this._writeBuffer[this._bufferOffset],v=this._action(p,T);if(v){const S=k=>Date.now()-E>=12?setTimeout((()=>this._innerWrite(0,k))):this._innerWrite(E,k);return void v.catch((k=>(queueMicrotask((()=>{throw k})),Promise.resolve(!1)))).then(S)}const _=this._callbacks[this._bufferOffset];if(_&&_(),this._bufferOffset++,this._pendingData-=p.length,Date.now()-E>=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=m},5941:(g,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.toRgbString=c.parseColor=void 0;const h=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,d=/^[\da-f]+$/;function b(m,w){const x=m.toString(16),T=x.length<2?"0"+x:x;switch(w){case 4:return x[0];case 8:return T;case 12:return(T+T).slice(0,3);default:return T+T}}c.parseColor=function(m){if(!m)return;let w=m.toLowerCase();if(w.indexOf("rgb:")===0){w=w.slice(4);const x=h.exec(w);if(x){const T=x[1]?15:x[4]?255:x[7]?4095:65535;return[Math.round(parseInt(x[1]||x[4]||x[7]||x[10],16)/T*255),Math.round(parseInt(x[2]||x[5]||x[8]||x[11],16)/T*255),Math.round(parseInt(x[3]||x[6]||x[9]||x[12],16)/T*255)]}}else if(w.indexOf("#")===0&&(w=w.slice(1),d.exec(w)&&[3,6,9,12].includes(w.length))){const x=w.length/3,T=[0,0,0];for(let E=0;E<3;++E){const p=parseInt(w.slice(x*E,x*E+x),16);T[E]=x===1?p<<4:x===2?p:x===3?p>>4:p>>8}return T}},c.toRgbString=function(m,w=16){const[x,T,E]=m;return`rgb:${b(x,w)}/${b(T,w)}/${b(E,w)}`}},5770:(g,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.PAYLOAD_LIMIT=void 0,c.PAYLOAD_LIMIT=1e7},6351:(g,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DcsHandler=c.DcsParser=void 0;const d=h(482),b=h(8742),m=h(5770),w=[];c.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=w,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=w}registerHandler(T,E){this._handlers[T]===void 0&&(this._handlers[T]=[]);const p=this._handlers[T];return p.push(E),{dispose:()=>{const v=p.indexOf(E);v!==-1&&p.splice(v,1)}}}clearHandler(T){this._handlers[T]&&delete this._handlers[T]}setHandlerFallback(T){this._handlerFb=T}reset(){if(this._active.length)for(let T=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;T>=0;--T)this._active[T].unhook(!1);this._stack.paused=!1,this._active=w,this._ident=0}hook(T,E){if(this.reset(),this._ident=T,this._active=this._handlers[T]||w,this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].hook(E);else this._handlerFb(this._ident,"HOOK",E)}put(T,E,p){if(this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].put(T,E,p);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(T,E,p))}unhook(T,E=!0){if(this._active.length){let p=!1,v=this._active.length-1,_=!1;if(this._stack.paused&&(v=this._stack.loopPosition-1,p=E,_=this._stack.fallThrough,this._stack.paused=!1),!_&&p===!1){for(;v>=0&&(p=this._active[v].unhook(T),p!==!0);v--)if(p instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!1,p;v--}for(;v>=0;v--)if(p=this._active[v].unhook(!1),p instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!0,p}else this._handlerFb(this._ident,"UNHOOK",T);this._active=w,this._ident=0}};const x=new b.Params;x.addParam(0),c.DcsHandler=class{constructor(T){this._handler=T,this._data="",this._params=x,this._hitLimit=!1}hook(T){this._params=T.length>1||T.params[0]?T.clone():x,this._data="",this._hitLimit=!1}put(T,E,p){this._hitLimit||(this._data+=(0,d.utf32ToString)(T,E,p),this._data.length>m.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(T){let E=!1;if(this._hitLimit)E=!1;else if(T&&(E=this._handler(this._data,this._params),E instanceof Promise))return E.then((p=>(this._params=x,this._data="",this._hitLimit=!1,p)));return this._params=x,this._data="",this._hitLimit=!1,E}}},2015:(g,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.EscapeSequenceParser=c.VT500_TRANSITION_TABLE=c.TransitionTable=void 0;const d=h(844),b=h(8742),m=h(6242),w=h(6351);class x{constructor(v){this.table=new Uint8Array(v)}setDefault(v,_){this.table.fill(v<<4|_)}add(v,_,S,k){this.table[_<<8|v]=S<<4|k}addMany(v,_,S,k){for(let L=0;L<v.length;L++)this.table[_<<8|v[L]]=S<<4|k}}c.TransitionTable=x;const T=160;c.VT500_TRANSITION_TABLE=(function(){const p=new x(4095),v=Array.apply(null,Array(256)).map(((N,A)=>A)),_=(N,A)=>v.slice(N,A),S=_(32,127),k=_(0,24);k.push(25),k.push.apply(k,_(28,32));const L=_(0,14);let R;for(R in p.setDefault(1,0),p.addMany(S,0,2,0),L)p.addMany([24,26,153,154],R,3,0),p.addMany(_(128,144),R,3,0),p.addMany(_(144,152),R,3,0),p.add(156,R,0,0),p.add(27,R,11,1),p.add(157,R,4,8),p.addMany([152,158,159],R,0,7),p.add(155,R,11,3),p.add(144,R,11,9);return p.addMany(k,0,3,0),p.addMany(k,1,3,1),p.add(127,1,0,1),p.addMany(k,8,0,8),p.addMany(k,3,3,3),p.add(127,3,0,3),p.addMany(k,4,3,4),p.add(127,4,0,4),p.addMany(k,6,3,6),p.addMany(k,5,3,5),p.add(127,5,0,5),p.addMany(k,2,3,2),p.add(127,2,0,2),p.add(93,1,4,8),p.addMany(S,8,5,8),p.add(127,8,5,8),p.addMany([156,27,24,26,7],8,6,0),p.addMany(_(28,32),8,0,8),p.addMany([88,94,95],1,0,7),p.addMany(S,7,0,7),p.addMany(k,7,0,7),p.add(156,7,0,0),p.add(127,7,0,7),p.add(91,1,11,3),p.addMany(_(64,127),3,7,0),p.addMany(_(48,60),3,8,4),p.addMany([60,61,62,63],3,9,4),p.addMany(_(48,60),4,8,4),p.addMany(_(64,127),4,7,0),p.addMany([60,61,62,63],4,0,6),p.addMany(_(32,64),6,0,6),p.add(127,6,0,6),p.addMany(_(64,127),6,0,0),p.addMany(_(32,48),3,9,5),p.addMany(_(32,48),5,9,5),p.addMany(_(48,64),5,0,6),p.addMany(_(64,127),5,7,0),p.addMany(_(32,48),4,9,5),p.addMany(_(32,48),1,9,2),p.addMany(_(32,48),2,9,2),p.addMany(_(48,127),2,10,0),p.addMany(_(48,80),1,10,0),p.addMany(_(81,88),1,10,0),p.addMany([89,90,92],1,10,0),p.addMany(_(96,127),1,10,0),p.add(80,1,11,9),p.addMany(k,9,0,9),p.add(127,9,0,9),p.addMany(_(28,32),9,0,9),p.addMany(_(32,48),9,9,12),p.addMany(_(48,60),9,8,10),p.addMany([60,61,62,63],9,9,10),p.addMany(k,11,0,11),p.addMany(_(32,128),11,0,11),p.addMany(_(28,32),11,0,11),p.addMany(k,10,0,10),p.add(127,10,0,10),p.addMany(_(28,32),10,0,10),p.addMany(_(48,60),10,8,10),p.addMany([60,61,62,63],10,0,11),p.addMany(_(32,48),10,9,12),p.addMany(k,12,0,12),p.add(127,12,0,12),p.addMany(_(28,32),12,0,12),p.addMany(_(32,48),12,9,12),p.addMany(_(48,64),12,0,11),p.addMany(_(64,127),12,12,13),p.addMany(_(64,127),10,12,13),p.addMany(_(64,127),9,12,13),p.addMany(k,13,13,13),p.addMany(S,13,13,13),p.add(127,13,0,13),p.addMany([27,156,24,26],13,14,0),p.add(T,0,2,0),p.add(T,8,5,8),p.add(T,6,0,6),p.add(T,11,0,11),p.add(T,13,13,13),p})();class E extends d.Disposable{constructor(v=c.VT500_TRANSITION_TABLE){super(),this._transitions=v,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new b.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(_,S,k)=>{},this._executeHandlerFb=_=>{},this._csiHandlerFb=(_,S)=>{},this._escHandlerFb=_=>{},this._errorHandlerFb=_=>_,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,d.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new m.OscParser),this._dcsParser=this.register(new w.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(v,_=[64,126]){let S=0;if(v.prefix){if(v.prefix.length>1)throw new Error("only one byte as prefix supported");if(S=v.prefix.charCodeAt(0),S&&60>S||S>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(v.intermediates){if(v.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let L=0;L<v.intermediates.length;++L){const R=v.intermediates.charCodeAt(L);if(32>R||R>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");S<<=8,S|=R}}if(v.final.length!==1)throw new Error("final must be a single byte");const k=v.final.charCodeAt(0);if(_[0]>k||k>_[1])throw new Error(`final must be in range ${_[0]} .. ${_[1]}`);return S<<=8,S|=k,S}identToString(v){const _=[];for(;v;)_.push(String.fromCharCode(255&v)),v>>=8;return _.reverse().join("")}setPrintHandler(v){this._printHandler=v}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(v,_){const S=this._identifier(v,[48,126]);this._escHandlers[S]===void 0&&(this._escHandlers[S]=[]);const k=this._escHandlers[S];return k.push(_),{dispose:()=>{const L=k.indexOf(_);L!==-1&&k.splice(L,1)}}}clearEscHandler(v){this._escHandlers[this._identifier(v,[48,126])]&&delete this._escHandlers[this._identifier(v,[48,126])]}setEscHandlerFallback(v){this._escHandlerFb=v}setExecuteHandler(v,_){this._executeHandlers[v.charCodeAt(0)]=_}clearExecuteHandler(v){this._executeHandlers[v.charCodeAt(0)]&&delete this._executeHandlers[v.charCodeAt(0)]}setExecuteHandlerFallback(v){this._executeHandlerFb=v}registerCsiHandler(v,_){const S=this._identifier(v);this._csiHandlers[S]===void 0&&(this._csiHandlers[S]=[]);const k=this._csiHandlers[S];return k.push(_),{dispose:()=>{const L=k.indexOf(_);L!==-1&&k.splice(L,1)}}}clearCsiHandler(v){this._csiHandlers[this._identifier(v)]&&delete this._csiHandlers[this._identifier(v)]}setCsiHandlerFallback(v){this._csiHandlerFb=v}registerDcsHandler(v,_){return this._dcsParser.registerHandler(this._identifier(v),_)}clearDcsHandler(v){this._dcsParser.clearHandler(this._identifier(v))}setDcsHandlerFallback(v){this._dcsParser.setHandlerFallback(v)}registerOscHandler(v,_){return this._oscParser.registerHandler(v,_)}clearOscHandler(v){this._oscParser.clearHandler(v)}setOscHandlerFallback(v){this._oscParser.setHandlerFallback(v)}setErrorHandler(v){this._errorHandler=v}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(v,_,S,k,L){this._parseStack.state=v,this._parseStack.handlers=_,this._parseStack.handlerPos=S,this._parseStack.transition=k,this._parseStack.chunkPos=L}parse(v,_,S){let k,L=0,R=0,N=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,N=this._parseStack.chunkPos+1;else{if(S===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const A=this._parseStack.handlers;let B=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(S===!1&&B>-1){for(;B>=0&&(k=A[B](this._params),k!==!0);B--)if(k instanceof Promise)return this._parseStack.handlerPos=B,k}this._parseStack.handlers=[];break;case 4:if(S===!1&&B>-1){for(;B>=0&&(k=A[B](),k!==!0);B--)if(k instanceof Promise)return this._parseStack.handlerPos=B,k}this._parseStack.handlers=[];break;case 6:if(L=v[this._parseStack.chunkPos],k=this._dcsParser.unhook(L!==24&&L!==26,S),k)return k;L===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(L=v[this._parseStack.chunkPos],k=this._oscParser.end(L!==24&&L!==26,S),k)return k;L===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,N=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let A=N;A<_;++A){switch(L=v[A],R=this._transitions.table[this.currentState<<8|(L<160?L:T)],R>>4){case 2:for(let I=A+1;;++I){if(I>=_||(L=v[I])<32||L>126&&L<T){this._printHandler(v,A,I),A=I-1;break}if(++I>=_||(L=v[I])<32||L>126&&L<T){this._printHandler(v,A,I),A=I-1;break}if(++I>=_||(L=v[I])<32||L>126&&L<T){this._printHandler(v,A,I),A=I-1;break}if(++I>=_||(L=v[I])<32||L>126&&L<T){this._printHandler(v,A,I),A=I-1;break}}break;case 3:this._executeHandlers[L]?this._executeHandlers[L]():this._executeHandlerFb(L),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:A,code:L,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const B=this._csiHandlers[this._collect<<8|L];let q=B?B.length-1:-1;for(;q>=0&&(k=B[q](this._params),k!==!0);q--)if(k instanceof Promise)return this._preserveStack(3,B,q,R,A),k;q<0&&this._csiHandlerFb(this._collect<<8|L,this._params),this.precedingJoinState=0;break;case 8:do switch(L){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(L-48)}while(++A<_&&(L=v[A])>47&&L<60);A--;break;case 9:this._collect<<=8,this._collect|=L;break;case 10:const F=this._escHandlers[this._collect<<8|L];let W=F?F.length-1:-1;for(;W>=0&&(k=F[W](),k!==!0);W--)if(k instanceof Promise)return this._preserveStack(4,F,W,R,A),k;W<0&&this._escHandlerFb(this._collect<<8|L),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|L,this._params);break;case 13:for(let I=A+1;;++I)if(I>=_||(L=v[I])===24||L===26||L===27||L>127&&L<T){this._dcsParser.put(v,A,I),A=I-1;break}break;case 14:if(k=this._dcsParser.unhook(L!==24&&L!==26),k)return this._preserveStack(6,[],0,R,A),k;L===27&&(R|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let I=A+1;;I++)if(I>=_||(L=v[I])<32||L>127&&L<T){this._oscParser.put(v,A,I),A=I-1;break}break;case 6:if(k=this._oscParser.end(L!==24&&L!==26),k)return this._preserveStack(5,[],0,R,A),k;L===27&&(R|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&R}}}c.EscapeSequenceParser=E},6242:(g,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.OscHandler=c.OscParser=void 0;const d=h(5770),b=h(482),m=[];c.OscParser=class{constructor(){this._state=0,this._active=m,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(w,x){this._handlers[w]===void 0&&(this._handlers[w]=[]);const T=this._handlers[w];return T.push(x),{dispose:()=>{const E=T.indexOf(x);E!==-1&&T.splice(E,1)}}}clearHandler(w){this._handlers[w]&&delete this._handlers[w]}setHandlerFallback(w){this._handlerFb=w}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=m}reset(){if(this._state===2)for(let w=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;w>=0;--w)this._active[w].end(!1);this._stack.paused=!1,this._active=m,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||m,this._active.length)for(let w=this._active.length-1;w>=0;w--)this._active[w].start();else this._handlerFb(this._id,"START")}_put(w,x,T){if(this._active.length)for(let E=this._active.length-1;E>=0;E--)this._active[E].put(w,x,T);else this._handlerFb(this._id,"PUT",(0,b.utf32ToString)(w,x,T))}start(){this.reset(),this._state=1}put(w,x,T){if(this._state!==3){if(this._state===1)for(;x<T;){const E=w[x++];if(E===59){this._state=2,this._start();break}if(E<48||57<E)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+E-48}this._state===2&&T-x>0&&this._put(w,x,T)}}end(w,x=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let T=!1,E=this._active.length-1,p=!1;if(this._stack.paused&&(E=this._stack.loopPosition-1,T=x,p=this._stack.fallThrough,this._stack.paused=!1),!p&&T===!1){for(;E>=0&&(T=this._active[E].end(w),T!==!0);E--)if(T instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=E,this._stack.fallThrough=!1,T;E--}for(;E>=0;E--)if(T=this._active[E].end(!1),T instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=E,this._stack.fallThrough=!0,T}else this._handlerFb(this._id,"END",w);this._active=m,this._id=-1,this._state=0}}},c.OscHandler=class{constructor(w){this._handler=w,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(w,x,T){this._hitLimit||(this._data+=(0,b.utf32ToString)(w,x,T),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(w){let x=!1;if(this._hitLimit)x=!1;else if(w&&(x=this._handler(this._data),x instanceof Promise))return x.then((T=>(this._data="",this._hitLimit=!1,T)));return this._data="",this._hitLimit=!1,x}}},8742:(g,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Params=void 0;const h=2147483647;class d{static fromArray(m){const w=new d;if(!m.length)return w;for(let x=Array.isArray(m[0])?1:0;x<m.length;++x){const T=m[x];if(Array.isArray(T))for(let E=0;E<T.length;++E)w.addSubParam(T[E]);else w.addParam(T)}return w}constructor(m=32,w=32){if(this.maxLength=m,this.maxSubParamsLength=w,w>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(m),this.length=0,this._subParams=new Int32Array(w),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(m),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const m=new d(this.maxLength,this.maxSubParamsLength);return m.params.set(this.params),m.length=this.length,m._subParams.set(this._subParams),m._subParamsLength=this._subParamsLength,m._subParamsIdx.set(this._subParamsIdx),m._rejectDigits=this._rejectDigits,m._rejectSubDigits=this._rejectSubDigits,m._digitIsSub=this._digitIsSub,m}toArray(){const m=[];for(let w=0;w<this.length;++w){m.push(this.params[w]);const x=this._subParamsIdx[w]>>8,T=255&this._subParamsIdx[w];T-x>0&&m.push(Array.prototype.slice.call(this._subParams,x,T))}return m}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(m){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(m<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=m>h?h:m}}addSubParam(m){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(m<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=m>h?h:m,this._subParamsIdx[this.length-1]++}}hasSubParams(m){return(255&this._subParamsIdx[m])-(this._subParamsIdx[m]>>8)>0}getSubParams(m){const w=this._subParamsIdx[m]>>8,x=255&this._subParamsIdx[m];return x-w>0?this._subParams.subarray(w,x):null}getSubParamsAll(){const m={};for(let w=0;w<this.length;++w){const x=this._subParamsIdx[w]>>8,T=255&this._subParamsIdx[w];T-x>0&&(m[w]=this._subParams.slice(x,T))}return m}addDigit(m){let w;if(this._rejectDigits||!(w=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const x=this._digitIsSub?this._subParams:this.params,T=x[w-1];x[w-1]=~T?Math.min(10*T+m,h):m}}c.Params=d},5741:(g,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.AddonManager=void 0,c.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let h=this._addons.length-1;h>=0;h--)this._addons[h].instance.dispose()}loadAddon(h,d){const b={instance:d,dispose:d.dispose,isDisposed:!1};this._addons.push(b),d.dispose=()=>this._wrappedAddonDispose(b),d.activate(h)}_wrappedAddonDispose(h){if(h.isDisposed)return;let d=-1;for(let b=0;b<this._addons.length;b++)if(this._addons[b]===h){d=b;break}if(d===-1)throw new Error("Could not dispose an addon that has not been loaded");h.isDisposed=!0,h.dispose.apply(h.instance),this._addons.splice(d,1)}}},8771:(g,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferApiView=void 0;const d=h(3785),b=h(511);c.BufferApiView=class{constructor(m,w){this._buffer=m,this.type=w}init(m){return this._buffer=m,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(m){const w=this._buffer.lines.get(m);if(w)return new d.BufferLineApiView(w)}getNullCell(){return new b.CellData}}},3785:(g,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferLineApiView=void 0;const d=h(511);c.BufferLineApiView=class{constructor(b){this._line=b}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(b,m){if(!(b<0||b>=this._line.length))return m?(this._line.loadCell(b,m),m):this._line.loadCell(b,new d.CellData)}translateToString(b,m,w){return this._line.translateToString(b,m,w)}}},8285:(g,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferNamespaceApi=void 0;const d=h(8771),b=h(8460),m=h(844);class w extends m.Disposable{constructor(T){super(),this._core=T,this._onBufferChange=this.register(new b.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new d.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new d.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}c.BufferNamespaceApi=w},7975:(g,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ParserApi=void 0,c.ParserApi=class{constructor(h){this._core=h}registerCsiHandler(h,d){return this._core.registerCsiHandler(h,(b=>d(b.toArray())))}addCsiHandler(h,d){return this.registerCsiHandler(h,d)}registerDcsHandler(h,d){return this._core.registerDcsHandler(h,((b,m)=>d(b,m.toArray())))}addDcsHandler(h,d){return this.registerDcsHandler(h,d)}registerEscHandler(h,d){return this._core.registerEscHandler(h,d)}addEscHandler(h,d){return this.registerEscHandler(h,d)}registerOscHandler(h,d){return this._core.registerOscHandler(h,d)}addOscHandler(h,d){return this.registerOscHandler(h,d)}}},7090:(g,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeApi=void 0,c.UnicodeApi=class{constructor(h){this._core=h}register(h){this._core.unicodeService.register(h)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(h){this._core.unicodeService.activeVersion=h}}},744:function(g,c,h){var d=this&&this.__decorate||function(p,v,_,S){var k,L=arguments.length,R=L<3?v:S===null?S=Object.getOwnPropertyDescriptor(v,_):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(p,v,_,S);else for(var N=p.length-1;N>=0;N--)(k=p[N])&&(R=(L<3?k(R):L>3?k(v,_,R):k(v,_))||R);return L>3&&R&&Object.defineProperty(v,_,R),R},b=this&&this.__param||function(p,v){return function(_,S){v(_,S,p)}};Object.defineProperty(c,"__esModule",{value:!0}),c.BufferService=c.MINIMUM_ROWS=c.MINIMUM_COLS=void 0;const m=h(8460),w=h(844),x=h(5295),T=h(2585);c.MINIMUM_COLS=2,c.MINIMUM_ROWS=1;let E=c.BufferService=class extends w.Disposable{get buffer(){return this.buffers.active}constructor(p){super(),this.isUserScrolling=!1,this._onResize=this.register(new m.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new m.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 x.BufferSet(p,this))}resize(p,v){this.cols=p,this.rows=v,this.buffers.resize(p,v),this._onResize.fire({cols:p,rows:v})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(p,v=!1){const _=this.buffer;let S;S=this._cachedBlankLine,S&&S.length===this.cols&&S.getFg(0)===p.fg&&S.getBg(0)===p.bg||(S=_.getBlankLine(p,v),this._cachedBlankLine=S),S.isWrapped=v;const k=_.ybase+_.scrollTop,L=_.ybase+_.scrollBottom;if(_.scrollTop===0){const R=_.lines.isFull;L===_.lines.length-1?R?_.lines.recycle().copyFrom(S):_.lines.push(S.clone()):_.lines.splice(L+1,0,S.clone()),R?this.isUserScrolling&&(_.ydisp=Math.max(_.ydisp-1,0)):(_.ybase++,this.isUserScrolling||_.ydisp++)}else{const R=L-k+1;_.lines.shiftElements(k+1,R-1,-1),_.lines.set(L,S.clone())}this.isUserScrolling||(_.ydisp=_.ybase),this._onScroll.fire(_.ydisp)}scrollLines(p,v,_){const S=this.buffer;if(p<0){if(S.ydisp===0)return;this.isUserScrolling=!0}else p+S.ydisp>=S.ybase&&(this.isUserScrolling=!1);const k=S.ydisp;S.ydisp=Math.max(Math.min(S.ydisp+p,S.ybase),0),k!==S.ydisp&&(v||this._onScroll.fire(S.ydisp))}};c.BufferService=E=d([b(0,T.IOptionsService)],E)},7994:(g,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(h){this.glevel=h,this.charset=this._charsets[h]}setgCharset(h,d){this._charsets[h]=d,this.glevel===h&&(this.charset=d)}}},1753:function(g,c,h){var d=this&&this.__decorate||function(S,k,L,R){var N,A=arguments.length,B=A<3?k:R===null?R=Object.getOwnPropertyDescriptor(k,L):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(S,k,L,R);else for(var q=S.length-1;q>=0;q--)(N=S[q])&&(B=(A<3?N(B):A>3?N(k,L,B):N(k,L))||B);return A>3&&B&&Object.defineProperty(k,L,B),B},b=this&&this.__param||function(S,k){return function(L,R){k(L,R,S)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreMouseService=void 0;const m=h(2585),w=h(8460),x=h(844),T={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:S=>S.button!==4&&S.action===1&&(S.ctrl=!1,S.alt=!1,S.shift=!1,!0)},VT200:{events:19,restrict:S=>S.action!==32},DRAG:{events:23,restrict:S=>S.action!==32||S.button!==3},ANY:{events:31,restrict:S=>!0}};function E(S,k){let L=(S.ctrl?16:0)|(S.shift?4:0)|(S.alt?8:0);return S.button===4?(L|=64,L|=S.action):(L|=3&S.button,4&S.button&&(L|=64),8&S.button&&(L|=128),S.action===32?L|=32:S.action!==0||k||(L|=3)),L}const p=String.fromCharCode,v={DEFAULT:S=>{const k=[E(S,!1)+32,S.col+32,S.row+32];return k[0]>255||k[1]>255||k[2]>255?"":`\x1B[M${p(k[0])}${p(k[1])}${p(k[2])}`},SGR:S=>{const k=S.action===0&&S.button!==4?"m":"M";return`\x1B[<${E(S,!0)};${S.col};${S.row}${k}`},SGR_PIXELS:S=>{const k=S.action===0&&S.button!==4?"m":"M";return`\x1B[<${E(S,!0)};${S.x};${S.y}${k}`}};let _=c.CoreMouseService=class extends x.Disposable{constructor(S,k){super(),this._bufferService=S,this._coreService=k,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new w.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const L of Object.keys(T))this.addProtocol(L,T[L]);for(const L of Object.keys(v))this.addEncoding(L,v[L]);this.reset()}addProtocol(S,k){this._protocols[S]=k}addEncoding(S,k){this._encodings[S]=k}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(S){if(!this._protocols[S])throw new Error(`unknown protocol "${S}"`);this._activeProtocol=S,this._onProtocolChange.fire(this._protocols[S].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(S){if(!this._encodings[S])throw new Error(`unknown encoding "${S}"`);this._activeEncoding=S}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(S){if(S.col<0||S.col>=this._bufferService.cols||S.row<0||S.row>=this._bufferService.rows||S.button===4&&S.action===32||S.button===3&&S.action!==32||S.button!==4&&(S.action===2||S.action===3)||(S.col++,S.row++,S.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,S,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(S))return!1;const k=this._encodings[this._activeEncoding](S);return k&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(k):this._coreService.triggerDataEvent(k,!0)),this._lastEvent=S,!0}explainEvents(S){return{down:!!(1&S),up:!!(2&S),drag:!!(4&S),move:!!(8&S),wheel:!!(16&S)}}_equalEvents(S,k,L){if(L){if(S.x!==k.x||S.y!==k.y)return!1}else if(S.col!==k.col||S.row!==k.row)return!1;return S.button===k.button&&S.action===k.action&&S.ctrl===k.ctrl&&S.alt===k.alt&&S.shift===k.shift}};c.CoreMouseService=_=d([b(0,m.IBufferService),b(1,m.ICoreService)],_)},6975:function(g,c,h){var d=this&&this.__decorate||function(_,S,k,L){var R,N=arguments.length,A=N<3?S:L===null?L=Object.getOwnPropertyDescriptor(S,k):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(_,S,k,L);else for(var B=_.length-1;B>=0;B--)(R=_[B])&&(A=(N<3?R(A):N>3?R(S,k,A):R(S,k))||A);return N>3&&A&&Object.defineProperty(S,k,A),A},b=this&&this.__param||function(_,S){return function(k,L){S(k,L,_)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreService=void 0;const m=h(1439),w=h(8460),x=h(844),T=h(2585),E=Object.freeze({insertMode:!1}),p=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let v=c.CoreService=class extends x.Disposable{constructor(_,S,k){super(),this._bufferService=_,this._logService=S,this._optionsService=k,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new w.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new w.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new w.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new w.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,m.clone)(E),this.decPrivateModes=(0,m.clone)(p)}reset(){this.modes=(0,m.clone)(E),this.decPrivateModes=(0,m.clone)(p)}triggerDataEvent(_,S=!1){if(this._optionsService.rawOptions.disableStdin)return;const k=this._bufferService.buffer;S&&this._optionsService.rawOptions.scrollOnUserInput&&k.ybase!==k.ydisp&&this._onRequestScrollToBottom.fire(),S&&this._onUserInput.fire(),this._logService.debug(`sending data "${_}"`,(()=>_.split("").map((L=>L.charCodeAt(0))))),this._onData.fire(_)}triggerBinaryEvent(_){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${_}"`,(()=>_.split("").map((S=>S.charCodeAt(0))))),this._onBinary.fire(_))}};c.CoreService=v=d([b(0,T.IBufferService),b(1,T.ILogService),b(2,T.IOptionsService)],v)},9074:(g,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DecorationService=void 0;const d=h(8055),b=h(8460),m=h(844),w=h(6106);let x=0,T=0;class E extends m.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new w.SortedList((_=>_?.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,m.toDisposable)((()=>this.reset())))}registerDecoration(_){if(_.marker.isDisposed)return;const S=new p(_);if(S){const k=S.marker.onDispose((()=>S.dispose()));S.onDispose((()=>{S&&(this._decorations.delete(S)&&this._onDecorationRemoved.fire(S),k.dispose())})),this._decorations.insert(S),this._onDecorationRegistered.fire(S)}return S}reset(){for(const _ of this._decorations.values())_.dispose();this._decorations.clear()}*getDecorationsAtCell(_,S,k){let L=0,R=0;for(const N of this._decorations.getKeyIterator(S))L=N.options.x??0,R=L+(N.options.width??1),_>=L&&_<R&&(!k||(N.options.layer??"bottom")===k)&&(yield N)}forEachDecorationAtCell(_,S,k,L){this._decorations.forEachByKey(S,(R=>{x=R.options.x??0,T=x+(R.options.width??1),_>=x&&_<T&&(!k||(R.options.layer??"bottom")===k)&&L(R)}))}}c.DecorationService=E;class p extends m.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=d.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=d.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(_){super(),this.options=_,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=_.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(g,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.InstantiationService=c.ServiceCollection=void 0;const d=h(2585),b=h(8343);class m{constructor(...x){this._entries=new Map;for(const[T,E]of x)this.set(T,E)}set(x,T){const E=this._entries.get(x);return this._entries.set(x,T),E}forEach(x){for(const[T,E]of this._entries.entries())x(T,E)}has(x){return this._entries.has(x)}get(x){return this._entries.get(x)}}c.ServiceCollection=m,c.InstantiationService=class{constructor(){this._services=new m,this._services.set(d.IInstantiationService,this)}setService(w,x){this._services.set(w,x)}getService(w){return this._services.get(w)}createInstance(w,...x){const T=(0,b.getServiceDependencies)(w).sort(((v,_)=>v.index-_.index)),E=[];for(const v of T){const _=this._services.get(v.id);if(!_)throw new Error(`[createInstance] ${w.name} depends on UNKNOWN service ${v.id}.`);E.push(_)}const p=T.length>0?T[0].index:x.length;if(x.length!==p)throw new Error(`[createInstance] First service dependency of ${w.name} at position ${p+1} conflicts with ${x.length} static arguments`);return new w(...x,...E)}}},7866:function(g,c,h){var d=this&&this.__decorate||function(p,v,_,S){var k,L=arguments.length,R=L<3?v:S===null?S=Object.getOwnPropertyDescriptor(v,_):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(p,v,_,S);else for(var N=p.length-1;N>=0;N--)(k=p[N])&&(R=(L<3?k(R):L>3?k(v,_,R):k(v,_))||R);return L>3&&R&&Object.defineProperty(v,_,R),R},b=this&&this.__param||function(p,v){return function(_,S){v(_,S,p)}};Object.defineProperty(c,"__esModule",{value:!0}),c.traceCall=c.setTraceLogger=c.LogService=void 0;const m=h(844),w=h(2585),x={trace:w.LogLevelEnum.TRACE,debug:w.LogLevelEnum.DEBUG,info:w.LogLevelEnum.INFO,warn:w.LogLevelEnum.WARN,error:w.LogLevelEnum.ERROR,off:w.LogLevelEnum.OFF};let T,E=c.LogService=class extends m.Disposable{get logLevel(){return this._logLevel}constructor(p){super(),this._optionsService=p,this._logLevel=w.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),T=this}_updateLogLevel(){this._logLevel=x[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(p){for(let v=0;v<p.length;v++)typeof p[v]=="function"&&(p[v]=p[v]())}_log(p,v,_){this._evalLazyOptionalParams(_),p.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+v,..._)}trace(p,...v){this._logLevel<=w.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,p,v)}debug(p,...v){this._logLevel<=w.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,p,v)}info(p,...v){this._logLevel<=w.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,p,v)}warn(p,...v){this._logLevel<=w.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,p,v)}error(p,...v){this._logLevel<=w.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,p,v)}};c.LogService=E=d([b(0,w.IOptionsService)],E),c.setTraceLogger=function(p){T=p},c.traceCall=function(p,v,_){if(typeof _.value!="function")throw new Error("not supported");const S=_.value;_.value=function(...k){if(T.logLevel!==w.LogLevelEnum.TRACE)return S.apply(this,k);T.trace(`GlyphRenderer#${S.name}(${k.map((R=>JSON.stringify(R))).join(", ")})`);const L=S.apply(this,k);return T.trace(`GlyphRenderer#${S.name} return`,L),L}}},7302:(g,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.OptionsService=c.DEFAULT_OPTIONS=void 0;const d=h(8460),b=h(844),m=h(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:m.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const w=["normal","bold","100","200","300","400","500","600","700","800","900"];class x extends b.Disposable{constructor(E){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const p={...c.DEFAULT_OPTIONS};for(const v in E)if(v in p)try{const _=E[v];p[v]=this._sanitizeAndValidateOption(v,_)}catch(_){console.error(_)}this.rawOptions=p,this.options={...p},this._setupOptions(),this.register((0,b.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(E,p){return this.onOptionChange((v=>{v===E&&p(this.rawOptions[E])}))}onMultipleOptionChange(E,p){return this.onOptionChange((v=>{E.indexOf(v)!==-1&&p()}))}_setupOptions(){const E=v=>{if(!(v in c.DEFAULT_OPTIONS))throw new Error(`No option with key "${v}"`);return this.rawOptions[v]},p=(v,_)=>{if(!(v in c.DEFAULT_OPTIONS))throw new Error(`No option with key "${v}"`);_=this._sanitizeAndValidateOption(v,_),this.rawOptions[v]!==_&&(this.rawOptions[v]=_,this._onOptionChange.fire(v))};for(const v in this.rawOptions){const _={get:E.bind(this,v),set:p.bind(this,v)};Object.defineProperty(this.options,v,_)}}_sanitizeAndValidateOption(E,p){switch(E){case"cursorStyle":if(p||(p=c.DEFAULT_OPTIONS[E]),!(function(v){return v==="block"||v==="underline"||v==="bar"})(p))throw new Error(`"${p}" is not a valid value for ${E}`);break;case"wordSeparator":p||(p=c.DEFAULT_OPTIONS[E]);break;case"fontWeight":case"fontWeightBold":if(typeof p=="number"&&1<=p&&p<=1e3)break;p=w.includes(p)?p:c.DEFAULT_OPTIONS[E];break;case"cursorWidth":p=Math.floor(p);case"lineHeight":case"tabStopWidth":if(p<1)throw new Error(`${E} 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(`${E} cannot be less than 0, value: ${p}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(p<=0)throw new Error(`${E} cannot be less than or equal to 0, value: ${p}`);break;case"rows":case"cols":if(!p&&p!==0)throw new Error(`${E} must be numeric, value: ${p}`);break;case"windowsPty":p=p??{}}return p}}c.OptionsService=x},2660:function(g,c,h){var d=this&&this.__decorate||function(x,T,E,p){var v,_=arguments.length,S=_<3?T:p===null?p=Object.getOwnPropertyDescriptor(T,E):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(x,T,E,p);else for(var k=x.length-1;k>=0;k--)(v=x[k])&&(S=(_<3?v(S):_>3?v(T,E,S):v(T,E))||S);return _>3&&S&&Object.defineProperty(T,E,S),S},b=this&&this.__param||function(x,T){return function(E,p){T(E,p,x)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OscLinkService=void 0;const m=h(2585);let w=c.OscLinkService=class{constructor(x){this._bufferService=x,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(x){const T=this._bufferService.buffer;if(x.id===void 0){const k=T.addMarker(T.ybase+T.y),L={data:x,id:this._nextId++,lines:[k]};return k.onDispose((()=>this._removeMarkerFromLink(L,k))),this._dataByLinkId.set(L.id,L),L.id}const E=x,p=this._getEntryIdKey(E),v=this._entriesWithId.get(p);if(v)return this.addLineToLink(v.id,T.ybase+T.y),v.id;const _=T.addMarker(T.ybase+T.y),S={id:this._nextId++,key:this._getEntryIdKey(E),data:E,lines:[_]};return _.onDispose((()=>this._removeMarkerFromLink(S,_))),this._entriesWithId.set(S.key,S),this._dataByLinkId.set(S.id,S),S.id}addLineToLink(x,T){const E=this._dataByLinkId.get(x);if(E&&E.lines.every((p=>p.line!==T))){const p=this._bufferService.buffer.addMarker(T);E.lines.push(p),p.onDispose((()=>this._removeMarkerFromLink(E,p)))}}getLinkData(x){return this._dataByLinkId.get(x)?.data}_getEntryIdKey(x){return`${x.id};;${x.uri}`}_removeMarkerFromLink(x,T){const E=x.lines.indexOf(T);E!==-1&&(x.lines.splice(E,1),x.lines.length===0&&(x.data.id!==void 0&&this._entriesWithId.delete(x.key),this._dataByLinkId.delete(x.id)))}};c.OscLinkService=w=d([b(0,m.IBufferService)],w)},8343:(g,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.createDecorator=c.getServiceDependencies=c.serviceRegistry=void 0;const h="di$target",d="di$dependencies";c.serviceRegistry=new Map,c.getServiceDependencies=function(b){return b[d]||[]},c.createDecorator=function(b){if(c.serviceRegistry.has(b))return c.serviceRegistry.get(b);const m=function(w,x,T){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(E,p,v){p[h]===p?p[d].push({id:E,index:v}):(p[d]=[{id:E,index:v}],p[h]=p)})(m,w,T)};return m.toString=()=>b,c.serviceRegistry.set(b,m),m}},2585:(g,c,h)=>{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 d=h(8343);var b;c.IBufferService=(0,d.createDecorator)("BufferService"),c.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),c.ICoreService=(0,d.createDecorator)("CoreService"),c.ICharsetService=(0,d.createDecorator)("CharsetService"),c.IInstantiationService=(0,d.createDecorator)("InstantiationService"),(function(m){m[m.TRACE=0]="TRACE",m[m.DEBUG=1]="DEBUG",m[m.INFO=2]="INFO",m[m.WARN=3]="WARN",m[m.ERROR=4]="ERROR",m[m.OFF=5]="OFF"})(b||(c.LogLevelEnum=b={})),c.ILogService=(0,d.createDecorator)("LogService"),c.IOptionsService=(0,d.createDecorator)("OptionsService"),c.IOscLinkService=(0,d.createDecorator)("OscLinkService"),c.IUnicodeService=(0,d.createDecorator)("UnicodeService"),c.IDecorationService=(0,d.createDecorator)("DecorationService")},1480:(g,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeService=void 0;const d=h(8460),b=h(225);class m{static extractShouldJoin(x){return(1&x)!=0}static extractWidth(x){return x>>1&3}static extractCharKind(x){return x>>3}static createPropertyValue(x,T,E=!1){return(16777215&x)<<3|(3&T)<<1|(E?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const x=new b.UnicodeV6;this.register(x),this._active=x.version,this._activeProvider=x}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(x){if(!this._providers[x])throw new Error(`unknown Unicode version "${x}"`);this._active=x,this._activeProvider=this._providers[x],this._onChange.fire(x)}register(x){this._providers[x.version]=x}wcwidth(x){return this._activeProvider.wcwidth(x)}getStringCellWidth(x){let T=0,E=0;const p=x.length;for(let v=0;v<p;++v){let _=x.charCodeAt(v);if(55296<=_&&_<=56319){if(++v>=p)return T+this.wcwidth(_);const L=x.charCodeAt(v);56320<=L&&L<=57343?_=1024*(_-55296)+L-56320+65536:T+=this.wcwidth(L)}const S=this.charProperties(_,E);let k=m.extractWidth(S);m.extractShouldJoin(S)&&(k-=m.extractWidth(E)),T+=k,E=S}return T}charProperties(x,T){return this._activeProvider.charProperties(x,T)}}c.UnicodeService=m}},s={};function o(g){var c=s[g];if(c!==void 0)return c.exports;var h=s[g]={exports:{}};return i[g].call(h.exports,h,h.exports,o),h.exports}var f={};return(()=>{var g=f;Object.defineProperty(g,"__esModule",{value:!0}),g.Terminal=void 0;const c=o(9042),h=o(3236),d=o(844),b=o(5741),m=o(8285),w=o(7975),x=o(7090),T=["cols","rows"];class E extends d.Disposable{constructor(v){super(),this._core=this.register(new h.Terminal(v)),this._addonManager=this.register(new b.AddonManager),this._publicOptions={...this._core.options};const _=k=>this._core.options[k],S=(k,L)=>{this._checkReadonlyOptions(k),this._core.options[k]=L};for(const k in this._core.options){const L={get:_.bind(this,k),set:S.bind(this,k)};Object.defineProperty(this._publicOptions,k,L)}}_checkReadonlyOptions(v){if(T.includes(v))throw new Error(`Option "${v}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new w.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new x.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 m.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const v=this._core.coreService.decPrivateModes;let _="none";switch(this._core.coreMouseService.activeProtocol){case"X10":_="x10";break;case"VT200":_="vt200";break;case"DRAG":_="drag";break;case"ANY":_="any"}return{applicationCursorKeysMode:v.applicationCursorKeys,applicationKeypadMode:v.applicationKeypad,bracketedPasteMode:v.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:_,originMode:v.origin,reverseWraparoundMode:v.reverseWraparound,sendFocusMode:v.sendFocus,wraparoundMode:v.wraparound}}get options(){return this._publicOptions}set options(v){for(const _ in v)this._publicOptions[_]=v[_]}blur(){this._core.blur()}focus(){this._core.focus()}input(v,_=!0){this._core.input(v,_)}resize(v,_){this._verifyIntegers(v,_),this._core.resize(v,_)}open(v){this._core.open(v)}attachCustomKeyEventHandler(v){this._core.attachCustomKeyEventHandler(v)}attachCustomWheelEventHandler(v){this._core.attachCustomWheelEventHandler(v)}registerLinkProvider(v){return this._core.registerLinkProvider(v)}registerCharacterJoiner(v){return this._checkProposedApi(),this._core.registerCharacterJoiner(v)}deregisterCharacterJoiner(v){this._checkProposedApi(),this._core.deregisterCharacterJoiner(v)}registerMarker(v=0){return this._verifyIntegers(v),this._core.registerMarker(v)}registerDecoration(v){return this._checkProposedApi(),this._verifyPositiveIntegers(v.x??0,v.width??0,v.height??0),this._core.registerDecoration(v)}hasSelection(){return this._core.hasSelection()}select(v,_,S){this._verifyIntegers(v,_,S),this._core.select(v,_,S)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(v,_){this._verifyIntegers(v,_),this._core.selectLines(v,_)}dispose(){super.dispose()}scrollLines(v){this._verifyIntegers(v),this._core.scrollLines(v)}scrollPages(v){this._verifyIntegers(v),this._core.scrollPages(v)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(v){this._verifyIntegers(v),this._core.scrollToLine(v)}clear(){this._core.clear()}write(v,_){this._core.write(v,_)}writeln(v,_){this._core.write(v),this._core.write(`\r
|
|
82
|
+
`,_)}paste(v){this._core.paste(v)}refresh(v,_){this._verifyIntegers(v,_),this._core.refresh(v,_)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(v){this._addonManager.loadAddon(this,v)}static get strings(){return c}_verifyIntegers(...v){for(const _ of v)if(_===1/0||isNaN(_)||_%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...v){for(const _ of v)if(_&&(_===1/0||isNaN(_)||_%1!=0||_<0))throw new Error("This API only accepts positive integers")}}g.Terminal=E})(),f})()))})(op)),op.exports}var CM=xM();function EM(e){let n=!1,i=!1,s=!1,o=!1,f=null,g=null;const c=()=>{f!==null&&(clearTimeout(f),f=null),s=!1},h=()=>{g!==null&&(clearTimeout(g),g=null),i=!1},d=()=>{h(),i=!0,g=setTimeout(()=>{g=null,i=!1},0)},b=()=>{s=!1,f!==null&&clearTimeout(f),g!==null&&(clearTimeout(g),g=null),f=setTimeout(()=>{f=null,i=!1,e()},0)},m=()=>{n=!1,f===null&&(h(),s=!1)},w=()=>{n=!1,o=!1,h(),c()},x=T=>{if(f===null){if(n||i||TM(T)){s=!0,i&&!n?b():n=!0;return}e()}};return{onCompositionStart(){n=!0},onCompositionEnd(){n=!1,d(),s&&b()},onCompositionCancel:m,handleKeyEvent(T){return kM(T)&&T.shiftKey?(T.preventDefault?.(),T.type==="keydown"?(o=!0,x(T)):T.type==="keypress"?(o||x(T),o=!1):T.type==="keyup"&&(o=!1),!1):!0},dispose:w}}function kM(e){return e.key==="Enter"||e.code==="Enter"||e.keyCode===13||e.which===13}function TM(e){return e.isComposing===!0||e.keyCode===229||e.which===229}const bm=14,gx=10,mx=22,AM=128,RM=.5,LM="mmmmmmmmmmwwwwiIl1 0O-_|┌ABCxyz",MM=/[\x00-\x1F\x7F]/g,H1={min:gx,max:mx},NM="cascadia",kh=[{id:"cascadia",name:"Cascadia Code",familyName:"Cascadia Code Variable",family:'"Cascadia Code Variable", ui-monospace, "SF Mono", Menlo, monospace',meta:"Variable · terminal tuned"},{id:"jetbrains",name:"JetBrains Mono",familyName:"JetBrains Mono Variable",family:'"JetBrains Mono Variable", ui-monospace, "SF Mono", Menlo, monospace',meta:"Variable · console mono"},{id:"fira-code",name:"Fira Code",familyName:"Fira Code Variable",family:'"Fira Code Variable", ui-monospace, "SF Mono", Menlo, monospace',meta:"Variable · ligatures"},{id:"source-code-pro",name:"Source Code Pro",familyName:"Source Code Pro Variable",family:'"Source Code Pro Variable", ui-monospace, "SF Mono", Menlo, monospace',meta:"Variable · Adobe mono"}],ta=kh[0];function rh(e){return kh.find(n=>n.id===e)??ta}function Kl(){return{source:"curated",id:NM,customName:"",family:ta.family,size:bm}}function ym(e,n){const i=rh(e);return{source:"curated",id:i.id,customName:"",family:i.family,size:xm(n)}}function Sm(e,n){const i=IM(e);return{source:"custom",id:null,customName:i,family:i?`"${bx(i)}", ${ta.family}`:ta.family,size:xm(n)}}function _x(e){if(typeof e!="object"||e===null||Array.isArray(e))return null;const n=e,i=xm(typeof n.size=="number"?n.size:bm);return n.source==="custom"&&typeof n.customName=="string"?Sm(n.customName,i):typeof n.id=="string"&&jM(n.id)?ym(n.id,i):null}function wm(e){if(!e)return Kl();try{const n=_x(JSON.parse(e));if(n!==null)return n}catch{}return Kl()}function OM(e){return JSON.stringify({source:e.source,id:e.id,customName:e.customName,size:e.size})}function xm(e){return Number.isFinite(e)?Math.min(mx,Math.max(gx,Math.round(e))):bm}function vx(e){return e.source==="curated"?{status:"self-hosted",fallbackName:ta.name}:e.customName?{status:DM(e.customName)?"resolved":"fallback",fallbackName:ta.name}:{status:"fallback",fallbackName:ta.name}}function DM(e){if(typeof document>"u")return!1;const n=document.createElement("canvas").getContext("2d");if(!n)return!1;for(const i of["monospace","serif","sans-serif"]){const s=$1(n,`"${bx(e)}", ${i}`),o=$1(n,i);if(Math.abs(s-o)>RM)return!0}return!1}function $1(e,n){return e.font=`28px ${n}`,e.measureText(LM).width}function jM(e){return kh.some(n=>n.id===e)}function IM(e){return e.replace(MM,"").trim().slice(0,AM)}function bx(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}const sh="fleet-plugin.terminal.renderer",lo="fleet-plugin.terminal.font",U1="fleet-console.terminalRenderer",F1="fleet-console.terminalFont",dg=new Set;let ks=BM(),Vl=null,na=0;function BM(){return typeof window>"u"?{renderer:"webgl",font:Kl()}:(PM(),{renderer:FM(),font:WM()})}function PM(){if(!(typeof window>"u"))try{if(window.localStorage.getItem(sh)!==null||window.localStorage.getItem(lo)!==null)return;const e=window.localStorage.getItem(U1),n=window.localStorage.getItem(F1),i=e==="webgl"||e==="dom"?e:"webgl",s=wm(n);window.localStorage.setItem(sh,i),window.localStorage.setItem(lo,OM(s)),window.localStorage.removeItem(U1),window.localStorage.removeItem(F1)}catch{}}function zM(e){na+=1,Vl=e,UM()}function yx(){return M.useSyncExternalStore(KM,q1,q1)}function HM(e){GM(e),go({renderer:e})}function $M(e){const n=ym(e,ks.font.size);na+=1,go({font:n}),Th(n)}function W1(e){const n=Sm(e,ks.font.size);na+=1,go({font:n}),Th(n)}function G1(e){const n=ks.font.source==="custom"?Sm(ks.font.customName,e):ym(ks.font.id,e);na+=1,go({font:n}),Th(n)}async function UM(){if(!Vl)return;const e=na;try{const n=await Vl.read("terminal");if(n!==null){const i=_x(n.font);if(i!==null){if(e!==na)return;go({font:i});try{window.localStorage.removeItem(lo)}catch{}return}}if(typeof window<"u"){let i=null;try{i=window.localStorage.getItem(lo)}catch{}if(i!==null){const s=wm(i);if(e!==na)return;go({font:s}),Th(s);try{window.localStorage.removeItem(lo)}catch{}}}}catch{}}async function Th(e){if(Vl)try{await Vl.write("terminal",{font:{source:e.source,id:e.id,customName:e.customName,size:e.size}})}catch{}}function FM(){if(typeof window>"u")return"webgl";try{const e=window.localStorage.getItem(sh);return e==="webgl"||e==="dom"?e:"webgl"}catch{return"webgl"}}function WM(){if(typeof window>"u")return Kl();try{return wm(window.localStorage.getItem(lo))}catch{return Kl()}}function GM(e){if(!(typeof window>"u"))try{window.localStorage.setItem(sh,e)}catch{}}function qM(){for(const e of dg)e()}function go(e){ks={...ks,...e},qM()}function KM(e){return dg.add(e),()=>{dg.delete(e)}}function q1(){return ks}const VM={allowProposedApi:!0,convertEol:!0,cursorBlink:!0,cursorStyle:"block",lineHeight:1},YM=80,XM=16,ZM=250,JM=1024*1024,QM=120,e6={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)"},t6={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 Sx({operationId:e,ticketPath:n,wsPath:i,theme:s="maritime",onExit:o,active:f,zoom:g=1}){const c=s,{renderer:h,font:d}=yx(),b=M.useRef(null),m=M.useRef(null),w=M.useRef(null),x=M.useRef(null),T=M.useRef(null),E=M.useRef(null),[p,v]=M.useState(g),_=M.useRef(o);_.current=o;const S=M.useRef(f);S.current=f;const[k,L]=M.useState("connecting");M.useEffect(()=>{const A=b.current;if(!A)return;let B=!1;const q=new CM.Terminal({...VM,fontFamily:d.family,fontSize:d.size*p,theme:K1(c)});m.current=q;const F=new P3.FitAddon;E.current=F,q.loadAddon(F),q.open(A),q.loadAddon(new $3.Unicode11Addon),q.unicode.activeVersion="11";const W=EM(()=>q.input(`
|
|
83
|
+
`)),I=A.querySelector("textarea.xterm-helper-textarea, textarea")??A;I.addEventListener("compositionstart",W.onCompositionStart),I.addEventListener("compositionend",W.onCompositionEnd),I.addEventListener("focusout",W.onCompositionCancel),q.attachCustomKeyEventHandler(W.handleKeyEvent);const Y=i6(q,S.current!==!1);T.current=Y;const V=N3({operationId:e,ticketPath:n,wsPath:i,terminal:{onData:P=>q.onData(P),write:Y.write},onExit:()=>_.current?.(),onStatus:(P,Z)=>{L(Z?`${P}: ${Z}`:P)}});w.current=V;let z=null;const G=()=>{F.fit(),V.resize(q.cols,q.rows)},K=()=>{G(),q.refresh(0,q.rows-1)},j=()=>{z&&clearTimeout(z),z=setTimeout(()=>{z=null,B||K()},YM)},H=async()=>{await document.fonts?.ready,!B&&(G(),V.start(),S.current!==!1&&q.focus())},D=new ResizeObserver(j);return D.observe(A),H(),()=>{B=!0,D.disconnect(),z&&clearTimeout(z),I.removeEventListener("compositionstart",W.onCompositionStart),I.removeEventListener("compositionend",W.onCompositionEnd),I.removeEventListener("focusout",W.onCompositionCancel),W.dispose(),V.dispose(),Y.dispose(),m.current=null,w.current=null,T.current=null,E.current=null;try{q.dispose()}catch{}}},[e,n,i]),M.useEffect(()=>{if(T.current?.setActive(f!==!1),!f)return;n6(m.current);const A=window.requestAnimationFrame(()=>{S.current===!0&&wx(m.current)});return()=>window.cancelAnimationFrame(A)},[f]),M.useEffect(()=>{const A=m.current;if(!A)return;let B=!1;if(h==="webgl")try{const q=new wM;x.current=q,q.onContextLoss(()=>{if(!B){try{q.dispose()}catch{}x.current===q&&(x.current=null)}}),A.loadAddon(q)}catch{try{x.current?.dispose()}catch{}x.current=null}return()=>{B=!0;const q=x.current;if(q){x.current=null;try{q.dispose()}catch{}}}},[h,e]),M.useEffect(()=>{const A=m.current;A&&(A.options.theme=K1(c))},[c]),M.useEffect(()=>{const A=m.current;A&&(A.options.fontFamily=d.family,V1(A,E.current,w.current))},[d.family]),M.useEffect(()=>{if(g===p)return;const A=setTimeout(()=>v(g),QM);return()=>clearTimeout(A)},[g,p]),M.useEffect(()=>{const A=m.current;A&&(A.options.fontSize=d.size*p,V1(A,E.current,w.current))},[p,d.size]);const R=k.startsWith("live"),N=p===1?void 0:{width:`${p*100}%`,height:`${p*100}%`,transform:`scale(${1/p})`,transformOrigin:"0 0"};return u.jsx("section",{className:"terminal-stage","aria-label":"Terminal",children:u.jsxs("div",{className:"terminal-shell",children:[R?null:u.jsxs("div",{className:"terminal-status","aria-live":"polite",children:[u.jsx("span",{className:"terminal-status-dot","aria-hidden":"true"}),k]}),u.jsx("div",{className:"terminal-viewport",children:u.jsx("div",{className:"terminal-canvas",ref:b,style:N})})]})})}function K1(e){return e==="carbon"?t6:e6}function n6(e){e&&(e.focus(),wx(e))}function wx(e){e&&(e.scrollToBottom(),e.rows>0&&e.refresh(0,e.rows-1))}function i6(e,n){let i=n,s=!1,o=null,f=0,g=[];const c=()=>{o&&(clearTimeout(o),o=null)},h=()=>{if(c(),s||f===0)return;const b=r6(g,f);g=[],f=0,e.write(b)},d=()=>{s||o||f===0||(o=setTimeout(h,i?XM:ZM))};return{write:b=>{if(!(s||b.byteLength===0)){if(g.push(b),f+=b.byteLength,f>=JM){h();return}d()}},setActive:b=>{if(i!==b){if(i=b,c(),i){h();return}d()}},dispose:()=>{h(),s=!0,g=[],f=0,c()}}}function r6(e,n){if(e.length===1)return e[0]??new Uint8Array;const i=new Uint8Array(n);let s=0;for(const o of e)i.set(o,s),s+=o.byteLength;return i}function V1(e,n,i){n?.fit(),i?.resize(e.cols,e.rows),e.refresh(0,e.rows-1)}const s6=["canonicalCwd","cwd","providerSession","ticket","token","transcriptPath","prompt","persona","toolAllowlist"];class Qi extends Error{status;constructor(n,i){super(i),this.name="AgentApiError",this.status=n}}async function a6(e){const n=await fetch("/plugins/terminal/agent/state",{signal:e});await Ur(n);const i=await n.json();if(!Array.isArray(i.agentClis))throw new Qi(n.status,"Invalid agent state response");return i.agentClis.map(s=>g6(s,n.status))}async function o6(e){const n=await fetch("/plugins/terminal/agent/agent-cli/state",{signal:e});await Ur(n);const i=await n.json();if(!Array.isArray(i.clis))throw new Qi(n.status,"Invalid Agent CLI state response");return i}async function l6(e){const n=await fetch("/plugins/terminal/agent/tenants",{signal:e});await Ur(n);const i=await n.json();if(!Array.isArray(i.tenants))throw new Qi(n.status,"Invalid tenants response");return i.tenants.map(s=>m6(s,n.status))}async function c6(e){const n=await fetch("/plugins/terminal/agent/jobs",{signal:e});await Ur(n);const i=await n.json();if(!Array.isArray(i.tenants))throw new Qi(n.status,"Invalid jobs response");return i.tenants}async function u6(e){const n=await fetch("/plugins/terminal/agent/sessions",{signal:e});await Ur(n);const i=await n.json();if(!Array.isArray(i.sessions))throw new Qi(n.status,"Invalid agent sessions response");return i.sessions.map(s=>Ah(s,n.status))}async function h6(e){const n=await fetch("/api/v1/operations",{signal:e});await Ur(n);const i=await n.json();if(!Array.isArray(i.operations))throw new Qi(n.status,"Invalid operations response");return{operations:i.operations.map(s=>_6(s,n.status))}}async function d6(e,n,i){const s=await fetch("/plugins/terminal/agent/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({theaterId:e,cliId:n}),signal:i});return await Ur(s),Ah(await s.json(),s.status)}async function f6(e,n){const i=await fetch(`/plugins/terminal/agent/sessions/${encodeURIComponent(e)}/resume`,{method:"POST",signal:n});return await Ur(i),Ah(await i.json(),i.status)}async function p6(e,n){const i=await fetch(`/plugins/terminal/agent/sessions/${encodeURIComponent(e)}`,{method:"DELETE",signal:n});await Ur(i)}function Ah(e,n){const i=e;if(!i||typeof i.sessionId!="string"||typeof i.cwdLabel!="string"||typeof i.status!="string"||typeof i.createdAt!="number"||fg(i))throw new Qi(n,"Invalid agent session response");return{sessionId:i.sessionId,terminalSessionId:typeof i.terminalSessionId=="string"?i.terminalSessionId:i.sessionId,cwdLabel:i.cwdLabel,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}}async function Ur(e){if(!e.ok)throw new Qi(e.status,`Agent plugin request failed: ${e.status}`)}function g6(e,n){const i=e;if(!i||typeof i.id!="string"||typeof i.label!="string")throw new Qi(n,"Invalid Agent CLI metadata response");return{id:i.id,label:i.label,available:i.available===!0,signedIn:i.signedIn!==!1}}function m6(e,n){const i=e;if(!i||typeof i.tenantId!="string"||typeof i.tenantLabel!="string"||typeof i.createdAt!="number"||typeof i.sessions!="number")throw new Qi(n,"Invalid tenant response");return i}function _6(e,n){const i=e;if(!i||typeof i.id!="string"||typeof i.theaterId!="string"||typeof i.type!="string"||typeof i.pluginId!="string"||typeof i.title!="string"||!i.payload||typeof i.payload!="object"||Array.isArray(i.payload)||!i.ts||typeof i.ts.createdAt!="number"||typeof i.ts.updatedAt!="number"||fg(i)||fg(i.payload))throw new Qi(n,"Invalid operation response");return{id:i.id,theaterId:i.theaterId,type:i.type,pluginId:i.pluginId,title:i.title,payload:i.payload,geometry:i.geometry??null,ts:i.ts}}function fg(e){return pg(e,new Set(s6))}function pg(e,n){return!e||typeof e!="object"?!1:Array.isArray(e)?e.some(i=>pg(i,n)):Object.entries(e).some(([i,s])=>n.has(i)||pg(s,n))}const v6="active",gg=new Set(["done","error","aborted"]);function b6(e,n){let i=mg(e,n.jobId,n.updatedAt);for(const s of n.events)i=xx(i,s);return gg.has(n.status)&&!gg.has(i.status)&&(i={...i,status:n.status}),i}function xx(e,n){if(n.id<=e.lastEventId)return e;const i=n.event,s={...e,updatedAt:n.at,lastEventId:n.id,recentEvents:w6(e.recentEvents,n)};switch(n.type){case"job:registered":return y6(s,i);case"job:finalized":return{...s,status:sn(i.status)??"done",finishedAt:bs(i.finishedAt)??n.at,summary:sn(i.summary),error:sn(i.error)};case"track:begin":return Ga(s,i,n.id,o=>({...o,startedAt:bs(i.startedAt)??n.at,requestPreview:sn(i.requestPreview)}));case"track:status":return Ga(s,i,n.id,o=>({...o,status:sn(i.status)??o.status}));case"track:text":return Ga(s,i,n.id,o=>{const f=o.text+(sn(i.text)??"");return{...o,status:"stream",text:f,sentTextLength:o.sentTextLength+(bs(i.textLength)??sn(i.text)?.length??0),latestLine:X1(f)||o.latestLine}});case"track:thought":return Ga(s,i,n.id,o=>{const f=o.thought+(sn(i.text)??"");return{...o,thought:f,sentThoughtLength:o.sentThoughtLength+(bs(i.textLength)??sn(i.text)?.length??0),latestLine:X1(f)||o.latestLine}});case"track:tool":return Ga(s,i,n.id,o=>({...o,status:"stream",tools:S6(o.tools,i)}));case"track:finalized":return Ga(s,i,n.id,o=>{const f=Y1(o.text,o.sentTextLength,sn(i.fallbackText),bs(i.fallbackTextLength)),g=Y1(o.thought,o.sentThoughtLength,sn(i.fallbackThought),bs(i.fallbackThoughtLength));return{...o,status:sn(i.status)??"done",finishedAt:bs(i.finishedAt)??n.at,error:sn(i.error),text:f.text,sentTextLength:f.sentLength,thought:g.text,sentThoughtLength:g.sentLength}});default:return s}}function mg(e,n,i){return{jobId:n,tenantId:e,status:v6,updatedAt:i,trackOrder:[],tracks:{},lastEventId:0,recentEvents:[]}}function Cx(e){return gg.has(e)}function y6(e,n){const i=Array.isArray(n.tracks)?n.tracks:[];let s=e.trackOrder,o=e.tracks;for(const f of i){if(!f.trackId)continue;const g=o[f.trackId],c={...g??Ex(f.trackId),displayName:f.displayName??g?.displayName??f.trackId,displayCli:f.displayCli??g?.displayCli,model:f.model??g?.model,effort:f.effort??g?.effort,subtitle:f.subtitle??g?.subtitle,kind:f.kind??g?.kind,startedAt:f.startedAt??g?.startedAt};g||(s=[...s,f.trackId]),o={...o,[f.trackId]:c}}return{...e,label:sn(n.label)??e.label,ownerCarrierId:sn(n.ownerCarrierId)??e.ownerCarrierId,kind:sn(n.kind)??e.kind,signatureCli:sn(n.signatureCli)??e.signatureCli,startedAt:bs(n.startedAt)??e.startedAt,trackOrder:s,tracks:o}}function Ga(e,n,i,s){const o=sn(n.trackId);if(!o)return e;const f=e.tracks[o],g={...s(f??Ex(o)),lastEventId:i};return{...e,trackOrder:f?e.trackOrder:[...e.trackOrder,o],tracks:{...e.tracks,[o]:g}}}function Ex(e){return{trackId:e,displayName:e,status:"active",lastEventId:0,text:"",thought:"",sentTextLength:0,sentThoughtLength:0,tools:[]}}function S6(e,n){const i=sn(n.toolId)??sn(n.id);if(!i)return e;const s={id:i,name:sn(n.name),input:n.input,output:n.output,status:sn(n.status)},o=e.findIndex(f=>f.id===i);return o>=0?[...e.slice(0,o),{...e[o],...s},...e.slice(o+1)]:[...e,s]}function Y1(e,n,i,s){return i?n>=(s??i.length)?{text:e,sentLength:n}:{text:i,sentLength:s??i.length}:{text:e,sentLength:n}}function w6(e,n){return[...e,n].slice(-120)}function X1(e){const n=e.trim();if(!n)return"";const i=n.split(`
|
|
84
|
+
`);return i[i.length-1]?.trim()??""}function sn(e){return typeof e=="string"?e:void 0}function bs(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}const x6=new Set(["idle_prompt","permission_prompt","auth_success","elicitation_dialog","elicitation_complete","elicitation_response"]);function C6(){let e="";return n=>{e+=n;const i=[];let s=e.indexOf(`
|
|
85
|
+
|
|
86
|
+
`);for(;s>=0;){const o=e.slice(0,s);e=e.slice(s+2);const f=k6(o);f&&i.push(f),s=e.indexOf(`
|
|
87
|
+
|
|
88
|
+
`)}return i}}function E6(e){if(!e.data)return null;let n;try{n=JSON.parse(e.data)}catch{return null}if(e.event==="observer:truncated"){const s=n.tenant?.tenantId;return!s||!n.truncation?null:{kind:"truncation",tenantId:s,tenantLabel:n.tenant?.tenantLabel,truncation:n.truncation}}if(e.event==="session:updated"){const s=J1(n.session);return s?{kind:"session",tenantId:s.tenantId??s.sessionId,session:s}:null}if(e.event==="session:attention"){const s=J1(n.session);return s?{kind:"attention",tenantId:s.tenantId??s.sessionId,session:s,reason:T6(n.reason)}:null}const i=Z1(n.event)??Z1(n);return i?{kind:"event",tenantId:i.tenantId,tenantLabel:n.tenant?.tenantLabel,event:i}:null}function k6(e){const n=e.split(`
|
|
89
|
+
`),i=n.find(o=>o.startsWith("event:"))?.slice(6).trim()??"message",s=n.filter(o=>o.startsWith("data:")).map(o=>o.slice(5).trim()).join(`
|
|
90
|
+
`);return!s&&i==="message"?null:{event:i,data:s}}function Z1(e){if(typeof e!="object"||e===null)return null;const n=e;return typeof n.id!="number"||typeof n.tenantId!="string"||typeof n.type!="string"||typeof n.at!="number"?null:{...n,event:typeof n.event=="object"&&n.event!==null?n.event:{}}}function J1(e){try{return Ah(e,200)}catch{return null}}function T6(e){return typeof e=="string"&&x6.has(e)?e:void 0}const Cm={droppedCount:0},_g=new Set;let Ut={connection:"connecting",connectionError:null,agentClis:[],sessions:{},sessionOrder:[],tenants:[],tenantJobs:{},tenantOrder:[],activeTerminalSessionId:null,turnState:{}};function A6(){return jS(R6,kx)}function kx(){return Ut}function R6(e){return _g.add(e),()=>{_g.delete(e)}}function xi(e){Ut={...Ut,...e},I6()}function L6(e){xi({agentClis:e})}function M6(e){const n={};for(const i of e)n[i.sessionId]=i;xi({sessions:n,sessionOrder:[...e].sort((i,s)=>s.createdAt-i.createdAt).map(i=>i.sessionId)})}function ah(e){const n=!!Ut.sessions[e.sessionId];xi({sessions:{...Ut.sessions,[e.sessionId]:e},sessionOrder:n?Ut.sessionOrder:[e.sessionId,...Ut.sessionOrder],turnState:{...Ut.turnState,[e.sessionId]:e.turnState}})}function Tx(e){const{[e]:n,...i}=Ut.sessions,{[e]:s,...o}=Ut.turnState;xi({sessions:i,sessionOrder:Ut.sessionOrder.filter(f=>f!==e),activeTerminalSessionId:Ut.activeTerminalSessionId===e?null:Ut.activeTerminalSessionId,turnState:o})}function Ax(e){xi({activeTerminalSessionId:e})}function N6(e){xi({tenants:e,tenantOrder:[...e.map(n=>n.tenantId),...Ut.tenantOrder.filter(n=>!e.some(i=>i.tenantId===n)&&Ut.tenantJobs[n])]})}function O6(e){const n={};for(const i of e){const s={};for(const o of i.jobs)s[o.jobId]=b6(i.tenantId,o);n[i.tenantId]={tenantId:i.tenantId,tenantLabel:i.tenantLabel,jobOrder:i.jobs.map(o=>o.jobId),jobs:s,truncation:i.truncation??Cm}}xi({tenantJobs:n,tenantOrder:[...e.map(i=>i.tenantId),...Ut.tenantOrder.filter(i=>n[i])]})}function D6(e,n){const i=e.tenantId,s=e.jobId??B6(e),o=Ut.tenantJobs[i]??{tenantId:i,tenantLabel:n,jobOrder:[],jobs:{},truncation:Cm},f=s?o.jobs[s]??mg(i,s,e.at):mg(i,"__unknown__",e.at),g=xx(f,e),c=s&&o.jobOrder.includes(s)?o.jobOrder:s?[s,...o.jobOrder]:o.jobOrder,h={...o,tenantLabel:n??o.tenantLabel,jobOrder:c,jobs:s?{...o.jobs,[s]:g}:o.jobs};return xi({tenantJobs:{...Ut.tenantJobs,[i]:h},tenantOrder:Ut.tenantOrder.includes(i)?Ut.tenantOrder:[i,...Ut.tenantOrder]}),{job:g,unknownTenant:!Ut.tenantJobs[i]}}function j6(e,n,i){const s=Ut.tenantJobs[e]??{tenantId:e,tenantLabel:n,jobOrder:[],jobs:{},truncation:Cm};xi({tenantJobs:{...Ut.tenantJobs,[e]:{...s,tenantLabel:n??s.tenantLabel,truncation:i}}})}function Rx(e){const n=e.tenantId;if(!n)return[];const i=Ut.tenantJobs[n];return i?i.jobOrder.map(s=>i.jobs[s]).filter(s=>!!s):[]}function I6(){for(const e of _g)e()}function B6(e){const n=e.event;return typeof n.jobId=="string"?n.jobId:null}const Q1=250,P6=5e3,vg=new Map;function z6(e){const n=new AbortController;return H6(n.signal,e),()=>n.abort()}async function H6(e,n){let i=Q1;for(;!e.aborted;){xi({connection:"connecting"});try{await W6(e,n);const s=await fetch("/plugins/terminal/agent/events",{signal:e});if(!s.ok||!s.body)throw new Error(`Agent stream failed: ${s.status}`);xi({connection:"live",connectionError:null}),i=Q1,await $6(s.body.getReader(),e,n),e.aborted||xi({connection:"connecting",connectionError:null})}catch(s){if(e.aborted)return;xi({connection:"connecting",connectionError:s instanceof Error?s.message:String(s)})}if(e.aborted)return;await q6(i,e),i=Math.min(i*2,P6)}}async function $6(e,n,i){const s=new TextDecoder,o=C6();for(;!n.aborted;){const f=await e.read();if(f.done)return;for(const g of o(s.decode(f.value,{stream:!0}))){const c=E6(g);if(c){if(c.kind==="truncation"&&c.truncation){j6(c.tenantId,c.tenantLabel,c.truncation);continue}if(c.kind==="session"&&c.session){ah(c.session),oh(i,c.session.sessionId,Em(c.session));continue}if(c.kind==="attention"&&c.session){ah(c.session),c.reason!=="idle_prompt"&&oh(i,c.session.sessionId,"awaiting");continue}c.event&&(D6(c.event,c.tenantLabel),F6(i,c.event.tenantId))}}}}function Em(e){return e.status==="dormant"?"dormant":e.turnState==="running"||e.turnState==="ended"&&U6(e)?"running":"idle"}function U6(e){return Rx(e).some(n=>!Cx(n.status))}function oh(e,n,i){const s=vg.get(n);e.status.set(n,i),vg.set(n,i),s!==i&&(i==="awaiting"?e.notifications.emit({kind:"agent.attention",operationId:n,message:"Agent is waiting for input"}):i==="idle"&&(s==="running"||s==="awaiting")&&e.notifications.emit({kind:"agent.ended",operationId:n,message:"Agent turn ended"}))}function F6(e,n){const{sessions:i}=kx();for(const s of Object.values(i))s.tenantId===n&&vg.get(s.sessionId)!=="awaiting"&&oh(e,s.sessionId,Em(s))}async function W6(e,n){const[i,s,o,f,g]=await Promise.all([a6(e),u6(e),l6(e),c6(e),h6(e)]);L6(i),M6(s),N6(o),O6(f);for(const c of s)oh(n,c.sessionId,Em(c));G6(g.operations,n)}function G6(e,n){for(const i of e)i.pluginId==="terminal"&&i.type==="agent.streaming"&&n.operations.remove(i.id).catch(()=>{})}async function q6(e,n){await new Promise(i=>{const s=()=>{clearTimeout(o),n.removeEventListener("abort",s),i()},o=setTimeout(s,e);n.addEventListener("abort",s)})}const K6=new Set(["nimitz","kirov","genesis","ohio","sentinel","vanguard","tempest","chronicle"]),V6=new Set(["claude","codex","opencode-go","cursor"]);function Y6(e){const n=Math.max(0,Math.floor(e/1e3));if(n<60)return`${n}s`;const i=Math.floor(n/60),s=n%60;return`${i}m ${s}s`}function X6(e){return e<=0?"":e<1e3?`~${e} tokens`:`~${(e/1e3).toFixed(1).replace(/\.0$/,"")}k tokens`}function Z6(e){return e.trackOrder.reduce((n,i)=>{const s=e.tracks[i];return s?n+Math.round((s.sentTextLength+s.sentThoughtLength)/4):n},0)}function J6(e){if(e.kind==="taskforce")return"taskforce";const n=e.signatureCli;return n&&V6.has(n)?n:void 0}function Lx(e){if(e)return K6.has(e)?e:void 0}class Mx extends Error{status;constructor(n,i){super(i),this.name="TerminalSettingsApiError",this.status=n}}async function Q6(e){const n=await fetch("/plugins/terminal/settings",{signal:e});return await Nx(n),Ox(await n.json(),n.status)}async function e4(e,n){const i=await fetch("/plugins/terminal/settings",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:n});return await Nx(i),Ox(await i.json(),i.status)}async function Nx(e){if(e.ok)return;let n=e.statusText||`HTTP ${e.status}`;try{const i=await e.json();typeof i.error=="string"&&(n=i.error)}catch{}throw new Mx(e.status,n)}function Ox(e,n){const i=e;if(!i||typeof i.replaceSystemPrompt!="boolean"||typeof i.enableMetaphor!="boolean")throw new Mx(n,"Invalid Terminal settings response");return{replaceSystemPrompt:i.replaceSystemPrompt,enableMetaphor:i.enableMetaphor}}const bg=new Set;let lh={loading:!1,state:null,savingField:null,error:null},Gu=0;function t4(){return M.useSyncExternalStore(n4,ey,ey)}function ey(){return lh}function n4(e){return bg.add(e),()=>{bg.delete(e)}}async function i4(e){const n=++Gu;co({loading:!0,error:null});try{const i=await Q6(e);if(n!==Gu)return;co({loading:!1,state:i,error:null})}catch(i){if(e?.aborted||n!==Gu)return;co({loading:!1,error:Dx(i)})}}async function ty(e,n){const i=lh.state;if(!i)return!1;Gu+=1;const s={...i,[e]:n};co({state:s,savingField:e,error:null});try{const o=await e4(s);return co({state:o,savingField:null,error:null}),!0}catch(o){return co({state:i,savingField:null,error:Dx(o)}),!1}}function co(e){lh={...lh,...e};for(const n of bg)n()}function Dx(e){return e instanceof Error?e.message:String(e)}const r4=[{id:"webgl",label:"WebGL"},{id:"dom",label:"DOM"}],s4="/plugins/terminal/agent/ticket",a4="/plugins/terminal/ws",lp="fleet-plugin.terminal.stream-dock-expanded",o4="fleet-plugin.terminal.stream-dock-collapsed",l4=56,jx={pluginId:"terminal",type:"agent",title:"Agent",subtitle:e=>Nl(e.payload,"cliLabel")??void 0,render:e=>u.jsx(p4,{context:e})},Ix={id:"agent-cli",title:"Agent CLI",render:()=>u.jsx(_4,{})},Bx={id:"agent.attention",title:"Agent input waiting"},c4={id:"agent.ended",title:"Agent turn ended"},Cu={id:"terminal",operationKinds:[jx],settingsSections:[Ix],notificationKinds:[Bx,c4],install:e=>u4(e),closeOperation:async e=>{try{await p6(e)}finally{Tx(e)}},launch:async({theaterId:e,kind:n})=>{const i=await d6(e,n.id);return ah(i),Ax(i.sessionId),{id:i.sessionId}},renderLaunchIcon:()=>u.jsx(N4,{})};function u4(e){return z6({operations:e.operations,notifications:e.notifications,status:e.status,refreshOperations:e.api.resync})}function h4(e,n){const i=M.useRef(null),s=M.useRef(!0),[o,f]=M.useState(!0),g=M.useCallback(h=>{s.current!==h&&(s.current=h,f(h))},[]);M.useEffect(()=>{const h=i.current;if(!h)return;const d=()=>{const b=h.scrollHeight-h.scrollTop-h.clientHeight;g(b<=l4)};return h.addEventListener("scroll",d,{passive:!0}),()=>h.removeEventListener("scroll",d)},[g]),M.useLayoutEffect(()=>{g(!0);const h=i.current;h&&(h.scrollTop=h.scrollHeight)},[e,g]),M.useLayoutEffect(()=>{const h=i.current;!h||!s.current||(h.scrollTop=h.scrollHeight)},[n]);const c=M.useCallback(()=>{const h=i.current;h&&(h.scrollTop=h.scrollHeight,h.focus({preventScroll:!0}),g(!0))},[g]);return{containerRef:i,pinned:o,jumpToLatest:c}}function d4(){const[e,n]=M.useState(()=>{try{return localStorage.removeItem(o4),localStorage.getItem(lp)==="true"}catch{return!1}}),i=M.useCallback(s=>{try{s?localStorage.setItem(lp,"true"):localStorage.removeItem(lp)}catch{}n(s)},[]);return[e,i]}function f4(e){const[n,i]=M.useState(Date.now);return M.useEffect(()=>{if(e===void 0)return;const s=setInterval(()=>i(Date.now()),1e3);return()=>clearInterval(s)},[e]),e===void 0?"":Y6(n-e)}function p4({context:e}){const i=A6().sessions[e.operationId]??x4(e),[s,o]=M.useState(!1),f=M.useRef(null),g=M.useRef(null),c=M.useRef(null),d=Rx(i).filter(m=>!Cx(m.status)),b=M.useCallback(()=>{o(!1),c.current?.focus()},[]);return M.useLayoutEffect(()=>{s&&f.current?.focus()},[s]),M.useEffect(()=>{if(!s)return;const m=w=>{if(w.key==="Escape"){w.stopPropagation(),b();return}if(w.key==="Tab"){const x=g.current;if(!x)return;const T=Array.from(x.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(v=>!v.hasAttribute("disabled")),E=T[0],p=T[T.length-1];w.shiftKey&&document.activeElement===E?(w.preventDefault(),p?.focus()):!w.shiftKey&&document.activeElement===p&&(w.preventDefault(),E?.focus())}};return document.addEventListener("keydown",m,!0),()=>document.removeEventListener("keydown",m,!0)},[s,b]),i.status==="dormant"?u.jsxs("button",{type:"button",className:"canvas-operation-dormant",onClick:()=>{w4(i.sessionId)},children:[u.jsx("span",{className:"canvas-operation-dormant-status",children:"Dormant"}),u.jsx("span",{className:"canvas-operation-dormant-action",children:"Resume"})]}):u.jsxs("div",{className:"agent-stream-host",children:[u.jsx(Sx,{operationId:i.sessionId,ticketPath:s4,wsPath:a4,active:e.active,zoom:e.zoom,theme:e.theme,onExit:()=>Tx(i.sessionId)}),d.length>0?u.jsx(g4,{activeJobs:d,onOpenDetail:()=>o(!0),detailBtnRef:c}):null,s?u.jsxs("div",{ref:g,className:"job-overlay",role:"dialog","aria-modal":"true","aria-label":"Carrier stream details",children:[u.jsx("button",{type:"button",className:"job-overlay-scrim","aria-label":"Close",tabIndex:-1,onClick:b}),u.jsxs("div",{className:"job-overlay-card",children:[u.jsx("button",{ref:f,type:"button",className:"job-overlay-close","aria-label":"Close",onClick:b,children:"×"}),u.jsx("div",{className:"job-overlay-body",children:d.length===0?u.jsx("p",{className:"job-overlay-empty",children:"No active streams."}):d.map(m=>u.jsx(y4,{job:m},m.jobId))})]})]}):null]})}function g4({activeJobs:e,onOpenDetail:n,detailBtnRef:i}){const[s,o]=d4(),f=e[0],g=f4(f?.startedAt),c=e.reduce((k,L)=>k+Z6(L),0),h=X6(c),d=e.length===1&&f?J6(f):void 0,b=e.length===1&&f?Lx(f.ownerCarrierId):void 0,m=e.length===1&&f?f.label:void 0,w=e.length>1?`${e.length} carriers`:f?.ownerCarrierId??"Carrier",x=E4(e),T=e.map(k=>`${k.jobId}:${k.lastEventId}`).join(","),E=`${s}:${e.map(k=>k.jobId).join(",")}`,{containerRef:p,pinned:v,jumpToLatest:_}=h4(E,T),S=e.some(k=>k.trackOrder.some(L=>{const R=k.tracks[L];return R?km(R.status):!1}));return u.jsxs("div",{className:"job-dock","data-signature":d,children:[u.jsxs("div",{className:"job-dock-strip",children:[u.jsx("span",{className:"job-dock-dot","aria-hidden":"true"}),u.jsx("span",{className:"job-dock-carrier","data-captain":b,title:m,children:w}),u.jsxs("span",{className:"job-dock-strip-line",style:s?{display:"none"}:void 0,"aria-hidden":"true",children:[x,!s&&S&&x?u.jsx("span",{className:"job-dock-caret","aria-hidden":"true"}):null]}),u.jsxs("span",{className:"job-dock-meta",children:[g?u.jsx("span",{children:g}):null,h?u.jsx("span",{children:h}):null]}),u.jsx("button",{type:"button",className:"job-dock-grip","aria-label":s?"Collapse stream dock":"Expand stream dock","aria-expanded":s,onClick:()=>o(!s),children:s?"▼":"▲"}),u.jsx("button",{ref:i,type:"button",className:"job-dock-detail-btn",onClick:n,children:"Details"})]}),u.jsxs("div",{className:`job-dock-body-wrap${s?"":" is-collapsed"}`,children:[u.jsxs("div",{ref:p,className:"job-dock-body",tabIndex:-1,children:[e.length===1&&m?u.jsx("div",{className:"job-dock-row",children:u.jsx("span",{className:"job-dock-row-label",children:m})}):null,e.map(k=>{const L=e.length>1,R=!L&&k.trackOrder.length===1;return k.trackOrder.map(N=>{const A=k.tracks[N];return A?u.jsx(m4,{track:A,job:k,multiJob:L,singleTrack:R},`${k.jobId}:${N}`):null})})]}),v?null:u.jsx("button",{type:"button",className:"follow-button",onClick:_,children:"↓ Follow"})]})]})}function m4({track:e,job:n,multiJob:i,singleTrack:s}){const o=km(e.status),f=iy(e.text),g=iy(e.thought),c=f||g,h=!f&&!!g,d=o?C4(e):void 0,b=i||!s,m=i?Lx(n.ownerCarrierId):void 0;return u.jsxs("div",{className:"job-dock-row",children:[b?u.jsx("span",{className:"job-dock-row-name","data-captain":m,children:e.displayName}):null,u.jsxs("span",{className:`job-dock-row-status${o?" job-dock-row-status--live":""}`,children:[e.status,d?` · ${d}`:""]}),c?u.jsxs("span",{className:`job-dock-row-line${h?" is-thought":""}`,children:[c,o?u.jsx("span",{className:"job-dock-caret","aria-hidden":"true"}):null]}):null]})}function _4(){const[e,n]=M.useState([]),[i,s]=M.useState(null),{renderer:o,font:f}=yx();return M.useEffect(()=>{const g=new AbortController;return o6(g.signal).then(c=>n(c.clis)).catch(c=>{g.signal.aborted||s(c instanceof Error?c.message:String(c))}),()=>g.abort()},[]),u.jsxs(u.Fragment,{children:[u.jsx(v4,{}),u.jsxs("section",{className:"global-settings-card","aria-label":"Agent CLI Available",children:[u.jsx("div",{className:"agent-cli-head",children:u.jsx("p",{className:"global-settings-resp-title",children:"Agent CLI Available"})}),u.jsx("p",{className:"global-settings-help",children:"Whether each Agent CLI is installed and discoverable on this machine's PATH, with its detected version. Carriers can only run on an Agent CLI shown as available here."}),i?u.jsx("p",{className:"settings-error",children:i}):null,u.jsx("div",{className:"agent-cli-list",children:e.map(g=>u.jsx(b4,{cli:g},g.id))}),u.jsx("p",{className:"global-settings-foot",children:"Install or update a CLI, then reopen this page to re-check availability."})]}),u.jsx(k4,{terminalFont:f}),u.jsx(T4,{terminalRenderer:o})]})}function v4(){const e=t4(),n=e.state,i=e.savingField!==null;return M.useEffect(()=>{const s=new AbortController;return i4(s.signal),()=>s.abort()},[]),u.jsxs("section",{className:"global-settings-card","aria-label":"System Prompt",children:[e.error?u.jsx("p",{className:"global-settings-error",role:"alert",children:e.error}):null,n?u.jsxs(u.Fragment,{children:[u.jsx(ny,{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 Code only; Codex always receives doctrine through its profile.",onLabel:"Replace",offLabel:"Append",value:n.replaceSystemPrompt,disabled:i,onToggle:()=>{ty("replaceSystemPrompt",!n.replaceSystemPrompt)}}),u.jsx(ny,{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:n.enableMetaphor,disabled:i,onToggle:()=>{ty("enableMetaphor",!n.enableMetaphor)}})]}):u.jsx("p",{className:"global-settings-help",children:e.loading?"Loading settings.":"Settings unavailable."}),u.jsx("p",{className:"global-settings-foot",children:"Changes apply to newly launched sessions. Running sessions keep their current configuration until relaunched."})]})}function ny({title:e,help:n,onLabel:i,offLabel:s,value:o,disabled:f,onToggle:g}){return u.jsxs("div",{className:"global-settings-row",children:[u.jsxs("div",{className:"global-settings-row-text",children:[u.jsx("p",{className:"global-settings-resp-title",children:e}),u.jsx("p",{className:"global-settings-help",children:n})]}),u.jsx("button",{type:"button",className:`global-settings-toggle ${o?"is-on":""}`,disabled:f,"aria-pressed":o,onClick:g,children:u.jsx("span",{children:o?i:s})})]})}function b4({cli:e}){return u.jsxs("div",{className:"agent-cli-row",children:[u.jsx("span",{className:"agent-cli-name",children:e.displayName}),u.jsxs("span",{className:"agent-cli-meta",children:[e.available&&e.version?u.jsx("span",{className:"agent-cli-version",children:e.version}):null,u.jsx("span",{className:`agent-cli-status ${e.available?"is-on":""}`,children:e.available?"Available":"Missing"})]})]})}function y4({job:e}){return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"job-overlay-head",children:[u.jsx("span",{className:"job-overlay-kicker",children:e.status}),u.jsx("strong",{children:e.label??e.jobId})]}),u.jsx("div",{className:"job-overlay-tracks",children:e.trackOrder.map(n=>{const i=e.tracks[n];return i?u.jsx(S4,{track:i},i.trackId):null})})]})}function S4({track:e}){const n=M4(e.status),i=n==="track-card--live";return u.jsxs("article",{className:n?`track-card ${n}`:"track-card",children:[u.jsxs("header",{className:"track-card-head",children:[u.jsx("span",{className:"track-card-title",children:e.displayName}),u.jsx("span",{className:"track-card-status",children:e.status})]}),e.thought?u.jsxs("div",{className:"track-card-thought",role:"group","aria-label":"Thinking",children:[u.jsx("span",{className:"track-card-section-label","aria-hidden":"true",children:"thinking"}),u.jsx("pre",{children:e.thought})]}):null,e.text?u.jsxs("div",{className:"track-card-text",role:"group","aria-label":"Output",children:[u.jsx("span",{className:"track-card-section-label track-card-section-label--output","aria-hidden":"true",children:"output"}),u.jsxs("pre",{children:[e.text,i?u.jsx("span",{className:"track-card-caret","aria-hidden":"true"}):null]})]}):null,e.error?u.jsx("div",{className:"track-card-error",role:"group","aria-label":"Error",children:e.error}):null,e.tools.length>0?u.jsx("ul",{className:"track-card-tools",children:e.tools.map(s=>u.jsx("li",{children:s.name??s.id},s.id))}):null]})}async function w4(e){ah(await f6(e)),Ax(e)}function x4(e){return{sessionId:e.operation.id,terminalSessionId:e.operation.id,cwdLabel:e.operation.title||"Workspace",label:e.operation.title,cliId:Nl(e.operation.payload,"cliId")??void 0,cliLabel:Nl(e.operation.payload,"cliLabel")??void 0,status:"dormant",turnState:"none",createdAt:e.operation.ts.createdAt,theaterId:e.theaterId,tenantId:Nl(e.operation.payload,"tenantId")??void 0,registrationId:Nl(e.operation.payload,"registrationId")??void 0,resumeAvailable:!0}}function Nl(e,n){const i=e[n];return typeof i=="string"?i:null}function km(e){return e==="stream"||e==="live"||e==="running"||e==="active"}function C4(e){const n=e.tools.find(i=>i.status!=="completed"&&i.status!=="failed"&&i.status!=="error");return n?n.name??n.id:void 0}function E4(e){const n=e.flatMap(i=>i.trackOrder.map(s=>i.tracks[s])).filter(i=>!!i).sort((i,s)=>s.lastEventId-i.lastEventId);for(const i of n)if(i.latestLine)return i.latestLine;return""}function iy(e){const n=e.trim();if(!n)return"";const i=n.split(`
|
|
91
|
+
`);return i[i.length-1]?.trim()??""}function k4({terminalFont:e}){const n=vx(e),i=R4(e);return u.jsxs("section",{className:"global-settings-card","aria-label":"Terminal Font",children:[u.jsxs("div",{className:"global-settings-row is-stack",children:[u.jsxs("div",{className:"global-settings-row-text",children:[u.jsxs("p",{className:"global-settings-resp-title",children:["Terminal Font ",u.jsx("span",{className:"new-badge",children:"New"})]}),u.jsx("p",{className:"global-settings-help",id:"terminal-font-help",children:"Typeface and size for every terminal panel — agent-cli and shell alike. Applies live to all open terminals; remembered on this browser."})]}),u.jsxs("div",{className:"font-control","aria-describedby":"terminal-font-help",children:[u.jsxs("div",{className:"current-readout","aria-live":"polite",children:[u.jsx("span",{className:"cr-label",children:"Currently"}),u.jsx("span",{className:"cr-value",children:i}),u.jsx("span",{className:"cr-sep",children:"·"}),u.jsxs("span",{className:"cr-value",children:[e.size,"px"]}),u.jsx("span",{className:"cr-sep",children:"·"}),u.jsx("span",{className:`cr-value ${n.status==="fallback"?"is-fallback":"is-ok"}`,children:n.status})]}),u.jsxs("div",{className:"font-cards",role:"group","aria-label":"Terminal font family",children:[kh.map(s=>u.jsx(A4,{font:s,active:e.source==="curated"&&e.id===s.id,onSelect:()=>$M(s.id)},s.id)),u.jsxs("button",{type:"button","aria-pressed":e.source==="custom",className:`font-card ${e.source==="custom"?"is-active":""}`,onClick:()=>{e.source!=="custom"&&W1("")},children:[u.jsxs("span",{className:"fc-name",children:["Custom…",u.jsx("span",{className:"fc-check","aria-hidden":"true",children:"✓"})]}),u.jsx("span",{className:"fc-sample is-custom","aria-hidden":"true",children:"type a font"}),u.jsx("span",{className:"fc-meta",children:"your installed face"}),u.jsx("span",{className:"fc-bundled fc-addon",children:"local OS font"})]})]}),u.jsx("div",{className:`custom-reveal ${e.source==="custom"?"is-open":""}`,children:u.jsxs("div",{className:"font-field-wrap",children:[u.jsxs("label",{className:"font-field",children:[u.jsx("span",{className:"field-icon","aria-hidden":"true",children:"Aa"}),u.jsx("input",{type:"text",spellCheck:!1,value:e.customName,placeholder:"e.g. MesloLGS NF, Fira Code, IBM Plex Mono","aria-label":"Custom terminal font family",onChange:s=>W1(s.currentTarget.value)})]}),u.jsxs("div",{className:`resolve-chip ${n.status==="fallback"?"is-fallback":"is-ok"}`,"aria-live":"polite",children:[u.jsx("span",{className:"rc-dot","aria-hidden":"true"}),u.jsx("span",{children:L4(e)})]})]})}),u.jsxs("div",{className:"size-row",children:[u.jsxs("div",{className:"size-stepper",role:"group","aria-label":"Font size",children:[u.jsx("button",{type:"button","aria-label":"Decrease terminal font size",disabled:e.size<=H1.min,onClick:()=>G1(e.size-1),children:"−"}),u.jsxs("span",{className:"size-val",children:[e.size,u.jsx("span",{children:" px"})]}),u.jsx("button",{type:"button","aria-label":"Increase terminal font size",disabled:e.size>=H1.max,onClick:()=>G1(e.size+1),children:"+"})]}),u.jsx("span",{className:"size-label",children:"Cell size — rescales every panel; zoom stays relative"})]})]})]}),u.jsx("p",{className:"global-settings-foot",children:"Appearance preferences apply immediately and are stored per browser, separate from session settings."})]})}function T4({terminalRenderer:e}){return u.jsx("section",{className:"global-settings-card","aria-label":"Terminal Renderer",children:u.jsxs("div",{className:"global-settings-row",children:[u.jsxs("div",{className:"global-settings-row-text",children:[u.jsx("p",{className:"global-settings-resp-title",children:"Terminal Renderer"}),u.jsx("p",{className:"global-settings-help",children:"WebGL paints the terminal on the GPU for sharper, faster output; DOM is a compatibility fallback. Switching applies to the live terminal instantly without dropping the session."})]}),u.jsx("div",{className:"segmented",role:"group","aria-label":"Terminal renderer",children:r4.map(n=>{const i=n.id===e;return u.jsx("button",{type:"button","aria-pressed":i,className:`segmented-option ${i?"is-active":""}`,onClick:()=>HM(n.id),children:n.label},n.id)})})]})})}function A4({active:e,font:n,onSelect:i}){return u.jsxs("button",{type:"button","aria-pressed":e,className:`font-card ${e?"is-active":""}`,onClick:i,children:[u.jsxs("span",{className:"fc-name",children:[n.name,u.jsx("span",{className:"fc-check","aria-hidden":"true",children:"✓"})]}),u.jsx("span",{className:"fc-sample",style:{fontFamily:n.family},"aria-hidden":"true",children:"Ag 0O ─┼ =>"}),u.jsx("span",{className:"fc-meta",children:n.meta}),u.jsx("span",{className:"fc-bundled",children:"self-hosted"})]})}function R4(e){return e.source==="custom"?e.customName||`${rh(null).name} (default)`:rh(e.id).name}function L4(e){if(!e.customName)return`Empty — using default ${rh(null).name}`;const n=vx(e);return n.status==="resolved"?`"${e.customName}" resolves on this machine`:`"${e.customName}" not found — falls back to ${n.fallbackName}`}function M4(e){return km(e)?"track-card--live":e==="error"?"track-card--bad":e==="done"||e==="aborted"?"track-card--idle":""}function N4(){return u.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[u.jsx("path",{d:"M8 2.6 12.6 5.2v5.6L8 13.4 3.4 10.8V5.2Z",fill:"none",stroke:"currentColor",strokeWidth:"1.15",strokeLinejoin:"round"}),u.jsx("path",{d:"M6.2 7.9h3.6M8 6.1v3.6",fill:"none",stroke:"currentColor",strokeWidth:"1.15",strokeLinecap:"round"})]})}const O4="/plugins/terminal/shell/ticket",D4="/plugins/terminal/ws",Px={pluginId:"terminal",type:"shell",title:"Shell",subtitle:()=>"shell",render:e=>M.createElement(j4,{context:e})},cp={id:"terminal",operationKinds:[Px],install:()=>{},closeOperation:async e=>{await fetch(`/plugins/terminal/shell/sessions/${encodeURIComponent(e)}`,{method:"DELETE"})},launch:async({theaterId:e,operations:n})=>({id:(await n.create({theaterId:e,type:"shell",pluginId:"terminal",title:"Shell",payload:{theaterId:e}})).id}),renderLaunchIcon:()=>u.jsx(I4,{})};function j4({context:e}){return u.jsx(Sx,{operationId:e.operationId,active:e.active,zoom:e.zoom,ticketPath:O4,wsPath:D4,theme:e.theme,onExit:e.onClose})}function I4(){return u.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[u.jsx("rect",{x:"2.8",y:"3.4",width:"10.4",height:"9.2",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.15"}),u.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"})]})}const B4=new Set(["agent"]),P4={id:"terminal",operationKinds:[Px,jx],settingsSections:[Ix],notificationKinds:[Bx],install:e=>(zM(e.settings),Cu.install?.(e)),closeOperation:async e=>{const n=await H4(e);if(n?.type==="shell"){await cp.closeOperation?.(e);return}n&&B4.has(n.type)&&await Cu.closeOperation?.(e)},launch:async e=>e.kind.type==="shell"?cp.launch?.(e)??{id:""}:Cu.launch?.(e)??{id:""},renderLaunchIcon:e=>e.type==="shell"?cp.renderLaunchIcon?.(e):Cu.renderLaunchIcon?.(e)},z4=[P4];async function H4(e){const n=await fetch(`/api/v1/operations/${encodeURIComponent(e)}`);if(!n.ok)return null;const i=await n.json();return typeof i.operation?.type=="string"?{type:i.operation.type}:null}const oe={ts:"ts",js:"js",json:"json",css:"css",html:"html",md:"md",py:"py",go:"go",rust:"rust",shell:"shell",config:"config",image:"image",data:"data",archive:"archive",binary:"binary",ruby:"ruby",folder:"folder",default:"default"},$4={src:oe.ts,lib:oe.ts,app:oe.ts,test:oe.shell,tests:oe.shell,__tests__:oe.shell,spec:oe.shell,specs:oe.shell,node_modules:oe.binary,vendor:oe.binary,dist:oe.config,build:oe.config,out:oe.config,target:oe.config,docs:oe.md,doc:oe.md,public:oe.data,assets:oe.data,static:oe.data,components:oe.image,scripts:oe.js,styles:oe.css,".git":oe.html,".github":oe.config,".vscode":oe.css},ry={ts:{shape:"angle",tone:oe.ts},tsx:{shape:"angle",tone:oe.ts},mts:{shape:"angle",tone:oe.ts},cts:{shape:"angle",tone:oe.ts},"d.ts":{shape:"angle",tone:oe.ts},js:{shape:"angle",tone:oe.js},jsx:{shape:"angle",tone:oe.js},mjs:{shape:"angle",tone:oe.js},cjs:{shape:"angle",tone:oe.js},json:{shape:"braces",tone:oe.json},jsonc:{shape:"braces",tone:oe.json},json5:{shape:"braces",tone:oe.json},jsonl:{shape:"braces",tone:oe.json},graphql:{shape:"braces",tone:oe.image},gql:{shape:"braces",tone:oe.image},proto:{shape:"braces",tone:oe.go},css:{shape:"hash",tone:oe.css},scss:{shape:"hash",tone:oe.css},sass:{shape:"hash",tone:oe.css},less:{shape:"hash",tone:oe.css},styl:{shape:"hash",tone:oe.css},html:{shape:"markup",tone:oe.html},htm:{shape:"markup",tone:oe.html},xml:{shape:"markup",tone:oe.html},xhtml:{shape:"markup",tone:oe.html},vue:{shape:"markup",tone:oe.shell},svelte:{shape:"markup",tone:oe.rust},astro:{shape:"markup",tone:oe.image},md:{shape:"doc",tone:oe.md},mdx:{shape:"doc",tone:oe.md},markdown:{shape:"doc",tone:oe.md},rst:{shape:"doc",tone:oe.md},txt:{shape:"doc",tone:oe.default},text:{shape:"doc",tone:oe.default},log:{shape:"doc",tone:oe.default},adoc:{shape:"doc",tone:oe.md},pdf:{shape:"doc",tone:oe.ruby},py:{shape:"angle",tone:oe.py},pyi:{shape:"angle",tone:oe.py},pyw:{shape:"angle",tone:oe.py},go:{shape:"angle",tone:oe.go},rs:{shape:"angle",tone:oe.rust},rb:{shape:"angle",tone:oe.ruby},rake:{shape:"angle",tone:oe.ruby},gemspec:{shape:"angle",tone:oe.ruby},java:{shape:"angle",tone:oe.html},kt:{shape:"angle",tone:oe.config},kts:{shape:"angle",tone:oe.config},scala:{shape:"angle",tone:oe.ruby},c:{shape:"angle",tone:oe.ts},h:{shape:"angle",tone:oe.ts},cpp:{shape:"angle",tone:oe.css},cc:{shape:"angle",tone:oe.css},cxx:{shape:"angle",tone:oe.css},hpp:{shape:"angle",tone:oe.css},cs:{shape:"angle",tone:oe.config},php:{shape:"angle",tone:oe.config},swift:{shape:"angle",tone:oe.html},lua:{shape:"angle",tone:oe.ts},dart:{shape:"angle",tone:oe.go},sh:{shape:"terminal",tone:oe.shell},bash:{shape:"terminal",tone:oe.shell},zsh:{shape:"terminal",tone:oe.shell},fish:{shape:"terminal",tone:oe.shell},ps1:{shape:"terminal",tone:oe.css},bat:{shape:"terminal",tone:oe.shell},cmd:{shape:"terminal",tone:oe.shell},yaml:{shape:"gear",tone:oe.config},yml:{shape:"gear",tone:oe.config},toml:{shape:"gear",tone:oe.config},ini:{shape:"gear",tone:oe.config},conf:{shape:"gear",tone:oe.config},cfg:{shape:"gear",tone:oe.config},properties:{shape:"gear",tone:oe.config},env:{shape:"gear",tone:oe.config},editorconfig:{shape:"gear",tone:oe.config},png:{shape:"image",tone:oe.image},jpg:{shape:"image",tone:oe.image},jpeg:{shape:"image",tone:oe.image},gif:{shape:"image",tone:oe.image},webp:{shape:"image",tone:oe.image},svg:{shape:"image",tone:oe.image},ico:{shape:"image",tone:oe.image},bmp:{shape:"image",tone:oe.image},avif:{shape:"image",tone:oe.image},tiff:{shape:"image",tone:oe.image},heic:{shape:"image",tone:oe.image},mp4:{shape:"image",tone:oe.data},mov:{shape:"image",tone:oe.data},webm:{shape:"image",tone:oe.data},mkv:{shape:"image",tone:oe.data},mp3:{shape:"chip",tone:oe.shell},wav:{shape:"chip",tone:oe.shell},flac:{shape:"chip",tone:oe.shell},ogg:{shape:"chip",tone:oe.shell},sql:{shape:"database",tone:oe.data},csv:{shape:"database",tone:oe.data},tsv:{shape:"database",tone:oe.data},db:{shape:"database",tone:oe.data},sqlite:{shape:"database",tone:oe.data},sqlite3:{shape:"database",tone:oe.data},parquet:{shape:"database",tone:oe.data},zip:{shape:"archive",tone:oe.archive},tar:{shape:"archive",tone:oe.archive},gz:{shape:"archive",tone:oe.archive},tgz:{shape:"archive",tone:oe.archive},bz2:{shape:"archive",tone:oe.archive},xz:{shape:"archive",tone:oe.archive},rar:{shape:"archive",tone:oe.archive},"7z":{shape:"archive",tone:oe.archive},zst:{shape:"archive",tone:oe.archive},bin:{shape:"chip",tone:oe.binary},exe:{shape:"chip",tone:oe.binary},dll:{shape:"chip",tone:oe.binary},so:{shape:"chip",tone:oe.binary},dylib:{shape:"chip",tone:oe.binary},wasm:{shape:"chip",tone:oe.config},class:{shape:"chip",tone:oe.binary},lock:{shape:"chip",tone:oe.binary},woff:{shape:"chip",tone:oe.config},woff2:{shape:"chip",tone:oe.config},ttf:{shape:"chip",tone:oe.config},otf:{shape:"chip",tone:oe.config}},U4={dockerfile:{shape:"chip",tone:oe.css},"docker-compose.yml":{shape:"gear",tone:oe.css},"docker-compose.yaml":{shape:"gear",tone:oe.css},makefile:{shape:"gear",tone:oe.html},"cmakelists.txt":{shape:"gear",tone:oe.html},".gitignore":{shape:"gear",tone:oe.html},".gitattributes":{shape:"gear",tone:oe.html},".dockerignore":{shape:"gear",tone:oe.html},".npmignore":{shape:"gear",tone:oe.html},".npmrc":{shape:"gear",tone:oe.ruby},"package.json":{shape:"braces",tone:oe.shell},"tsconfig.json":{shape:"braces",tone:oe.ts},license:{shape:"doc",tone:oe.json},"license.md":{shape:"doc",tone:oe.json},licence:{shape:"doc",tone:oe.json}},F4={shape:"default",tone:oe.default},yg={angle:u.jsxs(u.Fragment,{children:[u.jsx("path",{d:"M5.6 4.5 2.4 8l3.2 3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"}),u.jsx("path",{d:"M10.4 4.5 13.6 8l-3.2 3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"}),u.jsx("path",{d:"M9.1 3.4 6.9 12.6",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",opacity:"0.55"})]}),braces:u.jsxs(u.Fragment,{children:[u.jsx("path",{d:"M6.4 3.4c-1.1 0-1.5.5-1.5 1.5v1.2c0 .9-.4 1.4-1.1 1.6v.6c.7.2 1.1.7 1.1 1.6v1.2c0 1 .4 1.5 1.5 1.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"}),u.jsx("path",{d:"M9.6 3.4c1.1 0 1.5.5 1.5 1.5v1.2c0 .9.4 1.4 1.1 1.6v.6c-.7.2-1.1.7-1.1 1.6v1.2c0 1-.4 1.5-1.5 1.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"}),u.jsx("circle",{cx:"8",cy:"8",r:"0.85",fill:"currentColor",opacity:"0.6"})]}),hash:u.jsxs(u.Fragment,{children:[u.jsx("path",{d:"M6.6 3 5.2 13M10.8 3 9.4 13",fill:"none",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round"}),u.jsx("path",{d:"M3.6 6.4h9M3.4 9.6h9",fill:"none",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round"})]}),doc:u.jsxs(u.Fragment,{children:[u.jsx("path",{d:"M4 2.5h5l3 3v8a.6.6 0 0 1-.6.6H4a.6.6 0 0 1-.6-.6V3.1a.6.6 0 0 1 .6-.6Z",fill:"currentColor",opacity:"0.16"}),u.jsx("path",{d:"M4 2.5h5l3 3v8a.6.6 0 0 1-.6.6H4a.6.6 0 0 1-.6-.6V3.1a.6.6 0 0 1 .6-.6Z",fill:"none",stroke:"currentColor",strokeWidth:"1.1",strokeLinejoin:"round"}),u.jsx("path",{d:"M9 2.7V5.5h2.8",fill:"none",stroke:"currentColor",strokeWidth:"1.1",strokeLinejoin:"round"}),u.jsx("path",{d:"M5.7 8.6h4.6M5.7 10.5h4.6M5.7 12.1h3",fill:"none",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",opacity:"0.7"})]}),image:u.jsxs(u.Fragment,{children:[u.jsx("rect",{x:"2.5",y:"3.6",width:"11",height:"8.8",rx:"1.4",fill:"currentColor",opacity:"0.16"}),u.jsx("rect",{x:"2.5",y:"3.6",width:"11",height:"8.8",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.1"}),u.jsx("circle",{cx:"5.9",cy:"6.6",r:"1.1",fill:"currentColor"}),u.jsx("path",{d:"M3 11.4 6.6 7.9l2 2 1.9-1.7 2.5 2.3",fill:"none",stroke:"currentColor",strokeWidth:"1.1",strokeLinejoin:"round"})]}),terminal:u.jsxs(u.Fragment,{children:[u.jsx("rect",{x:"2.3",y:"3.3",width:"11.4",height:"9.4",rx:"1.5",fill:"currentColor",opacity:"0.16"}),u.jsx("rect",{x:"2.3",y:"3.3",width:"11.4",height:"9.4",rx:"1.5",fill:"none",stroke:"currentColor",strokeWidth:"1.1"}),u.jsx("path",{d:"M5 6.4 7.3 8 5 9.6",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"}),u.jsx("path",{d:"M8.4 9.8h3",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"})]}),gear:u.jsxs(u.Fragment,{children:[u.jsx("circle",{cx:"8",cy:"8",r:"2",fill:"none",stroke:"currentColor",strokeWidth:"1.25"}),u.jsx("circle",{cx:"8",cy:"8",r:"2",fill:"currentColor",opacity:"0.18"}),u.jsx("path",{d:"M8 2.4v2.1M8 11.5v2.1M13.6 8h-2.1M4.5 8H2.4M11.96 4.04l-1.49 1.49M5.53 10.47l-1.49 1.49M11.96 11.96l-1.49-1.49M5.53 5.53 4.04 4.04",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"})]}),markup:u.jsxs(u.Fragment,{children:[u.jsx("path",{d:"M5.6 4.2 2.4 8l3.2 3.8",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"}),u.jsx("path",{d:"M10.4 4.2 13.6 8l-3.2 3.8",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"}),u.jsx("circle",{cx:"8",cy:"8",r:"1.15",fill:"currentColor"})]}),database:u.jsxs(u.Fragment,{children:[u.jsx("ellipse",{cx:"8",cy:"4.6",rx:"4.4",ry:"1.8",fill:"currentColor",opacity:"0.18"}),u.jsx("path",{d:"M3.6 4.6v6.8c0 1 2 1.8 4.4 1.8s4.4-.8 4.4-1.8V4.6",fill:"none",stroke:"currentColor",strokeWidth:"1.1"}),u.jsx("ellipse",{cx:"8",cy:"4.6",rx:"4.4",ry:"1.8",fill:"none",stroke:"currentColor",strokeWidth:"1.1"}),u.jsx("path",{d:"M3.6 8c0 1 2 1.8 4.4 1.8s4.4-.8 4.4-1.8",fill:"none",stroke:"currentColor",strokeWidth:"1.1",opacity:"0.65"})]}),archive:u.jsxs(u.Fragment,{children:[u.jsx("path",{d:"M3 5.2 8 3.1l5 2.1v5.6L8 12.9 3 10.8V5.2Z",fill:"currentColor",opacity:"0.16"}),u.jsx("path",{d:"M3 5.2 8 3.1l5 2.1v5.6L8 12.9 3 10.8V5.2Z",fill:"none",stroke:"currentColor",strokeWidth:"1.1",strokeLinejoin:"round"}),u.jsx("path",{d:"M3 5.2 8 7.3l5-2.1M8 7.3v5.6",fill:"none",stroke:"currentColor",strokeWidth:"1.1",strokeLinejoin:"round"}),u.jsx("path",{d:"M5.5 4.15 10.5 6.25",fill:"none",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",opacity:"0.6"})]}),chip:u.jsxs(u.Fragment,{children:[u.jsx("rect",{x:"4.2",y:"4.2",width:"7.6",height:"7.6",rx:"1.1",fill:"currentColor",opacity:"0.16"}),u.jsx("rect",{x:"4.2",y:"4.2",width:"7.6",height:"7.6",rx:"1.1",fill:"none",stroke:"currentColor",strokeWidth:"1.1"}),u.jsx("rect",{x:"6.6",y:"6.6",width:"2.8",height:"2.8",rx:"0.5",fill:"currentColor",opacity:"0.5"}),u.jsx("path",{d:"M6.5 2.6v1.6M9.5 2.6v1.6M6.5 11.8v1.6M9.5 11.8v1.6M2.6 6.5h1.6M2.6 9.5h1.6M11.8 6.5h1.6M11.8 9.5h1.6",fill:"none",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round"})]}),default:u.jsxs(u.Fragment,{children:[u.jsx("path",{d:"M4 2.5h5l3 3v8a.6.6 0 0 1-.6.6H4a.6.6 0 0 1-.6-.6V3.1a.6.6 0 0 1 .6-.6Z",fill:"currentColor",opacity:"0.14"}),u.jsx("path",{d:"M4 2.5h5l3 3v8a.6.6 0 0 1-.6.6H4a.6.6 0 0 1-.6-.6V3.1a.6.6 0 0 1 .6-.6Z",fill:"none",stroke:"currentColor",strokeWidth:"1.1",strokeLinejoin:"round"}),u.jsx("path",{d:"M9 2.7V5.5h2.8",fill:"none",stroke:"currentColor",strokeWidth:"1.1",strokeLinejoin:"round"})]}),folderClosed:u.jsxs(u.Fragment,{children:[u.jsx("path",{d:"M2.4 5.4c0-.69.56-1.25 1.25-1.25h2.7c.33 0 .65.13.88.37l.72.72c.23.23.55.37.88.37h3.15c.69 0 1.25.56 1.25 1.25v4.05c0 .69-.56 1.25-1.25 1.25H3.65c-.69 0-1.25-.56-1.25-1.25V5.4Z",fill:"currentColor",opacity:"0.2"}),u.jsx("path",{d:"M2.4 5.4c0-.69.56-1.25 1.25-1.25h2.7c.33 0 .65.13.88.37l.72.72c.23.23.55.37.88.37h3.15c.69 0 1.25.56 1.25 1.25v4.05c0 .69-.56 1.25-1.25 1.25H3.65c-.69 0-1.25-.56-1.25-1.25V5.4Z",fill:"none",stroke:"currentColor",strokeWidth:"1.1",strokeLinejoin:"round"})]}),folderOpen:u.jsxs(u.Fragment,{children:[u.jsx("path",{d:"M2.4 5.2c0-.69.56-1.25 1.25-1.25h2.7c.33 0 .65.13.88.37l.72.72c.23.23.55.37.88.37h3.15c.69 0 1.25.56 1.25 1.25v1.1H2.4V5.2Z",fill:"currentColor",opacity:"0.18"}),u.jsx("path",{d:"M1.45 7.55h12.1l-1.16 3.88c-.17.56-.69.97-1.28.97H3.89c-.59 0-1.11-.41-1.28-.97L1.45 7.55Z",fill:"currentColor",opacity:"0.26"}),u.jsx("path",{d:"M2.4 5.2c0-.69.56-1.25 1.25-1.25h2.7c.33 0 .65.13.88.37l.72.72c.23.23.55.37.88.37h3.15c.69 0 1.25.56 1.25 1.25v.8",fill:"none",stroke:"currentColor",strokeWidth:"1.1",strokeLinejoin:"round"}),u.jsx("path",{d:"M1.45 7.55h12.1l-1.16 3.88c-.17.56-.69.97-1.28.97H3.89c-.59 0-1.11-.41-1.28-.97L1.45 7.55Z",fill:"none",stroke:"currentColor",strokeWidth:"1.1",strokeLinejoin:"round"})]})};function W4({name:e}){const n=q4(e);return u.jsx("svg",{className:"fexp-file-svg",width:"15",height:"15",viewBox:"0 0 16 16","aria-hidden":"true",style:{color:`var(--fexp-ic-${n.tone})`},children:yg[n.shape]})}function G4({name:e,open:n}){const i=$4[e.toLowerCase()]??oe.folder;return u.jsx("svg",{className:"fexp-file-svg",width:"15",height:"15",viewBox:"0 0 16 16","aria-hidden":"true",style:{color:`var(--fexp-ic-${i})`},children:n?yg.folderOpen:yg.folderClosed})}function q4(e){const n=e.toLowerCase(),i=U4[n];if(i)return i;if(n.startsWith(".env"))return{shape:"gear",tone:oe.config};if(n.startsWith("readme"))return{shape:"doc",tone:oe.md};if(n.endsWith(".d.ts"))return ry["d.ts"];const s=n.lastIndexOf(".");if(s>0&&s<n.length-1){const o=n.slice(s+1),f=ry[o];if(f)return f}return F4}const K4=200,Eu=30,sy=5,zx="fleet-console.fileExplorer.showHidden";function Hx(e,n,i,s){for(const o of e)if(!(!s&&o.name.startsWith("."))){if(o.name.toLowerCase().includes(i))return!0;if(o.kind==="dir"){const f=n.get(o.relativePath)?.entries;if(f&&Hx(f,n,i,s))return!0}}return!1}function $x(e,n,i,s,o,f,g,c){const h=[];for(const d of e)if(!(!c&&d.name.startsWith("."))){if(g){const b=d.name.toLowerCase().includes(g),m=d.kind==="dir"&&Hx(f.get(d.relativePath)?.entries??[],f,g,c);if(!b&&!m)continue}if(h.push({entry:d,depth:n,isSelected:i===d.relativePath,isExpanded:s.has(d.relativePath),isLoading:o.has(d.relativePath)}),d.kind==="dir"&&s.has(d.relativePath)){const b=f.get(d.relativePath)?.entries;b&&h.push(...$x(b,n+1,i,s,o,f,g,c))}}return h}function V4({files:e,theaterId:n,selectedPath:i,onSelect:s}){const[o,f]=M.useState(null),[g,c]=M.useState(null),[h,d]=M.useState(""),[b,m]=M.useState(new Set),[w,x]=M.useState(new Set),[T,E]=M.useState(new Map),[p,v]=M.useState(""),[_,S]=M.useState(0),[k,L]=M.useState(600),[R,N]=M.useState(()=>Y4()),A=M.useRef(null),B=M.useRef(b);B.current=b;const q=M.useRef(h);q.current=h;const F=M.useRef(e);F.current=e,M.useEffect(()=>{n&&(f(null),c(null),d(""),m(new Set),E(new Map),v(""))},[n]),M.useEffect(()=>{n&&e.listFolder(h||void 0).then(se=>{f(se),c(null)}).catch(se=>{c(se instanceof Error?se.message:"Unable to load folder")})},[n,h,e]),M.useEffect(()=>{const se=A.current;if(!se)return;const X=new ResizeObserver(()=>L(se.clientHeight));return X.observe(se),L(se.clientHeight),()=>X.disconnect()},[]),M.useEffect(()=>{if(!n)return;let se=!0;const X=`/plugins/file-explorer/files/watch?theaterId=${encodeURIComponent(n)}`,$=new EventSource(X),ae=()=>{F.current.listFolder(q.current||void 0).then(we=>{f(we),c(null)}).catch(()=>{})},de=()=>{ae();for(const we of B.current)F.current.listFolder(we).then(ye=>{E(Ne=>new Map(Ne).set(we,ye))}).catch(()=>{})};return $.addEventListener("change",we=>{let ye;try{ye=JSON.parse(we.data)}catch{return}typeof ye=="string"&&((ye===""||ye===q.current)&&ae(),ye!==""&&B.current.has(ye)&&F.current.listFolder(ye).then(Ne=>{E(Oe=>new Map(Oe).set(ye,Ne))}).catch(()=>{}))}),$.onopen=()=>{if(se){se=!1;return}de()},()=>{$.close()}},[n,e]);const W=M.useCallback(se=>{const X=se.relativePath,$=!b.has(X);m(ae=>{const de=new Set(ae);return de.has(X)?(de.delete(X),de):(de.add(X),de)}),$&&(x(ae=>new Set(ae).add(X)),e.listFolder(X).then(ae=>{E(de=>new Map(de).set(X,ae)),x(de=>{const we=new Set(de);return we.delete(X),we})}).catch(()=>{x(ae=>{const de=new Set(ae);return de.delete(X),de})}))},[e,b]),I=M.useCallback(se=>{se.kind==="dir"?W(se):s(se)},[W,s]),Y=M.useCallback(se=>{S(se.currentTarget.scrollTop)},[]),V=M.useCallback(()=>{N(se=>{const X=!se;try{localStorage.setItem(zx,X?"1":"0")}catch{}return X})},[]),z=M.useCallback(()=>{if(n){e.listFolder(h||void 0).then(se=>{f(se),c(null)}).catch(se=>{c(se instanceof Error?se.message:"Unable to load folder")});for(const se of b)e.listFolder(se).then(X=>{E($=>new Map($).set(se,X))}).catch(()=>{})}},[e,h,b,n]),G=p.toLowerCase(),K=M.useMemo(()=>o?$x(o.entries,0,i,b,w,T,G,R):[],[o,i,b,w,T,G,R]),j=!R&&o!==null&&o.entries.length>0&&K.length===0&&!p,H=K.length>K4,D=H?Math.max(0,Math.floor(_/Eu)-sy):0,P=H?Math.min(K.length,Math.ceil((_+k)/Eu)+sy):K.length,Z=K.slice(D,P),ee=K.length*Eu,J=D*Eu;return n?g&&!o?u.jsx("div",{className:"fexp-tree-error",children:g}):o?u.jsxs("div",{className:"fexp-tree-container",children:[u.jsxs("div",{className:"fexp-filter",children:[u.jsx("input",{type:"text",className:"fexp-filter-input",placeholder:"Filter…",value:p,onChange:se=>v(se.target.value),"aria-label":"Filter files"}),p&&u.jsx("button",{type:"button",className:"fexp-filter-clear",onClick:()=>v(""),"aria-label":"Clear filter",children:"✕"}),u.jsx("button",{type:"button",className:"fexp-refresh-btn",onClick:z,"aria-label":"Refresh file tree",title:"Refresh file tree",children:"↻"}),u.jsx("button",{type:"button",className:`fexp-hidden-toggle${R?" is-active":""}`,onClick:V,"aria-pressed":R,"aria-label":R?"Hide hidden files":"Show hidden files",title:R?"Hide hidden files":"Show hidden files",children:R?u.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[u.jsx("ellipse",{cx:"8",cy:"8",rx:"5.5",ry:"3.5",stroke:"currentColor",strokeWidth:"1.4"}),u.jsx("circle",{cx:"8",cy:"8",r:"1.8",fill:"currentColor"})]}):u.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[u.jsx("ellipse",{cx:"8",cy:"8",rx:"5.5",ry:"3.5",stroke:"currentColor",strokeWidth:"1.4"}),u.jsx("circle",{cx:"8",cy:"8",r:"1.8",fill:"currentColor"}),u.jsx("line",{x1:"3",y1:"13",x2:"13",y2:"3",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]})})]}),u.jsxs("div",{ref:A,className:"fexp-tree",role:"tree","aria-label":"File tree",onScroll:H?Y:void 0,children:[o.parentRelativePath!==null&&!p&&u.jsx("button",{className:"fexp-tree-up",type:"button",onClick:()=>d(o.parentRelativePath??""),"aria-label":"Parent folder",children:"↑ .."}),H?u.jsx("div",{style:{height:ee,position:"relative"},children:u.jsx("div",{style:{transform:`translateY(${J}px)`},children:Z.map(se=>u.jsx(ay,{row:se,onEntryClick:I},se.entry.relativePath))})}):Z.map(se=>u.jsx(ay,{row:se,onEntryClick:I},se.entry.relativePath)),K.length===0&&p&&u.jsx("div",{className:"fexp-tree-empty",children:"No matching items"}),K.length===0&&!p&&o.entries.length===0&&u.jsx("div",{className:"fexp-tree-empty",children:"This folder is empty"}),j&&u.jsx("div",{className:"fexp-tree-empty",children:"Only hidden items — use the eye icon to show them"})]})]}):u.jsx("div",{className:"fexp-tree-loading",children:"Loading…"}):u.jsx("div",{className:"fexp-tree-empty",children:"Select a Theater"})}function ay({row:e,onEntryClick:n}){const{entry:i,depth:s,isSelected:o,isExpanded:f,isLoading:g}=e,c=i.kind==="dir",h=s*16,d=M.useCallback(()=>n(i),[i,n]);return u.jsxs("button",{className:`fexp-tree-row${o?" is-cur":""}${c?" is-dir":" is-file"}`,style:{paddingLeft:`${h+12}px`},type:"button",role:"treeitem","aria-selected":o,"aria-expanded":c?f:void 0,onClick:d,children:[u.jsx("span",{className:"fexp-tree-icon","aria-hidden":"true",children:c?u.jsx(G4,{name:i.name,open:f}):u.jsx(W4,{name:i.name})}),u.jsx("span",{className:"fexp-tree-name",children:i.name}),g&&u.jsx("span",{className:"fexp-tree-spin","aria-hidden":"true",children:"⋯"})]})}function Y4(){try{return localStorage.getItem(zx)==="1"}catch{return!1}}function X4({name:e,sizeHint:n}){return u.jsxs("div",{className:"fexp-bin-wrap v-bin",children:[u.jsx("span",{className:"fexp-bin-glyph","aria-hidden":"true",children:"⊘"}),u.jsx("p",{className:"fexp-bin-name",children:e}),n&&u.jsx("p",{className:"fexp-bin-meta",children:n}),u.jsx("p",{className:"fexp-bin-hint",children:"Binary files can't be previewed"})]})}function Z4(e,n){switch(n){case"typescript":case"javascript":return Q4(e);case"json":return eN(e);case"python":return nN(e);case"css":case"scss":case"sass":case"less":return iN(e);case"html":case"xml":return rN(e);case"bash":case"shell":return sN(e);case"yaml":return aN(e);default:return[{kind:"text",value:e}]}}const J4=new Set(["abstract","as","async","await","break","case","catch","class","const","continue","debugger","declare","default","delete","do","else","enum","export","extends","false","finally","for","from","function","if","implements","import","in","instanceof","interface","is","keyof","let","namespace","new","null","of","override","package","private","protected","public","readonly","return","satisfies","static","super","switch","this","throw","true","try","type","typeof","undefined","var","void","while","with","yield"]);function Q4(e){const n=[];let i=0;for(;i<e.length;){if(e.startsWith("/*",i)){const s=e.indexOf("*/",i+2),o=s===-1?e.slice(i):e.slice(i,s+2);n.push({kind:"com",value:o}),i+=o.length;continue}if(e.startsWith("//",i)){const s=e.indexOf(`
|
|
92
|
+
`,i),o=s===-1?e.slice(i):e.slice(i,s);n.push({kind:"com",value:o}),i+=o.length;continue}if(e[i]==="`"){const{slice:s,length:o}=Ts(e,i,"`","`");n.push({kind:"str",value:s}),i+=o;continue}if(e[i]==='"'||e[i]==="'"){const{slice:s,length:o}=Ts(e,i,e[i],e[i]);n.push({kind:"str",value:s}),i+=o;continue}if(/[0-9]/.test(e[i])||e[i]==="."&&/[0-9]/.test(e[i+1]??"")){const s=e.slice(i).match(/^(0x[\da-fA-F]+|0o[0-7]+|0b[01]+|[\d]*\.?[\d]+(?:[eE][+-]?\d+)?[nN]?)/);if(s){n.push({kind:"num",value:s[0]}),i+=s[0].length;continue}}if(/[a-zA-Z_$]/.test(e[i])){const s=e.slice(i).match(/^[a-zA-Z_$][\w$]*/);if(s){const o=s[0],f=e.slice(i+o.length).match(/^\s*\(/);J4.has(o)?n.push({kind:"key",value:o}):f?n.push({kind:"fn",value:o}):n.push({kind:"text",value:o}),i+=o.length;continue}}if(/[{}()[\];,.<>!?:|&^~%*+\-=/\\@#]/.test(e[i])){n.push({kind:"punct",value:e[i]}),i++;continue}n.push({kind:"text",value:e[i]}),i++}return n}function eN(e){const n=[];let i=0;for(;i<e.length;){if(e[i]==='"'){const{slice:s,length:o}=Ts(e,i,'"','"'),g=e.slice(i+o).trimStart().startsWith(":");n.push({kind:g?"attr":"str",value:s}),i+=o;continue}if(/[0-9\-]/.test(e[i])){const s=e.slice(i).match(/^-?[\d]*\.?[\d]+(?:[eE][+-]?\d+)?/);if(s){n.push({kind:"num",value:s[0]}),i+=s[0].length;continue}}if(e.startsWith("true",i)||e.startsWith("false",i)||e.startsWith("null",i)){const s=e.slice(i).match(/^(true|false|null)/);if(s){n.push({kind:"key",value:s[0]}),i+=s[0].length;continue}}if(/[{}[\]:,]/.test(e[i])){n.push({kind:"punct",value:e[i]}),i++;continue}n.push({kind:"text",value:e[i]}),i++}return n}const tN=new Set(["False","None","True","and","as","assert","async","await","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield"]);function nN(e){const n=[];let i=0;for(;i<e.length;){if(e[i]==="#"){const s=e.indexOf(`
|
|
93
|
+
`,i),o=s===-1?e.slice(i):e.slice(i,s);n.push({kind:"com",value:o}),i+=o.length;continue}if(e.startsWith('"""',i)||e.startsWith("'''",i)){const s=e.slice(i,i+3),o=e.indexOf(s,i+3),f=o===-1?e.slice(i):e.slice(i,o+3);n.push({kind:"str",value:f}),i+=f.length;continue}if(e[i]==='"'||e[i]==="'"){const{slice:s,length:o}=Ts(e,i,e[i],e[i]);n.push({kind:"str",value:s}),i+=o;continue}if(/[0-9]/.test(e[i])){const s=e.slice(i).match(/^(0x[\da-fA-F]+|0o[0-7]+|0b[01]+|[\d]*\.?[\d]+(?:[eE][+-]?\d+)?)/);if(s){n.push({kind:"num",value:s[0]}),i+=s[0].length;continue}}if(/[a-zA-Z_]/.test(e[i])){const s=e.slice(i).match(/^[a-zA-Z_]\w*/);if(s){const o=s[0],f=e.slice(i+o.length).match(/^\s*\(/);tN.has(o)?n.push({kind:"key",value:o}):f?n.push({kind:"fn",value:o}):n.push({kind:"text",value:o}),i+=o.length;continue}}n.push({kind:"text",value:e[i]}),i++}return n}function iN(e){const n=[];let i=0;for(;i<e.length;){if(e.startsWith("/*",i)){const s=e.indexOf("*/",i+2),o=s===-1?e.slice(i):e.slice(i,s+2);n.push({kind:"com",value:o}),i+=o.length;continue}if(e.startsWith("//",i)){const s=e.indexOf(`
|
|
94
|
+
`,i),o=s===-1?e.slice(i):e.slice(i,s);n.push({kind:"com",value:o}),i+=o.length;continue}if(e[i]==='"'||e[i]==="'"){const{slice:s,length:o}=Ts(e,i,e[i],e[i]);n.push({kind:"str",value:s}),i+=o;continue}if(e[i]==="."||e[i]==="#"||e[i]===":"){const s=e.slice(i).match(/^[.#:][:a-zA-Z_-][\w-]*/);if(s){n.push({kind:"tag",value:s[0]}),i+=s[0].length;continue}}if(/[a-zA-Z-]/.test(e[i])){const s=e.slice(i).match(/^[a-zA-Z-][\w-]*/);if(s){const o=s[0];e.slice(i+o.length).trimStart().startsWith(":")?n.push({kind:"attr",value:o}):n.push({kind:"text",value:o}),i+=o.length;continue}}if(/[0-9]/.test(e[i])){const s=e.slice(i).match(/^[\d]*\.?[\d]+(?:[a-zA-Z%]*)/);if(s){n.push({kind:"num",value:s[0]}),i+=s[0].length;continue}}n.push({kind:"text",value:e[i]}),i++}return n}function rN(e){const n=[];let i=0;for(;i<e.length;){if(e.startsWith("<!--",i)){const s=e.indexOf("-->",i+4),o=s===-1?e.slice(i):e.slice(i,s+3);n.push({kind:"com",value:o}),i+=o.length;continue}if(e[i]==="<"){n.push({kind:"punct",value:"<"}),i++,e[i]==="/"&&(n.push({kind:"punct",value:"/"}),i++);const s=e.slice(i).match(/^[a-zA-Z][\w:-]*/);s&&(n.push({kind:"tag",value:s[0]}),i+=s[0].length);continue}if(e[i]==='"'||e[i]==="'"){const{slice:s,length:o}=Ts(e,i,e[i],e[i]);n.push({kind:"str",value:s}),i+=o;continue}if(/[a-zA-Z]/.test(e[i])){const s=e.slice(i).match(/^[a-zA-Z][\w:-]*/);if(s){const o=e.slice(i+s[0].length).trimStart();n.push({kind:o.startsWith("=")?"attr":"text",value:s[0]}),i+=s[0].length;continue}}n.push({kind:"text",value:e[i]}),i++}return n}function sN(e){const n=[];let i=0;const s=new Set(["if","then","else","elif","fi","for","in","do","done","while","until","case","esac","function","return","local","export","readonly","declare","unset","echo","exit","shift","source","."]);for(;i<e.length;){if(e[i]==="#"){const o=e.indexOf(`
|
|
95
|
+
`,i),f=o===-1?e.slice(i):e.slice(i,o);n.push({kind:"com",value:f}),i+=f.length;continue}if(e[i]==='"'||e[i]==="'"){const{slice:o,length:f}=Ts(e,i,e[i],e[i]);n.push({kind:"str",value:o}),i+=f;continue}if(/[a-zA-Z_]/.test(e[i])){const o=e.slice(i).match(/^[a-zA-Z_][\w]*/);if(o){n.push({kind:s.has(o[0])?"key":"text",value:o[0]}),i+=o[0].length;continue}}n.push({kind:"text",value:e[i]}),i++}return n}function aN(e){const n=[];let i=0;for(;i<e.length;){if(e[i]==="#"){const s=e.indexOf(`
|
|
96
|
+
`,i),o=s===-1?e.slice(i):e.slice(i,s);n.push({kind:"com",value:o}),i+=o.length;continue}if(e[i]==='"'||e[i]==="'"){const{slice:s,length:o}=Ts(e,i,e[i],e[i]);n.push({kind:"str",value:s}),i+=o;continue}if(/[a-zA-Z_]/.test(e[i])){const s=e.slice(i).match(/^[a-zA-Z_][\w-]*/);if(s){e.slice(i+s[0].length).trimStart().startsWith(":")?n.push({kind:"attr",value:s[0]}):["true","false","null","yes","no","on","off"].includes(s[0])?n.push({kind:"key",value:s[0]}):n.push({kind:"text",value:s[0]}),i+=s[0].length;continue}}if(/[0-9\-]/.test(e[i])){const s=e.slice(i).match(/^-?[\d]*\.?[\d]+/);if(s){n.push({kind:"num",value:s[0]}),i+=s[0].length;continue}}n.push({kind:"text",value:e[i]}),i++}return n}function Ts(e,n,i,s){let o=n+i.length;for(;o<e.length;){if(e[o]==="\\"){o+=2;continue}if(e.startsWith(s,o)){o+=s.length;break}if(s!=="`"&&e[o]===`
|
|
97
|
+
`)break;o++}return{slice:e.slice(n,o),length:o-n}}function oN({content:e,lang:n,truncated:i}){const s=M.useMemo(()=>lN(e,n),[e,n]);return u.jsxs("div",{className:"fexp-code-wrap",children:[i&&u.jsx("div",{className:"fexp-truncated-badge",children:"File is too large — showing a partial preview"}),u.jsx("div",{className:"fexp-code-scroll",children:u.jsx("table",{className:"fexp-code-table","aria-label":"File contents",children:u.jsx("tbody",{children:s.map((o,f)=>u.jsxs("tr",{className:"fexp-code-row",children:[u.jsx("td",{className:"fexp-line-num","aria-hidden":"true",children:f+1}),u.jsx("td",{className:"fexp-line-code",dangerouslySetInnerHTML:{__html:o}})]},f))})})})]})}function lN(e,n){return e.split(`
|
|
98
|
+
`).map(s=>cN(s,n))}function cN(e,n){return n==="plaintext"||n==="markdown"?oy(e)||" ":Z4(e,n).map(s=>{const o=oy(s.value);return s.kind==="text"?o:`<span class="syn-${s.kind}">${o}</span>`}).join("")||" "}function oy(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function uN({src:e,name:n}){return u.jsxs("div",{className:"fexp-img-wrap",children:[u.jsx("div",{className:"fexp-img-stage",children:u.jsx("img",{src:e,alt:n,className:"fexp-img",draggable:!1})}),u.jsx("figcaption",{className:"fexp-img-caption",children:n})]})}function Tm(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var sa=Tm();function Ux(e){sa=e}var zl={exec:()=>null};function mt(e,n=""){let i=typeof e=="string"?e:e.source,s={replace:(o,f)=>{let g=typeof f=="string"?f:f.source;return g=g.replace(Vn.caret,"$1"),i=i.replace(o,g),s},getRegex:()=>new RegExp(i,n)};return s}var hN=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Vn={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")},dN=/^(?:[ \t]*(?:\n|$))+/,fN=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,pN=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,nc=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,gN=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Am=/(?:[*+-]|\d{1,9}[.)])/,Fx=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Wx=mt(Fx).replace(/bull/g,Am).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(),mN=mt(Fx).replace(/bull/g,Am).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(),Rm=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,_N=/^[^\n]+/,Lm=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,vN=mt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Lm).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),bN=mt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Am).getRegex(),Rh="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",Mm=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,yN=mt("^ {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",Mm).replace("tag",Rh).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Gx=mt(Rm).replace("hr",nc).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",Rh).getRegex(),SN=mt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Gx).getRegex(),Nm={blockquote:SN,code:fN,def:vN,fences:pN,heading:gN,hr:nc,html:yN,lheading:Wx,list:bN,newline:dN,paragraph:Gx,table:zl,text:_N},ly=mt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",nc).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",Rh).getRegex(),wN={...Nm,lheading:mN,table:ly,paragraph:mt(Rm).replace("hr",nc).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ly).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",Rh).getRegex()},xN={...Nm,html:mt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Mm).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:zl,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:mt(Rm).replace("hr",nc).replace("heading",` *#{1,6} *[^
|
|
99
|
+
]`).replace("lheading",Wx).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},CN=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,EN=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,qx=/^( {2,}|\\)\n(?!\s*$)/,kN=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Lh=/[\p{P}\p{S}]/u,Om=/[\s\p{P}\p{S}]/u,Kx=/[^\s\p{P}\p{S}]/u,TN=mt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Om).getRegex(),Vx=/(?!~)[\p{P}\p{S}]/u,AN=/(?!~)[\s\p{P}\p{S}]/u,RN=/(?:[^\s\p{P}\p{S}]|~)/u,LN=mt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",hN?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Yx=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,MN=mt(Yx,"u").replace(/punct/g,Lh).getRegex(),NN=mt(Yx,"u").replace(/punct/g,Vx).getRegex(),Xx="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",ON=mt(Xx,"gu").replace(/notPunctSpace/g,Kx).replace(/punctSpace/g,Om).replace(/punct/g,Lh).getRegex(),DN=mt(Xx,"gu").replace(/notPunctSpace/g,RN).replace(/punctSpace/g,AN).replace(/punct/g,Vx).getRegex(),jN=mt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Kx).replace(/punctSpace/g,Om).replace(/punct/g,Lh).getRegex(),IN=mt(/\\(punct)/,"gu").replace(/punct/g,Lh).getRegex(),BN=mt(/^<(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(),PN=mt(Mm).replace("(?:-->|$)","-->").getRegex(),zN=mt("^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",PN).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ch=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,HN=mt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",ch).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Zx=mt(/^!?\[(label)\]\[(ref)\]/).replace("label",ch).replace("ref",Lm).getRegex(),Jx=mt(/^!?\[(ref)\](?:\[\])?/).replace("ref",Lm).getRegex(),$N=mt("reflink|nolink(?!\\()","g").replace("reflink",Zx).replace("nolink",Jx).getRegex(),cy=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Dm={_backpedal:zl,anyPunctuation:IN,autolink:BN,blockSkip:LN,br:qx,code:EN,del:zl,emStrongLDelim:MN,emStrongRDelimAst:ON,emStrongRDelimUnd:jN,escape:CN,link:HN,nolink:Jx,punctuation:TN,reflink:Zx,reflinkSearch:$N,tag:zN,text:kN,url:zl},UN={...Dm,link:mt(/^!?\[(label)\]\((.*?)\)/).replace("label",ch).getRegex(),reflink:mt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ch).getRegex()},Sg={...Dm,emStrongRDelimAst:DN,emStrongLDelim:NN,url:mt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",cy).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:mt(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",cy).getRegex()},FN={...Sg,br:mt(qx).replace("{2,}","*").getRegex(),text:mt(Sg.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ku={normal:Nm,gfm:wN,pedantic:xN},wl={normal:Dm,gfm:Sg,breaks:FN,pedantic:UN},WN={"&":"&","<":"<",">":">",'"':""","'":"'"},uy=e=>WN[e];function ar(e,n){if(n){if(Vn.escapeTest.test(e))return e.replace(Vn.escapeReplace,uy)}else if(Vn.escapeTestNoEncode.test(e))return e.replace(Vn.escapeReplaceNoEncode,uy);return e}function hy(e){try{e=encodeURI(e).replace(Vn.percentDecode,"%")}catch{return null}return e}function dy(e,n){let i=e.replace(Vn.findPipe,(f,g,c)=>{let h=!1,d=g;for(;--d>=0&&c[d]==="\\";)h=!h;return h?"|":" |"}),s=i.split(Vn.splitPipe),o=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),n)if(s.length>n)s.splice(n);else for(;s.length<n;)s.push("");for(;o<s.length;o++)s[o]=s[o].trim().replace(Vn.slashPipe,"|");return s}function xl(e,n,i){let s=e.length;if(s===0)return"";let o=0;for(;o<s&&e.charAt(s-o-1)===n;)o++;return e.slice(0,s-o)}function GN(e,n){if(e.indexOf(n[1])===-1)return-1;let i=0;for(let s=0;s<e.length;s++)if(e[s]==="\\")s++;else if(e[s]===n[0])i++;else if(e[s]===n[1]&&(i--,i<0))return s;return i>0?-2:-1}function fy(e,n,i,s,o){let f=n.href,g=n.title||null,c=e[1].replace(o.other.outputLinkReplace,"$1");s.state.inLink=!0;let h={type:e[0].charAt(0)==="!"?"image":"link",raw:i,href:f,title:g,text:c,tokens:s.inlineTokens(c)};return s.state.inLink=!1,h}function qN(e,n,i){let s=e.match(i.other.indentCodeCompensation);if(s===null)return n;let o=s[1];return n.split(`
|
|
100
|
+
`).map(f=>{let g=f.match(i.other.beginningSpace);if(g===null)return f;let[c]=g;return c.length>=o.length?f.slice(o.length):f}).join(`
|
|
101
|
+
`)}var uh=class{options;rules;lexer;constructor(e){this.options=e||sa}space(e){let n=this.rules.block.newline.exec(e);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(e){let n=this.rules.block.code.exec(e);if(n){let i=n[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?i:xl(i,`
|
|
102
|
+
`)}}}fences(e){let n=this.rules.block.fences.exec(e);if(n){let i=n[0],s=qN(i,n[3]||"",this.rules);return{type:"code",raw:i,lang:n[2]?n[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):n[2],text:s}}}heading(e){let n=this.rules.block.heading.exec(e);if(n){let i=n[2].trim();if(this.rules.other.endingHash.test(i)){let s=xl(i,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(i=s.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(e){let n=this.rules.block.hr.exec(e);if(n)return{type:"hr",raw:xl(n[0],`
|
|
103
|
+
`)}}blockquote(e){let n=this.rules.block.blockquote.exec(e);if(n){let i=xl(n[0],`
|
|
104
|
+
`).split(`
|
|
105
|
+
`),s="",o="",f=[];for(;i.length>0;){let g=!1,c=[],h;for(h=0;h<i.length;h++)if(this.rules.other.blockquoteStart.test(i[h]))c.push(i[h]),g=!0;else if(!g)c.push(i[h]);else break;i=i.slice(h);let d=c.join(`
|
|
106
|
+
`),b=d.replace(this.rules.other.blockquoteSetextReplace,`
|
|
107
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
|
|
108
|
+
${d}`:d,o=o?`${o}
|
|
109
|
+
${b}`:b;let m=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(b,f,!0),this.lexer.state.top=m,i.length===0)break;let w=f.at(-1);if(w?.type==="code")break;if(w?.type==="blockquote"){let x=w,T=x.raw+`
|
|
110
|
+
`+i.join(`
|
|
111
|
+
`),E=this.blockquote(T);f[f.length-1]=E,s=s.substring(0,s.length-x.raw.length)+E.raw,o=o.substring(0,o.length-x.text.length)+E.text;break}else if(w?.type==="list"){let x=w,T=x.raw+`
|
|
112
|
+
`+i.join(`
|
|
113
|
+
`),E=this.list(T);f[f.length-1]=E,s=s.substring(0,s.length-w.raw.length)+E.raw,o=o.substring(0,o.length-x.raw.length)+E.raw,i=T.substring(f.at(-1).raw.length).split(`
|
|
114
|
+
`);continue}}return{type:"blockquote",raw:s,tokens:f,text:o}}}list(e){let n=this.rules.block.list.exec(e);if(n){let i=n[1].trim(),s=i.length>1,o={type:"list",raw:"",ordered:s,start:s?+i.slice(0,-1):"",loose:!1,items:[]};i=s?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=s?i:"[*+-]");let f=this.rules.other.listItemRegex(i),g=!1;for(;e;){let h=!1,d="",b="";if(!(n=f.exec(e))||this.rules.block.hr.test(e))break;d=n[0],e=e.substring(d.length);let m=n[2].split(`
|
|
115
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,v=>" ".repeat(3*v.length)),w=e.split(`
|
|
116
|
+
`,1)[0],x=!m.trim(),T=0;if(this.options.pedantic?(T=2,b=m.trimStart()):x?T=n[1].length+1:(T=n[2].search(this.rules.other.nonSpaceChar),T=T>4?1:T,b=m.slice(T),T+=n[1].length),x&&this.rules.other.blankLine.test(w)&&(d+=w+`
|
|
117
|
+
`,e=e.substring(w.length+1),h=!0),!h){let v=this.rules.other.nextBulletRegex(T),_=this.rules.other.hrRegex(T),S=this.rules.other.fencesBeginRegex(T),k=this.rules.other.headingBeginRegex(T),L=this.rules.other.htmlBeginRegex(T);for(;e;){let R=e.split(`
|
|
118
|
+
`,1)[0],N;if(w=R,this.options.pedantic?(w=w.replace(this.rules.other.listReplaceNesting," "),N=w):N=w.replace(this.rules.other.tabCharGlobal," "),S.test(w)||k.test(w)||L.test(w)||v.test(w)||_.test(w))break;if(N.search(this.rules.other.nonSpaceChar)>=T||!w.trim())b+=`
|
|
119
|
+
`+N.slice(T);else{if(x||m.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||S.test(m)||k.test(m)||_.test(m))break;b+=`
|
|
120
|
+
`+w}!x&&!w.trim()&&(x=!0),d+=R+`
|
|
121
|
+
`,e=e.substring(R.length+1),m=N.slice(T)}}o.loose||(g?o.loose=!0:this.rules.other.doubleBlankLine.test(d)&&(g=!0));let E=null,p;this.options.gfm&&(E=this.rules.other.listIsTask.exec(b),E&&(p=E[0]!=="[ ] ",b=b.replace(this.rules.other.listReplaceTask,""))),o.items.push({type:"list_item",raw:d,task:!!E,checked:p,loose:!1,text:b,tokens:[]}),o.raw+=d}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 h=0;h<o.items.length;h++)if(this.lexer.state.top=!1,o.items[h].tokens=this.lexer.blockTokens(o.items[h].text,[]),!o.loose){let d=o.items[h].tokens.filter(m=>m.type==="space"),b=d.length>0&&d.some(m=>this.rules.other.anyLine.test(m.raw));o.loose=b}if(o.loose)for(let h=0;h<o.items.length;h++)o.items[h].loose=!0;return o}}html(e){let n=this.rules.block.html.exec(e);if(n)return{type:"html",block:!0,raw:n[0],pre:n[1]==="pre"||n[1]==="script"||n[1]==="style",text:n[0]}}def(e){let n=this.rules.block.def.exec(e);if(n){let i=n[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=n[2]?n[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):n[3];return{type:"def",tag:i,raw:n[0],href:s,title:o}}}table(e){let n=this.rules.block.table.exec(e);if(!n||!this.rules.other.tableDelimiter.test(n[2]))return;let i=dy(n[1]),s=n[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=n[3]?.trim()?n[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
122
|
+
`):[],f={type:"table",raw:n[0],header:[],align:[],rows:[]};if(i.length===s.length){for(let g of s)this.rules.other.tableAlignRight.test(g)?f.align.push("right"):this.rules.other.tableAlignCenter.test(g)?f.align.push("center"):this.rules.other.tableAlignLeft.test(g)?f.align.push("left"):f.align.push(null);for(let g=0;g<i.length;g++)f.header.push({text:i[g],tokens:this.lexer.inline(i[g]),header:!0,align:f.align[g]});for(let g of o)f.rows.push(dy(g,f.header.length).map((c,h)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:f.align[h]})));return f}}lheading(e){let n=this.rules.block.lheading.exec(e);if(n)return{type:"heading",raw:n[0],depth:n[2].charAt(0)==="="?1:2,text:n[1],tokens:this.lexer.inline(n[1])}}paragraph(e){let n=this.rules.block.paragraph.exec(e);if(n){let i=n[1].charAt(n[1].length-1)===`
|
|
123
|
+
`?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:i,tokens:this.lexer.inline(i)}}}text(e){let n=this.rules.block.text.exec(e);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(e){let n=this.rules.inline.escape.exec(e);if(n)return{type:"escape",raw:n[0],text:n[1]}}tag(e){let n=this.rules.inline.tag.exec(e);if(n)return!this.lexer.state.inLink&&this.rules.other.startATag.test(n[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:n[0]}}link(e){let n=this.rules.inline.link.exec(e);if(n){let i=n[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let f=xl(i.slice(0,-1),"\\");if((i.length-f.length)%2===0)return}else{let f=GN(n[2],"()");if(f===-2)return;if(f>-1){let g=(n[0].indexOf("!")===0?5:4)+n[1].length+f;n[2]=n[2].substring(0,f),n[0]=n[0].substring(0,g).trim(),n[3]=""}}let s=n[2],o="";if(this.options.pedantic){let f=this.rules.other.pedanticHrefTitle.exec(s);f&&(s=f[1],o=f[3])}else o=n[3]?n[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(i)?s=s.slice(1):s=s.slice(1,-1)),fy(n,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},n[0],this.lexer,this.rules)}}reflink(e,n){let i;if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){let s=(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=n[s.toLowerCase()];if(!o){let f=i[0].charAt(0);return{type:"text",raw:f,text:f}}return fy(i,o,i[0],this.lexer,this.rules)}}emStrong(e,n,i=""){let s=this.rules.inline.emStrongLDelim.exec(e);if(!(!s||s[3]&&i.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[2])||!i||this.rules.inline.punctuation.exec(i))){let o=[...s[0]].length-1,f,g,c=o,h=0,d=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,n=n.slice(-1*e.length+o);(s=d.exec(n))!=null;){if(f=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!f)continue;if(g=[...f].length,s[3]||s[4]){c+=g;continue}else if((s[5]||s[6])&&o%3&&!((o+g)%3)){h+=g;continue}if(c-=g,c>0)continue;g=Math.min(g,g+c+h);let b=[...s[0]][0].length,m=e.slice(0,o+s.index+b+g);if(Math.min(o,g)%2){let x=m.slice(1,-1);return{type:"em",raw:m,text:x,tokens:this.lexer.inlineTokens(x)}}let w=m.slice(2,-2);return{type:"strong",raw:m,text:w,tokens:this.lexer.inlineTokens(w)}}}}codespan(e){let n=this.rules.inline.code.exec(e);if(n){let i=n[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(i),o=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return s&&o&&(i=i.substring(1,i.length-1)),{type:"codespan",raw:n[0],text:i}}}br(e){let n=this.rules.inline.br.exec(e);if(n)return{type:"br",raw:n[0]}}del(e){let n=this.rules.inline.del.exec(e);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(e){let n=this.rules.inline.autolink.exec(e);if(n){let i,s;return n[2]==="@"?(i=n[1],s="mailto:"+i):(i=n[1],s=i),{type:"link",raw:n[0],text:i,href:s,tokens:[{type:"text",raw:i,text:i}]}}}url(e){let n;if(n=this.rules.inline.url.exec(e)){let i,s;if(n[2]==="@")i=n[0],s="mailto:"+i;else{let o;do o=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])?.[0]??"";while(o!==n[0]);i=n[0],n[1]==="www."?s="http://"+n[0]:s=n[0]}return{type:"link",raw:n[0],text:i,href:s,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){let n=this.rules.inline.text.exec(e);if(n){let i=this.lexer.state.inRawBlock;return{type:"text",raw:n[0],text:n[0],escaped:i}}}},Ki=class wg{tokens;options;state;tokenizer;inlineQueue;constructor(n){this.tokens=[],this.tokens.links=Object.create(null),this.options=n||sa,this.options.tokenizer=this.options.tokenizer||new uh,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 i={other:Vn,block:ku.normal,inline:wl.normal};this.options.pedantic?(i.block=ku.pedantic,i.inline=wl.pedantic):this.options.gfm&&(i.block=ku.gfm,this.options.breaks?i.inline=wl.breaks:i.inline=wl.gfm),this.tokenizer.rules=i}static get rules(){return{block:ku,inline:wl}}static lex(n,i){return new wg(i).lex(n)}static lexInline(n,i){return new wg(i).inlineTokens(n)}lex(n){n=n.replace(Vn.carriageReturn,`
|
|
124
|
+
`),this.blockTokens(n,this.tokens);for(let i=0;i<this.inlineQueue.length;i++){let s=this.inlineQueue[i];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(n,i=[],s=!1){for(this.options.pedantic&&(n=n.replace(Vn.tabCharGlobal," ").replace(Vn.spaceLine,""));n;){let o;if(this.options.extensions?.block?.some(g=>(o=g.call({lexer:this},n,i))?(n=n.substring(o.raw.length),i.push(o),!0):!1))continue;if(o=this.tokenizer.space(n)){n=n.substring(o.raw.length);let g=i.at(-1);o.raw.length===1&&g!==void 0?g.raw+=`
|
|
125
|
+
`:i.push(o);continue}if(o=this.tokenizer.code(n)){n=n.substring(o.raw.length);let g=i.at(-1);g?.type==="paragraph"||g?.type==="text"?(g.raw+=(g.raw.endsWith(`
|
|
126
|
+
`)?"":`
|
|
127
|
+
`)+o.raw,g.text+=`
|
|
128
|
+
`+o.text,this.inlineQueue.at(-1).src=g.text):i.push(o);continue}if(o=this.tokenizer.fences(n)){n=n.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.heading(n)){n=n.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.hr(n)){n=n.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.blockquote(n)){n=n.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.list(n)){n=n.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.html(n)){n=n.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.def(n)){n=n.substring(o.raw.length);let g=i.at(-1);g?.type==="paragraph"||g?.type==="text"?(g.raw+=(g.raw.endsWith(`
|
|
129
|
+
`)?"":`
|
|
130
|
+
`)+o.raw,g.text+=`
|
|
131
|
+
`+o.raw,this.inlineQueue.at(-1).src=g.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title},i.push(o));continue}if(o=this.tokenizer.table(n)){n=n.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.lheading(n)){n=n.substring(o.raw.length),i.push(o);continue}let f=n;if(this.options.extensions?.startBlock){let g=1/0,c=n.slice(1),h;this.options.extensions.startBlock.forEach(d=>{h=d.call({lexer:this},c),typeof h=="number"&&h>=0&&(g=Math.min(g,h))}),g<1/0&&g>=0&&(f=n.substring(0,g+1))}if(this.state.top&&(o=this.tokenizer.paragraph(f))){let g=i.at(-1);s&&g?.type==="paragraph"?(g.raw+=(g.raw.endsWith(`
|
|
132
|
+
`)?"":`
|
|
133
|
+
`)+o.raw,g.text+=`
|
|
134
|
+
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=g.text):i.push(o),s=f.length!==n.length,n=n.substring(o.raw.length);continue}if(o=this.tokenizer.text(n)){n=n.substring(o.raw.length);let g=i.at(-1);g?.type==="text"?(g.raw+=(g.raw.endsWith(`
|
|
135
|
+
`)?"":`
|
|
136
|
+
`)+o.raw,g.text+=`
|
|
137
|
+
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=g.text):i.push(o);continue}if(n){let g="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(g);break}else throw new Error(g)}}return this.state.top=!0,i}inline(n,i=[]){return this.inlineQueue.push({src:n,tokens:i}),i}inlineTokens(n,i=[]){let s=n,o=null;if(this.tokens.links){let h=Object.keys(this.tokens.links);if(h.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)h.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,o.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let f;for(;(o=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)f=o[2]?o[2].length:0,s=s.slice(0,o.index+f)+"["+"a".repeat(o[0].length-f-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let g=!1,c="";for(;n;){g||(c=""),g=!1;let h;if(this.options.extensions?.inline?.some(b=>(h=b.call({lexer:this},n,i))?(n=n.substring(h.raw.length),i.push(h),!0):!1))continue;if(h=this.tokenizer.escape(n)){n=n.substring(h.raw.length),i.push(h);continue}if(h=this.tokenizer.tag(n)){n=n.substring(h.raw.length),i.push(h);continue}if(h=this.tokenizer.link(n)){n=n.substring(h.raw.length),i.push(h);continue}if(h=this.tokenizer.reflink(n,this.tokens.links)){n=n.substring(h.raw.length);let b=i.at(-1);h.type==="text"&&b?.type==="text"?(b.raw+=h.raw,b.text+=h.text):i.push(h);continue}if(h=this.tokenizer.emStrong(n,s,c)){n=n.substring(h.raw.length),i.push(h);continue}if(h=this.tokenizer.codespan(n)){n=n.substring(h.raw.length),i.push(h);continue}if(h=this.tokenizer.br(n)){n=n.substring(h.raw.length),i.push(h);continue}if(h=this.tokenizer.del(n)){n=n.substring(h.raw.length),i.push(h);continue}if(h=this.tokenizer.autolink(n)){n=n.substring(h.raw.length),i.push(h);continue}if(!this.state.inLink&&(h=this.tokenizer.url(n))){n=n.substring(h.raw.length),i.push(h);continue}let d=n;if(this.options.extensions?.startInline){let b=1/0,m=n.slice(1),w;this.options.extensions.startInline.forEach(x=>{w=x.call({lexer:this},m),typeof w=="number"&&w>=0&&(b=Math.min(b,w))}),b<1/0&&b>=0&&(d=n.substring(0,b+1))}if(h=this.tokenizer.inlineText(d)){n=n.substring(h.raw.length),h.raw.slice(-1)!=="_"&&(c=h.raw.slice(-1)),g=!0;let b=i.at(-1);b?.type==="text"?(b.raw+=h.raw,b.text+=h.text):i.push(h);continue}if(n){let b="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(b);break}else throw new Error(b)}}return i}},hh=class{options;parser;constructor(e){this.options=e||sa}space(e){return""}code({text:e,lang:n,escaped:i}){let s=(n||"").match(Vn.notSpaceStart)?.[0],o=e.replace(Vn.endingNewline,"")+`
|
|
138
|
+
`;return s?'<pre><code class="language-'+ar(s)+'">'+(i?o:ar(o,!0))+`</code></pre>
|
|
139
|
+
`:"<pre><code>"+(i?o:ar(o,!0))+`</code></pre>
|
|
140
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
|
141
|
+
${this.parser.parse(e)}</blockquote>
|
|
142
|
+
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:n}){return`<h${n}>${this.parser.parseInline(e)}</h${n}>
|
|
143
|
+
`}hr(e){return`<hr>
|
|
144
|
+
`}list(e){let n=e.ordered,i=e.start,s="";for(let g=0;g<e.items.length;g++){let c=e.items[g];s+=this.listitem(c)}let o=n?"ol":"ul",f=n&&i!==1?' start="'+i+'"':"";return"<"+o+f+`>
|
|
145
|
+
`+s+"</"+o+`>
|
|
146
|
+
`}listitem(e){let n="";if(e.task){let i=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type==="paragraph"?(e.tokens[0].text=i+" "+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=i+" "+ar(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:i+" ",text:i+" ",escaped:!0}):n+=i+" "}return n+=this.parser.parse(e.tokens,!!e.loose),`<li>${n}</li>
|
|
147
|
+
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
148
|
+
`}table(e){let n="",i="";for(let o=0;o<e.header.length;o++)i+=this.tablecell(e.header[o]);n+=this.tablerow({text:i});let s="";for(let o=0;o<e.rows.length;o++){let f=e.rows[o];i="";for(let g=0;g<f.length;g++)i+=this.tablecell(f[g]);s+=this.tablerow({text:i})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
|
|
149
|
+
<thead>
|
|
150
|
+
`+n+`</thead>
|
|
151
|
+
`+s+`</table>
|
|
152
|
+
`}tablerow({text:e}){return`<tr>
|
|
153
|
+
${e}</tr>
|
|
154
|
+
`}tablecell(e){let n=this.parser.parseInline(e.tokens),i=e.header?"th":"td";return(e.align?`<${i} align="${e.align}">`:`<${i}>`)+n+`</${i}>
|
|
155
|
+
`}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>${ar(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:n,tokens:i}){let s=this.parser.parseInline(i),o=hy(e);if(o===null)return s;e=o;let f='<a href="'+e+'"';return n&&(f+=' title="'+ar(n)+'"'),f+=">"+s+"</a>",f}image({href:e,title:n,text:i,tokens:s}){s&&(i=this.parser.parseInline(s,this.parser.textRenderer));let o=hy(e);if(o===null)return ar(i);e=o;let f=`<img src="${e}" alt="${i}"`;return n&&(f+=` title="${ar(n)}"`),f+=">",f}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:ar(e.text)}},jm=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""}},Vi=class xg{options;renderer;textRenderer;constructor(n){this.options=n||sa,this.options.renderer=this.options.renderer||new hh,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new jm}static parse(n,i){return new xg(i).parse(n)}static parseInline(n,i){return new xg(i).parseInline(n)}parse(n,i=!0){let s="";for(let o=0;o<n.length;o++){let f=n[o];if(this.options.extensions?.renderers?.[f.type]){let c=f,h=this.options.extensions.renderers[c.type].call({parser:this},c);if(h!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(c.type)){s+=h||"";continue}}let g=f;switch(g.type){case"space":{s+=this.renderer.space(g);continue}case"hr":{s+=this.renderer.hr(g);continue}case"heading":{s+=this.renderer.heading(g);continue}case"code":{s+=this.renderer.code(g);continue}case"table":{s+=this.renderer.table(g);continue}case"blockquote":{s+=this.renderer.blockquote(g);continue}case"list":{s+=this.renderer.list(g);continue}case"html":{s+=this.renderer.html(g);continue}case"def":{s+=this.renderer.def(g);continue}case"paragraph":{s+=this.renderer.paragraph(g);continue}case"text":{let c=g,h=this.renderer.text(c);for(;o+1<n.length&&n[o+1].type==="text";)c=n[++o],h+=`
|
|
156
|
+
`+this.renderer.text(c);i?s+=this.renderer.paragraph({type:"paragraph",raw:h,text:h,tokens:[{type:"text",raw:h,text:h,escaped:!0}]}):s+=h;continue}default:{let c='Token with "'+g.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return s}parseInline(n,i=this.renderer){let s="";for(let o=0;o<n.length;o++){let f=n[o];if(this.options.extensions?.renderers?.[f.type]){let c=this.options.extensions.renderers[f.type].call({parser:this},f);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(f.type)){s+=c||"";continue}}let g=f;switch(g.type){case"escape":{s+=i.text(g);break}case"html":{s+=i.html(g);break}case"link":{s+=i.link(g);break}case"image":{s+=i.image(g);break}case"strong":{s+=i.strong(g);break}case"em":{s+=i.em(g);break}case"codespan":{s+=i.codespan(g);break}case"br":{s+=i.br(g);break}case"del":{s+=i.del(g);break}case"text":{s+=i.text(g);break}default:{let c='Token with "'+g.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return s}},Ol=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?Ki.lex:Ki.lexInline}provideParser(){return this.block?Vi.parse:Vi.parseInline}},Qx=class{defaults=Tm();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Vi;Renderer=hh;TextRenderer=jm;Lexer=Ki;Tokenizer=uh;Hooks=Ol;constructor(...e){this.use(...e)}walkTokens(e,n){let i=[];for(let s of e)switch(i=i.concat(n.call(this,s)),s.type){case"table":{let o=s;for(let f of o.header)i=i.concat(this.walkTokens(f.tokens,n));for(let f of o.rows)for(let g of f)i=i.concat(this.walkTokens(g.tokens,n));break}case"list":{let o=s;i=i.concat(this.walkTokens(o.items,n));break}default:{let o=s;this.defaults.extensions?.childTokens?.[o.type]?this.defaults.extensions.childTokens[o.type].forEach(f=>{let g=o[f].flat(1/0);i=i.concat(this.walkTokens(g,n))}):o.tokens&&(i=i.concat(this.walkTokens(o.tokens,n)))}}return i}use(...e){let n=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(i=>{let s={...i};if(s.async=this.defaults.async||s.async||!1,i.extensions&&(i.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let f=n.renderers[o.name];f?n.renderers[o.name]=function(...g){let c=o.renderer.apply(this,g);return c===!1&&(c=f.apply(this,g)),c}:n.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 f=n[o.level];f?f.unshift(o.tokenizer):n[o.level]=[o.tokenizer],o.start&&(o.level==="block"?n.startBlock?n.startBlock.push(o.start):n.startBlock=[o.start]:o.level==="inline"&&(n.startInline?n.startInline.push(o.start):n.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(n.childTokens[o.name]=o.childTokens)}),s.extensions=n),i.renderer){let o=this.defaults.renderer||new hh(this.defaults);for(let f in i.renderer){if(!(f in o))throw new Error(`renderer '${f}' does not exist`);if(["options","parser"].includes(f))continue;let g=f,c=i.renderer[g],h=o[g];o[g]=(...d)=>{let b=c.apply(o,d);return b===!1&&(b=h.apply(o,d)),b||""}}s.renderer=o}if(i.tokenizer){let o=this.defaults.tokenizer||new uh(this.defaults);for(let f in i.tokenizer){if(!(f in o))throw new Error(`tokenizer '${f}' does not exist`);if(["options","rules","lexer"].includes(f))continue;let g=f,c=i.tokenizer[g],h=o[g];o[g]=(...d)=>{let b=c.apply(o,d);return b===!1&&(b=h.apply(o,d)),b}}s.tokenizer=o}if(i.hooks){let o=this.defaults.hooks||new Ol;for(let f in i.hooks){if(!(f in o))throw new Error(`hook '${f}' does not exist`);if(["options","block"].includes(f))continue;let g=f,c=i.hooks[g],h=o[g];Ol.passThroughHooks.has(f)?o[g]=d=>{if(this.defaults.async&&Ol.passThroughHooksRespectAsync.has(f))return(async()=>{let m=await c.call(o,d);return h.call(o,m)})();let b=c.call(o,d);return h.call(o,b)}:o[g]=(...d)=>{if(this.defaults.async)return(async()=>{let m=await c.apply(o,d);return m===!1&&(m=await h.apply(o,d)),m})();let b=c.apply(o,d);return b===!1&&(b=h.apply(o,d)),b}}s.hooks=o}if(i.walkTokens){let o=this.defaults.walkTokens,f=i.walkTokens;s.walkTokens=function(g){let c=[];return c.push(f.call(this,g)),o&&(c=c.concat(o.call(this,g))),c}}this.defaults={...this.defaults,...s}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,n){return Ki.lex(e,n??this.defaults)}parser(e,n){return Vi.parse(e,n??this.defaults)}parseMarkdown(e){return(n,i)=>{let s={...i},o={...this.defaults,...s},f=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&s.async===!1)return f(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 n>"u"||n===null)return f(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return f(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=e),o.async)return(async()=>{let g=o.hooks?await o.hooks.preprocess(n):n,c=await(o.hooks?await o.hooks.provideLexer():e?Ki.lex:Ki.lexInline)(g,o),h=o.hooks?await o.hooks.processAllTokens(c):c;o.walkTokens&&await Promise.all(this.walkTokens(h,o.walkTokens));let d=await(o.hooks?await o.hooks.provideParser():e?Vi.parse:Vi.parseInline)(h,o);return o.hooks?await o.hooks.postprocess(d):d})().catch(f);try{o.hooks&&(n=o.hooks.preprocess(n));let g=(o.hooks?o.hooks.provideLexer():e?Ki.lex:Ki.lexInline)(n,o);o.hooks&&(g=o.hooks.processAllTokens(g)),o.walkTokens&&this.walkTokens(g,o.walkTokens);let c=(o.hooks?o.hooks.provideParser():e?Vi.parse:Vi.parseInline)(g,o);return o.hooks&&(c=o.hooks.postprocess(c)),c}catch(g){return f(g)}}}onError(e,n){return i=>{if(i.message+=`
|
|
157
|
+
Please report this to https://github.com/markedjs/marked.`,e){let s="<p>An error occurred:</p><pre>"+ar(i.message+"",!0)+"</pre>";return n?Promise.resolve(s):s}if(n)return Promise.reject(i);throw i}}},ra=new Qx;function At(e,n){return ra.parse(e,n)}At.options=At.setOptions=function(e){return ra.setOptions(e),At.defaults=ra.defaults,Ux(At.defaults),At};At.getDefaults=Tm;At.defaults=sa;At.use=function(...e){return ra.use(...e),At.defaults=ra.defaults,Ux(At.defaults),At};At.walkTokens=function(e,n){return ra.walkTokens(e,n)};At.parseInline=ra.parseInline;At.Parser=Vi;At.parser=Vi.parse;At.Renderer=hh;At.TextRenderer=jm;At.Lexer=Ki;At.lexer=Ki.lex;At.Tokenizer=uh;At.Hooks=Ol;At.parse=At;At.options;At.setOptions;At.use;At.walkTokens;At.parseInline;Vi.parse;Ki.lex;const{entries:eC,setPrototypeOf:py,isFrozen:KN,getPrototypeOf:VN,getOwnPropertyDescriptor:YN}=Object;let{freeze:Xn,seal:$i,create:Ya}=Object,{apply:Cg,construct:Eg}=typeof Reflect<"u"&&Reflect;Xn||(Xn=function(n){return n});$i||($i=function(n){return n});Cg||(Cg=function(n,i){for(var s=arguments.length,o=new Array(s>2?s-2:0),f=2;f<s;f++)o[f-2]=arguments[f];return n.apply(i,o)});Eg||(Eg=function(n){for(var i=arguments.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=arguments[o];return new n(...s)});const Cl=_n(Array.prototype.forEach),XN=_n(Array.prototype.lastIndexOf),gy=_n(Array.prototype.pop),El=_n(Array.prototype.push),ZN=_n(Array.prototype.splice),Gn=Array.isArray,Dl=_n(String.prototype.toLowerCase),up=_n(String.prototype.toString),my=_n(String.prototype.match),qa=_n(String.prototype.replace),_y=_n(String.prototype.indexOf),JN=_n(String.prototype.trim),QN=_n(Number.prototype.toString),eO=_n(Boolean.prototype.toString),vy=typeof BigInt>"u"?null:_n(BigInt.prototype.toString),by=typeof Symbol>"u"?null:_n(Symbol.prototype.toString),rn=_n(Object.prototype.hasOwnProperty),kl=_n(Object.prototype.toString),In=_n(RegExp.prototype.test),Tu=tO(TypeError);function _n(e){return function(n){n instanceof RegExp&&(n.lastIndex=0);for(var i=arguments.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=arguments[o];return Cg(e,n,s)}}function tO(e){return function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Eg(e,i)}}function Xe(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Dl;if(py&&py(e,null),!Gn(n))return e;let s=n.length;for(;s--;){let o=n[s];if(typeof o=="string"){const f=i(o);f!==o&&(KN(n)||(n[s]=f),o=f)}e[o]=!0}return e}function nO(e){for(let n=0;n<e.length;n++)rn(e,n)||(e[n]=null);return e}function ci(e){const n=Ya(null);for(const[i,s]of eC(e))rn(e,i)&&(Gn(s)?n[i]=nO(s):s&&typeof s=="object"&&s.constructor===Object?n[i]=ci(s):n[i]=s);return n}function iO(e){switch(typeof e){case"string":return e;case"number":return QN(e);case"boolean":return eO(e);case"bigint":return vy?vy(e):"0";case"symbol":return by?by(e):"Symbol()";case"undefined":return kl(e);case"function":case"object":{if(e===null)return kl(e);const n=e,i=Xa(n,"toString");if(typeof i=="function"){const s=i(n);return typeof s=="string"?s:kl(s)}return kl(e)}default:return kl(e)}}function Xa(e,n){for(;e!==null;){const s=YN(e,n);if(s){if(s.get)return _n(s.get);if(typeof s.value=="function")return _n(s.value)}e=VN(e)}function i(){return null}return i}function rO(e){try{return In(e,""),!0}catch{return!1}}const yy=Xn(["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"]),hp=Xn(["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"]),dp=Xn(["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"]),sO=Xn(["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"]),fp=Xn(["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"]),aO=Xn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Sy=Xn(["#text"]),wy=Xn(["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"]),pp=Xn(["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"]),xy=Xn(["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"]),Au=Xn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),oO=$i(/\{\{[\w\W]*|[\w\W]*\}\}/gm),lO=$i(/<%[\w\W]*|[\w\W]*%>/gm),cO=$i(/\$\{[\w\W]*/gm),uO=$i(/^data-[\-\w.\u00B7-\uFFFF]+$/),hO=$i(/^aria-[\-\w]+$/),tC=$i(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),dO=$i(/^(?:\w+script|data):/i),fO=$i(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),nC=$i(/^html$/i),pO=$i(/^[a-z][.\w]*(-[.\w]+)+$/i);var Cy=Object.freeze({__proto__:null,ARIA_ATTR:hO,ATTR_WHITESPACE:fO,CUSTOM_ELEMENT:pO,DATA_ATTR:uO,DOCTYPE_NAME:nC,ERB_EXPR:lO,IS_ALLOWED_URI:tC,IS_SCRIPT_OR_DATA:dO,MUSTACHE_EXPR:oO,TMPLIT_EXPR:cO});const Tl={element:1,text:3,progressingInstruction:7,comment:8,document:9},gO=function(){return typeof window>"u"?null:window},mO=function(n,i){if(typeof n!="object"||typeof n.createPolicy!="function")return null;let s=null;const o="data-tt-policy-suffix";i&&i.hasAttribute(o)&&(s=i.getAttribute(o));const f="dompurify"+(s?"#"+s:"");try{return n.createPolicy(f,{createHTML(g){return g},createScriptURL(g){return g}})}catch{return console.warn("TrustedTypes policy "+f+" could not be created."),null}},Ey=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function iC(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:gO();const n=De=>iC(De);if(n.version="3.4.2",n.removed=[],!e||!e.document||e.document.nodeType!==Tl.document||!e.Element)return n.isSupported=!1,n;let{document:i}=e;const s=i,o=s.currentScript,{DocumentFragment:f,HTMLTemplateElement:g,Node:c,Element:h,NodeFilter:d,NamedNodeMap:b=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:m,DOMParser:w,trustedTypes:x}=e,T=h.prototype,E=Xa(T,"cloneNode"),p=Xa(T,"remove"),v=Xa(T,"nextSibling"),_=Xa(T,"childNodes"),S=Xa(T,"parentNode");if(typeof g=="function"){const De=i.createElement("template");De.content&&De.content.ownerDocument&&(i=De.content.ownerDocument)}let k,L="";const{implementation:R,createNodeIterator:N,createDocumentFragment:A,getElementsByTagName:B}=i,{importNode:q}=s;let F=Ey();n.isSupported=typeof eC=="function"&&typeof S=="function"&&R&&R.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:W,ERB_EXPR:I,TMPLIT_EXPR:Y,DATA_ATTR:V,ARIA_ATTR:z,IS_SCRIPT_OR_DATA:G,ATTR_WHITESPACE:K,CUSTOM_ELEMENT:j}=Cy;let{IS_ALLOWED_URI:H}=Cy,D=null;const P=Xe({},[...yy,...hp,...dp,...fp,...Sy]);let Z=null;const ee=Xe({},[...wy,...pp,...xy,...Au]);let J=Object.seal(Ya(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}})),se=null,X=null;const $=Object.seal(Ya(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ae=!0,de=!0,we=!1,ye=!0,Ne=!1,Oe=!0,Ge=!1,vt=!1,Le=!1,Rt=!1,Xt=!1,vn=!1,on=!0,kn=!1;const Zt="user-content-";let ut=!0,Lt=!1,Ct={},Ft=null;const Kt=Xe({},["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 Jn=null;const bn=Xe({},["audio","video","img","source","image","track"]);let Pn=null;const dt=Xe({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Tn="http://www.w3.org/1998/Math/MathML",ve="http://www.w3.org/2000/svg",$e="http://www.w3.org/1999/xhtml";let Je=$e,at=!1,Ve=null;const ln=Xe({},[Tn,ve,$e],up);let Dt=Xe({},["mi","mo","mn","ms","mtext"]),An=Xe({},["annotation-xml"]);const Un=Xe({},["title","style","font","a","script"]);let jt=null;const te=["application/xhtml+xml","text/html"],pe="text/html";let Se=null,je=null;const bt=i.createElement("form"),ht=function(Q){return Q instanceof RegExp||Q instanceof Function},ke=function(){let Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(je&&je===Q)return;(!Q||typeof Q!="object")&&(Q={}),Q=ci(Q),jt=te.indexOf(Q.PARSER_MEDIA_TYPE)===-1?pe:Q.PARSER_MEDIA_TYPE,Se=jt==="application/xhtml+xml"?up:Dl,D=rn(Q,"ALLOWED_TAGS")&&Gn(Q.ALLOWED_TAGS)?Xe({},Q.ALLOWED_TAGS,Se):P,Z=rn(Q,"ALLOWED_ATTR")&&Gn(Q.ALLOWED_ATTR)?Xe({},Q.ALLOWED_ATTR,Se):ee,Ve=rn(Q,"ALLOWED_NAMESPACES")&&Gn(Q.ALLOWED_NAMESPACES)?Xe({},Q.ALLOWED_NAMESPACES,up):ln,Pn=rn(Q,"ADD_URI_SAFE_ATTR")&&Gn(Q.ADD_URI_SAFE_ATTR)?Xe(ci(dt),Q.ADD_URI_SAFE_ATTR,Se):dt,Jn=rn(Q,"ADD_DATA_URI_TAGS")&&Gn(Q.ADD_DATA_URI_TAGS)?Xe(ci(bn),Q.ADD_DATA_URI_TAGS,Se):bn,Ft=rn(Q,"FORBID_CONTENTS")&&Gn(Q.FORBID_CONTENTS)?Xe({},Q.FORBID_CONTENTS,Se):Kt,se=rn(Q,"FORBID_TAGS")&&Gn(Q.FORBID_TAGS)?Xe({},Q.FORBID_TAGS,Se):ci({}),X=rn(Q,"FORBID_ATTR")&&Gn(Q.FORBID_ATTR)?Xe({},Q.FORBID_ATTR,Se):ci({}),Ct=rn(Q,"USE_PROFILES")?Q.USE_PROFILES&&typeof Q.USE_PROFILES=="object"?ci(Q.USE_PROFILES):Q.USE_PROFILES:!1,ae=Q.ALLOW_ARIA_ATTR!==!1,de=Q.ALLOW_DATA_ATTR!==!1,we=Q.ALLOW_UNKNOWN_PROTOCOLS||!1,ye=Q.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ne=Q.SAFE_FOR_TEMPLATES||!1,Oe=Q.SAFE_FOR_XML!==!1,Ge=Q.WHOLE_DOCUMENT||!1,Rt=Q.RETURN_DOM||!1,Xt=Q.RETURN_DOM_FRAGMENT||!1,vn=Q.RETURN_TRUSTED_TYPE||!1,Le=Q.FORCE_BODY||!1,on=Q.SANITIZE_DOM!==!1,kn=Q.SANITIZE_NAMED_PROPS||!1,ut=Q.KEEP_CONTENT!==!1,Lt=Q.IN_PLACE||!1,H=rO(Q.ALLOWED_URI_REGEXP)?Q.ALLOWED_URI_REGEXP:tC,Je=typeof Q.NAMESPACE=="string"?Q.NAMESPACE:$e,Dt=rn(Q,"MATHML_TEXT_INTEGRATION_POINTS")&&Q.MATHML_TEXT_INTEGRATION_POINTS&&typeof Q.MATHML_TEXT_INTEGRATION_POINTS=="object"?ci(Q.MATHML_TEXT_INTEGRATION_POINTS):Xe({},["mi","mo","mn","ms","mtext"]),An=rn(Q,"HTML_INTEGRATION_POINTS")&&Q.HTML_INTEGRATION_POINTS&&typeof Q.HTML_INTEGRATION_POINTS=="object"?ci(Q.HTML_INTEGRATION_POINTS):Xe({},["annotation-xml"]);const _e=rn(Q,"CUSTOM_ELEMENT_HANDLING")&&Q.CUSTOM_ELEMENT_HANDLING&&typeof Q.CUSTOM_ELEMENT_HANDLING=="object"?ci(Q.CUSTOM_ELEMENT_HANDLING):Ya(null);if(J=Ya(null),rn(_e,"tagNameCheck")&&ht(_e.tagNameCheck)&&(J.tagNameCheck=_e.tagNameCheck),rn(_e,"attributeNameCheck")&&ht(_e.attributeNameCheck)&&(J.attributeNameCheck=_e.attributeNameCheck),rn(_e,"allowCustomizedBuiltInElements")&&typeof _e.allowCustomizedBuiltInElements=="boolean"&&(J.allowCustomizedBuiltInElements=_e.allowCustomizedBuiltInElements),Ne&&(de=!1),Xt&&(Rt=!0),Ct&&(D=Xe({},Sy),Z=Ya(null),Ct.html===!0&&(Xe(D,yy),Xe(Z,wy)),Ct.svg===!0&&(Xe(D,hp),Xe(Z,pp),Xe(Z,Au)),Ct.svgFilters===!0&&(Xe(D,dp),Xe(Z,pp),Xe(Z,Au)),Ct.mathMl===!0&&(Xe(D,fp),Xe(Z,xy),Xe(Z,Au))),$.tagCheck=null,$.attributeCheck=null,rn(Q,"ADD_TAGS")&&(typeof Q.ADD_TAGS=="function"?$.tagCheck=Q.ADD_TAGS:Gn(Q.ADD_TAGS)&&(D===P&&(D=ci(D)),Xe(D,Q.ADD_TAGS,Se))),rn(Q,"ADD_ATTR")&&(typeof Q.ADD_ATTR=="function"?$.attributeCheck=Q.ADD_ATTR:Gn(Q.ADD_ATTR)&&(Z===ee&&(Z=ci(Z)),Xe(Z,Q.ADD_ATTR,Se))),rn(Q,"ADD_URI_SAFE_ATTR")&&Gn(Q.ADD_URI_SAFE_ATTR)&&Xe(Pn,Q.ADD_URI_SAFE_ATTR,Se),rn(Q,"FORBID_CONTENTS")&&Gn(Q.FORBID_CONTENTS)&&(Ft===Kt&&(Ft=ci(Ft)),Xe(Ft,Q.FORBID_CONTENTS,Se)),rn(Q,"ADD_FORBID_CONTENTS")&&Gn(Q.ADD_FORBID_CONTENTS)&&(Ft===Kt&&(Ft=ci(Ft)),Xe(Ft,Q.ADD_FORBID_CONTENTS,Se)),ut&&(D["#text"]=!0),Ge&&Xe(D,["html","head","body"]),D.table&&(Xe(D,["tbody"]),delete se.tbody),Q.TRUSTED_TYPES_POLICY){if(typeof Q.TRUSTED_TYPES_POLICY.createHTML!="function")throw Tu('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Q.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Tu('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');k=Q.TRUSTED_TYPES_POLICY,L=k.createHTML("")}else k===void 0&&(k=mO(x,o)),k!==null&&typeof L=="string"&&(L=k.createHTML(""));Xn&&Xn(Q),je=Q},Ce=Xe({},[...hp,...dp,...sO]),Pe=Xe({},[...fp,...aO]),Vt=function(Q){let _e=S(Q);(!_e||!_e.tagName)&&(_e={namespaceURI:Je,tagName:"template"});const Ee=Dl(Q.tagName),ot=Dl(_e.tagName);return Ve[Q.namespaceURI]?Q.namespaceURI===ve?_e.namespaceURI===$e?Ee==="svg":_e.namespaceURI===Tn?Ee==="svg"&&(ot==="annotation-xml"||Dt[ot]):!!Ce[Ee]:Q.namespaceURI===Tn?_e.namespaceURI===$e?Ee==="math":_e.namespaceURI===ve?Ee==="math"&&An[ot]:!!Pe[Ee]:Q.namespaceURI===$e?_e.namespaceURI===ve&&!An[ot]||_e.namespaceURI===Tn&&!Dt[ot]?!1:!Pe[Ee]&&(Un[Ee]||!Ce[Ee]):!!(jt==="application/xhtml+xml"&&Ve[Q.namespaceURI]):!1},nt=function(Q){El(n.removed,{element:Q});try{S(Q).removeChild(Q)}catch{p(Q)}},Rn=function(Q,_e){try{El(n.removed,{attribute:_e.getAttributeNode(Q),from:_e})}catch{El(n.removed,{attribute:null,from:_e})}if(_e.removeAttribute(Q),Q==="is")if(Rt||Xt)try{nt(_e)}catch{}else try{_e.setAttribute(Q,"")}catch{}},dr=function(Q){let _e=null,Ee=null;if(Le)Q="<remove></remove>"+Q;else{const Bt=my(Q,/^[\r\n\t ]+/);Ee=Bt&&Bt[0]}jt==="application/xhtml+xml"&&Je===$e&&(Q='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Q+"</body></html>");const ot=k?k.createHTML(Q):Q;if(Je===$e)try{_e=new w().parseFromString(ot,jt)}catch{}if(!_e||!_e.documentElement){_e=R.createDocument(Je,"template",null);try{_e.documentElement.innerHTML=at?L:ot}catch{}}const Qe=_e.body||_e.documentElement;return Q&&Ee&&Qe.insertBefore(i.createTextNode(Ee),Qe.childNodes[0]||null),Je===$e?B.call(_e,Ge?"html":"body")[0]:Ge?_e.documentElement:Qe},fr=function(Q){return N.call(Q.ownerDocument||Q,Q,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},Qn=function(Q){return Q instanceof m&&(typeof Q.nodeName!="string"||typeof Q.textContent!="string"||typeof Q.removeChild!="function"||!(Q.attributes instanceof b)||typeof Q.removeAttribute!="function"||typeof Q.setAttribute!="function"||typeof Q.namespaceURI!="string"||typeof Q.insertBefore!="function"||typeof Q.hasChildNodes!="function")},It=function(Q){return typeof c=="function"&&Q instanceof c};function Nt(De,Q,_e){Cl(De,Ee=>{Ee.call(n,Q,_e,je)})}const Fi=function(Q){let _e=null;if(Nt(F.beforeSanitizeElements,Q,null),Qn(Q))return nt(Q),!0;const Ee=Se(Q.nodeName);if(Nt(F.uponSanitizeElement,Q,{tagName:Ee,allowedTags:D}),Oe&&Q.hasChildNodes()&&!It(Q.firstElementChild)&&In(/<[/\w!]/g,Q.innerHTML)&&In(/<[/\w!]/g,Q.textContent)||Oe&&Q.namespaceURI===$e&&Ee==="style"&&It(Q.firstElementChild)||Q.nodeType===Tl.progressingInstruction||Oe&&Q.nodeType===Tl.comment&&In(/<[/\w]/g,Q.data))return nt(Q),!0;if(se[Ee]||!($.tagCheck instanceof Function&&$.tagCheck(Ee))&&!D[Ee]){if(!se[Ee]&&pr(Ee)&&(J.tagNameCheck instanceof RegExp&&In(J.tagNameCheck,Ee)||J.tagNameCheck instanceof Function&&J.tagNameCheck(Ee)))return!1;if(ut&&!Ft[Ee]){const ot=S(Q)||Q.parentNode,Qe=_(Q)||Q.childNodes;if(Qe&&ot){const Bt=Qe.length;for(let Jt=Bt-1;Jt>=0;--Jt){const Qt=E(Qe[Jt],!0);ot.insertBefore(Qt,v(Q))}}}return nt(Q),!0}return Q instanceof h&&!Vt(Q)||(Ee==="noscript"||Ee==="noembed"||Ee==="noframes")&&In(/<\/no(script|embed|frames)/i,Q.innerHTML)?(nt(Q),!0):(Ne&&Q.nodeType===Tl.text&&(_e=Q.textContent,Cl([W,I,Y],ot=>{_e=qa(_e,ot," ")}),Q.textContent!==_e&&(El(n.removed,{element:Q.cloneNode()}),Q.textContent=_e)),Nt(F.afterSanitizeElements,Q,null),!1)},Fr=function(Q,_e,Ee){if(X[_e]||on&&(_e==="id"||_e==="name")&&(Ee in i||Ee in bt))return!1;const ot=Z[_e]||$.attributeCheck instanceof Function&&$.attributeCheck(_e,Q);if(!(de&&!X[_e]&&In(V,_e))){if(!(ae&&In(z,_e))){if(!ot||X[_e]){if(!(pr(Q)&&(J.tagNameCheck instanceof RegExp&&In(J.tagNameCheck,Q)||J.tagNameCheck instanceof Function&&J.tagNameCheck(Q))&&(J.attributeNameCheck instanceof RegExp&&In(J.attributeNameCheck,_e)||J.attributeNameCheck instanceof Function&&J.attributeNameCheck(_e,Q))||_e==="is"&&J.allowCustomizedBuiltInElements&&(J.tagNameCheck instanceof RegExp&&In(J.tagNameCheck,Ee)||J.tagNameCheck instanceof Function&&J.tagNameCheck(Ee))))return!1}else if(!Pn[_e]){if(!In(H,qa(Ee,K,""))){if(!((_e==="src"||_e==="xlink:href"||_e==="href")&&Q!=="script"&&_y(Ee,"data:")===0&&Jn[Q])){if(!(we&&!In(G,qa(Ee,K,"")))){if(Ee)return!1}}}}}}return!0},la=Xe({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),pr=function(Q){return!la[Dl(Q)]&&In(j,Q)},As=function(Q){Nt(F.beforeSanitizeAttributes,Q,null);const{attributes:_e}=Q;if(!_e||Qn(Q))return;const Ee={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Z,forceKeepAttr:void 0};let ot=_e.length;for(;ot--;){const Qe=_e[ot],{name:Bt,namespaceURI:Jt,value:Qt}=Qe,be=Se(Bt),Me=Qt;let Ie=Bt==="value"?Me:JN(Me);if(Ee.attrName=be,Ee.attrValue=Ie,Ee.keepAttr=!0,Ee.forceKeepAttr=void 0,Nt(F.uponSanitizeAttribute,Q,Ee),Ie=Ee.attrValue,kn&&(be==="id"||be==="name")&&_y(Ie,Zt)!==0&&(Rn(Bt,Q),Ie=Zt+Ie),Oe&&In(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Ie)){Rn(Bt,Q);continue}if(be==="attributename"&&my(Ie,"href")){Rn(Bt,Q);continue}if(Ee.forceKeepAttr)continue;if(!Ee.keepAttr){Rn(Bt,Q);continue}if(!ye&&In(/\/>/i,Ie)){Rn(Bt,Q);continue}Ne&&Cl([W,I,Y],Wt=>{Ie=qa(Ie,Wt," ")});const ft=Se(Q.nodeName);if(!Fr(ft,be,Ie)){Rn(Bt,Q);continue}if(k&&typeof x=="object"&&typeof x.getAttributeType=="function"&&!Jt)switch(x.getAttributeType(ft,be)){case"TrustedHTML":{Ie=k.createHTML(Ie);break}case"TrustedScriptURL":{Ie=k.createScriptURL(Ie);break}}if(Ie!==Me)try{Jt?Q.setAttributeNS(Jt,Bt,Ie):Q.setAttribute(Bt,Ie),Qn(Q)?nt(Q):gy(n.removed)}catch{Rn(Bt,Q)}}Nt(F.afterSanitizeAttributes,Q,null)},er=function(Q){let _e=null;const Ee=fr(Q);for(Nt(F.beforeSanitizeShadowDOM,Q,null);_e=Ee.nextNode();)Nt(F.uponSanitizeShadowNode,_e,null),Fi(_e),As(_e),_e.content instanceof f&&er(_e.content);Nt(F.afterSanitizeShadowDOM,Q,null)};return n.sanitize=function(De){let Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_e=null,Ee=null,ot=null,Qe=null;if(at=!De,at&&(De="<!-->"),typeof De!="string"&&!It(De)&&(De=iO(De),typeof De!="string"))throw Tu("dirty is not a string, aborting");if(!n.isSupported)return De;if(vt||ke(Q),n.removed=[],typeof De=="string"&&(Lt=!1),Lt){const Qt=De.nodeName;if(typeof Qt=="string"){const be=Se(Qt);if(!D[be]||se[be])throw Tu("root node is forbidden and cannot be sanitized in-place")}}else if(De instanceof c)_e=dr("<!---->"),Ee=_e.ownerDocument.importNode(De,!0),Ee.nodeType===Tl.element&&Ee.nodeName==="BODY"||Ee.nodeName==="HTML"?_e=Ee:_e.appendChild(Ee);else{if(!Rt&&!Ne&&!Ge&&De.indexOf("<")===-1)return k&&vn?k.createHTML(De):De;if(_e=dr(De),!_e)return Rt?null:vn?L:""}_e&&Le&&nt(_e.firstChild);const Bt=fr(Lt?De:_e);for(;ot=Bt.nextNode();)Fi(ot),As(ot),ot.content instanceof f&&er(ot.content);if(Lt)return De;if(Rt){if(Ne){_e.normalize();let Qt=_e.innerHTML;Cl([W,I,Y],be=>{Qt=qa(Qt,be," ")}),_e.innerHTML=Qt}if(Xt)for(Qe=A.call(_e.ownerDocument);_e.firstChild;)Qe.appendChild(_e.firstChild);else Qe=_e;return(Z.shadowroot||Z.shadowrootmode)&&(Qe=q.call(s,Qe,!0)),Qe}let Jt=Ge?_e.outerHTML:_e.innerHTML;return Ge&&D["!doctype"]&&_e.ownerDocument&&_e.ownerDocument.doctype&&_e.ownerDocument.doctype.name&&In(nC,_e.ownerDocument.doctype.name)&&(Jt="<!DOCTYPE "+_e.ownerDocument.doctype.name+`>
|
|
158
|
+
`+Jt),Ne&&Cl([W,I,Y],Qt=>{Jt=qa(Jt,Qt," ")}),k&&vn?k.createHTML(Jt):Jt},n.setConfig=function(){let De=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ke(De),vt=!0},n.clearConfig=function(){je=null,vt=!1},n.isValidAttribute=function(De,Q,_e){je||ke({});const Ee=Se(De),ot=Se(Q);return Fr(Ee,ot,_e)},n.addHook=function(De,Q){typeof Q=="function"&&El(F[De],Q)},n.removeHook=function(De,Q){if(Q!==void 0){const _e=XN(F[De],Q);return _e===-1?void 0:ZN(F[De],_e,1)[0]}return gy(F[De])},n.removeHooks=function(De){F[De]=[]},n.removeAllHooks=function(){F=Ey()},n}var Hl=iC(),gp,ky;function _O(){if(ky)return gp;ky=1;function e(te){return te instanceof Map?te.clear=te.delete=te.set=function(){throw new Error("map is read-only")}:te instanceof Set&&(te.add=te.clear=te.delete=function(){throw new Error("set is read-only")}),Object.freeze(te),Object.getOwnPropertyNames(te).forEach(pe=>{const Se=te[pe],je=typeof Se;(je==="object"||je==="function")&&!Object.isFrozen(Se)&&e(Se)}),te}class n{constructor(pe){pe.data===void 0&&(pe.data={}),this.data=pe.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function i(te){return te.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function s(te,...pe){const Se=Object.create(null);for(const je in te)Se[je]=te[je];return pe.forEach(function(je){for(const bt in je)Se[bt]=je[bt]}),Se}const o="</span>",f=te=>!!te.scope,g=(te,{prefix:pe})=>{if(te.startsWith("language:"))return te.replace("language:","language-");if(te.includes(".")){const Se=te.split(".");return[`${pe}${Se.shift()}`,...Se.map((je,bt)=>`${je}${"_".repeat(bt+1)}`)].join(" ")}return`${pe}${te}`};class c{constructor(pe,Se){this.buffer="",this.classPrefix=Se.classPrefix,pe.walk(this)}addText(pe){this.buffer+=i(pe)}openNode(pe){if(!f(pe))return;const Se=g(pe.scope,{prefix:this.classPrefix});this.span(Se)}closeNode(pe){f(pe)&&(this.buffer+=o)}value(){return this.buffer}span(pe){this.buffer+=`<span class="${pe}">`}}const h=(te={})=>{const pe={children:[]};return Object.assign(pe,te),pe};class d{constructor(){this.rootNode=h(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(pe){this.top.children.push(pe)}openNode(pe){const Se=h({scope:pe});this.add(Se),this.stack.push(Se)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(pe){return this.constructor._walk(pe,this.rootNode)}static _walk(pe,Se){return typeof Se=="string"?pe.addText(Se):Se.children&&(pe.openNode(Se),Se.children.forEach(je=>this._walk(pe,je)),pe.closeNode(Se)),pe}static _collapse(pe){typeof pe!="string"&&pe.children&&(pe.children.every(Se=>typeof Se=="string")?pe.children=[pe.children.join("")]:pe.children.forEach(Se=>{d._collapse(Se)}))}}class b extends d{constructor(pe){super(),this.options=pe}addText(pe){pe!==""&&this.add(pe)}startScope(pe){this.openNode(pe)}endScope(){this.closeNode()}__addSublanguage(pe,Se){const je=pe.root;Se&&(je.scope=`language:${Se}`),this.add(je)}toHTML(){return new c(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function m(te){return te?typeof te=="string"?te:te.source:null}function w(te){return E("(?=",te,")")}function x(te){return E("(?:",te,")*")}function T(te){return E("(?:",te,")?")}function E(...te){return te.map(Se=>m(Se)).join("")}function p(te){const pe=te[te.length-1];return typeof pe=="object"&&pe.constructor===Object?(te.splice(te.length-1,1),pe):{}}function v(...te){return"("+(p(te).capture?"":"?:")+te.map(je=>m(je)).join("|")+")"}function _(te){return new RegExp(te.toString()+"|").exec("").length-1}function S(te,pe){const Se=te&&te.exec(pe);return Se&&Se.index===0}const k=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function L(te,{joinWith:pe}){let Se=0;return te.map(je=>{Se+=1;const bt=Se;let ht=m(je),ke="";for(;ht.length>0;){const Ce=k.exec(ht);if(!Ce){ke+=ht;break}ke+=ht.substring(0,Ce.index),ht=ht.substring(Ce.index+Ce[0].length),Ce[0][0]==="\\"&&Ce[1]?ke+="\\"+String(Number(Ce[1])+bt):(ke+=Ce[0],Ce[0]==="("&&Se++)}return ke}).map(je=>`(${je})`).join(pe)}const R=/\b\B/,N="[a-zA-Z]\\w*",A="[a-zA-Z_]\\w*",B="\\b\\d+(\\.\\d+)?",q="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",F="\\b(0b[01]+)",W="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",I=(te={})=>{const pe=/^#![ ]*\//;return te.binary&&(te.begin=E(pe,/.*\b/,te.binary,/\b.*/)),s({scope:"meta",begin:pe,end:/$/,relevance:0,"on:begin":(Se,je)=>{Se.index!==0&&je.ignoreMatch()}},te)},Y={begin:"\\\\[\\s\\S]",relevance:0},V={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Y]},z={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Y]},G={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/},K=function(te,pe,Se={}){const je=s({scope:"comment",begin:te,end:pe,contains:[]},Se);je.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 bt=v("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return je.contains.push({begin:E(/[ ]+/,"(",bt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),je},j=K("//","$"),H=K("/\\*","\\*/"),D=K("#","$"),P={scope:"number",begin:B,relevance:0},Z={scope:"number",begin:q,relevance:0},ee={scope:"number",begin:F,relevance:0},J={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Y,{begin:/\[/,end:/\]/,relevance:0,contains:[Y]}]},se={scope:"title",begin:N,relevance:0},X={scope:"title",begin:A,relevance:0},$={begin:"\\.\\s*"+A,relevance:0};var de=Object.freeze({__proto__:null,APOS_STRING_MODE:V,BACKSLASH_ESCAPE:Y,BINARY_NUMBER_MODE:ee,BINARY_NUMBER_RE:F,COMMENT:K,C_BLOCK_COMMENT_MODE:H,C_LINE_COMMENT_MODE:j,C_NUMBER_MODE:Z,C_NUMBER_RE:q,END_SAME_AS_BEGIN:function(te){return Object.assign(te,{"on:begin":(pe,Se)=>{Se.data._beginMatch=pe[1]},"on:end":(pe,Se)=>{Se.data._beginMatch!==pe[1]&&Se.ignoreMatch()}})},HASH_COMMENT_MODE:D,IDENT_RE:N,MATCH_NOTHING_RE:R,METHOD_GUARD:$,NUMBER_MODE:P,NUMBER_RE:B,PHRASAL_WORDS_MODE:G,QUOTE_STRING_MODE:z,REGEXP_MODE:J,RE_STARTERS_RE:W,SHEBANG:I,TITLE_MODE:se,UNDERSCORE_IDENT_RE:A,UNDERSCORE_TITLE_MODE:X});function we(te,pe){te.input[te.index-1]==="."&&pe.ignoreMatch()}function ye(te,pe){te.className!==void 0&&(te.scope=te.className,delete te.className)}function Ne(te,pe){pe&&te.beginKeywords&&(te.begin="\\b("+te.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",te.__beforeBegin=we,te.keywords=te.keywords||te.beginKeywords,delete te.beginKeywords,te.relevance===void 0&&(te.relevance=0))}function Oe(te,pe){Array.isArray(te.illegal)&&(te.illegal=v(...te.illegal))}function Ge(te,pe){if(te.match){if(te.begin||te.end)throw new Error("begin & end are not supported with match");te.begin=te.match,delete te.match}}function vt(te,pe){te.relevance===void 0&&(te.relevance=1)}const Le=(te,pe)=>{if(!te.beforeMatch)return;if(te.starts)throw new Error("beforeMatch cannot be used with starts");const Se=Object.assign({},te);Object.keys(te).forEach(je=>{delete te[je]}),te.keywords=Se.keywords,te.begin=E(Se.beforeMatch,w(Se.begin)),te.starts={relevance:0,contains:[Object.assign(Se,{endsParent:!0})]},te.relevance=0,delete Se.beforeMatch},Rt=["of","and","for","in","not","or","if","then","parent","list","value"],Xt="keyword";function vn(te,pe,Se=Xt){const je=Object.create(null);return typeof te=="string"?bt(Se,te.split(" ")):Array.isArray(te)?bt(Se,te):Object.keys(te).forEach(function(ht){Object.assign(je,vn(te[ht],pe,ht))}),je;function bt(ht,ke){pe&&(ke=ke.map(Ce=>Ce.toLowerCase())),ke.forEach(function(Ce){const Pe=Ce.split("|");je[Pe[0]]=[ht,on(Pe[0],Pe[1])]})}}function on(te,pe){return pe?Number(pe):kn(te)?0:1}function kn(te){return Rt.includes(te.toLowerCase())}const Zt={},ut=te=>{console.error(te)},Lt=(te,...pe)=>{console.log(`WARN: ${te}`,...pe)},Ct=(te,pe)=>{Zt[`${te}/${pe}`]||(console.log(`Deprecated as of ${te}. ${pe}`),Zt[`${te}/${pe}`]=!0)},Ft=new Error;function Kt(te,pe,{key:Se}){let je=0;const bt=te[Se],ht={},ke={};for(let Ce=1;Ce<=pe.length;Ce++)ke[Ce+je]=bt[Ce],ht[Ce+je]=!0,je+=_(pe[Ce-1]);te[Se]=ke,te[Se]._emit=ht,te[Se]._multi=!0}function Jn(te){if(Array.isArray(te.begin)){if(te.skip||te.excludeBegin||te.returnBegin)throw ut("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Ft;if(typeof te.beginScope!="object"||te.beginScope===null)throw ut("beginScope must be object"),Ft;Kt(te,te.begin,{key:"beginScope"}),te.begin=L(te.begin,{joinWith:""})}}function bn(te){if(Array.isArray(te.end)){if(te.skip||te.excludeEnd||te.returnEnd)throw ut("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Ft;if(typeof te.endScope!="object"||te.endScope===null)throw ut("endScope must be object"),Ft;Kt(te,te.end,{key:"endScope"}),te.end=L(te.end,{joinWith:""})}}function Pn(te){te.scope&&typeof te.scope=="object"&&te.scope!==null&&(te.beginScope=te.scope,delete te.scope)}function dt(te){Pn(te),typeof te.beginScope=="string"&&(te.beginScope={_wrap:te.beginScope}),typeof te.endScope=="string"&&(te.endScope={_wrap:te.endScope}),Jn(te),bn(te)}function Tn(te){function pe(ke,Ce){return new RegExp(m(ke),"m"+(te.case_insensitive?"i":"")+(te.unicodeRegex?"u":"")+(Ce?"g":""))}class Se{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Ce,Pe){Pe.position=this.position++,this.matchIndexes[this.matchAt]=Pe,this.regexes.push([Pe,Ce]),this.matchAt+=_(Ce)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Ce=this.regexes.map(Pe=>Pe[1]);this.matcherRe=pe(L(Ce,{joinWith:"|"}),!0),this.lastIndex=0}exec(Ce){this.matcherRe.lastIndex=this.lastIndex;const Pe=this.matcherRe.exec(Ce);if(!Pe)return null;const Vt=Pe.findIndex((Rn,dr)=>dr>0&&Rn!==void 0),nt=this.matchIndexes[Vt];return Pe.splice(0,Vt),Object.assign(Pe,nt)}}class je{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 Pe=new Se;return this.rules.slice(Ce).forEach(([Vt,nt])=>Pe.addRule(Vt,nt)),Pe.compile(),this.multiRegexes[Ce]=Pe,Pe}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Ce,Pe){this.rules.push([Ce,Pe]),Pe.type==="begin"&&this.count++}exec(Ce){const Pe=this.getMatcher(this.regexIndex);Pe.lastIndex=this.lastIndex;let Vt=Pe.exec(Ce);if(this.resumingScanAtSamePosition()&&!(Vt&&Vt.index===this.lastIndex)){const nt=this.getMatcher(0);nt.lastIndex=this.lastIndex+1,Vt=nt.exec(Ce)}return Vt&&(this.regexIndex+=Vt.position+1,this.regexIndex===this.count&&this.considerAll()),Vt}}function bt(ke){const Ce=new je;return ke.contains.forEach(Pe=>Ce.addRule(Pe.begin,{rule:Pe,type:"begin"})),ke.terminatorEnd&&Ce.addRule(ke.terminatorEnd,{type:"end"}),ke.illegal&&Ce.addRule(ke.illegal,{type:"illegal"}),Ce}function ht(ke,Ce){const Pe=ke;if(ke.isCompiled)return Pe;[ye,Ge,dt,Le].forEach(nt=>nt(ke,Ce)),te.compilerExtensions.forEach(nt=>nt(ke,Ce)),ke.__beforeBegin=null,[Ne,Oe,vt].forEach(nt=>nt(ke,Ce)),ke.isCompiled=!0;let Vt=null;return typeof ke.keywords=="object"&&ke.keywords.$pattern&&(ke.keywords=Object.assign({},ke.keywords),Vt=ke.keywords.$pattern,delete ke.keywords.$pattern),Vt=Vt||/\w+/,ke.keywords&&(ke.keywords=vn(ke.keywords,te.case_insensitive)),Pe.keywordPatternRe=pe(Vt,!0),Ce&&(ke.begin||(ke.begin=/\B|\b/),Pe.beginRe=pe(Pe.begin),!ke.end&&!ke.endsWithParent&&(ke.end=/\B|\b/),ke.end&&(Pe.endRe=pe(Pe.end)),Pe.terminatorEnd=m(Pe.end)||"",ke.endsWithParent&&Ce.terminatorEnd&&(Pe.terminatorEnd+=(ke.end?"|":"")+Ce.terminatorEnd)),ke.illegal&&(Pe.illegalRe=pe(ke.illegal)),ke.contains||(ke.contains=[]),ke.contains=[].concat(...ke.contains.map(function(nt){return $e(nt==="self"?ke:nt)})),ke.contains.forEach(function(nt){ht(nt,Pe)}),ke.starts&&ht(ke.starts,Ce),Pe.matcher=bt(Pe),Pe}if(te.compilerExtensions||(te.compilerExtensions=[]),te.contains&&te.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return te.classNameAliases=s(te.classNameAliases||{}),ht(te)}function ve(te){return te?te.endsWithParent||ve(te.starts):!1}function $e(te){return te.variants&&!te.cachedVariants&&(te.cachedVariants=te.variants.map(function(pe){return s(te,{variants:null},pe)})),te.cachedVariants?te.cachedVariants:ve(te)?s(te,{starts:te.starts?s(te.starts):null}):Object.isFrozen(te)?s(te):te}var Je="11.11.1";class at extends Error{constructor(pe,Se){super(pe),this.name="HTMLInjectionError",this.html=Se}}const Ve=i,ln=s,Dt=Symbol("nomatch"),An=7,Un=function(te){const pe=Object.create(null),Se=Object.create(null),je=[];let bt=!0;const ht="Could not find the language '{}', did you forget to load/include a language module?",ke={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 Pe(be){return Ce.noHighlightRe.test(be)}function Vt(be){let Me=be.className+" ";Me+=be.parentNode?be.parentNode.className:"";const Ie=Ce.languageDetectRe.exec(Me);if(Ie){const ft=Q(Ie[1]);return ft||(Lt(ht.replace("{}",Ie[1])),Lt("Falling back to no-highlight mode for this block.",be)),ft?Ie[1]:"no-highlight"}return Me.split(/\s+/).find(ft=>Pe(ft)||Q(ft))}function nt(be,Me,Ie){let ft="",Wt="";typeof Me=="object"?(ft=be,Ie=Me.ignoreIllegals,Wt=Me.language):(Ct("10.7.0","highlight(lang, code, ...args) has been deprecated."),Ct("10.7.0",`Please use highlight(code, options) instead.
|
|
159
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),Wt=be,ft=Me),Ie===void 0&&(Ie=!0);const zn={code:ft,language:Wt};Jt("before:highlight",zn);const hi=zn.result?zn.result:Rn(zn.language,zn.code,Ie);return hi.code=zn.code,Jt("after:highlight",hi),hi}function Rn(be,Me,Ie,ft){const Wt=Object.create(null);function zn(xe,Ae){return xe.keywords[Ae]}function hi(){if(!Ue.keywords){hn.addText(yt);return}let xe=0;Ue.keywordPatternRe.lastIndex=0;let Ae=Ue.keywordPatternRe.exec(yt),We="";for(;Ae;){We+=yt.substring(xe,Ae.index);const it=Ln.case_insensitive?Ae[0].toLowerCase():Ae[0],Yt=zn(Ue,it);if(Yt){const[Ti,Eo]=Yt;if(hn.addText(We),We="",Wt[it]=(Wt[it]||0)+1,Wt[it]<=An&&(Wr+=Eo),Ti.startsWith("_"))We+=Ae[0];else{const oc=Ln.classNameAliases[Ti]||Ti;di(Ae[0],oc)}}else We+=Ae[0];xe=Ue.keywordPatternRe.lastIndex,Ae=Ue.keywordPatternRe.exec(yt)}We+=yt.substring(xe),hn.addText(We)}function ei(){if(yt==="")return;let xe=null;if(typeof Ue.subLanguage=="string"){if(!pe[Ue.subLanguage]){hn.addText(yt);return}xe=Rn(Ue.subLanguage,yt,!0,ac[Ue.subLanguage]),ac[Ue.subLanguage]=xe._top}else xe=fr(yt,Ue.subLanguage.length?Ue.subLanguage:null);Ue.relevance>0&&(Wr+=xe.relevance),hn.__addSublanguage(xe._emitter,xe.language)}function Ot(){Ue.subLanguage!=null?ei():hi(),yt=""}function di(xe,Ae){xe!==""&&(hn.startScope(Ae),hn.addText(xe),hn.endScope())}function rc(xe,Ae){let We=1;const it=Ae.length-1;for(;We<=it;){if(!xe._emit[We]){We++;continue}const Yt=Ln.classNameAliases[xe[We]]||xe[We],Ti=Ae[We];Yt?di(Ti,Yt):(yt=Ti,hi(),yt=""),We++}}function ca(xe,Ae){return xe.scope&&typeof xe.scope=="string"&&hn.openNode(Ln.classNameAliases[xe.scope]||xe.scope),xe.beginScope&&(xe.beginScope._wrap?(di(yt,Ln.classNameAliases[xe.beginScope._wrap]||xe.beginScope._wrap),yt=""):xe.beginScope._multi&&(rc(xe.beginScope,Ae),yt="")),Ue=Object.create(xe,{parent:{value:Ue}}),Ue}function wo(xe,Ae,We){let it=S(xe.endRe,We);if(it){if(xe["on:end"]){const Yt=new n(xe);xe["on:end"](Ae,Yt),Yt.isMatchIgnored&&(it=!1)}if(it){for(;xe.endsParent&&xe.parent;)xe=xe.parent;return xe}}if(xe.endsWithParent)return wo(xe.parent,Ae,We)}function ua(xe){return Ue.matcher.regexIndex===0?(yt+=xe[0],1):(Gr=!0,0)}function Nh(xe){const Ae=xe[0],We=xe.rule,it=new n(We),Yt=[We.__beforeBegin,We["on:begin"]];for(const Ti of Yt)if(Ti&&(Ti(xe,it),it.isMatchIgnored))return ua(Ae);return We.skip?yt+=Ae:(We.excludeBegin&&(yt+=Ae),Ot(),!We.returnBegin&&!We.excludeBegin&&(yt=Ae)),ca(We,xe),We.returnBegin?0:Ae.length}function ti(xe){const Ae=xe[0],We=Me.substring(xe.index),it=wo(Ue,xe,We);if(!it)return Dt;const Yt=Ue;Ue.endScope&&Ue.endScope._wrap?(Ot(),di(Ae,Ue.endScope._wrap)):Ue.endScope&&Ue.endScope._multi?(Ot(),rc(Ue.endScope,xe)):Yt.skip?yt+=Ae:(Yt.returnEnd||Yt.excludeEnd||(yt+=Ae),Ot(),Yt.excludeEnd&&(yt=Ae));do Ue.scope&&hn.closeNode(),!Ue.skip&&!Ue.subLanguage&&(Wr+=Ue.relevance),Ue=Ue.parent;while(Ue!==it.parent);return it.starts&&ca(it.starts,xe),Yt.returnEnd?0:Ae.length}function xo(){const xe=[];for(let Ae=Ue;Ae!==Ln;Ae=Ae.parent)Ae.scope&&xe.unshift(Ae.scope);xe.forEach(Ae=>hn.openNode(Ae))}let Rs={};function ha(xe,Ae){const We=Ae&&Ae[0];if(yt+=xe,We==null)return Ot(),0;if(Rs.type==="begin"&&Ae.type==="end"&&Rs.index===Ae.index&&We===""){if(yt+=Me.slice(Ae.index,Ae.index+1),!bt){const it=new Error(`0 width match regex (${be})`);throw it.languageName=be,it.badRule=Rs.rule,it}return 1}if(Rs=Ae,Ae.type==="begin")return Nh(Ae);if(Ae.type==="illegal"&&!Ie){const it=new Error('Illegal lexeme "'+We+'" for mode "'+(Ue.scope||"<unnamed>")+'"');throw it.mode=Ue,it}else if(Ae.type==="end"){const it=ti(Ae);if(it!==Dt)return it}if(Ae.type==="illegal"&&We==="")return yt+=`
|
|
160
|
+
`,1;if(Co>1e5&&Co>Ae.index*3)throw new Error("potential infinite loop, way more iterations than matches");return yt+=We,We.length}const Ln=Q(be);if(!Ln)throw ut(ht.replace("{}",be)),new Error('Unknown language: "'+be+'"');const sc=Tn(Ln);let da="",Ue=ft||sc;const ac={},hn=new Ce.__emitter(Ce);xo();let yt="",Wr=0,gr=0,Co=0,Gr=!1;try{if(Ln.__emitTokens)Ln.__emitTokens(Me,hn);else{for(Ue.matcher.considerAll();;){Co++,Gr?Gr=!1:Ue.matcher.considerAll(),Ue.matcher.lastIndex=gr;const xe=Ue.matcher.exec(Me);if(!xe)break;const Ae=Me.substring(gr,xe.index),We=ha(Ae,xe);gr=xe.index+We}ha(Me.substring(gr))}return hn.finalize(),da=hn.toHTML(),{language:be,value:da,relevance:Wr,illegal:!1,_emitter:hn,_top:Ue}}catch(xe){if(xe.message&&xe.message.includes("Illegal"))return{language:be,value:Ve(Me),illegal:!0,relevance:0,_illegalBy:{message:xe.message,index:gr,context:Me.slice(gr-100,gr+100),mode:xe.mode,resultSoFar:da},_emitter:hn};if(bt)return{language:be,value:Ve(Me),illegal:!1,relevance:0,errorRaised:xe,_emitter:hn,_top:Ue};throw xe}}function dr(be){const Me={value:Ve(be),illegal:!1,relevance:0,_top:ke,_emitter:new Ce.__emitter(Ce)};return Me._emitter.addText(be),Me}function fr(be,Me){Me=Me||Ce.languages||Object.keys(pe);const Ie=dr(be),ft=Me.filter(Q).filter(Ee).map(Ot=>Rn(Ot,be,!1));ft.unshift(Ie);const Wt=ft.sort((Ot,di)=>{if(Ot.relevance!==di.relevance)return di.relevance-Ot.relevance;if(Ot.language&&di.language){if(Q(Ot.language).supersetOf===di.language)return 1;if(Q(di.language).supersetOf===Ot.language)return-1}return 0}),[zn,hi]=Wt,ei=zn;return ei.secondBest=hi,ei}function Qn(be,Me,Ie){const ft=Me&&Se[Me]||Ie;be.classList.add("hljs"),be.classList.add(`language-${ft}`)}function It(be){let Me=null;const Ie=Vt(be);if(Pe(Ie))return;if(Jt("before:highlightElement",{el:be,language:Ie}),be.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",be);return}if(be.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(be)),Ce.throwUnescapedHTML))throw new at("One of your code blocks includes unescaped HTML.",be.innerHTML);Me=be;const ft=Me.textContent,Wt=Ie?nt(ft,{language:Ie,ignoreIllegals:!0}):fr(ft);be.innerHTML=Wt.value,be.dataset.highlighted="yes",Qn(be,Ie,Wt.language),be.result={language:Wt.language,re:Wt.relevance,relevance:Wt.relevance},Wt.secondBest&&(be.secondBest={language:Wt.secondBest.language,relevance:Wt.secondBest.relevance}),Jt("after:highlightElement",{el:be,result:Wt,text:ft})}function Nt(be){Ce=ln(Ce,be)}const Fi=()=>{pr(),Ct("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Fr(){pr(),Ct("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let la=!1;function pr(){function be(){pr()}if(document.readyState==="loading"){la||window.addEventListener("DOMContentLoaded",be,!1),la=!0;return}document.querySelectorAll(Ce.cssSelector).forEach(It)}function As(be,Me){let Ie=null;try{Ie=Me(te)}catch(ft){if(ut("Language definition for '{}' could not be registered.".replace("{}",be)),bt)ut(ft);else throw ft;Ie=ke}Ie.name||(Ie.name=be),pe[be]=Ie,Ie.rawDefinition=Me.bind(null,te),Ie.aliases&&_e(Ie.aliases,{languageName:be})}function er(be){delete pe[be];for(const Me of Object.keys(Se))Se[Me]===be&&delete Se[Me]}function De(){return Object.keys(pe)}function Q(be){return be=(be||"").toLowerCase(),pe[be]||pe[Se[be]]}function _e(be,{languageName:Me}){typeof be=="string"&&(be=[be]),be.forEach(Ie=>{Se[Ie.toLowerCase()]=Me})}function Ee(be){const Me=Q(be);return Me&&!Me.disableAutodetect}function ot(be){be["before:highlightBlock"]&&!be["before:highlightElement"]&&(be["before:highlightElement"]=Me=>{be["before:highlightBlock"](Object.assign({block:Me.el},Me))}),be["after:highlightBlock"]&&!be["after:highlightElement"]&&(be["after:highlightElement"]=Me=>{be["after:highlightBlock"](Object.assign({block:Me.el},Me))})}function Qe(be){ot(be),je.push(be)}function Bt(be){const Me=je.indexOf(be);Me!==-1&&je.splice(Me,1)}function Jt(be,Me){const Ie=be;je.forEach(function(ft){ft[Ie]&&ft[Ie](Me)})}function Qt(be){return Ct("10.7.0","highlightBlock will be removed entirely in v12.0"),Ct("10.7.0","Please use highlightElement now."),It(be)}Object.assign(te,{highlight:nt,highlightAuto:fr,highlightAll:pr,highlightElement:It,highlightBlock:Qt,configure:Nt,initHighlighting:Fi,initHighlightingOnLoad:Fr,registerLanguage:As,unregisterLanguage:er,listLanguages:De,getLanguage:Q,registerAliases:_e,autoDetection:Ee,inherit:ln,addPlugin:Qe,removePlugin:Bt}),te.debugMode=function(){bt=!1},te.safeMode=function(){bt=!0},te.versionString=Je,te.regex={concat:E,lookahead:w,either:v,optional:T,anyNumberOfTimes:x};for(const be in de)typeof de[be]=="object"&&e(de[be]);return Object.assign(te,de),te},jt=Un({});return jt.newInstance=()=>Un({}),gp=jt,jt.HighlightJS=jt,jt.default=jt,gp}var vO=_O();const Ii=Vg(vO);function Ty(e){const n=e.regex,i={},s={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[i]}]};Object.assign(i,{className:"variable",variants:[{begin:n.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},s]});const o={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},f=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),g={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,i,o]};o.contains.push(c);const h={match:/\\"/},d={className:"string",begin:/'/,end:/'/},b={match:/\\'/},m={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,i]},w=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],x=e.SHEBANG({binary:`(${w.join("|")})`,relevance:10}),T={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},E=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],p=["true","false"],v={match:/(\/[a-z._-]+)+/},_=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],S=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],k=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],L=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:E,literal:p,built_in:[..._,...S,"set","shopt",...k,...L]},contains:[x,e.SHEBANG(),T,m,f,g,v,c,h,d,b,i]}}const Ay="[A-Za-z$_][0-9A-Za-z$_]*",bO=["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"],yO=["true","false","null","undefined","NaN","Infinity"],rC=["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"],sC=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],aC=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],SO=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],wO=[].concat(aC,rC,sC);function Ry(e){const n=e.regex,i=(K,{after:j})=>{const H="</"+K[0].slice(1);return K.input.indexOf(H,j)!==-1},s=Ay,o={begin:"<>",end:"</>"},f=/<[A-Za-z0-9\\._:-]+\s*\/>/,g={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(K,j)=>{const H=K[0].length+K.index,D=K.input[H];if(D==="<"||D===","){j.ignoreMatch();return}D===">"&&(i(K,{after:H})||j.ignoreMatch());let P;const Z=K.input.substring(H);if(P=Z.match(/^\s*=/)){j.ignoreMatch();return}if((P=Z.match(/^\s+extends\s+/))&&P.index===0){j.ignoreMatch();return}}},c={$pattern:Ay,keyword:bO,literal:yO,built_in:wO,"variable.language":SO},h="[0-9](_?[0-9])*",d=`\\.(${h})`,b="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",m={className:"number",variants:[{begin:`(\\b(${b})((${d})|\\.)?|(${d}))[eE][+-]?(${h})\\b`},{begin:`\\b(${b})\\b((${d})\\b|\\.)?|(${d})\\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},w={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},x={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,w],subLanguage:"xml"}},T={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,w],subLanguage:"css"}},E={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,w],subLanguage:"graphql"}},p={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,w]},_={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:s+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},S=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,x,T,E,p,{match:/\$\d+/},m];w.contains=S.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(S)});const k=[].concat(_,w.contains),L=k.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(k)}]),R={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:L},N={variants:[{match:[/class/,/\s+/,s,/\s+/,/extends/,/\s+/,n.concat(s,"(",n.concat(/\./,s),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,s],scope:{1:"keyword",3:"title.class"}}]},A={relevance:0,match:n.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...rC,...sC]}},B={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},q={variants:[{match:[/function/,/\s+/,s,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[R],illegal:/%/},F={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function W(K){return n.concat("(?!",K.join("|"),")")}const I={match:n.concat(/\b/,W([...aC,"super","import"].map(K=>`${K}\\s*\\(`)),s,n.lookahead(/\s*\(/)),className:"title.function",relevance:0},Y={begin:n.concat(/\./,n.lookahead(n.concat(s,/(?![0-9A-Za-z$_(])/))),end:s,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},V={match:[/get|set/,/\s+/,s,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},R]},z="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",G={match:[/const|var|let/,/\s+/,s,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(z)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[R]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:L,CLASS_REFERENCE:A},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),B,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,x,T,E,p,_,{match:/\$\d+/},m,A,{scope:"attr",match:s+n.lookahead(":"),relevance:0},G,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[_,e.REGEXP_MODE,{className:"function",begin:z,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:L}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:f},{begin:g.begin,"on:begin":g.isTrulyOpeningTag,end:g.end}],subLanguage:"xml",contains:[{begin:g.begin,end:g.end,skip:!0,contains:["self"]}]}]},q,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[R,e.inherit(e.TITLE_MODE,{begin:s,className:"title.function"})]},{match:/\.\.\./,relevance:0},Y,{match:"\\$"+s,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[R]},I,F,N,V,{match:/\$[(.]/}]}}function xO(e){const n={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},i={match:/[{}[\],:]/,className:"punctuation",relevance:0},s=["true","false","null"],o={scope:"literal",beginKeywords:s.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:s},contains:[n,i,e.QUOTE_STRING_MODE,o,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function Ly(e){const n=e.regex,i={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},s={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}]},f={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},g={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+.-]*/,h={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:n.concat(/\[.+?\]\(/,c,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},d={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}]},m=e.inherit(d,{contains:[]}),w=e.inherit(b,{contains:[]});d.contains.push(w),b.contains.push(m);let x=[i,h];return[d,b,m,w].forEach(v=>{v.contains=v.contains.concat(x)}),x=x.concat(d,b),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:x},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:x}]}]},i,f,d,b,{className:"quote",begin:"^>\\s+",contains:x,end:"$"},o,s,h,g,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function My(e){const n=e.regex,i=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),s=["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:s,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"]},h={className:"meta",begin:/^(>>>|\.\.\.) /},d={className:"subst",begin:/\{/,end:/\}/,keywords:c,illegal:/#/},b={begin:/\{\{/,relevance:0},m={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,h],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,h],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,h,b,d]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,h,b,d]},{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,d]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,b,d]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},w="[0-9](_?[0-9])*",x=`(\\b(${w}))?\\.(${w})|\\b(${w})\\.`,T=`\\b|${s.join("|")}`,E={className:"number",relevance:0,variants:[{begin:`(\\b(${w})|(${x}))[eE][+-]?(${w})[jJ]?(?=${T})`},{begin:`(${x})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${T})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${T})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${T})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${T})`},{begin:`\\b(${w})[jJ](?=${T})`}]},p={className:"comment",begin:n.lookahead(/# type:/),end:/$/,keywords:c,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},v={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:["self",h,E,m,e.HASH_COMMENT_MODE]}]};return d.contains=[m,E,h],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:c,illegal:/(<\/|\?)|=>/,contains:[h,E,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},m,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,i],scope:{1:"keyword",3:"title.function"},contains:[v]},{variants:[{match:[/\bclass/,/\s+/,i,/\s*/,/\(\s*/,i,/\s*\)/]},{match:[/\bclass/,/\s+/,i]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[E,v,m]}]}}const dh="[A-Za-z$_][0-9A-Za-z$_]*",oC=["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"],lC=["true","false","null","undefined","NaN","Infinity"],cC=["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"],uC=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],hC=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],dC=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],fC=[].concat(hC,cC,uC);function CO(e){const n=e.regex,i=(K,{after:j})=>{const H="</"+K[0].slice(1);return K.input.indexOf(H,j)!==-1},s=dh,o={begin:"<>",end:"</>"},f=/<[A-Za-z0-9\\._:-]+\s*\/>/,g={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(K,j)=>{const H=K[0].length+K.index,D=K.input[H];if(D==="<"||D===","){j.ignoreMatch();return}D===">"&&(i(K,{after:H})||j.ignoreMatch());let P;const Z=K.input.substring(H);if(P=Z.match(/^\s*=/)){j.ignoreMatch();return}if((P=Z.match(/^\s+extends\s+/))&&P.index===0){j.ignoreMatch();return}}},c={$pattern:dh,keyword:oC,literal:lC,built_in:fC,"variable.language":dC},h="[0-9](_?[0-9])*",d=`\\.(${h})`,b="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",m={className:"number",variants:[{begin:`(\\b(${b})((${d})|\\.)?|(${d}))[eE][+-]?(${h})\\b`},{begin:`\\b(${b})\\b((${d})\\b|\\.)?|(${d})\\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},w={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},x={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,w],subLanguage:"xml"}},T={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,w],subLanguage:"css"}},E={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,w],subLanguage:"graphql"}},p={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,w]},_={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:s+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},S=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,x,T,E,p,{match:/\$\d+/},m];w.contains=S.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(S)});const k=[].concat(_,w.contains),L=k.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(k)}]),R={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:L},N={variants:[{match:[/class/,/\s+/,s,/\s+/,/extends/,/\s+/,n.concat(s,"(",n.concat(/\./,s),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,s],scope:{1:"keyword",3:"title.class"}}]},A={relevance:0,match:n.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...cC,...uC]}},B={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},q={variants:[{match:[/function/,/\s+/,s,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[R],illegal:/%/},F={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function W(K){return n.concat("(?!",K.join("|"),")")}const I={match:n.concat(/\b/,W([...hC,"super","import"].map(K=>`${K}\\s*\\(`)),s,n.lookahead(/\s*\(/)),className:"title.function",relevance:0},Y={begin:n.concat(/\./,n.lookahead(n.concat(s,/(?![0-9A-Za-z$_(])/))),end:s,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},V={match:[/get|set/,/\s+/,s,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},R]},z="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",G={match:[/const|var|let/,/\s+/,s,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(z)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[R]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:L,CLASS_REFERENCE:A},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),B,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,x,T,E,p,_,{match:/\$\d+/},m,A,{scope:"attr",match:s+n.lookahead(":"),relevance:0},G,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[_,e.REGEXP_MODE,{className:"function",begin:z,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:L}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:f},{begin:g.begin,"on:begin":g.isTrulyOpeningTag,end:g.end}],subLanguage:"xml",contains:[{begin:g.begin,end:g.end,skip:!0,contains:["self"]}]}]},q,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[R,e.inherit(e.TITLE_MODE,{begin:s,className:"title.function"})]},{match:/\.\.\./,relevance:0},Y,{match:"\\$"+s,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[R]},I,F,N,V,{match:/\$[(.]/}]}}function Ny(e){const n=e.regex,i=CO(e),s=dh,o=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],f={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},g={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:o},contains:[i.exports.CLASS_REFERENCE]},c={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},h=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],d={$pattern:dh,keyword:oC.concat(h),literal:lC,built_in:fC.concat(o),"variable.language":dC},b={className:"meta",begin:"@"+s},m=(E,p,v)=>{const _=E.contains.findIndex(S=>S.label===p);if(_===-1)throw new Error("can not find mode to replace");E.contains.splice(_,1,v)};Object.assign(i.keywords,d),i.exports.PARAMS_CONTAINS.push(b);const w=i.contains.find(E=>E.scope==="attr"),x=Object.assign({},w,{match:n.concat(s,n.lookahead(/\s*\?:/))});i.exports.PARAMS_CONTAINS.push([i.exports.CLASS_REFERENCE,w,x]),i.contains=i.contains.concat([b,f,g,x]),m(i,"shebang",e.SHEBANG()),m(i,"use_strict",c);const T=i.contains.find(E=>E.label==="func.def");return T.relevance=0,Object.assign(i,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),i}const EO=/\[\[wiki:([^\]]+)\]\]/g,kO=/^\uFEFF?---[ \t]*\r?\n([\s\S]*?)\r?\n---[ \t]*(?:\r?\n|$)/,TO=/^(\S[^:]*?):[ \t]*(.*)$/,AO=new Qx({gfm:!0,breaks:!1}),Oy={ALLOWED_URI_REGEXP:/^(?:(?:https?|mailto):|[#/]|\.{0,2}\/|[^:]+$)/i,ADD_ATTR:["target","rel","data-entry-id"]},mp=UO();function fh(e,n={}){const{entries:i,content:s}=MO(e),o=DO(s,n.resolveWikiLink),f=AO.parse(o,{async:!1}),g=OO(i),c=Hl.sanitize(g+f,Oy),h=new DOMParser().parseFromString(c,"text/html");return IO(h,n.omitDuplicateTitle),jO(h),BO(h),zO(h),{html:Hl.sanitize(h.body.innerHTML,Oy),toc:HO(h)}}function RO(e){const n=new TextEncoder().encode(e);let i="";for(const s of n)i+=String.fromCharCode(s);return btoa(i)}function LO(e){const n=atob(e),i=new Uint8Array(n.length);for(let s=0;s<n.length;s++)i[s]=n.charCodeAt(s);return new TextDecoder().decode(i)}function MO(e){const n=kO.exec(e);return n?{entries:NO(n[1]??""),content:e.slice(n[0].length)}:{entries:[],content:e}}function NO(e){const n=[];for(const i of e.split(/\r?\n/)){const s=i.replace(/\s+$/,"");if(s.trim()==="")continue;const o=TO.exec(s);if(o){const[,c="",h=""]=o;n.push({key:c.trim(),value:h.trim()});continue}const f=n[n.length-1];if(!f)continue;const g=s.trim();f.value=f.value?`${f.value} ${g}`:g}return n}function OO(e){return e.length===0?"":`<dl class="frontmatter">${e.map(i=>`<dt>${$l(i.key)}</dt><dd>${$l(i.value)}</dd>`).join("")}</dl>`}function DO(e,n){return e.replace(EO,(i,s)=>{const o=s.trim();if(!o)return"";if(!n)return $l(`[[wiki:${o}]]`);const f=n(o);if(f===null)return $l(`[[wiki:${o}]]`);const g=$l(o),c=encodeURIComponent(o);return`<a href="${f}" data-entry-id="${c}">${g}</a>`})}function jO(e){const n=new Map;for(const i of e.querySelectorAll("h2, h3")){const s=i.textContent?.trim()??"",o=GO(s||"section"),f=n.get(o)??0;n.set(o,f+1),i.id=f===0?o:`${o}-${f+1}`}}function IO(e,n){if(!n)return;const i=e.body.querySelector("h1, h2, h3, h4, h5, h6");!i||i.tagName.toLowerCase()!=="h1"||Dy(i.textContent??"")===Dy(n)&&i.remove()}function BO(e){for(const n of e.querySelectorAll("pre > code")){const i=FO(n.className),s=n.textContent??"",o=n.parentElement;if(!o)continue;if(i==="mermaid"){const g=e.createElement("div");g.className="diagram-block",g.setAttribute("data-mermaid-source",RO(s)),g.setAttribute("data-diagram-state","pending"),o.replaceWith(g);continue}const f=$O(s,i);n.innerHTML=f,n.classList.add("hljs"),o.classList.add("code-block"),o.dataset.code=s,o.insertBefore(PO(e,i||"text"),o.firstChild)}}function PO(e,n){const i=e.createElement("div");i.className="code-block-toolbar";const s=e.createElement("span");s.className="code-block-dots",s.setAttribute("aria-hidden","true");for(let g=0;g<3;g++)s.append(e.createElement("span"));const o=e.createElement("span");o.className="code-block-language",o.textContent=n;const f=e.createElement("button");return f.className="copy-code",f.type="button",f.dataset.action="copy-code",f.setAttribute("aria-label",`Copy ${n} code`),f.textContent="Copy",i.append(s,o,f),i}function zO(e){for(const n of e.querySelectorAll("a")){const i=n.getAttribute("href")??"";WO(i)&&(n.setAttribute("target","_blank"),n.setAttribute("rel","noopener noreferrer"))}}function HO(e){return[...e.querySelectorAll("h2, h3")].map(n=>({id:n.id,text:n.textContent?.trim()??n.id,level:n.tagName.toLowerCase()==="h2"?2:3}))}function $O(e,n){return n&&mp.getLanguage(n)?mp.highlight(e,{language:n}).value:mp.highlightAuto(e).value}function UO(){return Ii.registerLanguage("bash",Ty),Ii.registerLanguage("sh",Ty),Ii.registerLanguage("javascript",Ry),Ii.registerLanguage("js",Ry),Ii.registerLanguage("json",xO),Ii.registerLanguage("markdown",Ly),Ii.registerLanguage("md",Ly),Ii.registerLanguage("python",My),Ii.registerLanguage("py",My),Ii.registerLanguage("typescript",Ny),Ii.registerLanguage("ts",Ny),Ii}function FO(e){return e.match(/language-([a-z0-9_-]+)/i)?.[1]?.toLowerCase()??null}function WO(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)&&!e.startsWith(window.location.origin)}function GO(e){return e.trim().toLowerCase().replace(/[^\p{Letter}\p{Number}]+/gu,"-").replace(/^-+|-+$/g,"")||"section"}function Dy(e){return e.trim().replace(/\s+/g," ").toLocaleLowerCase("en-US")}function $l(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}const qO="modulepreload",KO=function(e){return"/console/"+e},jy={},VO=function(n,i,s){let o=Promise.resolve();if(i&&i.length>0){let h=function(d){return Promise.all(d.map(b=>Promise.resolve(b).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const g=document.querySelector("meta[property=csp-nonce]"),c=g?.nonce||g?.getAttribute("nonce");o=h(i.map(d=>{if(d=KO(d),d in jy)return;jy[d]=!0;const b=d.endsWith(".css"),m=b?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${m}`))return;const w=document.createElement("link");if(w.rel=b?"stylesheet":qO,b||(w.as="script"),w.crossOrigin="",w.href=d,c&&w.setAttribute("nonce",c),document.head.appendChild(w),b)return new Promise((x,T)=>{w.addEventListener("load",x),w.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${d}`)))})}))}function f(g){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=g,window.dispatchEvent(c),!c.defaultPrevented)throw g}return o.then(g=>{for(const c of g||[])c.status==="rejected"&&f(c.reason);return n().catch(f)})},YO=".diagram-block[data-mermaid-source]:not([data-diagram-state='rendered']):not([data-diagram-state='error'])",XO=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(","),ZO=/^on/i,JO={USE_PROFILES:{svg:!0,svgFilters:!1},FORBID_TAGS:["foreignObject","script"],FORBID_ATTR:["href","xlink:href"]},Iy="diagramInteractionBound",QO=/^oklch\s*\(\s*([^)]+)\s*\)$/i,eD=/^(-?\d+(?:\.\d+)?)(deg)?$/i,zi=[25,50,75,100,125,150,200],tD=["pie1","pie2","pie3","pie4","pie5","pie6","pie7","pie8","pie9","pie10","pie11","pie12"];let _p=null;const By=new WeakSet;let nD=0,iD=0,Yl=null;function ys(e){const n=e.trim();if(!n)return n;const i=ED(n);return i?kD(i):n}function pC(e){if(By.has(e))return;By.add(e),Py(e);const n=e instanceof Node?e:document.body;new MutationObserver(s=>{let o=!1;for(const f of s)if(f.type==="childList"){Yl&&!Yl.trigger.isConnected&&jl(!1);for(const g of f.addedNodes)if(g instanceof Element&&(g.matches?.(".diagram-block[data-mermaid-source]")||g.querySelector?.(".diagram-block[data-mermaid-source]"))){o=!0;break}if(o)break}o&&Py(e)}).observe(n,{childList:!0,subtree:!0})}function Py(e){const n=e.querySelectorAll(YO);for(const i of n)i.dataset.diagramHydrating!=="true"&&(i.dataset.diagramHydrating="true",i.dataset.diagramState="pending",rD(i))}async function rD(e){const n=e.getAttribute("data-mermaid-source")??"";let i="";try{i=LO(n)}catch{vp(e,"Invalid diagram source");return}if(!i.trim()){vp(e,"Empty diagram source");return}try{const s=await aD(),o=`mermaid-diagram-${++nD}`,{svg:f}=await s.render(o,i);e.innerHTML=sD(f),cD(e,f),uD(e),hD(e),e.dataset.diagramState="rendered"}catch(s){const o=s instanceof Error?s.message:String(s);vp(e,o)}}function vp(e,n){e.dataset.diagramState="error",e.textContent=`Diagram render failed: ${n}`}function sD(e){const n=(i,s)=>{ZO.test(s.attrName)&&(s.keepAttr=!1)};Hl.addHook("uponSanitizeAttribute",n);try{return Hl.sanitize(e,JO)}finally{Hl.removeHook("uponSanitizeAttribute",n)}}async function aD(){return _p||(_p=(async()=>{const e=await VO(()=>import("./mermaid.core-BT7SVKBR.js").then(i=>i.bC),[]),n=e.default??e;return n.initialize({securityLevel:"strict",htmlLabels:!1,suppressErrorRendering:!0,startOnLoad:!1,theme:"base",look:"handDrawn",themeVariables:oD(),themeCSS:lD(),flowchart:{htmlLabels:!1,useMaxWidth:!1}}),n})()),_p}function oD(){const e=getComputedStyle(document.documentElement),n=(E,p)=>{const v=e.getPropertyValue(E).trim();return ys(v||p)},i=(E,p)=>e.getPropertyValue(E).trim()||p,s=n("--brass","#c69a4a"),o=n("--brass-bright","#e6b86a"),f=n("--brass-deep","#a0782a"),g=n("--aurora","#8bd7e6"),c=n("--aurora-deep","#1f8aa8"),h=n("--coral","#ef7c63"),d=n("--ink-deep","#1d2734"),b=n("--ink-fog","#a6afbb"),m=n("--ink-pearl","#e6e9ef"),w=n("--ink-spectral","#bcc4d0"),x=[o,s,g,h,ys("oklch(70% 0.11 68)"),c,ys("oklch(76% 0.09 205)"),f,ys("oklch(68% 0.14 30)"),b,ys("oklch(62% 0.08 228)"),ys("oklch(52% 0.05 248)")],T=Object.fromEntries(tD.map((E,p)=>[E,x[p]??d]));return{background:"transparent",primaryColor:"transparent",primaryTextColor:m,primaryBorderColor:s,secondaryColor:"transparent",secondaryTextColor:m,secondaryBorderColor:o,tertiaryColor:"transparent",tertiaryTextColor:w,tertiaryBorderColor:s,lineColor:c,edgeLabelBackground:"transparent",titleColor:o,fontFamily:"JetBrains Mono Variable, ui-monospace, monospace",mainBkg:"transparent",nodeBorder:s,clusterBkg:"transparent",clusterBorder:s,pieTitleTextColor:o,pieTitleTextSize:i("--font-size-title-lg","19px"),pieSectionTextColor:m,pieSectionTextSize:i("--font-size-md","13px"),pieLegendTextColor:m,pieLegendTextSize:i("--font-size-lg","14px"),pieStrokeColor:f,pieStrokeWidth:"1.35px",pieOuterStrokeColor:o,pieOuterStrokeWidth:"2.5px",pieOpacity:"0.96",...T}}function lD(){const e=getComputedStyle(document.documentElement),n=(d,b)=>{const m=e.getPropertyValue(d).trim();return ys(m||b)},i=n("--brass-deep","#a0782a"),s=n("--brass-bright","#e6b86a"),o=n("--aurora-deep","#1f8aa8"),f=n("--ink-abyss","#131920"),g=ys("oklch(15% 0.04 250 / 34%)"),c=n("--surface-glass","#1d2734"),h=n("--ink-pearl","#e6e9ef");return`
|
|
161
|
+
.node rect, .node polygon, .node circle, .node ellipse, .actor, .classGroup rect {
|
|
162
|
+
stroke: ${i};
|
|
163
|
+
fill: ${c};
|
|
164
|
+
}
|
|
165
|
+
.edgePath path, .messageLine0, .messageLine1, .relation {
|
|
166
|
+
stroke: ${o};
|
|
167
|
+
}
|
|
168
|
+
.nodeLabel, .edgeLabel, .actor text, .messageText {
|
|
169
|
+
fill: ${h};
|
|
170
|
+
font-family: "Manrope Variable", "Manrope", ui-sans-serif, sans-serif;
|
|
171
|
+
}
|
|
172
|
+
.pieCircle {
|
|
173
|
+
stroke: ${i};
|
|
174
|
+
stroke-width: 1.35px;
|
|
175
|
+
opacity: 0.96;
|
|
176
|
+
filter: drop-shadow(0 0 1.5px ${g});
|
|
177
|
+
}
|
|
178
|
+
.pieOuterCircle {
|
|
179
|
+
stroke: ${s};
|
|
180
|
+
opacity: 0.7;
|
|
181
|
+
}
|
|
182
|
+
.slice, .legend text, .pieTitleText {
|
|
183
|
+
fill: ${h};
|
|
184
|
+
paint-order: stroke;
|
|
185
|
+
stroke: ${f};
|
|
186
|
+
stroke-width: 3px;
|
|
187
|
+
stroke-linejoin: round;
|
|
188
|
+
font-family: "Manrope Variable", "Manrope", ui-sans-serif, sans-serif;
|
|
189
|
+
}
|
|
190
|
+
.slice {
|
|
191
|
+
font-weight: 600;
|
|
192
|
+
letter-spacing: 0.04em;
|
|
193
|
+
font-style: italic;
|
|
194
|
+
}
|
|
195
|
+
.pieTitleText {
|
|
196
|
+
font-weight: 600;
|
|
197
|
+
letter-spacing: 0.12em;
|
|
198
|
+
font-style: italic;
|
|
199
|
+
}
|
|
200
|
+
.legend text {
|
|
201
|
+
font-weight: 500;
|
|
202
|
+
letter-spacing: 0.03em;
|
|
203
|
+
}
|
|
204
|
+
.legend rect {
|
|
205
|
+
rx: 999px;
|
|
206
|
+
ry: 999px;
|
|
207
|
+
opacity: 0.9;
|
|
208
|
+
stroke: ${f};
|
|
209
|
+
stroke-width: 1.5px;
|
|
210
|
+
paint-order: stroke;
|
|
211
|
+
filter: saturate(0.78) brightness(0.92) drop-shadow(0 0 0.55px ${s});
|
|
212
|
+
}
|
|
213
|
+
`}function cD(e,n){const i=new DOMParser().parseFromString(n,"image/svg+xml"),s=Array.from(i.querySelectorAll("a")),o=Array.from(e.querySelectorAll("a")),f=Math.min(s.length,o.length);for(let g=0;g<f;g++){const c=s[g],h=o[g];if(!c||!h)continue;const d=c.getAttribute("href")??c.getAttribute("xlink:href")??"",b=mC(d);b&&h.setAttribute("href",b)}}function uD(e){const n=e.querySelector("svg");if(!n)return;let i;try{i=n.getBBox()}catch{return}const{x:s,y:o,width:f,height:g}=i;!Number.isFinite(s)||!Number.isFinite(o)||!Number.isFinite(f)||!Number.isFinite(g)||s<0||o<0||f<=0||g<=0||n.setAttribute("viewBox",`${to(s)} ${to(o)} ${to(f)} ${to(g)}`)}function hD(e){e.tabIndex=0,e.setAttribute("aria-label","Open diagram in expanded view"),wD(e),e.dataset[Iy]!=="true"&&(e.dataset[Iy]="true",e.addEventListener("click",dD),e.addEventListener("keydown",fD))}function dD(e){if(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0||ph(e.target))return;const n=e.currentTarget;n instanceof HTMLElement&&(e.preventDefault(),gC(n))}function fD(e){if(e.key!=="Enter"&&e.key!==" "||ph(e.target))return;const n=e.currentTarget;n instanceof HTMLElement&&(e.preventDefault(),gC(n))}function gC(e){const n=e.querySelector("svg");if(!n)return;jl(!1);const i=typeof HTMLDialogElement<"u"&&typeof HTMLDialogElement.prototype.showModal=="function",s=document.createElement(i?"dialog":"div"),o=++iD,f=`diagram-lightbox-title-${o}`;s.className="diagram-lightbox",s.setAttribute("aria-labelledby",f),i||(s.setAttribute("role","dialog"),s.setAttribute("aria-modal","true"),s.tabIndex=-1);const g=document.createElement("div");g.className="diagram-lightbox__frame";const c=document.createElement("div");c.className="diagram-lightbox__header";const h=document.createElement("h2");h.id=f,h.textContent="MANIFEST · DIAGRAM";const d=document.createElement("button");d.className="diagram-lightbox__close",d.type="button",d.setAttribute("aria-label","Close expanded diagram"),d.textContent="Close";const b=document.createElement("div");b.className="diagram-lightbox__controls",b.setAttribute("aria-label","Diagram zoom controls");const m=Ru("−","Zoom out","out"),w=document.createElement("span");w.className="diagram-lightbox__zoom-readout",w.setAttribute("aria-live","polite");const x=Ru("+","Zoom in","in"),T=Ru("Fit","Fit diagram to viewport","fit"),E=Ru("Reset","Reset diagram zoom","reset");b.append(m,w,x,T,E);const p=document.createElement("div");p.className="diagram-lightbox__viewport";const v=mD(n),_=n.cloneNode(!0);_.removeAttribute("style"),vD(_,`diagram-lightbox-svg-${o}`),p.append(_),c.append(h,b,d),g.append(c,p),s.append(g),document.body.append(s);const S=new pD(p,_,w,v);m.addEventListener("click",()=>S.zoomOut()),x.addEventListener("click",()=>S.zoomIn()),T.addEventListener("click",()=>S.fit()),E.addEventListener("click",()=>S.reset());const k=bD(s),L=A=>{(A.target===s||A.target===d)&&jl(!0)},R=A=>{if(A.key==="Escape"){A.preventDefault(),jl(!0);return}S.handleKeyboard(A)||A.key==="Tab"&&SD(A,s)},N={dialog:s,trigger:e,inertStates:k,onClick:L,onKeyDown:R,cleanupPanZoom:()=>S.destroy()};i&&(N.onCancel=A=>{A.preventDefault(),jl(!0)},s.addEventListener("cancel",N.onCancel),s.showModal()),s.addEventListener("click",L),document.addEventListener("keydown",R,!0),Yl=N,S.fit(),d.focus()}function Ru(e,n,i){const s=document.createElement("button");return s.className="diagram-lightbox__zoom-button",s.type="button",s.dataset.zoomAction=i,s.setAttribute("aria-label",n),s.textContent=e,s}class pD{constructor(n,i,s,o){this.viewport=n,this.svg=i,this.readout=s,this.baseSize=o,this.applyZoom(this.zoomIndex),n.addEventListener("pointerdown",this.onPointerDown),n.addEventListener("pointermove",this.onPointerMove),n.addEventListener("pointerup",this.onPointerEnd),n.addEventListener("pointercancel",this.onPointerEnd),n.addEventListener("wheel",this.onWheel,{passive:!1}),n.addEventListener("dblclick",this.onDoubleClick),window.addEventListener("resize",this.onResize)}viewport;svg;readout;baseSize;zoomIndex=zi.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,zi.length-1))}zoomOut(){this.zoomAroundViewportCenter(Math.max(this.zoomIndex-1,0))}reset(){this.zoomAroundViewportCenter(zi.indexOf(100))}fit(){const n=this.viewport.clientWidth||this.viewport.getBoundingClientRect().width||this.baseSize.width,i=this.viewport.clientHeight||this.viewport.getBoundingClientRect().height||this.baseSize.height,s=Math.min(n/this.baseSize.width,i/this.baseSize.height),o=Math.floor(s*100),f=zi.findIndex(c=>c>o),g=f===-1?zi.length-1:Math.max(0,f-1);this.applyZoom(g),this.viewport.scrollLeft=Math.max(0,(this.svgWidth-n)/2),this.viewport.scrollTop=Math.max(0,(this.svgHeight-i)/2)}handleKeyboard(n){return n.key==="+"||n.key==="="?(n.preventDefault(),this.zoomIn(),!0):n.key==="-"||n.key==="_"?(n.preventDefault(),this.zoomOut(),!0):n.key==="0"?(n.preventDefault(),this.reset(),!0):n.key.toLowerCase()==="f"?(n.preventDefault(),this.fit(),!0):!1}get svgWidth(){return this.baseSize.width*(Lu(this.zoomIndex)/100)}get svgHeight(){return this.baseSize.height*(Lu(this.zoomIndex)/100)}applyZoom(n){this.zoomIndex=n;const i=Lu(this.zoomIndex),s=i/100;this.svg.setAttribute("width",to(this.baseSize.width*s)),this.svg.setAttribute("height",to(this.baseSize.height*s)),this.readout.textContent=`${i}%`}zoomAroundViewportCenter(n){const i=this.viewport.getBoundingClientRect();this.zoomAroundPoint(n,i.left+i.width/2,i.top+i.height/2)}zoomAroundPoint(n,i,s){if(n===this.zoomIndex)return;const o=this.svgWidth,f=this.svgHeight,g=this.viewport.getBoundingClientRect(),c=this.viewport.scrollLeft+i-g.left,h=this.viewport.scrollTop+s-g.top;this.applyZoom(n),this.viewport.scrollLeft=c/o*this.svgWidth-(i-g.left),this.viewport.scrollTop=h/f*this.svgHeight-(s-g.top)}onPointerDown=n=>{if(n.button!==0||ph(n.target))return;const i=n.pointerId??1;if(this.pointers.set(i,n),this.pointers.size===2){this.pinchStart={distance:this.pointerDistance(),zoomIndex:this.zoomIndex};return}this.dragStart={x:n.clientX,y:n.clientY,scrollLeft:this.viewport.scrollLeft,scrollTop:this.viewport.scrollTop,pointerId:i},this.viewport.setPointerCapture?.(i)};onPointerMove=n=>{const i=n.pointerId??1;if(this.pointers.has(i)&&this.pointers.set(i,n),this.pinchStart&&this.pointers.size>=2){const s=this.pointerDistance()/this.pinchStart.distance,o=Lu(this.pinchStart.zoomIndex)*s;this.applyZoom(_D(o));return}!this.dragStart||this.dragStart.pointerId!==i||(n.preventDefault(),this.viewport.scrollLeft=this.dragStart.scrollLeft-(n.clientX-this.dragStart.x),this.viewport.scrollTop=this.dragStart.scrollTop-(n.clientY-this.dragStart.y))};onPointerEnd=n=>{const i=n.pointerId??1;this.pointers.delete(i),this.viewport.releasePointerCapture?.(i),this.dragStart?.pointerId===i&&(this.dragStart=null),this.pointers.size<2&&(this.pinchStart=null)};onWheel=n=>{if(!n.ctrlKey&&!n.metaKey)return;n.preventDefault();const i=n.deltaY<0?Math.min(this.zoomIndex+1,zi.length-1):Math.max(this.zoomIndex-1,0);this.zoomAroundPoint(i,n.clientX,n.clientY)};onDoubleClick=n=>{ph(n.target)||(n.preventDefault(),this.zoomAroundPoint(this.zoomIndex===zi.indexOf(200)?zi.indexOf(100):zi.indexOf(200),n.clientX,n.clientY))};onResize=()=>{this.fit()};pointerDistance(){const[n,i]=Array.from(this.pointers.values());return!n||!i?1:Math.hypot(i.clientX-n.clientX,i.clientY-n.clientY)}}function gD(e){const n=zy(e.getAttribute("width")),i=zy(e.getAttribute("height"));if(n&&i)return{width:n,height:i};const s=e.getAttribute("viewBox")?.trim().split(/[\s,]+/).map(Number)??[],o=s[2],f=s[3],g=o!==void 0&&Number.isFinite(o)&&o>0?o:null,c=f!==void 0&&Number.isFinite(f)&&f>0?f:null;return{width:n??g??800,height:i??c??600}}function mD(e){const n=e.getBoundingClientRect();return n.width>0&&n.height>0?{width:n.width,height:n.height}:gD(e)}function zy(e){if(!e)return null;const n=/^(\d+(?:\.\d+)?)/.exec(e.trim());if(!n)return null;const i=Number(n[1]);return Number.isFinite(i)&&i>0?i:null}function to(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/\.?0+$/,"")}function _D(e){let n=0,i=Number.POSITIVE_INFINITY;return zi.forEach((s,o)=>{const f=Math.abs(s-e);f<i&&(i=f,n=o)}),n}function Lu(e){return zi[e]??zi[0]}function vD(e,n){const i=e.getAttribute("id")??"";e.setAttribute("id",n);const s=e.querySelector("style");!i||!s?.textContent||(s.textContent=s.textContent.split(`#${i}`).join(`#${n}`))}function jl(e){const n=Yl;n&&(n.dialog.removeEventListener("click",n.onClick),document.removeEventListener("keydown",n.onKeyDown,!0),n.onCancel&&n.dialog.removeEventListener("cancel",n.onCancel),n.cleanupPanZoom(),yD(n.inertStates),n.dialog instanceof HTMLDialogElement&&n.dialog.open&&typeof n.dialog.close=="function"&&n.dialog.close(),n.dialog.remove(),Yl=null,e&&n.trigger.isConnected&&n.trigger.focus())}function bD(e){const n=[];for(const i of Array.from(document.body.children))!(i instanceof HTMLElement)||i===e||(n.push({element:i,ariaHidden:i.getAttribute("aria-hidden"),inert:i.inert}),i.inert=!0,i.setAttribute("aria-hidden","true"));return n}function yD(e){for(const n of e)n.element.inert=n.inert,n.ariaHidden===null?n.element.removeAttribute("aria-hidden"):n.element.setAttribute("aria-hidden",n.ariaHidden)}function SD(e,n){const i=Array.from(n.querySelectorAll(XO)).filter(CD);if(i.length===0){e.preventDefault(),n.focus();return}const s=i[0],o=i[i.length-1];!s||!o||(e.shiftKey&&document.activeElement===s?(e.preventDefault(),o.focus()):!e.shiftKey&&document.activeElement===o&&(e.preventDefault(),s.focus()))}function wD(e){e.querySelector("a[href]")?e.removeAttribute("role"):e.setAttribute("role","button")}function ph(e){if(!(e instanceof Element))return!1;const n=e.closest("a[href]");return!n||!(n.getAttribute("href")?.trim()??"")?!1:!xD(n)}function xD(e){return Array.from(e.children).some(n=>n.tagName.toLowerCase()==="svg")}function CD(e){return!(e.inert||e.hidden||e.getAttribute("aria-hidden")==="true"||"disabled"in e&&e.disabled)}function mC(e){const n=e.trim();if(!n||n.includes(".."))return null;if(/^[a-z][a-z0-9+.-]*:/i.test(n)){if(/^javascript:/i.test(n)||/^data:/i.test(n))return null;let s;try{s=new URL(n)}catch{return null}return s.origin!==window.location.origin?null:mC(s.pathname)}if(/^\/entry\/[^/?#]+$/.exec(n)){const s=n.slice(7);let o;try{o=decodeURIComponent(s)}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(n)?`/entry/${encodeURIComponent(n)}`:null}function ED(e){const n=QO.exec(e);if(!n)return null;const i=n[1]?.trim();if(!i)return null;const s=i.indexOf("/"),o=s>=0?i.slice(0,s):i,f=s>=0?i.slice(s+1).trim():"",g=o.trim().split(/[\s,]+/).filter(Boolean);if(g.length!==3)return null;const[c,h,d]=g;if(!c||!h||!d)return null;const b=bp(c,1),m=bp(h,.4),w=TD(d);if(b===null||m===null||w===null)return null;let x=1;if(s>=0){const T=bp(f,1);if(T===null)return null;x=T}return{L:b,C:m,h:w,alpha:x}}function kD(e){const n=e.h*Math.PI/180,i=e.C*Math.cos(n),s=e.C*Math.sin(n),o=e.L,f=o+.3963377774*i+.2158037573*s,g=o-.1055613458*i-.0638541728*s,c=o-.0894841775*i-1.291485548*s,h=f**3,d=g**3,b=c**3,m=4.0767416621*h-3.3077115913*d+.2309699292*b,w=-1.2684380046*h+2.6097574011*d-.3413193965*b,x=-.0041960863*h-.7034186147*d+1.707614701*b,T=Mu(yp(m)),E=Mu(yp(w)),p=Mu(yp(x));if(e.alpha<1){const v=Mu(e.alpha);return`#${Ks(T)}${Ks(E)}${Ks(p)}${Ks(v)}`}return`#${Ks(T)}${Ks(E)}${Ks(p)}`}function bp(e,n){if(!e)return null;if(e.endsWith("%")){const s=Number(e.slice(0,-1));return Number.isFinite(s)?s/100*n:null}const i=Number(e);return Number.isFinite(i)?i:null}function TD(e){const n=eD.exec(e);if(!n)return null;const i=Number(n[1]);return Number.isFinite(i)?i:null}function yp(e){const n=Math.max(0,Math.min(1,e));return n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n}function Mu(e){return Math.round(Math.max(0,Math.min(1,e))*255)}function Ks(e){return e.toString(16).padStart(2,"0")}function AD({content:e,truncated:n}){const i=M.useMemo(()=>{const f=fh(e).html,g=new DOMParser().parseFromString(f,"text/html");return Sp(g.body),g.body.innerHTML},[e]),s=M.useRef(null);M.useEffect(()=>{const f=s.current;if(!f)return;pC(f),Sp(f);const g=new MutationObserver(()=>Sp(f));return g.observe(f,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["href","src","srcset"]}),()=>g.disconnect()},[i]);const o=M.useCallback(f=>{const g=f.target.closest('[data-action="copy-code"]');if(!g)return;const c=g.closest("pre")?.getAttribute("data-code");if(!c)return;navigator.clipboard?.writeText(c);const h=g.textContent;g.textContent="Copied",window.setTimeout(()=>{g.textContent=h},1200)},[]);return u.jsxs("div",{className:"fexp-md-wrap",children:[n&&u.jsx("div",{className:"fexp-truncated-badge",children:"File is too large — showing a partial preview"}),u.jsx("div",{ref:s,className:"markdown-body",onClick:o,dangerouslySetInnerHTML:{__html:i}})]})}function Sp(e){for(const n of e.querySelectorAll("a[href]")){const i=n.getAttribute("href")??"";i&&!/^(https?:|mailto:|#)/i.test(i)&&(n.removeAttribute("href"),n.setAttribute("role","link"),n.setAttribute("aria-disabled","true"))}for(const n of e.querySelectorAll("img[src], img[srcset], source[src], source[srcset]"))n.removeAttribute("src"),n.removeAttribute("srcset"),n.tagName==="IMG"&&n.setAttribute("aria-hidden","true")}const RD=.55,kg={selectedPath:null,viewState:{kind:"none"},splitRatio:RD},_C=new Map,Tg=new Set;function LD(){for(const e of Tg)e()}function vC(e){return _C.get(e)??kg}function Im(e,n){_C.set(e,{...vC(e),...n}),LD()}function MD(e){return Tg.add(e),()=>{Tg.delete(e)}}function ND(e){return M.useSyncExternalStore(MD,()=>e!=null?vC(e):kg,()=>kg)}function Hy(e,n){e&&Im(e,{selectedPath:n})}function Vs(e,n){e&&Im(e,{viewState:n})}function OD(e,n){e&&Im(e,{splitRatio:n})}const DD=new Set([".png",".jpg",".jpeg",".webp",".gif"]),$y=200,Uy=160,jD=360;function ID(e){return{listFolder:async n=>{if(!e)throw new Error("no_theater");const i=await fetch("/plugins/file-explorer/files/list",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({theaterId:e,relativePath:n??""})});if(!i.ok){const s=await i.json();throw new Error(s.error??"list_failed")}return i.json()}}}function BD({theaterId:e}){const{selectedPath:n,viewState:i,splitRatio:s}=ND(e),o=M.useRef(s);o.current=s;const f=M.useRef(null),[g,c]=M.useState(!1),h=M.useMemo(()=>ID(e),[e]),d=M.useCallback(async x=>{if(x.kind!=="file")return;Hy(e,x.relativePath);const T=x.name,E=T.slice(T.lastIndexOf(".")).toLowerCase();if(DD.has(E)){const p=e?`/plugins/file-explorer/files/image?theaterId=${encodeURIComponent(e)}&path=${encodeURIComponent(x.relativePath)}`:"";Vs(e,{kind:"image",relativePath:x.relativePath,name:T,src:p});return}Vs(e,{kind:"loading"});try{const p=await fetch("/plugins/file-explorer/files/read",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({theaterId:e,relativePath:x.relativePath})});if(!p.ok){const _=await p.json();throw new Error(_.error??"read_failed")}const v=await p.json();if(v.binary){Vs(e,{kind:"binary",name:T});return}Vs(e,{kind:"code",relativePath:v.relativePath,content:v.content,lang:v.lang,truncated:v.truncated})}catch(p){const v=p instanceof Error?p.message:"Unable to load file";v==="binary_file"?Vs(e,{kind:"binary",name:T}):Vs(e,{kind:"error",message:v})}},[e]),b=M.useCallback(()=>{Vs(e,{kind:"none"}),Hy(e,null)},[e]),m=M.useCallback(x=>{x.preventDefault();const T=f.current;if(!T)return;const E=T.getBoundingClientRect().width,p=x.clientX,v=o.current;c(!0);const _=k=>{const L=k.clientX-p,R=Math.max($y/E,Math.min(1-Uy/E,v+L/E));o.current=R,OD(e,R)},S=()=>{document.removeEventListener("pointermove",_),document.removeEventListener("pointerup",S),c(!1)};document.addEventListener("pointermove",_),document.addEventListener("pointerup",S)},[e]),w=i.kind!=="none";return u.jsxs("div",{ref:f,className:`fexp-root${g?" is-dragging":""}`,style:{gridTemplateColumns:`minmax(${$y}px, ${s}fr) 4px minmax(${Uy}px, ${1-s}fr)`},children:[u.jsxs("div",{className:"fexp-viewer-pane",children:[u.jsxs("div",{className:"fexp-viewer-head",children:[u.jsx("span",{className:"fexp-viewer-filename",children:w&&i.kind!=="loading"&&i.kind!=="error"?"relativePath"in i?i.relativePath:i.name:""}),w&&u.jsx("button",{className:"fexp-viewer-close",type:"button",onClick:b,"aria-label":"Close viewer",children:"✕"})]}),u.jsxs("div",{className:"fexp-viewer-body",children:[i.kind==="none"&&u.jsx("div",{className:"fexp-viewer-empty",children:"Select an item in the file tree to preview its contents here."}),i.kind==="loading"&&u.jsx("div",{className:"fexp-viewer-loading",children:"Loading…"}),i.kind==="error"&&u.jsx("div",{className:"fexp-viewer-error",children:i.message}),i.kind==="code"&&i.lang==="markdown"&&u.jsx(AD,{content:i.content,truncated:i.truncated}),i.kind==="code"&&i.lang!=="markdown"&&u.jsx(oN,{content:i.content,lang:i.lang,truncated:i.truncated}),i.kind==="image"&&u.jsx(uN,{src:i.src,name:i.name}),i.kind==="binary"&&u.jsx(X4,{name:i.name})]})]}),u.jsx("div",{className:"fexp-divider",onPointerDown:m,"aria-hidden":"true"}),u.jsx("div",{className:"fexp-tree-pane",children:u.jsx(V4,{files:h,theaterId:e,selectedPath:n,onSelect:d})})]})}function PD(){return u.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:u.jsx("path",{d:"M3 5a2 2 0 012-2h3.586a1 1 0 01.707.293L10.707 4.7A1 1 0 0011.414 5H15a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2V5z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"})})}const zD={id:"file-explorer",title:"Files",icon:PD,render:e=>u.jsx(BD,{...e}),preferredExtraWidth:jD},HD={id:"file-explorer",railPanels:[zD]},$D=[HD],UD={M:"M",A:"A",D:"D",R:"R",U:"U"};function FD(e){const n={dirs:{},files:[]};for(const i of e){const s=i.path.split("/");s.pop();let o=n;for(const f of s)o.dirs[f]||(o.dirs[f]={dirs:{},files:[]}),o=o.dirs[f];o.files.push(i)}return n}function WD({files:e,selectedPath:n,onSelect:i}){const s=FD(e);return u.jsx(bC,{node:s,depth:0,selectedPath:n,onSelect:i})}function bC({node:e,depth:n,selectedPath:i,onSelect:s}){return u.jsxs(u.Fragment,{children:[Object.entries(e.dirs).map(([o,f])=>u.jsx(GD,{dirKey:o,node:f,depth:n,selectedPath:i,onSelect:s},o)),e.files.map(o=>u.jsx(qD,{entry:o,depth:n,selectedPath:i,onSelect:s},o.path))]})}function GD({dirKey:e,node:n,depth:i,selectedPath:s,onSelect:o}){const[f,g]=M.useState(!1),c=M.useCallback(()=>g(m=>!m),[]);let h=e,d=n;for(;Object.keys(d.dirs).length===1&&d.files.length===0;){const m=Object.keys(d.dirs)[0];h+="/"+m,d=d.dirs[m]}const b=i*16+12;return u.jsxs("div",{className:`diff-folder${f?" is-collapsed":""}`,children:[u.jsxs("button",{type:"button",className:"diff-folder-row",style:{paddingLeft:`${b}px`},onClick:c,"aria-expanded":!f,children:[u.jsx("svg",{className:"diff-folder-chevron",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:u.jsx("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})}),u.jsx("svg",{className:"diff-folder-icon",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:u.jsx("path",{d:"M2 4a1 1 0 011-1h3l1.2 1.2H13a1 1 0 011 1V12a1 1 0 01-1 1H3a1 1 0 01-1-1V4z",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"})}),u.jsx("span",{className:"diff-folder-name",children:h})]}),!f&&u.jsx(bC,{node:d,depth:i+1,selectedPath:s,onSelect:o})]})}function qD({entry:e,depth:n,selectedPath:i,onSelect:s}){const o=e.path===i,f=M.useCallback(()=>s(e),[e,s]),g=n*16+12,c=e.path.split("/").pop()??e.path;return u.jsxs("button",{type:"button",className:`diff-file-row${o?" is-cur":""}`,style:{paddingLeft:`${g}px`},title:e.path,onClick:f,children:[u.jsx("span",{className:`diff-status-glyph diff-status-${e.status.toLowerCase()}`,"aria-label":e.status,children:UD[e.status]??e.status}),u.jsx("span",{className:"diff-file-name",children:u.jsx("span",{className:"diff-file-fn",children:c})}),u.jsxs("span",{className:"diff-nums",children:[e.additions>0&&u.jsxs("span",{className:"diff-additions",children:["+",e.additions]}),e.deletions>0&&u.jsxs("span",{className:"diff-deletions",children:["−",e.deletions]})]})]})}const Fy="fleet-console.diff.changesCollapsed",KD={M:"modified",A:"added",D:"deleted",R:"renamed",U:"untracked"};function VD(e){try{return localStorage.getItem(e)==="1"}catch{return!1}}function YD({ctx:e,viewMode:n,selectedPath:i,subPath:s,onSelect:o}){const[f,g]=M.useState({kind:"loading"}),[c,h]=M.useState(0),[d,b]=M.useState(()=>VD(Fy));M.useEffect(()=>{if(!e.theaterId){g({kind:"error",message:"no_theater"});return}let x=!1;return g({kind:"loading"}),fetch("/plugins/diff/changed",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({theaterId:e.theaterId,subPath:s})}).then(async T=>{if(!T.ok){const v=(await T.json()).error??"git_failed";x||g(v==="no_git_repo"||v==="git_unavailable"?{kind:"notice",reason:v}:{kind:"error",message:v});return}const E=await T.json();x||g({kind:"ok",files:E.files})}).catch(T=>{x||g({kind:"error",message:T instanceof Error?T.message:"unknown"})}),()=>{x=!0}},[e.theaterId,s,c]);const m=M.useCallback(()=>h(x=>x+1),[]),w=M.useCallback(()=>{b(x=>{const T=!x;try{localStorage.setItem(Fy,T?"1":"0")}catch{}return T})},[]);if(f.kind==="loading")return u.jsx("div",{className:"diff-sections-loading",children:"Loading…"});if(f.kind==="notice"){const x=f.reason==="no_git_repo"?"Not a Git repository":"Git isn't available",T=f.reason==="no_git_repo"?"This folder isn't a Git repository, so there are no changes to show.":"Git was not found on this system. Install Git and make sure it's on your PATH.";return u.jsxs("div",{className:"diff-sections-notice",children:[u.jsx("strong",{className:"diff-notice-title",children:x}),u.jsx("span",{className:"diff-notice-body",children:T}),u.jsx("button",{type:"button",className:"diff-refresh-btn",onClick:m,children:"Retry"})]})}return f.kind==="error"?u.jsxs("div",{className:"diff-sections-error",children:[u.jsx("span",{children:f.message}),u.jsx("button",{type:"button",className:"diff-refresh-btn",onClick:m,children:"Retry"})]}):u.jsx("div",{className:"diff-sections",children:u.jsxs("div",{className:`diff-section${d?" is-collapsed":""}`,children:[u.jsxs("button",{type:"button",className:"diff-section-head",onClick:w,children:[u.jsx("svg",{className:"diff-section-chevron",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:u.jsx("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})}),u.jsx("span",{className:"diff-section-name",children:"Changes"}),u.jsx("span",{className:"diff-count-badge",children:f.files.length})]}),!d&&u.jsx("div",{className:"diff-section-rows",children:f.files.length===0?u.jsx("div",{className:"diff-empty-row",children:"No changes"}):n==="tree"?u.jsx(WD,{files:f.files,selectedPath:i,onSelect:o}):f.files.map(x=>u.jsx(XD,{entry:x,isSelected:x.path===i,onSelect:o},x.path))})]})})}function XD({entry:e,isSelected:n,onSelect:i}){const s=M.useCallback(()=>i(e),[e,i]),o=e.path.endsWith("/")?e.path.slice(0,-1):e.path,f=o.lastIndexOf("/"),g=f>=0?o.slice(0,f+1):"",c=(f>=0?o.slice(f+1):o)+(e.path.endsWith("/")?"/":"");return u.jsxs("button",{type:"button",className:`diff-file-row${n?" is-cur":""}`,title:e.path,onClick:s,children:[u.jsx("span",{className:`diff-status-glyph diff-status-${e.status.toLowerCase()}`,"aria-label":KD[e.status]??e.status,children:e.status}),u.jsxs("span",{className:"diff-file-name",children:[u.jsx("span",{className:"diff-file-fn",children:c}),g&&u.jsx("span",{className:"diff-file-dir",children:g})]}),u.jsxs("span",{className:"diff-nums",children:[e.additions>0&&u.jsxs("span",{className:"diff-additions",children:["+",e.additions]}),e.deletions>0&&u.jsxs("span",{className:"diff-deletions",children:["−",e.deletions]})]})]})}const Ag=new Set;let Bm={file:null};function yC(){for(const e of Ag)e()}function ZD(e){return Ag.add(e),()=>{Ag.delete(e)}}function Wy(){return Bm}function JD(e){const n=M.useSyncExternalStore(ZD,Wy,Wy);return!n.file||n.file.theaterId!==e?null:n.file}function QD(e,n,i){Bm={file:{entry:e,subPath:n,theaterId:i}},yC()}function wp(){Bm={file:null},yC()}const ej=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@(.*)/;function tj(e){if(!e)return[];const n=e.split(`
|
|
214
|
+
`);n[n.length-1]===""&&n.pop();const i=[];let s=0;for(;s<n.length&&n[s]?.startsWith("@@")===!1;)s++;if(s===n.length){for(const g of n)g!==""&&(g.startsWith("diff --git")||g.startsWith("index ")||g.startsWith("--- ")||g.startsWith("+++ ")||i.push({kind:"ctx",text:` ${g}`}));return i}let o=0,f=0;for(const g of n.slice(s))if(!g.startsWith("\\")){if(g.startsWith("@@")){const c=ej.exec(g);if(c){o=parseInt(c[1]??"0",10),f=parseInt(c[2]??"0",10);const h=c[3]?.trimEnd()??"",d=`@@ -${c[1]??""} +${c[2]??""} @@${h?` ${h.trimStart()}`:""}`;i.push({kind:"hunk-label",text:d})}else i.push({kind:"hunk-label",text:g});continue}g.startsWith("+")?i.push({kind:"add",text:g,newLine:f++}):g.startsWith("-")?i.push({kind:"del",text:g,oldLine:o++}):i.push({kind:"ctx",text:g,oldLine:o++,newLine:f++})}return i}function Gy(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function nj({ctx:e,file:n,mode:i,subPath:s}){const[o,f]=M.useState({kind:"loading"});if(M.useEffect(()=>{if(!e.theaterId){f({kind:"error",message:"no_theater"});return}let h=!1;return f({kind:"loading"}),e.api.fetch("diff","file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({theaterId:e.theaterId,filePath:n.path,mode:i,subPath:s})}).then(async d=>{const b=await d.json();h||f({kind:"ok",result:b})}).catch(d=>{h||f({kind:"error",message:d instanceof Error?d.message:"unknown"})}),()=>{h=!0}},[e.api,n.path,i,s,e.theaterId]),o.kind==="loading")return u.jsx("div",{className:"diff-hunk-loading",children:"Loading…"});if(o.kind==="error")return u.jsx("div",{className:"diff-hunk-error",children:o.message});const{result:g}=o,c=tj(g.content);return u.jsxs("div",{className:"diff-hunk-wrap",children:[g.truncated&&u.jsx("div",{className:"diff-truncated-badge",children:"Diff truncated"}),u.jsx("div",{className:"diff-hunk-scroll",children:u.jsx("table",{className:"diff-hunk-table",cellSpacing:0,cellPadding:0,children:u.jsx("tbody",{children:c.map((h,d)=>u.jsx("tr",{className:`diff-line diff-line-${h.kind}`,children:h.kind==="hunk-label"?u.jsx("td",{colSpan:4,className:"diff-line-label",dangerouslySetInnerHTML:{__html:Gy(h.text)}}):u.jsxs(u.Fragment,{children:[u.jsx("td",{className:"diff-gutter diff-gutter-old",children:h.oldLine??""}),u.jsx("td",{className:"diff-gutter diff-gutter-new",children:h.newLine??""}),u.jsx("td",{className:"diff-marker",children:h.kind==="add"?"+":h.kind==="del"?"−":""}),u.jsx("td",{className:"diff-line-code",dangerouslySetInnerHTML:{__html:Gy(h.text.length>0?h.text.slice(1):h.text)}})]})},d))})})})]})}function ij(e){const n=new Map;for(const o of e)if(o.worktreeOf!==void 0){const f=n.get(o.worktreeOf)??[];f.push(o),n.set(o.worktreeOf,f)}const i=e.filter(o=>o.worktreeOf===void 0);return{groups:i.map(o=>({repo:o,worktrees:n.get(o.relPath)??[]})),topLevelCount:i.length}}function rj(e,n){if(n==="")return e;const i=e.replace(/\\/g,"/"),o=n.replace(/\\/g,"/")+"/";return i.startsWith(o)?i.slice(o.length):i}const SC="fleet-console.diff.viewMode",wC="fleet-console.diff.splitRatio",xC="fleet-console.diff.depth",CC="fleet-console.diff.repo.",sj=400,qy=140,Ky=220,aj=.56,oj=3,lj=[{value:1,label:"1"},{value:2,label:"2"},{value:3,label:"3"},{value:4,label:"4"},{value:5,label:"5"},{value:8,label:"Max"}];function cj(){try{const e=localStorage.getItem(SC);if(e==="list"||e==="tree")return e}catch{}return"list"}function uj(){try{const e=localStorage.getItem(wC);if(e!==null){const n=parseFloat(e);if(!isNaN(n)&&n>0&&n<1)return n}}catch{}return aj}function hj(){try{const e=localStorage.getItem(xC);if(e!==null){const n=parseInt(e,10);if(!isNaN(n)&&n>=1)return n}}catch{}return oj}function Vy(e){try{return localStorage.getItem(CC+e)??""}catch{return""}}function dj(e,n){try{localStorage.setItem(CC+e,n)}catch{}}function fj(e){return e.entry.status==="U"?"untracked":"unified"}function pj(e){return e.split("/").filter(Boolean).pop()??e}function gj({repos:e,loading:n,truncated:i,activeSubPath:s,depth:o,onSelect:f,onDepthChange:g,onRescan:c,onClose:h}){const{groups:d,topLevelCount:b}=ij(e),m=M.useCallback(w=>{w.stopPropagation();const x=parseInt(w.target.value,10);isNaN(x)||g(x)},[g]);return u.jsxs("div",{className:"diff-repo-menu",role:"listbox","aria-label":"Repositories",onClick:w=>w.stopPropagation(),children:[u.jsxs("div",{className:"diff-repo-menu-eyebrow",children:[u.jsx("span",{children:"REPOSITORIES"}),!n&&u.jsxs("span",{children:[b," found · depth ",o]})]}),u.jsxs("div",{className:"diff-repo-menu-scroll",children:[n?u.jsxs("div",{className:"diff-repo-scan",children:[u.jsx("span",{className:"diff-repo-spin","aria-hidden":"true"}),"Scanning to depth ",o,"…"]}):e.length===0?u.jsxs("div",{className:"diff-repo-empty",children:["No Git repositories within depth ",o,"."]}):d.map(({repo:w,worktrees:x})=>{const T=w.relPath===s,E=w.isWorktree===!0&&w.worktreeOf===void 0;return u.jsxs("div",{className:"diff-repo-group",children:[u.jsxs("button",{type:"button",role:"option","aria-selected":T,className:`diff-repo-opt${T?" is-cur":""}`,onClick:()=>{f(w.relPath),h()},children:[u.jsx("svg",{className:"diff-repo-mark",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:T&&u.jsx("path",{d:"M3 7.5L6 10.5L11 4",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}),u.jsxs("span",{children:[u.jsxs("span",{className:"diff-repo-line1",children:[u.jsx("span",{className:"diff-repo-opt-name",children:w.name}),u.jsxs("span",{className:"diff-repo-branch",children:[u.jsx(Rg,{}),u.jsx("span",{children:w.branch})]}),w.relPath===""&&u.jsx("span",{className:"diff-repo-badge diff-repo-badge--root",children:"ROOT"}),E&&u.jsx("span",{className:"diff-repo-badge diff-repo-badge--worktree",children:"WORKTREE"})]}),u.jsx("span",{className:"diff-repo-opt-path",children:w.relPath===""?"· Theater root":w.relPath})]})]}),x.length>0&&u.jsx("div",{className:"diff-repo-children",role:"group",children:x.map(p=>{const v=p.relPath===s,_=rj(p.relPath,w.relPath);return u.jsx("div",{className:"diff-repo-child-row",children:u.jsxs("button",{type:"button",role:"option","aria-selected":v,className:`diff-repo-opt diff-repo-child-opt${v?" is-cur":""}`,onClick:()=>{f(p.relPath),h()},children:[u.jsx("svg",{className:"diff-repo-mark",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:v&&u.jsx("path",{d:"M3 7.5L6 10.5L11 4",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}),u.jsxs("span",{children:[u.jsxs("span",{className:"diff-repo-line1",children:[u.jsx("span",{className:"diff-repo-opt-name",children:p.name}),u.jsxs("span",{className:"diff-repo-branch",children:[u.jsx(Rg,{}),u.jsx("span",{children:p.branch})]}),u.jsx("span",{className:"diff-repo-badge diff-repo-badge--worktree",children:"WORKTREE"})]}),u.jsx("span",{className:"diff-repo-opt-path",children:_})]})]})},p.relPath)})})]},w.relPath)}),!n&&i&&u.jsx("div",{className:"diff-repo-truncated",children:"List capped — reduce depth to see all repos."})]}),u.jsxs("div",{className:"diff-repo-menu-foot",children:[u.jsxs("label",{className:"diff-repo-depth",children:["Depth",u.jsx("select",{value:o,onChange:m,onClick:w=>w.stopPropagation(),onMouseDown:w=>w.stopPropagation(),children:lj.map(w=>u.jsx("option",{value:w.value,children:w.label},w.value))})]}),u.jsx("button",{type:"button",className:"diff-repo-rescan",onClick:w=>{w.stopPropagation(),c()},children:"⟳ Rescan"})]})]})}function mj(){return u.jsx("svg",{className:"fico",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:u.jsx("path",{d:"M2 4a1 1 0 011-1h3l1.2 1.2H13a1 1 0 011 1V12a1 1 0 01-1 1H3a1 1 0 01-1-1V4z",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"})})}function Rg(){return u.jsxs("svg",{className:"bico",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:[u.jsx("circle",{cx:"3",cy:"3",r:"1.6",stroke:"currentColor",strokeWidth:"1.1"}),u.jsx("circle",{cx:"3",cy:"9",r:"1.6",stroke:"currentColor",strokeWidth:"1.1"}),u.jsx("circle",{cx:"9",cy:"3.4",r:"1.6",stroke:"currentColor",strokeWidth:"1.1"}),u.jsx("path",{d:"M3 4.6v2.8M4.4 3.2H7",stroke:"currentColor",strokeWidth:"1.1",strokeLinecap:"round"}),u.jsx("path",{d:"M7.4 4.8C6.4 5.4 4.4 5.6 3.6 7",stroke:"currentColor",strokeWidth:"1.1",strokeLinecap:"round"})]})}function _j(){return u.jsx("svg",{className:"chev",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:u.jsx("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function vj({ctx:e}){const[n,i]=M.useState(cj),s=JD(e.theaterId??null),[o,f]=M.useState(uj),g=M.useRef(o),c=M.useRef(null),[h,d]=M.useState(!1),[b,m]=M.useState(()=>e.theaterId?Vy(e.theaterId):""),[w,x]=M.useState(hj),[T,E]=M.useState([]),[p,v]=M.useState(!1),[_,S]=M.useState(!1),[k,L]=M.useState(!1),R=M.useRef(0),N=M.useRef(w);N.current=w;const A=M.useCallback(P=>{if(!e.theaterId)return;const Z=++R.current;v(!0),fetch("/plugins/diff/repos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({theaterId:e.theaterId,maxDepth:P})}).then(async ee=>{if(Z!==R.current)return;if(!ee.ok){v(!1);return}const J=await ee.json();if(Z!==R.current)return;const se=J.repos;E(se),L(J.truncated??!1),v(!1)}).catch(()=>{Z===R.current&&v(!1)})},[e.theaterId]);M.useEffect(()=>{if(!e.theaterId)return;const P=Vy(e.theaterId);m(P),E([]),L(!1),S(!1),wp(),A(N.current)},[e.theaterId,A]);const B=M.useCallback(P=>{P.stopPropagation(),S(Z=>!Z)},[]),q=M.useCallback(()=>S(!1),[]),F=M.useCallback(P=>{P!==b&&(m(P),e.theaterId&&dj(e.theaterId,P),wp())},[b,e.theaterId]),W=M.useCallback(P=>{x(P);try{localStorage.setItem(xC,String(P))}catch{}A(P)},[A]),I=M.useCallback(()=>{A(w)},[A,w]);M.useEffect(()=>{if(!_)return;const P=()=>S(!1);return document.addEventListener("click",P),()=>document.removeEventListener("click",P)},[_]),M.useEffect(()=>{if(!_)return;const P=Z=>{Z.key==="Escape"&&S(!1)};return document.addEventListener("keydown",P),()=>document.removeEventListener("keydown",P)},[_]);const Y=M.useCallback(P=>{e.theaterId&&QD(P,b,e.theaterId)},[e.theaterId,b]),V=M.useCallback(()=>{wp()},[]),z=M.useCallback(P=>{i(P);try{localStorage.setItem(SC,P)}catch{}},[]),G=M.useCallback(P=>{P.preventDefault();const Z=c.current;if(!Z)return;const ee=Z.getBoundingClientRect().width,J=P.clientX,se=g.current;d(!0);const X=ae=>{const de=ae.clientX-J,we=qy/ee,ye=1-Ky/ee,Ne=se+de/ee,Oe=we<=ye?Math.max(we,Math.min(ye,Ne)):se;g.current=Oe,f(Oe)},$=()=>{document.removeEventListener("pointermove",X),document.removeEventListener("pointerup",$),d(!1);try{localStorage.setItem(wC,String(g.current))}catch{}};document.addEventListener("pointermove",X),document.addEventListener("pointerup",$)},[]);M.useLayoutEffect(()=>{e.requestExtraWidth?.(s?sj:null)},[e,s]);const K=T.find(P=>P.relPath===b)??null,j=K?.name??(b===""?"Working tree":pj(b)||"Working tree"),H=K?.branch??null,D=s?fj(s):"unified";return u.jsxs("div",{ref:c,className:`diff-root${s?" has-hunk":""}${h?" is-dragging":""}`,style:s?{gridTemplateColumns:`minmax(${qy}px, ${o}fr) 4px minmax(${Ky}px, ${1-o}fr)`}:void 0,children:[s&&u.jsxs("div",{className:"diff-hunk-pane",children:[u.jsxs("div",{className:"diff-hunk-head",children:[u.jsx("span",{className:`diff-status-glyph diff-status-${s.entry.status.toLowerCase()}`,children:s.entry.status}),u.jsx("span",{className:"diff-hunk-filename",children:s.entry.path}),u.jsxs("span",{className:"diff-nums",children:[s.entry.additions>0&&u.jsxs("span",{className:"diff-additions",children:["+",s.entry.additions]}),s.entry.deletions>0&&u.jsxs("span",{className:"diff-deletions",children:["−",s.entry.deletions]})]}),u.jsx("button",{type:"button",className:"diff-hunk-close","aria-label":"Close diff",onClick:V,children:"✕"})]}),u.jsx("div",{className:"diff-hunk-body",children:u.jsx(nj,{ctx:e,file:s.entry,mode:D,subPath:s.subPath})})]}),s&&u.jsx("div",{className:"diff-divider",onPointerDown:G,"aria-hidden":"true"}),u.jsxs("div",{className:"diff-tree-pane",children:[u.jsxs("div",{className:"diff-plugin-toolbar",children:[u.jsxs("button",{type:"button",className:"diff-repo-trigger","aria-haspopup":"listbox","aria-expanded":_,onClick:B,children:[u.jsx(mj,{}),u.jsx("span",{className:"nm",children:j}),H&&u.jsxs("span",{className:"brc",children:[u.jsx(Rg,{}),u.jsx("span",{className:"bnm",children:H})]}),u.jsx(_j,{})]}),u.jsxs("div",{className:"diff-view-toggle",children:[u.jsx("button",{type:"button",className:`diff-toggle-btn${n==="list"?" is-active":""}`,title:"List view","aria-pressed":n==="list",onClick:()=>z("list"),children:u.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:[u.jsx("line",{x1:"2",y1:"3.5",x2:"12",y2:"3.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}),u.jsx("line",{x1:"2",y1:"7",x2:"12",y2:"7",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}),u.jsx("line",{x1:"2",y1:"10.5",x2:"12",y2:"10.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]})}),u.jsx("button",{type:"button",className:`diff-toggle-btn${n==="tree"?" is-active":""}`,title:"Tree view","aria-pressed":n==="tree",onClick:()=>z("tree"),children:u.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:[u.jsx("rect",{x:"1",y:"1",width:"4",height:"4",rx:"1",stroke:"currentColor",strokeWidth:"1.3"}),u.jsx("rect",{x:"9",y:"1",width:"4",height:"4",rx:"1",stroke:"currentColor",strokeWidth:"1.3"}),u.jsx("rect",{x:"1",y:"9",width:"4",height:"4",rx:"1",stroke:"currentColor",strokeWidth:"1.3"}),u.jsx("rect",{x:"9",y:"9",width:"4",height:"4",rx:"1",stroke:"currentColor",strokeWidth:"1.3"})]})})]})]}),u.jsx(YD,{ctx:e,viewMode:n,selectedPath:s?.entry.path??null,subPath:b,onSelect:Y}),_&&u.jsx(gj,{theaterId:e.theaterId??"",repos:T,loading:p,truncated:k,activeSubPath:b,depth:w,onSelect:F,onDepthChange:W,onRescan:I,onClose:q})]})]})}function bj(){return u.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",children:[u.jsx("rect",{x:"2",y:"4",width:"6",height:"1.5",rx:"0.5",fill:"currentColor",opacity:"0.5"}),u.jsx("rect",{x:"2",y:"7",width:"10",height:"1.5",rx:"0.5",fill:"currentColor"}),u.jsx("rect",{x:"2",y:"10",width:"8",height:"1.5",rx:"0.5",fill:"currentColor",opacity:"0.5"}),u.jsx("rect",{x:"2",y:"13",width:"12",height:"1.5",rx:"0.5",fill:"currentColor"}),u.jsx("line",{x1:"14",y1:"2",x2:"14",y2:"16",stroke:"currentColor",strokeWidth:"1.2"}),u.jsx("polyline",{points:"12,4 14,2 16,4",stroke:"currentColor",strokeWidth:"1.2",fill:"none"}),u.jsx("polyline",{points:"12,14 14,16 16,14",stroke:"currentColor",strokeWidth:"1.2",fill:"none"})]})}const yj={id:"diff",title:"Diff",icon:()=>u.jsx(bj,{}),render:e=>u.jsx(vj,{ctx:e})},Sj={id:"diff",railPanels:[yj]},wj=[Sj],Nu=["claude-code","codex","cursor","opencode"],xj={"claude-code":"Claude",codex:"Codex",cursor:"Cursor",opencode:"OpenCode"},Cj="Skills run with full agent permissions. Review before use — open the name to read SKILL.md.";function Ej({source:e,skill:n,theaterId:i,onCancel:s,onStarted:o,jobLog:f}){const[g,c]=M.useState(i?"project":"global"),[h,d]=M.useState(!0),[b,m]=M.useState(new Set(Nu)),{status:w,start:x}=f,T=w==="running",E=w==="done",p=w==="error",v=M.useCallback(()=>{d(!0),m(new Set(Nu))},[]),_=M.useCallback(k=>{d(!1),m(L=>{const R=new Set(L);return R.has(k)?R.delete(k):R.add(k),R})},[]),S=M.useCallback(()=>{const k=h?Nu:Array.from(b);if(k.length===0)return;const L={source:e,skill:n,scope:g,agents:k};g==="project"&&i&&(L.theaterId=i),x("/plugins/skills/install",L),o(g)},[h,b,e,n,g,i,x,o]);return u.jsxs("div",{className:"skills-install-flow",children:[u.jsxs("div",{className:"skills-scope-toggle",children:[u.jsx("button",{type:"button",className:`skills-scope-btn${g==="project"?" is-active":""}`,onClick:()=>c("project"),disabled:!i||T||E,title:i?void 0:"Select a Theater to install project skills",children:"Project"}),u.jsx("button",{type:"button",className:`skills-scope-btn${g==="global"?" is-active":""}`,onClick:()=>c("global"),disabled:T||E,children:"Global"})]}),u.jsxs("div",{className:"skills-agents-row",children:[u.jsx("button",{type:"button",className:`skills-agent-chip${h?" is-active":""}`,onClick:v,disabled:T||E,children:"All agents"}),Nu.map(k=>u.jsx("button",{type:"button",className:`skills-agent-chip${!h&&b.has(k)?" is-active":""}`,onClick:()=>_(k),disabled:T||E,children:xj[k]},k))]}),u.jsx("p",{className:"skills-permission-warning",children:Cj}),!T&&!E&&!p&&u.jsxs("div",{className:"skills-card-actions",children:[u.jsx("button",{type:"button",className:"skills-btn skills-btn--ghost",onClick:s,children:"Cancel"}),u.jsx("button",{type:"button",className:"skills-btn skills-btn--primary",onClick:S,disabled:!h&&b.size===0,children:"Install now"})]})]})}const kj=4e3;function EC({status:e,lines:n,runningLabel:i,doneLabel:s,errorLabel:o,onDismiss:f,onRetry:g}){const[c,h]=M.useState(!1),d=M.useRef(null),b=M.useRef(null);M.useEffect(()=>{e==="running"&&h(!1)},[e]),M.useEffect(()=>{const p=d.current;p&&(p.scrollTop=p.scrollHeight)},[n]),M.useEffect(()=>{if(e==="done")return b.current=setTimeout(()=>{h(!1),f()},kj),()=>{b.current&&(clearTimeout(b.current),b.current=null)}},[e,f]);const m=M.useCallback(()=>{b.current&&(clearTimeout(b.current),b.current=null),h(!1),f()},[f]),w=M.useCallback(()=>h(p=>!p),[]);if(e==="idle")return null;const x=e==="running"?"skills-dock-dot is-live":e==="done"?"skills-dock-dot is-ok":"skills-dock-dot is-err",T=e==="done"?"skills-dock-label is-ok":e==="error"?"skills-dock-label is-err":"skills-dock-label",E=e==="running"?i:e==="done"?s:o;return u.jsxs("div",{className:"skills-dock",children:[c&&u.jsxs("div",{ref:d,className:"skills-dock-log",children:[n.map((p,v)=>u.jsx("div",{className:"skills-dock-log-line",children:p},v)),e==="done"&&u.jsxs("div",{className:"skills-dock-log-line skills-dock-log-done",children:["✓ ",s]}),e==="error"&&u.jsxs("div",{className:"skills-dock-log-line skills-dock-log-error",children:["✗ ",o]})]}),u.jsxs("div",{role:"button",tabIndex:0,className:`skills-dock-summary${c?" is-open":""}`,"aria-expanded":c,onClick:w,onKeyDown:p=>{p.target===p.currentTarget&&(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),w())},children:[u.jsx("span",{className:x,"aria-hidden":"true"}),u.jsx("span",{className:T,"aria-live":"polite",children:E}),e==="running"&&n.length>0&&u.jsxs("span",{className:"skills-dock-count",children:[n.length," ",n.length===1?"line":"lines"]}),e==="done"&&u.jsx("button",{type:"button",className:"skills-dock-dismiss","aria-label":"Dismiss",onClick:p=>{p.stopPropagation(),m()},children:"✕"}),e==="error"&&u.jsxs(u.Fragment,{children:[g!=null&&u.jsx("button",{type:"button",className:"skills-dock-retry",onClick:p=>{p.stopPropagation(),g()},children:"Retry"}),u.jsx("button",{type:"button",className:"skills-dock-dismiss","aria-label":"Dismiss",onClick:p=>{p.stopPropagation(),m()},children:"✕"})]}),u.jsx("span",{className:`skills-dock-chevron${c?" is-open":""}`,"aria-hidden":"true",children:"▾"})]})]})}const Tj={activeTab:"installed",scope:"project",filterText:"",searchQuery:"",searchResults:[],searchLoading:!1,installedList:[],installedLoading:!1,updateJobId:null,updateJobScope:null,installFormOpenId:null},Lg=new Set;let Zn=Tj;function aa(){for(const e of Lg)e()}function Aj(e){return Lg.add(e),()=>{Lg.delete(e)}}function Yy(){return Zn}function Pm(){return M.useSyncExternalStore(Aj,Yy,Yy)}function Ou(e){Zn={...Zn,activeTab:e},aa()}function Xy(e){Zn={...Zn,scope:e},aa()}function Rj(e){Zn={...Zn,filterText:e},aa()}function Lj(e){Zn={...Zn,searchQuery:e},aa()}function Za(e,n){Zn={...Zn,searchResults:e,searchLoading:n},aa()}function xp(e,n){Zn={...Zn,installedList:e,installedLoading:n},aa()}function Mg(e){Zn={...Zn,installFormOpenId:e},aa()}const Zy=750;function kC(){const[e,n]=M.useState({status:"idle",lines:[]}),i=M.useRef(null),s=M.useCallback(()=>{i.current&&(clearTimeout(i.current),i.current=null)},[]);M.useEffect(()=>()=>s(),[s]);const o=M.useCallback(()=>{s(),n({status:"idle",lines:[]})},[s]),f=M.useCallback((g,c)=>{s(),n({status:"running",lines:[]}),(async()=>{const h=await fetch(g,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)}).catch(()=>null);if(!h?.ok){n({status:"error",lines:[]});return}const{jobId:d}=await h.json();let b=0;const m=async()=>{const w=await fetch(`/plugins/skills/jobs?jobId=${encodeURIComponent(d)}&cursor=${b}`).catch(()=>null);if(!w?.ok){n(T=>({...T,status:"error"}));return}const x=await w.json();b=x.nextCursor,n(T=>({...T,lines:[...T.lines,...x.lines]})),x.status==="running"?i.current=setTimeout(()=>{m()},Zy):n(T=>({...T,status:x.status}))};i.current=setTimeout(()=>{m()},Zy)})()},[s]);return{...e,start:f,reset:o}}const Mj=300,qu=2;function Nj(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}async function Oj(e){if(e.length<qu){Za([],!1);return}Za([],!0);try{const n=await fetch(`/plugins/skills/search?q=${encodeURIComponent(e)}&limit=10`);if(!n.ok){Za([],!1);return}const i=await n.json();Za(i.skills??[],!1)}catch{Za([],!1)}}function Dj({result:e,theaterId:n,isFormOpen:i,onInstallClick:s,onReadMore:o,onInstallStarted:f,jobLog:g}){const c={name:e.name,scope:"project",agents:[],source:e.source,displayPath:""};return u.jsxs("div",{className:`skills-card${i?" is-expanded":""}`,children:[u.jsxs("div",{className:"skills-card-header",children:[u.jsx("button",{type:"button",className:"skills-card-name-btn",onClick:()=>o(c,e.id),title:"Read SKILL.md preview",children:e.name}),e.installs>0&&u.jsx("span",{className:"skills-card-installs",children:Nj(e.installs)})]}),u.jsx("span",{className:"skills-card-meta",children:e.source}),u.jsx("div",{className:"skills-card-actions",children:u.jsx("button",{type:"button",className:"skills-btn skills-btn--primary",onClick:s,children:i?"Cancel":"Install"})}),i&&u.jsx(Ej,{source:e.source,skill:e.name,theaterId:n,onCancel:s,onStarted:h=>f(e.name,h),jobLog:g})]})}function jj({theaterId:e,onReadMore:n,onInstallSuccess:i}){const{searchQuery:s,searchResults:o,searchLoading:f,installFormOpenId:g}=Pm(),c=M.useRef(null),h=kC(),[d,b]=M.useState(null),m=M.useCallback(x=>{if(Lj(x),c.current&&clearTimeout(c.current),x.length<qu){Za([],!1);return}c.current=setTimeout(()=>{Oj(x)},Mj)},[]);M.useEffect(()=>()=>{c.current&&clearTimeout(c.current)},[]),M.useEffect(()=>{h.status!=="done"||!d||(i(d.name,d.scope),Mg(null),b(null))},[h.status,d,i]);const w=d?`Installing ${d.name}…`:"Installing…";return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"skills-tab-body",children:[u.jsx("input",{type:"search",className:"skills-filter-input",placeholder:"Search skills.sh registry…",value:s,onChange:x=>m(x.target.value),"aria-label":"Search skills registry"}),f&&u.jsx("div",{className:"skills-empty-state",children:"Searching…"}),!f&&s.length>=qu&&o.length===0&&u.jsxs("div",{className:"skills-empty-state",children:['No results for "',s,'".']}),!f&&s.length>0&&s.length<qu&&u.jsx("div",{className:"skills-empty-state",children:"Type at least 2 characters to search."}),u.jsx("div",{className:"skills-card-list",children:o.map(x=>u.jsx(Dj,{result:x,theaterId:e,isFormOpen:g===x.id,onInstallClick:()=>Mg(g===x.id?null:x.id),onReadMore:n,onInstallStarted:(T,E)=>b({name:T,scope:E}),jobLog:h},x.id))})]}),u.jsx(EC,{status:h.status,lines:h.lines,runningLabel:w,doneLabel:"Installed",errorLabel:"Install failed",onDismiss:h.reset})]})}const Ij=2600;function Bj({skill:e,onReadMore:n,onUpdate:i,onRemove:s,isUpdating:o}){const[f,g]=M.useState(!1),c=M.useRef(null),h=M.useCallback(()=>{c.current&&(clearTimeout(c.current),c.current=null)},[]),d=M.useCallback(()=>{f?(h(),g(!1),s?.(e.name,e.scope)):(g(!0),c.current=setTimeout(()=>g(!1),Ij))},[f,h,s,e.name,e.scope]);return M.useEffect(()=>()=>h(),[h]),u.jsxs("div",{className:"skills-card",children:[u.jsxs("div",{className:"skills-card-header",children:[u.jsx("button",{type:"button",className:"skills-card-name-btn",onClick:()=>n?.(e),title:"Read SKILL.md",children:e.name}),u.jsx("span",{className:`skills-card-scope-badge skills-card-scope-badge--${e.scope}`,children:e.scope})]}),e.source&&u.jsx("span",{className:"skills-card-meta",children:e.source}),u.jsx("span",{className:"skills-card-meta skills-card-agents",children:e.agents.join(", ")}),u.jsxs("div",{className:"skills-card-actions",children:[i&&u.jsx("button",{type:"button",className:"skills-btn skills-btn--ghost",title:`Updates all ${e.scope} skills`,onClick:()=>i(e.scope),disabled:o,children:o?"Updating…":"Update all"}),s&&u.jsx("button",{type:"button",className:`skills-btn skills-btn--remove${f?" is-armed":""}`,onClick:d,"aria-label":f?`Confirm remove ${e.name}`:`Remove ${e.name}`,children:f?"Remove?":"✕"})]})]})}async function Pj(e){const n=e?`?theaterId=${encodeURIComponent(e)}`:"",i=await fetch(`/plugins/skills/list${n}`);return i.ok?(await i.json()).skills??[]:[]}function zj({theaterId:e,onReadMore:n,refreshKey:i}){const{scope:s,filterText:o,installedList:f,installedLoading:g}=Pm(),c=kC(),h=M.useRef(null),d=M.useCallback(p=>{xp([],!0),Pj(p).then(v=>xp(v,!1)).catch(()=>xp([],!1))},[]);M.useEffect(()=>{d(e)},[e,d,i]),M.useEffect(()=>{(c.status==="done"||c.status==="error")&&d(e)},[c.status,e,d]);const b=M.useCallback(p=>{const v=p;h.current=v;const _={scope:v};e&&(_.theaterId=e),c.start("/plugins/skills/update",_)},[e,c]),m=M.useCallback((p,v)=>{const _={scope:v,skill:p};e&&(_.theaterId=e),fetch("/plugins/skills/remove",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(_)}).then(()=>d(e)).catch(()=>null)},[e,d]),w=M.useCallback(()=>{h.current&&b(h.current)},[b]),x=s==="project"&&!e?"global":s,T=f.filter(p=>p.scope!==x?!1:o?p.name.toLowerCase().includes(o.toLowerCase()):!0),E=c.status==="running"&&h.current===x;return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"skills-tab-body",children:[u.jsxs("div",{className:"skills-scope-toggle",children:[u.jsx("button",{type:"button",className:`skills-scope-btn${x==="project"?" is-active":""}`,onClick:()=>Xy("project"),disabled:!e,title:e?void 0:"Select a Theater to view project skills",children:"Project"}),u.jsx("button",{type:"button",className:`skills-scope-btn${x==="global"?" is-active":""}`,onClick:()=>Xy("global"),children:"Global"})]}),u.jsx("input",{type:"search",className:"skills-filter-input",placeholder:"Filter installed skills…",value:o,onChange:p=>Rj(p.target.value),"aria-label":"Filter installed skills"}),g&&u.jsx("div",{className:"skills-empty-state",children:"Loading…"}),!g&&T.length===0&&u.jsx("div",{className:"skills-empty-state",children:o?"No skills match the filter.":`No ${x} skills installed.`}),u.jsx("div",{className:"skills-card-list",children:T.map(p=>u.jsx(Bj,{skill:p,onReadMore:n,onUpdate:b,onRemove:m,isUpdating:E},`${p.scope}:${p.name}`))})]}),u.jsx(EC,{status:c.status,lines:c.lines,runningLabel:"Updating skills…",doneLabel:"Updated",errorLabel:"Update failed",onDismiss:c.reset,onRetry:w})]})}function Cp(e){for(const n of e.querySelectorAll("a[href]")){const i=n.getAttribute("href")??"";i&&!/^(https?:|mailto:|#)/i.test(i)&&(n.removeAttribute("href"),n.setAttribute("role","link"),n.setAttribute("aria-disabled","true"))}for(const n of e.querySelectorAll("img[src], img[srcset], source[src], source[srcset]"))n.removeAttribute("src"),n.removeAttribute("srcset"),n.tagName==="IMG"&&n.setAttribute("aria-hidden","true")}function Hj({content:e}){const n=M.useMemo(()=>{const o=fh(e).html,f=new DOMParser().parseFromString(o,"text/html");return Cp(f.body),f.body.innerHTML},[e]),i=M.useRef(null);M.useEffect(()=>{const o=i.current;if(!o)return;Cp(o);const f=new MutationObserver(()=>Cp(o));return f.observe(o,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["href","src","srcset"]}),()=>f.disconnect()},[n]);const s=M.useCallback(o=>{const f=o.target.closest('[data-action="copy-code"]');if(!f)return;const g=f.closest("pre")?.getAttribute("data-code");if(!g)return;navigator.clipboard?.writeText(g);const c=f.textContent;f.textContent="Copied",window.setTimeout(()=>{f.textContent=c},1200)},[]);return u.jsx("div",{ref:i,className:"markdown-body",onClick:s,dangerouslySetInnerHTML:{__html:n}})}const $j=["a[href]","button:not([disabled])","input:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(","),Uj="Skills run with full agent permissions. Review before use.";function Fj(e,n){if(!n)return;const i=Array.from(n.querySelectorAll($j)),s=i[0],o=i[i.length-1];!s||!o||(e.shiftKey&&document.activeElement===s?(e.preventDefault(),o.focus()):!e.shiftKey&&document.activeElement===o&&(e.preventDefault(),s.focus()))}function Wj({skill:e,isInstalled:n,theaterId:i,onClose:s,onInstall:o}){const[f,g]=M.useState(null),[c,h]=M.useState(!1),d=M.useRef(null),b=M.useRef(null),m=M.useRef(null);if(M.useEffect(()=>{e&&d.current===null&&(d.current=document.activeElement)},[e]),M.useEffect(()=>{if(!e){g(null);return}h(!0),g(null);let x=!1;return(async()=>{try{let E;if(n){const v={scope:e.scope,skill:e.name};i&&(v.theaterId=i),E=await fetch("/plugins/skills/installed-file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(v)})}else E=await fetch("/plugins/skills/preview",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:e.source,skill:e.name})});if(x)return;if(!E.ok){h(!1);return}const p=await E.json();x||(g(p.markdown??""),h(!1))}catch{x||h(!1)}})(),()=>{x=!0}},[e,n,i]),M.useEffect(()=>{if(!e)return;const x=T=>{T.key==="Escape"?(T.preventDefault(),s()):T.key==="Tab"&&Fj(T,m.current),T.stopImmediatePropagation()};return b.current?.focus(),window.addEventListener("keydown",x,!0),()=>{window.removeEventListener("keydown",x,!0);const T=d.current;d.current=null,T?.focus?.()}},[e,s]),M.useEffect(()=>{if(e)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[e]),!e)return null;const w=e.displayPath||e.source||null;return Cs.createPortal(u.jsx("div",{className:"skills-overlay-backdrop",onClick:s,"aria-hidden":"true",children:u.jsxs("div",{ref:m,role:"dialog","aria-modal":"true","aria-label":`${e.name} SKILL.md`,className:"skills-overlay-dialog",onClick:x=>x.stopPropagation(),children:[u.jsxs("div",{className:"skills-overlay-header",children:[u.jsx("span",{className:"skills-overlay-title",children:e.name}),w&&u.jsx("span",{className:"skills-overlay-meta",children:w}),u.jsx("button",{ref:b,type:"button",className:"skills-overlay-close",onClick:s,"aria-label":"Close",children:"✕"})]}),u.jsxs("div",{className:"skills-overlay-body",children:[c&&u.jsx("div",{className:"skills-empty-state",children:"Loading SKILL.md…"}),!c&&f===null&&u.jsx("div",{className:"skills-empty-state",children:"Could not load SKILL.md."}),f!==null&&u.jsx(Hj,{content:f})]}),u.jsxs("div",{className:"skills-overlay-footer",children:[u.jsx("p",{className:"skills-permission-warning",children:Uj}),!n&&u.jsx("button",{type:"button",className:"skills-btn skills-btn--primary",onClick:()=>{s(),o()},children:"Install"})]})]})}),document.body)}const Gj=3200;function qj({message:e,onDismiss:n}){return M.useEffect(()=>{if(!e)return;const i=setTimeout(n,Gj);return()=>clearTimeout(i)},[e,n]),e?u.jsx("div",{className:"skills-toast",role:"status","aria-live":"polite",children:e}):null}function Kj({ctx:e}){const{theaterId:n}=e,{activeTab:i,installedList:s}=Pm(),[o,f]=M.useState(null),[g,c]=M.useState(null),[h,d]=M.useState(0),b=s.length,m=M.useCallback(E=>{f({skill:E,isInstalled:!0})},[]),w=M.useCallback((E,p)=>{f({skill:E,isInstalled:!1,registryId:p})},[]),x=M.useCallback((E,p)=>{c(`Installed ${E} to ${p}`),d(v=>v+1),Ou("installed")},[]),T=M.useCallback(()=>{o?.registryId&&(Mg(o.registryId),Ou("find")),f(null)},[o]);return u.jsxs("div",{className:"skills-root",children:[u.jsxs("div",{className:"skills-tab-bar",role:"tablist","aria-label":"Skills panels",children:[u.jsxs("button",{type:"button",role:"tab","aria-selected":i==="installed",className:`skills-tab-btn${i==="installed"?" is-active":""}`,onClick:()=>Ou("installed"),children:["Installed",b>0?` ${b}`:""]}),u.jsx("button",{type:"button",role:"tab","aria-selected":i==="find",className:`skills-tab-btn${i==="find"?" is-active":""}`,onClick:()=>Ou("find"),children:"Find"})]}),i==="installed"?u.jsx(zj,{theaterId:n,onReadMore:m,refreshKey:h}):u.jsx(jj,{theaterId:n,onReadMore:w,onInstallSuccess:x}),u.jsx(qj,{message:g,onDismiss:()=>c(null)}),u.jsx(Wj,{skill:o?.skill??null,isInstalled:o?.isInstalled??!1,theaterId:n,onClose:()=>f(null),onInstall:T})]})}function Vj(){return u.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",children:u.jsx("path",{d:"M9 2L10.854 6.764L16 7.236L12.25 10.764L13.416 16L9 13.25L4.584 16L5.75 10.764L2 7.236L7.146 6.764Z",stroke:"currentColor",strokeWidth:"1.4",strokeLinejoin:"round"})})}const Yj={id:"skills",title:"Skills",icon:Vj,render:e=>u.jsx(Kj,{ctx:e})},Xj={id:"skills",railPanels:[Yj]},Zj=[Xj],TC=[...z4,...$D,...wj,...Zj],Jj=RC(TC),AC=M.createContext(Jj),Qj=AC.Provider;async function e8(){const e=[...TC],n=new Set(e.map(s=>s.id)),i=await t8();for(const s of i){if(n.has(s.id)){console.warn(`Skipping external plugin with duplicate id: ${s.id}`);continue}const o=await n8(s);if(o){if(n.has(o.id)){console.warn(`Skipping external plugin with duplicate id: ${o.id}`);continue}n.add(o.id),e.push(o)}}return RC(e)}function ic(){return M.useContext(AC)}async function t8(){try{const e=await fetch("/plugin-runtime/manifest");if(!e.ok)return console.warn(`Plugin runtime manifest unavailable: ${e.status}`),[];const n=await e.json();return Array.isArray(n.plugins)?n.plugins.filter(r8):[]}catch(e){return console.warn("Plugin runtime manifest failed to load.",e),[]}}async function n8(e){try{const n=await import(e.clientUrl),i=n.default??n.plugin;return i8(i)?i:(console.warn(`Skipping external plugin with invalid client module: ${e.id}`),null)}catch(n){return console.warn(`Skipping external plugin after client load failure: ${e.id}`,n),null}}function RC(e){const n=new Set,i=[];for(const s of e)for(const o of s.railPanels??[]){if(n.has(o.id)){console.warn(`Skipping rail panel with duplicate id: ${o.id}`);continue}n.add(o.id),i.push(o)}return{plugins:e,operationKinds:e.flatMap(s=>s.operationKinds??[]),settingsSections:e.flatMap(s=>s.settingsSections??[]),notificationKinds:e.flatMap(s=>s.notificationKinds??[]),railPanels:i}}function i8(e){return typeof e=="object"&&e!==null&&typeof e.id=="string"}function r8(e){if(typeof e!="object"||e===null)return!1;const n=e;return typeof n.id=="string"&&typeof n.clientUrl=="string"&&Number.isInteger(n.apiVersion)}const s8=new Set(["token","credential","cwd","path","persona","prompt","toolAllowlist","allowedExecutorTools"]);async function LC(e){const n=await fetch("/api/v1/settings/carriers",{signal:e});return await Hm(n),MC(await n.json(),n.status)}async function a8(e){const n=await fetch("/api/v1/settings/carriers/options",{signal:e});return await Hm(n),c8(await n.json(),n.status)}async function Ep(e,n,i){return zm(`/api/v1/settings/carriers/${encodeURIComponent(e)}`,"PATCH",n,i)}async function o8(e,n,i,s){return zm(`/api/v1/settings/carriers/${encodeURIComponent(e)}/taskforce/${encodeURIComponent(n)}`,"PUT",i,s)}async function l8(e,n,i){return zm(`/api/v1/settings/carriers/${encodeURIComponent(e)}/taskforce/${encodeURIComponent(n)}`,"DELETE",{},i)}async function zm(e,n,i,s){const o=await fetch(e,{method:n,headers:{"Content-Type":"application/json"},body:JSON.stringify(i),signal:s});await Hm(o);const f=await o.json();if(!f||typeof f!="object"||!("state"in f))throw new ct(o.status,"Invalid carrier settings mutation response");return{state:MC(f.state,o.status)}}async function Hm(e){if(e.ok)return;let n=e.statusText||`HTTP ${e.status}`;try{const i=await e.json();typeof i.error=="string"&&(n=i.error)}catch{}throw new ct(e.status,n)}function MC(e,n){NC(e,n);const i=e;if(!i||typeof i.generation!="number"||!Array.isArray(i.carriers))throw new ct(n,"Invalid carrier settings state response");return{generation:i.generation,carriers:i.carriers.map(s=>u8(s,n))}}function c8(e,n){NC(e,n);const i=e;if(!i||!Array.isArray(i.cliTypes)||!i.taskForceConstraints||typeof i.taskForceConstraints.minBackends!="number")throw new ct(n,"Invalid carrier settings options response");return{cliTypes:i.cliTypes.map(s=>h8(s,n)),taskForceConstraints:{minBackends:i.taskForceConstraints.minBackends}}}function u8(e,n){const i=e;if(!i||typeof i.carrierId!="string"||typeof i.displayName!="string"||typeof i.sourceDisplayName!="string"||typeof i.role!="string"||typeof i.roleDescription!="string"||typeof i.slot!="number"||typeof i.cliType!="string"||typeof i.defaultCliType!="string"||typeof i.model!="string"||i.effort!==void 0&&typeof i.effort!="string"||typeof i.taskForceBackendCount!="number"||!i.taskforce||!Array.isArray(i.taskforce.backends))throw new ct(n,"Invalid carrier settings carrier response");return{carrierId:i.carrierId,displayName:i.displayName,sourceDisplayName:i.sourceDisplayName,role:i.role,roleDescription:i.roleDescription,...i.category?{category:i.category}:{},slot:i.slot,cliType:i.cliType,defaultCliType:i.defaultCliType,model:i.model,...i.effort?{effort:i.effort}:{},taskForceBackendCount:i.taskForceBackendCount,taskforce:{backends:i.taskforce.backends.map(s=>f8(s,n))}}}function h8(e,n){const i=e;if(!i||typeof i.id!="string"||typeof i.displayName!="string"||!Array.isArray(i.models)||typeof i.defaultModel!="string")throw new ct(n,"Invalid carrier settings CLI option");return{id:i.id,displayName:i.displayName,models:i.models.map(s=>d8(s,n)),defaultModel:i.defaultModel}}function d8(e,n){const i=e;if(!i||typeof i.modelId!="string"||typeof i.name!="string")throw new ct(n,"Invalid carrier settings model option");if(i.effort!==void 0&&(!Array.isArray(i.effort.levels)||typeof i.effort.default!="string"))throw new ct(n,"Invalid carrier settings effort option");return{modelId:i.modelId,name:i.name,...i.effort?{effort:{levels:i.effort.levels.filter(s=>typeof s=="string"),default:i.effort.default}}:{}}}function f8(e,n){const i=e;if(!i||typeof i.cliType!="string"||typeof i.model!="string"||i.effort!==void 0&&typeof i.effort!="string")throw new ct(n,"Invalid carrier settings Task Force backend");return{cliType:i.cliType,model:i.model,...i.effort?{effort:i.effort}:{}}}function NC(e,n){const i=[e];for(;i.length>0;){const s=i.pop();if(!(!s||typeof s!="object"))for(const[o,f]of Object.entries(s)){if(s8.has(o))throw new ct(n,"Carrier settings response leaked a restricted field");f&&typeof f=="object"&&i.push(f)}}}const p8={cliType:"",model:"",effort:"",displayName:"",taskforce:{}},Ng=new Set;let Bn={loading:!1,state:null,options:null,activeCarrierId:null,draft:p8,savingActionId:null,error:null};function OC(){return M.useSyncExternalStore(g8,Jy,Jy)}function Jy(){return Bn}function g8(e){return Ng.add(e),()=>{Ng.delete(e)}}async function Qy(e){lr({loading:!0,error:null});try{const[n,i]=await Promise.all([LC(e),a8(e)]);DC(n,i)}catch(n){if(e?.aborted)return;lr({loading:!1,error:IC(n)})}}function m8(e){const n=Bn.state?.carriers.find(i=>i.carrierId===e);lr({activeCarrierId:e,draft:n?$m(n,Bn.options):Bn.draft,error:null})}function no(e){lr({draft:{...Bn.draft,...e},error:null})}function Og(e,n){const i=Bn.draft.taskforce[e]??{model:"",effort:""};lr({draft:{...Bn.draft,taskforce:{...Bn.draft.taskforce,[e]:{...i,...n}}},error:null})}function _8(){const e=jC();e&&lr({draft:$m(e,Bn.options),error:null})}async function v8(e){const n=jC();return n?b8("save-all",async()=>{const i=Bn.draft;let s=null;i.displayName!==n.displayName&&(s=(await Ep(n.carrierId,{displayName:i.displayName})).state);const o=i.cliType!==n.cliType;return o&&(s=(await Ep(n.carrierId,{cli:i.cliType})).state),(o||i.model!==n.model||(i.effort||"")!==(n.effort||""))&&(s=(await Ep(n.carrierId,{model:S8(i)})).state),s=await w8(n,e,s),{state:s??await LC()}}):!1}function DC(e,n){const i=x8(e,Bn.activeCarrierId),s=e.carriers.find(o=>o.carrierId===i)??null;lr({loading:!1,state:e,options:n,activeCarrierId:i,draft:s?$m(s,n):Bn.draft,error:null})}async function b8(e,n){lr({savingActionId:e,error:null});try{const i=await n();return DC(i.state,Bn.options??{cliTypes:[],taskForceConstraints:{minBackends:2}}),lr({savingActionId:null}),!0}catch(i){return lr({savingActionId:null,error:IC(i)}),!1}}function $m(e,n){const i=Object.fromEntries((n?.cliTypes??[]).map(s=>{const o=e.taskforce.backends.find(f=>f.cliType===s.id);return[s.id,{model:o?.model??s.defaultModel,effort:o?.effort??y8(s.id,o?.model??s.defaultModel,n)??""}]}));return{cliType:e.cliType,model:e.model,effort:e.effort??"",displayName:e.displayName,taskforce:i}}function y8(e,n,i){return i?.cliTypes.find(f=>f.id===e)?.models.find(f=>f.modelId===n)?.effort?.default??null}function S8(e){return{model:e.model,...e.effort?{effort:e.effort}:{}}}function jC(){return Bn.state?.carriers.find(e=>e.carrierId===Bn.activeCarrierId)??null}async function w8(e,n,i){const s=new Set(n.map(o=>o.cliType));for(const o of e.taskforce.backends)s.has(o.cliType)||(i=(await l8(e.carrierId,o.cliType)).state);for(const o of n){const f=e.taskforce.backends.find(g=>g.cliType===o.cliType);f&&f.model===o.model&&(f.effort||"")===(o.effort||"")||(i=(await o8(e.carrierId,o.cliType,{model:o.model,...o.effort?{effort:o.effort}:{}})).state)}return i}function x8(e,n){return n&&e.carriers.some(i=>i.carrierId===n)?n:e.carriers[0]?.carrierId??null}function lr(e){Bn={...Bn,...e};for(const n of Ng)n()}function IC(e){return e instanceof Error?e.message:String(e)}const C8=50,E8=2400,k8={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 T8(){const e=OC(),n=e.state?.carriers.find(E=>E.carrierId===e.activeCarrierId)??null,i=e.options?.cliTypes.find(E=>E.id===e.draft.cliType)??null,s=i?.models.find(E=>E.modelId===e.draft.model)??null,[o,f]=M.useState(!1),[g,c]=M.useState([]),[h,d]=M.useState("idle"),b=e.savingActionId==="save-all",m=n?O8(n,e.draft,g):!1,w=n?.taskforce.backends.map(E=>`${E.cliType}:${E.model}:${E.effort??""}`).join("|")??"";M.useEffect(()=>{const E=new AbortController;return Qy(E.signal),()=>E.abort()},[]),M.useEffect(()=>{f(!1),c(n?.taskforce.backends.map(E=>E.cliType)??[]),d("idle")},[n?.carrierId,w]),M.useEffect(()=>{if(h!=="saved")return;const E=window.setTimeout(()=>d("idle"),E8);return()=>window.clearTimeout(E)},[h]);function x(){n&&(_8(),c(n.taskforce.backends.map(E=>E.cliType)),f(!1),d("idle"))}async function T(){if(!n)return;if(d("saving"),!await v8(j8(g,e.draft.taskforce))){d("idle");return}f(!1),d("saved")}return u.jsxs("main",{className:"carrier-settings-page",children:[u.jsxs("section",{className:"carrier-settings-hero","aria-labelledby":"carrier-settings-title",children:[u.jsxs("div",{children:[u.jsx("p",{className:"bridge-kicker",children:"Carrier Control Surface"}),u.jsx("h2",{id:"carrier-settings-title",children:"Carrier Settings"})]}),u.jsxs("div",{className:"carrier-settings-hero-actions",children:[u.jsx("div",{className:`carrier-settings-save-status ${h==="saved"?"is-positive":""}`,role:"status","aria-live":"polite",children:h==="saving"||b?"Saving…":h==="saved"?"Saved ✓":""}),n?u.jsxs("div",{className:"carrier-settings-save-actions",children:[u.jsx("button",{type:"button",className:`carrier-settings-action-button ${m?"is-dirty":""}`,disabled:!m||b,onClick:()=>{T()},children:"Save"}),u.jsx("button",{type:"button",className:`carrier-settings-action-button ${m?"is-dirty":""}`,disabled:!m||b,onClick:x,children:"Discard"})]}):null,u.jsx("button",{type:"button",className:"carrier-settings-action-button carrier-settings-hero-refresh",disabled:e.loading,onClick:()=>{Qy()},children:"Refresh"})]})]}),e.error?u.jsx("p",{className:"carrier-settings-error",role:"alert",children:e.error}):null,u.jsxs("section",{className:"carrier-settings-grid",children:[u.jsxs("div",{className:"carrier-settings-list","aria-label":"Carrier list",children:[e.loading&&!e.state?u.jsx("p",{className:"carrier-settings-empty",children:"Loading carrier settings."}):null,e.state&&e.state.carriers.length===0?u.jsx("p",{className:"carrier-settings-empty",children:"No carriers registered."}):null,e.state?.carriers.map(E=>u.jsx(A8,{carrier:E,active:E.carrierId===e.activeCarrierId,minBackends:e.options?.taskForceConstraints.minBackends??2,onSelect:()=>m8(E.carrierId)},E.carrierId))]}),n&&e.options&&i?u.jsxs("div",{className:"carrier-settings-detail",style:zC(n.carrierId),children:[u.jsxs("div",{className:"carrier-settings-detail-head",children:[u.jsxs("div",{className:"carrier-settings-detail-title-block",children:[u.jsxs("div",{className:"carrier-settings-captain-id",children:[u.jsx("span",{children:"Captain"})," · ",n.carrierId.toUpperCase()]}),u.jsx("div",{className:`carrier-settings-name-line ${o?"is-editing":""}`,children:o?u.jsxs(u.Fragment,{children:[u.jsx("input",{id:"carrier-display-name",className:"carrier-settings-input carrier-settings-name-input",value:e.draft.displayName,maxLength:C8,onChange:E=>no({displayName:E.target.value})}),u.jsx("button",{type:"button",className:"carrier-settings-icon-button","aria-label":"Save display name",disabled:b,onClick:()=>{f(!1)},children:u.jsx(B8,{})}),u.jsx("button",{type:"button",className:"carrier-settings-icon-button","aria-label":"Cancel display name edit",onClick:()=>{no({displayName:n.displayName}),f(!1)},children:u.jsx(P8,{})})]}):u.jsxs(u.Fragment,{children:[u.jsx("h3",{className:"carrier-settings-captain-name",children:n.displayName}),u.jsx("button",{type:"button",className:"carrier-settings-icon-button","aria-label":"Edit display name",onClick:()=>{no({displayName:n.displayName}),f(!0)},children:u.jsx(I8,{})})]})}),u.jsx("div",{className:"carrier-settings-captain-role",children:n.role})]}),u.jsxs("div",{className:"carrier-settings-cli-badge",children:[u.jsx("span",{className:"ind","aria-hidden":"true"}),n.cliType]})]}),u.jsxs("div",{className:"carrier-settings-body",children:[u.jsxs("div",{className:"carrier-settings-control-group",children:[u.jsx("div",{className:"carrier-settings-resp-title",children:"Identity"}),u.jsxs("div",{className:"carrier-settings-mission",children:['"',n.roleDescription,'"']})]}),u.jsxs("div",{className:"carrier-settings-control-group",children:[u.jsx("div",{className:"carrier-settings-resp-title",children:"Runtime"}),u.jsxs("div",{className:"carrier-settings-runtime",children:[u.jsx("div",{className:"carrier-settings-runtime-row carrier-settings-runtime-row--cli",children:u.jsxs("div",{className:"carrier-settings-field carrier-settings-field--wide",children:[u.jsx("label",{className:"carrier-settings-label",htmlFor:"carrier-cli",children:"CLI"}),u.jsx("select",{id:"carrier-cli",className:"carrier-settings-select",value:e.draft.cliType,onChange:E=>L8(E.target.value,e.options?.cliTypes??[]),children:e.options.cliTypes.map(E=>u.jsx("option",{value:E.id,children:E.displayName},E.id))})]})}),u.jsxs("div",{className:"carrier-settings-runtime-row carrier-settings-runtime-row--model",children:[u.jsx(BC,{id:"carrier-model",label:"Model",models:i.models,value:e.draft.model,onChange:E=>M8(i,E)}),u.jsx(PC,{id:"carrier-effort",model:s,value:e.draft.effort,onChange:E=>no({effort:E})})]})]})]}),u.jsx(R8,{carrier:n,cliOptions:e.options.cliTypes,minBackends:e.options.taskForceConstraints.minBackends,savingActionId:e.savingActionId,rows:g,onRowsChange:c})]})]},n.carrierId):u.jsx("div",{className:"carrier-settings-detail",children:u.jsx("p",{className:"carrier-settings-empty",children:"Select a carrier."})})]})]})}function A8({carrier:e,active:n,minBackends:i,onSelect:s}){const o=e.taskForceBackendCount>=i;return u.jsxs("button",{type:"button",className:`carrier-settings-row ${n?"is-active":""}`,style:zC(e.carrierId),onClick:s,children:[u.jsx("span",{className:"carrier-settings-captain-dot","aria-hidden":"true"}),u.jsxs("span",{className:"carrier-settings-row-text",children:[u.jsx("span",{className:"carrier-settings-row-name",children:e.displayName}),u.jsx("span",{className:"carrier-settings-row-role",children:e.role})]}),u.jsx("span",{className:"carrier-settings-row-live","aria-hidden":"true",children:u.jsx("span",{className:`carrier-settings-live-dot ${o?"is-live":""}`})})]})}function BC({id:e,label:n,models:i,value:s,disabled:o=!1,onChange:f}){return u.jsxs("div",{className:"carrier-settings-field",children:[u.jsx("label",{className:"carrier-settings-label",htmlFor:e,children:n}),u.jsx("select",{id:e,className:"carrier-settings-select",value:s,disabled:o,onChange:g=>f(g.target.value),children:i.map(g=>u.jsx("option",{value:g.modelId,children:g.name},g.modelId))})]})}function PC({id:e,model:n,value:i,disabled:s=!1,onChange:o}){return n?.effort?u.jsxs("div",{className:"carrier-settings-field",children:[u.jsx("label",{className:"carrier-settings-label",htmlFor:e,children:"Effort"}),u.jsx("select",{id:e,className:"carrier-settings-select",value:i||n.effort.default,disabled:s,onChange:f=>o(f.target.value),children:n.effort.levels.map(f=>u.jsx("option",{value:f,children:f},f))})]}):u.jsxs("div",{className:"carrier-settings-field",children:[u.jsx("span",{className:"carrier-settings-label",children:"Effort"}),u.jsx("p",{className:"carrier-settings-help",children:"Not supported for this model."})]})}function R8({carrier:e,cliOptions:n,minBackends:i,savingActionId:s,rows:o,onRowsChange:f}){const g=OC(),c=e.taskforce.backends.length,[h,d]=M.useState(c>0),[b,m]=M.useState(!1),[w,x]=M.useState(""),T=e.taskForceBackendCount>=i,E=n.filter(v=>!o.includes(v.id)),p=w||E[0]?.id||"";return u.jsxs("div",{className:`carrier-settings-control-group carrier-settings-control-group--taskforce ${h?"is-expanded":""}`,children:[u.jsxs("div",{className:"carrier-settings-section-head",children:[u.jsxs("div",{children:[u.jsx("p",{className:"carrier-settings-resp-title",children:"Task Force"}),u.jsx("p",{className:"carrier-settings-help",children:c>0?`${c} backend${c===1?"":"s"} configured${T?" · active":` · needs ${i}+ to activate`}.`:`Run this carrier across multiple CLI backends. Needs at least ${i} to activate.`})]}),u.jsx("div",{className:"carrier-settings-tf-head-actions",children:u.jsx("button",{type:"button",className:"carrier-settings-tf-toggle","aria-expanded":h,onClick:()=>d(v=>!v),children:h?"Hide":"Configure"})})]}),h?u.jsxs("div",{className:"carrier-settings-tf-list",children:[o.length===0?u.jsx("p",{className:"carrier-settings-tf-empty",children:"No Task Force backend drafted."}):null,o.map(v=>{const _=n.find(R=>R.id===v);if(!_)return null;const S=g.draft.taskforce[_.id]??{model:_.defaultModel,effort:""},k=_.models.find(R=>R.modelId===S.model)??_.models[0]??null,L=e.taskforce.backends.some(R=>R.cliType===_.id);return u.jsxs("div",{className:`carrier-settings-tf-item ${L?"is-active":""}`,children:[u.jsxs("div",{className:"carrier-settings-tf-title",children:[u.jsx("span",{className:`carrier-settings-live-dot ${L?"is-live":""}`,"aria-hidden":"true"}),u.jsx("strong",{children:_.displayName})]}),u.jsx(BC,{id:`tf-${_.id}-model`,label:"Model",models:_.models,value:S.model,onChange:R=>N8(_,R)}),u.jsx(PC,{id:`tf-${_.id}-effort`,model:k,value:S.effort,onChange:R=>Og(_.id,{effort:R})}),u.jsx("div",{className:"carrier-settings-tf-actions",children:u.jsx("button",{type:"button",className:"carrier-settings-ghost-button",disabled:s==="save-all",onClick:()=>f(o.filter(R=>R!==_.id)),children:"Remove"})})]},_.id)}),u.jsxs("div",{className:"carrier-settings-tf-add-row",children:[b&&E.length>0?u.jsx("select",{className:"carrier-settings-select carrier-settings-tf-add-select",value:p,onChange:v=>x(v.target.value),"aria-label":"Task Force CLI to add",children:E.map(v=>u.jsx("option",{value:v.id,children:v.displayName},v.id))}):null,u.jsx("button",{type:"button",className:"carrier-settings-ghost-button",disabled:E.length===0||s==="save-all",onClick:()=>{if(!b){m(!0);return}const v=p,_=n.find(k=>k.id===v),S=_?.models.find(k=>k.modelId===_.defaultModel)??_?.models[0]??null;!_||!S||(Og(_.id,{model:S.modelId,effort:S.effort?.default??""}),f(o.includes(_.id)?o:[...o,_.id]),x(""),m(!1))},children:"Add"})]})]}):null]})}function L8(e,n){const i=n.find(o=>o.id===e),s=i?.models.find(o=>o.modelId===i.defaultModel)??i?.models[0]??null;no({cliType:e,model:s?.modelId??"",effort:s?.effort?.default??""})}function M8(e,n){const i=e.models.find(s=>s.modelId===n);no({model:n,effort:i?.effort?.default??""})}function N8(e,n){const i=e.models.find(s=>s.modelId===n);Og(e.id,{model:n,effort:i?.effort?.default??""})}function O8(e,n,i){return n.displayName!==e.displayName||n.cliType!==e.cliType||n.model!==e.model||(n.effort||"")!==(e.effort||"")?!0:D8(e,i,n.taskforce)}function D8(e,n,i){if(n.length!==e.taskforce.backends.length)return!0;const s=new Set(n);for(const o of e.taskforce.backends){if(!s.has(o.cliType))return!0;const f=i[o.cliType];if(!f||f.model!==o.model||(f.effort||"")!==(o.effort||""))return!0}return!1}function j8(e,n){return e.map(i=>{const s=n[i];return s?{cliType:i,model:s.model,...s.effort?{effort:s.effort}:{}}:null}).filter(i=>i!==null)}function zC(e){return{"--cap-color":k8[e]??"var(--brass)"}}function I8(){return u.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[u.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"}),u.jsx("path",{d:"M9.7 3.4 12.6 6.3"})]})}function B8(){return u.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:u.jsx("path",{d:"M3 8.3 6.4 11.7 13.2 4.5"})})}function P8(){return u.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[u.jsx("path",{d:"M4.2 4.2 11.8 11.8"}),u.jsx("path",{d:"M11.8 4.2 4.2 11.8"})]})}async function z8(e){const n=await fetch("/api/v1/settings/api-catalog",{signal:e});return await H8(n),$8(await n.json(),n.status).routes}async function H8(e){if(e.ok)return;let n=e.statusText||`HTTP ${e.status}`;try{const i=await e.json();typeof i.error=="string"&&(n=i.error)}catch{}throw new ct(e.status,n)}function $8(e,n){const i=e;if(!i||typeof i!="object"||!("version"in i)||!Array.isArray(i.routes))throw new ct(n,"Invalid backend API catalog response");return{routes:i.routes.map(s=>U8(s,n))}}function U8(e,n){const i=e;if(!i||typeof i!="object"||typeof i.method!="string"||typeof i.path!="string"||typeof i.summary!="string"||typeof i.category!="string"||typeof i.gate!="string")throw new ct(n,"Invalid backend API catalog entry");return{method:i.method,path:i.path,summary:i.summary,category:i.category,gate:i.gate}}const Dg=new Set;let jg={loading:!1,state:null,error:null};function F8(){return M.useSyncExternalStore(W8,eS,eS)}function eS(){return jg}function W8(e){return Dg.add(e),()=>{Dg.delete(e)}}async function G8(e){kp({loading:!0,error:null});try{const n=await z8(e);kp({loading:!1,state:n,error:null})}catch(n){if(e?.aborted)return;kp({loading:!1,error:q8(n)})}}function kp(e){jg={...jg,...e};for(const n of Dg)n()}function q8(e){return e instanceof Error?e.message:String(e)}function K8(){const e=F8(),[n,i]=M.useState(!0),s=M.useMemo(()=>X8(e.state??[]),[e.state]),o=e.state?.length??0,f=s.length;return M.useEffect(()=>{const g=new AbortController;return G8(g.signal),()=>g.abort()},[]),u.jsxs("section",{className:"global-settings-card backend-api-section","aria-label":"Backend API catalog",children:[u.jsx("div",{className:`backend-api-control carrier-settings-control-group--taskforce ${n?"is-expanded":""}`,children:u.jsxs("div",{className:"carrier-settings-section-head",children:[u.jsxs("div",{className:"backend-api-head",children:[u.jsx("p",{className:"global-settings-resp-title",children:"Backend API"}),u.jsx("p",{className:"global-settings-help",children:o>0?`${o} loopback route${o===1?"":"s"} across ${f} categor${f===1?"y":"ies"} reported by backend introspection.`:"Backend introspection route list for this console."})]}),u.jsx("div",{className:"carrier-settings-tf-head-actions",children:u.jsx("button",{type:"button",className:"carrier-settings-tf-toggle","aria-expanded":n,onClick:()=>i(g=>!g),children:n?"Hide":"Show"})})]})}),e.error?u.jsx("p",{className:"global-settings-error",role:"alert",children:e.error}):null,e.loading&&!e.state?u.jsx("p",{className:"global-settings-help",children:"Loading backend API catalog."}):null,n?u.jsxs("div",{className:"backend-api-groups",children:[s.length>0?s.map(g=>u.jsx(V8,{group:g},g.category)):null,e.state&&s.length===0?u.jsx("p",{className:"global-settings-help",children:"No backend API routes reported."}):null]}):null,u.jsx("p",{className:"global-settings-foot",children:"Console backend routes are fetched from GET /api/v1/settings/api-catalog, so newly registered routes appear here automatically. The Codex/Fleet Wiki API surface is not included."})]})}function V8({group:e}){return u.jsxs("div",{className:"backend-api-group",children:[u.jsxs("div",{className:"backend-api-group-head",children:[u.jsx("span",{children:e.category}),u.jsx("span",{children:e.entries.length})]}),u.jsx("div",{className:"backend-api-list",children:e.entries.map(n=>u.jsx(Y8,{entry:n},`${n.method}:${n.path}`))})]})}function Y8({entry:e}){return u.jsxs("div",{className:"backend-api-row",children:[u.jsx("span",{className:"backend-api-method",children:e.method.toUpperCase()}),u.jsx("code",{className:"backend-api-path",children:e.path}),u.jsx("span",{className:"backend-api-summary",children:e.summary}),u.jsx("span",{className:"backend-api-gate",children:e.gate})]})}function X8(e){const n=new Map;for(const i of e){const s=i.category.trim()||"Uncategorized",o=n.get(s);o?o.push(i):n.set(s,[i])}return Array.from(n.entries()).map(([i,s])=>({category:i,entries:s}))}async function HC(e){const n=await fetch("/api/v1/settings/global",{signal:e});return await $C(n),UC(await n.json(),n.status)}async function Z8(e,n){const i=await fetch("/api/v1/settings/global",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:n});await $C(i);const s=await i.json();if(!s||typeof s!="object"||!("state"in s))throw new ct(i.status,"Invalid global settings mutation response");return{state:UC(s.state,i.status)}}async function $C(e){if(e.ok)return;let n=e.statusText||`HTTP ${e.status}`;try{const i=await e.json();typeof i.error=="string"&&(n=i.error)}catch{}throw new ct(e.status,n)}function UC(e,n){const i=e;if(!i||i.consolePortMode!=="dynamic"&&i.consolePortMode!=="static"||i.consoleStaticPort!==null&&!J8(i.consoleStaticPort)||i.theme!=="maritime"&&i.theme!=="carbon")throw new ct(n,"Invalid global settings state response");return{consolePortMode:i.consolePortMode,consoleStaticPort:i.consoleStaticPort,theme:i.theme}}function J8(e){return typeof e=="number"&&Number.isInteger(e)&&e>=1024&&e<=65535}const Ig=new Set;let Bg={loading:!1,state:null,savingField:null,error:null};function Q8(){return M.useSyncExternalStore(e7,tS,tS)}function tS(){return Bg}function e7(e){return Ig.add(e),()=>{Ig.delete(e)}}async function t7(e){uo({loading:!0,error:null});try{const n=await HC(e);uo({loading:!1,state:n,error:null})}catch(n){if(e?.aborted)return;uo({loading:!1,error:FC(n)})}}async function Pg(e,n){uo({savingField:e,error:null});try{const i=await Z8({[e]:n});return uo({state:i.state,savingField:null,error:null}),!0}catch(i){return uo({savingField:null,error:FC(i)}),!1}}function uo(e){Bg={...Bg,...e};for(const n of Ig)n()}function FC(e){return e instanceof Error?e.message:String(e)}const n7=[{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)"]}],i7=[{id:"dynamic",label:"Dynamic"},{id:"static",label:"Static"}],r7=1024,s7=65535,a7=[{id:"general",label:"General",eyebrow:"Theme · Port"},{id:"backend-api",label:"Backend API",eyebrow:"Loopback routes"}];function o7(){const e=Q8(),n=e.state,i=e.savingField!==null,[s,o]=M.useState("general"),f=ic(),g=c7(f.plugins),c=u7(g);return M.useEffect(()=>{const h=new AbortController;return t7(h.signal),()=>h.abort()},[]),u.jsxs("main",{className:"global-settings-page",children:[u.jsxs("section",{className:"global-settings-hero","aria-labelledby":"global-settings-title",children:[u.jsxs("div",{children:[u.jsx("p",{className:"bridge-kicker",children:"Fleet Control Surface"}),u.jsx("h2",{id:"global-settings-title",children:"Settings"})]}),u.jsx("div",{className:"global-settings-status",role:"status","aria-live":"polite",children:i?"Saving…":""})]}),e.error?u.jsx("p",{className:"global-settings-error",role:"alert",children:e.error}):null,u.jsxs("section",{className:"global-settings-grid",children:[u.jsxs("div",{className:"global-settings-list","aria-label":"Settings sections",children:[u.jsx("p",{className:"global-settings-nav-group",children:"Console"}),a7.map(h=>u.jsxs("button",{type:"button",className:`global-settings-nav-item ${h.id===s?"is-active":""}`,"aria-pressed":h.id===s,onClick:()=>o(h.id),children:[u.jsx("span",{className:"global-settings-nav-label",children:h.label}),u.jsx("span",{className:"global-settings-nav-eyebrow",children:h.eyebrow})]},h.id)),g.length>0?u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"global-settings-nav-group",children:"Plugins"}),c.map(h=>u.jsxs("div",{className:"global-settings-plugin-group",children:[u.jsx("p",{className:"global-settings-plugin-heading",children:h.pluginLabel}),h.sections.map(d=>u.jsxs("button",{type:"button",className:`global-settings-nav-item ${d.id===s?"is-active":""}`,"aria-pressed":d.id===s,onClick:()=>o(d.id),children:[u.jsx("span",{className:"global-settings-nav-label",children:d.sectionTitle}),u.jsx("span",{className:"global-settings-nav-eyebrow",children:d.pluginLabel})]},d.id))]},h.pluginId))]}):null]}),u.jsx("div",{className:"global-settings-detail",children:l7(s,n,i,g)},s)]})]})}function l7(e,n,i,s){if(e.includes(":")){const o=s.find(f=>f.id===e);return o?.render?u.jsx(Xg,{fallback:u.jsx("div",{className:"fc-plugin-error",children:"Plugin settings failed to render."}),children:o.render()}):u.jsx("p",{className:"global-settings-help",children:"Plugin settings unavailable."})}switch(e){case"general":return u.jsxs(u.Fragment,{children:[u.jsx(d7,{}),u.jsx(f7,{state:n,saving:i})]});case"backend-api":return u.jsx(K8,{})}}function c7(e){return e.flatMap(n=>(n.settingsSections??[]).map(i=>({id:`${n.id}:${i.id}`,pluginId:n.id,pluginLabel:h7(n.id),sectionTitle:i.title,render:i.render})))}function u7(e){const n=[];for(const i of e){const s=n.at(-1);if(s?.pluginId===i.pluginId){n[n.length-1]={...s,sections:[...s.sections,i]};continue}n.push({pluginId:i.pluginId,pluginLabel:i.pluginLabel,sections:[i]})}return n}function h7(e){return e==="terminal"?"Terminal":e.split(/[-_]/g).filter(Boolean).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ")||e}function d7(){const{activeTheme:e}=$r();return u.jsxs("section",{className:"global-settings-card","aria-label":"Theme",children:[u.jsxs("div",{className:"global-settings-row",children:[u.jsxs("div",{className:"global-settings-row-text",children:[u.jsx("p",{className:"global-settings-resp-title",children:"Theme"}),u.jsx("p",{className:"global-settings-help",children:"Console color scheme. Applies immediately and is saved server-side."})]}),u.jsx("div",{className:"theme-picker",role:"group","aria-label":"Theme",children:n7.map(n=>{const i=n.id===e;return u.jsxs("button",{type:"button","aria-pressed":i,className:`theme-card ${i?"is-active":""}`,onClick:()=>{kw(n.id),Pg("theme",n.id)},children:[u.jsx("span",{className:"theme-card-swatch","aria-hidden":"true",children:n.swatch.map(s=>u.jsx("i",{style:{background:s}},s))}),u.jsx("span",{className:"theme-card-label",children:n.label}),u.jsx("span",{className:"theme-card-check","aria-hidden":"true",children:i?u.jsx(g7,{}):null})]},n.id)})})]}),u.jsx("p",{className:"global-settings-foot",children:"Theme applies immediately and is stored server-side."})]})}function f7({state:e,saving:n}){const i=$r();return u.jsxs("section",{className:"global-settings-card","aria-label":"General",children:[e?u.jsx(u.Fragment,{children:u.jsx(p7,{state:e,saving:n,consoleState:i})}):u.jsx("p",{className:"global-settings-help",children:"Loading settings."}),u.jsx("p",{className:"global-settings-foot",children:"Changes apply to newly launched sessions. Running sessions keep their current configuration until relaunched."})]})}function p7({state:e,saving:n,consoleState:i}){const[s,o]=M.useState(e.consoleStaticPort?.toString()??""),f=i.effectivePort,g=i.portMode==="static"&&!i.portHonored,c=i.requestedPort,h=e.consolePortMode==="static"&&e.consoleStaticPort!==null,d=s.trim(),b=Number(d),m=d.length>0,w=m&&nS(b),x=e.consolePortMode==="static"&&m&&!w;return M.useEffect(()=>{o(e.consoleStaticPort?.toString()??"")},[e.consoleStaticPort]),u.jsxs("div",{className:"global-settings-row is-stack console-port-row",children:[u.jsxs("div",{className:"global-settings-row-text",children:[u.jsxs("p",{className:"global-settings-resp-title",children:["Console Port ",u.jsx("span",{className:"new-badge",children:"New"})]}),u.jsx("p",{className:"global-settings-help",children:"Dynamic lets the OS pick a free loopback port each time the console starts. Static pins a port you choose so the console URL stays the same across restarts."})]}),u.jsxs("div",{className:"console-port-control",children:[u.jsx("div",{className:"segmented",role:"group","aria-label":"Console port mode",children:i7.map(T=>{const E=e.consolePortMode===T.id;return u.jsx("button",{type:"button","aria-pressed":E,className:`segmented-option ${E?"is-active":""}`,disabled:n,onClick:()=>{Pg("consolePortMode",T.id)},children:T.label},T.id)})}),u.jsx("div",{className:`console-port-reveal ${e.consolePortMode==="static"?"is-open":""}`,children:u.jsxs("div",{className:"console-port-reveal-inner",children:[u.jsx("label",{className:"console-port-input-label",htmlFor:"console-static-port-input",children:"Static port"}),u.jsx("input",{id:"console-static-port-input",className:`console-port-input ${x?"is-invalid":""}`,inputMode:"numeric",placeholder:"8080",value:s,disabled:n,"aria-invalid":x,"aria-describedby":"console-static-port-hint",onChange:T=>{const E=T.target.value;o(E);const p=Number(E.trim());nS(p)&&Pg("consoleStaticPort",p)}}),u.jsx("span",{id:"console-static-port-hint",className:`console-port-hint ${x?"is-invalid":""}`,children:"1024–65535"})]})}),u.jsxs("div",{className:`console-port-effective ${g?"is-fallback":""}`,"aria-live":"polite",children:[u.jsx("span",{className:"console-port-effective-dot","aria-hidden":"true"}),u.jsxs("div",{children:[u.jsx("p",{className:"console-port-effective-label",children:"Currently reachable on"}),u.jsxs("p",{className:"console-port-effective-value",children:["127.0.0.1:",u.jsx("span",{children:f||"..."}),g?" · Dynamic":""]})]})]}),g&&c?u.jsxs("div",{className:"console-port-warning",role:"status",children:["Port ",u.jsx("strong",{children:c})," was unavailable — the console fell back to a ",u.jsx("strong",{children:"Dynamic"})," port and is running on ",u.jsxs("strong",{children:["127.0.0.1:",f||"..."]}),"."," ",h?u.jsxs(u.Fragment,{children:["Next restart will try ",u.jsx("strong",{children:e.consoleStaticPort}),"."]}):u.jsx(u.Fragment,{children:"Next restart will use a dynamic port."})]}):null,u.jsx("p",{className:"console-port-note",children:"Applies when the console restarts. Console-wide — shared across every browser."})]})]})}function nS(e){return Number.isInteger(e)&&e>=r7&&e<=s7}function g7(){return u.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:u.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 m7(e,n){return{x:e.x*n.zoom+n.x,y:e.y*n.zoom+n.y}}function Xl(e,n){return{x:(e.x-n.x)/n.zoom,y:(e.y-n.y)/n.zoom}}function _7(e,n){return{...m7(e,n),width:e.width*n.zoom,height:e.height*n.zoom}}const v7=[{title:"Console",entries:[{combos:[["Mod","K"]],description:"Search Operations across Theaters"},{combos:[["Esc"]],description:"Close the open overlay or menu"}]},{title:"Operations",entries:[{combos:[["Esc"]],description:"Close the carrier job stream"},{combos:[["Shift","Enter"]],description:"Insert a newline in the terminal instead of submitting"},{combos:[["Enter"],["Esc"]],description:"Confirm or cancel a session rename"},{combos:[["↑"],["↓"]],description:"Move between Theater, Theme, and launch menu items"}]},{title:"Map",entries:[{combos:[["Alt","←"],["Alt","→"]],description:"Focus the previous / next Operation"},{combos:[["Drag"]],description:"Pan the operations map"},{combos:[["Shift","Drag"]],description:"Draw a new Operation terminal"},{combos:[["Space","Drag"]],description:"Pan even while a terminal has focus"},{combos:[["Scroll"]],description:"Zoom the map in or out"},{combos:[["Right-click"]],description:"Open the canvas actions menu"},{combos:[["Double-click"]],description:"Focus an Operation 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"}]}],b7=288,y7=520,Al=12,ms=[{id:"operations",label:"Operations"},{id:"map",label:"Map"},{id:"help",label:"Help"}],S7=/mac|iphone|ipad|ipod/i;function Ku({anchor:e,viewportBounds:n,placement:i="cursor",mode:s="full",catalog:o,canLaunch:f,mapFullscreen:g,radarEnabled:c,perimeterEnabled:h,renderKindIcon:d,onLaunchKind:b,onResetView:m,onMaximizeMap:w,onToggleRadar:x,onTogglePerimeter:T,onClose:E}){const p=M.useRef(null),v=M.useRef(null),_=M.useRef({operations:null,map:null,help:null}),[S,k]=M.useState(s==="controls"?"map":"operations"),L=C7(),R=s==="full",N=s==="full"||s==="launch",A=s==="full"||s==="controls";M.useEffect(()=>{const F=I=>{p.current?.contains(I.target)||E()},W=I=>{I.key==="Escape"&&E()};return document.addEventListener("mousedown",F),document.addEventListener("keydown",W),()=>{document.removeEventListener("mousedown",F),document.removeEventListener("keydown",W)}},[E]),M.useEffect(()=>{v.current?.focus()},[]);const B=(F,W=!1)=>{k(F),W&&window.requestAnimationFrame(()=>_.current[F]?.focus())},q=F=>{const W=ms.findIndex(Y=>Y.id===S),I=ms.length-1;if(F.key==="ArrowRight"||F.key==="ArrowLeft"){F.preventDefault();const Y=F.key==="ArrowRight"?1:-1,V=ms[(W+Y+ms.length)%ms.length];B(V.id,!0)}else F.key==="Home"?(F.preventDefault(),B(ms[0].id,!0)):F.key==="End"&&(F.preventDefault(),B(ms[I].id,!0))};return u.jsx("div",{className:`operation-launch-control operation-launch-control--canvas ${i==="above"?"operation-launch-control--up":""}`,ref:p,style:x7(e,n,i),"data-canvas-blocker":!0,children:u.jsxs("div",{className:"operation-launch-menu theater-menu canvas-context-menu",role:"dialog","aria-label":"Operations Control",tabIndex:-1,ref:v,children:[u.jsxs("div",{className:"canvas-context-menu-head",children:[u.jsx("span",{className:"canvas-context-menu-reticle","aria-hidden":"true",children:u.jsx(w7,{})}),u.jsx("span",{className:"canvas-context-menu-head-text",children:u.jsx("strong",{children:"Operations Control"})})]}),R?u.jsx("div",{className:"canvas-context-menu-tabs",role:"tablist","aria-label":"Operations Control sections",children:ms.map(F=>u.jsx("button",{ref:W=>{_.current[F.id]=W},type:"button",id:`canvas-control-tab-${F.id}`,className:"canvas-context-menu-tab",role:"tab","aria-selected":S===F.id,"aria-controls":`canvas-control-panel-${F.id}`,tabIndex:S===F.id?0:-1,onClick:()=>B(F.id),onKeyDown:q,children:F.label},F.id))}):null,N?u.jsxs("div",{id:"canvas-control-panel-operations",role:"tabpanel","aria-labelledby":"canvas-control-tab-operations",className:"canvas-context-menu-panel",hidden:R?S!=="operations":void 0,children:[u.jsx("p",{className:"canvas-context-menu-section",children:"Launch"}),o.length>0?o.map((F,W)=>u.jsxs("div",{children:[W>0?u.jsx("div",{className:"theater-menu-divider",role:"separator"}):null,u.jsx("p",{className:"canvas-context-menu-plugin",children:F.title}),F.kinds.map(I=>{const Y=I.disabled===!0||!f;return u.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item canvas-context-menu-item operation-launch-menu-item",disabled:Y,title:I.disabledReason,onClick:()=>b(F.id,I),children:[u.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:d(F.id,I)??u.jsx(R7,{})}),u.jsx("span",{className:"theater-menu-label",children:I.title}),I.disabledReason?u.jsx("span",{className:"operation-launch-menu-reason",children:I.disabledReason}):null]},`${F.id}:${I.id}`)})]},F.id)):u.jsx("p",{className:"theater-menu-empty",children:"No operations available."})]}):null,A?u.jsxs(u.Fragment,{children:[u.jsxs("div",{id:"canvas-control-panel-map",role:"tabpanel","aria-labelledby":"canvas-control-tab-map",className:"canvas-context-menu-panel",hidden:R?S!=="map":void 0,children:[u.jsx("p",{className:"canvas-context-menu-section",children:"View"}),u.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item canvas-context-menu-item",onClick:m,children:[u.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:u.jsx(E7,{})}),u.jsx("span",{className:"theater-menu-label",children:"Reset view"})]}),u.jsx("div",{className:"theater-menu-divider",role:"separator"}),u.jsx("p",{className:"canvas-context-menu-section",children:"Settings"}),w?u.jsx(Tp,{checked:!!g,label:"Maximized map",onClick:w,children:u.jsx(k7,{})}):null,x?u.jsx(Tp,{checked:!!c,label:"Radar sweep",onClick:x,children:u.jsx(T7,{})}):null,T?u.jsx(Tp,{checked:!!h,label:"Panel pulse",onClick:T,children:u.jsx(A7,{})}):null]}),u.jsx("div",{id:"canvas-control-panel-help",role:"tabpanel","aria-labelledby":"canvas-control-tab-help",className:"canvas-context-menu-panel canvas-context-menu-help",hidden:R?S!=="help":void 0,children:s==="controls"?u.jsxs("details",{className:"canvas-context-menu-help-details",children:[u.jsx("summary",{className:"canvas-context-menu-section canvas-context-menu-help-summary",children:"Shortcuts"}),u.jsx(iS,{modLabel:L})]}):u.jsx(iS,{modLabel:L})})]}):null]})})}function w7(){return u.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[u.jsx("circle",{cx:"12",cy:"12",r:"7",fill:"none",stroke:"currentColor",strokeWidth:"1.4"}),u.jsx("path",{d:"M12 2.4v3.4M12 18.2v3.4M2.4 12h3.4M18.2 12h3.4",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}),u.jsx("path",{d:"M12 9.2v5.6M9.2 12h5.6",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]})}function x7(e,n,i){const s=n?Math.max(Al,Math.min(e.x,n.width-b7-Al)):e.x;if(i==="above")return{left:s,bottom:Math.max(Al,e.y)};const o=n?Math.max(Al,Math.min(e.y,n.height-y7-Al)):e.y;return{left:s,top:o}}function iS({modLabel:e}){return u.jsx(u.Fragment,{children:v7.map(n=>u.jsxs("section",{className:"canvas-shortcuts-group","aria-labelledby":`canvas-shortcuts-${n.title.toLowerCase()}`,children:[u.jsx("h3",{id:`canvas-shortcuts-${n.title.toLowerCase()}`,children:n.title}),u.jsx("dl",{className:"canvas-shortcuts-list",children:n.entries.map(i=>u.jsxs("div",{className:"canvas-shortcuts-entry",children:[u.jsx("dt",{className:"canvas-shortcuts-combos",children:i.combos.map((s,o)=>u.jsxs("span",{className:"canvas-shortcuts-combo",children:[o>0?u.jsx("span",{className:"canvas-shortcuts-or",children:"or"}):null,u.jsx("span",{className:"canvas-shortcuts-keyset",children:s.map(f=>u.jsx("kbd",{children:f==="Mod"?e:f},f))})]},`${i.description}:${s.join("+")}`))}),u.jsx("dd",{children:i.description})]},`${n.title}:${i.description}`))})]},n.title))})}function Tp({checked:e,label:n,onClick:i,children:s}){return u.jsxs("button",{type:"button",role:"switch",className:`canvas-context-menu-switch ${e?"is-on":""}`,"aria-checked":e,onClick:i,children:[u.jsx("span",{className:"canvas-context-menu-switch-icon","aria-hidden":"true",children:s}),u.jsx("span",{className:"canvas-context-menu-switch-label",children:n}),u.jsx("span",{className:"canvas-context-menu-switch-track","aria-hidden":"true"})]})}function C7(){const n=navigator.userAgentData?.platform??navigator.platform;return S7.test(n)?"⌘":"Ctrl"}function E7(){return u.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[u.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"}),u.jsx("path",{d:"M2.4 4.6v2.8h2.8",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})]})}function k7(){return u.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:u.jsx("path",{d:"M9.5 3.5h3v3M12.5 3.5 9 7M6.5 12.5h-3v-3M3.5 12.5 7 9",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function T7(){return u.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[u.jsx("circle",{cx:"8",cy:"8",r:"5.2",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),u.jsx("path",{d:"M8 8 12 5.6",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"}),u.jsx("circle",{cx:"8",cy:"8",r:"1.1",fill:"currentColor"})]})}function A7(){return u.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[u.jsx("rect",{x:"3",y:"3.2",width:"10",height:"9.6",rx:"2",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),u.jsx("path",{d:"M10.9 3.2H13v2.1M5.1 12.8H3v-2.1",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),u.jsx("path",{d:"M12.6 5.1c.5 1.4.4 2.9-.3 4.2M3.4 10.9c-.5-1.4-.4-2.9.3-4.2",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"}),u.jsx("circle",{cx:"11.7",cy:"4.2",r:"0.9",fill:"currentColor"})]})}function R7(){return u.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:u.jsx("circle",{cx:"8",cy:"8",r:"3.2",fill:"currentColor",opacity:"0.86"})})}const rS=256,sS=176,Ap=12,Du=220,WC="fleet-console.map.radarCollapsed";function L7({operations:e,pluginOperations:n,viewport:i,canvasSize:s,onJump:o}){const f=M.useRef(null),g=M.useRef(!1),[c,h]=M.useState(M7);if(s.width<=0||s.height<=0||i.zoom<=0)return null;const d=[...Object.entries(e).map(([I,Y])=>({id:I,kind:"op",x:Y.x,y:Y.y,width:Y.width,height:Y.height})),...Object.entries(n).map(([I,Y])=>({id:I,kind:"plugin",x:Y.geometry.x,y:Y.geometry.y,width:Y.geometry.width,height:Y.geometry.height}))];if(d.length===0)return null;const b=()=>{h(I=>{const Y=!I;return N7(Y),Y})};if(c)return u.jsx("button",{type:"button",className:"canvas-minimap-fab","data-canvas-blocker":!0,onClick:b,"aria-label":"Radar 펼치기",title:"Show radar",children:u.jsx(D7,{})});const m=rS-Ap*2,w=sS-Ap*2,x={x:-i.x/i.zoom,y:-i.y/i.zoom,width:s.width/i.zoom,height:s.height/i.zoom};let T=Math.min(x.x,...d.map(I=>I.x)),E=Math.min(x.y,...d.map(I=>I.y)),p=Math.max(x.x+x.width,...d.map(I=>I.x+I.width)),v=Math.max(x.y+x.height,...d.map(I=>I.y+I.height));T-=Du,E-=Du,p+=Du,v+=Du;const _=p-T,S=v-E,k=Math.min(m/_,w/S),L=(m-_*k)/2,R=(w-S*k)/2,N=I=>L+(I-T)*k,A=I=>R+(I-E)*k,B=I=>{const Y=f.current?.getBoundingClientRect();if(!Y)return;const V=I.clientX-Y.left,z=I.clientY-Y.top;o({x:T+(V-L)/k,y:E+(z-R)/k})},q=I=>{I.stopPropagation(),g.current=!0,I.currentTarget.setPointerCapture(I.pointerId),B(I)},F=I=>{g.current&&(I.stopPropagation(),B(I))},W=I=>{g.current=!1;try{I.currentTarget.releasePointerCapture(I.pointerId)}catch{}};return u.jsxs("div",{className:"canvas-minimap","data-canvas-blocker":!0,style:{width:rS,height:sS},children:[u.jsx("span",{className:"canvas-minimap-label","aria-hidden":"true",children:"Radar"}),u.jsx("button",{type:"button",className:"canvas-minimap-toggle",onClick:b,"aria-label":"Radar 접기",title:"Collapse radar",children:u.jsx(O7,{})}),u.jsxs("div",{ref:f,className:"canvas-minimap-inner",style:{inset:Ap},onPointerDown:q,onPointerMove:F,onPointerUp:W,onPointerCancel:W,role:"presentation","aria-label":"Canvas minimap — drag to navigate",children:[d.map(I=>u.jsx("div",{className:`canvas-minimap-operation ${I.kind==="plugin"?"is-plugin":""}`,style:{left:N(I.x),top:A(I.y),width:Math.max(2,I.width*k),height:Math.max(2,I.height*k)}},I.id)),u.jsx("div",{className:"canvas-minimap-view",style:{left:N(x.x),top:A(x.y),width:x.width*k,height:x.height*k}})]})]})}function M7(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(WC)==="true"}catch{return!1}}function N7(e){if(!(typeof window>"u"))try{window.localStorage.setItem(WC,String(e))}catch{}}function O7(){return u.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:u.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 D7(){return u.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[u.jsx("rect",{x:"2",y:"3",width:"12",height:"10",rx:"2",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),u.jsx("rect",{x:"4.2",y:"5",width:"4.2",height:"3.1",rx:"0.6",fill:"none",stroke:"currentColor",strokeWidth:"1"}),u.jsx("circle",{cx:"11",cy:"10.2",r:"0.95",fill:"currentColor"})]})}const j7="is-animation-paused";function I7({viewport:e,backgroundAnimationEnabled:n}){const[i,s]=M.useState(()=>document.hidden);return M.useEffect(()=>{function o(){s(document.hidden)}return document.addEventListener("visibilitychange",o),()=>{document.removeEventListener("visibilitychange",o)}},[]),u.jsxs("div",{className:"operations-canvas-background","aria-hidden":"true",children:[u.jsx("div",{className:"operations-canvas-sea"}),u.jsx("div",{className:"operations-canvas-grid",style:{backgroundPosition:`${e.x}px ${e.y}px`,backgroundSize:`${48*e.zoom}px ${48*e.zoom}px, ${12*e.zoom}px ${12*e.zoom}px`}}),n?u.jsxs("div",{className:`operations-radar${i?` ${j7}`:""}`,children:[u.jsx("span",{className:"operations-radar-ring operations-radar-ring--outer"}),u.jsx("span",{className:"operations-radar-ring operations-radar-ring--middle"}),u.jsx("span",{className:"operations-radar-ring operations-radar-ring--inner"}),u.jsx("span",{className:"operations-radar-sweep"})]}):null]})}const Mh=[{key:"red",label:"Red",color:"oklch(70% 0.12 25)"},{key:"orange",label:"Orange",color:"oklch(73% 0.12 50)"},{key:"amber",label:"Amber",color:"oklch(78% 0.11 70)"},{key:"yellow",label:"Yellow",color:"oklch(84% 0.11 95)"},{key:"lime",label:"Lime",color:"oklch(81% 0.12 120)"},{key:"green",label:"Green",color:"oklch(74% 0.12 145)"},{key:"emerald",label:"Emerald",color:"oklch(73% 0.10 165)"},{key:"teal",label:"Teal",color:"oklch(74% 0.09 185)"},{key:"cyan",label:"Cyan",color:"oklch(76% 0.09 205)"},{key:"sky",label:"Sky",color:"oklch(74% 0.10 230)"},{key:"blue",label:"Blue",color:"oklch(70% 0.11 255)"},{key:"indigo",label:"Indigo",color:"oklch(68% 0.11 278)"},{key:"violet",label:"Violet",color:"oklch(70% 0.11 300)"},{key:"purple",label:"Purple",color:"oklch(70% 0.12 320)"},{key:"magenta",label:"Magenta",color:"oklch(71% 0.12 340)"},{key:"rose",label:"Rose",color:"oklch(72% 0.11 5)"}];function Zl(e){return Mh.find(n=>n.key===e)?.color??null}function aS(e){return typeof e.accent=="string"?e.accent:null}const oS=8,B7=120;function P7({anchor:e,accentKey:n,onSelect:i,onClose:s}){const[o,f]=M.useState(void 0);M.useLayoutEffect(()=>{const c=Math.max(8,Math.min(e.left,window.innerWidth-8)),h=e.bottom+oS,d=h+B7>window.innerHeight;f(d?{position:"fixed",left:c,top:"auto",bottom:Math.round(window.innerHeight-e.top+oS)}:{position:"fixed",left:c,top:Math.round(h)})},[e]),M.useEffect(()=>{const c=h=>{h.key==="Escape"&&(h.preventDefault(),s())};return window.addEventListener("keydown",c),window.addEventListener("resize",s),window.addEventListener("scroll",s,!0),()=>{window.removeEventListener("keydown",c),window.removeEventListener("resize",s),window.removeEventListener("scroll",s,!0)}},[s]);const g=c=>{i(c),s()};return Cs.createPortal(u.jsx("div",{className:"accent-popover-overlay",role:"presentation",onPointerDown:s,children:o?u.jsxs("div",{className:"accent-popover-card",role:"menu","aria-label":"Accent",style:o,onPointerDown:c=>c.stopPropagation(),children:[u.jsxs("button",{type:"button",className:"accent-popover-swatch accent-popover-swatch--clear",role:"menuitem","aria-label":"No accent","aria-pressed":n===null,onClick:()=>g(null),children:[u.jsx("span",{}),"None"]}),Mh.map(c=>u.jsx("button",{type:"button",className:"accent-popover-swatch",role:"menuitem","aria-label":c.label,"aria-pressed":n===c.key,onClick:()=>g(c.key),children:u.jsx("span",{style:{background:c.color}})},c.key))]}):null}),document.body)}function GC(e){const{currentTitle:n,onCommit:i,onBegin:s}=e,o=M.useRef(null),f=M.useRef(!1),g=M.useRef(!1),[c,h]=M.useState(!1),[d,b]=M.useState("");M.useEffect(()=>{c&&(o.current?.focus(),o.current?.select())},[c]);const m=()=>{s?.(),g.current=!1,b(n),h(!0)},w=()=>{g.current=!0,h(!1),b("")},x=()=>{if(!f.current){f.current=!0;try{i(d)}finally{f.current=!1,g.current=!0,h(!1)}}};return{renaming:c,draftTitle:d,inputRef:o,begin:m,cancel:w,commit:x,setDraftTitle:b,handleKeyDown:p=>{if(p.key==="Enter"){p.preventDefault(),x();return}p.key==="Escape"&&(p.preventDefault(),w())},handleBlur:()=>{if(g.current){g.current=!1;return}x()}}}const z7=["n","ne","e","se","s","sw","w","nw"],Rp=320,Lp=200;function H7({operation:e,active:n,geometry:i,zoom:s,subtitle:o,status:f,minimized:g=!1,maximized:c=!1,accentKey:h=null,children:d,onActivate:b,onClose:m,onMinimize:w,onMaximize:x,onRename:T,onSetAccent:E,onGeometryChange:p,onGeometryCommit:v}){const _=M.useRef(null),S=M.useRef(null),k=M.useRef(null),[L,R]=M.useState(null),N=e.title,A=GC({currentTitle:N,onCommit:T,onBegin:b}),B=h?Zl(h):null,q=["canvas-operation",n?"is-active":"",g?"is-minimized":"",c?"is-maximized":"",U7(f)].filter(Boolean).join(" "),F=ee=>{c||ee.button===0&&(ee.preventDefault(),ee.stopPropagation(),b(),S.current={pointerId:ee.pointerId,startX:ee.clientX,startY:ee.clientY,geometry:i,latest:i},ee.currentTarget.setPointerCapture(ee.pointerId))},W=ee=>{if(c)return;const J=S.current;if(!J||J.pointerId!==ee.pointerId)return;ee.preventDefault(),ee.stopPropagation();const se={...J.geometry,x:J.geometry.x+(ee.clientX-J.startX)/s,y:J.geometry.y+(ee.clientY-J.startY)/s};J.latest=se,p(se)},I=ee=>{if(c){S.current=null;return}const J=S.current;!J||J.pointerId!==ee.pointerId||(ee.preventDefault(),ee.stopPropagation(),S.current=null,ee.currentTarget.releasePointerCapture(ee.pointerId),v(J.latest))},Y=(ee,J)=>{c||(J.preventDefault(),J.stopPropagation(),b(),k.current={direction:ee,pointerId:J.pointerId,startX:J.clientX,startY:J.clientY,geometry:i,latest:i},J.currentTarget.setPointerCapture(J.pointerId))},V=ee=>{if(c)return;const J=k.current;if(!J||J.pointerId!==ee.pointerId)return;ee.preventDefault(),ee.stopPropagation();const se=$7(J.geometry,J.direction,(ee.clientX-J.startX)/s,(ee.clientY-J.startY)/s);J.latest=se,p(se)},z=ee=>{if(c){k.current=null;return}const J=k.current;!J||J.pointerId!==ee.pointerId||(ee.preventDefault(),ee.stopPropagation(),k.current=null,ee.currentTarget.releasePointerCapture(ee.pointerId),v(J.latest))},G=ee=>{ee.stopPropagation()},K=ee=>{ee.stopPropagation(),b()},j=ee=>{ee.stopPropagation(),b()},H=ee=>{ee.stopPropagation()},D=()=>{const ee=typeof document<"u"?document.activeElement:null;ee instanceof HTMLElement&&_.current?.contains(ee)&&ee.blur(),w()},P=ee=>{b(),R(ee)},Z={left:Math.round(i.x),top:Math.round(i.y),width:Math.round(i.width),height:Math.round(i.height),zIndex:i.zIndex,...B?{"--op-accent":B}:{}};return u.jsxs("article",{ref:_,className:q,style:Z,onPointerDown:b,"data-canvas-operation":!0,"aria-label":`Operation ${N}`,inert:g?!0:void 0,children:[u.jsxs("div",{className:"canvas-operation-titlebar",onPointerDown:F,onPointerMove:W,onPointerUp:I,onPointerCancel:I,"data-canvas-blocker":!0,children:[E?u.jsx("button",{type:"button",className:"canvas-operation-beacon-button",onPointerDown:G,onClick:ee=>P(ee.currentTarget.getBoundingClientRect()),"aria-label":`Set accent for operation ${N}`,"aria-haspopup":"menu",title:"Set accent",children:u.jsx("span",{className:lS(f),"aria-hidden":"true"})}):u.jsx("span",{className:lS(f),"aria-hidden":"true"}),A.renaming?u.jsx("input",{ref:A.inputRef,className:"canvas-operation-rename-input",value:A.draftTitle,"aria-label":`${N} 이름 변경`,onPointerDown:ee=>ee.stopPropagation(),onChange:ee=>A.setDraftTitle(ee.target.value),onKeyDown:A.handleKeyDown,onBlur:A.handleBlur}):u.jsx("span",{className:"canvas-operation-title",onPointerDown:K,onDoubleClick:A.begin,title:"Double-click to rename",children:N}),o?u.jsx("span",{className:"canvas-operation-cli",children:o}):null,u.jsx("button",{type:"button",className:"canvas-operation-icon-button",onPointerDown:G,onClick:D,"aria-label":`Minimize operation ${N}`,title:"Minimize operation",children:u.jsx(F7,{})}),x?u.jsx("button",{type:"button",className:`canvas-operation-icon-button ${c?"is-active":""}`,onPointerDown:G,onClick:x,"aria-label":c?`Restore operation ${N}`:`Maximize operation ${N}`,"aria-pressed":c,title:c?"Restore operation":"Maximize operation",children:c?u.jsx(G7,{}):u.jsx(W7,{})}):null,u.jsx("button",{type:"button",className:"canvas-operation-icon-button",onPointerDown:G,onClick:m,"aria-label":`Close operation ${N}`,title:"Close operation",children:u.jsx(q7,{})})]}),u.jsx("div",{className:"canvas-operation-terminal",onPointerDown:j,onWheel:H,"data-canvas-blocker":!0,children:d}),!c&&z7.map(ee=>u.jsx("div",{className:`canvas-operation-resize canvas-operation-resize--${ee}`,onPointerDown:J=>Y(ee,J),onPointerMove:V,onPointerUp:z,onPointerCancel:z,"data-canvas-blocker":!0,"aria-hidden":"true"},ee)),L&&E?u.jsx(P7,{anchor:L,accentKey:h,onSelect:E,onClose:()=>R(null)}):null]})}function $7(e,n,i,s){let{x:o,y:f,width:g,height:c}=e;return n.includes("e")&&(g+=i),n.includes("s")&&(c+=s),n.includes("w")&&(o+=i,g-=i),n.includes("n")&&(f+=s,c-=s),g<Rp&&(n.includes("w")&&(o-=Rp-g),g=Rp),c<Lp&&(n.includes("n")&&(f-=Lp-c),c=Lp),{...e,x:o,y:f,width:g,height:c}}function U7(e){return e==="running"?"is-running is-running--turn":e==="awaiting"?"is-running is-running--awaiting":""}function lS(e){return e==="running"?"tenant-beacon is-turn-running":e==="awaiting"?"tenant-beacon is-awaiting":e==="dormant"?"tenant-beacon is-dormant":"tenant-beacon is-idle"}function F7(){return u.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:u.jsx("path",{d:"M3.5 11.5h9",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function W7(){return u.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:u.jsx("path",{d:"M3.5 6V3.5H6M10 3.5h2.5V6M12.5 10v2.5H10M6 12.5H3.5V10",fill:"none",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round"})})}function G7(){return u.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:u.jsx("path",{d:"M6.2 3.5v2.7H3.5M9.8 3.5v2.7h2.7M12.5 9.8H9.8v2.7M3.5 9.8h2.7v2.7",fill:"none",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round"})})}function q7(){return u.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:u.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"})})}function K7({rect:e,viewport:n}){const i=_7(e,n);return u.jsx("div",{className:"canvas-rubber-band",style:{left:i.x,top:i.y,width:i.width,height:i.height},"aria-hidden":"true"})}const V7=.25,Y7=2,X7=200,Z7=150,cS=5,J7=.0018;function Q7({viewport:e,disabled:n=!1,consumePointerDown:i=!1,onViewportChange:s,onZoom:o,onCreate:f,onConsumePointerDown:g,onClick:c}){const h=M.useRef(null),d=M.useRef(e),[b,m]=M.useState(null),[w,x]=M.useState(!1),[T,E]=M.useState(!1);M.useEffect(()=>{d.current=e},[e]),M.useEffect(()=>{const R=A=>{A.key==="Shift"&&E(!0),!eI(A.target)&&A.code==="Space"&&(A.preventDefault(),x(!0))},N=A=>{A.key==="Shift"&&E(!1),A.code==="Space"&&x(!1)};return window.addEventListener("keydown",R),window.addEventListener("keyup",N),()=>{window.removeEventListener("keydown",R),window.removeEventListener("keyup",N)}},[]);const p=R=>{if(n||uS(R.target)||R.button!==0&&R.button!==1)return;if(R.preventDefault(),i){g?.();return}const N=Np(R),A=R.shiftKey&&R.button===0&&!w?"create":"pan";h.current={pointerId:R.pointerId,mode:A,startScreen:N,currentScreen:N,startViewport:d.current},R.currentTarget.setPointerCapture(R.pointerId),A==="create"&&m(Mp(N,N,d.current))},v=R=>{const N=h.current;if(!N||N.pointerId!==R.pointerId)return;R.preventDefault();const A=Np(R);if(h.current={...N,currentScreen:A},N.mode==="pan"){s({...N.startViewport,x:N.startViewport.x+A.x-N.startScreen.x,y:N.startViewport.y+A.y-N.startScreen.y});return}m(Mp(N.startScreen,A,d.current))},_=R=>{L(R,!0)},S=R=>{L(R,!1)},k=R=>{if(n||uS(R.target))return;R.preventDefault();const N=Np(R),A=d.current,B=tI(A.zoom*Math.exp(-R.deltaY*J7),V7,Y7),q=Xl(N,A);o({x:N.x-q.x*B,y:N.y-q.y*B,zoom:B})},L=(R,N)=>{const A=h.current;if(!A||A.pointerId!==R.pointerId||(h.current=null,R.currentTarget.releasePointerCapture(R.pointerId),m(null),!N))return;const B=Math.abs(A.currentScreen.x-A.startScreen.x),q=Math.abs(A.currentScreen.y-A.startScreen.y);if(B<cS&&q<cS){c?.();return}if(A.mode!=="create")return;const F=Mp(A.startScreen,A.currentScreen,d.current),W={x:F.x,y:F.y,width:Math.max(F.width,X7),height:Math.max(F.height,Z7)};f(W,A.currentScreen)};return{rubberBand:b,spaceActive:w,shiftActive:T,onPointerDown:p,onPointerMove:v,onPointerUp:_,onPointerCancel:S,onWheel:k}}function Mp(e,n,i){const s=Xl(e,i),o=Xl(n,i),f=Math.min(s.x,o.x),g=Math.min(s.y,o.y);return{x:f,y:g,width:Math.abs(s.x-o.x),height:Math.abs(s.y-o.y)}}function Np(e){const n=e.currentTarget.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}function uS(e){return e instanceof Element&&!!e.closest("[data-canvas-blocker], [data-canvas-operation]")}function eI(e){return e instanceof HTMLElement&&!!e.closest("input, textarea, select, [contenteditable='true']")}function tI(e,n,i){return Math.min(i,Math.max(n,e))}const nI="Shift-drag to create a Shell. Right-click for actions. Drag to pan; scroll to zoom.",iI=560,rI=360;function sI({state:e,catalog:n,canLaunch:i,mapFullscreen:s,radarEnabled:o,perimeterEnabled:f,renderKindIcon:g,onLaunchKind:c,onLaunchAtGeometry:h,onResetView:d,onMaximizeMap:b,onToggleRadar:m,onTogglePerimeter:w,onClose:x,onFocus:T,onSetAccent:E}){const p=M.useRef(null),v=nw(),_=rw(),S=sw(),k=e.activeOperationId,[L,R]=M.useState(null),N=ic(),[A,B]=M.useState({width:0,height:0}),q=!e.activeTheaterId||e.addingTheater;M.useEffect(()=>{const J=p.current;if(!J||typeof ResizeObserver>"u")return;const se=()=>B({width:J.clientWidth,height:J.clientHeight});se();const X=new ResizeObserver(se);return X.observe(J),()=>X.disconnect()},[]);const F=Q7({viewport:v.viewport,disabled:q,onViewportChange:Zp,onZoom:aw,onCreate:J=>{if(R(null),e.activeTheaterId&&i){const se=hI(n);if(!se)return;const X={...lI(J),zIndex:ia()};h(se.pluginId,se.kind,X)}},consumePointerDown:L!==null,onConsumePointerDown:()=>{R(null)},onClick:oI}),W=(J,se)=>{const X=L?.canvasPoint;R(null),X&&c(J,se,X)},I=()=>{R(null),d()},Y=J=>{if(J.target instanceof Element&&J.target.closest("[data-canvas-blocker], [data-canvas-operation]"))return;J.preventDefault();const se=p.current?.getBoundingClientRect();if(!se)return;const X={x:J.clientX-se.left,y:J.clientY-se.top};R({anchor:X,canvasPoint:Xl(X,v.viewport)})},V=new Set(S);M.useEffect(()=>{e.activeOperationId&&V.has(e.activeOperationId)&&or(null)},[S,e.activeOperationId]);const z=Object.fromEntries(Object.entries(v.operations).filter(([J])=>!V.has(J))),G=(e.operations??[]).filter(J=>J.theaterId===e.activeTheaterId),K=G,j=G.length>0,H=N.operationKinds,P=_!==null&&G.some(J=>J.id===_&&!V.has(J.id))?_:null,Z=P?1:v.viewport.zoom,ee=uI(v.operations)+1;return u.jsxs("main",{className:`operations-canvas ${F.spaceActive?"is-panning":""} ${F.shiftActive?"is-creating":""} ${P?"is-panel-maximized":""} ${f?"":"is-perimeter-anim-off"}`,onPointerDown:F.onPointerDown,onPointerMove:F.onPointerMove,onPointerUp:F.onPointerUp,onPointerCancel:F.onPointerCancel,onWheel:F.onWheel,onContextMenu:Y,ref:p,children:[u.jsx(I7,{viewport:v.viewport,backgroundAnimationEnabled:o}),u.jsx("div",{className:"operations-canvas-world",style:{transform:P?"none":`translate(${Math.round(v.viewport.x)}px, ${Math.round(v.viewport.y)}px) scale(${v.viewport.zoom})`},children:K.map(J=>{const se=v.operations[J.id]??J.geometry??Op(J),X=P===J.id,$=X?cI(A,ee):se;return fI(J,{active:k===J.id,geometry:$,operationKindRegistry:H,status:e.operationStatus[J.id],theme:e.activeTheme,viewportZoom:Z,minimized:V.has(J.id),maximized:X,accentKey:v.operationAccent[J.id]??dI(J),onActivate:()=>{or(J.id),X||Jp(J.id,v.operations[J.id]??J.geometry??Op(J))},onClose:()=>{e.activeOperationId===J.id&&or(null),P===J.id&&fo(),x(J.id)},onMinimize:()=>{e.activeOperationId===J.id&&or(null),VT(J.id)},onMaximize:()=>{X?fo():(or(J.id),Bl(J.id))},onRename:ae=>{mI(J.id,ae)},onSetAccent:ae=>{E(J.id,ae)},onGeometryChange:ae=>{X||Jp(J.id,ae)},onGeometryCommit:ae=>{X||gI(J.id,ho().operations[J.id]??ae)}})})}),j?null:u.jsxs("div",{className:"operations-canvas-empty","data-canvas-blocker":!0,children:[u.jsx("span",{className:"operations-canvas-empty-mark","aria-hidden":"true"}),u.jsx("p",{children:e.activeTheaterId?nI:"Add a Theater from the top bar to start operations."})]}),F.rubberBand?u.jsx(K7,{rect:F.rubberBand,viewport:v.viewport}):null,L?u.jsx(Ku,{anchor:L.anchor,viewportBounds:aI(p.current),placement:"cursor",catalog:n,canLaunch:i,mapFullscreen:s,radarEnabled:o,perimeterEnabled:f,renderKindIcon:g,onLaunchKind:W,onResetView:I,onMaximizeMap:b,onToggleRadar:m,onTogglePerimeter:w,onClose:()=>R(null)},`${L.anchor.x}:${L.anchor.y}`):null,u.jsx(L7,{operations:z,pluginOperations:Object.fromEntries(G.filter(J=>!V.has(J.id)).map(J=>[J.id,{theaterId:J.theaterId,geometry:v.operations[J.id]??J.geometry??Op(J)}])),viewport:v.viewport,canvasSize:A,onJump:J=>Zp({x:A.width/2-J.x*v.viewport.zoom,y:A.height/2-J.y*v.viewport.zoom,zoom:v.viewport.zoom})})]})}function aI(e){if(!e)return;const n=e.getBoundingClientRect();return{width:n.width,height:n.height}}function oI(){if(typeof document<"u"){const e=document.activeElement;e instanceof HTMLElement&&e.blur()}or(null)}function lI(e){return{x:e.x,y:e.y,width:e.width,height:e.height,zIndex:0}}function Op(e){return e.geometry??{x:0,y:0,width:iI,height:rI,zIndex:0}}function cI(e,n){return{x:0,y:0,width:Math.max(320,e.width),height:Math.max(240,e.height),zIndex:n}}function uI(e){return Object.values(e).reduce((n,i)=>Math.max(n,i.zIndex),0)}function hI(e){const n=e.flatMap(i=>i.kinds.filter(s=>s.disabled!==!0).map(s=>({pluginId:i.id,kind:s})));return n.find(({kind:i})=>i.type==="shell")??n[0]??null}function dI(e){return typeof e.accent=="string"?e.accent:null}function fI(e,n){const i=n.operationKindRegistry.find(f=>f.pluginId===e.pluginId&&f.type===e.type),s=n.geometry;if(!i?.render)return null;const o=Ch(()=>{Si(null).then(wi).catch(()=>{})});return u.jsx(H7,{operation:e,active:n.active,geometry:s,zoom:n.viewportZoom,subtitle:i.subtitle?.(e),status:n.status,minimized:n.minimized,maximized:n.maximized,accentKey:n.accentKey,onActivate:n.onActivate,onClose:n.onClose,onMinimize:n.onMinimize,onMaximize:n.onMaximize,onRename:n.onRename,onSetAccent:n.onSetAccent,onGeometryChange:n.onGeometryChange,onGeometryCommit:n.onGeometryCommit,children:u.jsx(Xg,{fallback:u.jsx("div",{className:"fc-plugin-error",children:"Plugin operation failed to render."}),children:u.jsx(pI,{active:n.active,capabilities:o,descriptor:i,geometry:s,operation:e,theme:n.theme,viewportZoom:n.viewportZoom,onActivate:n.onActivate,onClose:n.onClose,onGeometryChange:n.onGeometryChange})})},e.id)}function pI({active:e,capabilities:n,descriptor:i,geometry:s,operation:o,theme:f,viewportZoom:g,onActivate:c,onClose:h,onGeometryChange:d}){return i.render?i.render({operationId:o.id,theaterId:o.theaterId,pluginId:o.pluginId,type:o.type,operation:o,geometry:s,active:e,zoom:g,theme:f,api:n.api,lifecycle:n.lifecycle,terminal:n.terminal,notifications:n.notifications,operations:n.operations,preferences:n.preferences,settings:n.settings,status:n.status,onActivate:c,onClose:h,onGeometryChange:d}):null}async function gI(e,n){await fetch(`/api/v1/operations/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({geometry:n})})}async function mI(e,n){await vw(e,n),await Si(null).then(wi)}const zg="fleet-console.rail.activePanelId";function _I(){try{return localStorage.getItem(zg)}catch{return null}}function qC(e){try{e===null?localStorage.removeItem(zg):localStorage.setItem(zg,e)}catch{}}const Hg=new Set;let zr={activeRailPanelId:_I(),panelExtraWidth:0};function Um(){for(const e of Hg)e()}function KC(e){return Hg.add(e),()=>{Hg.delete(e)}}function VC(){return zr}function vI(e){const n=zr.activeRailPanelId===e?null:e;zr={activeRailPanelId:n,panelExtraWidth:0},qC(n),Um()}function bI(){zr.activeRailPanelId!==null&&(zr={activeRailPanelId:null,panelExtraWidth:0},qC(null),Um())}function yI(e,n){if(e!==zr.activeRailPanelId)return;const i=n===null||!Number.isFinite(n)?0:n,s=Math.max(0,Math.round(i)),o=typeof window<"u"?Math.min(s,Math.max(0,window.innerWidth-548)):s;o!==zr.panelExtraWidth&&(zr={...zr,panelExtraWidth:o},Um())}function YC(){return M.useSyncExternalStore(KC,VC).activeRailPanelId}function SI(){return M.useSyncExternalStore(KC,VC).panelExtraWidth}function XC(e){if(!e.operationsViewActive||!e.activeOperationId)return new Set;const n=e.operations.find(i=>i.id===e.activeOperationId);return!n||n.theaterId!==e.activeTheaterId?new Set:new Set([n.id])}function ZC(e,n){const i=new Set(n.map(s=>s.id));return e.filter(s=>i.has(s.operationId))}function JC(e,n){const i=[],s=[];for(const o of e)n.has(o.operationId)?s.push(o):i.push(o);return{hidden:i,visible:s}}function $g(e){const n=new Map;for(const i of[...e].sort((s,o)=>o.lastRaisedSeq-s.lastRaisedSeq)){const s=i.theaterId??"__unknown__",o=n.get(s)??{theaterId:i.theaterId,theaterLabel:i.theaterLabel,notifications:[]};o.notifications.push(i),n.set(s,o)}return[...n.values()].sort((i,s)=>{const o=i.notifications[0]?.lastRaisedSeq??0;return(s.notifications[0]?.lastRaisedSeq??0)-o})}function QC(e,n){return n.globalMute||n.dnd?[]:e.filter(i=>!i.theaterId||n.mutedTheaterIds[i.theaterId]!==!0)}const wI={ended:"Stood down","input-waiting":"Awaiting orders"},xI={id:"alerts",title:"Alerts",icon:()=>u.jsx(EI,{}),render:()=>u.jsx(CI,{})};function CI(){const e=$r(),n=yh(),[i,s]=M.useState(!1),o=M.useMemo(()=>ZC(Object.values(e.operationNotifications),e.operations),[e.operationNotifications,e.operations]),f=XC(e),g=JC(o,f).hidden,c=QC(g,e.notificationPreferences),h=$g(c),d=$g(g),b=Ug(h,"input-waiting"),m=Ug(h,"ended"),w=h.length===0,x=M.useCallback(T=>{wh(T.operationId),n("/operations")},[n]);return u.jsxs("div",{className:"alerts-panel-body","aria-live":"polite","aria-label":"Operation alerts",children:[u.jsxs("div",{className:"alerts-panel-toolbar",children:[u.jsxs("div",{className:"alerts-panel-tallies","aria-hidden":"true",children:[b>0?u.jsx("span",{className:"notification-tally is-input-waiting",children:b}):null,m>0?u.jsx("span",{className:"notification-tally is-ended",children:m}):null,w?u.jsx("span",{className:"alerts-panel-tally-empty",children:"—"}):null]}),u.jsx("button",{type:"button",className:`alerts-panel-settings-btn${i?" is-active":""}`,onClick:()=>s(T=>!T),"aria-expanded":i,"aria-label":"Notification settings",title:"Notification settings",children:u.jsx(RI,{})})]}),i?u.jsx(kI,{groups:d}):null,w?u.jsx("p",{className:"notification-dock-empty",children:"No active alerts"}):u.jsx("div",{className:"notification-dock-deck",children:h.map(T=>u.jsxs("section",{className:"notification-cluster-group",children:[u.jsxs("header",{className:"notification-cluster-group-head",children:[u.jsx("span",{className:"notification-cluster-theater",children:T.theaterLabel}),u.jsx("span",{className:"notification-cluster-group-count",children:T.notifications.length})]}),u.jsx("ul",{className:"notification-cluster-roster",children:T.notifications.map(E=>u.jsxs("li",{className:`notification-row is-${E.kind}`,children:[u.jsx("span",{className:"notification-row-beacon","aria-hidden":"true"}),u.jsxs("span",{className:"notification-row-body",children:[u.jsx("span",{className:"notification-row-op",children:E.operationLabel}),u.jsx("span",{className:"notification-row-state",children:wI[E.kind]})]}),u.jsx("button",{type:"button",className:"notification-row-move",onClick:()=>x(E),"aria-label":`Open ${T.theaterLabel} ${E.operationLabel}`,children:"Open"})]},E.operationId))})]},T.theaterId??"__unknown__"))})]})}function EI(){const e=$r(),i=YC()==="alerts",s=M.useMemo(()=>ZC(Object.values(e.operationNotifications),e.operations),[e.operationNotifications,e.operations]),o=XC(e),f=JC(s,o).hidden,g=QC(f,e.notificationPreferences),c=$g(g),h=c.reduce((E,p)=>E+p.notifications.length,0),d=Ug(c,"input-waiting"),b=M.useMemo(()=>g.reduce((E,p)=>Math.max(E,p.lastRaisedSeq),0),[g]),m=M.useRef(b),[w,x]=M.useState(0);M.useEffect(()=>{b>m.current&&!i&&x(E=>E+1),m.current=b},[b,i]);const T=h===0?"muted":d>0?"awaiting":"ended";return u.jsxs("span",{className:`alerts-icon is-${T}`,"aria-hidden":"true",children:[u.jsx(AI,{}),h>0?u.jsx("span",{className:"alerts-icon-badge",children:h}):null,w>0?u.jsx("span",{className:"alerts-icon-pulse","aria-hidden":"true"},w):null]})}function kI({groups:e}){const n=$r(),i=TI(e,n.notificationPreferences.mutedTheaterIds,n.theaters);return u.jsxs("div",{className:"notification-cluster-settings",role:"dialog","aria-label":"Notification settings",children:[u.jsx("p",{className:"notification-cluster-settings-eyebrow",children:"Display"}),u.jsxs("label",{className:"notification-cluster-setting",children:[u.jsx("input",{type:"checkbox",checked:n.notificationPreferences.globalMute,onChange:s=>_R(s.currentTarget.checked)}),u.jsx("span",{children:"Mute all"})]}),u.jsxs("label",{className:"notification-cluster-setting",children:[u.jsx("input",{type:"checkbox",checked:n.notificationPreferences.dnd,onChange:s=>vR(s.currentTarget.checked)}),u.jsx("span",{children:"Do not disturb"})]}),i.length>0?u.jsx("p",{className:"notification-cluster-settings-eyebrow",children:"By Theater"}):null,i.map(s=>u.jsxs("label",{className:"notification-cluster-setting",children:[u.jsx("input",{type:"checkbox",checked:s.theaterId?n.notificationPreferences.mutedTheaterIds[s.theaterId]===!0:!1,onChange:()=>{s.theaterId&&bR(s.theaterId)}}),u.jsx("span",{children:s.theaterLabel})]},s.theaterId))]})}function TI(e,n,i){const s=new Map;for(const o of e)o.theaterId&&s.set(o.theaterId,o);for(const o of Object.keys(n))s.has(o)||s.set(o,{theaterId:o,theaterLabel:i.find(f=>f.id===o)?.label??o,notifications:[]});return[...s.values()]}function Ug(e,n){let i=0;for(const s of e)for(const o of s.notifications)o.kind===n&&(i+=1);return i}function AI(){return u.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",width:"16",height:"16",children:[u.jsx("path",{d:"M8 2a4.5 4.5 0 0 0-4.5 4.5v2.25L2 10.5v.75h12v-.75l-1.5-1.75V6.5A4.5 4.5 0 0 0 8 2Z",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"}),u.jsx("path",{d:"M6.5 12a1.5 1.5 0 0 0 3 0",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"})]})}function RI(){return u.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",width:"15",height:"15",children:[u.jsx("path",{d:"M8 5.4a2.6 2.6 0 1 1 0 5.2 2.6 2.6 0 0 1 0-5.2Z",fill:"none",stroke:"currentColor",strokeWidth:"1.25"}),u.jsx("path",{d:"M8 2.2v1.6M8 12.2v1.6M3.9 3.9 5 5M11 11l1.1 1.1M2.2 8h1.6M12.2 8h1.6M3.9 12.1 5 11M11 5l1.1-1.1",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"})]})}async function LI(e,n){const s=new URLSearchParams().toString();return So(oa(e,`/search${s?`?${s}`:""}`))}async function MI(e,n,i){return So(oa(e,`/entry/${encodeURIComponent(n)}`))}async function e2(e,n="pending"){return So(oa(e,`/drydock?status=${encodeURIComponent(n)}`))}async function NI(e,n){return So(oa(e,`/drydock/${encodeURIComponent(n)}`))}async function OI(e,n,i,s){const o={action:i};return s!==void 0&&(o.reason=s),II(oa(e,`/drydock/${encodeURIComponent(n)}/decision`),o)}async function DI(e){return So(oa(e,"/conflicts"))}async function jI(e,n){return So(oa(e,`/conflicts/${encodeURIComponent(n)}`))}function oa(e,n){const i=n.startsWith("/")?n:`/${n}`;return e?`/console/codex/w/${encodeURIComponent(e)}/api${i}`:`/console/codex/api${i}`}async function So(e){const n=await fetch(e,{headers:{accept:"application/json"}});if(!n.ok)throw new Error(await t2(e,n));return n.json()}async function II(e,n){const i=await fetch(e,{method:"POST",headers:{"content-type":"application/json",accept:"application/json"},body:JSON.stringify(n)});if(!i.ok)throw new Error(await t2(e,i));return i.json()}async function t2(e,n){return(await n.json().catch(()=>null))?.error??`${e} request failed: ${n.status}`}const Fg=new Set,gh={index:[],conflicts:[],pendingPatchCount:0,currentWorkspaceId:null,loading:!1,error:null};function io(){return gh}function n2(e){return Fg.add(e),()=>Fg.delete(e)}function hS(e){Vu({currentWorkspaceId:e})}async function mh(){Vu({loading:!0,error:null});try{const e=gh.currentWorkspaceId,[n,i]=await Promise.all([LI(e),e2(e,"pending").catch(()=>null)]);Vu({index:n.entries,pendingPatchCount:i?.pendingCount??0,loading:!1})}catch(e){Vu({loading:!1,error:BI(e)})}}function Vu(e){Object.assign(gh,e);for(const n of Fg)n(gh)}function BI(e){return e instanceof Error?e.message:String(e)}const PI=120;function Yi(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function zI(e,n){if(!n)return Yi(e);const i=e.toLowerCase().indexOf(n.toLowerCase());return i===-1?Yi(e):Yi(e.slice(0,i))+`<mark>${Yi(e.slice(i,i+n.length))}</mark>`+Yi(e.slice(i+n.length))}function HI(e){return`<span class="codex-nav-tag">${Yi(e)}</span>`}function $I(e,n,i){const s=n?e.tags.some(c=>c.toLowerCase().includes(n.toLowerCase())):!1,o=e.tags.slice(0,3).map(HI).join(""),f=Yi(e.status??"current"),g=Yi(e.updated??"");return`<button
|
|
215
|
+
class="codex-nav-entry${i?" is-current":""}"
|
|
216
|
+
data-entry-id="${Yi(e.id)}"
|
|
217
|
+
type="button"
|
|
218
|
+
${i?'aria-current="page"':""}
|
|
219
|
+
title="${Yi(e.title)}"
|
|
220
|
+
>
|
|
221
|
+
<span class="t">${zI(e.title,s?"":n)}</span>
|
|
222
|
+
${o?`<span class="tg">${o}</span>`:""}
|
|
223
|
+
<span class="meta">${f} · ${g}</span>
|
|
224
|
+
</button>`}function UI(e,n){if(!n)return e;const i=n.toLowerCase();return e.filter(s=>s.title.toLowerCase().includes(i)||s.tags.some(o=>o.toLowerCase().includes(i)))}function FI(e,n){let i="",s=null,o=null;e.innerHTML=`
|
|
225
|
+
<div class="codex-navigator">
|
|
226
|
+
<div class="codex-nav-search">
|
|
227
|
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="M21 21l-4.35-4.35"/></svg>
|
|
228
|
+
<input
|
|
229
|
+
class="codex-nav-search-input"
|
|
230
|
+
type="search"
|
|
231
|
+
placeholder="Search entries"
|
|
232
|
+
autocomplete="off"
|
|
233
|
+
spellcheck="false"
|
|
234
|
+
aria-label="Search Codex entries"
|
|
235
|
+
/>
|
|
236
|
+
</div>
|
|
237
|
+
<div class="codex-nav-quick-row">
|
|
238
|
+
<button class="codex-nav-quick" data-action="drydock" type="button">
|
|
239
|
+
⚓ Drydock <span class="badge" id="codex-nav-drydock-badge">0</span>
|
|
240
|
+
</button>
|
|
241
|
+
<button class="codex-nav-quick" data-action="conflicts" type="button">Conflicts</button>
|
|
242
|
+
</div>
|
|
243
|
+
<div class="codex-nav-list-eyebrow" id="codex-nav-eyebrow">Entries · 0</div>
|
|
244
|
+
<div class="codex-navigator-scroll">
|
|
245
|
+
<div class="codex-nav-list" id="codex-nav-list"></div>
|
|
246
|
+
</div>
|
|
247
|
+
</div>
|
|
248
|
+
`;const f=e.querySelector(".codex-nav-search-input"),g=e.querySelector("#codex-nav-list"),c=e.querySelector("#codex-nav-eyebrow"),h=e.querySelector("#codex-nav-drydock-badge");function d(x){const T=UI(x.index,i);if(c.textContent=`Entries · ${T.length}`,h.textContent=String(x.pendingPatchCount),h.hidden=x.pendingPatchCount===0,x.loading&&x.index.length===0){g.innerHTML='<div class="codex-nav-loading" aria-live="polite">Loading…</div>';return}if(x.error){g.innerHTML=`<div class="codex-nav-error" role="alert">${Yi(x.error)}</div>`;return}if(T.length===0){g.innerHTML=`<div class="codex-nav-empty">${i?"No entries match.":"No entries."}</div>`;return}g.innerHTML=T.map(E=>$I(E,i,E.id===s)).join("")}function b(x){const T=x.target;if(!(T instanceof Element))return;const E=T.closest("[data-entry-id]");if(E?.dataset.entryId){s=E.dataset.entryId,d(io()),n.onRequest({kind:"entry",id:s});return}const p=T.closest("[data-action]");if(p?.dataset.action==="drydock"){n.onRequest({kind:"drydock"});return}if(p?.dataset.action==="conflicts"){n.onRequest({kind:"conflicts"});return}}function m(){o!==null&&clearTimeout(o),o=setTimeout(()=>{i=f.value,d(io())},PI)}e.addEventListener("click",b),f.addEventListener("input",m);const w=n2(x=>d(x));return d(io()),{destroy(){w(),e.removeEventListener("click",b),f.removeEventListener("input",m),o!==null&&clearTimeout(o),e.innerHTML=""},setTheater(x){i="",s=null,f&&(f.value=""),d(io())}}}function WI(e,n){n.initialTheaterId&&hS(n.initialTheaterId);const i=FI(e,{initialTheaterId:n.initialTheaterId,onRequest:n.onRequest}),s=n2(()=>{});mh();const o=i.destroy.bind(i);return{destroy(){s(),o()},setTheater(f){hS(f),mh(),i.setTheater(f)}}}function xt(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function mo(e){return xt(e).replace(/"/g,""")}const GI="contextual-knowledge-not-instructions";function qI(e,n){const i=e.frontmatter.whyThisMatched,s=s2(e,n);return`
|
|
249
|
+
<div class="context-actions-grid">
|
|
250
|
+
<button class="context-action-btn" type="button" data-action="copy-compact-context">
|
|
251
|
+
<span class="context-action-label">Compact context</span>
|
|
252
|
+
<span class="context-action-meta">${Yu(i2(e))} tok</span>
|
|
253
|
+
</button>
|
|
254
|
+
<button class="context-action-btn" type="button" data-action="copy-provenance-context">
|
|
255
|
+
<span class="context-action-label">Provenance</span>
|
|
256
|
+
<span class="context-action-meta">${Yu(r2(e))} tok</span>
|
|
257
|
+
</button>
|
|
258
|
+
<button class="context-action-btn" type="button" data-action="copy-related-context">
|
|
259
|
+
<span class="context-action-label">Context pack</span>
|
|
260
|
+
<span class="context-action-meta">${Yu(s)} tok</span>
|
|
261
|
+
</button>
|
|
262
|
+
${i?`
|
|
263
|
+
<button class="context-action-btn context-action-btn--secondary" type="button" data-action="toggle-why-matched">
|
|
264
|
+
<span class="context-action-label">Why this matched</span>
|
|
265
|
+
</button>
|
|
266
|
+
<div class="context-why-matched" hidden>${xt(i)}</div>
|
|
267
|
+
`:""}
|
|
268
|
+
</div>
|
|
269
|
+
`}function i2(e){const n={id:e.frontmatter.id,title:e.frontmatter.title,status:e.frontmatter.status??null,tags:e.frontmatter.tags,updated:e.frontmatter.updated,summary:Fm(e.body)};return JSON.stringify({...n,token_estimate:Yu(JSON.stringify(n))},null,2)}function r2(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",Fm(e.body)].join(`
|
|
270
|
+
`)}function s2(e,n){const i=new Set([...e.frontmatter.related??[]]),s=n.filter(o=>i.has(o.id)).sort((o,f)=>o.title.localeCompare(f.title));return[`<fleet-wiki-context boundary="${GI}">`,"# 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",Fm(e.body),"","### Related Entries",...s.length>0?s.map(o=>`- [[wiki:${o.id}]] — ${o.title}`):["- (none)"],"","</fleet-wiki-context>"].join(`
|
|
271
|
+
`)}function Yu(e){return Math.max(1,Math.ceil(e.length/4))}function Fm(e){return e.replace(/\s+/g," ").trim().slice(0,240)||"(empty)"}function KI(e){const n=e.tags.map(s=>`<span class="chip chip-tag">${xt(s)}</span>`).join(""),i=YI(e);return`
|
|
272
|
+
<div class="meta-chips">
|
|
273
|
+
${n}
|
|
274
|
+
${i}
|
|
275
|
+
<span class="chip">Updated ${xt(VI(e.updated))}</span>
|
|
276
|
+
</div>
|
|
277
|
+
`}function a2(e){return e.map(n=>`<span class="chip chip-muted">${xt(n)}</span>`).join("")}function VI(e){const n=new Date(e);return Number.isNaN(n.getTime())?e:n.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}function YI(e){const n=XI(e);return n?`<span class="chip ${n.tone==="deprecated"?"chip-coral":n.tone==="stale"?"chip-stale":""}" title="${mo(n.title)}">${xt(n.label)}</span>`:""}function XI(e,n=new Date){const i=e.status,s=typeof e.revalidateAfter=="string"&&!Number.isNaN(Date.parse(e.revalidateAfter))&&Date.parse(e.revalidateAfter)<n.getTime();return i==="deprecated"||i==="superseded"?{label:i,tone:"deprecated",title:s?`${i} · stale`:i}:s?{label:"stale",tone:"stale",title:e.revalidateAfter??"stale"}:i==="current"||i==="draft"?{label:i,tone:"neutral",title:i}:null}const ZI="active";function dS(e){return e.length===0?'<p class="toc-empty">No sections</p>':e.map(n=>`<a class="ti toc-level-${n.level}" href="#${mo(n.id)}" data-toc-id="${mo(n.id)}">${xt(n.text)}</a>`).join("")}function fS(e,n,i){if(n.length===0||typeof IntersectionObserver>"u")return()=>{};const s=[...i.querySelectorAll("[data-toc-id]")],o=new Set(n.map(d=>d.id)),f=[...e.querySelectorAll("h2[id], h3[id]")].filter(d=>o.has(d.id));if(s.length===0||f.length===0)return()=>{};const g=e.closest(".codex-reading-sheet-read"),c=new Set,h=new IntersectionObserver(d=>{for(const m of d){const w=m.target instanceof HTMLElement?m.target.id:"";w&&(m.isIntersecting?c.add(w):c.delete(w))}const b=JI(f,c)??QI(f,g)??f[0]?.id??null;pS(s,b)},{root:g,rootMargin:"-20% 0px -65% 0px",threshold:[0,.2,.6,1]});for(const d of f)h.observe(d);return pS(s,f[0]?.id??null),()=>h.disconnect()}function JI(e,n){for(const i of e)if(n.has(i.id))return i.id;return null}function QI(e,n){const i=n?n.getBoundingClientRect().top:0;let s=null;for(const o of e)if(o.getBoundingClientRect().top-i<=80)s=o.id;else break;return s}function pS(e,n){for(const i of e){const s=!!(n&&i.dataset.tocId===n);i.classList.toggle(ZI,s),s?i.setAttribute("aria-current","location"):i.removeAttribute("aria-current")}}function gS(e){return`/entry/${encodeURIComponent(e)}`}const o2={create_wiki:"+",update_wiki:"↻"},l2={create_wiki:"Create",update_wiki:"Update"};function eB(e,n){let i=!1,s=null,o=n,f="idle",g=null,c=null,h=null;pC(e);function d(v){const _=v.target;if(!(_ instanceof Element))return;const S=_.closest("[data-patch-id]");if(S){v.preventDefault();const B=S.dataset.patchId||void 0;o.onPatchOpen?.(B);return}const k=_.closest("[data-entry-id]");if(k?.dataset.entryId){v.preventDefault(),o.onRelatedClick(k.dataset.entryId);return}const L=_.closest("[data-drydock-action]");if(L){v.preventDefault(),b(L.dataset.drydockAction);return}const R=_.closest("[data-action]");if(!R)return;const N=R.dataset.action,A=e._currentEntry;if(A){if(N==="copy-compact-context")navigator.clipboard.writeText(i2(A));else if(N==="copy-provenance-context")navigator.clipboard.writeText(r2(A));else if(N==="copy-related-context")navigator.clipboard.writeText(s2(A,io().index));else if(N==="toggle-why-matched"){const B=R.nextElementSibling;B?.classList.contains("context-why-matched")&&(B.hidden=!B.hidden)}}}function b(v){if(v){if(v==="back"){o.onPatchOpen?.(void 0);return}if(v==="approve"){f="approving",g=null,w();return}if(v==="approve-confirm"){m("approve",void 0);return}if(v==="reject"){f="rejecting",g=null,w();return}if(v==="reject-submit"){const _=e.querySelector("#queue-reject-reason")?.value.trim();if(!_){g="Rejection reason is required.",w();return}m("reject",_);return}if(v==="cancel"){f="idle",g=null,w();return}}}async function m(v,_){if(h){f="submitting",g=null,w();try{await OI(o.theaterId,h,v,_),o.onDecided?.()}catch(S){f=v==="approve"?"approving":"rejecting",g=S instanceof Error?S.message:String(S),w()}}}function w(){const v=e.querySelector("[data-decision-bar-wrap]");v&&(v.innerHTML=c2(f,g))}e.addEventListener("click",d);function x(){s?.(),s=null}async function T(v){if(!i){Dp(e,n.tocContainer),x();try{const _=await MI(o.theaterId,v);if(i)return;const{index:S}=io(),{html:k,toc:L}=fh(_.body,{omitDuplicateTitle:_.frontmatter.title,resolveWikiLink:N=>gS(N)});e._currentEntry=_,e.innerHTML=`
|
|
278
|
+
<article class="document">
|
|
279
|
+
<header class="document-header">
|
|
280
|
+
${tB(_.frontmatter.title)}
|
|
281
|
+
<h1>${xt(_.frontmatter.title)}</h1>
|
|
282
|
+
${KI(_.frontmatter)}
|
|
283
|
+
</header>
|
|
284
|
+
<div class="markdown-body" id="codex-reader-body">
|
|
285
|
+
${k}
|
|
286
|
+
</div>
|
|
287
|
+
${nB(_.frontmatter.id,_.frontmatter.tags,S)}
|
|
288
|
+
${qI(_,S)}
|
|
289
|
+
</article>
|
|
290
|
+
`,n.tocContainer.innerHTML=dS(L);const R=e.querySelector("article");R&&L.length>0&&(s=fS(R,L,n.tocContainer))}catch(_){i||jp(e,n.tocContainer,_)}}}async function E(v){if(!i){Dp(e,n.tocContainer),x(),c=null,h=null,f="idle",g=null;try{if(v){const _=await NI(o.theaterId,v);if(i)return;c=_.meta,h=v;const{html:S,toc:k}=fh(_.wikiEntry.body,{omitDuplicateTitle:_.wikiEntry.title,resolveWikiLink:R=>gS(R)});e.innerHTML=sB(_,S),n.tocContainer.innerHTML=dS(k);const L=e.querySelector("article");L&&k.length>0&&(s=fS(L,k,n.tocContainer))}else{const _=await e2(o.theaterId,"pending");if(i)return;n.tocContainer.innerHTML="",e.innerHTML=iB(_.items,"Drydock — Pending Patches")}}catch(_){i||jp(e,n.tocContainer,_)}}}async function p(v){if(!i){Dp(e,n.tocContainer),x();try{if(v){const _=await jI(o.theaterId,v);if(i)return;n.tocContainer.innerHTML="",e.innerHTML=lB(_)}else{const _=await DI(o.theaterId);if(i)return;n.tocContainer.innerHTML="",e.innerHTML=cB(_)}}catch(_){i||jp(e,n.tocContainer,_)}}}return n.kind==="entry"&&n.initialEntryId?T(n.initialEntryId):n.kind==="drydock"?E(n.subId):n.kind==="conflicts"&&p(n.subId),{destroy(){i=!0,e.removeEventListener("click",d),x()},async setEntry(v){await T(v)},async navigateSub(v){n.kind==="drydock"?await E(v):n.kind==="conflicts"&&await p(v)},refreshCallbacks(v){o={...o,...v}}}}function Dp(e,n){e.innerHTML='<div class="codex-reader-loading" aria-live="polite" aria-busy="true">Loading…</div>',n.innerHTML=""}function jp(e,n,i){const s=i instanceof Error?i.message:String(i);e.innerHTML=`<div class="codex-reader-error" role="alert">${xt(s)}</div>`,n.innerHTML=""}function tB(e){return`
|
|
291
|
+
<nav class="breadcrumb" aria-label="Entry location">
|
|
292
|
+
<ol>
|
|
293
|
+
<li><span>Codex</span></li>
|
|
294
|
+
<li><span aria-current="page">${xt(e)}</span></li>
|
|
295
|
+
</ol>
|
|
296
|
+
</nav>
|
|
297
|
+
`}function nB(e,n,i){const s=new Set(n),o=i.filter(f=>f.id!==e).map(f=>({entry:f,matchingTags:f.tags.filter(g=>s.has(g))})).filter(f=>f.matchingTags.length>0).sort((f,g)=>g.matchingTags.length-f.matchingTags.length||f.entry.title.localeCompare(g.entry.title,"en-US",{sensitivity:"base",numeric:!0})).slice(0,5);return o.length===0?"":`
|
|
298
|
+
<section class="related-list">
|
|
299
|
+
<h2>Related entries</h2>
|
|
300
|
+
<div class="related-items">
|
|
301
|
+
${o.map(f=>`<button class="related-card" type="button" data-entry-id="${mo(f.entry.id)}">
|
|
302
|
+
<strong>${xt(f.entry.title)}</strong>
|
|
303
|
+
<span>${a2(f.matchingTags)}</span>
|
|
304
|
+
</button>`).join("")}
|
|
305
|
+
</div>
|
|
306
|
+
</section>
|
|
307
|
+
`}function iB(e,n){return e.length===0?'<div class="codex-reader-empty"><p class="queue-empty">No pending patches.</p></div>':`
|
|
308
|
+
<article class="document">
|
|
309
|
+
<header class="document-header">
|
|
310
|
+
<nav class="breadcrumb" aria-label="Entry location">
|
|
311
|
+
<ol>
|
|
312
|
+
<li><span>Codex</span></li>
|
|
313
|
+
<li><span aria-current="page">Drydock</span></li>
|
|
314
|
+
</ol>
|
|
315
|
+
</nav>
|
|
316
|
+
<h1>${xt(n)}</h1>
|
|
317
|
+
</header>
|
|
318
|
+
<div class="queue-row-list">
|
|
319
|
+
${e.map(rB).join("")}
|
|
320
|
+
</div>
|
|
321
|
+
</article>
|
|
322
|
+
`}function rB(e){const n=e.op??"create_wiki",i=o2[n]??"?",s=l2[n]??"Patch",o=e.target??e.id,g=[uB(e.meta.createdAt)].filter(Boolean);return`
|
|
323
|
+
<button class="queue-row" type="button" data-patch-id="${mo(e.id)}" aria-label="${mo(s+": "+o)}">
|
|
324
|
+
<span class="queue-row-badge" aria-hidden="true">
|
|
325
|
+
<span class="op-badge">${i}</span>
|
|
326
|
+
</span>
|
|
327
|
+
<span class="queue-row-body">
|
|
328
|
+
<span class="queue-row-target">${xt(o)}</span>
|
|
329
|
+
${e.summary?`<span class="queue-row-summary">${xt(e.summary)}</span>`:""}
|
|
330
|
+
${g.length>0?`<span class="queue-row-meta">${g.map(xt).join(" · ")}</span>`:""}
|
|
331
|
+
</span>
|
|
332
|
+
</button>
|
|
333
|
+
`}function sB(e,n){const{patch:i,meta:s,wikiEntry:o,targetExists:f}=e,g=i.frontmatter.op,c=o2[g]??"?",h=l2[g]??"Patch",d=f?"기존 문서 대체":"신규 문서 생성",b=s.status==="pending";return`
|
|
334
|
+
<article class="document">
|
|
335
|
+
<header class="document-header">
|
|
336
|
+
<nav class="breadcrumb" aria-label="Entry location">
|
|
337
|
+
<ol>
|
|
338
|
+
<li><span>Codex</span></li>
|
|
339
|
+
<li><span>Drydock</span></li>
|
|
340
|
+
<li><span aria-current="page">${xt(h)}</span></li>
|
|
341
|
+
</ol>
|
|
342
|
+
</nav>
|
|
343
|
+
<button type="button" class="queue-back-btn" data-drydock-action="back">‹ Queue</button>
|
|
344
|
+
<h1><span class="op-badge">${c}</span> ${xt(o.title)}</h1>
|
|
345
|
+
<p class="eyebrow">${xt(i.frontmatter.target)} · v${o.version} · ${xt(d)}</p>
|
|
346
|
+
${aB(i.frontmatter.proposer,o.tags)}
|
|
347
|
+
</header>
|
|
348
|
+
<div class="markdown-body" id="codex-reader-body">
|
|
349
|
+
${n}
|
|
350
|
+
</div>
|
|
351
|
+
<div class="queue-decision-section" data-decision-bar-wrap>
|
|
352
|
+
${b?c2("idle",null):oB(s)}
|
|
353
|
+
</div>
|
|
354
|
+
</article>
|
|
355
|
+
`}function aB(e,n){const i=[];return e&&i.push(`<span class="meta-chip">${xt(e)}</span>`),n.length>0&&i.push(a2(n)),i.length===0?"":`<div class="meta-chips">${i.join("")}</div>`}function c2(e,n){return e==="submitting"?'<span class="queue-action-spinner" role="status" aria-label="Processing…"></span>':e==="approving"?`
|
|
356
|
+
<p class="queue-decision-confirm">Apply this patch to the wiki?</p>
|
|
357
|
+
<div class="queue-action-buttons">
|
|
358
|
+
<button type="button" class="queue-action-btn queue-action-btn--approve" data-drydock-action="approve-confirm">✓ Yes, Approve</button>
|
|
359
|
+
<button type="button" class="queue-action-btn queue-action-btn--cancel" data-drydock-action="cancel">Cancel</button>
|
|
360
|
+
</div>
|
|
361
|
+
${n?`<p class="queue-action-error">${xt(n)}</p>`:""}
|
|
362
|
+
`:e==="rejecting"?`
|
|
363
|
+
<div class="queue-reject-form">
|
|
364
|
+
<textarea class="queue-reject-textarea" id="queue-reject-reason" placeholder="Rejection reason (required)…" rows="3"></textarea>
|
|
365
|
+
<div class="queue-action-buttons">
|
|
366
|
+
<button type="button" class="queue-action-btn queue-action-btn--reject-submit" data-drydock-action="reject-submit">Submit Rejection</button>
|
|
367
|
+
<button type="button" class="queue-action-btn queue-action-btn--cancel" data-drydock-action="cancel">Cancel</button>
|
|
368
|
+
</div>
|
|
369
|
+
${n?`<p class="queue-action-error">${xt(n)}</p>`:""}
|
|
370
|
+
</div>
|
|
371
|
+
`:`
|
|
372
|
+
<div class="queue-action-buttons">
|
|
373
|
+
<button type="button" class="queue-action-btn queue-action-btn--approve" data-drydock-action="approve">✓ Approve</button>
|
|
374
|
+
<button type="button" class="queue-action-btn queue-action-btn--reject" data-drydock-action="reject">✕ Reject</button>
|
|
375
|
+
</div>
|
|
376
|
+
`}function oB(e){const n=e.status==="accepted",i=n?"✓ Approved":"✕ Rejected",s=n?"queue-decision-decided--approve":"queue-decision-decided--reject",o=e.reason?` · ${xt(e.reason)}`:"";return`<p class="queue-decision-decided ${s}">${i}${o}</p>`}function lB(e){return`
|
|
377
|
+
<article class="document">
|
|
378
|
+
<header class="document-header">
|
|
379
|
+
<nav class="breadcrumb" aria-label="Entry location">
|
|
380
|
+
<ol><li><span>Codex</span></li><li><span>Conflicts</span></li></ol>
|
|
381
|
+
</nav>
|
|
382
|
+
<h1>${xt(e.id)}</h1>
|
|
383
|
+
<p class="eyebrow">Conflict · ${xt(e.meta?.status??"open")}</p>
|
|
384
|
+
</header>
|
|
385
|
+
<div class="markdown-body">
|
|
386
|
+
${e.current?`<h2>Current</h2><pre><code>${xt(e.current)}</code></pre>`:""}
|
|
387
|
+
${e.proposed?`<h2>Proposed</h2><pre><code>${xt(e.proposed)}</code></pre>`:""}
|
|
388
|
+
</div>
|
|
389
|
+
</article>
|
|
390
|
+
`}function cB(e){return e.length===0?'<div class="codex-reader-empty"><p>No conflicts found.</p></div>':`
|
|
391
|
+
<article class="document">
|
|
392
|
+
<header class="document-header">
|
|
393
|
+
<h1>Conflicts</h1>
|
|
394
|
+
</header>
|
|
395
|
+
<div class="markdown-body">
|
|
396
|
+
<ul class="queue-list">
|
|
397
|
+
${e.map(n=>`<li class="queue-item">
|
|
398
|
+
<strong>${xt(n.title||n.id)}</strong>
|
|
399
|
+
<span class="eyebrow">${xt(n.status)}</span>
|
|
400
|
+
</li>`).join("")}
|
|
401
|
+
</ul>
|
|
402
|
+
</div>
|
|
403
|
+
</article>
|
|
404
|
+
`}function uB(e){try{const i=(Date.now()-new Date(e).getTime())/(1e3*60*60);if(i<1)return"< 1h ago";if(i<24)return`${Math.floor(i)}h ago`;const s=i/24;return s<7?`${Math.floor(s)}d ago`:s<30?`${Math.floor(s/7)}w ago`:`${Math.floor(s/30)}mo ago`}catch{return""}}let Xs=null,Jl=null,u2=null,xs=null,Zs=null,Ss=null,Xu=null,Ip=null,Zu,Wg=0;function mS(e){u2=e}function hB(e,n){const i=pB();i.parentElement!==e&&e.appendChild(i),Jl||(Jl=WI(i,{initialTheaterId:n,onRequest:s=>u2?.(s)}))}function dB(e){Jl?.setTheater(e)}function h2(e,n,i){const s=gB(),o=mB(),f=s.parentElement,g=i.kind==="entry"&&Xu==="entry"&&i.initialEntryId===Ip;f&&f!==e&&(Wg=f.scrollTop),s.parentElement!==e&&e.appendChild(s),o.parentElement!==n&&n.appendChild(o),!Ss||Xu!==i.kind?(Ss?.destroy(),Ss=eB(s,{...i,tocContainer:o}),Xu=i.kind,Zu=i.subId):i.kind==="entry"&&i.initialEntryId&&i.initialEntryId!==Ip?Ss.setEntry(i.initialEntryId):(i.kind==="drydock"||i.kind==="conflicts")&&i.subId!==Zu&&(Zu=i.subId,Ss.navigateSub(i.subId)),Ip=i.kind==="entry"?i.initialEntryId??null:null,Ss.refreshCallbacks({onPatchOpen:i.onPatchOpen,onDecided:i.onDecided,onRelatedClick:i.onRelatedClick,onClose:i.onClose,theaterId:i.theaterId});const c=g?Wg:0;requestAnimationFrame(()=>{e.scrollTop=c})}function fB(){const e=xs?.parentElement;e&&(Wg=e.scrollTop)}function d2(){Ss?.destroy(),Ss=null,Xu=null,Zu=void 0,xs?.parentElement&&xs.parentElement.removeChild(xs),Zs?.parentElement&&Zs.parentElement.removeChild(Zs)}function _S(){d2(),Jl?.destroy(),Jl=null,Xs?.parentElement&&Xs.parentElement.removeChild(Xs)}function pB(){return Xs||(Xs=document.createElement("div"),Xs.className="codex-host"),Xs}function gB(){return xs||(xs=document.createElement("div"),xs.className="codex-reader-host"),xs}function mB(){return Zs||(Zs=document.createElement("div"),Zs.className="codex-toc-host"),Zs}const _B={id:"codex",title:"Codex",icon:()=>u.jsx(yB,{}),render:()=>u.jsx(vB,{})};function vB(){const e=$r(),n=M.useRef(null),i=M.useRef(null),s=M.useRef(null),o=e.codexReader,f=o!==null,g=e.codexReaderExpanded,c=e.theaters.find(w=>w.id===e.activeTheaterId)??null,h=c?.id??null,d=!!c?.hasWiki,b=e.theaters.length>0,m=o?`${o.kind}:${o.kind==="entry"?o.entryId:o.kind==="drydock"?o.patchId??"":o.id??""}`:null;return M.useEffect(()=>{if(!d){_S();return}return()=>{_S()}},[d]),M.useEffect(()=>{if(!d||!h)return;const w=n.current;if(w)return hB(w,h),mS(x=>{x.kind==="entry"?Br({kind:"entry",entryId:x.id}):x.kind==="drydock"?Br({kind:"drydock",patchId:x.patchId}):x.kind==="conflicts"&&Br({kind:"conflicts",id:x.id})}),()=>{mS(null)}},[d,h,f]),M.useEffect(()=>{d&&h&&dB(h)},[h,d]),M.useEffect(()=>{if(!d||!h||!f||g||!i.current||!s.current||!o)return;const w=o.kind,x=w==="drydock"?o.patchId:w==="conflicts"?o.id:void 0;h2(i.current,s.current,{initialEntryId:w==="entry"?o.entryId:"",kind:w,subId:x,theaterId:h,onRelatedClick:T=>Br({kind:"entry",entryId:T}),onClose:()=>Qb(),onPatchOpen:T=>Br({kind:"drydock",patchId:T}),onDecided:()=>{mh(),Br({kind:"drydock",patchId:void 0})}})},[d,h,f,g,m]),M.useEffect(()=>{f||d2()},[f]),d?f?u.jsxs("div",{className:"codex-rail-host is-split",children:[u.jsxs("div",{className:"codex-doc-pane",children:[u.jsxs("div",{className:"codex-doc-pane-head",children:[u.jsx("button",{className:"codex-doc-expand",type:"button","aria-label":"Expand reading sheet","data-codex-expand":"true",onClick:Hu,children:"⤢ Expand"}),u.jsx("button",{className:"codex-reading-sheet-close",type:"button","aria-label":"Close document pane",onClick:Qb,children:"✕"})]}),u.jsx("div",{ref:i,className:"codex-doc-scroll"}),u.jsx("div",{ref:s,className:"codex-doc-toc-inline"})]}),u.jsx("div",{ref:n,className:"codex-nav-pane"})]}):u.jsx("div",{ref:n,className:"codex-rail-host"}):u.jsx(bB,{activeTheater:c,hasTheaters:b})}function bB({activeTheater:e,hasTheaters:n}){return n?u.jsxs("section",{className:"codex-empty-state",children:[u.jsx("p",{className:"codex-empty-eyebrow",children:"Codex unavailable"}),u.jsx("h1",{children:e?.label??"This Theater"}),u.jsx("p",{children:"This Theater does not have Fleet Wiki data mounted."})]}):u.jsxs("section",{className:"codex-empty-state",children:[u.jsx("p",{className:"codex-empty-eyebrow",children:"Codex"}),u.jsx("h1",{children:"Add a Theater"}),u.jsx("p",{children:"Use the top bar Theater control to choose a project root before opening Codex."})]})}function yB(){return u.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[u.jsx("circle",{cx:"12",cy:"12",r:"9"}),u.jsx("circle",{cx:"12",cy:"12",r:"3.2",fill:"currentColor",stroke:"none",opacity:"0.16"}),u.jsx("path",{d:"M12 3v3.6M12 17.4V21M3 12h3.6M17.4 12H21"}),u.jsx("path",{d:"M12 8.6 14.2 12 12 15.4 9.8 12Z",fill:"currentColor",stroke:"none"})]})}const SB=[xI,_B];function wB(e="right"){const{railPanels:n}=ic();return e==="right"?n.filter(i=>(i.side??"right")==="right"):n}const xB=360;function CB(e){const{codexReader:n}=$r();return e==="codex"&&n!==null?xB:0}const f2=240,EB=312,p2="fleet-console.rail.panelWidth";function kB(){try{const e=localStorage.getItem(p2);if(e!==null){const n=parseInt(e,10);if(!isNaN(n)&&n>=f2)return n}}catch{}return EB}function TB({theaterId:e,api:n}){const i=YC(),s=wB(),o=SB,g=[...o,...s].find(v=>v.id===i)??null,c=g!==null,h=CB(i)+(g?.preferredExtraWidth??0)+SI(),d=M.useRef(h);d.current=h;const[b,m]=M.useState(kB),w=M.useRef(b),[x,T]=M.useState(!1),E=M.useCallback(v=>{v.preventDefault();const _=v.clientX,S=w.current;T(!0);const k=R=>{const N=_-R.clientX,A=window.innerWidth-148-d.current,B=Math.max(f2,Math.min(A,S+N));w.current=B,m(B)},L=()=>{document.removeEventListener("pointermove",k),document.removeEventListener("pointerup",L),T(!1);try{localStorage.setItem(p2,String(w.current))}catch{}};document.addEventListener("pointermove",k),document.addEventListener("pointerup",L)},[]),p=M.useMemo(()=>({theaterId:e,api:n,requestExtraWidth:v=>{i!==null&&yI(i,v)}}),[e,n,i]);return u.jsxs("div",{className:`right-rail${c?" is-open":""}${x?" is-dragging":""}`,role:"complementary","aria-label":"Activity Rail",children:[u.jsxs("div",{className:"right-rail-panel-slot",style:c?{width:b+h}:void 0,children:[c&&u.jsx("div",{className:"right-rail-resize-handle",onPointerDown:E,"aria-hidden":"true"}),g&&u.jsx(AB,{activePanel:g,activeId:i,ctx:p})]}),u.jsxs("nav",{className:"right-rail-icons",role:"tablist","aria-label":"Activity tools",children:[o.map(v=>u.jsx(vS,{panel:v,isActive:i===v.id},v.id)),o.length>0&&s.length>0?u.jsx("div",{className:"right-rail-divider",role:"separator","aria-hidden":"true"}):null,s.map(v=>u.jsx(vS,{panel:v,isActive:i===v.id},v.id))]})]})}const AB=M.memo(function({activePanel:n,activeId:i,ctx:s}){return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"right-rail-panel-head",children:[u.jsx("span",{className:"right-rail-panel-title",children:n.title}),u.jsx("button",{className:"right-rail-close-btn",type:"button","aria-label":`Close ${n.title}`,onClick:bI,children:"✕"})]}),u.jsx("div",{className:"right-rail-panel-body",role:"tabpanel","aria-labelledby":`rail-tab-${i}`,children:n.render(s)})]})});function vS({panel:e,isActive:n}){const i=M.useCallback(()=>vI(e.id),[e.id]),s=typeof e.icon=="function"?e.icon():e.icon;return u.jsx("button",{id:`rail-tab-${e.id}`,className:`right-rail-ico${n?" is-active":""}`,type:"button",role:"tab","aria-selected":n,"aria-label":e.title,title:e.title,onClick:i,children:s})}const bS=8,RB=260;function yS(e){const{anchor:n,onClose:i}=e,[s,o]=M.useState(void 0);return M.useLayoutEffect(()=>{const f=Math.max(8,Math.min(n.left,window.innerWidth-208)),g=n.bottom+bS,c=g+RB>window.innerHeight;o(c?{position:"fixed",left:f,top:"auto",bottom:Math.round(window.innerHeight-n.top+bS)}:{position:"fixed",left:f,top:Math.round(g)})},[n]),M.useEffect(()=>{const f=g=>{g.key==="Escape"&&(g.preventDefault(),i())};return window.addEventListener("keydown",f),window.addEventListener("resize",i),window.addEventListener("scroll",i,!0),()=>{window.removeEventListener("keydown",f),window.removeEventListener("resize",i),window.removeEventListener("scroll",i,!0)}},[i]),Cs.createPortal(u.jsx("div",{className:"group-context-menu-overlay",role:"presentation",onPointerDown:i,children:s?u.jsx("div",{className:"group-context-menu-card",role:"menu","aria-label":e.kind==="chip"?"Operation options":`${e.group.name} options`,style:s,onPointerDown:f=>f.stopPropagation(),children:e.kind==="chip"?u.jsx(LB,{...e}):u.jsx(MB,{...e})}):null}),document.body)}function LB({operation:e,groups:n,accentKey:i,actions:s,onClose:o}){const[f,g]=M.useState(!1),[c,h]=M.useState(`Group ${n.length+1}`),d=M.useRef(!1),b=M.useRef(null);M.useEffect(()=>{f&&b.current?.select()},[f]);const m=()=>{const w=c.trim();w&&(s.onCreateGroup(w),o())};return u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"group-context-menu-section-label",children:"Group"}),n.map(w=>{const x=Zl(w.color),T=e.groupId===w.id;return u.jsxs("button",{type:"button",className:`group-context-menu-item${T?" is-selected":""}`,role:"menuitemradio","aria-checked":T,onClick:()=>{s.onSetGroupId(T?null:w.id),o()},children:[u.jsx("span",{className:"group-context-menu-item__dot",style:x?{background:x}:void 0,"aria-hidden":"true"}),u.jsx("span",{className:"group-context-menu-item__name",children:w.name}),T?u.jsx(NB,{}):null]},w.id)}),f?u.jsx("input",{ref:b,className:"group-context-menu-new-input",type:"text",value:c,onChange:w=>h(w.target.value),onCompositionStart:()=>{d.current=!0},onCompositionEnd:()=>{d.current=!1},onKeyDown:w=>{w.key==="Enter"&&!d.current&&(w.preventDefault(),m()),w.key==="Escape"&&(w.preventDefault(),g(!1))},onBlur:()=>g(!1),"aria-label":"New group name",placeholder:"Group name"}):u.jsx("button",{type:"button",className:"group-context-menu-item group-context-menu-item--new",role:"menuitem",onClick:()=>g(!0),children:u.jsx("span",{className:"group-context-menu-item__new-label",children:"+ New group"})}),u.jsx("div",{className:"group-context-menu-divider","aria-hidden":"true"}),u.jsx("div",{className:"group-context-menu-section-label",children:"Accent"}),u.jsxs("button",{type:"button",className:"accent-popover-swatch accent-popover-swatch--clear",role:"menuitem","aria-label":"No accent","aria-pressed":i===null,onClick:()=>{s.onSetAccent(null),o()},children:[u.jsx("span",{}),"None"]}),u.jsx("div",{className:"group-context-menu-swatches",children:Mh.map(w=>u.jsx("button",{type:"button",className:"accent-popover-swatch",role:"menuitem","aria-label":w.label,"aria-pressed":i===w.key,onClick:()=>{s.onSetAccent(w.key),o()},children:u.jsx("span",{style:{background:w.color}})},w.key))})]})}function MB({group:e,actions:n,onClose:i}){const[s,o]=M.useState(e.name),[f,g]=M.useState(!1),c=M.useRef(!1),h=()=>{const d=s.trim();if(!d||d===e.name){i();return}n.onRename(d),i()};return u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"group-context-menu-section-label",children:"Color"}),u.jsx("div",{className:"group-context-menu-swatches",children:Mh.map(d=>u.jsx("button",{type:"button",className:"accent-popover-swatch",role:"menuitem","aria-label":d.label,"aria-pressed":e.color===d.key,onClick:()=>{n.onSetColor(d.key),i()},children:u.jsx("span",{style:{background:d.color}})},d.key))}),u.jsx("div",{className:"group-context-menu-divider","aria-hidden":"true"}),u.jsx("div",{className:"group-context-menu-section-label",children:"Rename"}),u.jsx("input",{className:"group-context-menu-new-input",type:"text",value:s,onChange:d=>o(d.target.value),onCompositionStart:()=>{c.current=!0},onCompositionEnd:()=>{c.current=!1},onKeyDown:d=>{d.key==="Enter"&&!c.current&&(d.preventDefault(),h()),d.key==="Escape"&&(d.preventDefault(),i())},onBlur:h,"aria-label":"Group name"}),u.jsx("div",{className:"group-context-menu-divider","aria-hidden":"true"}),u.jsx("button",{type:"button",className:`group-context-menu-item group-context-menu-item--danger${f?" is-armed":""}`,role:"menuitem",onClick:()=>{if(!f){g(!0);return}n.onUngroupAll(),i()},"aria-label":f?"Confirm: remove all members and delete group":"Ungroup all members and delete group",children:f?"Confirm ungroup all?":"Ungroup all"})]})}function NB(){return u.jsx("svg",{viewBox:"0 0 12 12",className:"group-context-menu-item__check","aria-hidden":"true",children:u.jsx("path",{d:"M2 6l3 3 5-5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function OB(e,n,i,s){if(!i)return{groupId:null,index:0};for(const f of n){const g=f.groupId??"__ungrouped__",c=i.querySelector(`[data-drop-zone-group-id="${g}"]`);if(!c)continue;const h=c.getBoundingClientRect();if(e<h.top||e>h.bottom)continue;const d=c.querySelector(`[data-group-section-id="${g}"]`);if(!d||e<d.getBoundingClientRect().top)return{groupId:f.groupId,index:0};const b=Array.from(d.querySelectorAll("[data-side-bar-chip-id]"));for(const m of b){const w=m.dataset.sideBarChipId;if(!w||w===s)continue;const x=m.getBoundingClientRect();if(e<=x.top+x.height/2)return{groupId:f.groupId,index:Math.max(0,f.entryIds.indexOf(w))}}return{groupId:f.groupId,index:f.entryIds.length}}const o=n[n.length-1];return{groupId:o?.groupId??null,index:o?.entryIds.length??0}}function DB(e,n,i,s){const o=e.filter(b=>b!==n),f=new Set(s),g=o.filter(b=>f.has(b)),c=Math.max(0,Math.min(i,g.length));if(g.length===0)return[...o,n];if(c<g.length){const b=o.indexOf(g[c]),m=[...o];return m.splice(b,0,n),m}const h=o.indexOf(g[g.length-1]),d=[...o];return d.splice(h+1,0,n),d}function jB(e,n,i,s){const o=new Set(s),f=e.filter(m=>o.has(m)),g=f.indexOf(n),c=f.filter(m=>m!==n),h=i>g?i-1:i,d=Math.max(0,Math.min(h,c.length));c.splice(d,0,n);let b=0;return e.map(m=>o.has(m)?c[b++]??m:m)}function IB(e,n,i){if(i.length!==n.length)return[...e];const s=new Set(n);let o=0;return e.map(f=>s.has(f)?i[o++]??f:f)}function BB(e,n,i){if(e.indexOf(n)===-1)return[...e];const o=e.filter(g=>g!==n),f=Math.max(0,Math.min(i,o.length));return o.splice(f,0,n),o}function PB({entry:e,index:n,isCloseArmed:i,accentValue:s,dragging:o,dragOffsetY:f,dropTarget:g,onArmClose:c,onDisarmClose:h,onClose:d,onFocus:b,onKeyboardMove:m,onPointerDragStart:w,onOpenAccent:x,onRename:T}){const E=M.useRef(!1),{operation:p,active:v,minimized:_,notificationCount:S}=e,k=zB(p),L=GC({currentTitle:k,onCommit:I=>T(p.id,I),onBegin:h}),R=["side-bar-chip",v?"side-bar-chip--active":"",_?"side-bar-chip--minimized":"",o?"side-bar-chip--dragging":"",g?"side-bar-chip--drop-target":""].filter(Boolean).join(" "),N=["side-bar-chip-close",i?"is-armed":""].filter(Boolean).join(" "),A={"--i":n,...s?{"--chip-accent":s}:{},...o?{"--drag-dy":`${Math.round(f)}px`}:{}},B=()=>{if(h(),E.current){E.current=!1;return}b(p.id)},q=I=>{I.stopPropagation()},F=I=>{if(I.stopPropagation(),!i){c(p.id);return}h(),d(p.id)},W=I=>{I.preventDefault(),h(),x(p.id,I.currentTarget.getBoundingClientRect())};return u.jsxs("li",{"data-side-bar-chip-id":p.id,className:R,role:"button",tabIndex:0,"aria-label":v?`${k} (focused)`:`Focus operation ${k}`,"aria-current":v?"true":void 0,title:v?"Focused · double-click to rename · right-click to set accent":"Click to focus · double-click to rename · right-click to set accent",style:A,onClick:B,onContextMenu:W,onFocus:()=>{i||h()},onPointerDown:I=>w(I,p.id),onPointerUp:()=>{o&&(E.current=!0)},onKeyDown:I=>{if(I.target===I.currentTarget){if(I.altKey&&I.shiftKey&&(I.key==="ArrowUp"||I.key==="ArrowDown")){I.preventDefault(),m(p.id,I.key==="ArrowUp"?-1:1);return}(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),B())}},children:[u.jsx("span",{className:"side-bar-chip-beacon-button","aria-hidden":"true",children:u.jsx("span",{className:"side-bar-chip-op-icon",children:e.icon??u.jsx($B,{})})}),L.renaming?u.jsx("input",{className:"side-bar-chip-rename-input",ref:L.inputRef,value:L.draftTitle,"aria-label":`Rename operation ${k}`,onChange:I=>L.setDraftTitle(I.target.value),onKeyDown:L.handleKeyDown,onBlur:L.handleBlur,onPointerDown:I=>I.stopPropagation(),onClick:I=>I.stopPropagation()}):u.jsx("span",{className:"side-bar-chip-name",onDoubleClick:L.begin,children:k}),S>0?u.jsx("span",{className:"side-bar-chip-count",children:S}):null,u.jsx("button",{type:"button",className:N,onPointerDown:q,onClick:F,"aria-label":i?`Confirm close operation ${k}`:`Close operation ${k}`,title:i?"Confirm close":"Close operation",children:i?"Close?":u.jsx(HB,{})})]})}function zB(e){return e.title}function HB(){return u.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:u.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"})})}function $B(){return u.jsx("svg",{viewBox:"0 0 14 14","aria-hidden":"true",children:u.jsx("rect",{x:"2",y:"2",width:"10",height:"10",rx:"2.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3"})})}function UB({group:e,count:n,collapsed:i,tier:s,onToggle:o,onContextMenu:f}){const g=Zl(e.color),c=g?{"--grp-color":g}:void 0,h=d=>{d.preventDefault(),f(e.id,d.currentTarget.getBoundingClientRect())};return s==="rail"?u.jsx("div",{className:"side-bar-group-header side-bar-group-header--rail","data-tier":"rail",style:c,onClick:()=>o(e.id),onContextMenu:h,role:"button",tabIndex:0,"aria-label":`Group ${e.name}`,onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),o(e.id))},children:u.jsx("span",{className:"side-bar-group-header__dot","aria-hidden":"true"})}):u.jsxs("div",{className:"side-bar-group-header",style:c,onContextMenu:h,role:"group","aria-label":e.name,children:[u.jsx("button",{type:"button",className:"side-bar-group-header__toggle",onClick:()=>o(e.id),"aria-expanded":!i,"aria-label":i?`Expand group ${e.name}`:`Collapse group ${e.name}`,title:i?"Expand":"Collapse",children:u.jsx(FB,{collapsed:i})}),u.jsx("span",{className:"side-bar-group-header__name",children:e.name}),u.jsx("span",{className:"side-bar-group-header__count","aria-label":`${n} operations`,children:n})]})}function FB({collapsed:e}){return u.jsx("svg",{viewBox:"0 0 12 12","aria-hidden":"true",className:`side-bar-group-header__arrow${e?" is-collapsed":""}`,children:u.jsx("path",{d:"M3 5l3 3 3-3",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})})}const g2="fleet-console.operations.side-width",m2="fleet-console.operations.side-collapsed",_h=56,WB=180,SS=WB;function GB(){return typeof window<"u"?window.innerWidth-480:800}function qB(){try{if(typeof window>"u")return SS;const e=localStorage.getItem(g2);if(e!==null){const n=parseInt(e,10);if(!isNaN(n)&&n>=_h)return n}}catch{}return SS}function KB(){try{return typeof window>"u"?!1:localStorage.getItem(m2)==="1"}catch{}return!1}let Ql={width:qB(),collapsed:KB()};const Gg=new Set;function _2(){for(const e of Gg)e()}function wS(){return Ql}function VB(e){return Gg.add(e),()=>{Gg.delete(e)}}function YB(){return M.useSyncExternalStore(VB,wS,wS)}function xS(e){const n=Math.max(_h,Math.min(GB(),e));Ql={...Ql,width:n};try{typeof window<"u"&&localStorage.setItem(g2,String(n))}catch{}_2()}function XB(e){Ql={...Ql,collapsed:e};try{typeof window<"u"&&localStorage.setItem(m2,e?"1":"0")}catch{}_2()}function ZB(e){return e<120?"rail":e<240?"list":"detail"}const JB=1500,QB=6,CS=34,ES=18;function e9({operations:e,groups:n,minimized:i,activeOperationId:s,operationNotifications:o,catalog:f,canLaunch:g,mapFullscreen:c,radarEnabled:h,perimeterEnabled:d,renderKindIcon:b,onLaunchKind:m,onResetView:w,onMaximizeMap:x,onToggleRadar:T,onTogglePerimeter:E,onClose:p,onFocus:v,onSetAccent:_,onRename:S,onSetGroupId:k,onCreateGroup:L,onSetGroupColor:R,onRenameGroup:N,onUngroupAll:A}){const B=M.useRef(null),q=YB(),{width:F,collapsed:W}=q,I=W?"rail":ZB(F),Y=nw(),V=M.useRef(null),[z,G]=M.useState(null),[K,j]=M.useState(null),H=M.useRef(null),D=M.useRef([]),P=M.useRef([]),Z=M.useRef([]),ee=M.useRef(k),[J,se]=M.useState(null),[X,$]=M.useState(null),[ae,de]=M.useState(null),we=KT(),ye=new Set(i),Ne=new Set(we),Oe=Ow(e,Y.operationOrder).map(ve=>{const $e=f.find(at=>at.id===ve.pluginId)?.kinds.find(at=>at.type===ve.type)??null,Je=$e?b(ve.pluginId,$e):null;return{operation:ve,active:s===ve.id,minimized:ye.has(ve.id),notificationCount:o[ve.id]?1:0,icon:Je}}),Ge=t9(Oe,n,Y.operationOrder),vt=Ge.flatMap(ve=>Ne.has(ve.groupId??"")?[]:ve.entries),Le=Oe.map(ve=>ve.operation.id),Rt=M.useCallback(()=>{V.current!==null&&(window.clearTimeout(V.current),V.current=null)},[]),Xt=M.useCallback(()=>{Rt(),G(null)},[Rt]),vn=M.useCallback(ve=>{Rt(),G(ve),V.current=window.setTimeout(()=>{V.current=null,G(null)},JB)},[Rt]);M.useEffect(()=>Rt,[Rt]),M.useEffect(()=>{z!==null&&(Oe.some(ve=>ve.operation.id===z)||Xt())},[z,Oe,Xt]);const on=J?.kind==="chip"?Oe.find(ve=>ve.operation.id===J.operationId)?.operation??null:null,kn=J?.kind==="group"?n.find(ve=>ve.id===J.groupId)??null:null,Zt=(ve,$e)=>{const Je=vt.findIndex(Dt=>Dt.operation.id===ve);if(Je===-1)return;const at=Math.max(0,Math.min(vt.length-1,Je+$e));if(at===Je)return;const Ve=vt.map(Dt=>Dt.operation.id),ln=BB(Ve,ve,at);Gf(IB(Le,Ve,ln))},ut=Ge.map(ve=>({groupId:ve.groupId,entryIds:ve.entries.map($e=>$e.operation.id)}));M.useEffect(()=>{D.current=Oe,P.current=Le,Z.current=ut,ee.current=k});const Lt=ve=>{H.current=ve,j(ve)},Ct=K?.pointerId??null;M.useEffect(()=>{if(Ct===null)return;const ve=at=>{if(at.pointerId!==Ct)return;const Ve=H.current;if(!Ve)return;if(at.buttons===0){Lt(null);return}const ln=Math.hypot(at.clientX-Ve.startX,at.clientY-Ve.startY);if(!Ve.dragging&&ln<QB)return;Ve.dragging&&at.preventDefault();const Dt=OB(at.clientY,Z.current,B.current,Ve.sourceId);n9(at.clientY,B.current),Lt({...Ve,currentY:at.clientY,dragging:!0,dropIndex:Dt.index,dropGroupId:Dt.groupId})},$e=at=>{if(at.pointerId!==Ct)return;const Ve=H.current;if(Lt(null),!Ve?.dragging)return;const{sourceId:ln,sourceGroupId:Dt,dropIndex:An,dropGroupId:Un}=Ve,jt=Z.current,te=P.current;if(Un!==Dt){const ke=jt.find(Ce=>Ce.groupId===Un)?.entryIds??[];Gf(DB(te,ln,An,ke)),ee.current(ln,Un);return}const Se=jt.find(ht=>ht.groupId===Dt)?.entryIds??[],je=Se.indexOf(ln);if(je===-1||An===je)return;const bt=jB(te,ln,An,Se);Gf(bt)},Je=at=>{at.pointerId===Ct&&Lt(null)};return window.addEventListener("pointermove",ve),window.addEventListener("pointerup",$e),window.addEventListener("pointercancel",Je),()=>{window.removeEventListener("pointermove",ve),window.removeEventListener("pointerup",$e),window.removeEventListener("pointercancel",Je)}},[Ct]);const Ft=(ve,$e)=>{if(ve.button!==0||ve.target instanceof Element&&ve.target.closest("button"))return;se(null),Xt();const at=Oe.find(Ve=>Ve.operation.id===$e)?.operation.groupId??null;Lt({sourceId:$e,sourceGroupId:at,pointerId:ve.pointerId,startX:ve.clientX,startY:ve.clientY,currentY:ve.clientY,dragging:!1,dropIndex:Le.indexOf($e),dropGroupId:at})},Kt=M.useCallback(ve=>{ve.preventDefault();const $e=ve.clientX,Je=q.width,at=ln=>{const Dt=ln.clientX-$e;xS(Je+Dt)},Ve=()=>{document.removeEventListener("pointermove",at),document.removeEventListener("pointerup",Ve)};document.addEventListener("pointermove",at),document.addEventListener("pointerup",Ve)},[q.width]),Jn=()=>{XB(!W),W||xS(_h)},bn=ve=>{if(X){$(null);return}de(null);const $e=ve.currentTarget.getBoundingClientRect();$({anchor:{x:$e.right+8,y:$e.top},viewportBounds:{width:window.innerWidth,height:window.innerHeight}})},Pn=ve=>{ve.defaultPrevented||(ve.preventDefault(),de(null),se(null),$({anchor:{x:ve.clientX,y:ve.clientY},viewportBounds:{width:window.innerWidth,height:window.innerHeight}}))},dt=ve=>{if(ae){de(null);return}$(null);const $e=ve.currentTarget.getBoundingClientRect();de({anchor:{x:$e.right+8,y:$e.top},viewportBounds:{width:window.innerWidth,height:window.innerHeight}})},Tn=W?_h:F;return Oe.length===0&&I==="rail"?u.jsxs("aside",{className:"operations-side-bar","data-tier":I,"data-canvas-blocker":!0,style:{"--side-bar-width":`${Tn}px`},onContextMenu:Pn,children:[u.jsx("header",{className:"operations-side-bar-header",children:u.jsx("button",{type:"button",className:"side-bar-new-btn",onClick:bn,"aria-label":"New Operation",title:"New Operation",children:u.jsx(kS,{})})}),u.jsx("div",{className:"operations-side-bar-resize-handle",onPointerDown:Kt,onDoubleClick:Jn,"aria-hidden":"true"}),X?Cs.createPortal(u.jsx(Ku,{anchor:X.anchor,viewportBounds:X.viewportBounds,placement:"cursor",mode:"launch",catalog:f,canLaunch:g,renderKindIcon:b,onLaunchKind:(ve,$e)=>{$(null),m(ve,$e)},onResetView:w,onClose:()=>$(null)},`${X.anchor.x}:${X.anchor.y}`),document.body):null]}):u.jsxs("aside",{className:"operations-side-bar","data-tier":I,"data-canvas-blocker":!0,style:{"--side-bar-width":`${Tn}px`},onContextMenu:Pn,children:[u.jsxs("header",{className:"operations-side-bar-header",children:[u.jsxs("button",{type:"button",className:"side-bar-new-btn",onClick:bn,"aria-label":"New Operation","aria-expanded":X!==null,title:"New Operation",children:[u.jsx(kS,{}),I!=="rail"?u.jsx("span",{children:"Operation"}):null]}),I!=="rail"?u.jsx("button",{type:"button",className:"side-bar-settings-btn",onClick:dt,"aria-expanded":ae!==null,"aria-label":"Map and display controls",title:"Map and display controls",children:u.jsx(i9,{})}):null]}),u.jsx("ol",{className:"operations-side-bar-chips",ref:B,"aria-label":"Operations",children:Ge.map(ve=>{const $e=ve.groupId!==null&&Ne.has(ve.groupId),Je=ve.group?Zl(ve.group.color):null,at=Je?{"--grp-color":Je}:void 0;return u.jsxs("li",{"data-drop-zone-group-id":ve.groupId??"__ungrouped__",className:ve.groupId?"side-bar-group-section":"side-bar-ungrouped-section",style:at,children:[ve.group?u.jsx(UB,{group:ve.group,count:ve.entries.length,collapsed:$e,tier:I,onToggle:qT,onContextMenu:(Ve,ln)=>se({kind:"group",groupId:Ve,anchor:ln})}):ve.entries.length>0?u.jsx("div",{className:"side-bar-ungrouped-label","aria-label":"Ungrouped operations",children:I!=="rail"?u.jsx("span",{children:"Ungrouped"}):null}):null,$e?null:u.jsx("ol",{className:["side-bar-group-chips",K?.dragging&&K.dropGroupId===ve.groupId&&K.dropGroupId!==K.sourceGroupId?"side-bar-section--drop-target":""].filter(Boolean).join(" "),"data-group-section-id":ve.groupId??"__ungrouped__","aria-label":ve.group?ve.group.name:"Ungrouped",children:ve.entries.map(Ve=>{const ln=Oe.indexOf(Ve),Dt=ve.entries.indexOf(Ve),An=Y.operationAccent[Ve.operation.id]??aS(Ve.operation),Un=An?Zl(An):null;return u.jsx(PB,{entry:Ve,index:ln,isCloseArmed:z===Ve.operation.id,accentValue:Un,dragging:K?.sourceId===Ve.operation.id&&K.dragging,dragOffsetY:K?.sourceId===Ve.operation.id&&K.dragging?K.currentY-K.startY:0,dropTarget:K?.dragging===!0&&K.dropGroupId===ve.groupId&&K.dropGroupId===K.sourceGroupId&&K.dropIndex===Dt&&K.sourceId!==Ve.operation.id,onArmClose:vn,onDisarmClose:Xt,onClose:p,onFocus:v,onKeyboardMove:Zt,onPointerDragStart:Ft,onOpenAccent:(jt,te)=>se({kind:"chip",operationId:jt,anchor:te}),onRename:S},Ve.operation.id)})})]},ve.groupId??"__ungrouped__")})}),u.jsx("div",{className:"operations-side-bar-resize-handle",onPointerDown:Kt,onDoubleClick:Jn,"aria-hidden":"true"}),X?Cs.createPortal(u.jsx(Ku,{anchor:X.anchor,viewportBounds:X.viewportBounds,placement:"cursor",mode:"launch",catalog:f,canLaunch:g,renderKindIcon:b,onLaunchKind:(ve,$e)=>{$(null),m(ve,$e)},onResetView:w,onClose:()=>$(null)},`${X.anchor.x}:${X.anchor.y}`),document.body):null,ae?Cs.createPortal(u.jsx(Ku,{anchor:ae.anchor,viewportBounds:ae.viewportBounds,placement:"cursor",mode:"controls",catalog:f,canLaunch:g,mapFullscreen:c,radarEnabled:h,perimeterEnabled:d,renderKindIcon:b,onLaunchKind:m,onResetView:()=>{de(null),w()},onMaximizeMap:x,onToggleRadar:T,onTogglePerimeter:E,onClose:()=>de(null)},`settings:${ae.anchor.x}:${ae.anchor.y}`),document.body):null,J?.kind==="chip"&&on?u.jsx(yS,{kind:"chip",operation:on,groups:n,accentKey:Y.operationAccent[on.id]??aS(on),anchor:J.anchor,actions:{onSetAccent:ve=>_(on.id,ve),onSetGroupId:ve=>k(on.id,ve),onCreateGroup:ve=>L(on.theaterId,ve,on.id)},onClose:()=>se(null)}):J?.kind==="group"&&kn?u.jsx(yS,{kind:"group-header",group:kn,anchor:J.anchor,actions:{onSetColor:ve=>R(kn.id,ve),onRename:ve=>N(kn.id,ve),onUngroupAll:()=>A(kn.id)},onClose:()=>se(null)}):null]})}function t9(e,n,i){const s=[...n].sort((c,h)=>c.order-h.order||c.createdAt-h.createdAt),o=s.map(c=>({groupId:c.id,group:c,entries:[]})),f={groupId:null,group:null,entries:[]},g=new Map(s.map(c=>[c.id,c]));for(const c of e){const h=c.operation.groupId??null;h!==null&&g.has(h)?o.find(b=>b.groupId===h)?.entries.push(c):f.entries.push(c)}return[...o,f]}function n9(e,n){if(!n)return;const i=n.getBoundingClientRect();e<i.top+CS?n.scrollTop-=ES:e>i.bottom-CS&&(n.scrollTop+=ES)}function kS(){return u.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[u.jsx("circle",{cx:"12",cy:"12",r:"7",fill:"none",stroke:"currentColor",strokeWidth:"1.4"}),u.jsx("path",{d:"M12 2.4v3.4M12 18.2v3.4M2.4 12h3.4M18.2 12h3.4",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}),u.jsx("path",{d:"M12 9.2v5.6M9.2 12h5.6",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]})}function i9(){return u.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[u.jsx("circle",{cx:"8",cy:"8",r:"2.2",fill:"none",stroke:"currentColor",strokeWidth:"1.25"}),u.jsx("path",{d:"M8 1.4v1.4M8 13.2v1.4M1.4 8h1.4M13.2 8h1.4M3.3 3.3l1 1M11.7 11.7l1 1M11.7 3.3l-1 1M3.3 11.7l-1 1",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"})]})}const r9='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function s9(){const{codexReader:e,codexReaderExpanded:n,activeTheaterId:i}=$r(),s=M.useRef(null),o=M.useRef(null),f=M.useRef(null),g=e?`${e.kind}:${e.kind==="entry"?e.entryId:e.kind==="drydock"?e.patchId??"":e.id??""}`:null,c=e!==null&&n,h=M.useCallback(()=>{fB(),gR()},[]);return M.useEffect(()=>{if(!c)return;const d=e;document.body.setAttribute("data-codex-reading","true");const b=document.querySelector(".operations-canvas"),m=document.querySelector(".operations-side-bar");b?.setAttribute("inert",""),m?.setAttribute("inert","");const w=x=>{if(x.key==="Escape"){x.preventDefault(),x.stopPropagation(),h();return}x.key==="Tab"&&a9(s.current,x)};return window.addEventListener("keydown",w,!0),()=>{window.removeEventListener("keydown",w,!0),document.body.removeAttribute("data-codex-reading"),b?.removeAttribute("inert"),m?.removeAttribute("inert");const x=d?.kind==="entry"?d.entryId:null;(document.querySelector('[data-codex-expand="true"]')??(x?document.querySelector(`.codex-nav-entry.is-current[data-entry-id="${x}"]`):null)??document.querySelector(".codex-navigator .codex-nav-search-input"))?.focus()}},[c]),M.useEffect(()=>{if(!c||!o.current||!f.current||!e)return;const d=e.kind,b=d==="drydock"?e.patchId:d==="conflicts"?e.id:void 0;h2(o.current,f.current,{initialEntryId:d==="entry"?e.entryId:"",kind:d,subId:b,theaterId:i,onRelatedClick:m=>{Br({kind:"entry",entryId:m}),Hu()},onClose:h,onPatchOpen:m=>{Br({kind:"drydock",patchId:m}),Hu()},onDecided:()=>{mh(),Br({kind:"drydock",patchId:void 0}),Hu()}}),requestAnimationFrame(()=>{s.current?.querySelector("[data-sheet-initial-focus]")?.focus()})},[c,g]),c?Cs.createPortal(u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"codex-reading-scrim",onClick:h,"aria-hidden":"true"}),u.jsxs("div",{ref:s,className:"codex-reading-sheet",role:"dialog","aria-modal":"true","aria-label":"Codex reading",children:[u.jsxs("div",{className:"codex-reading-sheet-head",children:[u.jsx("span",{className:"codex-reading-sheet-eyebrow",children:"Codex · Reading"}),u.jsx("button",{"data-sheet-initial-focus":!0,className:"codex-reading-sheet-close",type:"button","aria-label":"Close reading",onClick:h,children:"✕"})]}),u.jsxs("div",{className:"codex-reading-sheet-body",children:[u.jsx("div",{ref:o,className:"codex-reading-sheet-read"}),u.jsx("aside",{ref:f,className:"codex-reading-sheet-toc","aria-label":"On this page"})]})]})]}),document.body):null}function a9(e,n){if(!e)return;const i=[...e.querySelectorAll(r9)].filter(f=>!f.closest("[inert]"));if(i.length===0)return;const s=i[0],o=i[i.length-1];n.shiftKey?document.activeElement===s&&(n.preventDefault(),o.focus()):document.activeElement===o&&(n.preventDefault(),s.focus())}const o9=Ch().api,qg=560,Kg=360,Bp=new Set;function l9({state:e}){const n=M.useRef(null),i=rw(),s=sw(),o=WT(),f=GT(),g=iw(),c=ic(),[h,d]=M.useState([]),b=M.useMemo(()=>c9(e).map(z=>z.id),[e.operations,e.activeTheaterId]),m=M.useRef(e);m.current=e,M.useEffect(()=>{JT(e.activeTheaterId)},[e.activeTheaterId]),M.useEffect(()=>{if(!e.activeTheaterId){d([]);return}MS().then(d).catch(()=>{})},[e.activeTheaterId]),M.useEffect(()=>{const z={current:i},G=K=>{if(!K.altKey||K.metaKey||K.ctrlKey||K.shiftKey||K.key!=="ArrowLeft"&&K.key!=="ArrowRight")return;const j=document.activeElement;if(j instanceof HTMLElement&&j.matches("input, textarea, [contenteditable='true']")&&!j.closest(".xterm"))return;const H=m.current,D=ho(),P=dR(H.operations.filter(J=>J.theaterId===H.activeTheaterId),H.groups.filter(J=>J.theaterId===H.activeTheaterId),D.operationOrder,D.collapsedGroups).map(J=>J.id);if(P.length===0)return;K.preventDefault(),K.stopImmediatePropagation();const Z=z.current??m.current.activeOperationId,ee=hR(P,Z,K.key==="ArrowRight"?1:-1);if(ee){if(z.current){or(ee),Bl(ee);return}wh(ee)}};return window.addEventListener("keydown",G,!0),()=>window.removeEventListener("keydown",G,!0)},[i]),M.useEffect(()=>{for(const z of b)XT(z);e.operationsHydrated&&ZT(b)},[b,e.operationsHydrated]),M.useEffect(()=>{const z=e.pendingOperationFocus;if(z===null)return;if(Xp()!==null){Bl(z),Zb();return}fo();const G=TS(n.current);G&&Ub(z,G),Zb()},[e.pendingOperationFocus]);const w=!!e.activeTheaterId&&!e.addingTheater,x=(e.operations??[]).filter(z=>z.theaterId===e.activeTheaterId),T=(e.groups??[]).filter(z=>z.theaterId===e.activeTheaterId),E=M.useCallback((z,G)=>c.plugins.find(j=>j.id===z)?.renderLaunchIcon?.(G)??null,[c.plugins]),p=M.useCallback((z,G,K)=>{if(!m.current.activeTheaterId)return;const j={...AS(K),zIndex:ia()};Pp(z,G,j,m.current.activeTheaterId,c.plugins)},[c.plugins]),v=M.useCallback((z,G)=>{if(!m.current.activeTheaterId)return;const K=h9(n.current),j={...AS(K),zIndex:ia()};Pp(z,G,j,m.current.activeTheaterId,c.plugins)},[c.plugins]),_=M.useCallback((z,G,K)=>{m.current.activeTheaterId&&Pp(z,G,K,m.current.activeTheaterId,c.plugins)},[c.plugins]),S=M.useCallback(()=>{aw({x:0,y:0,zoom:1})},[]),k=M.useCallback(()=>{nA()},[]),L=M.useCallback(()=>{QT()},[]),R=M.useCallback(()=>{eA()},[]),N=M.useCallback(z=>{const G=m.current.operations.find(P=>P.id===z);if(!G)return;const K=Xp();if(K!==null&&K!==z){or(z),Bl(z);return}const j=ho(),H=j.operations[z]??G.geometry??u9(G);j.operations[z]||Jp(z,H),YT(z),or(z);const D=TS(n.current);D&&Ub(z,D)},[]),A=M.useCallback((z,G)=>{zu(z,{accent:G}).then(()=>Si(null)).then(wi).catch(()=>{})},[]),B=M.useCallback((z,G)=>{vw(z,G).then(()=>Si(null)).then(wi).catch(()=>{})},[]),q=M.useCallback((z,G)=>{zu(z,{groupId:G}).then(()=>Si(null)).then(wi).catch(()=>{})},[]),F=M.useCallback((z,G,K)=>{BA({theaterId:z,name:G,color:"blue"}).then(j=>zu(K,{groupId:j.id})).then(()=>Promise.all([Si(null).then(wi),Rl().then(Ll)])).catch(()=>{})},[]),W=M.useCallback((z,G)=>{G&&Yb(z,{color:G}).then(()=>Rl()).then(Ll).catch(()=>{})},[]),I=M.useCallback((z,G)=>{Yb(z,{name:G}).then(()=>Rl()).then(Ll).catch(()=>{})},[]),Y=M.useCallback(z=>{PA(z).then(()=>Promise.all([Si(null).then(wi),Rl().then(Ll)])).catch(()=>{})},[]),V=M.useCallback(z=>{if(Bp.has(z))return;Bp.add(z);const G=m.current.operations.find(j=>j.id===z)?.pluginId,K=(G?c.plugins.find(j=>j.id===G):null)??null;d9(z,K).finally(()=>Bp.delete(z))},[c.plugins]);return u.jsxs("div",{className:"console-body is-canvas",ref:n,children:[u.jsx(e9,{operations:x,groups:T,minimized:s,activeOperationId:e.activeOperationId,operationNotifications:e.operationNotifications,catalog:h,canLaunch:w,mapFullscreen:g,radarEnabled:o,perimeterEnabled:f,renderKindIcon:E,onLaunchKind:v,onResetView:S,onMaximizeMap:k,onToggleRadar:L,onTogglePerimeter:R,onClose:V,onFocus:N,onSetAccent:A,onRename:B,onSetGroupId:q,onCreateGroup:F,onSetGroupColor:W,onRenameGroup:I,onUngroupAll:Y}),u.jsx(sI,{state:e,catalog:h,canLaunch:w,mapFullscreen:g,radarEnabled:o,perimeterEnabled:f,renderKindIcon:E,onLaunchKind:p,onLaunchAtGeometry:_,onResetView:S,onMaximizeMap:k,onToggleRadar:L,onTogglePerimeter:R,onClose:V,onFocus:N,onSetAccent:A}),u.jsx(TB,{theaterId:e.activeTheaterId,api:o9}),u.jsx(s9,{})]})}function c9(e){return e.operations.filter(n=>n.theaterId===e.activeTheaterId).sort(sg)}function TS(e){if(!e)return null;const n=e.getBoundingClientRect();return{width:n.width,height:n.height}}function u9(e){return e.geometry??{x:0,y:0,width:qg,height:Kg,zIndex:0}}function h9(e){const n=ho(),i=e?.clientWidth??800,s=e?.clientHeight??600;return Xl({x:i/2,y:s/2},n.viewport)}function AS(e){return{x:e.x-qg/2,y:e.y-Kg/2,width:qg,height:Kg}}async function Pp(e,n,i,s,o){const f=o.find(m=>m.id===e),c=Ch(()=>{Si(null).then(wi).catch(()=>{})});let h=null;if(f?.launch?h=(await f.launch({theaterId:s,kind:n,geometry:i,operations:c.operations})).id:h=(await c.operations.create({theaterId:s,type:n.type,pluginId:e,title:n.title,geometry:i})).id,await Si(null).then(wi).catch(()=>{}),!h)return;const d=FT()===s,b=ig().operations.some(m=>m.id===h);d&&b&&Xp()!==null?(or(h),Bl(h)):wh(h)}async function d9(e,n){try{n?.closeOperation&&await n.closeOperation(e)}catch{}await fetch(`/api/v1/operations/${encodeURIComponent(e)}`,{method:"DELETE"}).catch(()=>{}),await Si(null).then(wi).catch(()=>{})}const f9=6e3;function p9(){const e=$r(),n=Ui(),i=ic(),s=n.pathname,f=iw()&&s.startsWith("/operations"),g=s.startsWith("/operations");return M.useEffect(()=>{const c=Ch(()=>{Si().then(wi).catch(()=>{})}),h=i.plugins.map(d=>d.install?.(c)).filter(d=>typeof d=="function");return()=>{for(const d of h)d()}},[i.plugins]),M.useEffect(()=>{tR(g)},[g]),M.useEffect(()=>{const c=document.querySelector(".topbar");if(!c)return;const h=()=>{document.documentElement.style.setProperty("--console-topbar-offset",`${Math.round(c.getBoundingClientRect().bottom)}px`)};h();const d=new ResizeObserver(h);return d.observe(c),window.addEventListener("resize",h),()=>{d.disconnect(),window.removeEventListener("resize",h)}},[]),M.useEffect(()=>{const c=new AbortController;NA(c.signal).then(b=>{sR(b),e1()}).catch(b=>{c.signal.aborted||(Ze({theaterError:b instanceof Error?b.message:String(b)}),e1())}),Si(null,c.signal).then(wi).catch(()=>{}),Rl(null,c.signal).then(Ll).catch(()=>{}),Tw(),gw({signal:c.signal}).then(Aw).catch(b=>{c.signal.aborted||Rw(b instanceof Error?b.message:String(b))});const h=()=>{OA(e.activeTheaterId,c.signal).then(nR).catch(()=>{})};h();const d=window.setTimeout(h,f9);return()=>{window.clearTimeout(d),c.abort()}},[]),M.useEffect(()=>{const c=h=>{(h.metaKey||h.ctrlKey)&&h.key.toLowerCase()==="k"&&(h.preventDefault(),h.stopImmediatePropagation(),fR())};return window.addEventListener("keydown",c,!0),()=>window.removeEventListener("keydown",c,!0)},[]),u.jsxs("div",{className:`console-shell ${f?"is-map-fullscreen":""}`,children:[u.jsx(n3,{state:e}),u.jsxs(sT,{children:[u.jsx(Ka,{path:"/",element:u.jsx(Bb,{to:"/operations",replace:!0})}),u.jsx(Ka,{path:"/operations",element:u.jsx(l9,{state:e})}),u.jsx(Ka,{path:"/carrier-settings",element:u.jsx(T8,{})}),u.jsx(Ka,{path:"/settings",element:u.jsx(o7,{})}),u.jsx(Ka,{path:"*",element:u.jsx(Bb,{to:"/operations",replace:!0})})]}),u.jsx(FR,{state:e}),u.jsx(C3,{state:e}),u.jsx(HR,{state:e}),u.jsx(YR,{open:e.connectionError!==null,tone:"error",title:"Console link interrupted",message:e.connectionError??void 0})]})}const g9=3e4;let ju=1e3,Iu=null;function v2(){Iu!==null&&clearTimeout(Iu);const e=new EventSource("/api/v1/operations/events");e.addEventListener("operation:changed",n=>{const i=n;try{const s=JSON.parse(i.data);m9(s.operation)&&aR(s.operation)}catch{}}),e.onopen=()=>{ju=1e3},e.onerror=()=>{e.close(),Iu=setTimeout(()=>{Iu=null,ju=Math.min(ju*2,g9),Si().then(wi).catch(()=>{}).finally(v2)},ju)}}function m9(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}globalThis.__fleetConsoleRuntime__={react:Ju,"react/jsx-runtime":C5,"@fleet-console/sdk/plugin/browser":W5,"@fleet-console/sdk/settings/browser":Z5,"@fleet-console/sdk/operations/browser":N5,"@fleet-console/sdk/notifications/browser":Q5,"@fleet-console/sdk/react/browser":tk};try{const e=await HC();kw(e.theme)}catch{}const _9=await e8();v2();const RS=document.querySelector("#app");RS&&ok.createRoot(RS).render(u.jsx(M.StrictMode,{children:u.jsx(RT,{basename:"/console",children:u.jsx(Qj,{value:_9,children:u.jsx(p9,{})})})}));export{VO as _,v9 as a,Vg as g,At as k,Hl as p};
|