create-claudeportal 0.1.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/bin/cli.js +37 -0
- package/dist/assets/index-BBU5K5iA.js +132 -0
- package/dist/assets/index-fNmv07eE.css +1 -0
- package/dist/index.html +13 -0
- package/index.html +12 -0
- package/mockups/01-chat-conversation-v2.html +803 -0
- package/mockups/01-chat-conversation.html +592 -0
- package/mockups/02-activity-feed.html +648 -0
- package/mockups/03-focused-workspace.html +680 -0
- package/mockups/04-documents-mode.html +1556 -0
- package/package.json +54 -0
- package/server/index.js +140 -0
- package/server/lib/detect-tools.js +93 -0
- package/server/lib/file-scanner.js +46 -0
- package/server/lib/file-watcher.js +45 -0
- package/server/lib/fix-npm-prefix.js +61 -0
- package/server/lib/folder-scanner.js +43 -0
- package/server/lib/install-tools.js +122 -0
- package/server/lib/platform.js +18 -0
- package/server/lib/sse-manager.js +36 -0
- package/server/lib/terminal.js +95 -0
- package/server/lib/validate-folder-path.js +17 -0
- package/server/lib/validate-path.js +13 -0
- package/server/routes/detect.js +64 -0
- package/server/routes/doc-events.js +94 -0
- package/server/routes/events.js +37 -0
- package/server/routes/folder.js +195 -0
- package/server/routes/github.js +21 -0
- package/server/routes/health.js +16 -0
- package/server/routes/install.js +102 -0
- package/server/routes/project.js +18 -0
- package/server/routes/scaffold.js +45 -0
- package/skills-lock.json +15 -0
- package/tsconfig.app.json +17 -0
- package/tsconfig.node.json +11 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/ui/app.js +747 -0
- package/ui/index.html +272 -0
- package/ui/styles.css +788 -0
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))l(o);new MutationObserver(o=>{for(const h of o)if(h.type==="childList")for(const d of h.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&l(d)}).observe(document,{childList:!0,subtree:!0});function n(o){const h={};return o.integrity&&(h.integrity=o.integrity),o.referrerPolicy&&(h.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?h.credentials="include":o.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function l(o){if(o.ep)return;o.ep=!0;const h=n(o);fetch(o.href,h)}})();var Oh={exports:{}},Fn={};var og;function ny(){if(og)return Fn;og=1;var e=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function n(l,o,h){var d=null;if(h!==void 0&&(d=""+h),o.key!==void 0&&(d=""+o.key),"key"in o){h={};for(var _ in o)_!=="key"&&(h[_]=o[_])}else h=o;return o=h.ref,{$$typeof:e,type:l,key:d,ref:o!==void 0?o:null,props:h}}return Fn.Fragment=i,Fn.jsx=n,Fn.jsxs=n,Fn}var cg;function ly(){return cg||(cg=1,Oh.exports=ny()),Oh.exports}var m=ly(),Lh={exports:{}},_e={};var hg;function ay(){if(hg)return _e;hg=1;var e=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),d=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),x=Symbol.iterator;function C(k){return k===null||typeof k!="object"?null:(k=x&&k[x]||k["@@iterator"],typeof k=="function"?k:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R=Object.assign,L={};function X(k,H,F){this.props=k,this.context=H,this.refs=L,this.updater=F||b}X.prototype.isReactComponent={},X.prototype.setState=function(k,H){if(typeof k!="object"&&typeof k!="function"&&k!=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,k,H,"setState")},X.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function se(){}se.prototype=X.prototype;function $(k,H,F){this.props=k,this.context=H,this.refs=L,this.updater=F||b}var W=$.prototype=new se;W.constructor=$,R(W,X.prototype),W.isPureReactComponent=!0;var Y=Array.isArray;function Q(){}var J={H:null,A:null,T:null,S:null},Se=Object.prototype.hasOwnProperty;function Te(k,H,F){var ee=F.ref;return{$$typeof:e,type:k,key:H,ref:ee!==void 0?ee:null,props:F}}function zt(k,H){return Te(k.type,H,k.props)}function de(k){return typeof k=="object"&&k!==null&&k.$$typeof===e}function G(k){var H={"=":"=0",":":"=2"};return"$"+k.replace(/[=:]/g,function(F){return H[F]})}var I=/\/+/g;function te(k,H){return typeof k=="object"&&k!==null&&k.key!=null?G(""+k.key):H.toString(36)}function Z(k){switch(k.status){case"fulfilled":return k.value;case"rejected":throw k.reason;default:switch(typeof k.status=="string"?k.then(Q,Q):(k.status="pending",k.then(function(H){k.status==="pending"&&(k.status="fulfilled",k.value=H)},function(H){k.status==="pending"&&(k.status="rejected",k.reason=H)})),k.status){case"fulfilled":return k.value;case"rejected":throw k.reason}}throw k}function T(k,H,F,ee,oe){var he=typeof k;(he==="undefined"||he==="boolean")&&(k=null);var ye=!1;if(k===null)ye=!0;else switch(he){case"bigint":case"string":case"number":ye=!0;break;case"object":switch(k.$$typeof){case e:case i:ye=!0;break;case S:return ye=k._init,T(ye(k._payload),H,F,ee,oe)}}if(ye)return oe=oe(k),ye=ee===""?"."+te(k,0):ee,Y(oe)?(F="",ye!=null&&(F=ye.replace(I,"$&/")+"/"),T(oe,H,F,"",function(wi){return wi})):oe!=null&&(de(oe)&&(oe=zt(oe,F+(oe.key==null||k&&k.key===oe.key?"":(""+oe.key).replace(I,"$&/")+"/")+ye)),H.push(oe)),1;ye=0;var at=ee===""?".":ee+":";if(Y(k))for(var Ae=0;Ae<k.length;Ae++)ee=k[Ae],he=at+te(ee,Ae),ye+=T(ee,H,F,he,oe);else if(Ae=C(k),typeof Ae=="function")for(k=Ae.call(k),Ae=0;!(ee=k.next()).done;)ee=ee.value,he=at+te(ee,Ae++),ye+=T(ee,H,F,he,oe);else if(he==="object"){if(typeof k.then=="function")return T(Z(k),H,F,ee,oe);throw H=String(k),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(k).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.")}return ye}function j(k,H,F){if(k==null)return k;var ee=[],oe=0;return T(k,ee,"","",function(he){return H.call(F,he,oe++)}),ee}function q(k){if(k._status===-1){var H=k._result;H=H(),H.then(function(F){(k._status===0||k._status===-1)&&(k._status=1,k._result=F)},function(F){(k._status===0||k._status===-1)&&(k._status=2,k._result=F)}),k._status===-1&&(k._status=0,k._result=H)}if(k._status===1)return k._result.default;throw k._result}var ae=typeof reportError=="function"?reportError:function(k){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var H=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof k=="object"&&k!==null&&typeof k.message=="string"?String(k.message):String(k),error:k});if(!window.dispatchEvent(H))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",k);return}console.error(k)},fe={map:j,forEach:function(k,H,F){j(k,function(){H.apply(this,arguments)},F)},count:function(k){var H=0;return j(k,function(){H++}),H},toArray:function(k){return j(k,function(H){return H})||[]},only:function(k){if(!de(k))throw Error("React.Children.only expected to receive a single React element child.");return k}};return _e.Activity=y,_e.Children=fe,_e.Component=X,_e.Fragment=n,_e.Profiler=o,_e.PureComponent=$,_e.StrictMode=l,_e.Suspense=p,_e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=J,_e.__COMPILER_RUNTIME={__proto__:null,c:function(k){return J.H.useMemoCache(k)}},_e.cache=function(k){return function(){return k.apply(null,arguments)}},_e.cacheSignal=function(){return null},_e.cloneElement=function(k,H,F){if(k==null)throw Error("The argument must be a React element, but you passed "+k+".");var ee=R({},k.props),oe=k.key;if(H!=null)for(he in H.key!==void 0&&(oe=""+H.key),H)!Se.call(H,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&H.ref===void 0||(ee[he]=H[he]);var he=arguments.length-2;if(he===1)ee.children=F;else if(1<he){for(var ye=Array(he),at=0;at<he;at++)ye[at]=arguments[at+2];ee.children=ye}return Te(k.type,oe,ee)},_e.createContext=function(k){return k={$$typeof:d,_currentValue:k,_currentValue2:k,_threadCount:0,Provider:null,Consumer:null},k.Provider=k,k.Consumer={$$typeof:h,_context:k},k},_e.createElement=function(k,H,F){var ee,oe={},he=null;if(H!=null)for(ee in H.key!==void 0&&(he=""+H.key),H)Se.call(H,ee)&&ee!=="key"&&ee!=="__self"&&ee!=="__source"&&(oe[ee]=H[ee]);var ye=arguments.length-2;if(ye===1)oe.children=F;else if(1<ye){for(var at=Array(ye),Ae=0;Ae<ye;Ae++)at[Ae]=arguments[Ae+2];oe.children=at}if(k&&k.defaultProps)for(ee in ye=k.defaultProps,ye)oe[ee]===void 0&&(oe[ee]=ye[ee]);return Te(k,he,oe)},_e.createRef=function(){return{current:null}},_e.forwardRef=function(k){return{$$typeof:_,render:k}},_e.isValidElement=de,_e.lazy=function(k){return{$$typeof:S,_payload:{_status:-1,_result:k},_init:q}},_e.memo=function(k,H){return{$$typeof:f,type:k,compare:H===void 0?null:H}},_e.startTransition=function(k){var H=J.T,F={};J.T=F;try{var ee=k(),oe=J.S;oe!==null&&oe(F,ee),typeof ee=="object"&&ee!==null&&typeof ee.then=="function"&&ee.then(Q,ae)}catch(he){ae(he)}finally{H!==null&&F.types!==null&&(H.types=F.types),J.T=H}},_e.unstable_useCacheRefresh=function(){return J.H.useCacheRefresh()},_e.use=function(k){return J.H.use(k)},_e.useActionState=function(k,H,F){return J.H.useActionState(k,H,F)},_e.useCallback=function(k,H){return J.H.useCallback(k,H)},_e.useContext=function(k){return J.H.useContext(k)},_e.useDebugValue=function(){},_e.useDeferredValue=function(k,H){return J.H.useDeferredValue(k,H)},_e.useEffect=function(k,H){return J.H.useEffect(k,H)},_e.useEffectEvent=function(k){return J.H.useEffectEvent(k)},_e.useId=function(){return J.H.useId()},_e.useImperativeHandle=function(k,H,F){return J.H.useImperativeHandle(k,H,F)},_e.useInsertionEffect=function(k,H){return J.H.useInsertionEffect(k,H)},_e.useLayoutEffect=function(k,H){return J.H.useLayoutEffect(k,H)},_e.useMemo=function(k,H){return J.H.useMemo(k,H)},_e.useOptimistic=function(k,H){return J.H.useOptimistic(k,H)},_e.useReducer=function(k,H,F){return J.H.useReducer(k,H,F)},_e.useRef=function(k){return J.H.useRef(k)},_e.useState=function(k){return J.H.useState(k)},_e.useSyncExternalStore=function(k,H,F){return J.H.useSyncExternalStore(k,H,F)},_e.useTransition=function(){return J.H.useTransition()},_e.version="19.2.4",_e}var ug;function Wu(){return ug||(ug=1,Lh.exports=ay()),Lh.exports}var O=Wu(),Nh={exports:{}},Zn={},Hh={exports:{}},jh={};var dg;function oy(){return dg||(dg=1,(function(e){function i(T,j){var q=T.length;T.push(j);e:for(;0<q;){var ae=q-1>>>1,fe=T[ae];if(0<o(fe,j))T[ae]=j,T[q]=fe,q=ae;else break e}}function n(T){return T.length===0?null:T[0]}function l(T){if(T.length===0)return null;var j=T[0],q=T.pop();if(q!==j){T[0]=q;e:for(var ae=0,fe=T.length,k=fe>>>1;ae<k;){var H=2*(ae+1)-1,F=T[H],ee=H+1,oe=T[ee];if(0>o(F,q))ee<fe&&0>o(oe,F)?(T[ae]=oe,T[ee]=q,ae=ee):(T[ae]=F,T[H]=q,ae=H);else if(ee<fe&&0>o(oe,q))T[ae]=oe,T[ee]=q,ae=ee;else break e}}return j}function o(T,j){var q=T.sortIndex-j.sortIndex;return q!==0?q:T.id-j.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;e.unstable_now=function(){return h.now()}}else{var d=Date,_=d.now();e.unstable_now=function(){return d.now()-_}}var p=[],f=[],S=1,y=null,x=3,C=!1,b=!1,R=!1,L=!1,X=typeof setTimeout=="function"?setTimeout:null,se=typeof clearTimeout=="function"?clearTimeout:null,$=typeof setImmediate<"u"?setImmediate:null;function W(T){for(var j=n(f);j!==null;){if(j.callback===null)l(f);else if(j.startTime<=T)l(f),j.sortIndex=j.expirationTime,i(p,j);else break;j=n(f)}}function Y(T){if(R=!1,W(T),!b)if(n(p)!==null)b=!0,Q||(Q=!0,G());else{var j=n(f);j!==null&&Z(Y,j.startTime-T)}}var Q=!1,J=-1,Se=5,Te=-1;function zt(){return L?!0:!(e.unstable_now()-Te<Se)}function de(){if(L=!1,Q){var T=e.unstable_now();Te=T;var j=!0;try{e:{b=!1,R&&(R=!1,se(J),J=-1),C=!0;var q=x;try{t:{for(W(T),y=n(p);y!==null&&!(y.expirationTime>T&&zt());){var ae=y.callback;if(typeof ae=="function"){y.callback=null,x=y.priorityLevel;var fe=ae(y.expirationTime<=T);if(T=e.unstable_now(),typeof fe=="function"){y.callback=fe,W(T),j=!0;break t}y===n(p)&&l(p),W(T)}else l(p);y=n(p)}if(y!==null)j=!0;else{var k=n(f);k!==null&&Z(Y,k.startTime-T),j=!1}}break e}finally{y=null,x=q,C=!1}j=void 0}}finally{j?G():Q=!1}}}var G;if(typeof $=="function")G=function(){$(de)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,te=I.port2;I.port1.onmessage=de,G=function(){te.postMessage(null)}}else G=function(){X(de,0)};function Z(T,j){J=X(function(){T(e.unstable_now())},j)}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(T){T.callback=null},e.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Se=0<T?Math.floor(1e3/T):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(T){switch(x){case 1:case 2:case 3:var j=3;break;default:j=x}var q=x;x=j;try{return T()}finally{x=q}},e.unstable_requestPaint=function(){L=!0},e.unstable_runWithPriority=function(T,j){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var q=x;x=T;try{return j()}finally{x=q}},e.unstable_scheduleCallback=function(T,j,q){var ae=e.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?ae+q:ae):q=ae,T){case 1:var fe=-1;break;case 2:fe=250;break;case 5:fe=1073741823;break;case 4:fe=1e4;break;default:fe=5e3}return fe=q+fe,T={id:S++,callback:j,priorityLevel:T,startTime:q,expirationTime:fe,sortIndex:-1},q>ae?(T.sortIndex=q,i(f,T),n(p)===null&&T===n(f)&&(R?(se(J),J=-1):R=!0,Z(Y,q-ae))):(T.sortIndex=fe,i(p,T),b||C||(b=!0,Q||(Q=!0,G()))),T},e.unstable_shouldYield=zt,e.unstable_wrapCallback=function(T){var j=x;return function(){var q=x;x=j;try{return T.apply(this,arguments)}finally{x=q}}}})(jh)),jh}var fg;function cy(){return fg||(fg=1,Hh.exports=oy()),Hh.exports}var Uh={exports:{}},kt={};var _g;function hy(){if(_g)return kt;_g=1;var e=Wu();function i(p){var f="https://react.dev/errors/"+p;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var S=2;S<arguments.length;S++)f+="&args[]="+encodeURIComponent(arguments[S])}return"Minified React error #"+p+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var l={d:{f:n,r:function(){throw Error(i(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},o=Symbol.for("react.portal");function h(p,f,S){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:y==null?null:""+y,children:p,containerInfo:f,implementation:S}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function _(p,f){if(p==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return kt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,kt.createPortal=function(p,f){var S=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(i(299));return h(p,f,null,S)},kt.flushSync=function(p){var f=d.T,S=l.p;try{if(d.T=null,l.p=2,p)return p()}finally{d.T=f,l.p=S,l.d.f()}},kt.preconnect=function(p,f){typeof p=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,l.d.C(p,f))},kt.prefetchDNS=function(p){typeof p=="string"&&l.d.D(p)},kt.preinit=function(p,f){if(typeof p=="string"&&f&&typeof f.as=="string"){var S=f.as,y=_(S,f.crossOrigin),x=typeof f.integrity=="string"?f.integrity:void 0,C=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;S==="style"?l.d.S(p,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:y,integrity:x,fetchPriority:C}):S==="script"&&l.d.X(p,{crossOrigin:y,integrity:x,fetchPriority:C,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},kt.preinitModule=function(p,f){if(typeof p=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var S=_(f.as,f.crossOrigin);l.d.M(p,{crossOrigin:S,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&l.d.M(p)},kt.preload=function(p,f){if(typeof p=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var S=f.as,y=_(S,f.crossOrigin);l.d.L(p,S,{crossOrigin:y,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},kt.preloadModule=function(p,f){if(typeof p=="string")if(f){var S=_(f.as,f.crossOrigin);l.d.m(p,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:S,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else l.d.m(p)},kt.requestFormReset=function(p){l.d.r(p)},kt.unstable_batchedUpdates=function(p,f){return p(f)},kt.useFormState=function(p,f,S){return d.H.useFormState(p,f,S)},kt.useFormStatus=function(){return d.H.useHostTransitionStatus()},kt.version="19.2.4",kt}var pg;function uy(){if(pg)return Uh.exports;pg=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(i){console.error(i)}}return e(),Uh.exports=hy(),Uh.exports}var gg;function dy(){if(gg)return Zn;gg=1;var e=cy(),i=Wu(),n=uy();function l(t){var s="https://react.dev/errors/"+t;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)s+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+t+"; visit "+s+" 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 h(t){var s=t,r=t;if(t.alternate)for(;s.return;)s=s.return;else{t=s;do s=t,(s.flags&4098)!==0&&(r=s.return),t=s.return;while(t)}return s.tag===3?r:null}function d(t){if(t.tag===13){var s=t.memoizedState;if(s===null&&(t=t.alternate,t!==null&&(s=t.memoizedState)),s!==null)return s.dehydrated}return null}function _(t){if(t.tag===31){var s=t.memoizedState;if(s===null&&(t=t.alternate,t!==null&&(s=t.memoizedState)),s!==null)return s.dehydrated}return null}function p(t){if(h(t)!==t)throw Error(l(188))}function f(t){var s=t.alternate;if(!s){if(s=h(t),s===null)throw Error(l(188));return s!==t?null:t}for(var r=t,a=s;;){var c=r.return;if(c===null)break;var u=c.alternate;if(u===null){if(a=c.return,a!==null){r=a;continue}break}if(c.child===u.child){for(u=c.child;u;){if(u===r)return p(c),t;if(u===a)return p(c),s;u=u.sibling}throw Error(l(188))}if(r.return!==a.return)r=c,a=u;else{for(var g=!1,v=c.child;v;){if(v===r){g=!0,r=c,a=u;break}if(v===a){g=!0,a=c,r=u;break}v=v.sibling}if(!g){for(v=u.child;v;){if(v===r){g=!0,r=u,a=c;break}if(v===a){g=!0,a=u,r=c;break}v=v.sibling}if(!g)throw Error(l(189))}}if(r.alternate!==a)throw Error(l(190))}if(r.tag!==3)throw Error(l(188));return r.stateNode.current===r?t:s}function S(t){var s=t.tag;if(s===5||s===26||s===27||s===6)return t;for(t=t.child;t!==null;){if(s=S(t),s!==null)return s;t=t.sibling}return null}var y=Object.assign,x=Symbol.for("react.element"),C=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),L=Symbol.for("react.strict_mode"),X=Symbol.for("react.profiler"),se=Symbol.for("react.consumer"),$=Symbol.for("react.context"),W=Symbol.for("react.forward_ref"),Y=Symbol.for("react.suspense"),Q=Symbol.for("react.suspense_list"),J=Symbol.for("react.memo"),Se=Symbol.for("react.lazy"),Te=Symbol.for("react.activity"),zt=Symbol.for("react.memo_cache_sentinel"),de=Symbol.iterator;function G(t){return t===null||typeof t!="object"?null:(t=de&&t[de]||t["@@iterator"],typeof t=="function"?t:null)}var I=Symbol.for("react.client.reference");function te(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 R:return"Fragment";case X:return"Profiler";case L:return"StrictMode";case Y:return"Suspense";case Q:return"SuspenseList";case Te:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case b:return"Portal";case $:return t.displayName||"Context";case se:return(t._context.displayName||"Context")+".Consumer";case W:var s=t.render;return t=t.displayName,t||(t=s.displayName||s.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case J:return s=t.displayName||null,s!==null?s:te(t.type)||"Memo";case Se:s=t._payload,t=t._init;try{return te(t(s))}catch{}}return null}var Z=Array.isArray,T=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q={pending:!1,data:null,method:null,action:null},ae=[],fe=-1;function k(t){return{current:t}}function H(t){0>fe||(t.current=ae[fe],ae[fe]=null,fe--)}function F(t,s){fe++,ae[fe]=t.current,t.current=s}var ee=k(null),oe=k(null),he=k(null),ye=k(null);function at(t,s){switch(F(he,s),F(oe,t),F(ee,null),s.nodeType){case 9:case 11:t=(t=s.documentElement)&&(t=t.namespaceURI)?Bp(t):0;break;default:if(t=s.tagName,s=s.namespaceURI)s=Bp(s),t=Ap(s,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}H(ee),F(ee,t)}function Ae(){H(ee),H(oe),H(he)}function wi(t){t.memoizedState!==null&&F(ye,t);var s=ee.current,r=Ap(s,t.type);s!==r&&(F(oe,t),F(ee,r))}function Ci(t){oe.current===t&&(H(ee),H(oe)),ye.current===t&&(H(ye),In._currentValue=q)}var ti,Re;function mi(t){if(ti===void 0)try{throw Error()}catch(r){var s=r.stack.trim().match(/\n( *(at )?)/);ti=s&&s[1]||"",Re=-1<r.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+ti+t+Re}var mo=!1;function vo(t,s){if(!t||mo)return"";mo=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(s){var P=function(){throw Error()};if(Object.defineProperty(P.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(P,[])}catch(z){var A=z}Reflect.construct(t,[],P)}else{try{P.call()}catch(z){A=z}t.call(P.prototype)}}else{try{throw Error()}catch(z){A=z}(P=t())&&typeof P.catch=="function"&&P.catch(function(){})}}catch(z){if(z&&A&&typeof z.stack=="string")return[z.stack,A.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=a.DetermineComponentFrameRoot(),g=u[0],v=u[1];if(g&&v){var w=g.split(`
|
|
4
|
+
`),B=v.split(`
|
|
5
|
+
`);for(c=a=0;a<w.length&&!w[a].includes("DetermineComponentFrameRoot");)a++;for(;c<B.length&&!B[c].includes("DetermineComponentFrameRoot");)c++;if(a===w.length||c===B.length)for(a=w.length-1,c=B.length-1;1<=a&&0<=c&&w[a]!==B[c];)c--;for(;1<=a&&0<=c;a--,c--)if(w[a]!==B[c]){if(a!==1||c!==1)do if(a--,c--,0>c||w[a]!==B[c]){var N=`
|
|
6
|
+
`+w[a].replace(" at new "," at ");return t.displayName&&N.includes("<anonymous>")&&(N=N.replace("<anonymous>",t.displayName)),N}while(1<=a&&0<=c);break}}}finally{mo=!1,Error.prepareStackTrace=r}return(r=t?t.displayName||t.name:"")?mi(r):""}function Nv(t,s){switch(t.tag){case 26:case 27:case 5:return mi(t.type);case 16:return mi("Lazy");case 13:return t.child!==s&&s!==null?mi("Suspense Fallback"):mi("Suspense");case 19:return mi("SuspenseList");case 0:case 15:return vo(t.type,!1);case 11:return vo(t.type.render,!1);case 1:return vo(t.type,!0);case 31:return mi("Activity");default:return""}}function ad(t){try{var s="",r=null;do s+=Nv(t,r),r=t,t=t.return;while(t);return s}catch(a){return`
|
|
7
|
+
Error generating stack: `+a.message+`
|
|
8
|
+
`+a.stack}}var So=Object.prototype.hasOwnProperty,yo=e.unstable_scheduleCallback,bo=e.unstable_cancelCallback,Hv=e.unstable_shouldYield,jv=e.unstable_requestPaint,Pt=e.unstable_now,Uv=e.unstable_getCurrentPriorityLevel,od=e.unstable_ImmediatePriority,cd=e.unstable_UserBlockingPriority,xl=e.unstable_NormalPriority,qv=e.unstable_LowPriority,hd=e.unstable_IdlePriority,Wv=e.log,Pv=e.unstable_setDisableYieldValue,rn=null,Kt=null;function ls(t){if(typeof Wv=="function"&&Pv(t),Kt&&typeof Kt.setStrictMode=="function")try{Kt.setStrictMode(rn,t)}catch{}}var Yt=Math.clz32?Math.clz32:$v,Kv=Math.log,Yv=Math.LN2;function $v(t){return t>>>=0,t===0?32:31-(Kv(t)/Yv|0)|0}var wl=256,Cl=262144,kl=4194304;function Hs(t){var s=t&42;if(s!==0)return s;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 El(t,s,r){var a=t.pendingLanes;if(a===0)return 0;var c=0,u=t.suspendedLanes,g=t.pingedLanes;t=t.warmLanes;var v=a&134217727;return v!==0?(a=v&~u,a!==0?c=Hs(a):(g&=v,g!==0?c=Hs(g):r||(r=v&~t,r!==0&&(c=Hs(r))))):(v=a&~u,v!==0?c=Hs(v):g!==0?c=Hs(g):r||(r=a&~t,r!==0&&(c=Hs(r)))),c===0?0:s!==0&&s!==c&&(s&u)===0&&(u=c&-c,r=s&-s,u>=r||u===32&&(r&4194048)!==0)?s:c}function nn(t,s){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&s)===0}function Iv(t,s){switch(t){case 1:case 2:case 4:case 8:case 64:return s+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 s+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 ud(){var t=kl;return kl<<=1,(kl&62914560)===0&&(kl=4194304),t}function xo(t){for(var s=[],r=0;31>r;r++)s.push(t);return s}function ln(t,s){t.pendingLanes|=s,s!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Xv(t,s,r,a,c,u){var g=t.pendingLanes;t.pendingLanes=r,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=r,t.entangledLanes&=r,t.errorRecoveryDisabledLanes&=r,t.shellSuspendCounter=0;var v=t.entanglements,w=t.expirationTimes,B=t.hiddenUpdates;for(r=g&~r;0<r;){var N=31-Yt(r),P=1<<N;v[N]=0,w[N]=-1;var A=B[N];if(A!==null)for(B[N]=null,N=0;N<A.length;N++){var z=A[N];z!==null&&(z.lane&=-536870913)}r&=~P}a!==0&&dd(t,a,0),u!==0&&c===0&&t.tag!==0&&(t.suspendedLanes|=u&~(g&~s))}function dd(t,s,r){t.pendingLanes|=s,t.suspendedLanes&=~s;var a=31-Yt(s);t.entangledLanes|=s,t.entanglements[a]=t.entanglements[a]|1073741824|r&261930}function fd(t,s){var r=t.entangledLanes|=s;for(t=t.entanglements;r;){var a=31-Yt(r),c=1<<a;c&s|t[a]&s&&(t[a]|=s),r&=~c}}function _d(t,s){var r=s&-s;return r=(r&42)!==0?1:wo(r),(r&(t.suspendedLanes|s))!==0?0:r}function wo(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 Co(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function pd(){var t=j.p;return t!==0?t:(t=window.event,t===void 0?32:tg(t.type))}function gd(t,s){var r=j.p;try{return j.p=t,s()}finally{j.p=r}}var as=Math.random().toString(36).slice(2),St="__reactFiber$"+as,Ot="__reactProps$"+as,dr="__reactContainer$"+as,ko="__reactEvents$"+as,Gv="__reactListeners$"+as,Vv="__reactHandles$"+as,md="__reactResources$"+as,an="__reactMarker$"+as;function Eo(t){delete t[St],delete t[Ot],delete t[ko],delete t[Gv],delete t[Vv]}function fr(t){var s=t[St];if(s)return s;for(var r=t.parentNode;r;){if(s=r[dr]||r[St]){if(r=s.alternate,s.child!==null||r!==null&&r.child!==null)for(t=Up(t);t!==null;){if(r=t[St])return r;t=Up(t)}return s}t=r,r=t.parentNode}return null}function _r(t){if(t=t[St]||t[dr]){var s=t.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return t}return null}function on(t){var s=t.tag;if(s===5||s===26||s===27||s===6)return t.stateNode;throw Error(l(33))}function pr(t){var s=t[md];return s||(s=t[md]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function dt(t){t[an]=!0}var vd=new Set,Sd={};function js(t,s){gr(t,s),gr(t+"Capture",s)}function gr(t,s){for(Sd[t]=s,t=0;t<s.length;t++)vd.add(s[t])}var Fv=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]*$"),yd={},bd={};function Zv(t){return So.call(bd,t)?!0:So.call(yd,t)?!1:Fv.test(t)?bd[t]=!0:(yd[t]=!0,!1)}function Tl(t,s,r){if(Zv(s))if(r===null)t.removeAttribute(s);else{switch(typeof r){case"undefined":case"function":case"symbol":t.removeAttribute(s);return;case"boolean":var a=s.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){t.removeAttribute(s);return}}t.setAttribute(s,""+r)}}function Rl(t,s,r){if(r===null)t.removeAttribute(s);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(s);return}t.setAttribute(s,""+r)}}function Ni(t,s,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.setAttributeNS(s,r,""+a)}}function ii(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function xd(t){var s=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Qv(t,s,r){var a=Object.getOwnPropertyDescriptor(t.constructor.prototype,s);if(!t.hasOwnProperty(s)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var c=a.get,u=a.set;return Object.defineProperty(t,s,{configurable:!0,get:function(){return c.call(this)},set:function(g){r=""+g,u.call(this,g)}}),Object.defineProperty(t,s,{enumerable:a.enumerable}),{getValue:function(){return r},setValue:function(g){r=""+g},stopTracking:function(){t._valueTracker=null,delete t[s]}}}}function To(t){if(!t._valueTracker){var s=xd(t)?"checked":"value";t._valueTracker=Qv(t,s,""+t[s])}}function wd(t){if(!t)return!1;var s=t._valueTracker;if(!s)return!0;var r=s.getValue(),a="";return t&&(a=xd(t)?t.checked?"true":"false":t.value),t=a,t!==r?(s.setValue(t),!0):!1}function Dl(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 Jv=/[\n"\\]/g;function si(t){return t.replace(Jv,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Ro(t,s,r,a,c,u,g,v){t.name="",g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?t.type=g:t.removeAttribute("type"),s!=null?g==="number"?(s===0&&t.value===""||t.value!=s)&&(t.value=""+ii(s)):t.value!==""+ii(s)&&(t.value=""+ii(s)):g!=="submit"&&g!=="reset"||t.removeAttribute("value"),s!=null?Do(t,g,ii(s)):r!=null?Do(t,g,ii(r)):a!=null&&t.removeAttribute("value"),c==null&&u!=null&&(t.defaultChecked=!!u),c!=null&&(t.checked=c&&typeof c!="function"&&typeof c!="symbol"),v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?t.name=""+ii(v):t.removeAttribute("name")}function Cd(t,s,r,a,c,u,g,v){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(t.type=u),s!=null||r!=null){if(!(u!=="submit"&&u!=="reset"||s!=null)){To(t);return}r=r!=null?""+ii(r):"",s=s!=null?""+ii(s):r,v||s===t.value||(t.value=s),t.defaultValue=s}a=a??c,a=typeof a!="function"&&typeof a!="symbol"&&!!a,t.checked=v?t.checked:!!a,t.defaultChecked=!!a,g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(t.name=g),To(t)}function Do(t,s,r){s==="number"&&Dl(t.ownerDocument)===t||t.defaultValue===""+r||(t.defaultValue=""+r)}function mr(t,s,r,a){if(t=t.options,s){s={};for(var c=0;c<r.length;c++)s["$"+r[c]]=!0;for(r=0;r<t.length;r++)c=s.hasOwnProperty("$"+t[r].value),t[r].selected!==c&&(t[r].selected=c),c&&a&&(t[r].defaultSelected=!0)}else{for(r=""+ii(r),s=null,c=0;c<t.length;c++){if(t[c].value===r){t[c].selected=!0,a&&(t[c].defaultSelected=!0);return}s!==null||t[c].disabled||(s=t[c])}s!==null&&(s.selected=!0)}}function kd(t,s,r){if(s!=null&&(s=""+ii(s),s!==t.value&&(t.value=s),r==null)){t.defaultValue!==s&&(t.defaultValue=s);return}t.defaultValue=r!=null?""+ii(r):""}function Ed(t,s,r,a){if(s==null){if(a!=null){if(r!=null)throw Error(l(92));if(Z(a)){if(1<a.length)throw Error(l(93));a=a[0]}r=a}r==null&&(r=""),s=r}r=ii(s),t.defaultValue=r,a=t.textContent,a===r&&a!==""&&a!==null&&(t.value=a),To(t)}function vr(t,s){if(s){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=s;return}}t.textContent=s}var e0=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 Td(t,s,r){var a=s.indexOf("--")===0;r==null||typeof r=="boolean"||r===""?a?t.setProperty(s,""):s==="float"?t.cssFloat="":t[s]="":a?t.setProperty(s,r):typeof r!="number"||r===0||e0.has(s)?s==="float"?t.cssFloat=r:t[s]=(""+r).trim():t[s]=r+"px"}function Rd(t,s,r){if(s!=null&&typeof s!="object")throw Error(l(62));if(t=t.style,r!=null){for(var a in r)!r.hasOwnProperty(a)||s!=null&&s.hasOwnProperty(a)||(a.indexOf("--")===0?t.setProperty(a,""):a==="float"?t.cssFloat="":t[a]="");for(var c in s)a=s[c],s.hasOwnProperty(c)&&r[c]!==a&&Td(t,c,a)}else for(var u in s)s.hasOwnProperty(u)&&Td(t,u,s[u])}function Mo(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 t0=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"]]),i0=/^[\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 Ml(t){return i0.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Hi(){}var Bo=null;function Ao(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Sr=null,yr=null;function Dd(t){var s=_r(t);if(s&&(t=s.stateNode)){var r=t[Ot]||null;e:switch(t=s.stateNode,s.type){case"input":if(Ro(t,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name),s=r.name,r.type==="radio"&&s!=null){for(r=t;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll('input[name="'+si(""+s)+'"][type="radio"]'),s=0;s<r.length;s++){var a=r[s];if(a!==t&&a.form===t.form){var c=a[Ot]||null;if(!c)throw Error(l(90));Ro(a,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(s=0;s<r.length;s++)a=r[s],a.form===t.form&&wd(a)}break e;case"textarea":kd(t,r.value,r.defaultValue);break e;case"select":s=r.value,s!=null&&mr(t,!!r.multiple,s,!1)}}}var zo=!1;function Md(t,s,r){if(zo)return t(s,r);zo=!0;try{var a=t(s);return a}finally{if(zo=!1,(Sr!==null||yr!==null)&&(ma(),Sr&&(s=Sr,t=yr,yr=Sr=null,Dd(s),t)))for(s=0;s<t.length;s++)Dd(t[s])}}function cn(t,s){var r=t.stateNode;if(r===null)return null;var a=r[Ot]||null;if(a===null)return null;r=a[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(t=t.type,a=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!a;break e;default:t=!1}if(t)return null;if(r&&typeof r!="function")throw Error(l(231,s,typeof r));return r}var ji=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Oo=!1;if(ji)try{var hn={};Object.defineProperty(hn,"passive",{get:function(){Oo=!0}}),window.addEventListener("test",hn,hn),window.removeEventListener("test",hn,hn)}catch{Oo=!1}var os=null,Lo=null,Bl=null;function Bd(){if(Bl)return Bl;var t,s=Lo,r=s.length,a,c="value"in os?os.value:os.textContent,u=c.length;for(t=0;t<r&&s[t]===c[t];t++);var g=r-t;for(a=1;a<=g&&s[r-a]===c[u-a];a++);return Bl=c.slice(t,1<a?1-a:void 0)}function Al(t){var s=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&s===13&&(t=13)):t=s,t===10&&(t=13),32<=t||t===13?t:0}function zl(){return!0}function Ad(){return!1}function Lt(t){function s(r,a,c,u,g){this._reactName=r,this._targetInst=c,this.type=a,this.nativeEvent=u,this.target=g,this.currentTarget=null;for(var v in t)t.hasOwnProperty(v)&&(r=t[v],this[v]=r?r(u):u[v]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?zl:Ad,this.isPropagationStopped=Ad,this}return y(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=zl)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=zl)},persist:function(){},isPersistent:zl}),s}var Us={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ol=Lt(Us),un=y({},Us,{view:0,detail:0}),s0=Lt(un),No,Ho,dn,Ll=y({},un,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Uo,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!==dn&&(dn&&t.type==="mousemove"?(No=t.screenX-dn.screenX,Ho=t.screenY-dn.screenY):Ho=No=0,dn=t),No)},movementY:function(t){return"movementY"in t?t.movementY:Ho}}),zd=Lt(Ll),r0=y({},Ll,{dataTransfer:0}),n0=Lt(r0),l0=y({},un,{relatedTarget:0}),jo=Lt(l0),a0=y({},Us,{animationName:0,elapsedTime:0,pseudoElement:0}),o0=Lt(a0),c0=y({},Us,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),h0=Lt(c0),u0=y({},Us,{data:0}),Od=Lt(u0),d0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},f0={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"},_0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function p0(t){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(t):(t=_0[t])?!!s[t]:!1}function Uo(){return p0}var g0=y({},un,{key:function(t){if(t.key){var s=d0[t.key]||t.key;if(s!=="Unidentified")return s}return t.type==="keypress"?(t=Al(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?f0[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Uo,charCode:function(t){return t.type==="keypress"?Al(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Al(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),m0=Lt(g0),v0=y({},Ll,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ld=Lt(v0),S0=y({},un,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Uo}),y0=Lt(S0),b0=y({},Us,{propertyName:0,elapsedTime:0,pseudoElement:0}),x0=Lt(b0),w0=y({},Ll,{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}),C0=Lt(w0),k0=y({},Us,{newState:0,oldState:0}),E0=Lt(k0),T0=[9,13,27,32],qo=ji&&"CompositionEvent"in window,fn=null;ji&&"documentMode"in document&&(fn=document.documentMode);var R0=ji&&"TextEvent"in window&&!fn,Nd=ji&&(!qo||fn&&8<fn&&11>=fn),Hd=" ",jd=!1;function Ud(t,s){switch(t){case"keyup":return T0.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qd(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var br=!1;function D0(t,s){switch(t){case"compositionend":return qd(s);case"keypress":return s.which!==32?null:(jd=!0,Hd);case"textInput":return t=s.data,t===Hd&&jd?null:t;default:return null}}function M0(t,s){if(br)return t==="compositionend"||!qo&&Ud(t,s)?(t=Bd(),Bl=Lo=os=null,br=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return Nd&&s.locale!=="ko"?null:s.data;default:return null}}var B0={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 Wd(t){var s=t&&t.nodeName&&t.nodeName.toLowerCase();return s==="input"?!!B0[t.type]:s==="textarea"}function Pd(t,s,r,a){Sr?yr?yr.push(a):yr=[a]:Sr=a,s=Ca(s,"onChange"),0<s.length&&(r=new Ol("onChange","change",null,r,a),t.push({event:r,listeners:s}))}var _n=null,pn=null;function A0(t){kp(t,0)}function Nl(t){var s=on(t);if(wd(s))return t}function Kd(t,s){if(t==="change")return s}var Yd=!1;if(ji){var Wo;if(ji){var Po="oninput"in document;if(!Po){var $d=document.createElement("div");$d.setAttribute("oninput","return;"),Po=typeof $d.oninput=="function"}Wo=Po}else Wo=!1;Yd=Wo&&(!document.documentMode||9<document.documentMode)}function Id(){_n&&(_n.detachEvent("onpropertychange",Xd),pn=_n=null)}function Xd(t){if(t.propertyName==="value"&&Nl(pn)){var s=[];Pd(s,pn,t,Ao(t)),Md(A0,s)}}function z0(t,s,r){t==="focusin"?(Id(),_n=s,pn=r,_n.attachEvent("onpropertychange",Xd)):t==="focusout"&&Id()}function O0(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Nl(pn)}function L0(t,s){if(t==="click")return Nl(s)}function N0(t,s){if(t==="input"||t==="change")return Nl(s)}function H0(t,s){return t===s&&(t!==0||1/t===1/s)||t!==t&&s!==s}var $t=typeof Object.is=="function"?Object.is:H0;function gn(t,s){if($t(t,s))return!0;if(typeof t!="object"||t===null||typeof s!="object"||s===null)return!1;var r=Object.keys(t),a=Object.keys(s);if(r.length!==a.length)return!1;for(a=0;a<r.length;a++){var c=r[a];if(!So.call(s,c)||!$t(t[c],s[c]))return!1}return!0}function Gd(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Vd(t,s){var r=Gd(t);t=0;for(var a;r;){if(r.nodeType===3){if(a=t+r.textContent.length,t<=s&&a>=s)return{node:r,offset:s-t};t=a}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Gd(r)}}function Fd(t,s){return t&&s?t===s?!0:t&&t.nodeType===3?!1:s&&s.nodeType===3?Fd(t,s.parentNode):"contains"in t?t.contains(s):t.compareDocumentPosition?!!(t.compareDocumentPosition(s)&16):!1:!1}function Zd(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var s=Dl(t.document);s instanceof t.HTMLIFrameElement;){try{var r=typeof s.contentWindow.location.href=="string"}catch{r=!1}if(r)t=s.contentWindow;else break;s=Dl(t.document)}return s}function Ko(t){var s=t&&t.nodeName&&t.nodeName.toLowerCase();return s&&(s==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||s==="textarea"||t.contentEditable==="true")}var j0=ji&&"documentMode"in document&&11>=document.documentMode,xr=null,Yo=null,mn=null,$o=!1;function Qd(t,s,r){var a=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;$o||xr==null||xr!==Dl(a)||(a=xr,"selectionStart"in a&&Ko(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),mn&&gn(mn,a)||(mn=a,a=Ca(Yo,"onSelect"),0<a.length&&(s=new Ol("onSelect","select",null,s,r),t.push({event:s,listeners:a}),s.target=xr)))}function qs(t,s){var r={};return r[t.toLowerCase()]=s.toLowerCase(),r["Webkit"+t]="webkit"+s,r["Moz"+t]="moz"+s,r}var wr={animationend:qs("Animation","AnimationEnd"),animationiteration:qs("Animation","AnimationIteration"),animationstart:qs("Animation","AnimationStart"),transitionrun:qs("Transition","TransitionRun"),transitionstart:qs("Transition","TransitionStart"),transitioncancel:qs("Transition","TransitionCancel"),transitionend:qs("Transition","TransitionEnd")},Io={},Jd={};ji&&(Jd=document.createElement("div").style,"AnimationEvent"in window||(delete wr.animationend.animation,delete wr.animationiteration.animation,delete wr.animationstart.animation),"TransitionEvent"in window||delete wr.transitionend.transition);function Ws(t){if(Io[t])return Io[t];if(!wr[t])return t;var s=wr[t],r;for(r in s)if(s.hasOwnProperty(r)&&r in Jd)return Io[t]=s[r];return t}var ef=Ws("animationend"),tf=Ws("animationiteration"),sf=Ws("animationstart"),U0=Ws("transitionrun"),q0=Ws("transitionstart"),W0=Ws("transitioncancel"),rf=Ws("transitionend"),nf=new Map,Xo="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(" ");Xo.push("scrollEnd");function vi(t,s){nf.set(t,s),js(s,[t])}var Hl=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=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(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},ri=[],Cr=0,Go=0;function jl(){for(var t=Cr,s=Go=Cr=0;s<t;){var r=ri[s];ri[s++]=null;var a=ri[s];ri[s++]=null;var c=ri[s];ri[s++]=null;var u=ri[s];if(ri[s++]=null,a!==null&&c!==null){var g=a.pending;g===null?c.next=c:(c.next=g.next,g.next=c),a.pending=c}u!==0&&lf(r,c,u)}}function Ul(t,s,r,a){ri[Cr++]=t,ri[Cr++]=s,ri[Cr++]=r,ri[Cr++]=a,Go|=a,t.lanes|=a,t=t.alternate,t!==null&&(t.lanes|=a)}function Vo(t,s,r,a){return Ul(t,s,r,a),ql(t)}function Ps(t,s){return Ul(t,null,null,s),ql(t)}function lf(t,s,r){t.lanes|=r;var a=t.alternate;a!==null&&(a.lanes|=r);for(var c=!1,u=t.return;u!==null;)u.childLanes|=r,a=u.alternate,a!==null&&(a.childLanes|=r),u.tag===22&&(t=u.stateNode,t===null||t._visibility&1||(c=!0)),t=u,u=u.return;return t.tag===3?(u=t.stateNode,c&&s!==null&&(c=31-Yt(r),t=u.hiddenUpdates,a=t[c],a===null?t[c]=[s]:a.push(s),s.lane=r|536870912),u):null}function ql(t){if(50<Un)throw Un=0,rh=null,Error(l(185));for(var s=t.return;s!==null;)t=s,s=t.return;return t.tag===3?t.stateNode:null}var kr={};function P0(t,s,r,a){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function It(t,s,r,a){return new P0(t,s,r,a)}function Fo(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Ui(t,s){var r=t.alternate;return r===null?(r=It(t.tag,s,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=s,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&65011712,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,s=t.dependencies,r.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r.refCleanup=t.refCleanup,r}function af(t,s){t.flags&=65011714;var r=t.alternate;return r===null?(t.childLanes=0,t.lanes=s,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=r.childLanes,t.lanes=r.lanes,t.child=r.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=r.memoizedProps,t.memoizedState=r.memoizedState,t.updateQueue=r.updateQueue,t.type=r.type,s=r.dependencies,t.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),t}function Wl(t,s,r,a,c,u){var g=0;if(a=t,typeof t=="function")Fo(t)&&(g=1);else if(typeof t=="string")g=XS(t,r,ee.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case Te:return t=It(31,r,s,c),t.elementType=Te,t.lanes=u,t;case R:return Ks(r.children,c,u,s);case L:g=8,c|=24;break;case X:return t=It(12,r,s,c|2),t.elementType=X,t.lanes=u,t;case Y:return t=It(13,r,s,c),t.elementType=Y,t.lanes=u,t;case Q:return t=It(19,r,s,c),t.elementType=Q,t.lanes=u,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case $:g=10;break e;case se:g=9;break e;case W:g=11;break e;case J:g=14;break e;case Se:g=16,a=null;break e}g=29,r=Error(l(130,t===null?"null":typeof t,"")),a=null}return s=It(g,r,s,c),s.elementType=t,s.type=a,s.lanes=u,s}function Ks(t,s,r,a){return t=It(7,t,a,s),t.lanes=r,t}function Zo(t,s,r){return t=It(6,t,null,s),t.lanes=r,t}function of(t){var s=It(18,null,null,0);return s.stateNode=t,s}function Qo(t,s,r){return s=It(4,t.children!==null?t.children:[],t.key,s),s.lanes=r,s.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},s}var cf=new WeakMap;function ni(t,s){if(typeof t=="object"&&t!==null){var r=cf.get(t);return r!==void 0?r:(s={value:t,source:s,stack:ad(s)},cf.set(t,s),s)}return{value:t,source:s,stack:ad(s)}}var Er=[],Tr=0,Pl=null,vn=0,li=[],ai=0,cs=null,ki=1,Ei="";function qi(t,s){Er[Tr++]=vn,Er[Tr++]=Pl,Pl=t,vn=s}function hf(t,s,r){li[ai++]=ki,li[ai++]=Ei,li[ai++]=cs,cs=t;var a=ki;t=Ei;var c=32-Yt(a)-1;a&=~(1<<c),r+=1;var u=32-Yt(s)+c;if(30<u){var g=c-c%5;u=(a&(1<<g)-1).toString(32),a>>=g,c-=g,ki=1<<32-Yt(s)+c|r<<c|a,Ei=u+t}else ki=1<<u|r<<c|a,Ei=t}function Jo(t){t.return!==null&&(qi(t,1),hf(t,1,0))}function ec(t){for(;t===Pl;)Pl=Er[--Tr],Er[Tr]=null,vn=Er[--Tr],Er[Tr]=null;for(;t===cs;)cs=li[--ai],li[ai]=null,Ei=li[--ai],li[ai]=null,ki=li[--ai],li[ai]=null}function uf(t,s){li[ai++]=ki,li[ai++]=Ei,li[ai++]=cs,ki=s.id,Ei=s.overflow,cs=t}var yt=null,We=null,ke=!1,hs=null,oi=!1,tc=Error(l(519));function us(t){var s=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Sn(ni(s,t)),tc}function df(t){var s=t.stateNode,r=t.type,a=t.memoizedProps;switch(s[St]=t,s[Ot]=a,r){case"dialog":xe("cancel",s),xe("close",s);break;case"iframe":case"object":case"embed":xe("load",s);break;case"video":case"audio":for(r=0;r<Wn.length;r++)xe(Wn[r],s);break;case"source":xe("error",s);break;case"img":case"image":case"link":xe("error",s),xe("load",s);break;case"details":xe("toggle",s);break;case"input":xe("invalid",s),Cd(s,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":xe("invalid",s);break;case"textarea":xe("invalid",s),Ed(s,a.value,a.defaultValue,a.children)}r=a.children,typeof r!="string"&&typeof r!="number"&&typeof r!="bigint"||s.textContent===""+r||a.suppressHydrationWarning===!0||Dp(s.textContent,r)?(a.popover!=null&&(xe("beforetoggle",s),xe("toggle",s)),a.onScroll!=null&&xe("scroll",s),a.onScrollEnd!=null&&xe("scrollend",s),a.onClick!=null&&(s.onclick=Hi),s=!0):s=!1,s||us(t,!0)}function ff(t){for(yt=t.return;yt;)switch(yt.tag){case 5:case 31:case 13:oi=!1;return;case 27:case 3:oi=!0;return;default:yt=yt.return}}function Rr(t){if(t!==yt)return!1;if(!ke)return ff(t),ke=!0,!1;var s=t.tag,r;if((r=s!==3&&s!==27)&&((r=s===5)&&(r=t.type,r=!(r!=="form"&&r!=="button")||Sh(t.type,t.memoizedProps)),r=!r),r&&We&&us(t),ff(t),s===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(317));We=jp(t)}else if(s===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(317));We=jp(t)}else s===27?(s=We,ks(t.type)?(t=Ch,Ch=null,We=t):We=s):We=yt?hi(t.stateNode.nextSibling):null;return!0}function Ys(){We=yt=null,ke=!1}function ic(){var t=hs;return t!==null&&(Ut===null?Ut=t:Ut.push.apply(Ut,t),hs=null),t}function Sn(t){hs===null?hs=[t]:hs.push(t)}var sc=k(null),$s=null,Wi=null;function ds(t,s,r){F(sc,s._currentValue),s._currentValue=r}function Pi(t){t._currentValue=sc.current,H(sc)}function rc(t,s,r){for(;t!==null;){var a=t.alternate;if((t.childLanes&s)!==s?(t.childLanes|=s,a!==null&&(a.childLanes|=s)):a!==null&&(a.childLanes&s)!==s&&(a.childLanes|=s),t===r)break;t=t.return}}function nc(t,s,r,a){var c=t.child;for(c!==null&&(c.return=t);c!==null;){var u=c.dependencies;if(u!==null){var g=c.child;u=u.firstContext;e:for(;u!==null;){var v=u;u=c;for(var w=0;w<s.length;w++)if(v.context===s[w]){u.lanes|=r,v=u.alternate,v!==null&&(v.lanes|=r),rc(u.return,r,t),a||(g=null);break e}u=v.next}}else if(c.tag===18){if(g=c.return,g===null)throw Error(l(341));g.lanes|=r,u=g.alternate,u!==null&&(u.lanes|=r),rc(g,r,t),g=null}else g=c.child;if(g!==null)g.return=c;else for(g=c;g!==null;){if(g===t){g=null;break}if(c=g.sibling,c!==null){c.return=g.return,g=c;break}g=g.return}c=g}}function Dr(t,s,r,a){t=null;for(var c=s,u=!1;c!==null;){if(!u){if((c.flags&524288)!==0)u=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var g=c.alternate;if(g===null)throw Error(l(387));if(g=g.memoizedProps,g!==null){var v=c.type;$t(c.pendingProps.value,g.value)||(t!==null?t.push(v):t=[v])}}else if(c===ye.current){if(g=c.alternate,g===null)throw Error(l(387));g.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(t!==null?t.push(In):t=[In])}c=c.return}t!==null&&nc(s,t,r,a),s.flags|=262144}function Kl(t){for(t=t.firstContext;t!==null;){if(!$t(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Is(t){$s=t,Wi=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function bt(t){return _f($s,t)}function Yl(t,s){return $s===null&&Is(t),_f(t,s)}function _f(t,s){var r=s._currentValue;if(s={context:s,memoizedValue:r,next:null},Wi===null){if(t===null)throw Error(l(308));Wi=s,t.dependencies={lanes:0,firstContext:s},t.flags|=524288}else Wi=Wi.next=s;return r}var K0=typeof AbortController<"u"?AbortController:function(){var t=[],s=this.signal={aborted:!1,addEventListener:function(r,a){t.push(a)}};this.abort=function(){s.aborted=!0,t.forEach(function(r){return r()})}},Y0=e.unstable_scheduleCallback,$0=e.unstable_NormalPriority,tt={$$typeof:$,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function lc(){return{controller:new K0,data:new Map,refCount:0}}function yn(t){t.refCount--,t.refCount===0&&Y0($0,function(){t.controller.abort()})}var bn=null,ac=0,Mr=0,Br=null;function I0(t,s){if(bn===null){var r=bn=[];ac=0,Mr=hh(),Br={status:"pending",value:void 0,then:function(a){r.push(a)}}}return ac++,s.then(pf,pf),s}function pf(){if(--ac===0&&bn!==null){Br!==null&&(Br.status="fulfilled");var t=bn;bn=null,Mr=0,Br=null;for(var s=0;s<t.length;s++)(0,t[s])()}}function X0(t,s){var r=[],a={status:"pending",value:null,reason:null,then:function(c){r.push(c)}};return t.then(function(){a.status="fulfilled",a.value=s;for(var c=0;c<r.length;c++)(0,r[c])(s)},function(c){for(a.status="rejected",a.reason=c,c=0;c<r.length;c++)(0,r[c])(void 0)}),a}var gf=T.S;T.S=function(t,s){J_=Pt(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&I0(t,s),gf!==null&&gf(t,s)};var Xs=k(null);function oc(){var t=Xs.current;return t!==null?t:qe.pooledCache}function $l(t,s){s===null?F(Xs,Xs.current):F(Xs,s.pool)}function mf(){var t=oc();return t===null?null:{parent:tt._currentValue,pool:t}}var Ar=Error(l(460)),cc=Error(l(474)),Il=Error(l(542)),Xl={then:function(){}};function vf(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Sf(t,s,r){switch(r=t[r],r===void 0?t.push(s):r!==s&&(s.then(Hi,Hi),s=r),s.status){case"fulfilled":return s.value;case"rejected":throw t=s.reason,bf(t),t;default:if(typeof s.status=="string")s.then(Hi,Hi);else{if(t=qe,t!==null&&100<t.shellSuspendCounter)throw Error(l(482));t=s,t.status="pending",t.then(function(a){if(s.status==="pending"){var c=s;c.status="fulfilled",c.value=a}},function(a){if(s.status==="pending"){var c=s;c.status="rejected",c.reason=a}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw t=s.reason,bf(t),t}throw Vs=s,Ar}}function Gs(t){try{var s=t._init;return s(t._payload)}catch(r){throw r!==null&&typeof r=="object"&&typeof r.then=="function"?(Vs=r,Ar):r}}var Vs=null;function yf(){if(Vs===null)throw Error(l(459));var t=Vs;return Vs=null,t}function bf(t){if(t===Ar||t===Il)throw Error(l(483))}var zr=null,xn=0;function Gl(t){var s=xn;return xn+=1,zr===null&&(zr=[]),Sf(zr,t,s)}function wn(t,s){s=s.props.ref,t.ref=s!==void 0?s:null}function Vl(t,s){throw s.$$typeof===x?Error(l(525)):(t=Object.prototype.toString.call(s),Error(l(31,t==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":t)))}function xf(t){function s(D,E){if(t){var M=D.deletions;M===null?(D.deletions=[E],D.flags|=16):M.push(E)}}function r(D,E){if(!t)return null;for(;E!==null;)s(D,E),E=E.sibling;return null}function a(D){for(var E=new Map;D!==null;)D.key!==null?E.set(D.key,D):E.set(D.index,D),D=D.sibling;return E}function c(D,E){return D=Ui(D,E),D.index=0,D.sibling=null,D}function u(D,E,M){return D.index=M,t?(M=D.alternate,M!==null?(M=M.index,M<E?(D.flags|=67108866,E):M):(D.flags|=67108866,E)):(D.flags|=1048576,E)}function g(D){return t&&D.alternate===null&&(D.flags|=67108866),D}function v(D,E,M,U){return E===null||E.tag!==6?(E=Zo(M,D.mode,U),E.return=D,E):(E=c(E,M),E.return=D,E)}function w(D,E,M,U){var le=M.type;return le===R?N(D,E,M.props.children,U,M.key):E!==null&&(E.elementType===le||typeof le=="object"&&le!==null&&le.$$typeof===Se&&Gs(le)===E.type)?(E=c(E,M.props),wn(E,M),E.return=D,E):(E=Wl(M.type,M.key,M.props,null,D.mode,U),wn(E,M),E.return=D,E)}function B(D,E,M,U){return E===null||E.tag!==4||E.stateNode.containerInfo!==M.containerInfo||E.stateNode.implementation!==M.implementation?(E=Qo(M,D.mode,U),E.return=D,E):(E=c(E,M.children||[]),E.return=D,E)}function N(D,E,M,U,le){return E===null||E.tag!==7?(E=Ks(M,D.mode,U,le),E.return=D,E):(E=c(E,M),E.return=D,E)}function P(D,E,M){if(typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint")return E=Zo(""+E,D.mode,M),E.return=D,E;if(typeof E=="object"&&E!==null){switch(E.$$typeof){case C:return M=Wl(E.type,E.key,E.props,null,D.mode,M),wn(M,E),M.return=D,M;case b:return E=Qo(E,D.mode,M),E.return=D,E;case Se:return E=Gs(E),P(D,E,M)}if(Z(E)||G(E))return E=Ks(E,D.mode,M,null),E.return=D,E;if(typeof E.then=="function")return P(D,Gl(E),M);if(E.$$typeof===$)return P(D,Yl(D,E),M);Vl(D,E)}return null}function A(D,E,M,U){var le=E!==null?E.key:null;if(typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint")return le!==null?null:v(D,E,""+M,U);if(typeof M=="object"&&M!==null){switch(M.$$typeof){case C:return M.key===le?w(D,E,M,U):null;case b:return M.key===le?B(D,E,M,U):null;case Se:return M=Gs(M),A(D,E,M,U)}if(Z(M)||G(M))return le!==null?null:N(D,E,M,U,null);if(typeof M.then=="function")return A(D,E,Gl(M),U);if(M.$$typeof===$)return A(D,E,Yl(D,M),U);Vl(D,M)}return null}function z(D,E,M,U,le){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return D=D.get(M)||null,v(E,D,""+U,le);if(typeof U=="object"&&U!==null){switch(U.$$typeof){case C:return D=D.get(U.key===null?M:U.key)||null,w(E,D,U,le);case b:return D=D.get(U.key===null?M:U.key)||null,B(E,D,U,le);case Se:return U=Gs(U),z(D,E,M,U,le)}if(Z(U)||G(U))return D=D.get(M)||null,N(E,D,U,le,null);if(typeof U.then=="function")return z(D,E,M,Gl(U),le);if(U.$$typeof===$)return z(D,E,M,Yl(E,U),le);Vl(E,U)}return null}function re(D,E,M,U){for(var le=null,De=null,ne=E,ge=E=0,Ce=null;ne!==null&&ge<M.length;ge++){ne.index>ge?(Ce=ne,ne=null):Ce=ne.sibling;var Me=A(D,ne,M[ge],U);if(Me===null){ne===null&&(ne=Ce);break}t&&ne&&Me.alternate===null&&s(D,ne),E=u(Me,E,ge),De===null?le=Me:De.sibling=Me,De=Me,ne=Ce}if(ge===M.length)return r(D,ne),ke&&qi(D,ge),le;if(ne===null){for(;ge<M.length;ge++)ne=P(D,M[ge],U),ne!==null&&(E=u(ne,E,ge),De===null?le=ne:De.sibling=ne,De=ne);return ke&&qi(D,ge),le}for(ne=a(ne);ge<M.length;ge++)Ce=z(ne,D,ge,M[ge],U),Ce!==null&&(t&&Ce.alternate!==null&&ne.delete(Ce.key===null?ge:Ce.key),E=u(Ce,E,ge),De===null?le=Ce:De.sibling=Ce,De=Ce);return t&&ne.forEach(function(Ms){return s(D,Ms)}),ke&&qi(D,ge),le}function ce(D,E,M,U){if(M==null)throw Error(l(151));for(var le=null,De=null,ne=E,ge=E=0,Ce=null,Me=M.next();ne!==null&&!Me.done;ge++,Me=M.next()){ne.index>ge?(Ce=ne,ne=null):Ce=ne.sibling;var Ms=A(D,ne,Me.value,U);if(Ms===null){ne===null&&(ne=Ce);break}t&&ne&&Ms.alternate===null&&s(D,ne),E=u(Ms,E,ge),De===null?le=Ms:De.sibling=Ms,De=Ms,ne=Ce}if(Me.done)return r(D,ne),ke&&qi(D,ge),le;if(ne===null){for(;!Me.done;ge++,Me=M.next())Me=P(D,Me.value,U),Me!==null&&(E=u(Me,E,ge),De===null?le=Me:De.sibling=Me,De=Me);return ke&&qi(D,ge),le}for(ne=a(ne);!Me.done;ge++,Me=M.next())Me=z(ne,D,ge,Me.value,U),Me!==null&&(t&&Me.alternate!==null&&ne.delete(Me.key===null?ge:Me.key),E=u(Me,E,ge),De===null?le=Me:De.sibling=Me,De=Me);return t&&ne.forEach(function(ry){return s(D,ry)}),ke&&qi(D,ge),le}function je(D,E,M,U){if(typeof M=="object"&&M!==null&&M.type===R&&M.key===null&&(M=M.props.children),typeof M=="object"&&M!==null){switch(M.$$typeof){case C:e:{for(var le=M.key;E!==null;){if(E.key===le){if(le=M.type,le===R){if(E.tag===7){r(D,E.sibling),U=c(E,M.props.children),U.return=D,D=U;break e}}else if(E.elementType===le||typeof le=="object"&&le!==null&&le.$$typeof===Se&&Gs(le)===E.type){r(D,E.sibling),U=c(E,M.props),wn(U,M),U.return=D,D=U;break e}r(D,E);break}else s(D,E);E=E.sibling}M.type===R?(U=Ks(M.props.children,D.mode,U,M.key),U.return=D,D=U):(U=Wl(M.type,M.key,M.props,null,D.mode,U),wn(U,M),U.return=D,D=U)}return g(D);case b:e:{for(le=M.key;E!==null;){if(E.key===le)if(E.tag===4&&E.stateNode.containerInfo===M.containerInfo&&E.stateNode.implementation===M.implementation){r(D,E.sibling),U=c(E,M.children||[]),U.return=D,D=U;break e}else{r(D,E);break}else s(D,E);E=E.sibling}U=Qo(M,D.mode,U),U.return=D,D=U}return g(D);case Se:return M=Gs(M),je(D,E,M,U)}if(Z(M))return re(D,E,M,U);if(G(M)){if(le=G(M),typeof le!="function")throw Error(l(150));return M=le.call(M),ce(D,E,M,U)}if(typeof M.then=="function")return je(D,E,Gl(M),U);if(M.$$typeof===$)return je(D,E,Yl(D,M),U);Vl(D,M)}return typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint"?(M=""+M,E!==null&&E.tag===6?(r(D,E.sibling),U=c(E,M),U.return=D,D=U):(r(D,E),U=Zo(M,D.mode,U),U.return=D,D=U),g(D)):r(D,E)}return function(D,E,M,U){try{xn=0;var le=je(D,E,M,U);return zr=null,le}catch(ne){if(ne===Ar||ne===Il)throw ne;var De=It(29,ne,null,D.mode);return De.lanes=U,De.return=D,De}}}var Fs=xf(!0),wf=xf(!1),fs=!1;function hc(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function uc(t,s){t=t.updateQueue,s.updateQueue===t&&(s.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function _s(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function ps(t,s,r){var a=t.updateQueue;if(a===null)return null;if(a=a.shared,(Be&2)!==0){var c=a.pending;return c===null?s.next=s:(s.next=c.next,c.next=s),a.pending=s,s=ql(t),lf(t,null,r),s}return Ul(t,a,s,r),ql(t)}function Cn(t,s,r){if(s=s.updateQueue,s!==null&&(s=s.shared,(r&4194048)!==0)){var a=s.lanes;a&=t.pendingLanes,r|=a,s.lanes=r,fd(t,r)}}function dc(t,s){var r=t.updateQueue,a=t.alternate;if(a!==null&&(a=a.updateQueue,r===a)){var c=null,u=null;if(r=r.firstBaseUpdate,r!==null){do{var g={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};u===null?c=u=g:u=u.next=g,r=r.next}while(r!==null);u===null?c=u=s:u=u.next=s}else c=u=s;r={baseState:a.baseState,firstBaseUpdate:c,lastBaseUpdate:u,shared:a.shared,callbacks:a.callbacks},t.updateQueue=r;return}t=r.lastBaseUpdate,t===null?r.firstBaseUpdate=s:t.next=s,r.lastBaseUpdate=s}var fc=!1;function kn(){if(fc){var t=Br;if(t!==null)throw t}}function En(t,s,r,a){fc=!1;var c=t.updateQueue;fs=!1;var u=c.firstBaseUpdate,g=c.lastBaseUpdate,v=c.shared.pending;if(v!==null){c.shared.pending=null;var w=v,B=w.next;w.next=null,g===null?u=B:g.next=B,g=w;var N=t.alternate;N!==null&&(N=N.updateQueue,v=N.lastBaseUpdate,v!==g&&(v===null?N.firstBaseUpdate=B:v.next=B,N.lastBaseUpdate=w))}if(u!==null){var P=c.baseState;g=0,N=B=w=null,v=u;do{var A=v.lane&-536870913,z=A!==v.lane;if(z?(we&A)===A:(a&A)===A){A!==0&&A===Mr&&(fc=!0),N!==null&&(N=N.next={lane:0,tag:v.tag,payload:v.payload,callback:null,next:null});e:{var re=t,ce=v;A=s;var je=r;switch(ce.tag){case 1:if(re=ce.payload,typeof re=="function"){P=re.call(je,P,A);break e}P=re;break e;case 3:re.flags=re.flags&-65537|128;case 0:if(re=ce.payload,A=typeof re=="function"?re.call(je,P,A):re,A==null)break e;P=y({},P,A);break e;case 2:fs=!0}}A=v.callback,A!==null&&(t.flags|=64,z&&(t.flags|=8192),z=c.callbacks,z===null?c.callbacks=[A]:z.push(A))}else z={lane:A,tag:v.tag,payload:v.payload,callback:v.callback,next:null},N===null?(B=N=z,w=P):N=N.next=z,g|=A;if(v=v.next,v===null){if(v=c.shared.pending,v===null)break;z=v,v=z.next,z.next=null,c.lastBaseUpdate=z,c.shared.pending=null}}while(!0);N===null&&(w=P),c.baseState=w,c.firstBaseUpdate=B,c.lastBaseUpdate=N,u===null&&(c.shared.lanes=0),ys|=g,t.lanes=g,t.memoizedState=P}}function Cf(t,s){if(typeof t!="function")throw Error(l(191,t));t.call(s)}function kf(t,s){var r=t.callbacks;if(r!==null)for(t.callbacks=null,t=0;t<r.length;t++)Cf(r[t],s)}var Or=k(null),Fl=k(0);function Ef(t,s){t=Zi,F(Fl,t),F(Or,s),Zi=t|s.baseLanes}function _c(){F(Fl,Zi),F(Or,Or.current)}function pc(){Zi=Fl.current,H(Or),H(Fl)}var Xt=k(null),ci=null;function gs(t){var s=t.alternate;F(Qe,Qe.current&1),F(Xt,t),ci===null&&(s===null||Or.current!==null||s.memoizedState!==null)&&(ci=t)}function gc(t){F(Qe,Qe.current),F(Xt,t),ci===null&&(ci=t)}function Tf(t){t.tag===22?(F(Qe,Qe.current),F(Xt,t),ci===null&&(ci=t)):ms()}function ms(){F(Qe,Qe.current),F(Xt,Xt.current)}function Gt(t){H(Xt),ci===t&&(ci=null),H(Qe)}var Qe=k(0);function Zl(t){for(var s=t;s!==null;){if(s.tag===13){var r=s.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||xh(r)||wh(r)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break;for(;s.sibling===null;){if(s.return===null||s.return===t)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var Ki=0,pe=null,Ne=null,it=null,Ql=!1,Lr=!1,Zs=!1,Jl=0,Tn=0,Nr=null,G0=0;function Ge(){throw Error(l(321))}function mc(t,s){if(s===null)return!1;for(var r=0;r<s.length&&r<t.length;r++)if(!$t(t[r],s[r]))return!1;return!0}function vc(t,s,r,a,c,u){return Ki=u,pe=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,T.H=t===null||t.memoizedState===null?h_:zc,Zs=!1,u=r(a,c),Zs=!1,Lr&&(u=Df(s,r,a,c)),Rf(t),u}function Rf(t){T.H=Mn;var s=Ne!==null&&Ne.next!==null;if(Ki=0,it=Ne=pe=null,Ql=!1,Tn=0,Nr=null,s)throw Error(l(300));t===null||st||(t=t.dependencies,t!==null&&Kl(t)&&(st=!0))}function Df(t,s,r,a){pe=t;var c=0;do{if(Lr&&(Nr=null),Tn=0,Lr=!1,25<=c)throw Error(l(301));if(c+=1,it=Ne=null,t.updateQueue!=null){var u=t.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}T.H=u_,u=s(r,a)}while(Lr);return u}function V0(){var t=T.H,s=t.useState()[0];return s=typeof s.then=="function"?Rn(s):s,t=t.useState()[0],(Ne!==null?Ne.memoizedState:null)!==t&&(pe.flags|=1024),s}function Sc(){var t=Jl!==0;return Jl=0,t}function yc(t,s,r){s.updateQueue=t.updateQueue,s.flags&=-2053,t.lanes&=~r}function bc(t){if(Ql){for(t=t.memoizedState;t!==null;){var s=t.queue;s!==null&&(s.pending=null),t=t.next}Ql=!1}Ki=0,it=Ne=pe=null,Lr=!1,Tn=Jl=0,Nr=null}function Tt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return it===null?pe.memoizedState=it=t:it=it.next=t,it}function Je(){if(Ne===null){var t=pe.alternate;t=t!==null?t.memoizedState:null}else t=Ne.next;var s=it===null?pe.memoizedState:it.next;if(s!==null)it=s,Ne=t;else{if(t===null)throw pe.alternate===null?Error(l(467)):Error(l(310));Ne=t,t={memoizedState:Ne.memoizedState,baseState:Ne.baseState,baseQueue:Ne.baseQueue,queue:Ne.queue,next:null},it===null?pe.memoizedState=it=t:it=it.next=t}return it}function ea(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Rn(t){var s=Tn;return Tn+=1,Nr===null&&(Nr=[]),t=Sf(Nr,t,s),s=pe,(it===null?s.memoizedState:it.next)===null&&(s=s.alternate,T.H=s===null||s.memoizedState===null?h_:zc),t}function ta(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Rn(t);if(t.$$typeof===$)return bt(t)}throw Error(l(438,String(t)))}function xc(t){var s=null,r=pe.updateQueue;if(r!==null&&(s=r.memoCache),s==null){var a=pe.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(s={data:a.data.map(function(c){return c.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),r===null&&(r=ea(),pe.updateQueue=r),r.memoCache=s,r=s.data[s.index],r===void 0)for(r=s.data[s.index]=Array(t),a=0;a<t;a++)r[a]=zt;return s.index++,r}function Yi(t,s){return typeof s=="function"?s(t):s}function ia(t){var s=Je();return wc(s,Ne,t)}function wc(t,s,r){var a=t.queue;if(a===null)throw Error(l(311));a.lastRenderedReducer=r;var c=t.baseQueue,u=a.pending;if(u!==null){if(c!==null){var g=c.next;c.next=u.next,u.next=g}s.baseQueue=c=u,a.pending=null}if(u=t.baseState,c===null)t.memoizedState=u;else{s=c.next;var v=g=null,w=null,B=s,N=!1;do{var P=B.lane&-536870913;if(P!==B.lane?(we&P)===P:(Ki&P)===P){var A=B.revertLane;if(A===0)w!==null&&(w=w.next={lane:0,revertLane:0,gesture:null,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null}),P===Mr&&(N=!0);else if((Ki&A)===A){B=B.next,A===Mr&&(N=!0);continue}else P={lane:0,revertLane:B.revertLane,gesture:null,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null},w===null?(v=w=P,g=u):w=w.next=P,pe.lanes|=A,ys|=A;P=B.action,Zs&&r(u,P),u=B.hasEagerState?B.eagerState:r(u,P)}else A={lane:P,revertLane:B.revertLane,gesture:B.gesture,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null},w===null?(v=w=A,g=u):w=w.next=A,pe.lanes|=P,ys|=P;B=B.next}while(B!==null&&B!==s);if(w===null?g=u:w.next=v,!$t(u,t.memoizedState)&&(st=!0,N&&(r=Br,r!==null)))throw r;t.memoizedState=u,t.baseState=g,t.baseQueue=w,a.lastRenderedState=u}return c===null&&(a.lanes=0),[t.memoizedState,a.dispatch]}function Cc(t){var s=Je(),r=s.queue;if(r===null)throw Error(l(311));r.lastRenderedReducer=t;var a=r.dispatch,c=r.pending,u=s.memoizedState;if(c!==null){r.pending=null;var g=c=c.next;do u=t(u,g.action),g=g.next;while(g!==c);$t(u,s.memoizedState)||(st=!0),s.memoizedState=u,s.baseQueue===null&&(s.baseState=u),r.lastRenderedState=u}return[u,a]}function Mf(t,s,r){var a=pe,c=Je(),u=ke;if(u){if(r===void 0)throw Error(l(407));r=r()}else r=s();var g=!$t((Ne||c).memoizedState,r);if(g&&(c.memoizedState=r,st=!0),c=c.queue,Tc(zf.bind(null,a,c,t),[t]),c.getSnapshot!==s||g||it!==null&&it.memoizedState.tag&1){if(a.flags|=2048,Hr(9,{destroy:void 0},Af.bind(null,a,c,r,s),null),qe===null)throw Error(l(349));u||(Ki&127)!==0||Bf(a,s,r)}return r}function Bf(t,s,r){t.flags|=16384,t={getSnapshot:s,value:r},s=pe.updateQueue,s===null?(s=ea(),pe.updateQueue=s,s.stores=[t]):(r=s.stores,r===null?s.stores=[t]:r.push(t))}function Af(t,s,r,a){s.value=r,s.getSnapshot=a,Of(s)&&Lf(t)}function zf(t,s,r){return r(function(){Of(s)&&Lf(t)})}function Of(t){var s=t.getSnapshot;t=t.value;try{var r=s();return!$t(t,r)}catch{return!0}}function Lf(t){var s=Ps(t,2);s!==null&&qt(s,t,2)}function kc(t){var s=Tt();if(typeof t=="function"){var r=t;if(t=r(),Zs){ls(!0);try{r()}finally{ls(!1)}}}return s.memoizedState=s.baseState=t,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yi,lastRenderedState:t},s}function Nf(t,s,r,a){return t.baseState=r,wc(t,Ne,typeof a=="function"?a:Yi)}function F0(t,s,r,a,c){if(na(t))throw Error(l(485));if(t=s.action,t!==null){var u={payload:c,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(g){u.listeners.push(g)}};T.T!==null?r(!0):u.isTransition=!1,a(u),r=s.pending,r===null?(u.next=s.pending=u,Hf(s,u)):(u.next=r.next,s.pending=r.next=u)}}function Hf(t,s){var r=s.action,a=s.payload,c=t.state;if(s.isTransition){var u=T.T,g={};T.T=g;try{var v=r(c,a),w=T.S;w!==null&&w(g,v),jf(t,s,v)}catch(B){Ec(t,s,B)}finally{u!==null&&g.types!==null&&(u.types=g.types),T.T=u}}else try{u=r(c,a),jf(t,s,u)}catch(B){Ec(t,s,B)}}function jf(t,s,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(a){Uf(t,s,a)},function(a){return Ec(t,s,a)}):Uf(t,s,r)}function Uf(t,s,r){s.status="fulfilled",s.value=r,qf(s),t.state=r,s=t.pending,s!==null&&(r=s.next,r===s?t.pending=null:(r=r.next,s.next=r,Hf(t,r)))}function Ec(t,s,r){var a=t.pending;if(t.pending=null,a!==null){a=a.next;do s.status="rejected",s.reason=r,qf(s),s=s.next;while(s!==a)}t.action=null}function qf(t){t=t.listeners;for(var s=0;s<t.length;s++)(0,t[s])()}function Wf(t,s){return s}function Pf(t,s){if(ke){var r=qe.formState;if(r!==null){e:{var a=pe;if(ke){if(We){t:{for(var c=We,u=oi;c.nodeType!==8;){if(!u){c=null;break t}if(c=hi(c.nextSibling),c===null){c=null;break t}}u=c.data,c=u==="F!"||u==="F"?c:null}if(c){We=hi(c.nextSibling),a=c.data==="F!";break e}}us(a)}a=!1}a&&(s=r[0])}}return r=Tt(),r.memoizedState=r.baseState=s,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wf,lastRenderedState:s},r.queue=a,r=a_.bind(null,pe,a),a.dispatch=r,a=kc(!1),u=Ac.bind(null,pe,!1,a.queue),a=Tt(),c={state:s,dispatch:null,action:t,pending:null},a.queue=c,r=F0.bind(null,pe,c,u,r),c.dispatch=r,a.memoizedState=t,[s,r,!1]}function Kf(t){var s=Je();return Yf(s,Ne,t)}function Yf(t,s,r){if(s=wc(t,s,Wf)[0],t=ia(Yi)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var a=Rn(s)}catch(g){throw g===Ar?Il:g}else a=s;s=Je();var c=s.queue,u=c.dispatch;return r!==s.memoizedState&&(pe.flags|=2048,Hr(9,{destroy:void 0},Z0.bind(null,c,r),null)),[a,u,t]}function Z0(t,s){t.action=s}function $f(t){var s=Je(),r=Ne;if(r!==null)return Yf(s,r,t);Je(),s=s.memoizedState,r=Je();var a=r.queue.dispatch;return r.memoizedState=t,[s,a,!1]}function Hr(t,s,r,a){return t={tag:t,create:r,deps:a,inst:s,next:null},s=pe.updateQueue,s===null&&(s=ea(),pe.updateQueue=s),r=s.lastEffect,r===null?s.lastEffect=t.next=t:(a=r.next,r.next=t,t.next=a,s.lastEffect=t),t}function If(){return Je().memoizedState}function sa(t,s,r,a){var c=Tt();pe.flags|=t,c.memoizedState=Hr(1|s,{destroy:void 0},r,a===void 0?null:a)}function ra(t,s,r,a){var c=Je();a=a===void 0?null:a;var u=c.memoizedState.inst;Ne!==null&&a!==null&&mc(a,Ne.memoizedState.deps)?c.memoizedState=Hr(s,u,r,a):(pe.flags|=t,c.memoizedState=Hr(1|s,u,r,a))}function Xf(t,s){sa(8390656,8,t,s)}function Tc(t,s){ra(2048,8,t,s)}function Q0(t){pe.flags|=4;var s=pe.updateQueue;if(s===null)s=ea(),pe.updateQueue=s,s.events=[t];else{var r=s.events;r===null?s.events=[t]:r.push(t)}}function Gf(t){var s=Je().memoizedState;return Q0({ref:s,nextImpl:t}),function(){if((Be&2)!==0)throw Error(l(440));return s.impl.apply(void 0,arguments)}}function Vf(t,s){return ra(4,2,t,s)}function Ff(t,s){return ra(4,4,t,s)}function Zf(t,s){if(typeof s=="function"){t=t();var r=s(t);return function(){typeof r=="function"?r():s(null)}}if(s!=null)return t=t(),s.current=t,function(){s.current=null}}function Qf(t,s,r){r=r!=null?r.concat([t]):null,ra(4,4,Zf.bind(null,s,t),r)}function Rc(){}function Jf(t,s){var r=Je();s=s===void 0?null:s;var a=r.memoizedState;return s!==null&&mc(s,a[1])?a[0]:(r.memoizedState=[t,s],t)}function e_(t,s){var r=Je();s=s===void 0?null:s;var a=r.memoizedState;if(s!==null&&mc(s,a[1]))return a[0];if(a=t(),Zs){ls(!0);try{t()}finally{ls(!1)}}return r.memoizedState=[a,s],a}function Dc(t,s,r){return r===void 0||(Ki&1073741824)!==0&&(we&261930)===0?t.memoizedState=s:(t.memoizedState=r,t=tp(),pe.lanes|=t,ys|=t,r)}function t_(t,s,r,a){return $t(r,s)?r:Or.current!==null?(t=Dc(t,r,a),$t(t,s)||(st=!0),t):(Ki&42)===0||(Ki&1073741824)!==0&&(we&261930)===0?(st=!0,t.memoizedState=r):(t=tp(),pe.lanes|=t,ys|=t,s)}function i_(t,s,r,a,c){var u=j.p;j.p=u!==0&&8>u?u:8;var g=T.T,v={};T.T=v,Ac(t,!1,s,r);try{var w=c(),B=T.S;if(B!==null&&B(v,w),w!==null&&typeof w=="object"&&typeof w.then=="function"){var N=X0(w,a);Dn(t,s,N,Zt(t))}else Dn(t,s,a,Zt(t))}catch(P){Dn(t,s,{then:function(){},status:"rejected",reason:P},Zt())}finally{j.p=u,g!==null&&v.types!==null&&(g.types=v.types),T.T=g}}function J0(){}function Mc(t,s,r,a){if(t.tag!==5)throw Error(l(476));var c=s_(t).queue;i_(t,c,s,q,r===null?J0:function(){return r_(t),r(a)})}function s_(t){var s=t.memoizedState;if(s!==null)return s;s={memoizedState:q,baseState:q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yi,lastRenderedState:q},next:null};var r={};return s.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yi,lastRenderedState:r},next:null},t.memoizedState=s,t=t.alternate,t!==null&&(t.memoizedState=s),s}function r_(t){var s=s_(t);s.next===null&&(s=t.alternate.memoizedState),Dn(t,s.next.queue,{},Zt())}function Bc(){return bt(In)}function n_(){return Je().memoizedState}function l_(){return Je().memoizedState}function eS(t){for(var s=t.return;s!==null;){switch(s.tag){case 24:case 3:var r=Zt();t=_s(r);var a=ps(s,t,r);a!==null&&(qt(a,s,r),Cn(a,s,r)),s={cache:lc()},t.payload=s;return}s=s.return}}function tS(t,s,r){var a=Zt();r={lane:a,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},na(t)?o_(s,r):(r=Vo(t,s,r,a),r!==null&&(qt(r,t,a),c_(r,s,a)))}function a_(t,s,r){var a=Zt();Dn(t,s,r,a)}function Dn(t,s,r,a){var c={lane:a,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(na(t))o_(s,c);else{var u=t.alternate;if(t.lanes===0&&(u===null||u.lanes===0)&&(u=s.lastRenderedReducer,u!==null))try{var g=s.lastRenderedState,v=u(g,r);if(c.hasEagerState=!0,c.eagerState=v,$t(v,g))return Ul(t,s,c,0),qe===null&&jl(),!1}catch{}if(r=Vo(t,s,c,a),r!==null)return qt(r,t,a),c_(r,s,a),!0}return!1}function Ac(t,s,r,a){if(a={lane:2,revertLane:hh(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},na(t)){if(s)throw Error(l(479))}else s=Vo(t,r,a,2),s!==null&&qt(s,t,2)}function na(t){var s=t.alternate;return t===pe||s!==null&&s===pe}function o_(t,s){Lr=Ql=!0;var r=t.pending;r===null?s.next=s:(s.next=r.next,r.next=s),t.pending=s}function c_(t,s,r){if((r&4194048)!==0){var a=s.lanes;a&=t.pendingLanes,r|=a,s.lanes=r,fd(t,r)}}var Mn={readContext:bt,use:ta,useCallback:Ge,useContext:Ge,useEffect:Ge,useImperativeHandle:Ge,useLayoutEffect:Ge,useInsertionEffect:Ge,useMemo:Ge,useReducer:Ge,useRef:Ge,useState:Ge,useDebugValue:Ge,useDeferredValue:Ge,useTransition:Ge,useSyncExternalStore:Ge,useId:Ge,useHostTransitionStatus:Ge,useFormState:Ge,useActionState:Ge,useOptimistic:Ge,useMemoCache:Ge,useCacheRefresh:Ge};Mn.useEffectEvent=Ge;var h_={readContext:bt,use:ta,useCallback:function(t,s){return Tt().memoizedState=[t,s===void 0?null:s],t},useContext:bt,useEffect:Xf,useImperativeHandle:function(t,s,r){r=r!=null?r.concat([t]):null,sa(4194308,4,Zf.bind(null,s,t),r)},useLayoutEffect:function(t,s){return sa(4194308,4,t,s)},useInsertionEffect:function(t,s){sa(4,2,t,s)},useMemo:function(t,s){var r=Tt();s=s===void 0?null:s;var a=t();if(Zs){ls(!0);try{t()}finally{ls(!1)}}return r.memoizedState=[a,s],a},useReducer:function(t,s,r){var a=Tt();if(r!==void 0){var c=r(s);if(Zs){ls(!0);try{r(s)}finally{ls(!1)}}}else c=s;return a.memoizedState=a.baseState=c,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:c},a.queue=t,t=t.dispatch=tS.bind(null,pe,t),[a.memoizedState,t]},useRef:function(t){var s=Tt();return t={current:t},s.memoizedState=t},useState:function(t){t=kc(t);var s=t.queue,r=a_.bind(null,pe,s);return s.dispatch=r,[t.memoizedState,r]},useDebugValue:Rc,useDeferredValue:function(t,s){var r=Tt();return Dc(r,t,s)},useTransition:function(){var t=kc(!1);return t=i_.bind(null,pe,t.queue,!0,!1),Tt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,s,r){var a=pe,c=Tt();if(ke){if(r===void 0)throw Error(l(407));r=r()}else{if(r=s(),qe===null)throw Error(l(349));(we&127)!==0||Bf(a,s,r)}c.memoizedState=r;var u={value:r,getSnapshot:s};return c.queue=u,Xf(zf.bind(null,a,u,t),[t]),a.flags|=2048,Hr(9,{destroy:void 0},Af.bind(null,a,u,r,s),null),r},useId:function(){var t=Tt(),s=qe.identifierPrefix;if(ke){var r=Ei,a=ki;r=(a&~(1<<32-Yt(a)-1)).toString(32)+r,s="_"+s+"R_"+r,r=Jl++,0<r&&(s+="H"+r.toString(32)),s+="_"}else r=G0++,s="_"+s+"r_"+r.toString(32)+"_";return t.memoizedState=s},useHostTransitionStatus:Bc,useFormState:Pf,useActionState:Pf,useOptimistic:function(t){var s=Tt();s.memoizedState=s.baseState=t;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=r,s=Ac.bind(null,pe,!0,r),r.dispatch=s,[t,s]},useMemoCache:xc,useCacheRefresh:function(){return Tt().memoizedState=eS.bind(null,pe)},useEffectEvent:function(t){var s=Tt(),r={impl:t};return s.memoizedState=r,function(){if((Be&2)!==0)throw Error(l(440));return r.impl.apply(void 0,arguments)}}},zc={readContext:bt,use:ta,useCallback:Jf,useContext:bt,useEffect:Tc,useImperativeHandle:Qf,useInsertionEffect:Vf,useLayoutEffect:Ff,useMemo:e_,useReducer:ia,useRef:If,useState:function(){return ia(Yi)},useDebugValue:Rc,useDeferredValue:function(t,s){var r=Je();return t_(r,Ne.memoizedState,t,s)},useTransition:function(){var t=ia(Yi)[0],s=Je().memoizedState;return[typeof t=="boolean"?t:Rn(t),s]},useSyncExternalStore:Mf,useId:n_,useHostTransitionStatus:Bc,useFormState:Kf,useActionState:Kf,useOptimistic:function(t,s){var r=Je();return Nf(r,Ne,t,s)},useMemoCache:xc,useCacheRefresh:l_};zc.useEffectEvent=Gf;var u_={readContext:bt,use:ta,useCallback:Jf,useContext:bt,useEffect:Tc,useImperativeHandle:Qf,useInsertionEffect:Vf,useLayoutEffect:Ff,useMemo:e_,useReducer:Cc,useRef:If,useState:function(){return Cc(Yi)},useDebugValue:Rc,useDeferredValue:function(t,s){var r=Je();return Ne===null?Dc(r,t,s):t_(r,Ne.memoizedState,t,s)},useTransition:function(){var t=Cc(Yi)[0],s=Je().memoizedState;return[typeof t=="boolean"?t:Rn(t),s]},useSyncExternalStore:Mf,useId:n_,useHostTransitionStatus:Bc,useFormState:$f,useActionState:$f,useOptimistic:function(t,s){var r=Je();return Ne!==null?Nf(r,Ne,t,s):(r.baseState=t,[t,r.queue.dispatch])},useMemoCache:xc,useCacheRefresh:l_};u_.useEffectEvent=Gf;function Oc(t,s,r,a){s=t.memoizedState,r=r(a,s),r=r==null?s:y({},s,r),t.memoizedState=r,t.lanes===0&&(t.updateQueue.baseState=r)}var Lc={enqueueSetState:function(t,s,r){t=t._reactInternals;var a=Zt(),c=_s(a);c.payload=s,r!=null&&(c.callback=r),s=ps(t,c,a),s!==null&&(qt(s,t,a),Cn(s,t,a))},enqueueReplaceState:function(t,s,r){t=t._reactInternals;var a=Zt(),c=_s(a);c.tag=1,c.payload=s,r!=null&&(c.callback=r),s=ps(t,c,a),s!==null&&(qt(s,t,a),Cn(s,t,a))},enqueueForceUpdate:function(t,s){t=t._reactInternals;var r=Zt(),a=_s(r);a.tag=2,s!=null&&(a.callback=s),s=ps(t,a,r),s!==null&&(qt(s,t,r),Cn(s,t,r))}};function d_(t,s,r,a,c,u,g){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(a,u,g):s.prototype&&s.prototype.isPureReactComponent?!gn(r,a)||!gn(c,u):!0}function f_(t,s,r,a){t=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(r,a),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(r,a),s.state!==t&&Lc.enqueueReplaceState(s,s.state,null)}function Qs(t,s){var r=s;if("ref"in s){r={};for(var a in s)a!=="ref"&&(r[a]=s[a])}if(t=t.defaultProps){r===s&&(r=y({},r));for(var c in t)r[c]===void 0&&(r[c]=t[c])}return r}function __(t){Hl(t)}function p_(t){console.error(t)}function g_(t){Hl(t)}function la(t,s){try{var r=t.onUncaughtError;r(s.value,{componentStack:s.stack})}catch(a){setTimeout(function(){throw a})}}function m_(t,s,r){try{var a=t.onCaughtError;a(r.value,{componentStack:r.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function Nc(t,s,r){return r=_s(r),r.tag=3,r.payload={element:null},r.callback=function(){la(t,s)},r}function v_(t){return t=_s(t),t.tag=3,t}function S_(t,s,r,a){var c=r.type.getDerivedStateFromError;if(typeof c=="function"){var u=a.value;t.payload=function(){return c(u)},t.callback=function(){m_(s,r,a)}}var g=r.stateNode;g!==null&&typeof g.componentDidCatch=="function"&&(t.callback=function(){m_(s,r,a),typeof c!="function"&&(bs===null?bs=new Set([this]):bs.add(this));var v=a.stack;this.componentDidCatch(a.value,{componentStack:v!==null?v:""})})}function iS(t,s,r,a,c){if(r.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(s=r.alternate,s!==null&&Dr(s,r,c,!0),r=Xt.current,r!==null){switch(r.tag){case 31:case 13:return ci===null?va():r.alternate===null&&Ve===0&&(Ve=3),r.flags&=-257,r.flags|=65536,r.lanes=c,a===Xl?r.flags|=16384:(s=r.updateQueue,s===null?r.updateQueue=new Set([a]):s.add(a),ah(t,a,c)),!1;case 22:return r.flags|=65536,a===Xl?r.flags|=16384:(s=r.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([a])},r.updateQueue=s):(r=s.retryQueue,r===null?s.retryQueue=new Set([a]):r.add(a)),ah(t,a,c)),!1}throw Error(l(435,r.tag))}return ah(t,a,c),va(),!1}if(ke)return s=Xt.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=c,a!==tc&&(t=Error(l(422),{cause:a}),Sn(ni(t,r)))):(a!==tc&&(s=Error(l(423),{cause:a}),Sn(ni(s,r))),t=t.current.alternate,t.flags|=65536,c&=-c,t.lanes|=c,a=ni(a,r),c=Nc(t.stateNode,a,c),dc(t,c),Ve!==4&&(Ve=2)),!1;var u=Error(l(520),{cause:a});if(u=ni(u,r),jn===null?jn=[u]:jn.push(u),Ve!==4&&(Ve=2),s===null)return!0;a=ni(a,r),r=s;do{switch(r.tag){case 3:return r.flags|=65536,t=c&-c,r.lanes|=t,t=Nc(r.stateNode,a,t),dc(r,t),!1;case 1:if(s=r.type,u=r.stateNode,(r.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(bs===null||!bs.has(u))))return r.flags|=65536,c&=-c,r.lanes|=c,c=v_(c),S_(c,t,r,a),dc(r,c),!1}r=r.return}while(r!==null);return!1}var Hc=Error(l(461)),st=!1;function xt(t,s,r,a){s.child=t===null?wf(s,null,r,a):Fs(s,t.child,r,a)}function y_(t,s,r,a,c){r=r.render;var u=s.ref;if("ref"in a){var g={};for(var v in a)v!=="ref"&&(g[v]=a[v])}else g=a;return Is(s),a=vc(t,s,r,g,u,c),v=Sc(),t!==null&&!st?(yc(t,s,c),$i(t,s,c)):(ke&&v&&Jo(s),s.flags|=1,xt(t,s,a,c),s.child)}function b_(t,s,r,a,c){if(t===null){var u=r.type;return typeof u=="function"&&!Fo(u)&&u.defaultProps===void 0&&r.compare===null?(s.tag=15,s.type=u,x_(t,s,u,a,c)):(t=Wl(r.type,null,a,s,s.mode,c),t.ref=s.ref,t.return=s,s.child=t)}if(u=t.child,!$c(t,c)){var g=u.memoizedProps;if(r=r.compare,r=r!==null?r:gn,r(g,a)&&t.ref===s.ref)return $i(t,s,c)}return s.flags|=1,t=Ui(u,a),t.ref=s.ref,t.return=s,s.child=t}function x_(t,s,r,a,c){if(t!==null){var u=t.memoizedProps;if(gn(u,a)&&t.ref===s.ref)if(st=!1,s.pendingProps=a=u,$c(t,c))(t.flags&131072)!==0&&(st=!0);else return s.lanes=t.lanes,$i(t,s,c)}return jc(t,s,r,a,c)}function w_(t,s,r,a){var c=a.children,u=t!==null?t.memoizedState:null;if(t===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((s.flags&128)!==0){if(u=u!==null?u.baseLanes|r:r,t!==null){for(a=s.child=t.child,c=0;a!==null;)c=c|a.lanes|a.childLanes,a=a.sibling;a=c&~u}else a=0,s.child=null;return C_(t,s,u,r,a)}if((r&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},t!==null&&$l(s,u!==null?u.cachePool:null),u!==null?Ef(s,u):_c(),Tf(s);else return a=s.lanes=536870912,C_(t,s,u!==null?u.baseLanes|r:r,r,a)}else u!==null?($l(s,u.cachePool),Ef(s,u),ms(),s.memoizedState=null):(t!==null&&$l(s,null),_c(),ms());return xt(t,s,c,r),s.child}function Bn(t,s){return t!==null&&t.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function C_(t,s,r,a,c){var u=oc();return u=u===null?null:{parent:tt._currentValue,pool:u},s.memoizedState={baseLanes:r,cachePool:u},t!==null&&$l(s,null),_c(),Tf(s),t!==null&&Dr(t,s,a,!0),s.childLanes=c,null}function aa(t,s){return s=ca({mode:s.mode,children:s.children},t.mode),s.ref=t.ref,t.child=s,s.return=t,s}function k_(t,s,r){return Fs(s,t.child,null,r),t=aa(s,s.pendingProps),t.flags|=2,Gt(s),s.memoizedState=null,t}function sS(t,s,r){var a=s.pendingProps,c=(s.flags&128)!==0;if(s.flags&=-129,t===null){if(ke){if(a.mode==="hidden")return t=aa(s,a),s.lanes=536870912,Bn(null,t);if(gc(s),(t=We)?(t=Hp(t,oi),t=t!==null&&t.data==="&"?t:null,t!==null&&(s.memoizedState={dehydrated:t,treeContext:cs!==null?{id:ki,overflow:Ei}:null,retryLane:536870912,hydrationErrors:null},r=of(t),r.return=s,s.child=r,yt=s,We=null)):t=null,t===null)throw us(s);return s.lanes=536870912,null}return aa(s,a)}var u=t.memoizedState;if(u!==null){var g=u.dehydrated;if(gc(s),c)if(s.flags&256)s.flags&=-257,s=k_(t,s,r);else if(s.memoizedState!==null)s.child=t.child,s.flags|=128,s=null;else throw Error(l(558));else if(st||Dr(t,s,r,!1),c=(r&t.childLanes)!==0,st||c){if(a=qe,a!==null&&(g=_d(a,r),g!==0&&g!==u.retryLane))throw u.retryLane=g,Ps(t,g),qt(a,t,g),Hc;va(),s=k_(t,s,r)}else t=u.treeContext,We=hi(g.nextSibling),yt=s,ke=!0,hs=null,oi=!1,t!==null&&uf(s,t),s=aa(s,a),s.flags|=4096;return s}return t=Ui(t.child,{mode:a.mode,children:a.children}),t.ref=s.ref,s.child=t,t.return=s,t}function oa(t,s){var r=s.ref;if(r===null)t!==null&&t.ref!==null&&(s.flags|=4194816);else{if(typeof r!="function"&&typeof r!="object")throw Error(l(284));(t===null||t.ref!==r)&&(s.flags|=4194816)}}function jc(t,s,r,a,c){return Is(s),r=vc(t,s,r,a,void 0,c),a=Sc(),t!==null&&!st?(yc(t,s,c),$i(t,s,c)):(ke&&a&&Jo(s),s.flags|=1,xt(t,s,r,c),s.child)}function E_(t,s,r,a,c,u){return Is(s),s.updateQueue=null,r=Df(s,a,r,c),Rf(t),a=Sc(),t!==null&&!st?(yc(t,s,u),$i(t,s,u)):(ke&&a&&Jo(s),s.flags|=1,xt(t,s,r,u),s.child)}function T_(t,s,r,a,c){if(Is(s),s.stateNode===null){var u=kr,g=r.contextType;typeof g=="object"&&g!==null&&(u=bt(g)),u=new r(a,u),s.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=Lc,s.stateNode=u,u._reactInternals=s,u=s.stateNode,u.props=a,u.state=s.memoizedState,u.refs={},hc(s),g=r.contextType,u.context=typeof g=="object"&&g!==null?bt(g):kr,u.state=s.memoizedState,g=r.getDerivedStateFromProps,typeof g=="function"&&(Oc(s,r,g,a),u.state=s.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(g=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),g!==u.state&&Lc.enqueueReplaceState(u,u.state,null),En(s,a,u,c),kn(),u.state=s.memoizedState),typeof u.componentDidMount=="function"&&(s.flags|=4194308),a=!0}else if(t===null){u=s.stateNode;var v=s.memoizedProps,w=Qs(r,v);u.props=w;var B=u.context,N=r.contextType;g=kr,typeof N=="object"&&N!==null&&(g=bt(N));var P=r.getDerivedStateFromProps;N=typeof P=="function"||typeof u.getSnapshotBeforeUpdate=="function",v=s.pendingProps!==v,N||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(v||B!==g)&&f_(s,u,a,g),fs=!1;var A=s.memoizedState;u.state=A,En(s,a,u,c),kn(),B=s.memoizedState,v||A!==B||fs?(typeof P=="function"&&(Oc(s,r,P,a),B=s.memoizedState),(w=fs||d_(s,r,w,a,A,B,g))?(N||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(s.flags|=4194308)):(typeof u.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=a,s.memoizedState=B),u.props=a,u.state=B,u.context=g,a=w):(typeof u.componentDidMount=="function"&&(s.flags|=4194308),a=!1)}else{u=s.stateNode,uc(t,s),g=s.memoizedProps,N=Qs(r,g),u.props=N,P=s.pendingProps,A=u.context,B=r.contextType,w=kr,typeof B=="object"&&B!==null&&(w=bt(B)),v=r.getDerivedStateFromProps,(B=typeof v=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(g!==P||A!==w)&&f_(s,u,a,w),fs=!1,A=s.memoizedState,u.state=A,En(s,a,u,c),kn();var z=s.memoizedState;g!==P||A!==z||fs||t!==null&&t.dependencies!==null&&Kl(t.dependencies)?(typeof v=="function"&&(Oc(s,r,v,a),z=s.memoizedState),(N=fs||d_(s,r,N,a,A,z,w)||t!==null&&t.dependencies!==null&&Kl(t.dependencies))?(B||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(a,z,w),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(a,z,w)),typeof u.componentDidUpdate=="function"&&(s.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof u.componentDidUpdate!="function"||g===t.memoizedProps&&A===t.memoizedState||(s.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||g===t.memoizedProps&&A===t.memoizedState||(s.flags|=1024),s.memoizedProps=a,s.memoizedState=z),u.props=a,u.state=z,u.context=w,a=N):(typeof u.componentDidUpdate!="function"||g===t.memoizedProps&&A===t.memoizedState||(s.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||g===t.memoizedProps&&A===t.memoizedState||(s.flags|=1024),a=!1)}return u=a,oa(t,s),a=(s.flags&128)!==0,u||a?(u=s.stateNode,r=a&&typeof r.getDerivedStateFromError!="function"?null:u.render(),s.flags|=1,t!==null&&a?(s.child=Fs(s,t.child,null,c),s.child=Fs(s,null,r,c)):xt(t,s,r,c),s.memoizedState=u.state,t=s.child):t=$i(t,s,c),t}function R_(t,s,r,a){return Ys(),s.flags|=256,xt(t,s,r,a),s.child}var Uc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function qc(t){return{baseLanes:t,cachePool:mf()}}function Wc(t,s,r){return t=t!==null?t.childLanes&~r:0,s&&(t|=Ft),t}function D_(t,s,r){var a=s.pendingProps,c=!1,u=(s.flags&128)!==0,g;if((g=u)||(g=t!==null&&t.memoizedState===null?!1:(Qe.current&2)!==0),g&&(c=!0,s.flags&=-129),g=(s.flags&32)!==0,s.flags&=-33,t===null){if(ke){if(c?gs(s):ms(),(t=We)?(t=Hp(t,oi),t=t!==null&&t.data!=="&"?t:null,t!==null&&(s.memoizedState={dehydrated:t,treeContext:cs!==null?{id:ki,overflow:Ei}:null,retryLane:536870912,hydrationErrors:null},r=of(t),r.return=s,s.child=r,yt=s,We=null)):t=null,t===null)throw us(s);return wh(t)?s.lanes=32:s.lanes=536870912,null}var v=a.children;return a=a.fallback,c?(ms(),c=s.mode,v=ca({mode:"hidden",children:v},c),a=Ks(a,c,r,null),v.return=s,a.return=s,v.sibling=a,s.child=v,a=s.child,a.memoizedState=qc(r),a.childLanes=Wc(t,g,r),s.memoizedState=Uc,Bn(null,a)):(gs(s),Pc(s,v))}var w=t.memoizedState;if(w!==null&&(v=w.dehydrated,v!==null)){if(u)s.flags&256?(gs(s),s.flags&=-257,s=Kc(t,s,r)):s.memoizedState!==null?(ms(),s.child=t.child,s.flags|=128,s=null):(ms(),v=a.fallback,c=s.mode,a=ca({mode:"visible",children:a.children},c),v=Ks(v,c,r,null),v.flags|=2,a.return=s,v.return=s,a.sibling=v,s.child=a,Fs(s,t.child,null,r),a=s.child,a.memoizedState=qc(r),a.childLanes=Wc(t,g,r),s.memoizedState=Uc,s=Bn(null,a));else if(gs(s),wh(v)){if(g=v.nextSibling&&v.nextSibling.dataset,g)var B=g.dgst;g=B,a=Error(l(419)),a.stack="",a.digest=g,Sn({value:a,source:null,stack:null}),s=Kc(t,s,r)}else if(st||Dr(t,s,r,!1),g=(r&t.childLanes)!==0,st||g){if(g=qe,g!==null&&(a=_d(g,r),a!==0&&a!==w.retryLane))throw w.retryLane=a,Ps(t,a),qt(g,t,a),Hc;xh(v)||va(),s=Kc(t,s,r)}else xh(v)?(s.flags|=192,s.child=t.child,s=null):(t=w.treeContext,We=hi(v.nextSibling),yt=s,ke=!0,hs=null,oi=!1,t!==null&&uf(s,t),s=Pc(s,a.children),s.flags|=4096);return s}return c?(ms(),v=a.fallback,c=s.mode,w=t.child,B=w.sibling,a=Ui(w,{mode:"hidden",children:a.children}),a.subtreeFlags=w.subtreeFlags&65011712,B!==null?v=Ui(B,v):(v=Ks(v,c,r,null),v.flags|=2),v.return=s,a.return=s,a.sibling=v,s.child=a,Bn(null,a),a=s.child,v=t.child.memoizedState,v===null?v=qc(r):(c=v.cachePool,c!==null?(w=tt._currentValue,c=c.parent!==w?{parent:w,pool:w}:c):c=mf(),v={baseLanes:v.baseLanes|r,cachePool:c}),a.memoizedState=v,a.childLanes=Wc(t,g,r),s.memoizedState=Uc,Bn(t.child,a)):(gs(s),r=t.child,t=r.sibling,r=Ui(r,{mode:"visible",children:a.children}),r.return=s,r.sibling=null,t!==null&&(g=s.deletions,g===null?(s.deletions=[t],s.flags|=16):g.push(t)),s.child=r,s.memoizedState=null,r)}function Pc(t,s){return s=ca({mode:"visible",children:s},t.mode),s.return=t,t.child=s}function ca(t,s){return t=It(22,t,null,s),t.lanes=0,t}function Kc(t,s,r){return Fs(s,t.child,null,r),t=Pc(s,s.pendingProps.children),t.flags|=2,s.memoizedState=null,t}function M_(t,s,r){t.lanes|=s;var a=t.alternate;a!==null&&(a.lanes|=s),rc(t.return,s,r)}function Yc(t,s,r,a,c,u){var g=t.memoizedState;g===null?t.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:a,tail:r,tailMode:c,treeForkCount:u}:(g.isBackwards=s,g.rendering=null,g.renderingStartTime=0,g.last=a,g.tail=r,g.tailMode=c,g.treeForkCount=u)}function B_(t,s,r){var a=s.pendingProps,c=a.revealOrder,u=a.tail;a=a.children;var g=Qe.current,v=(g&2)!==0;if(v?(g=g&1|2,s.flags|=128):g&=1,F(Qe,g),xt(t,s,a,r),a=ke?vn:0,!v&&t!==null&&(t.flags&128)!==0)e:for(t=s.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&M_(t,r,s);else if(t.tag===19)M_(t,r,s);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===s)break e;for(;t.sibling===null;){if(t.return===null||t.return===s)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(c){case"forwards":for(r=s.child,c=null;r!==null;)t=r.alternate,t!==null&&Zl(t)===null&&(c=r),r=r.sibling;r=c,r===null?(c=s.child,s.child=null):(c=r.sibling,r.sibling=null),Yc(s,!1,c,r,u,a);break;case"backwards":case"unstable_legacy-backwards":for(r=null,c=s.child,s.child=null;c!==null;){if(t=c.alternate,t!==null&&Zl(t)===null){s.child=c;break}t=c.sibling,c.sibling=r,r=c,c=t}Yc(s,!0,r,null,u,a);break;case"together":Yc(s,!1,null,null,void 0,a);break;default:s.memoizedState=null}return s.child}function $i(t,s,r){if(t!==null&&(s.dependencies=t.dependencies),ys|=s.lanes,(r&s.childLanes)===0)if(t!==null){if(Dr(t,s,r,!1),(r&s.childLanes)===0)return null}else return null;if(t!==null&&s.child!==t.child)throw Error(l(153));if(s.child!==null){for(t=s.child,r=Ui(t,t.pendingProps),s.child=r,r.return=s;t.sibling!==null;)t=t.sibling,r=r.sibling=Ui(t,t.pendingProps),r.return=s;r.sibling=null}return s.child}function $c(t,s){return(t.lanes&s)!==0?!0:(t=t.dependencies,!!(t!==null&&Kl(t)))}function rS(t,s,r){switch(s.tag){case 3:at(s,s.stateNode.containerInfo),ds(s,tt,t.memoizedState.cache),Ys();break;case 27:case 5:wi(s);break;case 4:at(s,s.stateNode.containerInfo);break;case 10:ds(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,gc(s),null;break;case 13:var a=s.memoizedState;if(a!==null)return a.dehydrated!==null?(gs(s),s.flags|=128,null):(r&s.child.childLanes)!==0?D_(t,s,r):(gs(s),t=$i(t,s,r),t!==null?t.sibling:null);gs(s);break;case 19:var c=(t.flags&128)!==0;if(a=(r&s.childLanes)!==0,a||(Dr(t,s,r,!1),a=(r&s.childLanes)!==0),c){if(a)return B_(t,s,r);s.flags|=128}if(c=s.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),F(Qe,Qe.current),a)break;return null;case 22:return s.lanes=0,w_(t,s,r,s.pendingProps);case 24:ds(s,tt,t.memoizedState.cache)}return $i(t,s,r)}function A_(t,s,r){if(t!==null)if(t.memoizedProps!==s.pendingProps)st=!0;else{if(!$c(t,r)&&(s.flags&128)===0)return st=!1,rS(t,s,r);st=(t.flags&131072)!==0}else st=!1,ke&&(s.flags&1048576)!==0&&hf(s,vn,s.index);switch(s.lanes=0,s.tag){case 16:e:{var a=s.pendingProps;if(t=Gs(s.elementType),s.type=t,typeof t=="function")Fo(t)?(a=Qs(t,a),s.tag=1,s=T_(null,s,t,a,r)):(s.tag=0,s=jc(null,s,t,a,r));else{if(t!=null){var c=t.$$typeof;if(c===W){s.tag=11,s=y_(null,s,t,a,r);break e}else if(c===J){s.tag=14,s=b_(null,s,t,a,r);break e}}throw s=te(t)||t,Error(l(306,s,""))}}return s;case 0:return jc(t,s,s.type,s.pendingProps,r);case 1:return a=s.type,c=Qs(a,s.pendingProps),T_(t,s,a,c,r);case 3:e:{if(at(s,s.stateNode.containerInfo),t===null)throw Error(l(387));a=s.pendingProps;var u=s.memoizedState;c=u.element,uc(t,s),En(s,a,null,r);var g=s.memoizedState;if(a=g.cache,ds(s,tt,a),a!==u.cache&&nc(s,[tt],r,!0),kn(),a=g.element,u.isDehydrated)if(u={element:a,isDehydrated:!1,cache:g.cache},s.updateQueue.baseState=u,s.memoizedState=u,s.flags&256){s=R_(t,s,a,r);break e}else if(a!==c){c=ni(Error(l(424)),s),Sn(c),s=R_(t,s,a,r);break e}else for(t=s.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,We=hi(t.firstChild),yt=s,ke=!0,hs=null,oi=!0,r=wf(s,null,a,r),s.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Ys(),a===c){s=$i(t,s,r);break e}xt(t,s,a,r)}s=s.child}return s;case 26:return oa(t,s),t===null?(r=Kp(s.type,null,s.pendingProps,null))?s.memoizedState=r:ke||(r=s.type,t=s.pendingProps,a=ka(he.current).createElement(r),a[St]=s,a[Ot]=t,wt(a,r,t),dt(a),s.stateNode=a):s.memoizedState=Kp(s.type,t.memoizedProps,s.pendingProps,t.memoizedState),null;case 27:return wi(s),t===null&&ke&&(a=s.stateNode=qp(s.type,s.pendingProps,he.current),yt=s,oi=!0,c=We,ks(s.type)?(Ch=c,We=hi(a.firstChild)):We=c),xt(t,s,s.pendingProps.children,r),oa(t,s),t===null&&(s.flags|=4194304),s.child;case 5:return t===null&&ke&&((c=a=We)&&(a=OS(a,s.type,s.pendingProps,oi),a!==null?(s.stateNode=a,yt=s,We=hi(a.firstChild),oi=!1,c=!0):c=!1),c||us(s)),wi(s),c=s.type,u=s.pendingProps,g=t!==null?t.memoizedProps:null,a=u.children,Sh(c,u)?a=null:g!==null&&Sh(c,g)&&(s.flags|=32),s.memoizedState!==null&&(c=vc(t,s,V0,null,null,r),In._currentValue=c),oa(t,s),xt(t,s,a,r),s.child;case 6:return t===null&&ke&&((t=r=We)&&(r=LS(r,s.pendingProps,oi),r!==null?(s.stateNode=r,yt=s,We=null,t=!0):t=!1),t||us(s)),null;case 13:return D_(t,s,r);case 4:return at(s,s.stateNode.containerInfo),a=s.pendingProps,t===null?s.child=Fs(s,null,a,r):xt(t,s,a,r),s.child;case 11:return y_(t,s,s.type,s.pendingProps,r);case 7:return xt(t,s,s.pendingProps,r),s.child;case 8:return xt(t,s,s.pendingProps.children,r),s.child;case 12:return xt(t,s,s.pendingProps.children,r),s.child;case 10:return a=s.pendingProps,ds(s,s.type,a.value),xt(t,s,a.children,r),s.child;case 9:return c=s.type._context,a=s.pendingProps.children,Is(s),c=bt(c),a=a(c),s.flags|=1,xt(t,s,a,r),s.child;case 14:return b_(t,s,s.type,s.pendingProps,r);case 15:return x_(t,s,s.type,s.pendingProps,r);case 19:return B_(t,s,r);case 31:return sS(t,s,r);case 22:return w_(t,s,r,s.pendingProps);case 24:return Is(s),a=bt(tt),t===null?(c=oc(),c===null&&(c=qe,u=lc(),c.pooledCache=u,u.refCount++,u!==null&&(c.pooledCacheLanes|=r),c=u),s.memoizedState={parent:a,cache:c},hc(s),ds(s,tt,c)):((t.lanes&r)!==0&&(uc(t,s),En(s,null,null,r),kn()),c=t.memoizedState,u=s.memoizedState,c.parent!==a?(c={parent:a,cache:a},s.memoizedState=c,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=c),ds(s,tt,a)):(a=u.cache,ds(s,tt,a),a!==c.cache&&nc(s,[tt],r,!0))),xt(t,s,s.pendingProps.children,r),s.child;case 29:throw s.pendingProps}throw Error(l(156,s.tag))}function Ii(t){t.flags|=4}function Ic(t,s,r,a,c){if((s=(t.mode&32)!==0)&&(s=!1),s){if(t.flags|=16777216,(c&335544128)===c)if(t.stateNode.complete)t.flags|=8192;else if(np())t.flags|=8192;else throw Vs=Xl,cc}else t.flags&=-16777217}function z_(t,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Gp(s))if(np())t.flags|=8192;else throw Vs=Xl,cc}function ha(t,s){s!==null&&(t.flags|=4),t.flags&16384&&(s=t.tag!==22?ud():536870912,t.lanes|=s,Wr|=s)}function An(t,s){if(!ke)switch(t.tailMode){case"hidden":s=t.tail;for(var r=null;s!==null;)s.alternate!==null&&(r=s),s=s.sibling;r===null?t.tail=null:r.sibling=null;break;case"collapsed":r=t.tail;for(var a=null;r!==null;)r.alternate!==null&&(a=r),r=r.sibling;a===null?s||t.tail===null?t.tail=null:t.tail.sibling=null:a.sibling=null}}function Pe(t){var s=t.alternate!==null&&t.alternate.child===t.child,r=0,a=0;if(s)for(var c=t.child;c!==null;)r|=c.lanes|c.childLanes,a|=c.subtreeFlags&65011712,a|=c.flags&65011712,c.return=t,c=c.sibling;else for(c=t.child;c!==null;)r|=c.lanes|c.childLanes,a|=c.subtreeFlags,a|=c.flags,c.return=t,c=c.sibling;return t.subtreeFlags|=a,t.childLanes=r,s}function nS(t,s,r){var a=s.pendingProps;switch(ec(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pe(s),null;case 1:return Pe(s),null;case 3:return r=s.stateNode,a=null,t!==null&&(a=t.memoizedState.cache),s.memoizedState.cache!==a&&(s.flags|=2048),Pi(tt),Ae(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(Rr(s)?Ii(s):t===null||t.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,ic())),Pe(s),null;case 26:var c=s.type,u=s.memoizedState;return t===null?(Ii(s),u!==null?(Pe(s),z_(s,u)):(Pe(s),Ic(s,c,null,a,r))):u?u!==t.memoizedState?(Ii(s),Pe(s),z_(s,u)):(Pe(s),s.flags&=-16777217):(t=t.memoizedProps,t!==a&&Ii(s),Pe(s),Ic(s,c,t,a,r)),null;case 27:if(Ci(s),r=he.current,c=s.type,t!==null&&s.stateNode!=null)t.memoizedProps!==a&&Ii(s);else{if(!a){if(s.stateNode===null)throw Error(l(166));return Pe(s),null}t=ee.current,Rr(s)?df(s):(t=qp(c,a,r),s.stateNode=t,Ii(s))}return Pe(s),null;case 5:if(Ci(s),c=s.type,t!==null&&s.stateNode!=null)t.memoizedProps!==a&&Ii(s);else{if(!a){if(s.stateNode===null)throw Error(l(166));return Pe(s),null}if(u=ee.current,Rr(s))df(s);else{var g=ka(he.current);switch(u){case 1:u=g.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:u=g.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":u=g.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":u=g.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":u=g.createElement("div"),u.innerHTML="<script><\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof a.is=="string"?g.createElement("select",{is:a.is}):g.createElement("select"),a.multiple?u.multiple=!0:a.size&&(u.size=a.size);break;default:u=typeof a.is=="string"?g.createElement(c,{is:a.is}):g.createElement(c)}}u[St]=s,u[Ot]=a;e:for(g=s.child;g!==null;){if(g.tag===5||g.tag===6)u.appendChild(g.stateNode);else if(g.tag!==4&&g.tag!==27&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===s)break e;for(;g.sibling===null;){if(g.return===null||g.return===s)break e;g=g.return}g.sibling.return=g.return,g=g.sibling}s.stateNode=u;e:switch(wt(u,c,a),c){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&Ii(s)}}return Pe(s),Ic(s,s.type,t===null?null:t.memoizedProps,s.pendingProps,r),null;case 6:if(t&&s.stateNode!=null)t.memoizedProps!==a&&Ii(s);else{if(typeof a!="string"&&s.stateNode===null)throw Error(l(166));if(t=he.current,Rr(s)){if(t=s.stateNode,r=s.memoizedProps,a=null,c=yt,c!==null)switch(c.tag){case 27:case 5:a=c.memoizedProps}t[St]=s,t=!!(t.nodeValue===r||a!==null&&a.suppressHydrationWarning===!0||Dp(t.nodeValue,r)),t||us(s,!0)}else t=ka(t).createTextNode(a),t[St]=s,s.stateNode=t}return Pe(s),null;case 31:if(r=s.memoizedState,t===null||t.memoizedState!==null){if(a=Rr(s),r!==null){if(t===null){if(!a)throw Error(l(318));if(t=s.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(557));t[St]=s}else Ys(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Pe(s),t=!1}else r=ic(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=r),t=!0;if(!t)return s.flags&256?(Gt(s),s):(Gt(s),null);if((s.flags&128)!==0)throw Error(l(558))}return Pe(s),null;case 13:if(a=s.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(c=Rr(s),a!==null&&a.dehydrated!==null){if(t===null){if(!c)throw Error(l(318));if(c=s.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(l(317));c[St]=s}else Ys(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Pe(s),c=!1}else c=ic(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=c),c=!0;if(!c)return s.flags&256?(Gt(s),s):(Gt(s),null)}return Gt(s),(s.flags&128)!==0?(s.lanes=r,s):(r=a!==null,t=t!==null&&t.memoizedState!==null,r&&(a=s.child,c=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(c=a.alternate.memoizedState.cachePool.pool),u=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),u!==c&&(a.flags|=2048)),r!==t&&r&&(s.child.flags|=8192),ha(s,s.updateQueue),Pe(s),null);case 4:return Ae(),t===null&&_h(s.stateNode.containerInfo),Pe(s),null;case 10:return Pi(s.type),Pe(s),null;case 19:if(H(Qe),a=s.memoizedState,a===null)return Pe(s),null;if(c=(s.flags&128)!==0,u=a.rendering,u===null)if(c)An(a,!1);else{if(Ve!==0||t!==null&&(t.flags&128)!==0)for(t=s.child;t!==null;){if(u=Zl(t),u!==null){for(s.flags|=128,An(a,!1),t=u.updateQueue,s.updateQueue=t,ha(s,t),s.subtreeFlags=0,t=r,r=s.child;r!==null;)af(r,t),r=r.sibling;return F(Qe,Qe.current&1|2),ke&&qi(s,a.treeForkCount),s.child}t=t.sibling}a.tail!==null&&Pt()>pa&&(s.flags|=128,c=!0,An(a,!1),s.lanes=4194304)}else{if(!c)if(t=Zl(u),t!==null){if(s.flags|=128,c=!0,t=t.updateQueue,s.updateQueue=t,ha(s,t),An(a,!0),a.tail===null&&a.tailMode==="hidden"&&!u.alternate&&!ke)return Pe(s),null}else 2*Pt()-a.renderingStartTime>pa&&r!==536870912&&(s.flags|=128,c=!0,An(a,!1),s.lanes=4194304);a.isBackwards?(u.sibling=s.child,s.child=u):(t=a.last,t!==null?t.sibling=u:s.child=u,a.last=u)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Pt(),t.sibling=null,r=Qe.current,F(Qe,c?r&1|2:r&1),ke&&qi(s,a.treeForkCount),t):(Pe(s),null);case 22:case 23:return Gt(s),pc(),a=s.memoizedState!==null,t!==null?t.memoizedState!==null!==a&&(s.flags|=8192):a&&(s.flags|=8192),a?(r&536870912)!==0&&(s.flags&128)===0&&(Pe(s),s.subtreeFlags&6&&(s.flags|=8192)):Pe(s),r=s.updateQueue,r!==null&&ha(s,r.retryQueue),r=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),a=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(a=s.memoizedState.cachePool.pool),a!==r&&(s.flags|=2048),t!==null&&H(Xs),null;case 24:return r=null,t!==null&&(r=t.memoizedState.cache),s.memoizedState.cache!==r&&(s.flags|=2048),Pi(tt),Pe(s),null;case 25:return null;case 30:return null}throw Error(l(156,s.tag))}function lS(t,s){switch(ec(s),s.tag){case 1:return t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 3:return Pi(tt),Ae(),t=s.flags,(t&65536)!==0&&(t&128)===0?(s.flags=t&-65537|128,s):null;case 26:case 27:case 5:return Ci(s),null;case 31:if(s.memoizedState!==null){if(Gt(s),s.alternate===null)throw Error(l(340));Ys()}return t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 13:if(Gt(s),t=s.memoizedState,t!==null&&t.dehydrated!==null){if(s.alternate===null)throw Error(l(340));Ys()}return t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 19:return H(Qe),null;case 4:return Ae(),null;case 10:return Pi(s.type),null;case 22:case 23:return Gt(s),pc(),t!==null&&H(Xs),t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 24:return Pi(tt),null;case 25:return null;default:return null}}function O_(t,s){switch(ec(s),s.tag){case 3:Pi(tt),Ae();break;case 26:case 27:case 5:Ci(s);break;case 4:Ae();break;case 31:s.memoizedState!==null&&Gt(s);break;case 13:Gt(s);break;case 19:H(Qe);break;case 10:Pi(s.type);break;case 22:case 23:Gt(s),pc(),t!==null&&H(Xs);break;case 24:Pi(tt)}}function zn(t,s){try{var r=s.updateQueue,a=r!==null?r.lastEffect:null;if(a!==null){var c=a.next;r=c;do{if((r.tag&t)===t){a=void 0;var u=r.create,g=r.inst;a=u(),g.destroy=a}r=r.next}while(r!==c)}}catch(v){Oe(s,s.return,v)}}function vs(t,s,r){try{var a=s.updateQueue,c=a!==null?a.lastEffect:null;if(c!==null){var u=c.next;a=u;do{if((a.tag&t)===t){var g=a.inst,v=g.destroy;if(v!==void 0){g.destroy=void 0,c=s;var w=r,B=v;try{B()}catch(N){Oe(c,w,N)}}}a=a.next}while(a!==u)}}catch(N){Oe(s,s.return,N)}}function L_(t){var s=t.updateQueue;if(s!==null){var r=t.stateNode;try{kf(s,r)}catch(a){Oe(t,t.return,a)}}}function N_(t,s,r){r.props=Qs(t.type,t.memoizedProps),r.state=t.memoizedState;try{r.componentWillUnmount()}catch(a){Oe(t,s,a)}}function On(t,s){try{var r=t.ref;if(r!==null){switch(t.tag){case 26:case 27:case 5:var a=t.stateNode;break;case 30:a=t.stateNode;break;default:a=t.stateNode}typeof r=="function"?t.refCleanup=r(a):r.current=a}}catch(c){Oe(t,s,c)}}function Ti(t,s){var r=t.ref,a=t.refCleanup;if(r!==null)if(typeof a=="function")try{a()}catch(c){Oe(t,s,c)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(c){Oe(t,s,c)}else r.current=null}function H_(t){var s=t.type,r=t.memoizedProps,a=t.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":r.autoFocus&&a.focus();break e;case"img":r.src?a.src=r.src:r.srcSet&&(a.srcset=r.srcSet)}}catch(c){Oe(t,t.return,c)}}function Xc(t,s,r){try{var a=t.stateNode;RS(a,t.type,r,s),a[Ot]=s}catch(c){Oe(t,t.return,c)}}function j_(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&ks(t.type)||t.tag===4}function Gc(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||j_(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&&ks(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 Vc(t,s,r){var a=t.tag;if(a===5||a===6)t=t.stateNode,s?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(t,s):(s=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,s.appendChild(t),r=r._reactRootContainer,r!=null||s.onclick!==null||(s.onclick=Hi));else if(a!==4&&(a===27&&ks(t.type)&&(r=t.stateNode,s=null),t=t.child,t!==null))for(Vc(t,s,r),t=t.sibling;t!==null;)Vc(t,s,r),t=t.sibling}function ua(t,s,r){var a=t.tag;if(a===5||a===6)t=t.stateNode,s?r.insertBefore(t,s):r.appendChild(t);else if(a!==4&&(a===27&&ks(t.type)&&(r=t.stateNode),t=t.child,t!==null))for(ua(t,s,r),t=t.sibling;t!==null;)ua(t,s,r),t=t.sibling}function U_(t){var s=t.stateNode,r=t.memoizedProps;try{for(var a=t.type,c=s.attributes;c.length;)s.removeAttributeNode(c[0]);wt(s,a,r),s[St]=t,s[Ot]=r}catch(u){Oe(t,t.return,u)}}var Xi=!1,rt=!1,Fc=!1,q_=typeof WeakSet=="function"?WeakSet:Set,ft=null;function aS(t,s){if(t=t.containerInfo,mh=Aa,t=Zd(t),Ko(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var a=r.getSelection&&r.getSelection();if(a&&a.rangeCount!==0){r=a.anchorNode;var c=a.anchorOffset,u=a.focusNode;a=a.focusOffset;try{r.nodeType,u.nodeType}catch{r=null;break e}var g=0,v=-1,w=-1,B=0,N=0,P=t,A=null;t:for(;;){for(var z;P!==r||c!==0&&P.nodeType!==3||(v=g+c),P!==u||a!==0&&P.nodeType!==3||(w=g+a),P.nodeType===3&&(g+=P.nodeValue.length),(z=P.firstChild)!==null;)A=P,P=z;for(;;){if(P===t)break t;if(A===r&&++B===c&&(v=g),A===u&&++N===a&&(w=g),(z=P.nextSibling)!==null)break;P=A,A=P.parentNode}P=z}r=v===-1||w===-1?null:{start:v,end:w}}else r=null}r=r||{start:0,end:0}}else r=null;for(vh={focusedElem:t,selectionRange:r},Aa=!1,ft=s;ft!==null;)if(s=ft,t=s.child,(s.subtreeFlags&1028)!==0&&t!==null)t.return=s,ft=t;else for(;ft!==null;){switch(s=ft,u=s.alternate,t=s.flags,s.tag){case 0:if((t&4)!==0&&(t=s.updateQueue,t=t!==null?t.events:null,t!==null))for(r=0;r<t.length;r++)c=t[r],c.ref.impl=c.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&u!==null){t=void 0,r=s,c=u.memoizedProps,u=u.memoizedState,a=r.stateNode;try{var re=Qs(r.type,c);t=a.getSnapshotBeforeUpdate(re,u),a.__reactInternalSnapshotBeforeUpdate=t}catch(ce){Oe(r,r.return,ce)}}break;case 3:if((t&1024)!==0){if(t=s.stateNode.containerInfo,r=t.nodeType,r===9)bh(t);else if(r===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":bh(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(l(163))}if(t=s.sibling,t!==null){t.return=s.return,ft=t;break}ft=s.return}}function W_(t,s,r){var a=r.flags;switch(r.tag){case 0:case 11:case 15:Vi(t,r),a&4&&zn(5,r);break;case 1:if(Vi(t,r),a&4)if(t=r.stateNode,s===null)try{t.componentDidMount()}catch(g){Oe(r,r.return,g)}else{var c=Qs(r.type,s.memoizedProps);s=s.memoizedState;try{t.componentDidUpdate(c,s,t.__reactInternalSnapshotBeforeUpdate)}catch(g){Oe(r,r.return,g)}}a&64&&L_(r),a&512&&On(r,r.return);break;case 3:if(Vi(t,r),a&64&&(t=r.updateQueue,t!==null)){if(s=null,r.child!==null)switch(r.child.tag){case 27:case 5:s=r.child.stateNode;break;case 1:s=r.child.stateNode}try{kf(t,s)}catch(g){Oe(r,r.return,g)}}break;case 27:s===null&&a&4&&U_(r);case 26:case 5:Vi(t,r),s===null&&a&4&&H_(r),a&512&&On(r,r.return);break;case 12:Vi(t,r);break;case 31:Vi(t,r),a&4&&Y_(t,r);break;case 13:Vi(t,r),a&4&&$_(t,r),a&64&&(t=r.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(r=gS.bind(null,r),NS(t,r))));break;case 22:if(a=r.memoizedState!==null||Xi,!a){s=s!==null&&s.memoizedState!==null||rt,c=Xi;var u=rt;Xi=a,(rt=s)&&!u?Fi(t,r,(r.subtreeFlags&8772)!==0):Vi(t,r),Xi=c,rt=u}break;case 30:break;default:Vi(t,r)}}function P_(t){var s=t.alternate;s!==null&&(t.alternate=null,P_(s)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(s=t.stateNode,s!==null&&Eo(s)),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 Ye=null,Nt=!1;function Gi(t,s,r){for(r=r.child;r!==null;)K_(t,s,r),r=r.sibling}function K_(t,s,r){if(Kt&&typeof Kt.onCommitFiberUnmount=="function")try{Kt.onCommitFiberUnmount(rn,r)}catch{}switch(r.tag){case 26:rt||Ti(r,s),Gi(t,s,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:rt||Ti(r,s);var a=Ye,c=Nt;ks(r.type)&&(Ye=r.stateNode,Nt=!1),Gi(t,s,r),Kn(r.stateNode),Ye=a,Nt=c;break;case 5:rt||Ti(r,s);case 6:if(a=Ye,c=Nt,Ye=null,Gi(t,s,r),Ye=a,Nt=c,Ye!==null)if(Nt)try{(Ye.nodeType===9?Ye.body:Ye.nodeName==="HTML"?Ye.ownerDocument.body:Ye).removeChild(r.stateNode)}catch(u){Oe(r,s,u)}else try{Ye.removeChild(r.stateNode)}catch(u){Oe(r,s,u)}break;case 18:Ye!==null&&(Nt?(t=Ye,Lp(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,r.stateNode),Vr(t)):Lp(Ye,r.stateNode));break;case 4:a=Ye,c=Nt,Ye=r.stateNode.containerInfo,Nt=!0,Gi(t,s,r),Ye=a,Nt=c;break;case 0:case 11:case 14:case 15:vs(2,r,s),rt||vs(4,r,s),Gi(t,s,r);break;case 1:rt||(Ti(r,s),a=r.stateNode,typeof a.componentWillUnmount=="function"&&N_(r,s,a)),Gi(t,s,r);break;case 21:Gi(t,s,r);break;case 22:rt=(a=rt)||r.memoizedState!==null,Gi(t,s,r),rt=a;break;default:Gi(t,s,r)}}function Y_(t,s){if(s.memoizedState===null&&(t=s.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Vr(t)}catch(r){Oe(s,s.return,r)}}}function $_(t,s){if(s.memoizedState===null&&(t=s.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Vr(t)}catch(r){Oe(s,s.return,r)}}function oS(t){switch(t.tag){case 31:case 13:case 19:var s=t.stateNode;return s===null&&(s=t.stateNode=new q_),s;case 22:return t=t.stateNode,s=t._retryCache,s===null&&(s=t._retryCache=new q_),s;default:throw Error(l(435,t.tag))}}function da(t,s){var r=oS(t);s.forEach(function(a){if(!r.has(a)){r.add(a);var c=mS.bind(null,t,a);a.then(c,c)}})}function Ht(t,s){var r=s.deletions;if(r!==null)for(var a=0;a<r.length;a++){var c=r[a],u=t,g=s,v=g;e:for(;v!==null;){switch(v.tag){case 27:if(ks(v.type)){Ye=v.stateNode,Nt=!1;break e}break;case 5:Ye=v.stateNode,Nt=!1;break e;case 3:case 4:Ye=v.stateNode.containerInfo,Nt=!0;break e}v=v.return}if(Ye===null)throw Error(l(160));K_(u,g,c),Ye=null,Nt=!1,u=c.alternate,u!==null&&(u.return=null),c.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)I_(s,t),s=s.sibling}var Si=null;function I_(t,s){var r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Ht(s,t),jt(t),a&4&&(vs(3,t,t.return),zn(3,t),vs(5,t,t.return));break;case 1:Ht(s,t),jt(t),a&512&&(rt||r===null||Ti(r,r.return)),a&64&&Xi&&(t=t.updateQueue,t!==null&&(a=t.callbacks,a!==null&&(r=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=r===null?a:r.concat(a))));break;case 26:var c=Si;if(Ht(s,t),jt(t),a&512&&(rt||r===null||Ti(r,r.return)),a&4){var u=r!==null?r.memoizedState:null;if(a=t.memoizedState,r===null)if(a===null)if(t.stateNode===null){e:{a=t.type,r=t.memoizedProps,c=c.ownerDocument||c;t:switch(a){case"title":u=c.getElementsByTagName("title")[0],(!u||u[an]||u[St]||u.namespaceURI==="http://www.w3.org/2000/svg"||u.hasAttribute("itemprop"))&&(u=c.createElement(a),c.head.insertBefore(u,c.querySelector("head > title"))),wt(u,a,r),u[St]=t,dt(u),a=u;break e;case"link":var g=Ip("link","href",c).get(a+(r.href||""));if(g){for(var v=0;v<g.length;v++)if(u=g[v],u.getAttribute("href")===(r.href==null||r.href===""?null:r.href)&&u.getAttribute("rel")===(r.rel==null?null:r.rel)&&u.getAttribute("title")===(r.title==null?null:r.title)&&u.getAttribute("crossorigin")===(r.crossOrigin==null?null:r.crossOrigin)){g.splice(v,1);break t}}u=c.createElement(a),wt(u,a,r),c.head.appendChild(u);break;case"meta":if(g=Ip("meta","content",c).get(a+(r.content||""))){for(v=0;v<g.length;v++)if(u=g[v],u.getAttribute("content")===(r.content==null?null:""+r.content)&&u.getAttribute("name")===(r.name==null?null:r.name)&&u.getAttribute("property")===(r.property==null?null:r.property)&&u.getAttribute("http-equiv")===(r.httpEquiv==null?null:r.httpEquiv)&&u.getAttribute("charset")===(r.charSet==null?null:r.charSet)){g.splice(v,1);break t}}u=c.createElement(a),wt(u,a,r),c.head.appendChild(u);break;default:throw Error(l(468,a))}u[St]=t,dt(u),a=u}t.stateNode=a}else Xp(c,t.type,t.stateNode);else t.stateNode=$p(c,a,t.memoizedProps);else u!==a?(u===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):u.count--,a===null?Xp(c,t.type,t.stateNode):$p(c,a,t.memoizedProps)):a===null&&t.stateNode!==null&&Xc(t,t.memoizedProps,r.memoizedProps)}break;case 27:Ht(s,t),jt(t),a&512&&(rt||r===null||Ti(r,r.return)),r!==null&&a&4&&Xc(t,t.memoizedProps,r.memoizedProps);break;case 5:if(Ht(s,t),jt(t),a&512&&(rt||r===null||Ti(r,r.return)),t.flags&32){c=t.stateNode;try{vr(c,"")}catch(re){Oe(t,t.return,re)}}a&4&&t.stateNode!=null&&(c=t.memoizedProps,Xc(t,c,r!==null?r.memoizedProps:c)),a&1024&&(Fc=!0);break;case 6:if(Ht(s,t),jt(t),a&4){if(t.stateNode===null)throw Error(l(162));a=t.memoizedProps,r=t.stateNode;try{r.nodeValue=a}catch(re){Oe(t,t.return,re)}}break;case 3:if(Ra=null,c=Si,Si=Ea(s.containerInfo),Ht(s,t),Si=c,jt(t),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Vr(s.containerInfo)}catch(re){Oe(t,t.return,re)}Fc&&(Fc=!1,X_(t));break;case 4:a=Si,Si=Ea(t.stateNode.containerInfo),Ht(s,t),jt(t),Si=a;break;case 12:Ht(s,t),jt(t);break;case 31:Ht(s,t),jt(t),a&4&&(a=t.updateQueue,a!==null&&(t.updateQueue=null,da(t,a)));break;case 13:Ht(s,t),jt(t),t.child.flags&8192&&t.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(_a=Pt()),a&4&&(a=t.updateQueue,a!==null&&(t.updateQueue=null,da(t,a)));break;case 22:c=t.memoizedState!==null;var w=r!==null&&r.memoizedState!==null,B=Xi,N=rt;if(Xi=B||c,rt=N||w,Ht(s,t),rt=N,Xi=B,jt(t),a&8192)e:for(s=t.stateNode,s._visibility=c?s._visibility&-2:s._visibility|1,c&&(r===null||w||Xi||rt||Js(t)),r=null,s=t;;){if(s.tag===5||s.tag===26){if(r===null){w=r=s;try{if(u=w.stateNode,c)g=u.style,typeof g.setProperty=="function"?g.setProperty("display","none","important"):g.display="none";else{v=w.stateNode;var P=w.memoizedProps.style,A=P!=null&&P.hasOwnProperty("display")?P.display:null;v.style.display=A==null||typeof A=="boolean"?"":(""+A).trim()}}catch(re){Oe(w,w.return,re)}}}else if(s.tag===6){if(r===null){w=s;try{w.stateNode.nodeValue=c?"":w.memoizedProps}catch(re){Oe(w,w.return,re)}}}else if(s.tag===18){if(r===null){w=s;try{var z=w.stateNode;c?Np(z,!0):Np(w.stateNode,!1)}catch(re){Oe(w,w.return,re)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===t)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break e;for(;s.sibling===null;){if(s.return===null||s.return===t)break e;r===s&&(r=null),s=s.return}r===s&&(r=null),s.sibling.return=s.return,s=s.sibling}a&4&&(a=t.updateQueue,a!==null&&(r=a.retryQueue,r!==null&&(a.retryQueue=null,da(t,r))));break;case 19:Ht(s,t),jt(t),a&4&&(a=t.updateQueue,a!==null&&(t.updateQueue=null,da(t,a)));break;case 30:break;case 21:break;default:Ht(s,t),jt(t)}}function jt(t){var s=t.flags;if(s&2){try{for(var r,a=t.return;a!==null;){if(j_(a)){r=a;break}a=a.return}if(r==null)throw Error(l(160));switch(r.tag){case 27:var c=r.stateNode,u=Gc(t);ua(t,u,c);break;case 5:var g=r.stateNode;r.flags&32&&(vr(g,""),r.flags&=-33);var v=Gc(t);ua(t,v,g);break;case 3:case 4:var w=r.stateNode.containerInfo,B=Gc(t);Vc(t,B,w);break;default:throw Error(l(161))}}catch(N){Oe(t,t.return,N)}t.flags&=-3}s&4096&&(t.flags&=-4097)}function X_(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var s=t;X_(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),t=t.sibling}}function Vi(t,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)W_(t,s.alternate,s),s=s.sibling}function Js(t){for(t=t.child;t!==null;){var s=t;switch(s.tag){case 0:case 11:case 14:case 15:vs(4,s,s.return),Js(s);break;case 1:Ti(s,s.return);var r=s.stateNode;typeof r.componentWillUnmount=="function"&&N_(s,s.return,r),Js(s);break;case 27:Kn(s.stateNode);case 26:case 5:Ti(s,s.return),Js(s);break;case 22:s.memoizedState===null&&Js(s);break;case 30:Js(s);break;default:Js(s)}t=t.sibling}}function Fi(t,s,r){for(r=r&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var a=s.alternate,c=t,u=s,g=u.flags;switch(u.tag){case 0:case 11:case 15:Fi(c,u,r),zn(4,u);break;case 1:if(Fi(c,u,r),a=u,c=a.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(B){Oe(a,a.return,B)}if(a=u,c=a.updateQueue,c!==null){var v=a.stateNode;try{var w=c.shared.hiddenCallbacks;if(w!==null)for(c.shared.hiddenCallbacks=null,c=0;c<w.length;c++)Cf(w[c],v)}catch(B){Oe(a,a.return,B)}}r&&g&64&&L_(u),On(u,u.return);break;case 27:U_(u);case 26:case 5:Fi(c,u,r),r&&a===null&&g&4&&H_(u),On(u,u.return);break;case 12:Fi(c,u,r);break;case 31:Fi(c,u,r),r&&g&4&&Y_(c,u);break;case 13:Fi(c,u,r),r&&g&4&&$_(c,u);break;case 22:u.memoizedState===null&&Fi(c,u,r),On(u,u.return);break;case 30:break;default:Fi(c,u,r)}s=s.sibling}}function Zc(t,s){var r=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),t=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(t=s.memoizedState.cachePool.pool),t!==r&&(t!=null&&t.refCount++,r!=null&&yn(r))}function Qc(t,s){t=null,s.alternate!==null&&(t=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==t&&(s.refCount++,t!=null&&yn(t))}function yi(t,s,r,a){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)G_(t,s,r,a),s=s.sibling}function G_(t,s,r,a){var c=s.flags;switch(s.tag){case 0:case 11:case 15:yi(t,s,r,a),c&2048&&zn(9,s);break;case 1:yi(t,s,r,a);break;case 3:yi(t,s,r,a),c&2048&&(t=null,s.alternate!==null&&(t=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==t&&(s.refCount++,t!=null&&yn(t)));break;case 12:if(c&2048){yi(t,s,r,a),t=s.stateNode;try{var u=s.memoizedProps,g=u.id,v=u.onPostCommit;typeof v=="function"&&v(g,s.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(w){Oe(s,s.return,w)}}else yi(t,s,r,a);break;case 31:yi(t,s,r,a);break;case 13:yi(t,s,r,a);break;case 23:break;case 22:u=s.stateNode,g=s.alternate,s.memoizedState!==null?u._visibility&2?yi(t,s,r,a):Ln(t,s):u._visibility&2?yi(t,s,r,a):(u._visibility|=2,jr(t,s,r,a,(s.subtreeFlags&10256)!==0||!1)),c&2048&&Zc(g,s);break;case 24:yi(t,s,r,a),c&2048&&Qc(s.alternate,s);break;default:yi(t,s,r,a)}}function jr(t,s,r,a,c){for(c=c&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var u=t,g=s,v=r,w=a,B=g.flags;switch(g.tag){case 0:case 11:case 15:jr(u,g,v,w,c),zn(8,g);break;case 23:break;case 22:var N=g.stateNode;g.memoizedState!==null?N._visibility&2?jr(u,g,v,w,c):Ln(u,g):(N._visibility|=2,jr(u,g,v,w,c)),c&&B&2048&&Zc(g.alternate,g);break;case 24:jr(u,g,v,w,c),c&&B&2048&&Qc(g.alternate,g);break;default:jr(u,g,v,w,c)}s=s.sibling}}function Ln(t,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var r=t,a=s,c=a.flags;switch(a.tag){case 22:Ln(r,a),c&2048&&Zc(a.alternate,a);break;case 24:Ln(r,a),c&2048&&Qc(a.alternate,a);break;default:Ln(r,a)}s=s.sibling}}var Nn=8192;function Ur(t,s,r){if(t.subtreeFlags&Nn)for(t=t.child;t!==null;)V_(t,s,r),t=t.sibling}function V_(t,s,r){switch(t.tag){case 26:Ur(t,s,r),t.flags&Nn&&t.memoizedState!==null&&GS(r,Si,t.memoizedState,t.memoizedProps);break;case 5:Ur(t,s,r);break;case 3:case 4:var a=Si;Si=Ea(t.stateNode.containerInfo),Ur(t,s,r),Si=a;break;case 22:t.memoizedState===null&&(a=t.alternate,a!==null&&a.memoizedState!==null?(a=Nn,Nn=16777216,Ur(t,s,r),Nn=a):Ur(t,s,r));break;default:Ur(t,s,r)}}function F_(t){var s=t.alternate;if(s!==null&&(t=s.child,t!==null)){s.child=null;do s=t.sibling,t.sibling=null,t=s;while(t!==null)}}function Hn(t){var s=t.deletions;if((t.flags&16)!==0){if(s!==null)for(var r=0;r<s.length;r++){var a=s[r];ft=a,Q_(a,t)}F_(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Z_(t),t=t.sibling}function Z_(t){switch(t.tag){case 0:case 11:case 15:Hn(t),t.flags&2048&&vs(9,t,t.return);break;case 3:Hn(t);break;case 12:Hn(t);break;case 22:var s=t.stateNode;t.memoizedState!==null&&s._visibility&2&&(t.return===null||t.return.tag!==13)?(s._visibility&=-3,fa(t)):Hn(t);break;default:Hn(t)}}function fa(t){var s=t.deletions;if((t.flags&16)!==0){if(s!==null)for(var r=0;r<s.length;r++){var a=s[r];ft=a,Q_(a,t)}F_(t)}for(t=t.child;t!==null;){switch(s=t,s.tag){case 0:case 11:case 15:vs(8,s,s.return),fa(s);break;case 22:r=s.stateNode,r._visibility&2&&(r._visibility&=-3,fa(s));break;default:fa(s)}t=t.sibling}}function Q_(t,s){for(;ft!==null;){var r=ft;switch(r.tag){case 0:case 11:case 15:vs(8,r,s);break;case 23:case 22:if(r.memoizedState!==null&&r.memoizedState.cachePool!==null){var a=r.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:yn(r.memoizedState.cache)}if(a=r.child,a!==null)a.return=r,ft=a;else e:for(r=t;ft!==null;){a=ft;var c=a.sibling,u=a.return;if(P_(a),a===r){ft=null;break e}if(c!==null){c.return=u,ft=c;break e}ft=u}}}var cS={getCacheForType:function(t){var s=bt(tt),r=s.data.get(t);return r===void 0&&(r=t(),s.data.set(t,r)),r},cacheSignal:function(){return bt(tt).controller.signal}},hS=typeof WeakMap=="function"?WeakMap:Map,Be=0,qe=null,be=null,we=0,ze=0,Vt=null,Ss=!1,qr=!1,Jc=!1,Zi=0,Ve=0,ys=0,er=0,eh=0,Ft=0,Wr=0,jn=null,Ut=null,th=!1,_a=0,J_=0,pa=1/0,ga=null,bs=null,ot=0,xs=null,Pr=null,Qi=0,ih=0,sh=null,ep=null,Un=0,rh=null;function Zt(){return(Be&2)!==0&&we!==0?we&-we:T.T!==null?hh():pd()}function tp(){if(Ft===0)if((we&536870912)===0||ke){var t=Cl;Cl<<=1,(Cl&3932160)===0&&(Cl=262144),Ft=t}else Ft=536870912;return t=Xt.current,t!==null&&(t.flags|=32),Ft}function qt(t,s,r){(t===qe&&(ze===2||ze===9)||t.cancelPendingCommit!==null)&&(Kr(t,0),ws(t,we,Ft,!1)),ln(t,r),((Be&2)===0||t!==qe)&&(t===qe&&((Be&2)===0&&(er|=r),Ve===4&&ws(t,we,Ft,!1)),Ri(t))}function ip(t,s,r){if((Be&6)!==0)throw Error(l(327));var a=!r&&(s&127)===0&&(s&t.expiredLanes)===0||nn(t,s),c=a?fS(t,s):lh(t,s,!0),u=a;do{if(c===0){qr&&!a&&ws(t,s,0,!1);break}else{if(r=t.current.alternate,u&&!uS(r)){c=lh(t,s,!1),u=!1;continue}if(c===2){if(u=s,t.errorRecoveryDisabledLanes&u)var g=0;else g=t.pendingLanes&-536870913,g=g!==0?g:g&536870912?536870912:0;if(g!==0){s=g;e:{var v=t;c=jn;var w=v.current.memoizedState.isDehydrated;if(w&&(Kr(v,g).flags|=256),g=lh(v,g,!1),g!==2){if(Jc&&!w){v.errorRecoveryDisabledLanes|=u,er|=u,c=4;break e}u=Ut,Ut=c,u!==null&&(Ut===null?Ut=u:Ut.push.apply(Ut,u))}c=g}if(u=!1,c!==2)continue}}if(c===1){Kr(t,0),ws(t,s,0,!0);break}e:{switch(a=t,u=c,u){case 0:case 1:throw Error(l(345));case 4:if((s&4194048)!==s)break;case 6:ws(a,s,Ft,!Ss);break e;case 2:Ut=null;break;case 3:case 5:break;default:throw Error(l(329))}if((s&62914560)===s&&(c=_a+300-Pt(),10<c)){if(ws(a,s,Ft,!Ss),El(a,0,!0)!==0)break e;Qi=s,a.timeoutHandle=zp(sp.bind(null,a,r,Ut,ga,th,s,Ft,er,Wr,Ss,u,"Throttled",-0,0),c);break e}sp(a,r,Ut,ga,th,s,Ft,er,Wr,Ss,u,null,-0,0)}}break}while(!0);Ri(t)}function sp(t,s,r,a,c,u,g,v,w,B,N,P,A,z){if(t.timeoutHandle=-1,P=s.subtreeFlags,P&8192||(P&16785408)===16785408){P={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Hi},V_(s,u,P);var re=(u&62914560)===u?_a-Pt():(u&4194048)===u?J_-Pt():0;if(re=VS(P,re),re!==null){Qi=u,t.cancelPendingCommit=re(up.bind(null,t,s,u,r,a,c,g,v,w,N,P,null,A,z)),ws(t,u,g,!B);return}}up(t,s,u,r,a,c,g,v,w)}function uS(t){for(var s=t;;){var r=s.tag;if((r===0||r===11||r===15)&&s.flags&16384&&(r=s.updateQueue,r!==null&&(r=r.stores,r!==null)))for(var a=0;a<r.length;a++){var c=r[a],u=c.getSnapshot;c=c.value;try{if(!$t(u(),c))return!1}catch{return!1}}if(r=s.child,s.subtreeFlags&16384&&r!==null)r.return=s,s=r;else{if(s===t)break;for(;s.sibling===null;){if(s.return===null||s.return===t)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function ws(t,s,r,a){s&=~eh,s&=~er,t.suspendedLanes|=s,t.pingedLanes&=~s,a&&(t.warmLanes|=s),a=t.expirationTimes;for(var c=s;0<c;){var u=31-Yt(c),g=1<<u;a[u]=-1,c&=~g}r!==0&&dd(t,r,s)}function ma(){return(Be&6)===0?(qn(0),!1):!0}function nh(){if(be!==null){if(ze===0)var t=be.return;else t=be,Wi=$s=null,bc(t),zr=null,xn=0,t=be;for(;t!==null;)O_(t.alternate,t),t=t.return;be=null}}function Kr(t,s){var r=t.timeoutHandle;r!==-1&&(t.timeoutHandle=-1,BS(r)),r=t.cancelPendingCommit,r!==null&&(t.cancelPendingCommit=null,r()),Qi=0,nh(),qe=t,be=r=Ui(t.current,null),we=s,ze=0,Vt=null,Ss=!1,qr=nn(t,s),Jc=!1,Wr=Ft=eh=er=ys=Ve=0,Ut=jn=null,th=!1,(s&8)!==0&&(s|=s&32);var a=t.entangledLanes;if(a!==0)for(t=t.entanglements,a&=s;0<a;){var c=31-Yt(a),u=1<<c;s|=t[c],a&=~u}return Zi=s,jl(),r}function rp(t,s){pe=null,T.H=Mn,s===Ar||s===Il?(s=yf(),ze=3):s===cc?(s=yf(),ze=4):ze=s===Hc?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,Vt=s,be===null&&(Ve=1,la(t,ni(s,t.current)))}function np(){var t=Xt.current;return t===null?!0:(we&4194048)===we?ci===null:(we&62914560)===we||(we&536870912)!==0?t===ci:!1}function lp(){var t=T.H;return T.H=Mn,t===null?Mn:t}function ap(){var t=T.A;return T.A=cS,t}function va(){Ve=4,Ss||(we&4194048)!==we&&Xt.current!==null||(qr=!0),(ys&134217727)===0&&(er&134217727)===0||qe===null||ws(qe,we,Ft,!1)}function lh(t,s,r){var a=Be;Be|=2;var c=lp(),u=ap();(qe!==t||we!==s)&&(ga=null,Kr(t,s)),s=!1;var g=Ve;e:do try{if(ze!==0&&be!==null){var v=be,w=Vt;switch(ze){case 8:nh(),g=6;break e;case 3:case 2:case 9:case 6:Xt.current===null&&(s=!0);var B=ze;if(ze=0,Vt=null,Yr(t,v,w,B),r&&qr){g=0;break e}break;default:B=ze,ze=0,Vt=null,Yr(t,v,w,B)}}dS(),g=Ve;break}catch(N){rp(t,N)}while(!0);return s&&t.shellSuspendCounter++,Wi=$s=null,Be=a,T.H=c,T.A=u,be===null&&(qe=null,we=0,jl()),g}function dS(){for(;be!==null;)op(be)}function fS(t,s){var r=Be;Be|=2;var a=lp(),c=ap();qe!==t||we!==s?(ga=null,pa=Pt()+500,Kr(t,s)):qr=nn(t,s);e:do try{if(ze!==0&&be!==null){s=be;var u=Vt;t:switch(ze){case 1:ze=0,Vt=null,Yr(t,s,u,1);break;case 2:case 9:if(vf(u)){ze=0,Vt=null,cp(s);break}s=function(){ze!==2&&ze!==9||qe!==t||(ze=7),Ri(t)},u.then(s,s);break e;case 3:ze=7;break e;case 4:ze=5;break e;case 7:vf(u)?(ze=0,Vt=null,cp(s)):(ze=0,Vt=null,Yr(t,s,u,7));break;case 5:var g=null;switch(be.tag){case 26:g=be.memoizedState;case 5:case 27:var v=be;if(g?Gp(g):v.stateNode.complete){ze=0,Vt=null;var w=v.sibling;if(w!==null)be=w;else{var B=v.return;B!==null?(be=B,Sa(B)):be=null}break t}}ze=0,Vt=null,Yr(t,s,u,5);break;case 6:ze=0,Vt=null,Yr(t,s,u,6);break;case 8:nh(),Ve=6;break e;default:throw Error(l(462))}}_S();break}catch(N){rp(t,N)}while(!0);return Wi=$s=null,T.H=a,T.A=c,Be=r,be!==null?0:(qe=null,we=0,jl(),Ve)}function _S(){for(;be!==null&&!Hv();)op(be)}function op(t){var s=A_(t.alternate,t,Zi);t.memoizedProps=t.pendingProps,s===null?Sa(t):be=s}function cp(t){var s=t,r=s.alternate;switch(s.tag){case 15:case 0:s=E_(r,s,s.pendingProps,s.type,void 0,we);break;case 11:s=E_(r,s,s.pendingProps,s.type.render,s.ref,we);break;case 5:bc(s);default:O_(r,s),s=be=af(s,Zi),s=A_(r,s,Zi)}t.memoizedProps=t.pendingProps,s===null?Sa(t):be=s}function Yr(t,s,r,a){Wi=$s=null,bc(s),zr=null,xn=0;var c=s.return;try{if(iS(t,c,s,r,we)){Ve=1,la(t,ni(r,t.current)),be=null;return}}catch(u){if(c!==null)throw be=c,u;Ve=1,la(t,ni(r,t.current)),be=null;return}s.flags&32768?(ke||a===1?t=!0:qr||(we&536870912)!==0?t=!1:(Ss=t=!0,(a===2||a===9||a===3||a===6)&&(a=Xt.current,a!==null&&a.tag===13&&(a.flags|=16384))),hp(s,t)):Sa(s)}function Sa(t){var s=t;do{if((s.flags&32768)!==0){hp(s,Ss);return}t=s.return;var r=nS(s.alternate,s,Zi);if(r!==null){be=r;return}if(s=s.sibling,s!==null){be=s;return}be=s=t}while(s!==null);Ve===0&&(Ve=5)}function hp(t,s){do{var r=lS(t.alternate,t);if(r!==null){r.flags&=32767,be=r;return}if(r=t.return,r!==null&&(r.flags|=32768,r.subtreeFlags=0,r.deletions=null),!s&&(t=t.sibling,t!==null)){be=t;return}be=t=r}while(t!==null);Ve=6,be=null}function up(t,s,r,a,c,u,g,v,w){t.cancelPendingCommit=null;do ya();while(ot!==0);if((Be&6)!==0)throw Error(l(327));if(s!==null){if(s===t.current)throw Error(l(177));if(u=s.lanes|s.childLanes,u|=Go,Xv(t,r,u,g,v,w),t===qe&&(be=qe=null,we=0),Pr=s,xs=t,Qi=r,ih=u,sh=c,ep=a,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,vS(xl,function(){return gp(),null})):(t.callbackNode=null,t.callbackPriority=0),a=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||a){a=T.T,T.T=null,c=j.p,j.p=2,g=Be,Be|=4;try{aS(t,s,r)}finally{Be=g,j.p=c,T.T=a}}ot=1,dp(),fp(),_p()}}function dp(){if(ot===1){ot=0;var t=xs,s=Pr,r=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||r){r=T.T,T.T=null;var a=j.p;j.p=2;var c=Be;Be|=4;try{I_(s,t);var u=vh,g=Zd(t.containerInfo),v=u.focusedElem,w=u.selectionRange;if(g!==v&&v&&v.ownerDocument&&Fd(v.ownerDocument.documentElement,v)){if(w!==null&&Ko(v)){var B=w.start,N=w.end;if(N===void 0&&(N=B),"selectionStart"in v)v.selectionStart=B,v.selectionEnd=Math.min(N,v.value.length);else{var P=v.ownerDocument||document,A=P&&P.defaultView||window;if(A.getSelection){var z=A.getSelection(),re=v.textContent.length,ce=Math.min(w.start,re),je=w.end===void 0?ce:Math.min(w.end,re);!z.extend&&ce>je&&(g=je,je=ce,ce=g);var D=Vd(v,ce),E=Vd(v,je);if(D&&E&&(z.rangeCount!==1||z.anchorNode!==D.node||z.anchorOffset!==D.offset||z.focusNode!==E.node||z.focusOffset!==E.offset)){var M=P.createRange();M.setStart(D.node,D.offset),z.removeAllRanges(),ce>je?(z.addRange(M),z.extend(E.node,E.offset)):(M.setEnd(E.node,E.offset),z.addRange(M))}}}}for(P=[],z=v;z=z.parentNode;)z.nodeType===1&&P.push({element:z,left:z.scrollLeft,top:z.scrollTop});for(typeof v.focus=="function"&&v.focus(),v=0;v<P.length;v++){var U=P[v];U.element.scrollLeft=U.left,U.element.scrollTop=U.top}}Aa=!!mh,vh=mh=null}finally{Be=c,j.p=a,T.T=r}}t.current=s,ot=2}}function fp(){if(ot===2){ot=0;var t=xs,s=Pr,r=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||r){r=T.T,T.T=null;var a=j.p;j.p=2;var c=Be;Be|=4;try{W_(t,s.alternate,s)}finally{Be=c,j.p=a,T.T=r}}ot=3}}function _p(){if(ot===4||ot===3){ot=0,jv();var t=xs,s=Pr,r=Qi,a=ep;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?ot=5:(ot=0,Pr=xs=null,pp(t,t.pendingLanes));var c=t.pendingLanes;if(c===0&&(bs=null),Co(r),s=s.stateNode,Kt&&typeof Kt.onCommitFiberRoot=="function")try{Kt.onCommitFiberRoot(rn,s,void 0,(s.current.flags&128)===128)}catch{}if(a!==null){s=T.T,c=j.p,j.p=2,T.T=null;try{for(var u=t.onRecoverableError,g=0;g<a.length;g++){var v=a[g];u(v.value,{componentStack:v.stack})}}finally{T.T=s,j.p=c}}(Qi&3)!==0&&ya(),Ri(t),c=t.pendingLanes,(r&261930)!==0&&(c&42)!==0?t===rh?Un++:(Un=0,rh=t):Un=0,qn(0)}}function pp(t,s){(t.pooledCacheLanes&=s)===0&&(s=t.pooledCache,s!=null&&(t.pooledCache=null,yn(s)))}function ya(){return dp(),fp(),_p(),gp()}function gp(){if(ot!==5)return!1;var t=xs,s=ih;ih=0;var r=Co(Qi),a=T.T,c=j.p;try{j.p=32>r?32:r,T.T=null,r=sh,sh=null;var u=xs,g=Qi;if(ot=0,Pr=xs=null,Qi=0,(Be&6)!==0)throw Error(l(331));var v=Be;if(Be|=4,Z_(u.current),G_(u,u.current,g,r),Be=v,qn(0,!1),Kt&&typeof Kt.onPostCommitFiberRoot=="function")try{Kt.onPostCommitFiberRoot(rn,u)}catch{}return!0}finally{j.p=c,T.T=a,pp(t,s)}}function mp(t,s,r){s=ni(r,s),s=Nc(t.stateNode,s,2),t=ps(t,s,2),t!==null&&(ln(t,2),Ri(t))}function Oe(t,s,r){if(t.tag===3)mp(t,t,r);else for(;s!==null;){if(s.tag===3){mp(s,t,r);break}else if(s.tag===1){var a=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(bs===null||!bs.has(a))){t=ni(r,t),r=v_(2),a=ps(s,r,2),a!==null&&(S_(r,a,s,t),ln(a,2),Ri(a));break}}s=s.return}}function ah(t,s,r){var a=t.pingCache;if(a===null){a=t.pingCache=new hS;var c=new Set;a.set(s,c)}else c=a.get(s),c===void 0&&(c=new Set,a.set(s,c));c.has(r)||(Jc=!0,c.add(r),t=pS.bind(null,t,s,r),s.then(t,t))}function pS(t,s,r){var a=t.pingCache;a!==null&&a.delete(s),t.pingedLanes|=t.suspendedLanes&r,t.warmLanes&=~r,qe===t&&(we&r)===r&&(Ve===4||Ve===3&&(we&62914560)===we&&300>Pt()-_a?(Be&2)===0&&Kr(t,0):eh|=r,Wr===we&&(Wr=0)),Ri(t)}function vp(t,s){s===0&&(s=ud()),t=Ps(t,s),t!==null&&(ln(t,s),Ri(t))}function gS(t){var s=t.memoizedState,r=0;s!==null&&(r=s.retryLane),vp(t,r)}function mS(t,s){var r=0;switch(t.tag){case 31:case 13:var a=t.stateNode,c=t.memoizedState;c!==null&&(r=c.retryLane);break;case 19:a=t.stateNode;break;case 22:a=t.stateNode._retryCache;break;default:throw Error(l(314))}a!==null&&a.delete(s),vp(t,r)}function vS(t,s){return yo(t,s)}var ba=null,$r=null,oh=!1,xa=!1,ch=!1,Cs=0;function Ri(t){t!==$r&&t.next===null&&($r===null?ba=$r=t:$r=$r.next=t),xa=!0,oh||(oh=!0,yS())}function qn(t,s){if(!ch&&xa){ch=!0;do for(var r=!1,a=ba;a!==null;){if(t!==0){var c=a.pendingLanes;if(c===0)var u=0;else{var g=a.suspendedLanes,v=a.pingedLanes;u=(1<<31-Yt(42|t)+1)-1,u&=c&~(g&~v),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(r=!0,xp(a,u))}else u=we,u=El(a,a===qe?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(u&3)===0||nn(a,u)||(r=!0,xp(a,u));a=a.next}while(r);ch=!1}}function SS(){Sp()}function Sp(){xa=oh=!1;var t=0;Cs!==0&&MS()&&(t=Cs);for(var s=Pt(),r=null,a=ba;a!==null;){var c=a.next,u=yp(a,s);u===0?(a.next=null,r===null?ba=c:r.next=c,c===null&&($r=r)):(r=a,(t!==0||(u&3)!==0)&&(xa=!0)),a=c}ot!==0&&ot!==5||qn(t),Cs!==0&&(Cs=0)}function yp(t,s){for(var r=t.suspendedLanes,a=t.pingedLanes,c=t.expirationTimes,u=t.pendingLanes&-62914561;0<u;){var g=31-Yt(u),v=1<<g,w=c[g];w===-1?((v&r)===0||(v&a)!==0)&&(c[g]=Iv(v,s)):w<=s&&(t.expiredLanes|=v),u&=~v}if(s=qe,r=we,r=El(t,t===s?r:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),a=t.callbackNode,r===0||t===s&&(ze===2||ze===9)||t.cancelPendingCommit!==null)return a!==null&&a!==null&&bo(a),t.callbackNode=null,t.callbackPriority=0;if((r&3)===0||nn(t,r)){if(s=r&-r,s===t.callbackPriority)return s;switch(a!==null&&bo(a),Co(r)){case 2:case 8:r=cd;break;case 32:r=xl;break;case 268435456:r=hd;break;default:r=xl}return a=bp.bind(null,t),r=yo(r,a),t.callbackPriority=s,t.callbackNode=r,s}return a!==null&&a!==null&&bo(a),t.callbackPriority=2,t.callbackNode=null,2}function bp(t,s){if(ot!==0&&ot!==5)return t.callbackNode=null,t.callbackPriority=0,null;var r=t.callbackNode;if(ya()&&t.callbackNode!==r)return null;var a=we;return a=El(t,t===qe?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),a===0?null:(ip(t,a,s),yp(t,Pt()),t.callbackNode!=null&&t.callbackNode===r?bp.bind(null,t):null)}function xp(t,s){if(ya())return null;ip(t,s,!0)}function yS(){AS(function(){(Be&6)!==0?yo(od,SS):Sp()})}function hh(){if(Cs===0){var t=Mr;t===0&&(t=wl,wl<<=1,(wl&261888)===0&&(wl=256)),Cs=t}return Cs}function wp(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Ml(""+t)}function Cp(t,s){var r=s.ownerDocument.createElement("input");return r.name=s.name,r.value=s.value,t.id&&r.setAttribute("form",t.id),s.parentNode.insertBefore(r,s),t=new FormData(t),r.parentNode.removeChild(r),t}function bS(t,s,r,a,c){if(s==="submit"&&r&&r.stateNode===c){var u=wp((c[Ot]||null).action),g=a.submitter;g&&(s=(s=g[Ot]||null)?wp(s.formAction):g.getAttribute("formAction"),s!==null&&(u=s,g=null));var v=new Ol("action","action",null,a,c);t.push({event:v,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(Cs!==0){var w=g?Cp(c,g):new FormData(c);Mc(r,{pending:!0,data:w,method:c.method,action:u},null,w)}}else typeof u=="function"&&(v.preventDefault(),w=g?Cp(c,g):new FormData(c),Mc(r,{pending:!0,data:w,method:c.method,action:u},u,w))},currentTarget:c}]})}}for(var uh=0;uh<Xo.length;uh++){var dh=Xo[uh],xS=dh.toLowerCase(),wS=dh[0].toUpperCase()+dh.slice(1);vi(xS,"on"+wS)}vi(ef,"onAnimationEnd"),vi(tf,"onAnimationIteration"),vi(sf,"onAnimationStart"),vi("dblclick","onDoubleClick"),vi("focusin","onFocus"),vi("focusout","onBlur"),vi(U0,"onTransitionRun"),vi(q0,"onTransitionStart"),vi(W0,"onTransitionCancel"),vi(rf,"onTransitionEnd"),gr("onMouseEnter",["mouseout","mouseover"]),gr("onMouseLeave",["mouseout","mouseover"]),gr("onPointerEnter",["pointerout","pointerover"]),gr("onPointerLeave",["pointerout","pointerover"]),js("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),js("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),js("onBeforeInput",["compositionend","keypress","textInput","paste"]),js("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),js("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),js("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Wn="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(" "),CS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Wn));function kp(t,s){s=(s&4)!==0;for(var r=0;r<t.length;r++){var a=t[r],c=a.event;a=a.listeners;e:{var u=void 0;if(s)for(var g=a.length-1;0<=g;g--){var v=a[g],w=v.instance,B=v.currentTarget;if(v=v.listener,w!==u&&c.isPropagationStopped())break e;u=v,c.currentTarget=B;try{u(c)}catch(N){Hl(N)}c.currentTarget=null,u=w}else for(g=0;g<a.length;g++){if(v=a[g],w=v.instance,B=v.currentTarget,v=v.listener,w!==u&&c.isPropagationStopped())break e;u=v,c.currentTarget=B;try{u(c)}catch(N){Hl(N)}c.currentTarget=null,u=w}}}}function xe(t,s){var r=s[ko];r===void 0&&(r=s[ko]=new Set);var a=t+"__bubble";r.has(a)||(Ep(s,t,2,!1),r.add(a))}function fh(t,s,r){var a=0;s&&(a|=4),Ep(r,t,a,s)}var wa="_reactListening"+Math.random().toString(36).slice(2);function _h(t){if(!t[wa]){t[wa]=!0,vd.forEach(function(r){r!=="selectionchange"&&(CS.has(r)||fh(r,!1,t),fh(r,!0,t))});var s=t.nodeType===9?t:t.ownerDocument;s===null||s[wa]||(s[wa]=!0,fh("selectionchange",!1,s))}}function Ep(t,s,r,a){switch(tg(s)){case 2:var c=QS;break;case 8:c=JS;break;default:c=Dh}r=c.bind(null,s,r,t),c=void 0,!Oo||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(c=!0),a?c!==void 0?t.addEventListener(s,r,{capture:!0,passive:c}):t.addEventListener(s,r,!0):c!==void 0?t.addEventListener(s,r,{passive:c}):t.addEventListener(s,r,!1)}function ph(t,s,r,a,c){var u=a;if((s&1)===0&&(s&2)===0&&a!==null)e:for(;;){if(a===null)return;var g=a.tag;if(g===3||g===4){var v=a.stateNode.containerInfo;if(v===c)break;if(g===4)for(g=a.return;g!==null;){var w=g.tag;if((w===3||w===4)&&g.stateNode.containerInfo===c)return;g=g.return}for(;v!==null;){if(g=fr(v),g===null)return;if(w=g.tag,w===5||w===6||w===26||w===27){a=u=g;continue e}v=v.parentNode}}a=a.return}Md(function(){var B=u,N=Ao(r),P=[];e:{var A=nf.get(t);if(A!==void 0){var z=Ol,re=t;switch(t){case"keypress":if(Al(r)===0)break e;case"keydown":case"keyup":z=m0;break;case"focusin":re="focus",z=jo;break;case"focusout":re="blur",z=jo;break;case"beforeblur":case"afterblur":z=jo;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":z=zd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":z=n0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":z=y0;break;case ef:case tf:case sf:z=o0;break;case rf:z=x0;break;case"scroll":case"scrollend":z=s0;break;case"wheel":z=C0;break;case"copy":case"cut":case"paste":z=h0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":z=Ld;break;case"toggle":case"beforetoggle":z=E0}var ce=(s&4)!==0,je=!ce&&(t==="scroll"||t==="scrollend"),D=ce?A!==null?A+"Capture":null:A;ce=[];for(var E=B,M;E!==null;){var U=E;if(M=U.stateNode,U=U.tag,U!==5&&U!==26&&U!==27||M===null||D===null||(U=cn(E,D),U!=null&&ce.push(Pn(E,U,M))),je)break;E=E.return}0<ce.length&&(A=new z(A,re,null,r,N),P.push({event:A,listeners:ce}))}}if((s&7)===0){e:{if(A=t==="mouseover"||t==="pointerover",z=t==="mouseout"||t==="pointerout",A&&r!==Bo&&(re=r.relatedTarget||r.fromElement)&&(fr(re)||re[dr]))break e;if((z||A)&&(A=N.window===N?N:(A=N.ownerDocument)?A.defaultView||A.parentWindow:window,z?(re=r.relatedTarget||r.toElement,z=B,re=re?fr(re):null,re!==null&&(je=h(re),ce=re.tag,re!==je||ce!==5&&ce!==27&&ce!==6)&&(re=null)):(z=null,re=B),z!==re)){if(ce=zd,U="onMouseLeave",D="onMouseEnter",E="mouse",(t==="pointerout"||t==="pointerover")&&(ce=Ld,U="onPointerLeave",D="onPointerEnter",E="pointer"),je=z==null?A:on(z),M=re==null?A:on(re),A=new ce(U,E+"leave",z,r,N),A.target=je,A.relatedTarget=M,U=null,fr(N)===B&&(ce=new ce(D,E+"enter",re,r,N),ce.target=M,ce.relatedTarget=je,U=ce),je=U,z&&re)t:{for(ce=kS,D=z,E=re,M=0,U=D;U;U=ce(U))M++;U=0;for(var le=E;le;le=ce(le))U++;for(;0<M-U;)D=ce(D),M--;for(;0<U-M;)E=ce(E),U--;for(;M--;){if(D===E||E!==null&&D===E.alternate){ce=D;break t}D=ce(D),E=ce(E)}ce=null}else ce=null;z!==null&&Tp(P,A,z,ce,!1),re!==null&&je!==null&&Tp(P,je,re,ce,!0)}}e:{if(A=B?on(B):window,z=A.nodeName&&A.nodeName.toLowerCase(),z==="select"||z==="input"&&A.type==="file")var De=Kd;else if(Wd(A))if(Yd)De=N0;else{De=O0;var ne=z0}else z=A.nodeName,!z||z.toLowerCase()!=="input"||A.type!=="checkbox"&&A.type!=="radio"?B&&Mo(B.elementType)&&(De=Kd):De=L0;if(De&&(De=De(t,B))){Pd(P,De,r,N);break e}ne&&ne(t,A,B),t==="focusout"&&B&&A.type==="number"&&B.memoizedProps.value!=null&&Do(A,"number",A.value)}switch(ne=B?on(B):window,t){case"focusin":(Wd(ne)||ne.contentEditable==="true")&&(xr=ne,Yo=B,mn=null);break;case"focusout":mn=Yo=xr=null;break;case"mousedown":$o=!0;break;case"contextmenu":case"mouseup":case"dragend":$o=!1,Qd(P,r,N);break;case"selectionchange":if(j0)break;case"keydown":case"keyup":Qd(P,r,N)}var ge;if(qo)e:{switch(t){case"compositionstart":var Ce="onCompositionStart";break e;case"compositionend":Ce="onCompositionEnd";break e;case"compositionupdate":Ce="onCompositionUpdate";break e}Ce=void 0}else br?Ud(t,r)&&(Ce="onCompositionEnd"):t==="keydown"&&r.keyCode===229&&(Ce="onCompositionStart");Ce&&(Nd&&r.locale!=="ko"&&(br||Ce!=="onCompositionStart"?Ce==="onCompositionEnd"&&br&&(ge=Bd()):(os=N,Lo="value"in os?os.value:os.textContent,br=!0)),ne=Ca(B,Ce),0<ne.length&&(Ce=new Od(Ce,t,null,r,N),P.push({event:Ce,listeners:ne}),ge?Ce.data=ge:(ge=qd(r),ge!==null&&(Ce.data=ge)))),(ge=R0?D0(t,r):M0(t,r))&&(Ce=Ca(B,"onBeforeInput"),0<Ce.length&&(ne=new Od("onBeforeInput","beforeinput",null,r,N),P.push({event:ne,listeners:Ce}),ne.data=ge)),bS(P,t,B,r,N)}kp(P,s)})}function Pn(t,s,r){return{instance:t,listener:s,currentTarget:r}}function Ca(t,s){for(var r=s+"Capture",a=[];t!==null;){var c=t,u=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||u===null||(c=cn(t,r),c!=null&&a.unshift(Pn(t,c,u)),c=cn(t,s),c!=null&&a.push(Pn(t,c,u))),t.tag===3)return a;t=t.return}return[]}function kS(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Tp(t,s,r,a,c){for(var u=s._reactName,g=[];r!==null&&r!==a;){var v=r,w=v.alternate,B=v.stateNode;if(v=v.tag,w!==null&&w===a)break;v!==5&&v!==26&&v!==27||B===null||(w=B,c?(B=cn(r,u),B!=null&&g.unshift(Pn(r,B,w))):c||(B=cn(r,u),B!=null&&g.push(Pn(r,B,w)))),r=r.return}g.length!==0&&t.push({event:s,listeners:g})}var ES=/\r\n?/g,TS=/\u0000|\uFFFD/g;function Rp(t){return(typeof t=="string"?t:""+t).replace(ES,`
|
|
9
|
+
`).replace(TS,"")}function Dp(t,s){return s=Rp(s),Rp(t)===s}function He(t,s,r,a,c,u){switch(r){case"children":typeof a=="string"?s==="body"||s==="textarea"&&a===""||vr(t,a):(typeof a=="number"||typeof a=="bigint")&&s!=="body"&&vr(t,""+a);break;case"className":Rl(t,"class",a);break;case"tabIndex":Rl(t,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":Rl(t,r,a);break;case"style":Rd(t,a,u);break;case"data":if(s!=="object"){Rl(t,"data",a);break}case"src":case"href":if(a===""&&(s!=="a"||r!=="href")){t.removeAttribute(r);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){t.removeAttribute(r);break}a=Ml(""+a),t.setAttribute(r,a);break;case"action":case"formAction":if(typeof a=="function"){t.setAttribute(r,"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 u=="function"&&(r==="formAction"?(s!=="input"&&He(t,s,"name",c.name,c,null),He(t,s,"formEncType",c.formEncType,c,null),He(t,s,"formMethod",c.formMethod,c,null),He(t,s,"formTarget",c.formTarget,c,null)):(He(t,s,"encType",c.encType,c,null),He(t,s,"method",c.method,c,null),He(t,s,"target",c.target,c,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){t.removeAttribute(r);break}a=Ml(""+a),t.setAttribute(r,a);break;case"onClick":a!=null&&(t.onclick=Hi);break;case"onScroll":a!=null&&xe("scroll",t);break;case"onScrollEnd":a!=null&&xe("scrollend",t);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(l(61));if(r=a.__html,r!=null){if(c.children!=null)throw Error(l(60));t.innerHTML=r}}break;case"multiple":t.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":t.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){t.removeAttribute("xlink:href");break}r=Ml(""+a),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?t.setAttribute(r,""+a):t.removeAttribute(r);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":a&&typeof a!="function"&&typeof a!="symbol"?t.setAttribute(r,""):t.removeAttribute(r);break;case"capture":case"download":a===!0?t.setAttribute(r,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?t.setAttribute(r,a):t.removeAttribute(r);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?t.setAttribute(r,a):t.removeAttribute(r);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?t.removeAttribute(r):t.setAttribute(r,a);break;case"popover":xe("beforetoggle",t),xe("toggle",t),Tl(t,"popover",a);break;case"xlinkActuate":Ni(t,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Ni(t,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Ni(t,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Ni(t,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Ni(t,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Ni(t,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Ni(t,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Ni(t,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Ni(t,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Tl(t,"is",a);break;case"innerText":case"textContent":break;default:(!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(r=t0.get(r)||r,Tl(t,r,a))}}function gh(t,s,r,a,c,u){switch(r){case"style":Rd(t,a,u);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(l(61));if(r=a.__html,r!=null){if(c.children!=null)throw Error(l(60));t.innerHTML=r}}break;case"children":typeof a=="string"?vr(t,a):(typeof a=="number"||typeof a=="bigint")&&vr(t,""+a);break;case"onScroll":a!=null&&xe("scroll",t);break;case"onScrollEnd":a!=null&&xe("scrollend",t);break;case"onClick":a!=null&&(t.onclick=Hi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Sd.hasOwnProperty(r))e:{if(r[0]==="o"&&r[1]==="n"&&(c=r.endsWith("Capture"),s=r.slice(2,c?r.length-7:void 0),u=t[Ot]||null,u=u!=null?u[r]:null,typeof u=="function"&&t.removeEventListener(s,u,c),typeof a=="function")){typeof u!="function"&&u!==null&&(r in t?t[r]=null:t.hasAttribute(r)&&t.removeAttribute(r)),t.addEventListener(s,a,c);break e}r in t?t[r]=a:a===!0?t.setAttribute(r,""):Tl(t,r,a)}}}function wt(t,s,r){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":xe("error",t),xe("load",t);var a=!1,c=!1,u;for(u in r)if(r.hasOwnProperty(u)){var g=r[u];if(g!=null)switch(u){case"src":a=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,s));default:He(t,s,u,g,r,null)}}c&&He(t,s,"srcSet",r.srcSet,r,null),a&&He(t,s,"src",r.src,r,null);return;case"input":xe("invalid",t);var v=u=g=c=null,w=null,B=null;for(a in r)if(r.hasOwnProperty(a)){var N=r[a];if(N!=null)switch(a){case"name":c=N;break;case"type":g=N;break;case"checked":w=N;break;case"defaultChecked":B=N;break;case"value":u=N;break;case"defaultValue":v=N;break;case"children":case"dangerouslySetInnerHTML":if(N!=null)throw Error(l(137,s));break;default:He(t,s,a,N,r,null)}}Cd(t,u,v,w,B,g,c,!1);return;case"select":xe("invalid",t),a=g=u=null;for(c in r)if(r.hasOwnProperty(c)&&(v=r[c],v!=null))switch(c){case"value":u=v;break;case"defaultValue":g=v;break;case"multiple":a=v;default:He(t,s,c,v,r,null)}s=u,r=g,t.multiple=!!a,s!=null?mr(t,!!a,s,!1):r!=null&&mr(t,!!a,r,!0);return;case"textarea":xe("invalid",t),u=c=a=null;for(g in r)if(r.hasOwnProperty(g)&&(v=r[g],v!=null))switch(g){case"value":a=v;break;case"defaultValue":c=v;break;case"children":u=v;break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(l(91));break;default:He(t,s,g,v,r,null)}Ed(t,a,c,u);return;case"option":for(w in r)r.hasOwnProperty(w)&&(a=r[w],a!=null)&&(w==="selected"?t.selected=a&&typeof a!="function"&&typeof a!="symbol":He(t,s,w,a,r,null));return;case"dialog":xe("beforetoggle",t),xe("toggle",t),xe("cancel",t),xe("close",t);break;case"iframe":case"object":xe("load",t);break;case"video":case"audio":for(a=0;a<Wn.length;a++)xe(Wn[a],t);break;case"image":xe("error",t),xe("load",t);break;case"details":xe("toggle",t);break;case"embed":case"source":case"link":xe("error",t),xe("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(B in r)if(r.hasOwnProperty(B)&&(a=r[B],a!=null))switch(B){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,s));default:He(t,s,B,a,r,null)}return;default:if(Mo(s)){for(N in r)r.hasOwnProperty(N)&&(a=r[N],a!==void 0&&gh(t,s,N,a,r,void 0));return}}for(v in r)r.hasOwnProperty(v)&&(a=r[v],a!=null&&He(t,s,v,a,r,null))}function RS(t,s,r,a){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,u=null,g=null,v=null,w=null,B=null,N=null;for(z in r){var P=r[z];if(r.hasOwnProperty(z)&&P!=null)switch(z){case"checked":break;case"value":break;case"defaultValue":w=P;default:a.hasOwnProperty(z)||He(t,s,z,null,a,P)}}for(var A in a){var z=a[A];if(P=r[A],a.hasOwnProperty(A)&&(z!=null||P!=null))switch(A){case"type":u=z;break;case"name":c=z;break;case"checked":B=z;break;case"defaultChecked":N=z;break;case"value":g=z;break;case"defaultValue":v=z;break;case"children":case"dangerouslySetInnerHTML":if(z!=null)throw Error(l(137,s));break;default:z!==P&&He(t,s,A,z,a,P)}}Ro(t,g,v,w,B,N,u,c);return;case"select":z=g=v=A=null;for(u in r)if(w=r[u],r.hasOwnProperty(u)&&w!=null)switch(u){case"value":break;case"multiple":z=w;default:a.hasOwnProperty(u)||He(t,s,u,null,a,w)}for(c in a)if(u=a[c],w=r[c],a.hasOwnProperty(c)&&(u!=null||w!=null))switch(c){case"value":A=u;break;case"defaultValue":v=u;break;case"multiple":g=u;default:u!==w&&He(t,s,c,u,a,w)}s=v,r=g,a=z,A!=null?mr(t,!!r,A,!1):!!a!=!!r&&(s!=null?mr(t,!!r,s,!0):mr(t,!!r,r?[]:"",!1));return;case"textarea":z=A=null;for(v in r)if(c=r[v],r.hasOwnProperty(v)&&c!=null&&!a.hasOwnProperty(v))switch(v){case"value":break;case"children":break;default:He(t,s,v,null,a,c)}for(g in a)if(c=a[g],u=r[g],a.hasOwnProperty(g)&&(c!=null||u!=null))switch(g){case"value":A=c;break;case"defaultValue":z=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(l(91));break;default:c!==u&&He(t,s,g,c,a,u)}kd(t,A,z);return;case"option":for(var re in r)A=r[re],r.hasOwnProperty(re)&&A!=null&&!a.hasOwnProperty(re)&&(re==="selected"?t.selected=!1:He(t,s,re,null,a,A));for(w in a)A=a[w],z=r[w],a.hasOwnProperty(w)&&A!==z&&(A!=null||z!=null)&&(w==="selected"?t.selected=A&&typeof A!="function"&&typeof A!="symbol":He(t,s,w,A,a,z));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 ce in r)A=r[ce],r.hasOwnProperty(ce)&&A!=null&&!a.hasOwnProperty(ce)&&He(t,s,ce,null,a,A);for(B in a)if(A=a[B],z=r[B],a.hasOwnProperty(B)&&A!==z&&(A!=null||z!=null))switch(B){case"children":case"dangerouslySetInnerHTML":if(A!=null)throw Error(l(137,s));break;default:He(t,s,B,A,a,z)}return;default:if(Mo(s)){for(var je in r)A=r[je],r.hasOwnProperty(je)&&A!==void 0&&!a.hasOwnProperty(je)&&gh(t,s,je,void 0,a,A);for(N in a)A=a[N],z=r[N],!a.hasOwnProperty(N)||A===z||A===void 0&&z===void 0||gh(t,s,N,A,a,z);return}}for(var D in r)A=r[D],r.hasOwnProperty(D)&&A!=null&&!a.hasOwnProperty(D)&&He(t,s,D,null,a,A);for(P in a)A=a[P],z=r[P],!a.hasOwnProperty(P)||A===z||A==null&&z==null||He(t,s,P,A,a,z)}function Mp(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function DS(){if(typeof performance.getEntriesByType=="function"){for(var t=0,s=0,r=performance.getEntriesByType("resource"),a=0;a<r.length;a++){var c=r[a],u=c.transferSize,g=c.initiatorType,v=c.duration;if(u&&v&&Mp(g)){for(g=0,v=c.responseEnd,a+=1;a<r.length;a++){var w=r[a],B=w.startTime;if(B>v)break;var N=w.transferSize,P=w.initiatorType;N&&Mp(P)&&(w=w.responseEnd,g+=N*(w<v?1:(v-B)/(w-B)))}if(--a,s+=8*(u+g)/(c.duration/1e3),t++,10<t)break}}if(0<t)return s/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var mh=null,vh=null;function ka(t){return t.nodeType===9?t:t.ownerDocument}function Bp(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 Ap(t,s){if(t===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&s==="foreignObject"?0:t}function Sh(t,s){return t==="textarea"||t==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var yh=null;function MS(){var t=window.event;return t&&t.type==="popstate"?t===yh?!1:(yh=t,!0):(yh=null,!1)}var zp=typeof setTimeout=="function"?setTimeout:void 0,BS=typeof clearTimeout=="function"?clearTimeout:void 0,Op=typeof Promise=="function"?Promise:void 0,AS=typeof queueMicrotask=="function"?queueMicrotask:typeof Op<"u"?function(t){return Op.resolve(null).then(t).catch(zS)}:zp;function zS(t){setTimeout(function(){throw t})}function ks(t){return t==="head"}function Lp(t,s){var r=s,a=0;do{var c=r.nextSibling;if(t.removeChild(r),c&&c.nodeType===8)if(r=c.data,r==="/$"||r==="/&"){if(a===0){t.removeChild(c),Vr(s);return}a--}else if(r==="$"||r==="$?"||r==="$~"||r==="$!"||r==="&")a++;else if(r==="html")Kn(t.ownerDocument.documentElement);else if(r==="head"){r=t.ownerDocument.head,Kn(r);for(var u=r.firstChild;u;){var g=u.nextSibling,v=u.nodeName;u[an]||v==="SCRIPT"||v==="STYLE"||v==="LINK"&&u.rel.toLowerCase()==="stylesheet"||r.removeChild(u),u=g}}else r==="body"&&Kn(t.ownerDocument.body);r=c}while(r);Vr(s)}function Np(t,s){var r=t;t=0;do{var a=r.nextSibling;if(r.nodeType===1?s?(r._stashedDisplay=r.style.display,r.style.display="none"):(r.style.display=r._stashedDisplay||"",r.getAttribute("style")===""&&r.removeAttribute("style")):r.nodeType===3&&(s?(r._stashedText=r.nodeValue,r.nodeValue=""):r.nodeValue=r._stashedText||""),a&&a.nodeType===8)if(r=a.data,r==="/$"){if(t===0)break;t--}else r!=="$"&&r!=="$?"&&r!=="$~"&&r!=="$!"||t++;r=a}while(r)}function bh(t){var s=t.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var r=s;switch(s=s.nextSibling,r.nodeName){case"HTML":case"HEAD":case"BODY":bh(r),Eo(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}t.removeChild(r)}}function OS(t,s,r,a){for(;t.nodeType===1;){var c=r;if(t.nodeName.toLowerCase()!==s.toLowerCase()){if(!a&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(a){if(!t[an])switch(s){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(u=t.getAttribute("rel"),u==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(u!==c.rel||t.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||t.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||t.getAttribute("title")!==(c.title==null?null:c.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(u=t.getAttribute("src"),(u!==(c.src==null?null:c.src)||t.getAttribute("type")!==(c.type==null?null:c.type)||t.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&u&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(s==="input"&&t.type==="hidden"){var u=c.name==null?null:""+c.name;if(c.type==="hidden"&&t.getAttribute("name")===u)return t}else return t;if(t=hi(t.nextSibling),t===null)break}return null}function LS(t,s,r){if(s==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!r||(t=hi(t.nextSibling),t===null))return null;return t}function Hp(t,s){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!s||(t=hi(t.nextSibling),t===null))return null;return t}function xh(t){return t.data==="$?"||t.data==="$~"}function wh(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function NS(t,s){var r=t.ownerDocument;if(t.data==="$~")t._reactRetry=s;else if(t.data!=="$?"||r.readyState!=="loading")s();else{var a=function(){s(),r.removeEventListener("DOMContentLoaded",a)};r.addEventListener("DOMContentLoaded",a),t._reactRetry=a}}function hi(t){for(;t!=null;t=t.nextSibling){var s=t.nodeType;if(s===1||s===3)break;if(s===8){if(s=t.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return t}var Ch=null;function jp(t){t=t.nextSibling;for(var s=0;t;){if(t.nodeType===8){var r=t.data;if(r==="/$"||r==="/&"){if(s===0)return hi(t.nextSibling);s--}else r!=="$"&&r!=="$!"&&r!=="$?"&&r!=="$~"&&r!=="&"||s++}t=t.nextSibling}return null}function Up(t){t=t.previousSibling;for(var s=0;t;){if(t.nodeType===8){var r=t.data;if(r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"){if(s===0)return t;s--}else r!=="/$"&&r!=="/&"||s++}t=t.previousSibling}return null}function qp(t,s,r){switch(s=ka(r),t){case"html":if(t=s.documentElement,!t)throw Error(l(452));return t;case"head":if(t=s.head,!t)throw Error(l(453));return t;case"body":if(t=s.body,!t)throw Error(l(454));return t;default:throw Error(l(451))}}function Kn(t){for(var s=t.attributes;s.length;)t.removeAttributeNode(s[0]);Eo(t)}var ui=new Map,Wp=new Set;function Ea(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Ji=j.d;j.d={f:HS,r:jS,D:US,C:qS,L:WS,m:PS,X:YS,S:KS,M:$S};function HS(){var t=Ji.f(),s=ma();return t||s}function jS(t){var s=_r(t);s!==null&&s.tag===5&&s.type==="form"?r_(s):Ji.r(t)}var Ir=typeof document>"u"?null:document;function Pp(t,s,r){var a=Ir;if(a&&typeof s=="string"&&s){var c=si(s);c='link[rel="'+t+'"][href="'+c+'"]',typeof r=="string"&&(c+='[crossorigin="'+r+'"]'),Wp.has(c)||(Wp.add(c),t={rel:t,crossOrigin:r,href:s},a.querySelector(c)===null&&(s=a.createElement("link"),wt(s,"link",t),dt(s),a.head.appendChild(s)))}}function US(t){Ji.D(t),Pp("dns-prefetch",t,null)}function qS(t,s){Ji.C(t,s),Pp("preconnect",t,s)}function WS(t,s,r){Ji.L(t,s,r);var a=Ir;if(a&&t&&s){var c='link[rel="preload"][as="'+si(s)+'"]';s==="image"&&r&&r.imageSrcSet?(c+='[imagesrcset="'+si(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(c+='[imagesizes="'+si(r.imageSizes)+'"]')):c+='[href="'+si(t)+'"]';var u=c;switch(s){case"style":u=Xr(t);break;case"script":u=Gr(t)}ui.has(u)||(t=y({rel:"preload",href:s==="image"&&r&&r.imageSrcSet?void 0:t,as:s},r),ui.set(u,t),a.querySelector(c)!==null||s==="style"&&a.querySelector(Yn(u))||s==="script"&&a.querySelector($n(u))||(s=a.createElement("link"),wt(s,"link",t),dt(s),a.head.appendChild(s)))}}function PS(t,s){Ji.m(t,s);var r=Ir;if(r&&t){var a=s&&typeof s.as=="string"?s.as:"script",c='link[rel="modulepreload"][as="'+si(a)+'"][href="'+si(t)+'"]',u=c;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=Gr(t)}if(!ui.has(u)&&(t=y({rel:"modulepreload",href:t},s),ui.set(u,t),r.querySelector(c)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector($n(u)))return}a=r.createElement("link"),wt(a,"link",t),dt(a),r.head.appendChild(a)}}}function KS(t,s,r){Ji.S(t,s,r);var a=Ir;if(a&&t){var c=pr(a).hoistableStyles,u=Xr(t);s=s||"default";var g=c.get(u);if(!g){var v={loading:0,preload:null};if(g=a.querySelector(Yn(u)))v.loading=5;else{t=y({rel:"stylesheet",href:t,"data-precedence":s},r),(r=ui.get(u))&&kh(t,r);var w=g=a.createElement("link");dt(w),wt(w,"link",t),w._p=new Promise(function(B,N){w.onload=B,w.onerror=N}),w.addEventListener("load",function(){v.loading|=1}),w.addEventListener("error",function(){v.loading|=2}),v.loading|=4,Ta(g,s,a)}g={type:"stylesheet",instance:g,count:1,state:v},c.set(u,g)}}}function YS(t,s){Ji.X(t,s);var r=Ir;if(r&&t){var a=pr(r).hoistableScripts,c=Gr(t),u=a.get(c);u||(u=r.querySelector($n(c)),u||(t=y({src:t,async:!0},s),(s=ui.get(c))&&Eh(t,s),u=r.createElement("script"),dt(u),wt(u,"link",t),r.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(c,u))}}function $S(t,s){Ji.M(t,s);var r=Ir;if(r&&t){var a=pr(r).hoistableScripts,c=Gr(t),u=a.get(c);u||(u=r.querySelector($n(c)),u||(t=y({src:t,async:!0,type:"module"},s),(s=ui.get(c))&&Eh(t,s),u=r.createElement("script"),dt(u),wt(u,"link",t),r.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(c,u))}}function Kp(t,s,r,a){var c=(c=he.current)?Ea(c):null;if(!c)throw Error(l(446));switch(t){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(s=Xr(r.href),r=pr(c).hoistableStyles,a=r.get(s),a||(a={type:"style",instance:null,count:0,state:null},r.set(s,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){t=Xr(r.href);var u=pr(c).hoistableStyles,g=u.get(t);if(g||(c=c.ownerDocument||c,g={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(t,g),(u=c.querySelector(Yn(t)))&&!u._p&&(g.instance=u,g.state.loading=5),ui.has(t)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},ui.set(t,r),u||IS(c,t,r,g.state))),s&&a===null)throw Error(l(528,""));return g}if(s&&a!==null)throw Error(l(529,""));return null;case"script":return s=r.async,r=r.src,typeof r=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Gr(r),r=pr(c).hoistableScripts,a=r.get(s),a||(a={type:"script",instance:null,count:0,state:null},r.set(s,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,t))}}function Xr(t){return'href="'+si(t)+'"'}function Yn(t){return'link[rel="stylesheet"]['+t+"]"}function Yp(t){return y({},t,{"data-precedence":t.precedence,precedence:null})}function IS(t,s,r,a){t.querySelector('link[rel="preload"][as="style"]['+s+"]")?a.loading=1:(s=t.createElement("link"),a.preload=s,s.addEventListener("load",function(){return a.loading|=1}),s.addEventListener("error",function(){return a.loading|=2}),wt(s,"link",r),dt(s),t.head.appendChild(s))}function Gr(t){return'[src="'+si(t)+'"]'}function $n(t){return"script[async]"+t}function $p(t,s,r){if(s.count++,s.instance===null)switch(s.type){case"style":var a=t.querySelector('style[data-href~="'+si(r.href)+'"]');if(a)return s.instance=a,dt(a),a;var c=y({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return a=(t.ownerDocument||t).createElement("style"),dt(a),wt(a,"style",c),Ta(a,r.precedence,t),s.instance=a;case"stylesheet":c=Xr(r.href);var u=t.querySelector(Yn(c));if(u)return s.state.loading|=4,s.instance=u,dt(u),u;a=Yp(r),(c=ui.get(c))&&kh(a,c),u=(t.ownerDocument||t).createElement("link"),dt(u);var g=u;return g._p=new Promise(function(v,w){g.onload=v,g.onerror=w}),wt(u,"link",a),s.state.loading|=4,Ta(u,r.precedence,t),s.instance=u;case"script":return u=Gr(r.src),(c=t.querySelector($n(u)))?(s.instance=c,dt(c),c):(a=r,(c=ui.get(u))&&(a=y({},r),Eh(a,c)),t=t.ownerDocument||t,c=t.createElement("script"),dt(c),wt(c,"link",a),t.head.appendChild(c),s.instance=c);case"void":return null;default:throw Error(l(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(a=s.instance,s.state.loading|=4,Ta(a,r.precedence,t));return s.instance}function Ta(t,s,r){for(var a=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=a.length?a[a.length-1]:null,u=c,g=0;g<a.length;g++){var v=a[g];if(v.dataset.precedence===s)u=v;else if(u!==c)break}u?u.parentNode.insertBefore(t,u.nextSibling):(s=r.nodeType===9?r.head:r,s.insertBefore(t,s.firstChild))}function kh(t,s){t.crossOrigin==null&&(t.crossOrigin=s.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=s.referrerPolicy),t.title==null&&(t.title=s.title)}function Eh(t,s){t.crossOrigin==null&&(t.crossOrigin=s.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=s.referrerPolicy),t.integrity==null&&(t.integrity=s.integrity)}var Ra=null;function Ip(t,s,r){if(Ra===null){var a=new Map,c=Ra=new Map;c.set(r,a)}else c=Ra,a=c.get(r),a||(a=new Map,c.set(r,a));if(a.has(t))return a;for(a.set(t,null),r=r.getElementsByTagName(t),c=0;c<r.length;c++){var u=r[c];if(!(u[an]||u[St]||t==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var g=u.getAttribute(s)||"";g=t+g;var v=a.get(g);v?v.push(u):a.set(g,[u])}}return a}function Xp(t,s,r){t=t.ownerDocument||t,t.head.insertBefore(r,s==="title"?t.querySelector("head > title"):null)}function XS(t,s,r){if(r===1||s.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;return s.rel==="stylesheet"?(t=s.disabled,typeof s.precedence=="string"&&t==null):!0;case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function Gp(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function GS(t,s,r,a){if(r.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var c=Xr(a.href),u=s.querySelector(Yn(c));if(u){s=u._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(t.count++,t=Da.bind(t),s.then(t,t)),r.state.loading|=4,r.instance=u,dt(u);return}u=s.ownerDocument||s,a=Yp(a),(c=ui.get(c))&&kh(a,c),u=u.createElement("link"),dt(u);var g=u;g._p=new Promise(function(v,w){g.onload=v,g.onerror=w}),wt(u,"link",a),r.instance=u}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(r,s),(s=r.state.preload)&&(r.state.loading&3)===0&&(t.count++,r=Da.bind(t),s.addEventListener("load",r),s.addEventListener("error",r))}}var Th=0;function VS(t,s){return t.stylesheets&&t.count===0&&Ba(t,t.stylesheets),0<t.count||0<t.imgCount?function(r){var a=setTimeout(function(){if(t.stylesheets&&Ba(t,t.stylesheets),t.unsuspend){var u=t.unsuspend;t.unsuspend=null,u()}},6e4+s);0<t.imgBytes&&Th===0&&(Th=62500*DS());var c=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Ba(t,t.stylesheets),t.unsuspend)){var u=t.unsuspend;t.unsuspend=null,u()}},(t.imgBytes>Th?50:800)+s);return t.unsuspend=r,function(){t.unsuspend=null,clearTimeout(a),clearTimeout(c)}}:null}function Da(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ba(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Ma=null;function Ba(t,s){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Ma=new Map,s.forEach(FS,t),Ma=null,Da.call(t))}function FS(t,s){if(!(s.state.loading&4)){var r=Ma.get(t);if(r)var a=r.get(null);else{r=new Map,Ma.set(t,r);for(var c=t.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<c.length;u++){var g=c[u];(g.nodeName==="LINK"||g.getAttribute("media")!=="not all")&&(r.set(g.dataset.precedence,g),a=g)}a&&r.set(null,a)}c=s.instance,g=c.getAttribute("data-precedence"),u=r.get(g)||a,u===a&&r.set(null,c),r.set(g,c),this.count++,a=Da.bind(this),c.addEventListener("load",a),c.addEventListener("error",a),u?u.parentNode.insertBefore(c,u.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(c,t.firstChild)),s.state.loading|=4}}var In={$$typeof:$,Provider:null,Consumer:null,_currentValue:q,_currentValue2:q,_threadCount:0};function ZS(t,s,r,a,c,u,g,v,w){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=xo(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xo(0),this.hiddenUpdates=xo(null),this.identifierPrefix=a,this.onUncaughtError=c,this.onCaughtError=u,this.onRecoverableError=g,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=w,this.incompleteTransitions=new Map}function Vp(t,s,r,a,c,u,g,v,w,B,N,P){return t=new ZS(t,s,r,g,w,B,N,P,v),s=1,u===!0&&(s|=24),u=It(3,null,null,s),t.current=u,u.stateNode=t,s=lc(),s.refCount++,t.pooledCache=s,s.refCount++,u.memoizedState={element:a,isDehydrated:r,cache:s},hc(u),t}function Fp(t){return t?(t=kr,t):kr}function Zp(t,s,r,a,c,u){c=Fp(c),a.context===null?a.context=c:a.pendingContext=c,a=_s(s),a.payload={element:r},u=u===void 0?null:u,u!==null&&(a.callback=u),r=ps(t,a,s),r!==null&&(qt(r,t,s),Cn(r,t,s))}function Qp(t,s){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var r=t.retryLane;t.retryLane=r!==0&&r<s?r:s}}function Rh(t,s){Qp(t,s),(t=t.alternate)&&Qp(t,s)}function Jp(t){if(t.tag===13||t.tag===31){var s=Ps(t,67108864);s!==null&&qt(s,t,67108864),Rh(t,67108864)}}function eg(t){if(t.tag===13||t.tag===31){var s=Zt();s=wo(s);var r=Ps(t,s);r!==null&&qt(r,t,s),Rh(t,s)}}var Aa=!0;function QS(t,s,r,a){var c=T.T;T.T=null;var u=j.p;try{j.p=2,Dh(t,s,r,a)}finally{j.p=u,T.T=c}}function JS(t,s,r,a){var c=T.T;T.T=null;var u=j.p;try{j.p=8,Dh(t,s,r,a)}finally{j.p=u,T.T=c}}function Dh(t,s,r,a){if(Aa){var c=Mh(a);if(c===null)ph(t,s,a,za,r),ig(t,a);else if(ty(c,t,s,r,a))a.stopPropagation();else if(ig(t,a),s&4&&-1<ey.indexOf(t)){for(;c!==null;){var u=_r(c);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var g=Hs(u.pendingLanes);if(g!==0){var v=u;for(v.pendingLanes|=2,v.entangledLanes|=2;g;){var w=1<<31-Yt(g);v.entanglements[1]|=w,g&=~w}Ri(u),(Be&6)===0&&(pa=Pt()+500,qn(0))}}break;case 31:case 13:v=Ps(u,2),v!==null&&qt(v,u,2),ma(),Rh(u,2)}if(u=Mh(a),u===null&&ph(t,s,a,za,r),u===c)break;c=u}c!==null&&a.stopPropagation()}else ph(t,s,a,null,r)}}function Mh(t){return t=Ao(t),Bh(t)}var za=null;function Bh(t){if(za=null,t=fr(t),t!==null){var s=h(t);if(s===null)t=null;else{var r=s.tag;if(r===13){if(t=d(s),t!==null)return t;t=null}else if(r===31){if(t=_(s),t!==null)return t;t=null}else if(r===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;t=null}else s!==t&&(t=null)}}return za=t,null}function tg(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(Uv()){case od:return 2;case cd:return 8;case xl:case qv:return 32;case hd:return 268435456;default:return 32}default:return 32}}var Ah=!1,Es=null,Ts=null,Rs=null,Xn=new Map,Gn=new Map,Ds=[],ey="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 ig(t,s){switch(t){case"focusin":case"focusout":Es=null;break;case"dragenter":case"dragleave":Ts=null;break;case"mouseover":case"mouseout":Rs=null;break;case"pointerover":case"pointerout":Xn.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Gn.delete(s.pointerId)}}function Vn(t,s,r,a,c,u){return t===null||t.nativeEvent!==u?(t={blockedOn:s,domEventName:r,eventSystemFlags:a,nativeEvent:u,targetContainers:[c]},s!==null&&(s=_r(s),s!==null&&Jp(s)),t):(t.eventSystemFlags|=a,s=t.targetContainers,c!==null&&s.indexOf(c)===-1&&s.push(c),t)}function ty(t,s,r,a,c){switch(s){case"focusin":return Es=Vn(Es,t,s,r,a,c),!0;case"dragenter":return Ts=Vn(Ts,t,s,r,a,c),!0;case"mouseover":return Rs=Vn(Rs,t,s,r,a,c),!0;case"pointerover":var u=c.pointerId;return Xn.set(u,Vn(Xn.get(u)||null,t,s,r,a,c)),!0;case"gotpointercapture":return u=c.pointerId,Gn.set(u,Vn(Gn.get(u)||null,t,s,r,a,c)),!0}return!1}function sg(t){var s=fr(t.target);if(s!==null){var r=h(s);if(r!==null){if(s=r.tag,s===13){if(s=d(r),s!==null){t.blockedOn=s,gd(t.priority,function(){eg(r)});return}}else if(s===31){if(s=_(r),s!==null){t.blockedOn=s,gd(t.priority,function(){eg(r)});return}}else if(s===3&&r.stateNode.current.memoizedState.isDehydrated){t.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Oa(t){if(t.blockedOn!==null)return!1;for(var s=t.targetContainers;0<s.length;){var r=Mh(t.nativeEvent);if(r===null){r=t.nativeEvent;var a=new r.constructor(r.type,r);Bo=a,r.target.dispatchEvent(a),Bo=null}else return s=_r(r),s!==null&&Jp(s),t.blockedOn=r,!1;s.shift()}return!0}function rg(t,s,r){Oa(t)&&r.delete(s)}function iy(){Ah=!1,Es!==null&&Oa(Es)&&(Es=null),Ts!==null&&Oa(Ts)&&(Ts=null),Rs!==null&&Oa(Rs)&&(Rs=null),Xn.forEach(rg),Gn.forEach(rg)}function La(t,s){t.blockedOn===s&&(t.blockedOn=null,Ah||(Ah=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,iy)))}var Na=null;function ng(t){Na!==t&&(Na=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Na===t&&(Na=null);for(var s=0;s<t.length;s+=3){var r=t[s],a=t[s+1],c=t[s+2];if(typeof a!="function"){if(Bh(a||r)===null)continue;break}var u=_r(r);u!==null&&(t.splice(s,3),s-=3,Mc(u,{pending:!0,data:c,method:r.method,action:a},a,c))}}))}function Vr(t){function s(w){return La(w,t)}Es!==null&&La(Es,t),Ts!==null&&La(Ts,t),Rs!==null&&La(Rs,t),Xn.forEach(s),Gn.forEach(s);for(var r=0;r<Ds.length;r++){var a=Ds[r];a.blockedOn===t&&(a.blockedOn=null)}for(;0<Ds.length&&(r=Ds[0],r.blockedOn===null);)sg(r),r.blockedOn===null&&Ds.shift();if(r=(t.ownerDocument||t).$$reactFormReplay,r!=null)for(a=0;a<r.length;a+=3){var c=r[a],u=r[a+1],g=c[Ot]||null;if(typeof u=="function")g||ng(r);else if(g){var v=null;if(u&&u.hasAttribute("formAction")){if(c=u,g=u[Ot]||null)v=g.formAction;else if(Bh(c)!==null)continue}else v=g.action;typeof v=="function"?r[a+1]=v:(r.splice(a,3),a-=3),ng(r)}}}function lg(){function t(u){u.canIntercept&&u.info==="react-transition"&&u.intercept({handler:function(){return new Promise(function(g){return c=g})},focusReset:"manual",scroll:"manual"})}function s(){c!==null&&(c(),c=null),a||setTimeout(r,20)}function r(){if(!a&&!navigation.transition){var u=navigation.currentEntry;u&&u.url!=null&&navigation.navigate(u.url,{state:u.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,c=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(r,100),function(){a=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),c!==null&&(c(),c=null)}}}function zh(t){this._internalRoot=t}Ha.prototype.render=zh.prototype.render=function(t){var s=this._internalRoot;if(s===null)throw Error(l(409));var r=s.current,a=Zt();Zp(r,a,t,s,null,null)},Ha.prototype.unmount=zh.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var s=t.containerInfo;Zp(t.current,2,null,t,null,null),ma(),s[dr]=null}};function Ha(t){this._internalRoot=t}Ha.prototype.unstable_scheduleHydration=function(t){if(t){var s=pd();t={blockedOn:null,target:t,priority:s};for(var r=0;r<Ds.length&&s!==0&&s<Ds[r].priority;r++);Ds.splice(r,0,t),r===0&&sg(t)}};var ag=i.version;if(ag!=="19.2.4")throw Error(l(527,ag,"19.2.4"));j.findDOMNode=function(t){var s=t._reactInternals;if(s===void 0)throw typeof t.render=="function"?Error(l(188)):(t=Object.keys(t).join(","),Error(l(268,t)));return t=f(s),t=t!==null?S(t):null,t=t===null?null:t.stateNode,t};var sy={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:T,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ja=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ja.isDisabled&&ja.supportsFiber)try{rn=ja.inject(sy),Kt=ja}catch{}}return Zn.createRoot=function(t,s){if(!o(t))throw Error(l(299));var r=!1,a="",c=__,u=p_,g=g_;return s!=null&&(s.unstable_strictMode===!0&&(r=!0),s.identifierPrefix!==void 0&&(a=s.identifierPrefix),s.onUncaughtError!==void 0&&(c=s.onUncaughtError),s.onCaughtError!==void 0&&(u=s.onCaughtError),s.onRecoverableError!==void 0&&(g=s.onRecoverableError)),s=Vp(t,1,!1,null,null,r,a,null,c,u,g,lg),t[dr]=s.current,_h(t),new zh(s)},Zn.hydrateRoot=function(t,s,r){if(!o(t))throw Error(l(299));var a=!1,c="",u=__,g=p_,v=g_,w=null;return r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(c=r.identifierPrefix),r.onUncaughtError!==void 0&&(u=r.onUncaughtError),r.onCaughtError!==void 0&&(g=r.onCaughtError),r.onRecoverableError!==void 0&&(v=r.onRecoverableError),r.formState!==void 0&&(w=r.formState)),s=Vp(t,1,!0,s,r??null,a,c,w,u,g,v,lg),s.context=Fp(null),r=s.current,a=Zt(),a=wo(a),c=_s(a),c.callback=null,ps(r,c,a),r=a,s.current.lanes=r,ln(s,r),Ri(s),t[dr]=s.current,_h(t),new Ha(s)},Zn.version="19.2.4",Zn}var mg;function fy(){if(mg)return Nh.exports;mg=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(i){console.error(i)}}return e(),Nh.exports=dy(),Nh.exports}var _y=fy();const bm="claude-portal",vg="greenhouse-setup",py=10;function xm(){const e=localStorage.getItem(bm);if(e)try{return JSON.parse(e)}catch{}const i=localStorage.getItem(vg);if(i)try{const n=JSON.parse(i),l={recentProjects:n.projectDir?[n.projectDir]:[],checklist:{},jobHistory:{}};return wm(l),localStorage.removeItem(vg),l}catch{}return{recentProjects:[],checklist:{},jobHistory:{}}}function wm(e){localStorage.setItem(bm,JSON.stringify(e))}function Cm(){return xm().recentProjects}function gy(e){const i=xm();return i.recentProjects=[e,...i.recentProjects.filter(n=>n!==e)].slice(0,py),wm(i),i.recentProjects}const km=O.createContext(null);function my({children:e}){const[i,n]=O.useState(null),[l,o]=O.useState(Cm),[h,d]=O.useState(null),[_,p]=O.useState(null),[f,S]=O.useState(!1),[y,x]=O.useState(!0),[C,b]=O.useState("developer"),R=O.useCallback(se=>{n(se),o(gy(se)),d(null),p(null)},[]),L=O.useCallback(()=>{n(null),d(null),p(null),b("developer")},[]),X=O.useCallback((se,$)=>{d(se),p($)},[]);return m.jsx(km.Provider,{value:{path:i,recentProjects:l,gitBranch:h,gitRemote:_,terminalConnected:f,serverConnected:y,mode:C,setMode:b,setProjectPath:R,clearProject:L,setGitInfo:X,setTerminalConnected:S,setServerConnected:x},children:e})}function Mt(){const e=O.useContext(km);if(!e)throw new Error("useProject must be used within ProjectProvider");return e}const Em=O.createContext(null);function vy(e){return e.replace(/\x1b\[[?>=!]?[0-9;]*[a-zA-Z]/g,"").replace(/\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)/g,"").replace(/\x1b[()][0-9A-Z]/g,"").replace(/\x1b./g,"").replace(/\r/g,"")}function Sy({children:e}){const i=O.useRef(null),[n,l]=O.useState(!1),[o,h]=O.useState([]),d=O.useRef(!1),_=O.useRef(null),p=O.useRef(null),f=O.useRef(null),S=O.useRef(null),y=O.useRef(null),x=O.useRef(null),C=O.useRef(null),b=O.useCallback(Y=>{h(Q=>{const J=[...Q,Y];return J.length>100?J.slice(J.length-100):J})},[]),R=O.useCallback((Y,Q)=>{x.current=Y,C.current=Q},[]),L=O.useCallback(Y=>{const Q=i.current;Q?.readyState===WebSocket.OPEN&&Q.send(JSON.stringify({type:"input",data:Y}))},[]),X=O.useCallback(()=>{if(_.current){const Y=_.current;_.current=null,setTimeout(()=>L(Y+"\r"),300)}},[L]),se=O.useCallback(()=>{d.current||(d.current=!0,l(!0),f.current&&(clearTimeout(f.current),f.current=null),X())},[X]),$=O.useCallback(Y=>{d.current?L(Y+"\r"):_.current=Y},[L]),W=O.useCallback(Y=>{i.current&&i.current.close(),f.current&&(clearTimeout(f.current),f.current=null),d.current=!1,l(!1),p.current=null;const Q=location.protocol==="https:"?"wss:":"ws:",J=new WebSocket(`${Q}//${location.host}/terminal?cwd=${encodeURIComponent(Y)}`);return i.current=J,J.onopen=()=>{x.current?.(),setTimeout(()=>{L("claude --dangerously-skip-permissions\r"),p.current=Date.now()},500),f.current=setTimeout(se,15e3)},J.onmessage=Se=>{let Te;try{Te=JSON.parse(Se.data)}catch{return}if(Te.type==="output"){if(Te.data&&S.current?.(Te.data),!d.current&&p.current&&Date.now()-p.current>2e3){const de=vy(Te.data||"");(/>\s*$/.test(de)||de.includes("What can I help"))&&se()}}else Te.type==="exit"?y.current?.():Te.type==="error"&&S.current?.(`\r
|
|
10
|
+
[Error: ${Te.data||Te.message||"Unknown error"}]\r
|
|
11
|
+
`)},J.onclose=()=>C.current?.(),J},[L,se]);return m.jsx(Em.Provider,{value:{sendPrompt:$,isReady:n,connect:W,wsRef:i,onOutput:S,onExit:y,setConnectionCallbacks:R,outputLines:o,addOutputLine:b},children:e})}function en(){const e=O.useContext(Em);if(!e)throw new Error("useTerminal must be used within TerminalProvider");return e}async function pi(e,i){try{const n=await fetch(e,i);return n.ok?await n.json():null}catch{return null}}function Tm(e,i){const n=new URL(e,window.location.origin);return i&&n.searchParams.set("projectPath",i),n.toString()}const oo=[{key:"summarize",name:"Summarize",emoji:"📝",description:"Key points & themes",format:"md",category:"understand",prompt:`create a comprehensive summary covering:
|
|
12
|
+
- Key findings and themes
|
|
13
|
+
- Important data points and numbers
|
|
14
|
+
- Decisions and action items mentioned
|
|
15
|
+
- Any risks or concerns flagged`},{key:"extract",name:"Extract",emoji:"🔍",description:"Pull out specific data",format:"md",category:"understand",prompt:`extract:
|
|
16
|
+
- All action items and tasks (with owners if mentioned)
|
|
17
|
+
- Key dates and deadlines
|
|
18
|
+
- Important contact details
|
|
19
|
+
- Decision points and outcomes`},{key:"review",name:"Review",emoji:"✅",description:"Check for issues",format:"md",category:"understand",prompt:`review the documents for:
|
|
20
|
+
- Completeness and accuracy
|
|
21
|
+
- Compliance with standard practices
|
|
22
|
+
- Inconsistencies or errors
|
|
23
|
+
- Missing information or gaps
|
|
24
|
+
Provide specific findings with references to source documents.`},{key:"draft",name:"Draft",emoji:"📋",description:"Write a new document",format:"md",category:"create",prompt:`draft a new document based on the source material.
|
|
25
|
+
Synthesize the key information into a cohesive, well-structured document with an executive summary, key findings, detailed analysis, and recommendations.`},{key:"analyse",name:"Analyse",emoji:"📈",description:"Trends & recommendations",format:"md",category:"create",prompt:`analyse the documents and create a report covering:
|
|
26
|
+
- Recurring themes and patterns
|
|
27
|
+
- Trends over time (if dates are present)
|
|
28
|
+
- Outliers or anomalies
|
|
29
|
+
- Key insights, implications, and recommendations for next steps`},{key:"compare",name:"Compare",emoji:"⚖️",description:"Differences across docs",format:"md",category:"create",prompt:`create a comparison analysis.
|
|
30
|
+
Identify similarities, differences, contradictions, and gaps across the documents.
|
|
31
|
+
Present findings in a structured format with specific references.`},{key:"transform",name:"Transform",emoji:"🔄",description:"Change format or structure",format:"md",category:"create",prompt:`transform the content into a different format.
|
|
32
|
+
Restructure and reformat the information while preserving all key content. If extracting to a table or spreadsheet format, use CSV with the first row as column headers.`}],yy=[{key:"understand",label:"Understand",description:"Tell me what's in here"},{key:"create",label:"Create",description:"Make something from this"}],by=`IMPORTANT: Do NOT modify, move, rename, or delete any of the original files. Only create new files in the output/ directory.
|
|
33
|
+
If you cannot read a file, note it as skipped in the output with the filename and reason.`,xy="If the folder has more files than you can process in one pass, focus on the most relevant files based on their names and types, and note which files were not reviewed.";function wy(e){const{folderPath:i,templateKey:n,freeformText:l,context:o,fileCount:h}=e,d=n?oo.find(x=>x.key===n):null,_=d?.format||"md",p=new Date().toISOString().slice(0,10),f=d?.key||"output",S=`${i}/output/${f}-${p}.${_}`,y=[by,""];return h>50&&y.push(xy,""),d&&y.push(`Scan all documents in ${i} and ${d.prompt}`),l&&y.push(d?`
|
|
34
|
+
Also: ${l}`:`Scan all documents in ${i} and ${l}`),o&&y.push("",`Additional instructions: ${o}`),e.styleReference&&(y.push("","Use the following document as a style, tone, and format reference. Match its structure, headings, voice, and level of detail:"),y.push("---BEGIN STYLE REFERENCE---"),y.push(e.styleReference.slice(0,8e3)),y.push("---END STYLE REFERENCE---")),y.push("",`Save the output to ${S}`),y.join(`
|
|
35
|
+
`)}function Cy(e){const i=O.useRef(e);i.current=e;const n=O.useRef(null),l=O.useRef(null),o=O.useCallback(()=>{n.current?.close(),n.current=null,l.current&&(clearTimeout(l.current),l.current=null)},[]),h=O.useCallback((d,_)=>{o();const p=`/api/doc-events?folderPath=${encodeURIComponent(d)}`,f=new EventSource(p);n.current=f,f.addEventListener("output-created",S=>{i.current(JSON.parse(S.data)),o()}),l.current=setTimeout(()=>{o(),_()},600*1e3)},[o]);return O.useEffect(()=>o,[o]),{listen:h,close:o}}const Rm=O.createContext(null);function ky({children:e}){const[i,n]=O.useState(null),[l,o]=O.useState(null),[h,d]=O.useState(!1),[_,p]=O.useState(null),[f,S]=O.useState(""),[y,x]=O.useState(""),[C,b]=O.useState({status:"empty"}),[R,L]=O.useState(null),[X,se]=O.useState(!1),{sendPrompt:$}=en(),{path:W,mode:Y}=Mt(),Q=O.useCallback(async de=>{let G=await pi(`/api/read-output?path=${encodeURIComponent(de)}`);G||(G=await pi(`/api/read-file?path=${encodeURIComponent(de)}`)),G?(b({status:"complete",...G}),se(!1)):(b({status:"error",message:"Failed to load file"}),se(!1))},[]),J=Cy(de=>Q(de.path)),Se=O.useCallback(async de=>{n(de),d(!0);const G=await pi(`/api/folder-scan?folderPath=${encodeURIComponent(de)}`);o(G||null),d(!1)},[]);O.useEffect(()=>{Y==="document"&&W&&!i&&Se(W)},[Y,W,i,Se]);const Te=O.useCallback(()=>{n(null),o(null),b({status:"empty"}),se(!1),J.close()},[J]),zt=O.useCallback(async()=>{if(X||!i||!_&&!f.trim())return;if(se(!0),!(await fetch(`/api/ensure-output-dir?folderPath=${encodeURIComponent(i)}`,{method:"POST"})).ok){b({status:"error",message:"Failed to create output directory"}),se(!1);return}const G=l?.summary.total||0,I=wy({folderPath:i,templateKey:_||void 0,freeformText:f.trim()||void 0,context:y.trim()||void 0,styleReference:R||void 0,fileCount:G}),te=_?oo.find(Z=>Z.key===_)?.name||_:"Custom";b({status:"processing",outcome:te,fileCount:G}),J.listen(i,()=>{b({status:"error",message:"Timed out waiting for output. Check the terminal for details, or try again with fewer files."}),se(!1)}),$(I)},[X,i,_,f,y,R,l,$,J]);return m.jsx(Rm.Provider,{value:{folderPath:i,folderScan:l,scanLoading:h,scanFolder:Se,clearFolder:Te,selectedOutcome:_,setSelectedOutcome:p,freeformText:f,setFreeformText:S,contextText:y,setContextText:x,styleExampleContent:R,setStyleExampleContent:L,output:C,run:zt,loadOutput:Q,canRun:!!i&&(!!_||!!f.trim())&&!X,isRunning:X},children:e})}function ss(){const e=O.useContext(Rm);if(!e)throw new Error("useDocModeContext must be used within DocModeProvider");return e}function Ey(){const{path:e,setGitInfo:i}=Mt();O.useEffect(()=>{e&&pi(Tm("/api/project-info",e)).then(n=>{n&&i(n.gitBranch,n.gitRemote)})},[e,i])}function Ty({onAllReady:e,onNeedInstall:i}){const[n,l]=O.useState([]),[o,h]=O.useState(!0);O.useEffect(()=>{d()},[]);async function d(){h(!0);const _=await pi("/api/detect");_&&(l(_.tools),_.tools.filter(f=>f.required&&!f.installed).length===0?setTimeout(e,600):i(_.tools)),h(!1)}return m.jsxs("div",{className:"text-center",children:[m.jsx("h2",{className:"text-2xl font-bold text-[var(--text-primary)] mb-3",children:"Getting things ready..."}),m.jsx("p",{className:"text-[var(--text-secondary)] text-base mb-10",children:"Checking what's installed on your machine"}),o?m.jsxs("div",{className:"flex items-center justify-center gap-4 text-[var(--text-secondary)] text-base",children:[m.jsx("div",{className:"w-6 h-6 border-2 border-[#5e17eb]/30 border-t-[#5e17eb] rounded-full animate-spin"}),m.jsx("span",{children:"Scanning..."})]}):m.jsx("div",{className:"space-y-3 text-left",children:n.map(_=>m.jsxs("div",{className:"flex items-center gap-5 px-6 py-5 bg-[var(--bg-secondary)] rounded-2xl border border-[var(--border)]",style:{boxShadow:"0 4px 12px rgba(0,0,0,0.06)"},children:[m.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center text-base font-bold ${_.installed?"bg-[#30d158]/15 text-[#30d158]":"bg-[#ff453a]/15 text-[#ff453a]"}`,children:_.installed?"✓":"✗"}),m.jsx("span",{className:"text-[var(--text-primary)] text-lg font-semibold",children:_.name}),_.version&&m.jsx("span",{className:"text-[var(--text-secondary)] text-sm font-mono ml-auto",children:_.version})]},_.name))})]})}function Ry({tools:e,onDone:i}){const[n,l]=O.useState(null),[o,h]=O.useState(()=>{const f={};for(const S of e)f[S.id]=S.installed?"done":"pending";return f}),d=e.filter(f=>!f.installed&&f.required);async function _(f){l(f),h(S=>({...S,[f]:"installing"}));try{const y=(await fetch(`/api/install/${encodeURIComponent(f)}`,{method:"POST"})).body?.getReader(),x=new TextDecoder;let C=!1;if(y){let b="";for(;;){const{done:R,value:L}=await y.read();if(R)break;b+=x.decode(L,{stream:!0});const X=b.split(`
|
|
36
|
+
`);b=X.pop()??"";for(const se of X)if(se.startsWith("data: "))try{const $=JSON.parse(se.slice(6));$.tool===f&&$.status==="done"&&(C=!0),$.tool===f&&$.status==="error"&&(C=!1)}catch{}}}h(b=>({...b,[f]:C?"done":"error"}))}catch{h(S=>({...S,[f]:"error"}))}l(null)}const p=d.every(f=>o[f.id]==="done");return m.jsxs("div",{className:"space-y-4",children:[m.jsx("h2",{style:{fontSize:"20px",fontWeight:600,color:"var(--text-primary)"},children:"Install missing tools"}),m.jsx("div",{className:"space-y-2",children:d.map(f=>m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"16px 20px",background:"var(--bg-secondary)",border:"1px solid var(--border)",borderRadius:"12px",boxShadow:"0 2px 8px rgba(0,0,0,0.04)"},children:[m.jsx("span",{style:{color:o[f.id]==="done"?"#22c55e":o[f.id]==="error"?"#ef4444":o[f.id]==="installing"?"#f59e0b":"#9ca3af",fontSize:"16px"},children:o[f.id]==="done"?"✓":o[f.id]==="error"?"✗":o[f.id]==="installing"?"⏳":"○"}),m.jsx("span",{style:{color:"var(--text-primary)",flex:1,fontSize:"15px",fontWeight:500},children:f.name}),(o[f.id]==="pending"||o[f.id]==="error")&&m.jsx("button",{onClick:()=>_(f.id),disabled:n!==null,style:{padding:"8px 16px",background:"#22c55e",color:"#fff",fontSize:"13px",fontWeight:600,borderRadius:"8px",border:"none",cursor:"pointer",opacity:n?.5:1},children:o[f.id]==="error"?"Retry":"Install"})]},f.id))}),p&&m.jsx("button",{onClick:i,style:{width:"100%",padding:"16px",background:"linear-gradient(135deg, #5e17eb, #8b5cf6)",color:"#fff",borderRadius:"12px",fontSize:"16px",fontWeight:700,border:"none",cursor:"pointer",boxShadow:"0 4px 12px rgba(94,23,235,0.3)"},children:"Continue →"})]})}function Dy({onProjectSelected:e,mode:i="developer"}){const n=i==="document",[l,o]=O.useState(n?"open":"choose"),[h,d]=O.useState(""),[_,p]=O.useState(!1),[f,S]=O.useState(""),[y,x]=O.useState(""),[C,b]=O.useState(null),[R,L]=O.useState(!1),X=Cm();async function se(){if(!f.trim())return;L(!0),b(null);const Y=await pi("/api/scaffold",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectName:f.trim()})});Y?.projectDir?e(Y.projectDir):b("Failed to create project"),L(!1)}async function $(){if(!y.trim())return;L(!0),b(null);const Y=await pi("/api/scaffold",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectName:y.trim().split("/").pop()?.replace(/\.git$/,"")||"cloned-repo"})});Y?.projectDir?e(Y.projectDir):b("Failed to clone repository"),L(!1)}const W={padding:"36px",background:"var(--bg-secondary)",borderRadius:"24px",textAlign:"center",border:"1px solid var(--border)",boxShadow:"0 8px 24px rgba(0,0,0,0.08)",cursor:"pointer",transition:"all 0.3s ease"};return l==="choose"?m.jsxs("div",{className:"animate-in",children:[m.jsx("h2",{style:{fontSize:"28px",fontWeight:700,color:"var(--text-primary)",marginBottom:"8px",textAlign:"center"},children:"Choose a folder"}),m.jsx("p",{style:{color:"var(--text-secondary)",fontSize:"17px",marginBottom:"48px",textAlign:"center"},children:"Where would you like to work?"}),X.length>0&&m.jsxs("div",{style:{marginBottom:"48px"},children:[m.jsx("p",{style:{fontSize:"13px",color:"var(--text-secondary)",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:"16px"},children:"Recent"}),m.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:X.map(Y=>m.jsx("button",{onClick:()=>e(Y),className:"transition-all duration-300 hover:-translate-y-0.5 active:scale-[0.98]",style:{width:"100%",textAlign:"left",padding:"20px 24px",background:"var(--bg-secondary)",borderRadius:"16px",color:"var(--text-primary)",fontSize:"15px",fontFamily:"'SF Mono', Menlo, monospace",border:"1px solid var(--border)",boxShadow:"0 4px 12px rgba(0,0,0,0.06)",cursor:"pointer",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Y},Y))})]}),m.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:"20px"},children:[m.jsxs("button",{onClick:async()=>{p(!0);const Y=await pi("/api/pick-folder");p(!1),Y?.path&&e(Y.path)},disabled:_,className:"transition-all duration-300 hover:-translate-y-1 active:scale-[0.97]",style:W,children:[m.jsx("div",{style:{fontSize:"44px",marginBottom:"16px"},children:_?"⏳":"📂"}),m.jsx("div",{style:{color:"var(--text-primary)",fontSize:"16px",fontWeight:700,marginBottom:"6px"},children:_?"Choosing...":"Open existing"}),m.jsx("div",{style:{color:"var(--text-secondary)",fontSize:"14px"},children:"Browse in Finder"})]}),[{m:"create",icon:"✨",label:"Create new",desc:"Start from scratch"},{m:"clone",icon:"📦",label:"Clone repo",desc:"From GitHub"}].map(({m:Y,icon:Q,label:J,desc:Se})=>m.jsxs("button",{onClick:()=>o(Y),className:"transition-all duration-300 hover:-translate-y-1 active:scale-[0.97]",style:W,children:[m.jsx("div",{style:{fontSize:"44px",marginBottom:"16px"},children:Q}),m.jsx("div",{style:{color:"var(--text-primary)",fontSize:"16px",fontWeight:700,marginBottom:"6px"},children:J}),m.jsx("div",{style:{color:"var(--text-secondary)",fontSize:"14px"},children:Se})]},Y))]}),m.jsx("div",{style:{marginTop:"28px",textAlign:"center"},children:m.jsx("button",{onClick:()=>o("open"),className:"transition-colors",style:{color:"var(--text-secondary)",fontSize:"14px",background:"none",border:"none",cursor:"pointer"},children:"Or enter a path manually →"})})]}):m.jsxs("div",{className:"animate-in",children:[!n&&m.jsx("button",{onClick:()=>o("choose"),className:"text-[var(--text-secondary)] text-base hover:text-[var(--text-primary)] transition-colors mb-8 block",children:"← Back"}),l==="open"&&m.jsxs("div",{children:[m.jsx("h2",{style:{fontSize:"28px",fontWeight:700,color:"var(--text-primary)",marginBottom:"8px"},children:n?"What folder can Claude find your work?":"Open existing project"}),m.jsx("p",{style:{color:"var(--text-secondary)",fontSize:"17px",marginBottom:"40px"},children:n?"Browse to the folder with your documents.":"Enter the path to your project."}),n?m.jsx("button",{onClick:async()=>{p(!0);const Y=await pi("/api/pick-folder");p(!1),Y?.path&&e(Y.path)},disabled:_,className:"w-full hover:-translate-y-0.5 transition-all active:scale-[0.98]",style:{padding:"20px",background:"linear-gradient(135deg, #5e17eb, #8b5cf6)",color:"white",borderRadius:"16px",fontSize:"18px",fontWeight:700,border:"none",cursor:"pointer",boxShadow:"0 4px 12px rgba(94,23,235,0.3)",marginBottom:"40px"},children:_?"⏳ Choosing...":"📂 Browse for folder"}):m.jsxs(m.Fragment,{children:[m.jsx("input",{type:"text",value:h,onChange:Y=>d(Y.target.value),placeholder:"/path/to/your/project",autoFocus:!0,className:"w-full focus:outline-none transition-all",style:{padding:"20px 24px",background:"var(--bg-secondary)",border:"1px solid var(--border)",borderRadius:"16px",color:"var(--text-primary)",fontFamily:"'SF Mono', Menlo, monospace",fontSize:"15px",boxShadow:"0 4px 12px rgba(0,0,0,0.06)",marginBottom:"16px"}}),m.jsx("button",{onClick:()=>h.trim()&&e(h.trim()),disabled:!h.trim(),className:"w-full hover:-translate-y-0.5 disabled:opacity-30 transition-all active:scale-[0.98]",style:{padding:"20px",background:"linear-gradient(135deg, #5e17eb, #8b5cf6)",color:"white",borderRadius:"16px",fontSize:"18px",fontWeight:700,border:"none",cursor:"pointer",boxShadow:"0 4px 12px rgba(94,23,235,0.3)",marginBottom:"40px"},children:"Open project"})]}),n&&X.length>0&&m.jsxs("div",{style:{marginTop:n?"0":"40px"},children:[m.jsx("p",{style:{fontSize:"13px",color:"var(--text-secondary)",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:"16px"},children:"Recent"}),m.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:X.map(Y=>m.jsx("button",{onClick:()=>e(Y),className:"transition-all duration-200 hover:-translate-y-0.5 active:scale-[0.98]",style:{width:"100%",textAlign:"left",padding:"20px 24px",background:"var(--bg-secondary)",borderRadius:"16px",color:"var(--text-primary)",fontSize:"15px",fontFamily:"'SF Mono', Menlo, monospace",border:"1px solid var(--border)",cursor:"pointer",boxShadow:"0 4px 12px rgba(0,0,0,0.06)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Y},Y))})]})]}),l==="create"&&m.jsxs("div",{className:"space-y-6",children:[m.jsx("h2",{className:"text-2xl font-bold text-[var(--text-primary)]",children:"Create new project"}),m.jsx("input",{type:"text",value:f,onChange:Y=>S(Y.target.value),placeholder:"my-app",autoFocus:!0,className:"w-full px-6 py-5 bg-[var(--bg-secondary)] border border-[var(--border)] rounded-xl text-[var(--text-primary)] font-mono text-base placeholder:text-[#86868b] focus:outline-none focus:border-[#5e17eb]/50 focus:ring-2 focus:ring-[#5e17eb]/10 transition-all",style:{boxShadow:"0 4px 12px rgba(0,0,0,0.06)"}}),m.jsx("button",{onClick:se,disabled:!f.trim()||R,className:"w-full py-5 bg-gradient-to-r from-[#5e17eb] to-[#8b5cf6] text-white rounded-xl text-lg font-bold hover:-translate-y-0.5 disabled:opacity-30 transition-all active:scale-[0.98]",style:{boxShadow:"0 4px 12px rgba(94,23,235,0.3)"},children:R?"Creating...":"Create project"})]}),l==="clone"&&m.jsxs("div",{className:"space-y-6",children:[m.jsx("h2",{className:"text-2xl font-bold text-[var(--text-primary)]",children:"Clone from GitHub"}),m.jsx("input",{type:"text",value:y,onChange:Y=>x(Y.target.value),placeholder:"https://github.com/user/repo",autoFocus:!0,className:"w-full px-6 py-5 bg-[var(--bg-secondary)] border border-[var(--border)] rounded-xl text-[var(--text-primary)] font-mono text-base placeholder:text-[#86868b] focus:outline-none focus:border-[#5e17eb]/50 focus:ring-2 focus:ring-[#5e17eb]/10 transition-all",style:{boxShadow:"0 4px 12px rgba(0,0,0,0.06)"}}),m.jsx("button",{onClick:$,disabled:!y.trim()||R,className:"w-full py-5 bg-gradient-to-r from-[#5e17eb] to-[#8b5cf6] text-white rounded-xl text-lg font-bold hover:-translate-y-0.5 disabled:opacity-30 transition-all active:scale-[0.98]",style:{boxShadow:"0 4px 12px rgba(94,23,235,0.3)"},children:R?"Cloning...":"Clone repository"})]}),C&&m.jsx("p",{className:"text-[#ff453a] text-base bg-[#ff453a]/10 px-6 py-4 rounded-xl mt-6",children:C})]})}const qh=[{type:"image-text",title:"Most people:",content:"See a terminal and think...",imageUrl:"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExMG0wamx1NWUwOGcxN2F6ejBva3p3OW5peG5qdWlrcjI1d3JyM2l0dyZlcD12MV9naWZzX3NlYXJjaCZjdD1n/NRXleEopnqL3a/giphy.gif"},{type:"text",title:"What is a terminal?",content:"Terminal = using our computer without the mouse"},{type:"text",title:"The magic of Claude Code",content:`Once we set it up, we're no longer actually talking directly to our computer.
|
|
37
|
+
|
|
38
|
+
We're talking to Claude.
|
|
39
|
+
|
|
40
|
+
Who then takes action on our computer.`},{type:"text",title:"What's the advantage?",content:`1. Speed — rather than you manually searching or doing things, it can do it for you
|
|
41
|
+
|
|
42
|
+
2. You don't need to repeat yourself — it can access relevant knowledge documents and immediately understand + execute`},{type:"diagram",title:"Remember: AI is the middle",content:"The better the input, the better the output."},{type:"text",title:"The problem with AI in a browser",content:`You need to remind it of the context every time you input.
|
|
43
|
+
|
|
44
|
+
That's slow and repetitive.`},{type:"text",title:"The Claude Code advantage",content:`Using Claude Code, it can immediately access the relevant input from the folder.
|
|
45
|
+
|
|
46
|
+
Better inputs = Better outputs.
|
|
47
|
+
|
|
48
|
+
Claude Code enables you to provide better inputs faster by accessing the folder with your work.`}];function Dm({onClose:e}){const[i,n]=O.useState(0),l=qh[i],o=i===qh.length-1;return m.jsxs("div",{style:{position:"fixed",inset:0,zIndex:1e3,background:"rgba(0,0,0,0.7)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",animation:"fadeIn 0.3s ease"},onClick:e,children:[m.jsxs("div",{style:{width:"90%",maxWidth:"800px",maxHeight:"85vh",background:"#f5f5f5",borderRadius:"24px",overflow:"hidden",position:"relative",boxShadow:"0 24px 64px rgba(0,0,0,0.3)"},onClick:h=>h.stopPropagation(),children:[m.jsx("button",{onClick:e,style:{position:"absolute",top:"16px",right:"16px",zIndex:10,width:"36px",height:"36px",borderRadius:"50%",background:"rgba(0,0,0,0.08)",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"18px",color:"#666",transition:"background 0.15s"},children:"✕"}),m.jsxs("div",{style:{padding:"60px 48px 40px",minHeight:"420px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"},children:[l.type==="image-text"&&m.jsxs(m.Fragment,{children:[m.jsx("h2",{style:{fontSize:"32px",fontWeight:800,color:"#212529",marginBottom:"32px"},children:l.title}),m.jsxs("div",{style:{display:"flex",gap:"24px",alignItems:"center",justifyContent:"center",flexWrap:"wrap"},children:[m.jsx("div",{style:{width:"280px",height:"200px",background:"#1a1a2e",borderRadius:"12px",display:"flex",alignItems:"flex-start",padding:"16px",fontFamily:"'SF Mono', Menlo, monospace",fontSize:"12px",color:"#888",boxShadow:"0 8px 24px rgba(0,0,0,0.15)"},children:m.jsxs("div",{children:[m.jsx("div",{style:{color:"#666",marginBottom:"4px"},children:"Last login: Mon Mar 9"}),m.jsxs("div",{style:{color:"#888"},children:["nichurrell ~ %",m.jsx("span",{style:{animation:"blink 1s infinite"},children:"▋"})]})]})}),m.jsx("img",{src:l.imageUrl,alt:"Reaction",style:{width:"240px",borderRadius:"12px",boxShadow:"0 8px 24px rgba(0,0,0,0.15)"}})]})]}),l.type==="text"&&m.jsxs(m.Fragment,{children:[m.jsx("h2",{style:{fontSize:"28px",fontWeight:800,color:"#212529",marginBottom:"28px"},children:l.title}),m.jsx("p",{style:{fontSize:"22px",fontWeight:700,color:"#212529",lineHeight:1.6,maxWidth:"600px",whiteSpace:"pre-line"},children:l.content})]}),l.type==="diagram"&&m.jsxs(m.Fragment,{children:[m.jsx("h2",{style:{fontSize:"28px",fontWeight:800,color:"#212529",marginBottom:"32px",fontStyle:"italic"},children:l.title}),m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"16px",marginBottom:"32px"},children:[m.jsx("div",{style:{width:"100px",height:"100px",borderRadius:"50%",border:"4px solid #212529",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"18px",fontWeight:800,color:"#212529"},children:"START"}),m.jsx("span",{style:{fontSize:"28px",color:"#212529"},children:"→"}),m.jsx("div",{style:{width:"120px",height:"80px",borderRadius:"12px",border:"4px solid #212529",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"24px",fontWeight:800,color:"#212529",background:"rgba(94,23,235,0.05)"},children:"AI"}),m.jsx("span",{style:{fontSize:"28px",color:"#212529"},children:"→"}),m.jsx("div",{style:{width:"100px",height:"100px",borderRadius:"50%",border:"4px solid #212529",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"18px",fontWeight:800,color:"#212529"},children:"END"})]}),m.jsx("p",{style:{fontSize:"22px",fontWeight:700,color:"#212529"},children:l.content})]})]}),m.jsxs("div",{style:{padding:"20px 48px 32px",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[m.jsx("div",{style:{display:"flex",gap:"8px"},children:qh.map((h,d)=>m.jsx("button",{onClick:()=>n(d),style:{width:d===i?"24px":"8px",height:"8px",borderRadius:"4px",border:"none",cursor:"pointer",background:d===i?"#5e17eb":"#ddd",transition:"all 0.3s"}},d))}),m.jsxs("div",{style:{display:"flex",gap:"12px"},children:[i>0&&m.jsx("button",{onClick:()=>n(i-1),style:{padding:"12px 24px",borderRadius:"12px",background:"white",border:"1px solid #e9ecef",fontSize:"15px",fontWeight:600,color:"#495057",cursor:"pointer",transition:"all 0.2s"},children:"← Back"}),m.jsx("button",{onClick:()=>o?e():n(i+1),style:{padding:"12px 32px",borderRadius:"12px",background:o?"linear-gradient(135deg, #5e17eb, #8b5cf6)":"#212529",border:"none",fontSize:"15px",fontWeight:600,color:"white",cursor:"pointer",transition:"all 0.2s",boxShadow:o?"0 4px 12px rgba(94,23,235,0.3)":"none"},children:o?"Let's go! →":"Next →"})]})]})]}),m.jsx("style",{children:`
|
|
49
|
+
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
|
|
50
|
+
`})]})}function My({onProjectSelected:e}){const[i,n]=O.useState("detect"),[l,o]=O.useState([]),[h,d]=O.useState(!1),{setMode:_}=Mt(),[p,f]=O.useState("developer");function S(y){f(y),_(y),n("project")}return m.jsxs(m.Fragment,{children:[h&&m.jsx(Dm,{onClose:()=>d(!1)}),m.jsx("div",{className:"h-full flex items-center justify-center",style:{background:"var(--bg-primary)"},children:m.jsxs("div",{className:"w-full max-w-[600px] px-8 animate-in",children:[m.jsxs("div",{style:{marginBottom:"80px",textAlign:"center"},children:[m.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:"16px",marginBottom:"12px"},children:[m.jsx("div",{style:{width:"48px",height:"48px",borderRadius:"14px",background:"linear-gradient(135deg, #5e17eb, #8b5cf6)",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 4px 12px rgba(94,23,235,0.3)"},children:m.jsx("span",{style:{color:"white",fontSize:"24px",fontWeight:700},children:"C"})}),m.jsx("h1",{style:{fontSize:"40px",fontWeight:800,color:"var(--text-primary)",letterSpacing:"-0.02em"},children:"Claude Portal"})]}),m.jsx("p",{style:{color:"var(--text-secondary)",fontSize:"20px"},children:"Get more done with AI"})]}),i==="detect"&&m.jsx(Ty,{onAllReady:()=>n("mode"),onNeedInstall:y=>{o(y),n("install")}}),i==="install"&&m.jsx(Ry,{tools:l,onDone:()=>n("mode")}),i==="mode"&&m.jsxs("div",{className:"animate-in",children:[m.jsx("div",{style:{textAlign:"center",marginBottom:"40px"},children:m.jsx("button",{onClick:()=>d(!0),style:{padding:"14px 28px",borderRadius:"14px",background:"linear-gradient(135deg, rgba(94,23,235,0.08), rgba(139,92,246,0.08))",border:"1px solid rgba(94,23,235,0.2)",color:"#8b5cf6",fontSize:"15px",fontWeight:600,cursor:"pointer",transition:"all 0.2s",display:"inline-flex",alignItems:"center",gap:"8px"},children:"▶ How it works"})}),m.jsx("h2",{style:{fontSize:"28px",fontWeight:700,color:"var(--text-primary)",marginBottom:"8px",textAlign:"center"},children:"How can we help?"}),m.jsx("p",{style:{color:"var(--text-secondary)",fontSize:"17px",marginBottom:"48px",textAlign:"center"},children:"Choose how you'd like to work today"}),m.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"24px"},children:[m.jsx("button",{onClick:()=>S("developer"),className:"group transition-all duration-300 hover:-translate-y-1 active:scale-[0.98]",style:{width:"100%",padding:"40px",background:"var(--bg-secondary)",borderRadius:"24px",textAlign:"left",border:"1px solid var(--border)",boxShadow:"0 8px 24px rgba(0,0,0,0.08)",cursor:"pointer"},children:m.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"24px"},children:[m.jsx("div",{style:{width:"64px",height:"64px",borderRadius:"16px",background:"linear-gradient(135deg, #5e17eb, #8b5cf6)",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 4px 12px rgba(94,23,235,0.3)",flexShrink:0,fontSize:"32px"},children:"🔨"}),m.jsxs("div",{children:[m.jsx("div",{style:{color:"var(--text-primary)",fontSize:"22px",fontWeight:700,marginBottom:"8px"},children:"Build or improve a project"}),m.jsx("div",{style:{color:"var(--text-secondary)",fontSize:"16px",lineHeight:1.6},children:"Create new features, fix bugs, and get guided checklists to ship with confidence."})]})]})}),m.jsx("button",{onClick:()=>S("document"),className:"group transition-all duration-300 hover:-translate-y-1 active:scale-[0.98]",style:{width:"100%",padding:"40px",background:"var(--bg-secondary)",borderRadius:"24px",textAlign:"left",border:"1px solid var(--border)",boxShadow:"0 8px 24px rgba(0,0,0,0.08)",cursor:"pointer"},children:m.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"24px"},children:[m.jsx("div",{style:{width:"64px",height:"64px",borderRadius:"16px",background:"linear-gradient(135deg, #ffdd27, #ffc107)",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 4px 12px rgba(255,221,39,0.3)",flexShrink:0,fontSize:"32px"},children:"📄"}),m.jsxs("div",{children:[m.jsx("div",{style:{color:"var(--text-primary)",fontSize:"22px",fontWeight:700,marginBottom:"8px"},children:"Make your work faster"}),m.jsx("div",{style:{color:"var(--text-secondary)",fontSize:"16px",lineHeight:1.6},children:"Point AI at your documents and get summaries, reports, and analysis — no coding needed."})]})]})})]})]}),i==="project"&&m.jsx(Dy,{onProjectSelected:e,mode:p})]})})]})}function By(){const{path:e,gitBranch:i,terminalConnected:n,clearProject:l,mode:o,setMode:h}=Mt(),d=o==="document",_=p=>({padding:"10px 20px",borderRadius:"10px",fontSize:"14px",fontWeight:500,border:"none",cursor:"pointer",transition:"all 0.2s",background:p?"white":"transparent",color:p?o==="document"?"#5856d6":"#1d1d1f":"#86868b",boxShadow:p?"0 1px 3px rgba(0,0,0,0.1)":"none"});return m.jsxs("div",{style:{height:"56px",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 24px",borderBottom:"1px solid #e5e7eb",background:"rgba(255,255,255,0.9)",backdropFilter:"blur(20px)",flexShrink:0,transition:"background 0.2s, border-color 0.2s"},children:[m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"16px"},children:[d?m.jsx("div",{style:{width:"32px",height:"32px",borderRadius:"10px",background:"linear-gradient(135deg, #5856d6, #af52de)",display:"flex",alignItems:"center",justifyContent:"center",color:"white",fontSize:"15px",fontWeight:700},children:"C"}):m.jsx("div",{style:{width:"12px",height:"12px",borderRadius:"50%",background:"#30d158",boxShadow:"0 0 10px rgba(48,209,88,0.4)"}}),m.jsx("span",{style:{fontFamily:"'SF Mono', Menlo, monospace",fontSize:"13px",color:"#86868b",maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e?.split("/").filter(Boolean).pop()||e})]}),m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"20px"},children:[m.jsxs("div",{style:{display:"flex",borderRadius:"12px",padding:"3px",gap:"2px",background:d?"rgba(0,0,0,0.04)":"rgba(255,255,255,0.06)"},children:[m.jsx("button",{onClick:()=>h("developer"),style:_(o==="developer"),children:"🔨 Build"}),m.jsx("button",{onClick:()=>h("document"),style:_(o==="document"),children:"📄 Documents"})]}),i&&m.jsx("span",{style:{fontSize:"12px",fontFamily:"'SF Mono', Menlo, monospace",color:"#86868b"},children:i}),m.jsx("div",{style:{width:"10px",height:"10px",borderRadius:"50%",background:n?"#30d158":"#ff453a",boxShadow:n?"0 0 6px rgba(48,209,88,0.4)":"none"}}),m.jsx("button",{onClick:l,style:{padding:"8px 16px",borderRadius:"8px",fontSize:"14px",fontWeight:500,border:"none",cursor:"pointer",color:"#86868b",background:"transparent",transition:"all 0.2s"},className:d?"hover:bg-black/[0.04]":"hover:bg-white/[0.06]",children:"Switch"})]})]})}function Ay(){const{serverConnected:e}=Mt();return e?null:m.jsxs("div",{className:"px-4 py-2 bg-red-500/10 border-b border-red-500/20 text-red-400 text-sm text-center shrink-0",children:["Server connection lost. Restart with ",m.jsx("code",{className:"mx-1 font-mono",children:"npm run dev"})]})}function zy({open:e,onToggle:i}){const{mode:n}=Mt(),l=n==="document";return m.jsx("div",{style:{width:"52px",display:"flex",flexDirection:"column",alignItems:"center",paddingTop:"20px",borderRight:"1px solid #e5e7eb",background:"#fafafa",flexShrink:0,transition:"background 0.2s"},children:m.jsx("button",{onClick:i,title:"Toggle sidebar",style:{width:"36px",height:"36px",borderRadius:"10px",display:"flex",alignItems:"center",justifyContent:"center",border:"none",cursor:"pointer",transition:"all 0.2s",background:e?l?"rgba(88,86,214,0.1)":"rgba(48,209,88,0.1)":"transparent",color:e?l?"#5856d6":"#30d158":"#86868b"},className:"active:scale-90",children:m.jsx("svg",{width:"18",height:"18",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",children:m.jsx("path",{d:"M2 4h12M2 8h12M2 12h12"})})})})}function Oy(e){const{path:i,setServerConnected:n}=Mt(),l=O.useRef(e);l.current=e;const o=O.useRef(new Map),h=O.useCallback((d,_)=>{const p=o.current.get(d);p&&clearTimeout(p),o.current.set(d,setTimeout(()=>{l.current(d,_),o.current.delete(d)},400))},[]);O.useEffect(()=>{if(!i)return;const d=`/api/events?projectPath=${encodeURIComponent(i)}`,_=new EventSource(d);return _.addEventListener("health-changed",p=>h("health-changed",JSON.parse(p.data))),_.addEventListener("plan-changed",p=>h("plan-changed",JSON.parse(p.data))),_.addEventListener("push-detected",p=>h("push-detected",JSON.parse(p.data))),_.onopen=()=>n(!0),_.onerror=()=>n(!1),()=>{_.close();for(const p of o.current.values())clearTimeout(p);o.current.clear()}},[i,h,n])}function Ly(){const{path:e}=Mt(),[i,n]=O.useState([]),[l,o]=O.useState(!1),h=O.useCallback(async()=>{if(!e)return;o(!0);const d=await pi(Tm("/api/health-scan",e));d&&n(d.checks),o(!1)},[e]);return O.useEffect(()=>{h()},[h]),Oy(d=>{d==="health-changed"&&h()}),{checks:i,loading:l,failCount:i.filter(d=>d.status==="fail").length,passCount:i.filter(d=>d.status==="pass").length,rescan:h}}function Ny({label:e,description:i,status:n,fixPrompt:l}){const{sendPrompt:o}=en(),[h,d]=O.useState(!1);if(n==="pass")return null;const _=()=>{!l||h||(o(l),d(!0),setTimeout(()=>d(!1),3e3))};return m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"10px 16px",borderRadius:"8px",transition:"background 0.15s"},children:[m.jsx("div",{style:{width:"8px",height:"8px",borderRadius:"50%",background:"#f59e0b",flexShrink:0}}),m.jsxs("div",{style:{flex:1},children:[m.jsxs("div",{style:{fontSize:"13px",color:"#374151"},children:[e," missing"]}),i&&m.jsx("div",{style:{fontSize:"11px",color:"#9ca3af",marginTop:"1px"},children:i})]}),l&&m.jsx("button",{onClick:_,style:{padding:"6px 14px",background:"#dcfce7",color:"#16a34a",fontSize:"12px",borderRadius:"8px",fontWeight:600,border:h?"1px solid #86efac":"none",cursor:h?"default":"pointer",flexShrink:0,transition:"all 0.15s"},children:h?"✓ Sent":"Fix →"})]})}function Hy(){const{checks:e,loading:i,failCount:n,passCount:l}=Ly(),[o,h]=O.useState(!1);return m.jsxs("div",{style:{borderBottom:"1px solid #e5e7eb"},children:[m.jsxs("button",{onClick:()=>h(!o),style:{width:"100%",padding:"16px 20px",display:"flex",alignItems:"center",justifyContent:"space-between",background:"none",border:"none",cursor:"pointer",transition:"background 0.15s"},children:[m.jsxs("span",{style:{fontWeight:600,fontSize:"14px",color:"#374151",display:"flex",alignItems:"center",gap:"6px"},children:[m.jsx("span",{style:{fontSize:"10px",color:"#9ca3af",transform:o?"rotate(0deg)":"rotate(90deg)",transition:"transform 0.15s",display:"inline-block"},children:"▶"}),"Project Health"]}),i?m.jsx("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:m.jsx("span",{style:{fontSize:"12px",color:"#9ca3af"},children:"scanning..."})}):n>0?m.jsxs("span",{style:{background:"#fef3c7",color:"#d97706",fontSize:"12px",padding:"3px 10px",borderRadius:"12px",fontWeight:600},children:[n," issue",n!==1?"s":""]}):m.jsx("span",{style:{background:"#dcfce7",color:"#16a34a",fontSize:"12px",padding:"3px 10px",borderRadius:"12px",fontWeight:600},children:"all good"})]}),!o&&m.jsxs("div",{style:{padding:"0 12px 16px",display:"flex",flexDirection:"column",gap:"2px"},children:[e.filter(d=>d.status==="fail").map(d=>m.jsx(Ny,{label:d.label,description:d.description,status:d.status,fixPrompt:d.fixPrompt},d.id)),l>0&&m.jsxs("p",{style:{fontSize:"12px",color:"#9ca3af",paddingTop:"8px",paddingLeft:"16px"},children:[l," checks passing"]})]})]})}function jy(){const{sendPrompt:e}=en(),[i,n]=O.useState(!1),[l,o]=O.useState(""),[h,d]=O.useState(""),[_,p]=O.useState(!1),f=l.trim().length>0,S=()=>{if(!f)return;const C=["I want to add a new feature to my app:","",`**What it does:** ${l.trim()}`];h.trim()&&C.push("",`**What success looks like:** ${h.trim()}`),C.push("","Please:","1. Create an implementation plan with numbered steps and files to create/modify","2. Save the plan as a markdown file in docs/plans/","3. Include a testing checklist at the end with specific items to verify","4. Then start building step 1");const b=C.join(`
|
|
51
|
+
`);if(e(b),h.trim()){const R=h.trim().split(/[.\n]/).map(L=>L.trim()).filter(L=>L.length>10);R.length>0&&window.dispatchEvent(new CustomEvent("claude-portal:test-items",{detail:{items:R,feature:l.trim().slice(0,40)}}))}p(!0),setTimeout(()=>{o(""),d(""),p(!1)},2e3)},y={width:"100%",padding:"8px 12px",border:"1px solid #e5e7eb",borderRadius:"8px",fontSize:"12px",fontFamily:"inherit",resize:"none",outline:"none",color:"#374151",background:"#fff",boxSizing:"border-box"},x={fontSize:"12px",fontWeight:500,color:"#6b7280",marginBottom:"4px"};return m.jsxs("div",{style:{borderBottom:"1px solid #e5e7eb"},children:[m.jsx("button",{onClick:()=>n(!i),style:{width:"100%",padding:"16px 20px",display:"flex",alignItems:"center",justifyContent:"space-between",background:"none",border:"none",cursor:"pointer"},children:m.jsxs("span",{style:{fontWeight:600,fontSize:"14px",color:"#374151",display:"flex",alignItems:"center",gap:"6px"},children:[m.jsx("span",{style:{fontSize:"10px",color:"#9ca3af",transform:i?"rotate(0deg)":"rotate(90deg)",transition:"transform 0.15s",display:"inline-block"},children:"▶"}),"Build a Feature"]})}),!i&&m.jsxs("div",{style:{padding:"0 20px 16px",display:"flex",flexDirection:"column",gap:"12px"},children:[m.jsxs("div",{children:[m.jsx("div",{style:x,children:"What do you want to build?"}),m.jsx("textarea",{value:l,onChange:C=>o(C.target.value),rows:3,placeholder:"e.g. A settings page where users can update their profile, change password, and toggle dark mode",style:y})]}),m.jsxs("div",{children:[m.jsxs("div",{style:x,children:["What does success look like? ",m.jsx("span",{style:{color:"#9ca3af",fontWeight:400},children:"(optional)"})]}),m.jsx("textarea",{value:h,onChange:C=>d(C.target.value),rows:3,placeholder:"e.g. The page has a form with current values pre-filled. Save button shows a success toast. Password change requires current password.",style:y})]}),m.jsx("button",{onClick:S,disabled:!f||_,style:{padding:"10px 16px",borderRadius:"10px",border:"none",background:_?"#dcfce7":f?"#22c55e":"#e5e7eb",color:_?"#16a34a":f?"#fff":"#9ca3af",fontSize:"13px",fontWeight:600,cursor:f&&!_?"pointer":"not-allowed",transition:"all 0.15s",width:"100%"},children:_?"✓ Sent to Claude":"Build with Claude Code →"})]})]})}function Mm(e){return`claude-portal-tests-${e}`}function Uy(e){try{const i=localStorage.getItem(Mm(e));return i?JSON.parse(i):[]}catch{return[]}}function Sg(e,i){localStorage.setItem(Mm(e),JSON.stringify(i))}function qy(){const{path:e}=Mt(),[i,n]=O.useState(!1),[l,o]=O.useState([]),[h,d]=O.useState(!1),[_,p]=O.useState("");O.useEffect(()=>{e&&o(Uy(e))},[e]),O.useEffect(()=>{const b=R=>{const{items:L,feature:X}=R.detail;if(!L?.length||!e)return;const se=L.map(($,W)=>({id:`auto-${Date.now()}-${W}`,label:$,checked:!1}));o($=>{const W=[...$,...se];return Sg(e,W),W}),n(!1)};return window.addEventListener("claude-portal:test-items",b),()=>window.removeEventListener("claude-portal:test-items",b)},[e]);const f=O.useCallback(b=>{o(R=>{const L=b(R);return e&&Sg(e,L),L})},[e]),S=O.useCallback(b=>{f(R=>R.map(L=>L.id===b?{...L,checked:!L.checked}:L))},[f]),y=O.useCallback(b=>{f(R=>R.filter(L=>L.id!==b))},[f]),x=()=>{const b=_.trim();b&&(f(R=>[...R,{id:Date.now().toString(),label:b,checked:!1}]),p(""),d(!1))},C=l.filter(b=>b.checked).length;return m.jsxs("div",{style:{borderBottom:"1px solid #e5e7eb"},children:[m.jsxs("button",{onClick:()=>n(!i),style:{width:"100%",padding:"16px 20px",display:"flex",alignItems:"center",justifyContent:"space-between",background:"none",border:"none",cursor:"pointer"},children:[m.jsxs("span",{style:{fontWeight:600,fontSize:"14px",color:"#374151",display:"flex",alignItems:"center",gap:"6px"},children:[m.jsx("span",{style:{fontSize:"10px",color:"#9ca3af",transform:i?"rotate(0deg)":"rotate(90deg)",transition:"transform 0.15s",display:"inline-block"},children:"▶"}),"Feature Testing"]}),l.length>0&&m.jsxs("span",{style:{background:C===l.length?"#dcfce7":"#f3f4f6",color:C===l.length?"#16a34a":"#6b7280",fontSize:"12px",padding:"3px 10px",borderRadius:"12px",fontWeight:600},children:[C,"/",l.length," tested"]})]}),!i&&m.jsxs("div",{style:{padding:"0 20px 16px",display:"flex",flexDirection:"column",gap:"6px"},children:[l.length===0&&!h&&m.jsx("p",{style:{fontSize:"12px",color:"#9ca3af",lineHeight:"1.5",margin:0},children:"Test items will appear here when Claude creates a plan with a testing section."}),l.map(b=>m.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"8px",padding:"6px 0",fontSize:"12px",color:"#374151"},children:[m.jsx("input",{type:"checkbox",checked:b.checked,onChange:()=>S(b.id),style:{marginTop:"2px",accentColor:"#22c55e",cursor:"pointer"}}),m.jsx("span",{onClick:()=>S(b.id),style:{flex:1,cursor:"pointer",textDecoration:b.checked?"line-through":"none",color:b.checked?"#9ca3af":"#374151"},children:b.label}),m.jsx("button",{onClick:()=>y(b.id),"aria-label":`Remove ${b.label}`,style:{background:"none",border:"none",color:"#d1d5db",cursor:"pointer",fontSize:"11px",padding:"0 2px",flexShrink:0,transition:"color 0.15s"},onMouseEnter:R=>R.currentTarget.style.color="#ef4444",onMouseLeave:R=>R.currentTarget.style.color="#d1d5db",children:"✕"})]},b.id)),h?m.jsxs("div",{style:{display:"flex",gap:"6px",marginTop:"4px"},children:[m.jsx("input",{autoFocus:!0,value:_,onChange:b=>p(b.target.value),onKeyDown:b=>{b.key==="Enter"&&x(),b.key==="Escape"&&(d(!1),p(""))},placeholder:"Describe the test...",style:{flex:1,padding:"6px 10px",border:"1px solid #e5e7eb",borderRadius:"6px",fontSize:"12px",outline:"none",color:"#374151"}}),m.jsx("button",{onClick:x,style:{padding:"6px 12px",background:"#22c55e",color:"#fff",border:"none",borderRadius:"6px",fontSize:"12px",fontWeight:600,cursor:"pointer"},children:"Add"})]}):m.jsx("button",{onClick:()=>d(!0),style:{padding:"6px 0",background:"none",border:"none",color:"#22c55e",fontSize:"12px",fontWeight:500,cursor:"pointer",textAlign:"left",marginTop:"4px"},children:"+ Add test item"})]})]})}const Qn=[{id:"bugs",label:"Check for bugs",prompt:"Review all files changed since the last commit for bugs, logic errors, and edge cases. Report what you find."},{id:"diff",label:"Review diff",prompt:"Show me a summary of all changes since the last push — what was added, modified, and removed."},{id:"tests",label:"Run tests",prompt:"Run the test suite and report results. If any tests fail, explain why."},{id:"console",label:"Check console.logs",prompt:"Find any console.log, console.warn, or console.error statements in the changed files that should be removed before pushing."},{id:"build",label:"Build succeeds",prompt:"Run the build command and report if it succeeds. If it fails, explain the errors."},{id:"security",label:"Security check",prompt:"Check the changed files for security issues: hardcoded secrets, SQL injection, XSS vulnerabilities, or exposed API keys."}];function Bm(e){return`claude-portal-prepush-${e}`}function Wy(e){try{const i=localStorage.getItem(Bm(e));return i?JSON.parse(i):{}}catch{return{}}}function Py(e,i){localStorage.setItem(Bm(e),JSON.stringify(i))}function Ky(){const{path:e}=Mt(),{sendPrompt:i}=en(),[n,l]=O.useState(!1),[o,h]=O.useState({});O.useEffect(()=>{e&&h(Wy(e))},[e]);const d=O.useCallback(p=>{h(f=>{const S={...f,[p]:!f[p]};return e&&Py(e,S),S})},[e]),_=Qn.filter(p=>o[p.id]).length;return m.jsxs("div",{style:{borderBottom:"1px solid #e5e7eb"},children:[m.jsxs("button",{onClick:()=>l(!n),style:{width:"100%",padding:"16px 20px",display:"flex",alignItems:"center",justifyContent:"space-between",background:"none",border:"none",cursor:"pointer"},children:[m.jsxs("span",{style:{fontWeight:600,fontSize:"14px",color:"#374151",display:"flex",alignItems:"center",gap:"6px"},children:[m.jsx("span",{style:{fontSize:"10px",color:"#9ca3af",transform:n?"rotate(0deg)":"rotate(90deg)",transition:"transform 0.15s",display:"inline-block"},children:"▶"}),"Pre-Push"]}),m.jsxs("span",{style:{background:_===Qn.length?"#dcfce7":"#f3f4f6",color:_===Qn.length?"#16a34a":"#6b7280",fontSize:"12px",padding:"3px 10px",borderRadius:"12px",fontWeight:600},children:[_,"/",Qn.length]})]}),!n&&m.jsx("div",{style:{padding:"0 20px 16px",display:"flex",flexDirection:"column",gap:"4px"},children:Qn.map(p=>m.jsx(Yy,{label:p.label,prompt:p.prompt,isChecked:!!o[p.id],onToggle:()=>d(p.id),onRun:()=>i(p.prompt)},p.id))})]})}function Yy({label:e,prompt:i,isChecked:n,onToggle:l,onRun:o}){const[h,d]=O.useState(!1),_=()=>{h||(o(),d(!0),setTimeout(()=>d(!1),3e3))};return m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",padding:"8px 0"},children:[m.jsx("input",{type:"checkbox",checked:n,onChange:l,style:{accentColor:"#22c55e",flexShrink:0}}),m.jsx("span",{style:{flex:1,fontSize:"12px",color:n?"#9ca3af":"#374151",textDecoration:n?"line-through":"none"},children:e}),m.jsx("button",{onClick:_,style:{padding:"4px 10px",background:"#dcfce7",color:"#16a34a",fontSize:"11px",borderRadius:"6px",fontWeight:600,border:h?"1px solid #86efac":"none",cursor:h?"default":"pointer",flexShrink:0,transition:"all 0.15s"},children:h?"✓ Sent":"Run →"})]})}function $y(){const{path:e,setProjectPath:i}=Mt(),n=e?e.split("/").filter(Boolean).pop():"Project",l=async()=>{const o=await pi("/api/pick-folder");o?.path&&i(o.path)};return m.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",background:"#fff"},children:[m.jsxs("div",{style:{padding:"20px 24px 16px",borderBottom:"1px solid #e5e7eb"},children:[m.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"6px"},children:[m.jsx("div",{style:{fontSize:"11px",textTransform:"uppercase",letterSpacing:"0.05em",color:"#9ca3af"},children:"Project"}),m.jsx("button",{onClick:l,style:{padding:"4px 10px",borderRadius:"6px",border:"1px solid #e5e7eb",background:"#fff",color:"#6b7280",fontSize:"11px",fontWeight:500,cursor:"pointer",transition:"all 0.15s"},children:"Change"})]}),m.jsx("div",{style:{fontSize:"14px",fontWeight:600,color:"#1a2233",wordBreak:"break-all"},children:n}),e&&m.jsx("div",{style:{fontSize:"11px",color:"#9ca3af",marginTop:"2px",wordBreak:"break-all"},children:e})]}),m.jsxs("div",{style:{flex:1,overflowY:"auto"},children:[m.jsx(Hy,{}),m.jsx(jy,{}),m.jsx(qy,{}),m.jsx(Ky,{})]})]})}const Iy={pdf:"text-red-500",docx:"text-blue-500",doc:"text-blue-500",xlsx:"text-green-500",xls:"text-green-500",csv:"text-green-600",txt:"text-gray-400",md:"text-gray-400",json:"text-yellow-500",html:"text-orange-500",pptx:"text-pink-500"};function Xy(e){const i=e.split(".").pop()?.toLowerCase()||"";return Iy[i]||"text-gray-400"}function Gy(e){return Object.entries(e).sort((i,n)=>n[1]-i[1]).map(([i,n])=>`${n} ${i}`).join(", ")}function Vy(){const{folderPath:e,folderScan:i,scanLoading:n,scanFolder:l,clearFolder:o}=ss(),[h,d]=O.useState(""),[_,p]=O.useState(!1),[f,S]=O.useState(!1),[y,x]=O.useState(!1);async function C(){S(!0);const W=await pi("/api/pick-folder");S(!1),W?.path&&l(W.path)}function b(){const W=h.trim();W&&l(W)}function R(W){W.key==="Enter"&&b()}const L=i?.files||[],X=i?.summary.total||0,se=i?.summary.byType||{},$=L.slice(0,20);return m.jsxs("div",{style:{padding:"16px 20px",display:"flex",flexDirection:"column",gap:"10px",borderBottom:"1px solid var(--border)"},children:[m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[m.jsx("div",{style:{width:"24px",height:"24px",borderRadius:"8px",background:"linear-gradient(135deg, #5e17eb, #8b5cf6)",display:"flex",alignItems:"center",justifyContent:"center",color:"white",fontSize:"11px",fontWeight:700,flexShrink:0},children:"1"}),m.jsx("h3",{style:{fontSize:"13px",fontWeight:700,color:"var(--text-primary)"},children:"Choose folder"})]}),e?m.jsxs("div",{className:"rounded-lg border",style:{background:"var(--bg-secondary)",borderColor:"var(--border)",padding:"10px 12px"},children:[m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[m.jsx("span",{style:{fontSize:"14px",flexShrink:0},children:"📁"}),m.jsx("span",{style:{fontSize:"13px",fontWeight:600,color:"var(--text-primary)",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e?.split("/").filter(Boolean).pop()||e}),m.jsxs("span",{style:{fontSize:"11px",padding:"2px 8px",borderRadius:"100px",background:"#eef2ff",color:"#6366f1",fontWeight:600,flexShrink:0,whiteSpace:"nowrap"},children:[X," files"]}),m.jsx("button",{onClick:o,style:{fontSize:"11px",padding:"2px 8px",borderRadius:"100px",border:"1px solid var(--border)",background:"transparent",color:"var(--text-secondary)",cursor:"pointer",flexShrink:0,whiteSpace:"nowrap"},children:"Change"})]}),Object.keys(se).length>0&&m.jsx("p",{style:{fontSize:"11px",color:"var(--text-secondary)",marginTop:"4px"},children:Gy(se)}),X>50&&m.jsxs("p",{className:"text-xs text-amber-500 bg-amber-500/10 rounded px-2 py-1",children:["Large folder — processing may take longer for ",X," files."]}),L.length>0&&m.jsxs("div",{children:[m.jsx("button",{onClick:()=>p(W=>!W),className:"text-xs transition-colors",style:{color:"var(--text-secondary)"},children:_?"▲ Hide files":`▼ Show files (${Math.min(20,L.length)} of ${X})`}),_&&m.jsx("ul",{className:"mt-2 space-y-1 max-h-48 overflow-y-auto",children:$.map((W,Y)=>m.jsxs("li",{className:"flex items-center gap-2 text-xs",children:[m.jsx("span",{className:`font-mono font-semibold ${Xy(W.name)}`,children:W.name.split(".").pop()?.toLowerCase()}),m.jsx("span",{style:{color:"var(--text-primary)"},children:W.name})]},Y))})]})]}):m.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[m.jsx("button",{onClick:C,disabled:f||n,style:{width:"100%",padding:"16px 20px",borderRadius:"14px",fontSize:"15px",fontWeight:600,background:"linear-gradient(135deg, #5e17eb, #8b5cf6)",color:"white",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",boxShadow:"0 4px 12px rgba(94,23,235,0.3)",opacity:f||n?.5:1,transition:"all 0.2s"},children:f?m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Waiting for selection..."]}):m.jsx(m.Fragment,{children:"📂 Browse for folder"})}),y?m.jsxs("div",{className:"flex gap-2",children:[m.jsx("input",{type:"text",value:h,onChange:W=>d(W.target.value),onKeyDown:R,placeholder:"/path/to/documents",autoFocus:!0,className:"flex-1 px-3 py-2.5 rounded-lg text-sm border outline-none focus:ring-2 focus:ring-indigo-400",style:{background:"var(--bg-secondary)",borderColor:"var(--border)",color:"var(--text-primary)"}}),m.jsx("button",{onClick:b,disabled:!h.trim()||n,className:"px-4 py-2.5 rounded-lg text-sm font-medium bg-indigo-500 text-white hover:bg-indigo-600 disabled:opacity-50 transition-colors",children:n?"...":"Scan"})]}):m.jsx("button",{onClick:()=>x(!0),style:{fontSize:"13px",color:"var(--text-secondary)",background:"none",border:"none",cursor:"pointer",margin:"0 auto",display:"block"},children:"Or enter path manually →"})]})]})}function Fy(){const{selectedOutcome:e,setSelectedOutcome:i,freeformText:n,setFreeformText:l}=ss();return m.jsxs("div",{children:[m.jsxs("div",{className:"flex items-center gap-2",style:{marginBottom:"12px"},children:[m.jsx("div",{style:{width:"24px",height:"24px",borderRadius:"8px",background:"linear-gradient(135deg, #6366f1, #a855f7)",display:"flex",alignItems:"center",justifyContent:"center",color:"white",fontSize:"11px",fontWeight:700,flexShrink:0},children:"2"}),m.jsx("h3",{style:{fontSize:"13px",fontWeight:700,color:"var(--text-primary)"},children:"Choose outcome"})]}),yy.map(o=>{const h=oo.filter(d=>d.category===o.key);return m.jsxs("div",{style:{marginBottom:"12px"},children:[m.jsxs("div",{style:{fontSize:"11px",fontWeight:600,color:"#9ca3af",marginBottom:"6px",textTransform:"uppercase",letterSpacing:"0.04em"},children:[o.label," ",m.jsxs("span",{style:{fontWeight:400,textTransform:"none",letterSpacing:0},children:["— ",o.description]})]}),m.jsx("div",{className:"grid grid-cols-2",style:{gap:"6px"},children:h.map(d=>{const _=e===d.key;return m.jsxs("button",{onClick:()=>i(_?null:d.key),style:{padding:"8px 10px",borderRadius:"10px",border:_?"2px solid #818cf8":"1.5px solid var(--border)",background:_?"#eef2ff":"var(--bg-secondary, #fff)",cursor:"pointer",boxShadow:_?"0 0 0 3px rgba(99,102,241,0.08)":"none",display:"flex",alignItems:"center",gap:"8px",textAlign:"left",transition:"all 0.15s"},children:[m.jsx("span",{style:{fontSize:"15px",flexShrink:0},children:d.emoji}),m.jsxs("div",{style:{minWidth:0},children:[m.jsx("div",{style:{fontSize:"12px",fontWeight:700,color:_?"#4338ca":"var(--text-primary)"},children:d.name}),m.jsx("div",{style:{fontSize:"10px",color:"var(--text-secondary)",lineHeight:1.2},children:d.description})]})]},d.key)})})]},o.key)}),m.jsxs("div",{style:{marginTop:"8px"},children:[m.jsx("div",{style:{fontSize:"11px",fontWeight:500,color:"var(--text-secondary)",marginBottom:"4px"},children:"Or describe what you need:"}),m.jsx("textarea",{value:n,onChange:o=>l(o.target.value),placeholder:"e.g. Find all contract expiry dates and list them by client",rows:2,className:"w-full rounded-lg border outline-none resize-none",style:{padding:"10px 14px",fontSize:"12px",lineHeight:"1.5",background:"var(--bg-secondary)",borderColor:"var(--border)",color:"var(--text-primary)"}})]})]})}const Am="claude-portal-style-templates",zm=()=>{try{return JSON.parse(localStorage.getItem(Am)||"[]")}catch{return[]}},Zy=e=>localStorage.setItem(Am,JSON.stringify(e)),Qy=e=>zm().filter(i=>i.outcomeKey===e);function Jy(e){const i=zm();i.push(e);const n=new Map;for(const o of i){const h=n.get(o.outcomeKey)||[];h.push(o),n.set(o.outcomeKey,h)}const l=[];for(const o of n.values())l.push(...o.slice(-10));Zy(l)}const eb={pdf:"📄",md:"📝",docx:"📘",doc:"📘",txt:"📃"},tb=".md,.txt,.csv,.json,.html",Wh=3;function ib(e){return e.split(".").pop()?.toLowerCase()||""}function sb({outcomeKey:e,onContentChange:i}){const[n,l]=O.useState([]),[o,h]=O.useState(null),[d,_]=O.useState(!1),[p,f]=O.useState([]),S=O.useRef(null);O.useEffect(()=>{f(e?Qy(e):[]),h(null)},[e]);const y=O.useCallback(($,W)=>{if(W){const Y=p.find(Q=>Q.id===W);if(Y){i(Y.content);return}}if($.length>0){const Y=$.map(Q=>Q.content).join(`
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
`);i(Y)}else i(null)},[i,p]),x=O.useRef(!1);O.useEffect(()=>{if(!x.current){x.current=!0;return}y(n,o)},[n,o,y]);const C=O.useCallback(async $=>{const W=Array.from($),Y=[];for(const Q of W){const J=Q.name.split(".").pop()?.toLowerCase()||"";if(["pdf","docx","doc"].includes(J))continue;const Se=await Q.text();Y.push({name:Q.name,content:Se})}Y.length!==0&&(l(Q=>{const J=Wh-Q.length;return J<=0?Q:[...Q,...Y.slice(0,J)]}),h(null))},[]),b=O.useCallback($=>{$.preventDefault(),_(!1),$.dataTransfer.files.length>0&&C($.dataTransfer.files)},[C]),R=O.useCallback($=>{$.target.files&&$.target.files.length>0&&C($.target.files),$.target.value=""},[C]),L=O.useCallback($=>{l(W=>W.filter((Y,Q)=>Q!==$))},[]),X=O.useCallback($=>{h(W=>W===$?null:$),l([])},[]),se=n.length>0||o!==null;return m.jsxs("div",{className:"space-y-3",children:[m.jsxs("div",{className:"flex items-center gap-2",style:{marginBottom:"8px"},children:[m.jsx("div",{className:"flex items-center justify-center text-white text-xs font-bold flex-shrink-0",style:{width:"24px",height:"24px",borderRadius:"8px",background:"linear-gradient(135deg, #6366f1, #a855f7)"},children:"✦"}),m.jsx("h3",{className:"text-sm font-semibold",style:{color:"var(--text-primary)"},children:"Show Claude an example"}),m.jsx("span",{className:"text-xs italic",style:{color:"var(--text-secondary)"},children:"optional"})]}),n.map(($,W)=>{const Y=ib($.name),Q=eb[Y]||"📄",J=$.content.slice(0,80).replace(/\n/g," "),Se={pdf:"#fef2f2",md:"#f0f9ff",docx:"#eff6ff",doc:"#eff6ff",txt:"#f8fafc"};return m.jsxs("div",{className:"flex items-center gap-2.5 rounded-lg border",style:{padding:"10px 12px",background:"var(--bg-secondary)",borderColor:"var(--border)"},children:[m.jsx("div",{className:"flex items-center justify-center flex-shrink-0",style:{width:"32px",height:"32px",borderRadius:"8px",background:Se[Y]||"#f8fafc",fontSize:"16px"},children:Q}),m.jsxs("div",{className:"flex-1 min-w-0",children:[m.jsx("div",{className:"text-xs font-semibold truncate",style:{color:"var(--text-primary)"},children:$.name}),m.jsx("div",{className:"text-xs truncate",style:{color:"var(--text-secondary)",fontSize:"10px",marginTop:"1px"},children:J})]}),m.jsx("button",{onClick:()=>L(W),"aria-label":`Remove ${$.name}`,className:"flex items-center justify-center flex-shrink-0 border rounded-md transition-colors hover:bg-red-50 hover:border-red-300 hover:text-red-600",style:{width:"20px",height:"20px",borderColor:"var(--border)",color:"var(--text-secondary)",background:"transparent",cursor:"pointer",fontSize:"10px"},children:"✕"})]},W)}),n.length<Wh&&m.jsxs("div",{onDragOver:$=>{$.preventDefault(),_(!0)},onDragLeave:()=>_(!1),onDrop:b,onClick:()=>S.current?.click(),className:"relative text-center cursor-pointer transition-all rounded-xl",style:{border:`2px dashed ${d?"#818cf8":"#c7d2fe"}`,borderRadius:"10px",padding:"12px",background:d?"#eef2ff":"transparent"},children:[m.jsx("input",{ref:S,type:"file",multiple:!0,accept:tb,onChange:R,style:{position:"absolute",inset:0,opacity:0,cursor:"pointer"}}),m.jsx("div",{style:{fontSize:"18px",marginBottom:"4px",opacity:.7},children:"📎"}),m.jsxs("div",{style:{fontSize:"11px",color:"#64748b",fontWeight:500,lineHeight:1.4},children:[m.jsx("strong",{style:{color:"#6366f1"},children:"Drop a document"})," to use as a style reference"]}),m.jsx("div",{style:{fontSize:"10px",color:"#94a3b8",marginTop:"2px"},children:"MD, TXT, CSV, JSON, HTML — up to 3"})]}),n.length>0&&m.jsxs("div",{className:"text-right",style:{fontSize:"10px",color:"#94a3b8"},children:[n.length," of ",Wh," examples attached"]}),p.length>0&&m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"flex items-center gap-2",style:{margin:"12px 0 8px"},children:[m.jsx("div",{className:"flex-1",style:{height:"1px",background:"var(--border)"}}),m.jsx("span",{style:{fontSize:"10px",color:"#94a3b8",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.5px",whiteSpace:"nowrap"},children:"or use a saved style"}),m.jsx("div",{className:"flex-1",style:{height:"1px",background:"var(--border)"}})]}),m.jsx("div",{className:"flex flex-wrap gap-1.5",children:p.map($=>{const W=o===$.id;return m.jsxs("button",{onClick:()=>X($.id),className:"inline-flex items-center gap-1 rounded-lg text-xs transition-colors",style:{padding:"5px 10px",border:`1px solid ${W?"#818cf8":"var(--border)"}`,background:W?"#eef2ff":"transparent",color:W?"#4338ca":"var(--text-secondary)",cursor:"pointer",fontWeight:500},children:[m.jsx("span",{style:{fontSize:"12px"},children:"⭐"})," ",$.name]},$.id)})})]}),se&&m.jsx("div",{className:"rounded-lg",style:{fontSize:"10px",color:"#6366f1",background:"#eef2ff",border:"1px solid #e0e7ff",borderRadius:"8px",padding:"6px 10px"},children:"✨ Claude will match the tone, structure, and formatting of your example"})]})}function rb(){const{contextText:e,setContextText:i,canRun:n,run:l,selectedOutcome:o,folderScan:h,isRunning:d}=ss(),_=o?oo.find(f=>f.key===o)?.name||o:"Custom",p=h?.summary.total||0;return m.jsxs("div",{className:"space-y-2",children:[m.jsxs("div",{className:"flex items-center gap-2",style:{marginBottom:"8px"},children:[m.jsx("div",{className:"flex-shrink-0",style:{width:"24px",height:"24px",borderRadius:"8px",background:"linear-gradient(135deg, #5e17eb, #8b5cf6)",display:"flex",alignItems:"center",justifyContent:"center",color:"white",fontSize:"11px",fontWeight:700},children:"3"}),m.jsx("h3",{style:{fontSize:"13px",fontWeight:700,color:"var(--text-primary)"},children:"Additional context"})]}),m.jsx("textarea",{value:e,onChange:f=>i(f.target.value),placeholder:"Any extra instructions, e.g. focus on Q4, ignore drafts, output in French…",rows:2,className:"w-full rounded-lg border outline-none focus:ring-2 focus:ring-indigo-400 resize-none",style:{padding:"10px 14px",fontSize:"12px",lineHeight:"1.5",background:"var(--bg-secondary)",borderColor:"var(--border)",color:"var(--text-primary)"}}),m.jsxs("div",{className:"space-y-1.5",children:[m.jsx("button",{onClick:l,disabled:!n,className:"w-full rounded-lg text-sm font-semibold text-white shadow-lg disabled:opacity-40 disabled:cursor-not-allowed transition-all",style:{padding:"12px 16px",background:"linear-gradient(135deg, #7c3aed, #a855f7)"},children:d?"⏳ Working...":`✨ Go — ${_} ${p} documents`}),m.jsx("p",{className:"text-xs text-center",style:{color:"var(--text-secondary)"},children:"Claude will scan your files and create the output"})]})]})}function nb(){const{folderPath:e,selectedOutcome:i,setStyleExampleContent:n}=ss(),[l,o]=O.useState(!1);return m.jsxs("div",{className:"h-full overflow-y-auto",style:{background:"var(--bg-sidebar)"},children:[l&&m.jsx(Dm,{onClose:()=>o(!1)}),m.jsx("div",{style:{padding:"20px 28px 0"},children:m.jsx("button",{onClick:()=>o(!0),style:{width:"100%",padding:"12px 20px",borderRadius:"12px",background:"linear-gradient(135deg, rgba(94,23,235,0.06), rgba(139,92,246,0.06))",border:"1px solid rgba(94,23,235,0.15)",color:"#8b5cf6",fontSize:"14px",fontWeight:600,cursor:"pointer",transition:"all 0.2s",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"},children:"▶ How it works"})}),m.jsx(Vy,{}),e&&m.jsxs(m.Fragment,{children:[m.jsx("div",{style:{padding:"16px 20px",borderBottom:"1px solid var(--border)"},children:m.jsx(Fy,{})}),m.jsx("div",{style:{padding:"16px 20px",borderBottom:"1px solid var(--border)"},children:m.jsx(sb,{outcomeKey:i,onContentChange:n})}),m.jsx("div",{style:{padding:"16px 20px",paddingBottom:"24px"},children:m.jsx(rb,{})})]})]})}function lb({open:e}){const{mode:i}=Mt(),n=i==="document";return m.jsx("div",{style:{width:e?"340px":"0px",overflow:e?"auto":"hidden",borderRight:"1px solid #e5e7eb",background:"#fff",flexShrink:0,transition:"width 0.2s ease"},children:m.jsx("div",{style:{width:"340px",height:"100%"},children:n?m.jsx(nb,{}):m.jsx($y,{})})})}var Om=Object.defineProperty,ab=Object.getOwnPropertyDescriptor,ob=(e,i)=>{for(var n in i)Om(e,n,{get:i[n],enumerable:!0})},Ze=(e,i,n,l)=>{for(var o=l>1?void 0:l?ab(i,n):i,h=e.length-1,d;h>=0;h--)(d=e[h])&&(o=(l?d(i,n,o):d(o))||o);return l&&o&&Om(i,n,o),o},ie=(e,i)=>(n,l)=>i(n,l,e),yg="Terminal input",tu={get:()=>yg,set:e=>yg=e},bg="Too much output to announce, navigate to rows manually to read",iu={get:()=>bg,set:e=>bg=e};function cb(e){return e.replace(/\r?\n/g,"\r")}function hb(e,i){return i?"\x1B[200~"+e+"\x1B[201~":e}function ub(e,i){e.clipboardData&&e.clipboardData.setData("text/plain",i.selectionText),e.preventDefault()}function db(e,i,n,l){if(e.stopPropagation(),e.clipboardData){let o=e.clipboardData.getData("text/plain");Lm(o,i,n,l)}}function Lm(e,i,n,l){e=cb(e),e=hb(e,n.decPrivateModes.bracketedPasteMode&&l.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),i.value=""}function Nm(e,i,n){let l=n.getBoundingClientRect(),o=e.clientX-l.left-10,h=e.clientY-l.top-10;i.style.width="20px",i.style.height="20px",i.style.left=`${o}px`,i.style.top=`${h}px`,i.style.zIndex="1000",i.focus()}function xg(e,i,n,l,o){Nm(e,i,n),o&&l.rightClickSelect(e),i.value=l.selectionText,i.select()}function Os(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function co(e,i=0,n=e.length){let l="";for(let o=i;o<n;++o){let h=e[o];h>65535?(h-=65536,l+=String.fromCharCode((h>>10)+55296)+String.fromCharCode(h%1024+56320)):l+=String.fromCharCode(h)}return l}var fb=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,i){let n=e.length;if(!n)return 0;let l=0,o=0;if(this._interim){let h=e.charCodeAt(o++);56320<=h&&h<=57343?i[l++]=(this._interim-55296)*1024+h-56320+65536:(i[l++]=this._interim,i[l++]=h),this._interim=0}for(let h=o;h<n;++h){let d=e.charCodeAt(h);if(55296<=d&&d<=56319){if(++h>=n)return this._interim=d,l;let _=e.charCodeAt(h);56320<=_&&_<=57343?i[l++]=(d-55296)*1024+_-56320+65536:(i[l++]=d,i[l++]=_);continue}d!==65279&&(i[l++]=d)}return l}},_b=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,i){let n=e.length;if(!n)return 0;let l=0,o,h,d,_,p=0,f=0;if(this.interim[0]){let x=!1,C=this.interim[0];C&=(C&224)===192?31:(C&240)===224?15:7;let b=0,R;for(;(R=this.interim[++b]&63)&&b<4;)C<<=6,C|=R;let L=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,X=L-b;for(;f<X;){if(f>=n)return 0;if(R=e[f++],(R&192)!==128){f--,x=!0;break}else this.interim[b++]=R,C<<=6,C|=R&63}x||(L===2?C<128?f--:i[l++]=C:L===3?C<2048||C>=55296&&C<=57343||C===65279||(i[l++]=C):C<65536||C>1114111||(i[l++]=C)),this.interim.fill(0)}let S=n-4,y=f;for(;y<n;){for(;y<S&&!((o=e[y])&128)&&!((h=e[y+1])&128)&&!((d=e[y+2])&128)&&!((_=e[y+3])&128);)i[l++]=o,i[l++]=h,i[l++]=d,i[l++]=_,y+=4;if(o=e[y++],o<128)i[l++]=o;else if((o&224)===192){if(y>=n)return this.interim[0]=o,l;if(h=e[y++],(h&192)!==128){y--;continue}if(p=(o&31)<<6|h&63,p<128){y--;continue}i[l++]=p}else if((o&240)===224){if(y>=n)return this.interim[0]=o,l;if(h=e[y++],(h&192)!==128){y--;continue}if(y>=n)return this.interim[0]=o,this.interim[1]=h,l;if(d=e[y++],(d&192)!==128){y--;continue}if(p=(o&15)<<12|(h&63)<<6|d&63,p<2048||p>=55296&&p<=57343||p===65279)continue;i[l++]=p}else if((o&248)===240){if(y>=n)return this.interim[0]=o,l;if(h=e[y++],(h&192)!==128){y--;continue}if(y>=n)return this.interim[0]=o,this.interim[1]=h,l;if(d=e[y++],(d&192)!==128){y--;continue}if(y>=n)return this.interim[0]=o,this.interim[1]=h,this.interim[2]=d,l;if(_=e[y++],(_&192)!==128){y--;continue}if(p=(o&7)<<18|(h&63)<<12|(d&63)<<6|_&63,p<65536||p>1114111)continue;i[l++]=p}}return l}},Hm="",Ls=" ",ml=class jm{constructor(){this.fg=0,this.bg=0,this.extended=new Ja}static toColorRGB(i){return[i>>>16&255,i>>>8&255,i&255]}static fromColorRGB(i){return(i[0]&255)<<16|(i[1]&255)<<8|i[2]&255}clone(){let i=new jm;return i.fg=this.fg,i.bg=this.bg,i.extended=this.extended.clone(),i}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},Ja=class Um{constructor(i=0,n=0){this._ext=0,this._urlId=0,this._ext=i,this._urlId=n}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(i){this._ext=i}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(i){this._ext&=-469762049,this._ext|=i<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(i){this._ext&=-67108864,this._ext|=i&67108863}get urlId(){return this._urlId}set urlId(i){this._urlId=i}get underlineVariantOffset(){let i=(this._ext&3758096384)>>29;return i<0?i^4294967288:i}set underlineVariantOffset(i){this._ext&=536870911,this._ext|=i<<29&3758096384}clone(){return new Um(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},gi=class qm extends ml{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Ja,this.combinedData=""}static fromCharData(i){let n=new qm;return n.setFromCharData(i),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?Os(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(i){this.fg=i[0],this.bg=0;let n=!1;if(i[1].length>2)n=!0;else if(i[1].length===2){let l=i[1].charCodeAt(0);if(55296<=l&&l<=56319){let o=i[1].charCodeAt(1);56320<=o&&o<=57343?this.content=(l-55296)*1024+o-56320+65536|i[2]<<22:n=!0}else n=!0}else this.content=i[1].charCodeAt(0)|i[2]<<22;n&&(this.combinedData=i[1],this.content=2097152|i[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},wg="di$target",su="di$dependencies",Ph=new Map;function pb(e){return e[su]||[]}function vt(e){if(Ph.has(e))return Ph.get(e);let i=function(n,l,o){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");gb(i,n,o)};return i._id=e,Ph.set(e,i),i}function gb(e,i,n){i[wg]===i?i[su].push({id:e,index:n}):(i[su]=[{id:e,index:n}],i[wg]=i)}var Bt=vt("BufferService"),Wm=vt("CoreMouseService"),hr=vt("CoreService"),mb=vt("CharsetService"),Pu=vt("InstantiationService"),Pm=vt("LogService"),At=vt("OptionsService"),Km=vt("OscLinkService"),vb=vt("UnicodeService"),vl=vt("DecorationService"),ru=class{constructor(e,i,n){this._bufferService=e,this._optionsService=i,this._oscLinkService=n}provideLinks(e,i){let n=this._bufferService.buffer.lines.get(e-1);if(!n){i(void 0);return}let l=[],o=this._optionsService.rawOptions.linkHandler,h=new gi,d=n.getTrimmedLength(),_=-1,p=-1,f=!1;for(let S=0;S<d;S++)if(!(p===-1&&!n.hasContent(S))){if(n.loadCell(S,h),h.hasExtendedAttrs()&&h.extended.urlId)if(p===-1){p=S,_=h.extended.urlId;continue}else f=h.extended.urlId!==_;else p!==-1&&(f=!0);if(f||p!==-1&&S===d-1){let y=this._oscLinkService.getLinkData(_)?.uri;if(y){let x={start:{x:p+1,y:e},end:{x:S+(!f&&S===d-1?1:0),y:e}},C=!1;if(!o?.allowNonHttpProtocols)try{let b=new URL(y);["http:","https:"].includes(b.protocol)||(C=!0)}catch{C=!0}C||l.push({text:y,range:x,activate:(b,R)=>o?o.activate(b,R,x):Sb(b,R),hover:(b,R)=>o?.hover?.(b,R,x),leave:(b,R)=>o?.leave?.(b,R,x)})}f=!1,h.hasExtendedAttrs()&&h.extended.urlId?(p=S,_=h.extended.urlId):(p=-1,_=-1)}}i(l)}};ru=Ze([ie(0,Bt),ie(1,At),ie(2,Km)],ru);function Sb(e,i){if(confirm(`Do you want to navigate to ${i}?
|
|
56
|
+
|
|
57
|
+
WARNING: This link could potentially be dangerous`)){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=i}else console.warn("Opening link blocked as opener could not be cleared")}}var ho=vt("CharSizeService"),rs=vt("CoreBrowserService"),Ku=vt("MouseService"),ns=vt("RenderService"),yb=vt("SelectionService"),Ym=vt("CharacterJoinerService"),tn=vt("ThemeService"),$m=vt("LinkProviderService"),bb=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Cg.isErrorNoTelemetry(e)?new Cg(e.message+`
|
|
58
|
+
|
|
59
|
+
`+e.stack):new Error(e.message+`
|
|
60
|
+
|
|
61
|
+
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(i=>{i(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},xb=new bb;function Ia(e){wb(e)||xb.onUnexpectedError(e)}var nu="Canceled";function wb(e){return e instanceof Cb?!0:e instanceof Error&&e.name===nu&&e.message===nu}var Cb=class extends Error{constructor(){super(nu),this.name=this.message}};function kb(e){return new Error(`Illegal argument: ${e}`)}var Cg=class lu extends Error{constructor(i){super(i),this.name="CodeExpectedError"}static fromError(i){if(i instanceof lu)return i;let n=new lu;return n.message=i.message,n.stack=i.stack,n}static isErrorNoTelemetry(i){return i.name==="CodeExpectedError"}},au=class Im extends Error{constructor(i){super(i||"An unexpected bug occurred."),Object.setPrototypeOf(this,Im.prototype)}};function Qt(e,i=0){return e[e.length-(1+i)]}var Eb;(e=>{function i(h){return h<0}e.isLessThan=i;function n(h){return h<=0}e.isLessThanOrEqual=n;function l(h){return h>0}e.isGreaterThan=l;function o(h){return h===0}e.isNeitherLessOrGreaterThan=o,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(Eb||={});function Tb(e,i){let n=this,l=!1,o;return function(){return l||(l=!0,i||(o=e.apply(n,arguments))),o}}var Xm;(e=>{function i(W){return W&&typeof W=="object"&&typeof W[Symbol.iterator]=="function"}e.is=i;let n=Object.freeze([]);function l(){return n}e.empty=l;function*o(W){yield W}e.single=o;function h(W){return i(W)?W:o(W)}e.wrap=h;function d(W){return W||n}e.from=d;function*_(W){for(let Y=W.length-1;Y>=0;Y--)yield W[Y]}e.reverse=_;function p(W){return!W||W[Symbol.iterator]().next().done===!0}e.isEmpty=p;function f(W){return W[Symbol.iterator]().next().value}e.first=f;function S(W,Y){let Q=0;for(let J of W)if(Y(J,Q++))return!0;return!1}e.some=S;function y(W,Y){for(let Q of W)if(Y(Q))return Q}e.find=y;function*x(W,Y){for(let Q of W)Y(Q)&&(yield Q)}e.filter=x;function*C(W,Y){let Q=0;for(let J of W)yield Y(J,Q++)}e.map=C;function*b(W,Y){let Q=0;for(let J of W)yield*Y(J,Q++)}e.flatMap=b;function*R(...W){for(let Y of W)yield*Y}e.concat=R;function L(W,Y,Q){let J=Q;for(let Se of W)J=Y(J,Se);return J}e.reduce=L;function*X(W,Y,Q=W.length){for(Y<0&&(Y+=W.length),Q<0?Q+=W.length:Q>W.length&&(Q=W.length);Y<Q;Y++)yield W[Y]}e.slice=X;function se(W,Y=Number.POSITIVE_INFINITY){let Q=[];if(Y===0)return[Q,W];let J=W[Symbol.iterator]();for(let Se=0;Se<Y;Se++){let Te=J.next();if(Te.done)return[Q,e.empty()];Q.push(Te.value)}return[Q,{[Symbol.iterator](){return J}}]}e.consume=se;async function $(W){let Y=[];for await(let Q of W)Y.push(Q);return Promise.resolve(Y)}e.asyncToArray=$})(Xm||={});function ar(e){if(Xm.is(e)){let i=[];for(let n of e)if(n)try{n.dispose()}catch(l){i.push(l)}if(i.length===1)throw i[0];if(i.length>1)throw new AggregateError(i,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function Rb(...e){return $e(()=>ar(e))}function $e(e){return{dispose:Tb(()=>{e()})}}var Gm=class Vm{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{ar(this._toDispose)}finally{this._toDispose.clear()}}add(i){if(!i)return i;if(i===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?Vm.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(i),i}delete(i){if(i){if(i===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(i),i.dispose()}}deleteAndLeak(i){i&&this._toDispose.has(i)&&(this._toDispose.delete(i),void 0)}};Gm.DISABLE_DISPOSED_WARNING=!1;var Ns=Gm,ve=class{constructor(){this._store=new Ns,this._store}dispose(){this._store.dispose()}_register(i){if(i===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(i)}};ve.None=Object.freeze({dispose(){}});var Jr=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(i){this._isDisposed||i===this._value||(this._value?.dispose(),this._value=i)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let i=this._value;return this._value=void 0,i}},is=typeof window=="object"?window:globalThis,ou=class cu{constructor(i){this.element=i,this.next=cu.Undefined,this.prev=cu.Undefined}};ou.Undefined=new ou(void 0);var Ie=ou,kg=class{constructor(){this._first=Ie.Undefined,this._last=Ie.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Ie.Undefined}clear(){let e=this._first;for(;e!==Ie.Undefined;){let i=e.next;e.prev=Ie.Undefined,e.next=Ie.Undefined,e=i}this._first=Ie.Undefined,this._last=Ie.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,i){let n=new Ie(e);if(this._first===Ie.Undefined)this._first=n,this._last=n;else if(i){let o=this._last;this._last=n,n.prev=o,o.next=n}else{let o=this._first;this._first=n,n.next=o,o.prev=n}this._size+=1;let l=!1;return()=>{l||(l=!0,this._remove(n))}}shift(){if(this._first!==Ie.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Ie.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Ie.Undefined&&e.next!==Ie.Undefined){let i=e.prev;i.next=e.next,e.next.prev=i}else e.prev===Ie.Undefined&&e.next===Ie.Undefined?(this._first=Ie.Undefined,this._last=Ie.Undefined):e.next===Ie.Undefined?(this._last=this._last.prev,this._last.next=Ie.Undefined):e.prev===Ie.Undefined&&(this._first=this._first.next,this._first.prev=Ie.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Ie.Undefined;)yield e.element,e=e.next}},Db=globalThis.performance&&typeof globalThis.performance.now=="function",Mb=class Fm{static create(i){return new Fm(i)}constructor(i){this._now=Db&&i===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},Ct;(e=>{e.None=()=>ve.None;function i(G,I){return y(G,()=>{},0,void 0,!0,void 0,I)}e.defer=i;function n(G){return(I,te=null,Z)=>{let T=!1,j;return j=G(q=>{if(!T)return j?j.dispose():T=!0,I.call(te,q)},null,Z),T&&j.dispose(),j}}e.once=n;function l(G,I,te){return f((Z,T=null,j)=>G(q=>Z.call(T,I(q)),null,j),te)}e.map=l;function o(G,I,te){return f((Z,T=null,j)=>G(q=>{I(q),Z.call(T,q)},null,j),te)}e.forEach=o;function h(G,I,te){return f((Z,T=null,j)=>G(q=>I(q)&&Z.call(T,q),null,j),te)}e.filter=h;function d(G){return G}e.signal=d;function _(...G){return(I,te=null,Z)=>{let T=Rb(...G.map(j=>j(q=>I.call(te,q))));return S(T,Z)}}e.any=_;function p(G,I,te,Z){let T=te;return l(G,j=>(T=I(T,j),T),Z)}e.reduce=p;function f(G,I){let te,Z={onWillAddFirstListener(){te=G(T.fire,T)},onDidRemoveLastListener(){te?.dispose()}},T=new V(Z);return I?.add(T),T.event}function S(G,I){return I instanceof Array?I.push(G):I&&I.add(G),G}function y(G,I,te=100,Z=!1,T=!1,j,q){let ae,fe,k,H=0,F,ee={leakWarningThreshold:j,onWillAddFirstListener(){ae=G(he=>{H++,fe=I(fe,he),Z&&!k&&(oe.fire(fe),fe=void 0),F=()=>{let ye=fe;fe=void 0,k=void 0,(!Z||H>1)&&oe.fire(ye),H=0},typeof te=="number"?(clearTimeout(k),k=setTimeout(F,te)):k===void 0&&(k=0,queueMicrotask(F))})},onWillRemoveListener(){T&&H>0&&F?.()},onDidRemoveLastListener(){F=void 0,ae.dispose()}},oe=new V(ee);return q?.add(oe),oe.event}e.debounce=y;function x(G,I=0,te){return e.debounce(G,(Z,T)=>Z?(Z.push(T),Z):[T],I,void 0,!0,void 0,te)}e.accumulate=x;function C(G,I=(Z,T)=>Z===T,te){let Z=!0,T;return h(G,j=>{let q=Z||!I(j,T);return Z=!1,T=j,q},te)}e.latch=C;function b(G,I,te){return[e.filter(G,I,te),e.filter(G,Z=>!I(Z),te)]}e.split=b;function R(G,I=!1,te=[],Z){let T=te.slice(),j=G(fe=>{T?T.push(fe):ae.fire(fe)});Z&&Z.add(j);let q=()=>{T?.forEach(fe=>ae.fire(fe)),T=null},ae=new V({onWillAddFirstListener(){j||(j=G(fe=>ae.fire(fe)),Z&&Z.add(j))},onDidAddFirstListener(){T&&(I?setTimeout(q):q())},onDidRemoveLastListener(){j&&j.dispose(),j=null}});return Z&&Z.add(ae),ae.event}e.buffer=R;function L(G,I){return(te,Z,T)=>{let j=I(new se);return G(function(q){let ae=j.evaluate(q);ae!==X&&te.call(Z,ae)},void 0,T)}}e.chain=L;let X=Symbol("HaltChainable");class se{constructor(){this.steps=[]}map(I){return this.steps.push(I),this}forEach(I){return this.steps.push(te=>(I(te),te)),this}filter(I){return this.steps.push(te=>I(te)?te:X),this}reduce(I,te){let Z=te;return this.steps.push(T=>(Z=I(Z,T),Z)),this}latch(I=(te,Z)=>te===Z){let te=!0,Z;return this.steps.push(T=>{let j=te||!I(T,Z);return te=!1,Z=T,j?T:X}),this}evaluate(I){for(let te of this.steps)if(I=te(I),I===X)break;return I}}function $(G,I,te=Z=>Z){let Z=(...ae)=>q.fire(te(...ae)),T=()=>G.on(I,Z),j=()=>G.removeListener(I,Z),q=new V({onWillAddFirstListener:T,onDidRemoveLastListener:j});return q.event}e.fromNodeEventEmitter=$;function W(G,I,te=Z=>Z){let Z=(...ae)=>q.fire(te(...ae)),T=()=>G.addEventListener(I,Z),j=()=>G.removeEventListener(I,Z),q=new V({onWillAddFirstListener:T,onDidRemoveLastListener:j});return q.event}e.fromDOMEventEmitter=W;function Y(G){return new Promise(I=>n(G)(I))}e.toPromise=Y;function Q(G){let I=new V;return G.then(te=>{I.fire(te)},()=>{I.fire(void 0)}).finally(()=>{I.dispose()}),I.event}e.fromPromise=Q;function J(G,I){return G(te=>I.fire(te))}e.forward=J;function Se(G,I,te){return I(te),G(Z=>I(Z))}e.runAndSubscribe=Se;class Te{constructor(I,te){this._observable=I,this._counter=0,this._hasChanged=!1;let Z={onWillAddFirstListener:()=>{I.addObserver(this)},onDidRemoveLastListener:()=>{I.removeObserver(this)}};this.emitter=new V(Z),te&&te.add(this.emitter)}beginUpdate(I){this._counter++}handlePossibleChange(I){}handleChange(I,te){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 zt(G,I){return new Te(G,I).emitter.event}e.fromObservable=zt;function de(G){return(I,te,Z)=>{let T=0,j=!1,q={beginUpdate(){T++},endUpdate(){T--,T===0&&(G.reportChanges(),j&&(j=!1,I.call(te)))},handlePossibleChange(){},handleChange(){j=!0}};G.addObserver(q),G.reportChanges();let ae={dispose(){G.removeObserver(q)}};return Z instanceof Ns?Z.add(ae):Array.isArray(Z)&&Z.push(ae),ae}}e.fromObservableLight=de})(Ct||={});var hu=class uu{constructor(i){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${i}_${uu._idPool++}`,uu.all.add(this)}start(i){this._stopWatch=new Mb,this.listenerCount=i}stop(){if(this._stopWatch){let i=this._stopWatch.elapsed();this.durations.push(i),this.elapsedOverall+=i,this.invocationCount+=1,this._stopWatch=void 0}}};hu.all=new Set,hu._idPool=0;var Bb=hu,Ab=-1,Zm=class Qm{constructor(i,n,l=(Qm._idPool++).toString(16).padStart(3,"0")){this._errorHandler=i,this.threshold=n,this.name=l,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(i,n){let l=this.threshold;if(l<=0||n<l)return;this._stacks||(this._stacks=new Map);let o=this._stacks.get(i.value)||0;if(this._stacks.set(i.value,o+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=l*.5;let[h,d]=this.getMostFrequentStack(),_=`[${this.name}] potential listener LEAK detected, having ${n} listeners already. MOST frequent listener (${d}):`;console.warn(_),console.warn(h);let p=new Lb(_,h);this._errorHandler(p)}return()=>{let h=this._stacks.get(i.value)||0;this._stacks.set(i.value,h-1)}}getMostFrequentStack(){if(!this._stacks)return;let i,n=0;for(let[l,o]of this._stacks)(!i||n<o)&&(i=[l,o],n=o);return i}};Zm._idPool=1;var zb=Zm,Ob=class Jm{constructor(i){this.value=i}static create(){let i=new Error;return new Jm(i.stack??"")}print(){console.warn(this.value.split(`
|
|
62
|
+
`).slice(2).join(`
|
|
63
|
+
`))}},Lb=class extends Error{constructor(e,i){super(e),this.name="ListenerLeakError",this.stack=i}},Nb=class extends Error{constructor(e,i){super(e),this.name="ListenerRefusalError",this.stack=i}},Hb=0,Kh=class{constructor(e){this.value=e,this.id=Hb++}},jb=2,Ub,V=class{constructor(i){this._size=0,this._options=i,this._leakageMon=this._options?.leakWarningThreshold?new zb(i?.onListenerError??Ia,this._options?.leakWarningThreshold??Ab):void 0,this._perfMon=this._options?._profName?new Bb(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(i,n,l)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let _=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(_);let p=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],f=new Nb(`${_}. HINT: Stack shows most frequent listener (${p[1]}-times)`,p[0]);return(this._options?.onListenerError||Ia)(f),ve.None}if(this._disposed)return ve.None;n&&(i=i.bind(n));let o=new Kh(i),h;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o.stack=Ob.create(),h=this._leakageMon.check(o.stack,this._size+1)),this._listeners?this._listeners instanceof Kh?(this._deliveryQueue??=new qb,this._listeners=[this._listeners,o]):this._listeners.push(o):(this._options?.onWillAddFirstListener?.(this),this._listeners=o,this._options?.onDidAddFirstListener?.(this)),this._size++;let d=$e(()=>{h?.(),this._removeListener(o)});return l instanceof Ns?l.add(d):Array.isArray(l)&&l.push(d),d},this._event}_removeListener(i){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let n=this._listeners,l=n.indexOf(i);if(l===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,n[l]=void 0;let o=this._deliveryQueue.current===this;if(this._size*jb<=n.length){let h=0;for(let d=0;d<n.length;d++)n[d]?n[h++]=n[d]:o&&(this._deliveryQueue.end--,h<this._deliveryQueue.i&&this._deliveryQueue.i--);n.length=h}}_deliver(i,n){if(!i)return;let l=this._options?.onListenerError||Ia;if(!l){i.value(n);return}try{i.value(n)}catch(o){l(o)}}_deliverQueue(i){let n=i.current._listeners;for(;i.i<i.end;)this._deliver(n[i.i++],i.value);i.reset()}fire(i){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof Kh)this._deliver(this._listeners,i);else{let n=this._deliveryQueue;n.enqueue(this,i,this._listeners.length),this._deliverQueue(n)}this._perfMon?.stop()}hasListeners(){return this._size>0}},qb=class{constructor(){this.i=-1,this.end=0}enqueue(e,i,n){this.i=0,this.end=n,this.current=e,this.value=i}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},du=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new V,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new V,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(i){return this.mapWindowIdToZoomLevel.get(this.getWindowId(i))??0}setZoomLevel(i,n){if(this.getZoomLevel(n)===i)return;let l=this.getWindowId(n);this.mapWindowIdToZoomLevel.set(l,i),this._onDidChangeZoomLevel.fire(l)}getZoomFactor(i){return this.mapWindowIdToZoomFactor.get(this.getWindowId(i))??1}setZoomFactor(i,n){this.mapWindowIdToZoomFactor.set(this.getWindowId(n),i)}setFullscreen(i,n){if(this.isFullscreen(n)===i)return;let l=this.getWindowId(n);this.mapWindowIdToFullScreen.set(l,i),this._onDidChangeFullscreen.fire(l)}isFullscreen(i){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(i))}getWindowId(i){return i.vscodeWindowId}};du.INSTANCE=new du;var Yu=du;function Wb(e,i,n){typeof i=="string"&&(i=e.matchMedia(i)),i.addEventListener("change",n)}Yu.INSTANCE.onDidChangeZoomLevel;function Pb(e){return Yu.INSTANCE.getZoomFactor(e)}Yu.INSTANCE.onDidChangeFullscreen;var sn=typeof navigator=="object"?navigator.userAgent:"",fu=sn.indexOf("Firefox")>=0,Kb=sn.indexOf("AppleWebKit")>=0,$u=sn.indexOf("Chrome")>=0,Yb=!$u&&sn.indexOf("Safari")>=0;sn.indexOf("Electron/")>=0;sn.indexOf("Android")>=0;var Yh=!1;if(typeof is.matchMedia=="function"){let e=is.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),i=is.matchMedia("(display-mode: fullscreen)");Yh=e.matches,Wb(is,e,({matches:n})=>{Yh&&i.matches||(Yh=n)})}var Qr="en",_u=!1,pu=!1,Xa=!1,ev=!1,Ua,Ga=Qr,Eg=Qr,$b,ts,lr=globalThis,ei;typeof lr.vscode<"u"&&typeof lr.vscode.process<"u"?ei=lr.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(ei=process);var Ib=typeof ei?.versions?.electron=="string",Xb=Ib&&ei?.type==="renderer";if(typeof ei=="object"){_u=ei.platform==="win32",pu=ei.platform==="darwin",Xa=ei.platform==="linux",Xa&&ei.env.SNAP&&ei.env.SNAP_REVISION,ei.env.CI||ei.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Ua=Qr,Ga=Qr;let e=ei.env.VSCODE_NLS_CONFIG;if(e)try{let i=JSON.parse(e);Ua=i.userLocale,Eg=i.osLocale,Ga=i.resolvedLanguage||Qr,$b=i.languagePack?.translationsConfigFile}catch{}ev=!0}else typeof navigator=="object"&&!Xb?(ts=navigator.userAgent,_u=ts.indexOf("Windows")>=0,pu=ts.indexOf("Macintosh")>=0,(ts.indexOf("Macintosh")>=0||ts.indexOf("iPad")>=0||ts.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Xa=ts.indexOf("Linux")>=0,ts?.indexOf("Mobi")>=0,Ga=globalThis._VSCODE_NLS_LANGUAGE||Qr,Ua=navigator.language.toLowerCase(),Eg=Ua):console.error("Unable to resolve platform.");var tv=_u,Oi=pu,Gb=Xa,Tg=ev,Li=ts,Bs=Ga,Vb;(e=>{function i(){return Bs}e.value=i;function n(){return Bs.length===2?Bs==="en":Bs.length>=3?Bs[0]==="e"&&Bs[1]==="n"&&Bs[2]==="-":!1}e.isDefaultVariant=n;function l(){return Bs==="en"}e.isDefault=l})(Vb||={});var Fb=typeof lr.postMessage=="function"&&!lr.importScripts;(()=>{if(Fb){let e=[];lr.addEventListener("message",n=>{if(n.data&&n.data.vscodeScheduleAsyncWork)for(let l=0,o=e.length;l<o;l++){let h=e[l];if(h.id===n.data.vscodeScheduleAsyncWork){e.splice(l,1),h.callback();return}}});let i=0;return n=>{let l=++i;e.push({id:l,callback:n}),lr.postMessage({vscodeScheduleAsyncWork:l},"*")}}return e=>setTimeout(e)})();var Zb=!!(Li&&Li.indexOf("Chrome")>=0);Li&&Li.indexOf("Firefox")>=0;!Zb&&Li&&Li.indexOf("Safari")>=0;Li&&Li.indexOf("Edg/")>=0;Li&&Li.indexOf("Android")>=0;var Fr=typeof navigator=="object"?navigator:{};Tg||document.queryCommandSupported&&document.queryCommandSupported("copy")||Fr&&Fr.clipboard&&Fr.clipboard.writeText,Tg||Fr&&Fr.clipboard&&Fr.clipboard.readText;var Iu=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,i){this._keyCodeToStr[e]=i,this._strToKeyCode[i.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},$h=new Iu,Rg=new Iu,Dg=new Iu,Qb=new Array(230),iv;(e=>{function i(_){return $h.keyCodeToStr(_)}e.toString=i;function n(_){return $h.strToKeyCode(_)}e.fromString=n;function l(_){return Rg.keyCodeToStr(_)}e.toUserSettingsUS=l;function o(_){return Dg.keyCodeToStr(_)}e.toUserSettingsGeneral=o;function h(_){return Rg.strToKeyCode(_)||Dg.strToKeyCode(_)}e.fromUserSettings=h;function d(_){if(_>=98&&_<=113)return null;switch(_){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return $h.keyCodeToStr(_)}e.toElectronAccelerator=d})(iv||={});var Jb=class sv{constructor(i,n,l,o,h){this.ctrlKey=i,this.shiftKey=n,this.altKey=l,this.metaKey=o,this.keyCode=h}equals(i){return i instanceof sv&&this.ctrlKey===i.ctrlKey&&this.shiftKey===i.shiftKey&&this.altKey===i.altKey&&this.metaKey===i.metaKey&&this.keyCode===i.keyCode}getHashCode(){let i=this.ctrlKey?"1":"0",n=this.shiftKey?"1":"0",l=this.altKey?"1":"0",o=this.metaKey?"1":"0";return`K${i}${n}${l}${o}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new e1([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},e1=class{constructor(e){if(e.length===0)throw kb("chords");this.chords=e}getHashCode(){let e="";for(let i=0,n=this.chords.length;i<n;i++)i!==0&&(e+=";"),e+=this.chords[i].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let i=0;i<this.chords.length;i++)if(!this.chords[i].equals(e.chords[i]))return!1;return!0}};function t1(e){if(e.charCode){let n=String.fromCharCode(e.charCode).toUpperCase();return iv.fromString(n)}let i=e.keyCode;if(i===3)return 7;if(fu)switch(i){case 59:return 85;case 60:if(Gb)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Oi)return 57;break}else if(Kb&&(Oi&&i===93||!Oi&&i===92))return 57;return Qb[i]||0}var i1=Oi?256:2048,s1=512,r1=1024,n1=Oi?2048:256,Mg=class{constructor(e){this._standardKeyboardEventBrand=!0;let i=e;this.browserEvent=i,this.target=i.target,this.ctrlKey=i.ctrlKey,this.shiftKey=i.shiftKey,this.altKey=i.altKey,this.metaKey=i.metaKey,this.altGraphKey=i.getModifierState?.("AltGraph"),this.keyCode=t1(i),this.code=i.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let i=0;return this.ctrlKey&&(i|=i1),this.altKey&&(i|=s1),this.shiftKey&&(i|=r1),this.metaKey&&(i|=n1),i|=e,i}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new Jb(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},Bg=new WeakMap;function l1(e){if(!e.parent||e.parent===e)return null;try{let i=e.location,n=e.parent.location;if(i.origin!=="null"&&n.origin!=="null"&&i.origin!==n.origin)return null}catch{return null}return e.parent}var a1=class{static getSameOriginWindowChain(e){let i=Bg.get(e);if(!i){i=[],Bg.set(e,i);let n=e,l;do l=l1(n),l?i.push({window:new WeakRef(n),iframeElement:n.frameElement||null}):i.push({window:new WeakRef(n),iframeElement:null}),n=l;while(n)}return i.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,i){if(!i||e===i)return{top:0,left:0};let n=0,l=0,o=this.getSameOriginWindowChain(e);for(let h of o){let d=h.window.deref();if(n+=d?.scrollY??0,l+=d?.scrollX??0,d===i||!h.iframeElement)break;let _=h.iframeElement.getBoundingClientRect();n+=_.top,l+=_.left}return{top:n,left:l}}},qa=class{constructor(i,n){this.timestamp=Date.now(),this.browserEvent=n,this.leftButton=n.button===0,this.middleButton=n.button===1,this.rightButton=n.button===2,this.buttons=n.buttons,this.target=n.target,this.detail=n.detail||1,n.type==="dblclick"&&(this.detail=2),this.ctrlKey=n.ctrlKey,this.shiftKey=n.shiftKey,this.altKey=n.altKey,this.metaKey=n.metaKey,typeof n.pageX=="number"?(this.posx=n.pageX,this.posy=n.pageY):(this.posx=n.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=n.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let l=a1.getPositionOfChildWindowRelativeToAncestorWindow(i,n.view);this.posx-=l.left,this.posy-=l.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},Ag=class{constructor(e,i=0,n=0){this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=n,this.deltaX=i;let l=!1;if($u){let o=navigator.userAgent.match(/Chrome\/(\d+)/);l=(o?parseInt(o[1]):123)<=122}if(e){let o=e,h=e,d=e.view?.devicePixelRatio||1;if(typeof o.wheelDeltaY<"u")l?this.deltaY=o.wheelDeltaY/(120*d):this.deltaY=o.wheelDeltaY/120;else if(typeof h.VERTICAL_AXIS<"u"&&h.axis===h.VERTICAL_AXIS)this.deltaY=-h.detail/3;else if(e.type==="wheel"){let _=e;_.deltaMode===_.DOM_DELTA_LINE?fu&&!Oi?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof o.wheelDeltaX<"u")Yb&&tv?this.deltaX=-(o.wheelDeltaX/120):l?this.deltaX=o.wheelDeltaX/(120*d):this.deltaX=o.wheelDeltaX/120;else if(typeof h.HORIZONTAL_AXIS<"u"&&h.axis===h.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let _=e;_.deltaMode===_.DOM_DELTA_LINE?fu&&!Oi?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(l?this.deltaY=e.wheelDelta/(120*d):this.deltaY=e.wheelDelta/120)}}preventDefault(){this.browserEvent?.preventDefault()}stopPropagation(){this.browserEvent?.stopPropagation()}},rv=Object.freeze(function(e,i){let n=setTimeout(e.bind(i),0);return{dispose(){clearTimeout(n)}}}),o1;(e=>{function i(n){return n===e.None||n===e.Cancelled||n instanceof c1?!0:!n||typeof n!="object"?!1:typeof n.isCancellationRequested=="boolean"&&typeof n.onCancellationRequested=="function"}e.isCancellationToken=i,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Ct.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:rv})})(o1||={});var c1=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?rv:(this._emitter||(this._emitter=new V),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},Xu=class{constructor(i,n){this._isDisposed=!1,this._token=-1,typeof i=="function"&&typeof n=="number"&&this.setIfNotSet(i,n)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(i,n){if(this._isDisposed)throw new au("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,i()},n)}setIfNotSet(i,n){if(this._isDisposed)throw new au("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,i()},n))}},h1=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,i,n=globalThis){if(this.isDisposed)throw new au("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let l=n.setInterval(()=>{e()},i);this.disposable=$e(()=>{n.clearInterval(l),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},u1;(e=>{async function i(l){let o,h=await Promise.all(l.map(d=>d.then(_=>_,_=>{o||(o=_)})));if(typeof o<"u")throw o;return h}e.settled=i;function n(l){return new Promise(async(o,h)=>{try{await l(o,h)}catch(d){h(d)}})}e.withAsyncBody=n})(u1||={});var zg=class fi{static fromArray(i){return new fi(n=>{n.emitMany(i)})}static fromPromise(i){return new fi(async n=>{n.emitMany(await i)})}static fromPromises(i){return new fi(async n=>{await Promise.all(i.map(async l=>n.emitOne(await l)))})}static merge(i){return new fi(async n=>{await Promise.all(i.map(async l=>{for await(let o of l)n.emitOne(o)}))})}constructor(i,n){this._state=0,this._results=[],this._error=null,this._onReturn=n,this._onStateChanged=new V,queueMicrotask(async()=>{let l={emitOne:o=>this.emitOne(o),emitMany:o=>this.emitMany(o),reject:o=>this.reject(o)};try{await Promise.resolve(i(l)),this.resolve()}catch(o){this.reject(o)}finally{l.emitOne=void 0,l.emitMany=void 0,l.reject=void 0}})}[Symbol.asyncIterator](){let i=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(i<this._results.length)return{done:!1,value:this._results[i++]};if(this._state===1)return{done:!0,value:void 0};await Ct.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(i,n){return new fi(async l=>{for await(let o of i)l.emitOne(n(o))})}map(i){return fi.map(this,i)}static filter(i,n){return new fi(async l=>{for await(let o of i)n(o)&&l.emitOne(o)})}filter(i){return fi.filter(this,i)}static coalesce(i){return fi.filter(i,n=>!!n)}coalesce(){return fi.coalesce(this)}static async toPromise(i){let n=[];for await(let l of i)n.push(l);return n}toPromise(){return fi.toPromise(this)}emitOne(i){this._state===0&&(this._results.push(i),this._onStateChanged.fire())}emitMany(i){this._state===0&&(this._results=this._results.concat(i),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(i){this._state===0&&(this._state=2,this._error=i,this._onStateChanged.fire())}};zg.EMPTY=zg.fromArray([]);var{getWindow:zi,getWindowId:d1,onDidRegisterWindow:f1}=(function(){let e=new Map,i={window:is,disposables:new Ns};e.set(is.vscodeWindowId,i);let n=new V,l=new V,o=new V;function h(d,_){return(typeof d=="number"?e.get(d):void 0)??(_?i:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:o.event,onDidUnregisterWindow:l.event,registerWindow(d){if(e.has(d.vscodeWindowId))return ve.None;let _=new Ns,p={window:d,disposables:_.add(new Ns)};return e.set(d.vscodeWindowId,p),_.add($e(()=>{e.delete(d.vscodeWindowId),l.fire(d)})),_.add(ue(d,_t.BEFORE_UNLOAD,()=>{o.fire(d)})),n.fire(p),_},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(d){return d.vscodeWindowId},hasWindow(d){return e.has(d)},getWindowById:h,getWindow(d){let _=d;if(_?.ownerDocument?.defaultView)return _.ownerDocument.defaultView.window;let p=d;return p?.view?p.view.window:is},getDocument(d){return zi(d).document}}})(),_1=class{constructor(e,i,n,l){this._node=e,this._type=i,this._handler=n,this._options=l||!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 ue(e,i,n,l){return new _1(e,i,n,l)}var Og=function(e,i,n,l){return ue(e,i,n,l)},Gu,p1=class extends h1{constructor(e){super(),this.defaultTarget=e&&zi(e)}cancelAndSet(e,i,n){return super.cancelAndSet(e,i,n??this.defaultTarget)}},Lg=class{constructor(e,i=0){this._runner=e,this.priority=i,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){Ia(e)}}static sort(e,i){return i.priority-e.priority}};(function(){let e=new Map,i=new Map,n=new Map,l=new Map,o=h=>{n.set(h,!1);let d=e.get(h)??[];for(i.set(h,d),e.set(h,[]),l.set(h,!0);d.length>0;)d.sort(Lg.sort),d.shift().execute();l.set(h,!1)};Gu=(h,d,_=0)=>{let p=d1(h),f=new Lg(d,_),S=e.get(p);return S||(S=[],e.set(p,S)),S.push(f),n.get(p)||(n.set(p,!0),h.requestAnimationFrame(()=>o(p))),f}})();function g1(e){let i=e.getBoundingClientRect(),n=zi(e);return{left:i.left+n.scrollX,top:i.top+n.scrollY,width:i.width,height:i.height}}var _t={CLICK:"click",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",KEY_DOWN:"keydown",KEY_UP:"keyup",BEFORE_UNLOAD:"beforeunload",CHANGE:"change",FOCUS:"focus",BLUR:"blur",INPUT:"input"},m1=class{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){let i=Wt(e);this._maxWidth!==i&&(this._maxWidth=i,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let i=Wt(e);this._width!==i&&(this._width=i,this.domNode.style.width=this._width)}setHeight(e){let i=Wt(e);this._height!==i&&(this._height=i,this.domNode.style.height=this._height)}setTop(e){let i=Wt(e);this._top!==i&&(this._top=i,this.domNode.style.top=this._top)}setLeft(e){let i=Wt(e);this._left!==i&&(this._left=i,this.domNode.style.left=this._left)}setBottom(e){let i=Wt(e);this._bottom!==i&&(this._bottom=i,this.domNode.style.bottom=this._bottom)}setRight(e){let i=Wt(e);this._right!==i&&(this._right=i,this.domNode.style.right=this._right)}setPaddingTop(e){let i=Wt(e);this._paddingTop!==i&&(this._paddingTop=i,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let i=Wt(e);this._paddingLeft!==i&&(this._paddingLeft=i,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let i=Wt(e);this._paddingBottom!==i&&(this._paddingBottom=i,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let i=Wt(e);this._paddingRight!==i&&(this._paddingRight=i,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let i=Wt(e);this._fontSize!==i&&(this._fontSize=i,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let i=Wt(e);this._lineHeight!==i&&(this._lineHeight=i,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let i=Wt(e);this._letterSpacing!==i&&(this._letterSpacing=i,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,i){this.domNode.classList.toggle(e,i),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,i){this.domNode.setAttribute(e,i)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function Wt(e){return typeof e=="number"?`${e}px`:e}function fl(e){return new m1(e)}var nv=class{constructor(){this._hooks=new Ns,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,i){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let n=this._onStopCallback;this._onStopCallback=null,e&&n&&n(i)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,i,n,l,o){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=l,this._onStopCallback=o;let h=e;try{e.setPointerCapture(i),this._hooks.add($e(()=>{try{e.releasePointerCapture(i)}catch{}}))}catch{h=zi(e)}this._hooks.add(ue(h,_t.POINTER_MOVE,d=>{if(d.buttons!==n){this.stopMonitoring(!0);return}d.preventDefault(),this._pointerMoveCallback(d)})),this._hooks.add(ue(h,_t.POINTER_UP,d=>this.stopMonitoring(!0)))}};function v1(e,i,n){let l=null,o=null;if(typeof n.value=="function"?(l="value",o=n.value,o.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof n.get=="function"&&(l="get",o=n.get),!o)throw new Error("not supported");let h=`$memoize$${i}`;n[l]=function(...d){return this.hasOwnProperty(h)||Object.defineProperty(this,h,{configurable:!1,enumerable:!1,writable:!1,value:o.apply(this,d)}),this[h]}}var Bi;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(Bi||={});var al=class Et extends ve{constructor(){super(),this.dispatched=!1,this.targets=new kg,this.ignoreTargets=new kg,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(Ct.runAndSubscribe(f1,({window:i,disposables:n})=>{n.add(ue(i.document,"touchstart",l=>this.onTouchStart(l),{passive:!1})),n.add(ue(i.document,"touchend",l=>this.onTouchEnd(i,l))),n.add(ue(i.document,"touchmove",l=>this.onTouchMove(l),{passive:!1}))},{window:is,disposables:this._store}))}static addTarget(i){if(!Et.isTouchDevice())return ve.None;Et.INSTANCE||(Et.INSTANCE=new Et);let n=Et.INSTANCE.targets.push(i);return $e(n)}static ignoreTarget(i){if(!Et.isTouchDevice())return ve.None;Et.INSTANCE||(Et.INSTANCE=new Et);let n=Et.INSTANCE.ignoreTargets.push(i);return $e(n)}static isTouchDevice(){return"ontouchstart"in is||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(i){let n=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let l=0,o=i.targetTouches.length;l<o;l++){let h=i.targetTouches.item(l);this.activeTouches[h.identifier]={id:h.identifier,initialTarget:h.target,initialTimeStamp:n,initialPageX:h.pageX,initialPageY:h.pageY,rollingTimestamps:[n],rollingPageX:[h.pageX],rollingPageY:[h.pageY]};let d=this.newGestureEvent(Bi.Start,h.target);d.pageX=h.pageX,d.pageY=h.pageY,this.dispatchEvent(d)}this.dispatched&&(i.preventDefault(),i.stopPropagation(),this.dispatched=!1)}onTouchEnd(i,n){let l=Date.now(),o=Object.keys(this.activeTouches).length;for(let h=0,d=n.changedTouches.length;h<d;h++){let _=n.changedTouches.item(h);if(!this.activeTouches.hasOwnProperty(String(_.identifier))){console.warn("move of an UNKNOWN touch",_);continue}let p=this.activeTouches[_.identifier],f=Date.now()-p.initialTimeStamp;if(f<Et.HOLD_DELAY&&Math.abs(p.initialPageX-Qt(p.rollingPageX))<30&&Math.abs(p.initialPageY-Qt(p.rollingPageY))<30){let S=this.newGestureEvent(Bi.Tap,p.initialTarget);S.pageX=Qt(p.rollingPageX),S.pageY=Qt(p.rollingPageY),this.dispatchEvent(S)}else if(f>=Et.HOLD_DELAY&&Math.abs(p.initialPageX-Qt(p.rollingPageX))<30&&Math.abs(p.initialPageY-Qt(p.rollingPageY))<30){let S=this.newGestureEvent(Bi.Contextmenu,p.initialTarget);S.pageX=Qt(p.rollingPageX),S.pageY=Qt(p.rollingPageY),this.dispatchEvent(S)}else if(o===1){let S=Qt(p.rollingPageX),y=Qt(p.rollingPageY),x=Qt(p.rollingTimestamps)-p.rollingTimestamps[0],C=S-p.rollingPageX[0],b=y-p.rollingPageY[0],R=[...this.targets].filter(L=>p.initialTarget instanceof Node&&L.contains(p.initialTarget));this.inertia(i,R,l,Math.abs(C)/x,C>0?1:-1,S,Math.abs(b)/x,b>0?1:-1,y)}this.dispatchEvent(this.newGestureEvent(Bi.End,p.initialTarget)),delete this.activeTouches[_.identifier]}this.dispatched&&(n.preventDefault(),n.stopPropagation(),this.dispatched=!1)}newGestureEvent(i,n){let l=document.createEvent("CustomEvent");return l.initEvent(i,!1,!0),l.initialTarget=n,l.tapCount=0,l}dispatchEvent(i){if(i.type===Bi.Tap){let n=new Date().getTime(),l=0;n-this._lastSetTapCountTime>Et.CLEAR_TAP_COUNT_TIME?l=1:l=2,this._lastSetTapCountTime=n,i.tapCount=l}else(i.type===Bi.Change||i.type===Bi.Contextmenu)&&(this._lastSetTapCountTime=0);if(i.initialTarget instanceof Node){for(let l of this.ignoreTargets)if(l.contains(i.initialTarget))return;let n=[];for(let l of this.targets)if(l.contains(i.initialTarget)){let o=0,h=i.initialTarget;for(;h&&h!==l;)o++,h=h.parentElement;n.push([o,l])}n.sort((l,o)=>l[0]-o[0]);for(let[l,o]of n)o.dispatchEvent(i),this.dispatched=!0}}inertia(i,n,l,o,h,d,_,p,f){this.handle=Gu(i,()=>{let S=Date.now(),y=S-l,x=0,C=0,b=!0;o+=Et.SCROLL_FRICTION*y,_+=Et.SCROLL_FRICTION*y,o>0&&(b=!1,x=h*o*y),_>0&&(b=!1,C=p*_*y);let R=this.newGestureEvent(Bi.Change);R.translationX=x,R.translationY=C,n.forEach(L=>L.dispatchEvent(R)),b||this.inertia(i,n,S,o,h,d+x,_,p,f+C)})}onTouchMove(i){let n=Date.now();for(let l=0,o=i.changedTouches.length;l<o;l++){let h=i.changedTouches.item(l);if(!this.activeTouches.hasOwnProperty(String(h.identifier))){console.warn("end of an UNKNOWN touch",h);continue}let d=this.activeTouches[h.identifier],_=this.newGestureEvent(Bi.Change,d.initialTarget);_.translationX=h.pageX-Qt(d.rollingPageX),_.translationY=h.pageY-Qt(d.rollingPageY),_.pageX=h.pageX,_.pageY=h.pageY,this.dispatchEvent(_),d.rollingPageX.length>3&&(d.rollingPageX.shift(),d.rollingPageY.shift(),d.rollingTimestamps.shift()),d.rollingPageX.push(h.pageX),d.rollingPageY.push(h.pageY),d.rollingTimestamps.push(n)}this.dispatched&&(i.preventDefault(),i.stopPropagation(),this.dispatched=!1)}};al.SCROLL_FRICTION=-.005,al.HOLD_DELAY=700,al.CLEAR_TAP_COUNT_TIME=400,Ze([v1],al,"isTouchDevice",1);var S1=al,Vu=class extends ve{onclick(e,i){this._register(ue(e,_t.CLICK,n=>i(new qa(zi(e),n))))}onmousedown(e,i){this._register(ue(e,_t.MOUSE_DOWN,n=>i(new qa(zi(e),n))))}onmouseover(e,i){this._register(ue(e,_t.MOUSE_OVER,n=>i(new qa(zi(e),n))))}onmouseleave(e,i){this._register(ue(e,_t.MOUSE_LEAVE,n=>i(new qa(zi(e),n))))}onkeydown(e,i){this._register(ue(e,_t.KEY_DOWN,n=>i(new Mg(n))))}onkeyup(e,i){this._register(ue(e,_t.KEY_UP,n=>i(new Mg(n))))}oninput(e,i){this._register(ue(e,_t.INPUT,i))}onblur(e,i){this._register(ue(e,_t.BLUR,i))}onfocus(e,i){this._register(ue(e,_t.FOCUS,i))}onchange(e,i){this._register(ue(e,_t.CHANGE,i))}ignoreGesture(e){return S1.ignoreTarget(e)}},Ng=11,y1=class extends Vu{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.style.position="absolute",this.domNode.style.width=Ng+"px",this.domNode.style.height=Ng+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new nv),this._register(Og(this.bgDomNode,_t.POINTER_DOWN,i=>this._arrowPointerDown(i))),this._register(Og(this.domNode,_t.POINTER_DOWN,i=>this._arrowPointerDown(i))),this._pointerdownRepeatTimer=this._register(new p1),this._pointerdownScheduleRepeatTimer=this._register(new Xu)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let i=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,zi(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(i,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,n=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},b1=class gu{constructor(i,n,l,o,h,d,_){this._forceIntegerValues=i,this._scrollStateBrand=void 0,this._forceIntegerValues&&(n=n|0,l=l|0,o=o|0,h=h|0,d=d|0,_=_|0),this.rawScrollLeft=o,this.rawScrollTop=_,n<0&&(n=0),o+n>l&&(o=l-n),o<0&&(o=0),h<0&&(h=0),_+h>d&&(_=d-h),_<0&&(_=0),this.width=n,this.scrollWidth=l,this.scrollLeft=o,this.height=h,this.scrollHeight=d,this.scrollTop=_}equals(i){return this.rawScrollLeft===i.rawScrollLeft&&this.rawScrollTop===i.rawScrollTop&&this.width===i.width&&this.scrollWidth===i.scrollWidth&&this.scrollLeft===i.scrollLeft&&this.height===i.height&&this.scrollHeight===i.scrollHeight&&this.scrollTop===i.scrollTop}withScrollDimensions(i,n){return new gu(this._forceIntegerValues,typeof i.width<"u"?i.width:this.width,typeof i.scrollWidth<"u"?i.scrollWidth:this.scrollWidth,n?this.rawScrollLeft:this.scrollLeft,typeof i.height<"u"?i.height:this.height,typeof i.scrollHeight<"u"?i.scrollHeight:this.scrollHeight,n?this.rawScrollTop:this.scrollTop)}withScrollPosition(i){return new gu(this._forceIntegerValues,this.width,this.scrollWidth,typeof i.scrollLeft<"u"?i.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof i.scrollTop<"u"?i.scrollTop:this.rawScrollTop)}createScrollEvent(i,n){let l=this.width!==i.width,o=this.scrollWidth!==i.scrollWidth,h=this.scrollLeft!==i.scrollLeft,d=this.height!==i.height,_=this.scrollHeight!==i.scrollHeight,p=this.scrollTop!==i.scrollTop;return{inSmoothScrolling:n,oldWidth:i.width,oldScrollWidth:i.scrollWidth,oldScrollLeft:i.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:i.height,oldScrollHeight:i.scrollHeight,oldScrollTop:i.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:l,scrollWidthChanged:o,scrollLeftChanged:h,heightChanged:d,scrollHeightChanged:_,scrollTopChanged:p}}},x1=class extends ve{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new V),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new b1(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,i){let n=this._state.withScrollDimensions(e,i);this._setState(n,!!this._smoothScrolling),this._smoothScrolling?.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let i=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(i,!1)}setScrollPositionSmooth(e,i){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};let n=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===n.scrollLeft&&this._smoothScrolling.to.scrollTop===n.scrollTop)return;let l;i?l=new jg(this._smoothScrolling.from,n,this._smoothScrolling.startTime,this._smoothScrolling.duration):l=this._smoothScrolling.combine(this._state,n,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=l}else{let n=this._state.withScrollPosition(e);this._smoothScrolling=jg.start(this._state,n,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),i=this._state.withScrollPosition(e);if(this._setState(i,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,i){let n=this._state;n.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(n,i)))}},Hg=class{constructor(e,i,n){this.scrollLeft=e,this.scrollTop=i,this.isDone=n}};function Ih(e,i){let n=i-e;return function(l){return e+n*k1(l)}}function w1(e,i,n){return function(l){return l<n?e(l/n):i((l-n)/(1-n))}}var jg=class mu{constructor(i,n,l,o){this.from=i,this.to=n,this.duration=o,this.startTime=l,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(i,n,l){if(Math.abs(i-n)>2.5*l){let o,h;return i<n?(o=i+.75*l,h=n-.75*l):(o=i-.75*l,h=n+.75*l),w1(Ih(i,o),Ih(h,n),.33)}return Ih(i,n)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(i){this.to=i.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(i){let n=(i-this.startTime)/this.duration;if(n<1){let l=this.scrollLeft(n),o=this.scrollTop(n);return new Hg(l,o,!1)}return new Hg(this.to.scrollLeft,this.to.scrollTop,!0)}combine(i,n,l){return mu.start(i,n,l)}static start(i,n,l){l=l+10;let o=Date.now()-10;return new mu(i,n,o,l)}};function C1(e){return Math.pow(e,3)}function k1(e){return 1-C1(1-e)}var E1=class extends ve{constructor(e,i,n){super(),this._visibility=e,this._visibleClassName=i,this._invisibleClassName=n,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new Xu)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){let e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{this._domNode?.setClassName(this._visibleClassName)},0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(e?" fade":"")))}},T1=140,lv=class extends Vu{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new E1(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new nv),this._shouldRender=!0,this.domNode=fl(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(ue(this.domNode.domNode,_t.POINTER_DOWN,i=>this._domNodePointerDown(i)))}_createArrow(e){let i=this._register(new y1(e));this.domNode.domNode.appendChild(i.bgDomNode),this.domNode.domNode.appendChild(i.domNode)}_createSlider(e,i,n,l){this.slider=fl(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(i),typeof n=="number"&&this.slider.setWidth(n),typeof l=="number"&&this.slider.setHeight(l),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(ue(this.slider.domNode,_t.POINTER_DOWN,o=>{o.button===0&&(o.preventDefault(),this._sliderPointerDown(o))})),this.onclick(this.slider.domNode,o=>{o.leftButton&&o.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let i=this.domNode.domNode.getClientRects()[0].top,n=i+this._scrollbarState.getSliderPosition(),l=i+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),o=this._sliderPointerPosition(e);n<=o&&o<=l?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let i,n;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")i=e.offsetX,n=e.offsetY;else{let o=g1(this.domNode.domNode);i=e.pageX-o.left,n=e.pageY-o.top}let l=this._pointerDownRelativePosition(i,n);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(l):this._scrollbarState.getDesiredScrollPositionFromOffset(l)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let i=this._sliderPointerPosition(e),n=this._sliderOrthogonalPointerPosition(e),l=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,o=>{let h=this._sliderOrthogonalPointerPosition(o),d=Math.abs(h-n);if(tv&&d>T1){this._setDesiredScrollPositionNow(l.getScrollPosition());return}let _=this._sliderPointerPosition(o)-i;this._setDesiredScrollPositionNow(l.getDesiredScrollPositionFromDelta(_))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let i={};this.writeScrollPosition(i,e),this._scrollable.setScrollPositionNow(i)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},av=class vu{constructor(i,n,l,o,h,d){this._scrollbarSize=Math.round(n),this._oppositeScrollbarSize=Math.round(l),this._arrowSize=Math.round(i),this._visibleSize=o,this._scrollSize=h,this._scrollPosition=d,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new vu(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(i){let n=Math.round(i);return this._visibleSize!==n?(this._visibleSize=n,this._refreshComputedValues(),!0):!1}setScrollSize(i){let n=Math.round(i);return this._scrollSize!==n?(this._scrollSize=n,this._refreshComputedValues(),!0):!1}setScrollPosition(i){let n=Math.round(i);return this._scrollPosition!==n?(this._scrollPosition=n,this._refreshComputedValues(),!0):!1}setScrollbarSize(i){this._scrollbarSize=Math.round(i)}setOppositeScrollbarSize(i){this._oppositeScrollbarSize=Math.round(i)}static _computeValues(i,n,l,o,h){let d=Math.max(0,l-i),_=Math.max(0,d-2*n),p=o>0&&o>l;if(!p)return{computedAvailableSize:Math.round(d),computedIsNeeded:p,computedSliderSize:Math.round(_),computedSliderRatio:0,computedSliderPosition:0};let f=Math.round(Math.max(20,Math.floor(l*_/o))),S=(_-f)/(o-l),y=h*S;return{computedAvailableSize:Math.round(d),computedIsNeeded:p,computedSliderSize:Math.round(f),computedSliderRatio:S,computedSliderPosition:Math.round(y)}}_refreshComputedValues(){let i=vu._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=i.computedAvailableSize,this._computedIsNeeded=i.computedIsNeeded,this._computedSliderSize=i.computedSliderSize,this._computedSliderRatio=i.computedSliderRatio,this._computedSliderPosition=i.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(i){if(!this._computedIsNeeded)return 0;let n=i-this._arrowSize-this._computedSliderSize/2;return Math.round(n/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(i){if(!this._computedIsNeeded)return 0;let n=i-this._arrowSize,l=this._scrollPosition;return n<this._computedSliderPosition?l-=this._visibleSize:l+=this._visibleSize,l}getDesiredScrollPositionFromDelta(i){if(!this._computedIsNeeded)return 0;let n=this._computedSliderPosition+i;return Math.round(n/this._computedSliderRatio)}},R1=class extends lv{constructor(e,i,n){let l=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:i.lazyRender,host:n,scrollbarState:new av(i.horizontalHasArrows?i.arrowSize:0,i.horizontal===2?0:i.horizontalScrollbarSize,i.vertical===2?0:i.verticalScrollbarSize,l.width,l.scrollWidth,o.scrollLeft),visibility:i.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:i.scrollByPage}),i.horizontalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(Math.floor((i.horizontalScrollbarSize-i.horizontalSliderSize)/2),0,void 0,i.horizontalSliderSize)}_updateSlider(e,i){this.slider.setWidth(e),this.slider.setLeft(i)}_renderDomNode(e,i){this.domNode.setWidth(e),this.domNode.setHeight(i),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,i){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,i){e.scrollLeft=i}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}},D1=class extends lv{constructor(e,i,n){let l=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:i.lazyRender,host:n,scrollbarState:new av(i.verticalHasArrows?i.arrowSize:0,i.vertical===2?0:i.verticalScrollbarSize,0,l.height,l.scrollHeight,o.scrollTop),visibility:i.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:i.scrollByPage}),i.verticalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(0,Math.floor((i.verticalScrollbarSize-i.verticalSliderSize)/2),i.verticalSliderSize,void 0)}_updateSlider(e,i){this.slider.setHeight(e),this.slider.setTop(i)}_renderDomNode(e,i){this.domNode.setWidth(i),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,i){return i}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,i){e.scrollTop=i}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},M1=500,Ug=50,B1=class{constructor(e,i,n){this.timestamp=e,this.deltaX=i,this.deltaY=n,this.score=0}},Su=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let i=1,n=0,l=1,o=this._rear;do{let h=o===this._front?i:Math.pow(2,-l);if(i-=h,n+=this._memory[o].score*h,o===this._front)break;o=(this._capacity+o-1)%this._capacity,l++}while(!0);return n<=.5}acceptStandardWheelEvent(i){if($u){let n=zi(i.browserEvent),l=Pb(n);this.accept(Date.now(),i.deltaX*l,i.deltaY*l)}else this.accept(Date.now(),i.deltaX,i.deltaY)}accept(i,n,l){let o=null,h=new B1(i,n,l);this._front===-1&&this._rear===-1?(this._memory[0]=h,this._front=0,this._rear=0):(o=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=h),h.score=this._computeScore(h,o)}_computeScore(i,n){if(Math.abs(i.deltaX)>0&&Math.abs(i.deltaY)>0)return 1;let l=.5;if((!this._isAlmostInt(i.deltaX)||!this._isAlmostInt(i.deltaY))&&(l+=.25),n){let o=Math.abs(i.deltaX),h=Math.abs(i.deltaY),d=Math.abs(n.deltaX),_=Math.abs(n.deltaY),p=Math.max(Math.min(o,d),1),f=Math.max(Math.min(h,_),1),S=Math.max(o,d),y=Math.max(h,_);S%p===0&&y%f===0&&(l-=.5)}return Math.min(Math.max(l,0),1)}_isAlmostInt(i){return Math.abs(Math.round(i)-i)<.01}};Su.INSTANCE=new Su;var A1=Su,z1=class extends Vu{constructor(e,i,n){super(),this._onScroll=this._register(new V),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new V),this.onWillScroll=this._onWillScroll.event,this._options=L1(i),this._scrollable=n,this._register(this._scrollable.onScroll(o=>{this._onWillScroll.fire(o),this._onDidScroll(o),this._onScroll.fire(o)}));let l={onMouseWheel:o=>this._onMouseWheel(o),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new D1(this._scrollable,this._options,l)),this._horizontalScrollbar=this._register(new R1(this._scrollable,this._options,l)),this._domNode=document.createElement("div"),this._domNode.className="xterm-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=fl(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=fl(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=fl(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,o=>this._onMouseOver(o)),this.onmouseleave(this._listenOnDomNode,o=>this._onMouseLeave(o)),this._hideTimeout=this._register(new Xu),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=ar(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,Oi&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new Ag(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=ar(this._mouseWheelToDispose),e)){let i=n=>{this._onMouseWheel(new Ag(n))};this._mouseWheelToDispose.push(ue(this._listenOnDomNode,_t.MOUSE_WHEEL,i,{passive:!1}))}}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;let i=A1.INSTANCE;i.acceptStandardWheelEvent(e);let n=!1;if(e.deltaY||e.deltaX){let o=e.deltaY*this._options.mouseWheelScrollSensitivity,h=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&h+o===0?h=o=0:Math.abs(o)>=Math.abs(h)?h=0:o=0),this._options.flipAxes&&([o,h]=[h,o]);let d=!Oi&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||d)&&!h&&(h=o,o=0),e.browserEvent&&e.browserEvent.altKey&&(h=h*this._options.fastScrollSensitivity,o=o*this._options.fastScrollSensitivity);let _=this._scrollable.getFutureScrollPosition(),p={};if(o){let f=Ug*o,S=_.scrollTop-(f<0?Math.floor(f):Math.ceil(f));this._verticalScrollbar.writeScrollPosition(p,S)}if(h){let f=Ug*h,S=_.scrollLeft-(f<0?Math.floor(f):Math.ceil(f));this._horizontalScrollbar.writeScrollPosition(p,S)}p=this._scrollable.validateScrollPosition(p),(_.scrollLeft!==p.scrollLeft||_.scrollTop!==p.scrollTop)&&(this._options.mouseWheelSmoothScroll&&i.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(p):this._scrollable.setScrollPositionNow(p),n=!0)}let l=n;!l&&this._options.alwaysConsumeMouseWheel&&(l=!0),!l&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(l=!0),l&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),i=e.scrollTop>0,n=e.scrollLeft>0,l=n?" left":"",o=i?" top":"",h=n||i?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${l}`),this._topShadowDomNode.setClassName(`shadow${o}`),this._topLeftShadowDomNode.setClassName(`shadow${h}${o}${l}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),M1)}},O1=class extends z1{constructor(e,i,n){super(e,i,n)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function L1(e){let i={lazyRender:typeof e.lazyRender<"u"?e.lazyRender:!1,className:typeof e.className<"u"?e.className:"",useShadows:typeof e.useShadows<"u"?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<"u"?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<"u"?e.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<"u"?e.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<"u"?e.alwaysConsumeMouseWheel:!1,scrollYToX:typeof e.scrollYToX<"u"?e.scrollYToX:!1,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<"u"?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<"u"?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<"u"?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<"u"?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<"u"?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<"u"?e.listenOnDomNode:null,horizontal:typeof e.horizontal<"u"?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<"u"?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<"u"?e.horizontalHasArrows:!1,vertical:typeof e.vertical<"u"?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<"u"?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<"u"?e.verticalHasArrows:!1,verticalSliderSize:typeof e.verticalSliderSize<"u"?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<"u"?e.scrollByPage:!1};return i.horizontalSliderSize=typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:i.horizontalScrollbarSize,i.verticalSliderSize=typeof e.verticalSliderSize<"u"?e.verticalSliderSize:i.verticalScrollbarSize,Oi&&(i.className+=" mac"),i}var yu=class extends ve{constructor(e,i,n,l,o,h,d,_){super(),this._bufferService=n,this._optionsService=d,this._renderService=_,this._onRequestScrollLines=this._register(new V),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let p=this._register(new x1({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:f=>Gu(l.window,f)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{p.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new O1(i,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},p)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(o.onProtocolChange(f=>{this._scrollableElement.updateOptions({handleMouseWheel:!(f&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(Ct.runAndSubscribe(h.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=h.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register($e(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=l.mainDocument.createElement("style"),i.appendChild(this._styleElement),this._register($e(()=>this._styleElement.remove())),this._register(Ct.runAndSubscribe(h.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${h.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${h.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${h.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
|
|
64
|
+
`)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(f=>this._handleScroll(f)))}scrollLines(e){let i=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:i.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,i){i&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!i,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.width||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let i=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),n=i-this._bufferService.buffer.ydisp;n!==0&&(this._latestYDisp=i,this._onRequestScrollLines.fire(n)),this._isHandlingScroll=!1}};yu=Ze([ie(2,Bt),ie(3,rs),ie(4,Wm),ie(5,tn),ie(6,At),ie(7,ns)],yu);var bu=class extends ve{constructor(e,i,n,l,o){super(),this._screenElement=e,this._bufferService=i,this._coreBrowserService=n,this._decorationService=l,this._renderService=o,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(h=>this._removeDecoration(h))),this._register($e(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){let i=this._coreBrowserService.mainDocument.createElement("div");i.classList.add("xterm-decoration"),i.classList.toggle("xterm-decoration-top-layer",e?.options?.layer==="top"),i.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,i.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,i.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,i.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let n=e.options.x??0;return n&&n>this._bufferService.cols&&(i.style.display="none"),this._refreshXPosition(e,i),i}_refreshStyle(e){let i=e.marker.line-this._bufferService.buffers.active.ydisp;if(i<0||i>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let n=this._decorationElements.get(e);n||(n=this._createElement(e),e.element=n,this._decorationElements.set(e,n),this._container.appendChild(n),e.onDispose(()=>{this._decorationElements.delete(e),n.remove()})),n.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(n.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,n.style.top=`${i*this._renderService.dimensions.css.cell.height}px`,n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(n)}}_refreshXPosition(e,i=e.element){if(!i)return;let n=e.options.x??0;(e.options.anchor||"left")==="right"?i.style.right=n?`${n*this._renderService.dimensions.css.cell.width}px`:"":i.style.left=n?`${n*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){this._decorationElements.get(e)?.remove(),this._decorationElements.delete(e),e.dispose()}};bu=Ze([ie(1,Bt),ie(2,rs),ie(3,vl),ie(4,ns)],bu);var N1=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(e){if(e.options.overviewRulerOptions){for(let i of this._zones)if(i.color===e.options.overviewRulerOptions.color&&i.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(i,e.marker.line))return;if(this._lineAdjacentToZone(i,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(i,e.marker.line);return}}if(this._zonePoolIndex<this._zonePool.length){this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++]);return}this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,i){return i>=e.startBufferLine&&i<=e.endBufferLine}_lineAdjacentToZone(e,i,n){return i>=e.startBufferLine-this._linePadding[n||"full"]&&i<=e.endBufferLine+this._linePadding[n||"full"]}_addLineToZone(e,i){e.startBufferLine=Math.min(e.startBufferLine,i),e.endBufferLine=Math.max(e.endBufferLine,i)}},Di={full:0,left:0,center:0,right:0},As={full:0,left:0,center:0,right:0},Jn={full:0,left:0,center:0,right:0},eo=class extends ve{constructor(e,i,n,l,o,h,d,_){super(),this._viewportElement=e,this._screenElement=i,this._bufferService=n,this._decorationService=l,this._renderService=o,this._optionsService=h,this._themeService=d,this._coreBrowserService=_,this._colorZoneStore=new N1,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),this._register($e(()=>this._canvas?.remove()));let p=this._canvas.getContext("2d");if(p)this._ctx=p;else throw new Error("Ctx cannot be null");this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),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())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange("overviewRuler",()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){return this._optionsService.options.overviewRuler?.width||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),i=Math.ceil((this._canvas.width-1)/3);As.full=this._canvas.width,As.left=e,As.center=i,As.right=e,this._refreshDrawHeightConstants(),Jn.full=1,Jn.left=1,Jn.center=1+As.left,Jn.right=1+As.left+As.center}_refreshDrawHeightConstants(){Di.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,i=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);Di.left=i,Di.center=i,Di.right=i}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Di.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Di.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Di.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Di.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(let i of this._decorationService.decorations)this._colorZoneStore.addDecoration(i);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let i of e)i.position!=="full"&&this._renderColorZone(i);for(let i of e)i.position==="full"&&this._renderColorZone(i);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(Jn[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-Di[e.position||"full"]/2),As[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+Di[e.position||"full"]))}_queueRefresh(e,i){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=i||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};eo=Ze([ie(2,Bt),ie(3,vl),ie(4,ns),ie(5,At),ie(6,tn),ie(7,rs)],eo);var K;(e=>(e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="\x07",e.BS="\b",e.HT=" ",e.LF=`
|
|
65
|
+
`,e.VT="\v",e.FF="\f",e.CR="\r",e.SO="",e.SI="",e.DLE="",e.DC1="",e.DC2="",e.DC3="",e.DC4="",e.NAK="",e.SYN="",e.ETB="",e.CAN="",e.EM="",e.SUB="",e.ESC="\x1B",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL=""))(K||={});var Va;(e=>(e.PAD="",e.HOP="",e.BPH="",e.NBH="",e.IND="",e.NEL="
",e.SSA="",e.ESA="",e.HTS="",e.HTJ="",e.VTS="",e.PLD="",e.PLU="",e.RI="",e.SS2="",e.SS3="",e.DCS="",e.PU1="",e.PU2="",e.STS="",e.CCH="",e.MW="",e.SPA="",e.EPA="",e.SOS="",e.SGCI="",e.SCI="",e.CSI="",e.ST="",e.OSC="",e.PM="",e.APC=""))(Va||={});var ov;(e=>e.ST=`${K.ESC}\\`)(ov||={});var xu=class{constructor(e,i,n,l,o,h){this._textarea=e,this._compositionView=i,this._bufferService=n,this._optionsService=l,this._coreService=o,this._renderService=h,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}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===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let i={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let n;i.start+=this._dataAlreadySent.length,this._isComposing?n=this._textarea.value.substring(i.start,this._compositionPosition.start):n=this._textarea.value.substring(i.start),n.length>0&&this._coreService.triggerDataEvent(n,!0)}},0)}else{this._isSendingComposition=!1;let i=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(i,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let i=this._textarea.value,n=i.replace(e,"");this._dataAlreadySent=n,i.length>e.length?this._coreService.triggerDataEvent(n,!0):i.length<e.length?this._coreService.triggerDataEvent(`${K.DEL}`,!0):i.length===e.length&&i!==e&&this._coreService.triggerDataEvent(i,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let i=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),n=this._renderService.dimensions.css.cell.height,l=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,o=i*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=o+"px",this._compositionView.style.top=l+"px",this._compositionView.style.height=n+"px",this._compositionView.style.lineHeight=n+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let h=this._compositionView.getBoundingClientRect();this._textarea.style.left=o+"px",this._textarea.style.top=l+"px",this._textarea.style.width=Math.max(h.width,1)+"px",this._textarea.style.height=Math.max(h.height,1)+"px",this._textarea.style.lineHeight=h.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};xu=Ze([ie(2,Bt),ie(3,At),ie(4,hr),ie(5,ns)],xu);var pt=0,gt=0,mt=0,Fe=0,qg={css:"#00000000",rgba:0},lt;(e=>{function i(o,h,d,_){return _!==void 0?`#${tr(o)}${tr(h)}${tr(d)}${tr(_)}`:`#${tr(o)}${tr(h)}${tr(d)}`}e.toCss=i;function n(o,h,d,_=255){return(o<<24|h<<16|d<<8|_)>>>0}e.toRgba=n;function l(o,h,d,_){return{css:e.toCss(o,h,d,_),rgba:e.toRgba(o,h,d,_)}}e.toColor=l})(lt||={});var Ke;(e=>{function i(p,f){if(Fe=(f.rgba&255)/255,Fe===1)return{css:f.css,rgba:f.rgba};let S=f.rgba>>24&255,y=f.rgba>>16&255,x=f.rgba>>8&255,C=p.rgba>>24&255,b=p.rgba>>16&255,R=p.rgba>>8&255;pt=C+Math.round((S-C)*Fe),gt=b+Math.round((y-b)*Fe),mt=R+Math.round((x-R)*Fe);let L=lt.toCss(pt,gt,mt),X=lt.toRgba(pt,gt,mt);return{css:L,rgba:X}}e.blend=i;function n(p){return(p.rgba&255)===255}e.isOpaque=n;function l(p,f,S){let y=Fa.ensureContrastRatio(p.rgba,f.rgba,S);if(y)return lt.toColor(y>>24&255,y>>16&255,y>>8&255)}e.ensureContrastRatio=l;function o(p){let f=(p.rgba|255)>>>0;return[pt,gt,mt]=Fa.toChannels(f),{css:lt.toCss(pt,gt,mt),rgba:f}}e.opaque=o;function h(p,f){return Fe=Math.round(f*255),[pt,gt,mt]=Fa.toChannels(p.rgba),{css:lt.toCss(pt,gt,mt,Fe),rgba:lt.toRgba(pt,gt,mt,Fe)}}e.opacity=h;function d(p,f){return Fe=p.rgba&255,h(p,Fe*f/255)}e.multiplyOpacity=d;function _(p){return[p.rgba>>24&255,p.rgba>>16&255,p.rgba>>8&255]}e.toColorRGB=_})(Ke||={});var Xe;(e=>{let i,n;try{let o=document.createElement("canvas");o.width=1,o.height=1;let h=o.getContext("2d",{willReadFrequently:!0});h&&(i=h,i.globalCompositeOperation="copy",n=i.createLinearGradient(0,0,1,1))}catch{}function l(o){if(o.match(/#[\da-f]{3,8}/i))switch(o.length){case 4:return pt=parseInt(o.slice(1,2).repeat(2),16),gt=parseInt(o.slice(2,3).repeat(2),16),mt=parseInt(o.slice(3,4).repeat(2),16),lt.toColor(pt,gt,mt);case 5:return pt=parseInt(o.slice(1,2).repeat(2),16),gt=parseInt(o.slice(2,3).repeat(2),16),mt=parseInt(o.slice(3,4).repeat(2),16),Fe=parseInt(o.slice(4,5).repeat(2),16),lt.toColor(pt,gt,mt,Fe);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 h=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(h)return pt=parseInt(h[1]),gt=parseInt(h[2]),mt=parseInt(h[3]),Fe=Math.round((h[5]===void 0?1:parseFloat(h[5]))*255),lt.toColor(pt,gt,mt,Fe);if(!i||!n)throw new Error("css.toColor: Unsupported css format");if(i.fillStyle=n,i.fillStyle=o,typeof i.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(i.fillRect(0,0,1,1),[pt,gt,mt,Fe]=i.getImageData(0,0,1,1).data,Fe!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:lt.toRgba(pt,gt,mt,Fe),css:o}}e.toColor=l})(Xe||={});var Rt;(e=>{function i(l){return n(l>>16&255,l>>8&255,l&255)}e.relativeLuminance=i;function n(l,o,h){let d=l/255,_=o/255,p=h/255,f=d<=.03928?d/12.92:Math.pow((d+.055)/1.055,2.4),S=_<=.03928?_/12.92:Math.pow((_+.055)/1.055,2.4),y=p<=.03928?p/12.92:Math.pow((p+.055)/1.055,2.4);return f*.2126+S*.7152+y*.0722}e.relativeLuminance2=n})(Rt||={});var Fa;(e=>{function i(d,_){if(Fe=(_&255)/255,Fe===1)return _;let p=_>>24&255,f=_>>16&255,S=_>>8&255,y=d>>24&255,x=d>>16&255,C=d>>8&255;return pt=y+Math.round((p-y)*Fe),gt=x+Math.round((f-x)*Fe),mt=C+Math.round((S-C)*Fe),lt.toRgba(pt,gt,mt)}e.blend=i;function n(d,_,p){let f=Rt.relativeLuminance(d>>8),S=Rt.relativeLuminance(_>>8);if(es(f,S)<p){if(S<f){let C=l(d,_,p),b=es(f,Rt.relativeLuminance(C>>8));if(b<p){let R=o(d,_,p),L=es(f,Rt.relativeLuminance(R>>8));return b>L?C:R}return C}let y=o(d,_,p),x=es(f,Rt.relativeLuminance(y>>8));if(x<p){let C=l(d,_,p),b=es(f,Rt.relativeLuminance(C>>8));return x>b?y:C}return y}}e.ensureContrastRatio=n;function l(d,_,p){let f=d>>24&255,S=d>>16&255,y=d>>8&255,x=_>>24&255,C=_>>16&255,b=_>>8&255,R=es(Rt.relativeLuminance2(x,C,b),Rt.relativeLuminance2(f,S,y));for(;R<p&&(x>0||C>0||b>0);)x-=Math.max(0,Math.ceil(x*.1)),C-=Math.max(0,Math.ceil(C*.1)),b-=Math.max(0,Math.ceil(b*.1)),R=es(Rt.relativeLuminance2(x,C,b),Rt.relativeLuminance2(f,S,y));return(x<<24|C<<16|b<<8|255)>>>0}e.reduceLuminance=l;function o(d,_,p){let f=d>>24&255,S=d>>16&255,y=d>>8&255,x=_>>24&255,C=_>>16&255,b=_>>8&255,R=es(Rt.relativeLuminance2(x,C,b),Rt.relativeLuminance2(f,S,y));for(;R<p&&(x<255||C<255||b<255);)x=Math.min(255,x+Math.ceil((255-x)*.1)),C=Math.min(255,C+Math.ceil((255-C)*.1)),b=Math.min(255,b+Math.ceil((255-b)*.1)),R=es(Rt.relativeLuminance2(x,C,b),Rt.relativeLuminance2(f,S,y));return(x<<24|C<<16|b<<8|255)>>>0}e.increaseLuminance=o;function h(d){return[d>>24&255,d>>16&255,d>>8&255,d&255]}e.toChannels=h})(Fa||={});function tr(e){let i=e.toString(16);return i.length<2?"0"+i:i}function es(e,i){return e<i?(i+.05)/(e+.05):(e+.05)/(i+.05)}var H1=class extends ml{constructor(e,i,n){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=i,this._width=n}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()]}},to=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new gi}register(e){let i={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(i),i.id}deregister(e){for(let i=0;i<this._characterJoiners.length;i++)if(this._characterJoiners[i].id===e)return this._characterJoiners.splice(i,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let i=this._bufferService.buffer.lines.get(e);if(!i||i.length===0)return[];let n=[],l=i.translateToString(!0),o=0,h=0,d=0,_=i.getFg(0),p=i.getBg(0);for(let f=0;f<i.getTrimmedLength();f++)if(i.loadCell(f,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==_||this._workCell.bg!==p){if(f-o>1){let S=this._getJoinedRanges(l,d,h,i,o);for(let y=0;y<S.length;y++)n.push(S[y])}o=f,d=h,_=this._workCell.fg,p=this._workCell.bg}h+=this._workCell.getChars().length||Ls.length}if(this._bufferService.cols-o>1){let f=this._getJoinedRanges(l,d,h,i,o);for(let S=0;S<f.length;S++)n.push(f[S])}return n}_getJoinedRanges(e,i,n,l,o){let h=e.substring(i,n),d=[];try{d=this._characterJoiners[0].handler(h)}catch(_){console.error(_)}for(let _=1;_<this._characterJoiners.length;_++)try{let p=this._characterJoiners[_].handler(h);for(let f=0;f<p.length;f++)to._mergeRanges(d,p[f])}catch(p){console.error(p)}return this._stringRangesToCellRanges(d,l,o),d}_stringRangesToCellRanges(e,i,n){let l=0,o=!1,h=0,d=e[l];if(d){for(let _=n;_<this._bufferService.cols;_++){let p=i.getWidth(_),f=i.getString(_).length||Ls.length;if(p!==0){if(!o&&d[0]<=h&&(d[0]=_,o=!0),d[1]<=h){if(d[1]=_,d=e[++l],!d)break;d[0]<=h?(d[0]=_,o=!0):o=!1}h+=f}}d&&(d[1]=this._bufferService.cols)}}static _mergeRanges(e,i){let n=!1;for(let l=0;l<e.length;l++){let o=e[l];if(n){if(i[1]<=o[0])return e[l-1][1]=i[1],e;if(i[1]<=o[1])return e[l-1][1]=Math.max(i[1],o[1]),e.splice(l,1),e;e.splice(l,1),l--}else{if(i[1]<=o[0])return e.splice(l,0,i),e;if(i[1]<=o[1])return o[0]=Math.min(i[0],o[0]),e;i[0]<o[1]&&(o[0]=Math.min(i[0],o[0]),n=!0);continue}}return n?e[e.length-1][1]=i[1]:e.push(i),e}};to=Ze([ie(0,Bt)],to);function j1(e){return 57508<=e&&e<=57558}function U1(e){return 9472<=e&&e<=9631}function q1(e){return j1(e)||U1(e)}function W1(){return{css:{canvas:Wa(),cell:Wa()},device:{canvas:Wa(),cell:Wa(),char:{width:0,height:0,left:0,top:0}}}}function Wa(){return{width:0,height:0}}var wu=class{constructor(e,i,n,l,o,h,d){this._document=e,this._characterJoinerService=i,this._optionsService=n,this._coreBrowserService=l,this._coreService=o,this._decorationService=h,this._themeService=d,this._workCell=new gi,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,i,n){this._selectionStart=e,this._selectionEnd=i,this._columnSelectMode=n}createRow(e,i,n,l,o,h,d,_,p,f,S){let y=[],x=this._characterJoinerService.getJoinedCharacters(i),C=this._themeService.colors,b=e.getNoBgTrimmedLength();n&&b<h+1&&(b=h+1);let R,L=0,X="",se=0,$=0,W=0,Y=0,Q=!1,J=0,Se=!1,Te=0,zt=0,de=[],G=f!==-1&&S!==-1;for(let I=0;I<b;I++){e.loadCell(I,this._workCell);let te=this._workCell.getWidth();if(te===0)continue;let Z=!1,T=I>=zt,j=I,q=this._workCell;if(x.length>0&&I===x[0][0]&&T){let Re=x.shift(),mi=this._isCellInSelection(Re[0],i);for(se=Re[0]+1;se<Re[1];se++)T&&=mi===this._isCellInSelection(se,i);T&&=!n||h<Re[0]||h>=Re[1],T?(Z=!0,q=new H1(this._workCell,e.translateToString(!0,Re[0],Re[1]),Re[1]-Re[0]),j=Re[1]-1,te=q.getWidth()):zt=Re[1]}let ae=this._isCellInSelection(I,i),fe=n&&I===h,k=G&&I>=f&&I<=S,H=!1;this._decorationService.forEachDecorationAtCell(I,i,void 0,Re=>{H=!0});let F=q.getChars()||Ls;if(F===" "&&(q.isUnderline()||q.isOverline())&&(F=" "),Te=te*_-p.get(F,q.isBold(),q.isItalic()),!R)R=this._document.createElement("span");else if(L&&(ae&&Se||!ae&&!Se&&q.bg===$)&&(ae&&Se&&C.selectionForeground||q.fg===W)&&q.extended.ext===Y&&k===Q&&Te===J&&!fe&&!Z&&!H&&T){q.isInvisible()?X+=Ls:X+=F,L++;continue}else L&&(R.textContent=X),R=this._document.createElement("span"),L=0,X="";if($=q.bg,W=q.fg,Y=q.extended.ext,Q=k,J=Te,Se=ae,Z&&h>=I&&h<=j&&(h=I),!this._coreService.isCursorHidden&&fe&&this._coreService.isCursorInitialized){if(de.push("xterm-cursor"),this._coreBrowserService.isFocused)d&&de.push("xterm-cursor-blink"),de.push(l==="bar"?"xterm-cursor-bar":l==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(o)switch(o){case"outline":de.push("xterm-cursor-outline");break;case"block":de.push("xterm-cursor-block");break;case"bar":de.push("xterm-cursor-bar");break;case"underline":de.push("xterm-cursor-underline");break}}if(q.isBold()&&de.push("xterm-bold"),q.isItalic()&&de.push("xterm-italic"),q.isDim()&&de.push("xterm-dim"),q.isInvisible()?X=Ls:X=q.getChars()||Ls,q.isUnderline()&&(de.push(`xterm-underline-${q.extended.underlineStyle}`),X===" "&&(X=" "),!q.isUnderlineColorDefault()))if(q.isUnderlineColorRGB())R.style.textDecorationColor=`rgb(${ml.toColorRGB(q.getUnderlineColor()).join(",")})`;else{let Re=q.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&q.isBold()&&Re<8&&(Re+=8),R.style.textDecorationColor=C.ansi[Re].css}q.isOverline()&&(de.push("xterm-overline"),X===" "&&(X=" ")),q.isStrikethrough()&&de.push("xterm-strikethrough"),k&&(R.style.textDecoration="underline");let ee=q.getFgColor(),oe=q.getFgColorMode(),he=q.getBgColor(),ye=q.getBgColorMode(),at=!!q.isInverse();if(at){let Re=ee;ee=he,he=Re;let mi=oe;oe=ye,ye=mi}let Ae,wi,Ci=!1;this._decorationService.forEachDecorationAtCell(I,i,void 0,Re=>{Re.options.layer!=="top"&&Ci||(Re.backgroundColorRGB&&(ye=50331648,he=Re.backgroundColorRGB.rgba>>8&16777215,Ae=Re.backgroundColorRGB),Re.foregroundColorRGB&&(oe=50331648,ee=Re.foregroundColorRGB.rgba>>8&16777215,wi=Re.foregroundColorRGB),Ci=Re.options.layer==="top")}),!Ci&&ae&&(Ae=this._coreBrowserService.isFocused?C.selectionBackgroundOpaque:C.selectionInactiveBackgroundOpaque,he=Ae.rgba>>8&16777215,ye=50331648,Ci=!0,C.selectionForeground&&(oe=50331648,ee=C.selectionForeground.rgba>>8&16777215,wi=C.selectionForeground)),Ci&&de.push("xterm-decoration-top");let ti;switch(ye){case 16777216:case 33554432:ti=C.ansi[he],de.push(`xterm-bg-${he}`);break;case 50331648:ti=lt.toColor(he>>16,he>>8&255,he&255),this._addStyle(R,`background-color:#${Wg((he>>>0).toString(16),"0",6)}`);break;default:at?(ti=C.foreground,de.push("xterm-bg-257")):ti=C.background}switch(Ae||q.isDim()&&(Ae=Ke.multiplyOpacity(ti,.5)),oe){case 16777216:case 33554432:q.isBold()&&ee<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ee+=8),this._applyMinimumContrast(R,ti,C.ansi[ee],q,Ae,void 0)||de.push(`xterm-fg-${ee}`);break;case 50331648:let Re=lt.toColor(ee>>16&255,ee>>8&255,ee&255);this._applyMinimumContrast(R,ti,Re,q,Ae,wi)||this._addStyle(R,`color:#${Wg(ee.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(R,ti,C.foreground,q,Ae,wi)||at&&de.push("xterm-fg-257")}de.length&&(R.className=de.join(" "),de.length=0),!fe&&!Z&&!H&&T?L++:R.textContent=X,Te!==this.defaultSpacing&&(R.style.letterSpacing=`${Te}px`),y.push(R),I=j}return R&&L&&(R.textContent=X),y}_applyMinimumContrast(e,i,n,l,o,h){if(this._optionsService.rawOptions.minimumContrastRatio===1||q1(l.getCode()))return!1;let d=this._getContrastCache(l),_;if(!o&&!h&&(_=d.getColor(i.rgba,n.rgba)),_===void 0){let p=this._optionsService.rawOptions.minimumContrastRatio/(l.isDim()?2:1);_=Ke.ensureContrastRatio(o||i,h||n,p),d.setColor((o||i).rgba,(h||n).rgba,_??null)}return _?(this._addStyle(e,`color:${_.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,i){e.setAttribute("style",`${e.getAttribute("style")||""}${i};`)}_isCellInSelection(e,i){let n=this._selectionStart,l=this._selectionEnd;return!n||!l?!1:this._columnSelectMode?n[0]<=l[0]?e>=n[0]&&i>=n[1]&&e<l[0]&&i<=l[1]:e<n[0]&&i>=n[1]&&e>=l[0]&&i<=l[1]:i>n[1]&&i<l[1]||n[1]===l[1]&&i===n[1]&&e>=n[0]&&e<l[0]||n[1]<l[1]&&i===l[1]&&e<l[0]||n[1]<l[1]&&i===n[1]&&e>=n[0]}};wu=Ze([ie(1,Ym),ie(2,At),ie(3,rs),ie(4,hr),ie(5,vl),ie(6,tn)],wu);function Wg(e,i,n){for(;e.length<n;)e=i+e;return e}var P1=class{constructor(e,i){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=e.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";let n=e.createElement("span");n.classList.add("xterm-char-measure-element");let l=e.createElement("span");l.classList.add("xterm-char-measure-element"),l.style.fontWeight="bold";let o=e.createElement("span");o.classList.add("xterm-char-measure-element"),o.style.fontStyle="italic";let h=e.createElement("span");h.classList.add("xterm-char-measure-element"),h.style.fontWeight="bold",h.style.fontStyle="italic",this._measureElements=[n,l,o,h],this._container.appendChild(n),this._container.appendChild(l),this._container.appendChild(o),this._container.appendChild(h),i.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(e,i,n,l){e===this._font&&i===this._fontSize&&n===this._weight&&l===this._weightBold||(this._font=e,this._fontSize=i,this._weight=n,this._weightBold=l,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${n}`,this._measureElements[1].style.fontWeight=`${l}`,this._measureElements[2].style.fontWeight=`${n}`,this._measureElements[3].style.fontWeight=`${l}`,this.clear())}get(e,i,n){let l=0;if(!i&&!n&&e.length===1&&(l=e.charCodeAt(0))<256){if(this._flat[l]!==-9999)return this._flat[l];let d=this._measure(e,0);return d>0&&(this._flat[l]=d),d}let o=e;i&&(o+="B"),n&&(o+="I");let h=this._holey.get(o);if(h===void 0){let d=0;i&&(d|=1),n&&(d|=2),h=this._measure(e,d),h>0&&this._holey.set(o,h)}return h}_measure(e,i){let n=this._measureElements[i];return n.textContent=e.repeat(32),n.offsetWidth/32}},K1=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,i,n,l=!1){if(this.selectionStart=i,this.selectionEnd=n,!i||!n||i[0]===n[0]&&i[1]===n[1]){this.clear();return}let o=e.buffers.active.ydisp,h=i[1]-o,d=n[1]-o,_=Math.max(h,0),p=Math.min(d,e.rows-1);if(_>=e.rows||p<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=l,this.viewportStartRow=h,this.viewportEndRow=d,this.viewportCappedStartRow=_,this.viewportCappedEndRow=p,this.startCol=i[0],this.endCol=n[0]}isCellSelected(e,i,n){return this.hasSelection?(n-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?i>=this.startCol&&n>=this.viewportCappedStartRow&&i<this.endCol&&n<=this.viewportCappedEndRow:i<this.startCol&&n>=this.viewportCappedStartRow&&i>=this.endCol&&n<=this.viewportCappedEndRow:n>this.viewportStartRow&&n<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&n===this.viewportStartRow&&i>=this.startCol&&i<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportEndRow&&i<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportStartRow&&i>=this.startCol):!1}};function Y1(){return new K1}var Xh="xterm-dom-renderer-owner-",di="xterm-rows",Pa="xterm-fg-",Pg="xterm-bg-",el="xterm-focus",Ka="xterm-selection",$1=1,Cu=class extends ve{constructor(e,i,n,l,o,h,d,_,p,f,S,y,x,C){super(),this._terminal=e,this._document=i,this._element=n,this._screenElement=l,this._viewportElement=o,this._helperContainer=h,this._linkifier2=d,this._charSizeService=p,this._optionsService=f,this._bufferService=S,this._coreService=y,this._coreBrowserService=x,this._themeService=C,this._terminalClass=$1++,this._rowElements=[],this._selectionRenderModel=Y1(),this.onRequestRedraw=this._register(new V).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(di),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(Ka),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=W1(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(b=>this._injectCss(b))),this._injectCss(this._themeService.colors),this._rowFactory=_.createInstance(wu,document),this._element.classList.add(Xh+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(b=>this._handleLinkHover(b))),this._register(this._linkifier2.onHideLinkUnderline(b=>this._handleLinkLeave(b))),this._register($e(()=>{this._element.classList.remove(Xh+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new P1(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(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),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/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),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(let n of this._rowElements)n.style.width=`${this.dimensions.css.canvas.width}px`,n.style.height=`${this.dimensions.css.cell.height}px`,n.style.lineHeight=`${this.dimensions.css.cell.height}px`,n.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let i=`${this._terminalSelector} .${di} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=i,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(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let i=`${this._terminalSelector} .${di} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;i+=`${this._terminalSelector} .${di} .xterm-dim { color: ${Ke.multiplyOpacity(e.foreground,.5).css};}`,i+=`${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;}`;let n=`blink_underline_${this._terminalClass}`,l=`blink_bar_${this._terminalClass}`,o=`blink_block_${this._terminalClass}`;i+=`@keyframes ${n} { 50% { border-bottom-style: hidden; }}`,i+=`@keyframes ${l} { 50% { box-shadow: none; }}`,i+=`@keyframes ${o} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,i+=`${this._terminalSelector} .${di}.${el} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${di}.${el} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${l} 1s step-end infinite;}${this._terminalSelector} .${di}.${el} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${o} 1s step-end infinite;}${this._terminalSelector} .${di} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${di} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${di} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${di} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${di} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,i+=`${this._terminalSelector} .${Ka} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${Ka} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${Ka} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[h,d]of e.ansi.entries())i+=`${this._terminalSelector} .${Pa}${h} { color: ${d.css}; }${this._terminalSelector} .${Pa}${h}.xterm-dim { color: ${Ke.multiplyOpacity(d,.5).css}; }${this._terminalSelector} .${Pg}${h} { background-color: ${d.css}; }`;i+=`${this._terminalSelector} .${Pa}257 { color: ${Ke.opaque(e.background).css}; }${this._terminalSelector} .${Pa}257.xterm-dim { color: ${Ke.multiplyOpacity(Ke.opaque(e.background),.5).css}; }${this._terminalSelector} .${Pg}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=i}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,i){for(let n=this._rowElements.length;n<=i;n++){let l=this._document.createElement("div");this._rowContainer.appendChild(l),this._rowElements.push(l)}for(;this._rowElements.length>i;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,i){this._refreshRowElements(e,i),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(el),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(el),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,i,n){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,i,n),this.renderRows(0,this._bufferService.rows-1),!e||!i||(this._selectionRenderModel.update(this._terminal,e,i,n),!this._selectionRenderModel.hasSelection))return;let l=this._selectionRenderModel.viewportStartRow,o=this._selectionRenderModel.viewportEndRow,h=this._selectionRenderModel.viewportCappedStartRow,d=this._selectionRenderModel.viewportCappedEndRow,_=this._document.createDocumentFragment();if(n){let p=e[0]>i[0];_.appendChild(this._createSelectionElement(h,p?i[0]:e[0],p?e[0]:i[0],d-h+1))}else{let p=l===h?e[0]:0,f=h===o?i[0]:this._bufferService.cols;_.appendChild(this._createSelectionElement(h,p,f));let S=d-h-1;if(_.appendChild(this._createSelectionElement(h+1,0,this._bufferService.cols,S)),h!==d){let y=o===d?i[0]:this._bufferService.cols;_.appendChild(this._createSelectionElement(d,0,y))}}this._selectionContainer.appendChild(_)}_createSelectionElement(e,i,n,l=1){let o=this._document.createElement("div"),h=i*this.dimensions.css.cell.width,d=this.dimensions.css.cell.width*(n-i);return h+d>this.dimensions.css.canvas.width&&(d=this.dimensions.css.canvas.width-h),o.style.height=`${l*this.dimensions.css.cell.height}px`,o.style.top=`${e*this.dimensions.css.cell.height}px`,o.style.left=`${h}px`,o.style.width=`${d}px`,o}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(let e of this._rowElements)e.replaceChildren()}renderRows(e,i){let n=this._bufferService.buffer,l=n.ybase+n.y,o=Math.min(n.x,this._bufferService.cols-1),h=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,d=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,_=this._optionsService.rawOptions.cursorInactiveStyle;for(let p=e;p<=i;p++){let f=p+n.ydisp,S=this._rowElements[p],y=n.lines.get(f);if(!S||!y)break;S.replaceChildren(...this._rowFactory.createRow(y,f,f===l,d,_,o,h,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${Xh}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,i,n,l,o,h){n<0&&(e=0),l<0&&(i=0);let d=this._bufferService.rows-1;n=Math.max(Math.min(n,d),0),l=Math.max(Math.min(l,d),0),o=Math.min(o,this._bufferService.cols);let _=this._bufferService.buffer,p=_.ybase+_.y,f=Math.min(_.x,o-1),S=this._optionsService.rawOptions.cursorBlink,y=this._optionsService.rawOptions.cursorStyle,x=this._optionsService.rawOptions.cursorInactiveStyle;for(let C=n;C<=l;++C){let b=C+_.ydisp,R=this._rowElements[C],L=_.lines.get(b);if(!R||!L)break;R.replaceChildren(...this._rowFactory.createRow(L,b,b===p,y,x,f,S,this.dimensions.css.cell.width,this._widthCache,h?C===n?e:0:-1,h?(C===l?i:o)-1:-1))}}};Cu=Ze([ie(7,Pu),ie(8,ho),ie(9,At),ie(10,Bt),ie(11,hr),ie(12,rs),ie(13,tn)],Cu);var ku=class extends ve{constructor(e,i,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this._register(new V),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new X1(this._optionsService))}catch{this._measureStrategy=this._register(new I1(e,i,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};ku=Ze([ie(2,At)],ku);var cv=class extends ve{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,i){e!==void 0&&e>0&&i!==void 0&&i>0&&(this._result.width=e,this._result.height=i)}},I1=class extends cv{constructor(e,i,n){super(),this._document=e,this._parentElement=i,this._optionsService=n,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}},X1=class extends cv{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let i=this._ctx.measureText("W");if(!("width"in i&&"fontBoundingBoxAscent"in i&&"fontBoundingBoxDescent"in i))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},G1=class extends ve{constructor(e,i,n){super(),this._textarea=e,this._window=i,this.mainDocument=n,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new V1(this._window)),this._onDprChange=this._register(new V),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new V),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(l=>this._screenDprMonitor.setWindow(l))),this._register(Ct.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(ue(this._textarea,"focus",()=>this._isFocused=!0)),this._register(ue(this._textarea,"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}},V1=class extends ve{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new Jr),this._onDprChange=this._register(new V),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register($e(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=ue(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)}},F1=class extends ve{constructor(){super(),this.linkProviders=[],this._register($e(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let i=this.linkProviders.indexOf(e);i!==-1&&this.linkProviders.splice(i,1)}}}};function Fu(e,i,n){let l=n.getBoundingClientRect(),o=e.getComputedStyle(n),h=parseInt(o.getPropertyValue("padding-left")),d=parseInt(o.getPropertyValue("padding-top"));return[i.clientX-l.left-h,i.clientY-l.top-d]}function Z1(e,i,n,l,o,h,d,_,p){if(!h)return;let f=Fu(e,i,n);if(f)return f[0]=Math.ceil((f[0]+(p?d/2:0))/d),f[1]=Math.ceil(f[1]/_),f[0]=Math.min(Math.max(f[0],1),l+(p?1:0)),f[1]=Math.min(Math.max(f[1],1),o),f}var Eu=class{constructor(e,i){this._renderService=e,this._charSizeService=i}getCoords(e,i,n,l,o){return Z1(window,e,i,n,l,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,o)}getMouseReportCoords(e,i){let n=Fu(window,e,i);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};Eu=Ze([ie(0,ns),ie(1,ho)],Eu);var Q1=class{constructor(e,i){this._renderCallback=e,this._coreBrowserService=i,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(e,i,n){this._rowCount=n,e=e!==void 0?e:0,i=i!==void 0?i:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,i):i,!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){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),i=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,i),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},hv={};ob(hv,{getSafariVersion:()=>ex,isChromeOS:()=>_v,isFirefox:()=>uv,isIpad:()=>tx,isIphone:()=>ix,isLegacyEdge:()=>J1,isLinux:()=>Zu,isMac:()=>io,isNode:()=>uo,isSafari:()=>dv,isWindows:()=>fv});var uo=typeof process<"u"&&"title"in process,Sl=uo?"node":navigator.userAgent,yl=uo?"node":navigator.platform,uv=Sl.includes("Firefox"),J1=Sl.includes("Edge"),dv=/^((?!chrome|android).)*safari/i.test(Sl);function ex(){if(!dv)return 0;let e=Sl.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var io=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(yl),tx=yl==="iPad",ix=yl==="iPhone",fv=["Windows","Win16","Win32","WinCE"].includes(yl),Zu=yl.indexOf("Linux")>=0,_v=/\bCrOS\b/.test(Sl),pv=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(e){this._idleCallback=void 0;let i=0,n=0,l=e.timeRemaining(),o=0;for(;this._i<this._tasks.length;){if(i=performance.now(),this._tasks[this._i]()||this._i++,i=Math.max(1,performance.now()-i),n=Math.max(i,n),o=e.timeRemaining(),n*1.5>o){l-i<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(l-i))}ms`),this._start();return}l=o}this.clear()}},sx=class extends pv{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let i=performance.now()+e;return{timeRemaining:()=>Math.max(0,i-performance.now())}}},rx=class extends pv{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},so=!uo&&"requestIdleCallback"in window?rx:sx,nx=class{constructor(){this._queue=new so}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},Tu=class extends ve{constructor(e,i,n,l,o,h,d,_,p){super(),this._rowCount=e,this._optionsService=n,this._charSizeService=l,this._coreService=o,this._coreBrowserService=_,this._renderer=this._register(new Jr),this._pausedResizeTask=new nx,this._observerDisposable=this._register(new Jr),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 V),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new V),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new V),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new V),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new Q1((f,S)=>this._renderRows(f,S),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new lx(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register($e(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(d.onResize(()=>this._fullRefresh())),this._register(d.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(h.onDecorationRegistered(()=>this._fullRefresh())),this._register(h.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(d.cols,d.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(d.buffer.y,d.buffer.y,!0))),this._register(p.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,i),this._register(this._coreBrowserService.onWindowChange(f=>this._registerIntersectionObserver(f,i)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,i){if("IntersectionObserver"in e){let n=new e.IntersectionObserver(l=>this._handleIntersectionChange(l[l.length-1]),{threshold:0});n.observe(i),this._observerDisposable.value=$e(()=>n.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.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(e,i,n=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,i);return}let l=this._syncOutputHandler.flush();l&&(e=Math.min(e,l.start),i=Math.max(i,l.end)),n||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,i,this._rowCount)}_renderRows(e,i){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,i);return}e=Math.min(e,this._rowCount-1),i=Math.min(i,this._rowCount-1),this._renderer.value.renderRows(e,i),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:i}),this._onRender.fire({start:e,end:i}),this._isNextRenderRedrawOnly=!0}}resize(e,i){this._rowCount=i,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(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(i=>this.refreshRows(i.start,i.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_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(e,i){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(e,i)):this._renderer.value.handleResize(e,i),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,i,n){this._selectionState.start=e,this._selectionState.end=i,this._selectionState.columnSelectMode=n,this._renderer.value?.handleSelectionChanged(e,i,n)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};Tu=Ze([ie(2,At),ie(3,ho),ie(4,hr),ie(5,vl),ie(6,Bt),ie(7,rs),ie(8,tn)],Tu);var lx=class{constructor(e,i,n){this._coreBrowserService=e,this._coreService=i,this._onTimeout=n,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,i){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,i)):(this._start=e,this._end=i,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function ax(e,i,n,l){let o=n.buffer.x,h=n.buffer.y;if(!n.buffer.hasScrollback)return hx(o,h,e,i,n,l)+fo(h,i,n,l)+ux(o,h,e,i,n,l);let d;if(h===i)return d=o>e?"D":"C",pl(Math.abs(o-e),_l(d,l));d=h>i?"D":"C";let _=Math.abs(h-i),p=cx(h>i?e:o,n)+(_-1)*n.cols+1+ox(h>i?o:e);return pl(p,_l(d,l))}function ox(e,i){return e-1}function cx(e,i){return i.cols-e}function hx(e,i,n,l,o,h){return fo(i,l,o,h).length===0?"":pl(mv(e,i,e,i-or(i,o),!1,o).length,_l("D",h))}function fo(e,i,n,l){let o=e-or(e,n),h=i-or(i,n),d=Math.abs(o-h)-dx(e,i,n);return pl(d,_l(gv(e,i),l))}function ux(e,i,n,l,o,h){let d;fo(i,l,o,h).length>0?d=l-or(l,o):d=i;let _=l,p=fx(e,i,n,l,o,h);return pl(mv(e,d,n,_,p==="C",o).length,_l(p,h))}function dx(e,i,n){let l=0,o=e-or(e,n),h=i-or(i,n);for(let d=0;d<Math.abs(o-h);d++){let _=gv(e,i)==="A"?-1:1;n.buffer.lines.get(o+_*d)?.isWrapped&&l++}return l}function or(e,i){let n=0,l=i.buffer.lines.get(e),o=l?.isWrapped;for(;o&&e>=0&&e<i.rows;)n++,l=i.buffer.lines.get(--e),o=l?.isWrapped;return n}function fx(e,i,n,l,o,h){let d;return fo(n,l,o,h).length>0?d=l-or(l,o):d=i,e<n&&d<=l||e>=n&&d<l?"C":"D"}function gv(e,i){return e>i?"A":"B"}function mv(e,i,n,l,o,h){let d=e,_=i,p="";for(;(d!==n||_!==l)&&_>=0&&_<h.buffer.lines.length;)d+=o?1:-1,o&&d>h.cols-1?(p+=h.buffer.translateBufferLineToString(_,!1,e,d),d=0,e=0,_++):!o&&d<0&&(p+=h.buffer.translateBufferLineToString(_,!1,0,e+1),d=h.cols-1,e=d,_--);return p+h.buffer.translateBufferLineToString(_,!1,e,d)}function _l(e,i){let n=i?"O":"[";return K.ESC+n+e}function pl(e,i){e=Math.floor(e);let n="";for(let l=0;l<e;l++)n+=i;return n}var _x=class{constructor(e){this._bufferService=e,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.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()){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,i=this.selectionEnd;return!e||!i?!1:e[1]>i[1]||e[1]===i[1]&&e[0]>i[0]}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function Kg(e,i){if(e.start.y>e.end.y)throw new Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return i*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var Gh=50,px=15,gx=50,mx=500,vx=" ",Sx=new RegExp(vx,"g"),Ru=class extends ve{constructor(e,i,n,l,o,h,d,_,p){super(),this._element=e,this._screenElement=i,this._linkifier=n,this._bufferService=l,this._coreService=o,this._mouseService=h,this._optionsService=d,this._renderService=_,this._coreBrowserService=p,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new gi,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new V),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new V),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new V),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new V),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=f=>this._handleMouseMove(f),this._mouseUpListener=f=>this._handleMouseUp(f),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(f=>this._handleTrim(f)),this._register(this._bufferService.buffers.onBufferActivate(f=>this._handleBufferActivate(f))),this.enable(),this._model=new _x(this._bufferService),this._activeSelectionMode=0,this._register($e(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(f=>{f.rowsChanged&&this.clearSelection()}))}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(){let e=this._model.finalSelectionStart,i=this._model.finalSelectionEnd;return!e||!i?!1:e[0]!==i[0]||e[1]!==i[1]}get selectionText(){let e=this._model.finalSelectionStart,i=this._model.finalSelectionEnd;if(!e||!i)return"";let n=this._bufferService.buffer,l=[];if(this._activeSelectionMode===3){if(e[0]===i[0])return"";let o=e[0]<i[0]?e[0]:i[0],h=e[0]<i[0]?i[0]:e[0];for(let d=e[1];d<=i[1];d++){let _=n.translateBufferLineToString(d,!0,o,h);l.push(_)}}else{let o=e[1]===i[1]?i[0]:void 0;l.push(n.translateBufferLineToString(e[1],!0,e[0],o));for(let h=e[1]+1;h<=i[1]-1;h++){let d=n.lines.get(h),_=n.translateBufferLineToString(h,!0);d?.isWrapped?l[l.length-1]+=_:l.push(_)}if(e[1]!==i[1]){let h=n.lines.get(i[1]),d=n.translateBufferLineToString(i[1],!0,0,i[0]);h&&h.isWrapped?l[l.length-1]+=d:l.push(d)}}return l.map(o=>o.replace(Sx," ")).join(fv?`\r
|
|
66
|
+
`:`
|
|
67
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),Zu&&e&&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(e){let i=this._getMouseBufferCoords(e),n=this._model.finalSelectionStart,l=this._model.finalSelectionEnd;return!n||!l||!i?!1:this._areCoordsInSelection(i,n,l)}isCellInSelection(e,i){let n=this._model.finalSelectionStart,l=this._model.finalSelectionEnd;return!n||!l?!1:this._areCoordsInSelection([e,i],n,l)}_areCoordsInSelection(e,i,n){return e[1]>i[1]&&e[1]<n[1]||i[1]===n[1]&&e[1]===i[1]&&e[0]>=i[0]&&e[0]<n[0]||i[1]<n[1]&&e[1]===n[1]&&e[0]<n[0]||i[1]<n[1]&&e[1]===i[1]&&e[0]>=i[0]}_selectWordAtCursor(e,i){let n=this._linkifier.currentLink?.link?.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=Kg(n,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let l=this._getMouseBufferCoords(e);return l?(this._selectWordAt(l,i),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,i){this._model.clearSelection(),e=Math.max(e,0),i=Math.min(i,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,i],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let i=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(i)return i[0]--,i[1]--,i[1]+=this._bufferService.buffer.ydisp,i}_getMouseEventScrollAmount(e){let i=Fu(this._coreBrowserService.window,e,this._screenElement)[1],n=this._renderService.dimensions.css.canvas.height;return i>=0&&i<=n?0:(i>n&&(i-=n),i=Math.min(Math.max(i,-Gh),Gh),i/=Gh,i/Math.abs(i)+Math.round(i*(px-1)))}shouldForceSelection(e){return io?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),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(),gx)}_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(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let i=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);i&&i.length!==this._model.selectionStart[0]&&i.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let i=this._getMouseBufferCoords(e);i&&(this._activeSelectionMode=2,this._selectLineAt(i[1]))}shouldColumnSelect(e){return e.altKey&&!(io&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let i=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}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(e),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let n=this._bufferService.buffer;if(this._model.selectionEnd[1]<n.lines.length){let l=n.lines.get(this._model.selectionEnd[1]);l&&l.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}(!i||i[0]!==this._model.selectionEnd[0]||i[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});let e=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let i=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&i<mx&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let n=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(n&&n[0]!==void 0&&n[1]!==void 0){let l=ax(n[0]-1,n[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(l,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,i=this._model.finalSelectionEnd,n=!!e&&!!i&&(e[0]!==i[0]||e[1]!==i[1]);if(!n){this._oldHasSelection&&this._fireOnSelectionChange(e,i,n);return}!e||!i||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||i[0]!==this._oldSelectionEnd[0]||i[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,i,n)}_fireOnSelectionChange(e,i,n){this._oldSelectionStart=e,this._oldSelectionEnd=i,this._oldHasSelection=n,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(i=>this._handleTrim(i))}_convertViewportColToCharacterIndex(e,i){let n=i;for(let l=0;i>=l;l++){let o=e.loadCell(l,this._workCell).getChars().length;this._workCell.getWidth()===0?n--:o>1&&i!==l&&(n+=o-1)}return n}setSelection(e,i,n){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,i],this._model.selectionStartLength=n,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,i,n=!0,l=!0){if(e[0]>=this._bufferService.cols)return;let o=this._bufferService.buffer,h=o.lines.get(e[1]);if(!h)return;let d=o.translateBufferLineToString(e[1],!1),_=this._convertViewportColToCharacterIndex(h,e[0]),p=_,f=e[0]-_,S=0,y=0,x=0,C=0;if(d.charAt(_)===" "){for(;_>0&&d.charAt(_-1)===" ";)_--;for(;p<d.length&&d.charAt(p+1)===" ";)p++}else{let L=e[0],X=e[0];h.getWidth(L)===0&&(S++,L--),h.getWidth(X)===2&&(y++,X++);let se=h.getString(X).length;for(se>1&&(C+=se-1,p+=se-1);L>0&&_>0&&!this._isCharWordSeparator(h.loadCell(L-1,this._workCell));){h.loadCell(L-1,this._workCell);let $=this._workCell.getChars().length;this._workCell.getWidth()===0?(S++,L--):$>1&&(x+=$-1,_-=$-1),_--,L--}for(;X<h.length&&p+1<d.length&&!this._isCharWordSeparator(h.loadCell(X+1,this._workCell));){h.loadCell(X+1,this._workCell);let $=this._workCell.getChars().length;this._workCell.getWidth()===2?(y++,X++):$>1&&(C+=$-1,p+=$-1),p++,X++}}p++;let b=_+f-S+x,R=Math.min(this._bufferService.cols,p-_+S+y-x-C);if(!(!i&&d.slice(_,p).trim()==="")){if(n&&b===0&&h.getCodePoint(0)!==32){let L=o.lines.get(e[1]-1);if(L&&h.isWrapped&&L.getCodePoint(this._bufferService.cols-1)!==32){let X=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(X){let se=this._bufferService.cols-X.start;b-=se,R+=se}}}if(l&&b+R===this._bufferService.cols&&h.getCodePoint(this._bufferService.cols-1)!==32){let L=o.lines.get(e[1]+1);if(L?.isWrapped&&L.getCodePoint(0)!==32){let X=this._getWordAt([0,e[1]+1],!1,!1,!0);X&&(R+=X.length)}}return{start:b,length:R}}}_selectWordAt(e,i){let n=this._getWordAt(e,i);if(n){for(;n.start<0;)n.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[n.start,e[1]],this._model.selectionStartLength=n.length}}_selectToWordAt(e){let i=this._getWordAt(e,!0);if(i){let n=e[1];for(;i.start<0;)i.start+=this._bufferService.cols,n--;if(!this._model.areSelectionValuesReversed())for(;i.start+i.length>this._bufferService.cols;)i.length-=this._bufferService.cols,n++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?i.start:i.start+i.length,n]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let i=this._bufferService.buffer.getWrappedRangeForLine(e),n={start:{x:0,y:i.first},end:{x:this._bufferService.cols-1,y:i.last}};this._model.selectionStart=[0,i.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=Kg(n,this._bufferService.cols)}};Ru=Ze([ie(3,Bt),ie(4,hr),ie(5,Ku),ie(6,At),ie(7,ns),ie(8,rs)],Ru);var Yg=class{constructor(){this._data={}}set(e,i,n){this._data[e]||(this._data[e]={}),this._data[e][i]=n}get(e,i){return this._data[e]?this._data[e][i]:void 0}clear(){this._data={}}},$g=class{constructor(){this._color=new Yg,this._css=new Yg}setCss(e,i,n){this._css.set(e,i,n)}getCss(e,i){return this._css.get(e,i)}setColor(e,i,n){this._color.set(e,i,n)}getColor(e,i){return this._color.get(e,i)}clear(){this._color.clear(),this._css.clear()}},ct=Object.freeze((()=>{let e=[Xe.toColor("#2e3436"),Xe.toColor("#cc0000"),Xe.toColor("#4e9a06"),Xe.toColor("#c4a000"),Xe.toColor("#3465a4"),Xe.toColor("#75507b"),Xe.toColor("#06989a"),Xe.toColor("#d3d7cf"),Xe.toColor("#555753"),Xe.toColor("#ef2929"),Xe.toColor("#8ae234"),Xe.toColor("#fce94f"),Xe.toColor("#729fcf"),Xe.toColor("#ad7fa8"),Xe.toColor("#34e2e2"),Xe.toColor("#eeeeec")],i=[0,95,135,175,215,255];for(let n=0;n<216;n++){let l=i[n/36%6|0],o=i[n/6%6|0],h=i[n%6];e.push({css:lt.toCss(l,o,h),rgba:lt.toRgba(l,o,h)})}for(let n=0;n<24;n++){let l=8+n*10;e.push({css:lt.toCss(l,l,l),rgba:lt.toRgba(l,l,l)})}return e})()),ir=Xe.toColor("#ffffff"),ol=Xe.toColor("#000000"),Ig=Xe.toColor("#ffffff"),Xg=ol,tl={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},yx=ir,Du=class extends ve{constructor(e){super(),this._optionsService=e,this._contrastCache=new $g,this._halfContrastCache=new $g,this._onChangeColors=this._register(new V),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:ir,background:ol,cursor:Ig,cursorAccent:Xg,selectionForeground:void 0,selectionBackgroundTransparent:tl,selectionBackgroundOpaque:Ke.blend(ol,tl),selectionInactiveBackgroundTransparent:tl,selectionInactiveBackgroundOpaque:Ke.blend(ol,tl),scrollbarSliderBackground:Ke.opacity(ir,.2),scrollbarSliderHoverBackground:Ke.opacity(ir,.4),scrollbarSliderActiveBackground:Ke.opacity(ir,.5),overviewRulerBorder:ir,ansi:ct.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)))}get colors(){return this._colors}_setTheme(e={}){let i=this._colors;if(i.foreground=Ue(e.foreground,ir),i.background=Ue(e.background,ol),i.cursor=Ke.blend(i.background,Ue(e.cursor,Ig)),i.cursorAccent=Ke.blend(i.background,Ue(e.cursorAccent,Xg)),i.selectionBackgroundTransparent=Ue(e.selectionBackground,tl),i.selectionBackgroundOpaque=Ke.blend(i.background,i.selectionBackgroundTransparent),i.selectionInactiveBackgroundTransparent=Ue(e.selectionInactiveBackground,i.selectionBackgroundTransparent),i.selectionInactiveBackgroundOpaque=Ke.blend(i.background,i.selectionInactiveBackgroundTransparent),i.selectionForeground=e.selectionForeground?Ue(e.selectionForeground,qg):void 0,i.selectionForeground===qg&&(i.selectionForeground=void 0),Ke.isOpaque(i.selectionBackgroundTransparent)&&(i.selectionBackgroundTransparent=Ke.opacity(i.selectionBackgroundTransparent,.3)),Ke.isOpaque(i.selectionInactiveBackgroundTransparent)&&(i.selectionInactiveBackgroundTransparent=Ke.opacity(i.selectionInactiveBackgroundTransparent,.3)),i.scrollbarSliderBackground=Ue(e.scrollbarSliderBackground,Ke.opacity(i.foreground,.2)),i.scrollbarSliderHoverBackground=Ue(e.scrollbarSliderHoverBackground,Ke.opacity(i.foreground,.4)),i.scrollbarSliderActiveBackground=Ue(e.scrollbarSliderActiveBackground,Ke.opacity(i.foreground,.5)),i.overviewRulerBorder=Ue(e.overviewRulerBorder,yx),i.ansi=ct.slice(),i.ansi[0]=Ue(e.black,ct[0]),i.ansi[1]=Ue(e.red,ct[1]),i.ansi[2]=Ue(e.green,ct[2]),i.ansi[3]=Ue(e.yellow,ct[3]),i.ansi[4]=Ue(e.blue,ct[4]),i.ansi[5]=Ue(e.magenta,ct[5]),i.ansi[6]=Ue(e.cyan,ct[6]),i.ansi[7]=Ue(e.white,ct[7]),i.ansi[8]=Ue(e.brightBlack,ct[8]),i.ansi[9]=Ue(e.brightRed,ct[9]),i.ansi[10]=Ue(e.brightGreen,ct[10]),i.ansi[11]=Ue(e.brightYellow,ct[11]),i.ansi[12]=Ue(e.brightBlue,ct[12]),i.ansi[13]=Ue(e.brightMagenta,ct[13]),i.ansi[14]=Ue(e.brightCyan,ct[14]),i.ansi[15]=Ue(e.brightWhite,ct[15]),e.extendedAnsi){let n=Math.min(i.ansi.length-16,e.extendedAnsi.length);for(let l=0;l<n;l++)i.ansi[l+16]=Ue(e.extendedAnsi[l],ct[l+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(e){this._restoreColor(e),this._onChangeColors.fire(this.colors)}_restoreColor(e){if(e===void 0){for(let i=0;i<this._restoreColors.ansi.length;++i)this._colors.ansi[i]=this._restoreColors.ansi[i];return}switch(e){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[e]=this._restoreColors.ansi[e]}}modifyColors(e){e(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()}}};Du=Ze([ie(0,At)],Du);function Ue(e,i){if(e!==void 0)try{return Xe.toColor(e)}catch{}return i}var bx=class{constructor(...e){this._entries=new Map;for(let[i,n]of e)this.set(i,n)}set(e,i){let n=this._entries.get(e);return this._entries.set(e,i),n}forEach(e){for(let[i,n]of this._entries.entries())e(i,n)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},xx=class{constructor(){this._services=new bx,this._services.set(Pu,this)}setService(e,i){this._services.set(e,i)}getService(e){return this._services.get(e)}createInstance(e,...i){let n=pb(e).sort((h,d)=>h.index-d.index),l=[];for(let h of n){let d=this._services.get(h.id);if(!d)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${h.id._id}.`);l.push(d)}let o=n.length>0?n[0].index:i.length;if(i.length!==o)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${o+1} conflicts with ${i.length} static arguments`);return new e(...i,...l)}},wx={trace:0,debug:1,info:2,warn:3,error:4,off:5},Cx="xterm.js: ",Mu=class extends ve{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=wx[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let i=0;i<e.length;i++)typeof e[i]=="function"&&(e[i]=e[i]())}_log(e,i,n){this._evalLazyOptionalParams(n),e.call(console,(this._optionsService.options.logger?"":Cx)+i,...n)}trace(e,...i){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,i)}debug(e,...i){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,i)}info(e,...i){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,i)}warn(e,...i){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,i)}error(e,...i){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,i)}};Mu=Ze([ie(0,At)],Mu);var Gg=class extends ve{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new V),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new V),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new V),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let i=new Array(e);for(let n=0;n<Math.min(e,this.length);n++)i[n]=this._array[this._getCyclicIndex(n)];this._array=i,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let i=this._length;i<e;i++)this._array[i]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,i){this._array[this._getCyclicIndex(e)]=i}push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(e,i,...n){if(i){for(let l=e;l<this._length-i;l++)this._array[this._getCyclicIndex(l)]=this._array[this._getCyclicIndex(l+i)];this._length-=i,this.onDeleteEmitter.fire({index:e,amount:i})}for(let l=this._length-1;l>=e;l--)this._array[this._getCyclicIndex(l+n.length)]=this._array[this._getCyclicIndex(l)];for(let l=0;l<n.length;l++)this._array[this._getCyclicIndex(e+l)]=n[l];if(n.length&&this.onInsertEmitter.fire({index:e,amount:n.length}),this._length+n.length>this._maxLength){let l=this._length+n.length-this._maxLength;this._startIndex+=l,this._length=this._maxLength,this.onTrimEmitter.fire(l)}else this._length+=n.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,i,n){if(!(i<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+n<0)throw new Error("Cannot shift elements in list beyond index 0");if(n>0){for(let o=i-1;o>=0;o--)this.set(e+o+n,this.get(e+o));let l=e+i+n-this._length;if(l>0)for(this._length+=l;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let l=0;l<i;l++)this.set(e+l+n,this.get(e+l))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},me=3,nt=Object.freeze(new ml),Ya=0,Vh=2,cl=class vv{constructor(i,n,l=!1){this.isWrapped=l,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(i*me);let o=n||gi.fromCharData([0,Hm,1,0]);for(let h=0;h<i;++h)this.setCell(h,o);this.length=i}get(i){let n=this._data[i*me+0],l=n&2097151;return[this._data[i*me+1],n&2097152?this._combined[i]:l?Os(l):"",n>>22,n&2097152?this._combined[i].charCodeAt(this._combined[i].length-1):l]}set(i,n){this._data[i*me+1]=n[0],n[1].length>1?(this._combined[i]=n[1],this._data[i*me+0]=i|2097152|n[2]<<22):this._data[i*me+0]=n[1].charCodeAt(0)|n[2]<<22}getWidth(i){return this._data[i*me+0]>>22}hasWidth(i){return this._data[i*me+0]&12582912}getFg(i){return this._data[i*me+1]}getBg(i){return this._data[i*me+2]}hasContent(i){return this._data[i*me+0]&4194303}getCodePoint(i){let n=this._data[i*me+0];return n&2097152?this._combined[i].charCodeAt(this._combined[i].length-1):n&2097151}isCombined(i){return this._data[i*me+0]&2097152}getString(i){let n=this._data[i*me+0];return n&2097152?this._combined[i]:n&2097151?Os(n&2097151):""}isProtected(i){return this._data[i*me+2]&536870912}loadCell(i,n){return Ya=i*me,n.content=this._data[Ya+0],n.fg=this._data[Ya+1],n.bg=this._data[Ya+2],n.content&2097152&&(n.combinedData=this._combined[i]),n.bg&268435456&&(n.extended=this._extendedAttrs[i]),n}setCell(i,n){n.content&2097152&&(this._combined[i]=n.combinedData),n.bg&268435456&&(this._extendedAttrs[i]=n.extended),this._data[i*me+0]=n.content,this._data[i*me+1]=n.fg,this._data[i*me+2]=n.bg}setCellFromCodepoint(i,n,l,o){o.bg&268435456&&(this._extendedAttrs[i]=o.extended),this._data[i*me+0]=n|l<<22,this._data[i*me+1]=o.fg,this._data[i*me+2]=o.bg}addCodepointToCell(i,n,l){let o=this._data[i*me+0];o&2097152?this._combined[i]+=Os(n):o&2097151?(this._combined[i]=Os(o&2097151)+Os(n),o&=-2097152,o|=2097152):o=n|1<<22,l&&(o&=-12582913,o|=l<<22),this._data[i*me+0]=o}insertCells(i,n,l){if(i%=this.length,i&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i-1,0,1,l),n<this.length-i){let o=new gi;for(let h=this.length-i-n-1;h>=0;--h)this.setCell(i+n+h,this.loadCell(i+h,o));for(let h=0;h<n;++h)this.setCell(i+h,l)}else for(let o=i;o<this.length;++o)this.setCell(o,l);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,l)}deleteCells(i,n,l){if(i%=this.length,n<this.length-i){let o=new gi;for(let h=0;h<this.length-i-n;++h)this.setCell(i+h,this.loadCell(i+n+h,o));for(let h=this.length-n;h<this.length;++h)this.setCell(h,l)}else for(let o=i;o<this.length;++o)this.setCell(o,l);i&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i-1,0,1,l),this.getWidth(i)===0&&!this.hasContent(i)&&this.setCellFromCodepoint(i,0,1,l)}replaceCells(i,n,l,o=!1){if(o){for(i&&this.getWidth(i-1)===2&&!this.isProtected(i-1)&&this.setCellFromCodepoint(i-1,0,1,l),n<this.length&&this.getWidth(n-1)===2&&!this.isProtected(n)&&this.setCellFromCodepoint(n,0,1,l);i<n&&i<this.length;)this.isProtected(i)||this.setCell(i,l),i++;return}for(i&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i-1,0,1,l),n<this.length&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n,0,1,l);i<n&&i<this.length;)this.setCell(i++,l)}resize(i,n){if(i===this.length)return this._data.length*4*Vh<this._data.buffer.byteLength;let l=i*me;if(i>this.length){if(this._data.buffer.byteLength>=l*4)this._data=new Uint32Array(this._data.buffer,0,l);else{let o=new Uint32Array(l);o.set(this._data),this._data=o}for(let o=this.length;o<i;++o)this.setCell(o,n)}else{this._data=this._data.subarray(0,l);let o=Object.keys(this._combined);for(let d=0;d<o.length;d++){let _=parseInt(o[d],10);_>=i&&delete this._combined[_]}let h=Object.keys(this._extendedAttrs);for(let d=0;d<h.length;d++){let _=parseInt(h[d],10);_>=i&&delete this._extendedAttrs[_]}}return this.length=i,l*4*Vh<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*Vh<this._data.buffer.byteLength){let i=new Uint32Array(this._data.length);return i.set(this._data),this._data=i,1}return 0}fill(i,n=!1){if(n){for(let l=0;l<this.length;++l)this.isProtected(l)||this.setCell(l,i);return}this._combined={},this._extendedAttrs={};for(let l=0;l<this.length;++l)this.setCell(l,i)}copyFrom(i){this.length!==i.length?this._data=new Uint32Array(i._data):this._data.set(i._data),this.length=i.length,this._combined={};for(let n in i._combined)this._combined[n]=i._combined[n];this._extendedAttrs={};for(let n in i._extendedAttrs)this._extendedAttrs[n]=i._extendedAttrs[n];this.isWrapped=i.isWrapped}clone(){let i=new vv(0);i._data=new Uint32Array(this._data),i.length=this.length;for(let n in this._combined)i._combined[n]=this._combined[n];for(let n in this._extendedAttrs)i._extendedAttrs[n]=this._extendedAttrs[n];return i.isWrapped=this.isWrapped,i}getTrimmedLength(){for(let i=this.length-1;i>=0;--i)if(this._data[i*me+0]&4194303)return i+(this._data[i*me+0]>>22);return 0}getNoBgTrimmedLength(){for(let i=this.length-1;i>=0;--i)if(this._data[i*me+0]&4194303||this._data[i*me+2]&50331648)return i+(this._data[i*me+0]>>22);return 0}copyCellsFrom(i,n,l,o,h){let d=i._data;if(h)for(let p=o-1;p>=0;p--){for(let f=0;f<me;f++)this._data[(l+p)*me+f]=d[(n+p)*me+f];d[(n+p)*me+2]&268435456&&(this._extendedAttrs[l+p]=i._extendedAttrs[n+p])}else for(let p=0;p<o;p++){for(let f=0;f<me;f++)this._data[(l+p)*me+f]=d[(n+p)*me+f];d[(n+p)*me+2]&268435456&&(this._extendedAttrs[l+p]=i._extendedAttrs[n+p])}let _=Object.keys(i._combined);for(let p=0;p<_.length;p++){let f=parseInt(_[p],10);f>=n&&(this._combined[f-n+l]=i._combined[f])}}translateToString(i,n,l,o){n=n??0,l=l??this.length,i&&(l=Math.min(l,this.getTrimmedLength())),o&&(o.length=0);let h="";for(;n<l;){let d=this._data[n*me+0],_=d&2097151,p=d&2097152?this._combined[n]:_?Os(_):Ls;if(h+=p,o)for(let f=0;f<p.length;++f)o.push(n);n+=d>>22||1}return o&&o.push(n),h}};function kx(e,i,n,l,o,h){let d=[];for(let _=0;_<e.length-1;_++){let p=_,f=e.get(++p);if(!f.isWrapped)continue;let S=[e.get(_)];for(;p<e.length&&f.isWrapped;)S.push(f),f=e.get(++p);if(!h&&l>=_&&l<p){_+=S.length-1;continue}let y=0,x=gl(S,y,i),C=1,b=0;for(;C<S.length;){let L=gl(S,C,i),X=L-b,se=n-x,$=Math.min(X,se);S[y].copyCellsFrom(S[C],b,x,$,!1),x+=$,x===n&&(y++,x=0),b+=$,b===L&&(C++,b=0),x===0&&y!==0&&S[y-1].getWidth(n-1)===2&&(S[y].copyCellsFrom(S[y-1],n-1,x++,1,!1),S[y-1].setCell(n-1,o))}S[y].replaceCells(x,n,o);let R=0;for(let L=S.length-1;L>0&&(L>y||S[L].getTrimmedLength()===0);L--)R++;R>0&&(d.push(_+S.length-R),d.push(R)),_+=S.length-1}return d}function Ex(e,i){let n=[],l=0,o=i[l],h=0;for(let d=0;d<e.length;d++)if(o===d){let _=i[++l];e.onDeleteEmitter.fire({index:d-h,amount:_}),d+=_-1,h+=_,o=i[++l]}else n.push(d);return{layout:n,countRemoved:h}}function Tx(e,i){let n=[];for(let l=0;l<i.length;l++)n.push(e.get(i[l]));for(let l=0;l<n.length;l++)e.set(l,n[l]);e.length=i.length}function Rx(e,i,n){let l=[],o=e.map((p,f)=>gl(e,f,i)).reduce((p,f)=>p+f),h=0,d=0,_=0;for(;_<o;){if(o-_<n){l.push(o-_);break}h+=n;let p=gl(e,d,i);h>p&&(h-=p,d++);let f=e[d].getWidth(h-1)===2;f&&h--;let S=f?n-1:n;l.push(S),_+=S}return l}function gl(e,i,n){if(i===e.length-1)return e[i].getTrimmedLength();let l=!e[i].hasContent(n-1)&&e[i].getWidth(n-1)===1,o=e[i+1].getWidth(0)===2;return l&&o?n-1:n}var Sv=class yv{constructor(i){this.line=i,this.isDisposed=!1,this._disposables=[],this._id=yv._nextId++,this._onDispose=this.register(new V),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),ar(this._disposables),this._disposables.length=0)}register(i){return this._disposables.push(i),i}};Sv._nextId=1;var Dx=Sv,ut={},sr=ut.B;ut[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:"≥","{":"π","|":"≠","}":"£","~":"·"};ut.A={"#":"£"};ut.B=void 0;ut[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};ut.C=ut[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};ut.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};ut.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};ut.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};ut.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};ut.E=ut[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};ut.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};ut.H=ut[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};ut["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var Vg=4294967295,Fg=class{constructor(e,i,n){this._hasScrollback=e,this._optionsService=i,this._bufferService=n,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=nt.clone(),this.savedCharset=sr,this.markers=[],this._nullCell=gi.fromCharData([0,Hm,1,0]),this._whitespaceCell=gi.fromCharData([0,Ls,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new so,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new Gg(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new Ja),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new Ja),this._whitespaceCell}getBlankLine(e,i){return new cl(this._bufferService.cols,this.getNullCell(e),i)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let i=e+this._optionsService.rawOptions.scrollback;return i>Vg?Vg:i}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=nt);let i=this._rows;for(;i--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new Gg(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,i){let n=this.getNullCell(nt),l=0,o=this._getCorrectBufferLength(i);if(o>this.lines.maxLength&&(this.lines.maxLength=o),this.lines.length>0){if(this._cols<e)for(let d=0;d<this.lines.length;d++)l+=+this.lines.get(d).resize(e,n);let h=0;if(this._rows<i)for(let d=this._rows;d<i;d++)this.lines.length<i+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new cl(e,n)):this.ybase>0&&this.lines.length<=this.ybase+this.y+h+1?(this.ybase--,h++,this.ydisp>0&&this.ydisp--):this.lines.push(new cl(e,n)));else for(let d=this._rows;d>i;d--)this.lines.length>i+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(o<this.lines.maxLength){let d=this.lines.length-o;d>0&&(this.lines.trimStart(d),this.ybase=Math.max(this.ybase-d,0),this.ydisp=Math.max(this.ydisp-d,0),this.savedY=Math.max(this.savedY-d,0)),this.lines.maxLength=o}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,i-1),h&&(this.y+=h),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=i-1,this._isReflowEnabled&&(this._reflow(e,i),this._cols>e))for(let h=0;h<this.lines.length;h++)l+=+this.lines.get(h).resize(e,n);this._cols=e,this._rows=i,this._memoryCleanupQueue.clear(),l>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let i=0;for(;this._memoryCleanupPosition<this.lines.length;)if(i+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),i>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,i){this._cols!==e&&(e>this._cols?this._reflowLarger(e,i):this._reflowSmaller(e,i))}_reflowLarger(e,i){let n=this._optionsService.rawOptions.reflowCursorLine,l=kx(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(nt),n);if(l.length>0){let o=Ex(this.lines,l);Tx(this.lines,o.layout),this._reflowLargerAdjustViewport(e,i,o.countRemoved)}}_reflowLargerAdjustViewport(e,i,n){let l=this.getNullCell(nt),o=n;for(;o-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<i&&this.lines.push(new cl(e,l))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-n,0)}_reflowSmaller(e,i){let n=this._optionsService.rawOptions.reflowCursorLine,l=this.getNullCell(nt),o=[],h=0;for(let d=this.lines.length-1;d>=0;d--){let _=this.lines.get(d);if(!_||!_.isWrapped&&_.getTrimmedLength()<=e)continue;let p=[_];for(;_.isWrapped&&d>0;)_=this.lines.get(--d),p.unshift(_);if(!n){let $=this.ybase+this.y;if($>=d&&$<d+p.length)continue}let f=p[p.length-1].getTrimmedLength(),S=Rx(p,this._cols,e),y=S.length-p.length,x;this.ybase===0&&this.y!==this.lines.length-1?x=Math.max(0,this.y-this.lines.maxLength+y):x=Math.max(0,this.lines.length-this.lines.maxLength+y);let C=[];for(let $=0;$<y;$++){let W=this.getBlankLine(nt,!0);C.push(W)}C.length>0&&(o.push({start:d+p.length+h,newLines:C}),h+=C.length),p.push(...C);let b=S.length-1,R=S[b];R===0&&(b--,R=S[b]);let L=p.length-y-1,X=f;for(;L>=0;){let $=Math.min(X,R);if(p[b]===void 0)break;if(p[b].copyCellsFrom(p[L],X-$,R-$,$,!0),R-=$,R===0&&(b--,R=S[b]),X-=$,X===0){L--;let W=Math.max(L,0);X=gl(p,W,this._cols)}}for(let $=0;$<p.length;$++)S[$]<e&&p[$].setCell(S[$],l);let se=y-x;for(;se-- >0;)this.ybase===0?this.y<i-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+h)-i&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+y,this.ybase+i-1)}if(o.length>0){let d=[],_=[];for(let R=0;R<this.lines.length;R++)_.push(this.lines.get(R));let p=this.lines.length,f=p-1,S=0,y=o[S];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+h);let x=0;for(let R=Math.min(this.lines.maxLength-1,p+h-1);R>=0;R--)if(y&&y.start>f+x){for(let L=y.newLines.length-1;L>=0;L--)this.lines.set(R--,y.newLines[L]);R++,d.push({index:f+1,amount:y.newLines.length}),x+=y.newLines.length,y=o[++S]}else this.lines.set(R,_[f--]);let C=0;for(let R=d.length-1;R>=0;R--)d[R].index+=C,this.lines.onInsertEmitter.fire(d[R]),C+=d[R].amount;let b=Math.max(0,p+h-this.lines.maxLength);b>0&&this.lines.onTrimEmitter.fire(b)}}translateBufferLineToString(e,i,n=0,l){let o=this.lines.get(e);return o?o.translateToString(i,n,l):""}getWrappedRangeForLine(e){let i=e,n=e;for(;i>0&&this.lines.get(i).isWrapped;)i--;for(;n+1<this.lines.length&&this.lines.get(n+1).isWrapped;)n++;return{first:i,last:n}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let i=0;i<this.markers.length;i++)this.markers[i].line===e&&(this.markers[i].dispose(),this.markers.splice(i--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e){let i=new Dx(e);return this.markers.push(i),i.register(this.lines.onTrim(n=>{i.line-=n,i.line<0&&i.dispose()})),i.register(this.lines.onInsert(n=>{i.line>=n.index&&(i.line+=n.amount)})),i.register(this.lines.onDelete(n=>{i.line>=n.index&&i.line<n.index+n.amount&&i.dispose(),i.line>n.index&&(i.line-=n.amount)})),i.register(i.onDispose(()=>this._removeMarker(i))),i}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},Mx=class extends ve{constructor(e,i){super(),this._optionsService=e,this._bufferService=i,this._onBufferActivate=this._register(new V),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 Fg(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new Fg(!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(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),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(e,i){this._normal.resize(e,i),this._alt.resize(e,i),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},bv=2,xv=1,Bu=class extends ve{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new V),this.onResize=this._onResize.event,this._onScroll=this._register(new V),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,bv),this.rows=Math.max(e.rawOptions.rows||0,xv),this.buffers=this._register(new Mx(e,this)),this._register(this.buffers.onBufferActivate(i=>{this._onScroll.fire(i.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,i){let n=this.cols!==e,l=this.rows!==i;this.cols=e,this.rows=i,this.buffers.resize(e,i),this._onResize.fire({cols:e,rows:i,colsChanged:n,rowsChanged:l})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,i=!1){let n=this.buffer,l;l=this._cachedBlankLine,(!l||l.length!==this.cols||l.getFg(0)!==e.fg||l.getBg(0)!==e.bg)&&(l=n.getBlankLine(e,i),this._cachedBlankLine=l),l.isWrapped=i;let o=n.ybase+n.scrollTop,h=n.ybase+n.scrollBottom;if(n.scrollTop===0){let d=n.lines.isFull;h===n.lines.length-1?d?n.lines.recycle().copyFrom(l):n.lines.push(l.clone()):n.lines.splice(h+1,0,l.clone()),d?this.isUserScrolling&&(n.ydisp=Math.max(n.ydisp-1,0)):(n.ybase++,this.isUserScrolling||n.ydisp++)}else{let d=h-o+1;n.lines.shiftElements(o+1,d-1,-1),n.lines.set(h,l.clone())}this.isUserScrolling||(n.ydisp=n.ybase),this._onScroll.fire(n.ydisp)}scrollLines(e,i){let n=this.buffer;if(e<0){if(n.ydisp===0)return;this.isUserScrolling=!0}else e+n.ydisp>=n.ybase&&(this.isUserScrolling=!1);let l=n.ydisp;n.ydisp=Math.max(Math.min(n.ydisp+e,n.ybase),0),l!==n.ydisp&&(i||this._onScroll.fire(n.ydisp))}};Bu=Ze([ie(0,At)],Bu);var Zr={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:io,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},Bx=["normal","bold","100","200","300","400","500","600","700","800","900"],Ax=class extends ve{constructor(e){super(),this._onOptionChange=this._register(new V),this.onOptionChange=this._onOptionChange.event;let i={...Zr};for(let n in e)if(n in i)try{let l=e[n];i[n]=this._sanitizeAndValidateOption(n,l)}catch(l){console.error(l)}this.rawOptions=i,this.options={...i},this._setupOptions(),this._register($e(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,i){return this.onOptionChange(n=>{n===e&&i(this.rawOptions[e])})}onMultipleOptionChange(e,i){return this.onOptionChange(n=>{e.indexOf(n)!==-1&&i()})}_setupOptions(){let e=n=>{if(!(n in Zr))throw new Error(`No option with key "${n}"`);return this.rawOptions[n]},i=(n,l)=>{if(!(n in Zr))throw new Error(`No option with key "${n}"`);l=this._sanitizeAndValidateOption(n,l),this.rawOptions[n]!==l&&(this.rawOptions[n]=l,this._onOptionChange.fire(n))};for(let n in this.rawOptions){let l={get:e.bind(this,n),set:i.bind(this,n)};Object.defineProperty(this.options,n,l)}}_sanitizeAndValidateOption(e,i){switch(e){case"cursorStyle":if(i||(i=Zr[e]),!zx(i))throw new Error(`"${i}" is not a valid value for ${e}`);break;case"wordSeparator":i||(i=Zr[e]);break;case"fontWeight":case"fontWeightBold":if(typeof i=="number"&&1<=i&&i<=1e3)break;i=Bx.includes(i)?i:Zr[e];break;case"cursorWidth":i=Math.floor(i);case"lineHeight":case"tabStopWidth":if(i<1)throw new Error(`${e} cannot be less than 1, value: ${i}`);break;case"minimumContrastRatio":i=Math.max(1,Math.min(21,Math.round(i*10)/10));break;case"scrollback":if(i=Math.min(i,4294967295),i<0)throw new Error(`${e} cannot be less than 0, value: ${i}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(i<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${i}`);break;case"rows":case"cols":if(!i&&i!==0)throw new Error(`${e} must be numeric, value: ${i}`);break;case"windowsPty":i=i??{};break}return i}};function zx(e){return e==="block"||e==="underline"||e==="bar"}function hl(e,i=5){if(typeof e!="object")return e;let n=Array.isArray(e)?[]:{};for(let l in e)n[l]=i<=1?e[l]:e[l]&&hl(e[l],i-1);return n}var Zg=Object.freeze({insertMode:!1}),Qg=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),Au=class extends ve{constructor(e,i,n){super(),this._bufferService=e,this._logService=i,this._optionsService=n,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new V),this.onData=this._onData.event,this._onUserInput=this._register(new V),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new V),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new V),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=hl(Zg),this.decPrivateModes=hl(Qg)}reset(){this.modes=hl(Zg),this.decPrivateModes=hl(Qg)}triggerDataEvent(e,i=!1){if(this._optionsService.rawOptions.disableStdin)return;let n=this._bufferService.buffer;i&&this._optionsService.rawOptions.scrollOnUserInput&&n.ybase!==n.ydisp&&this._onRequestScrollToBottom.fire(),i&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(l=>l.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace("sending binary (codes)",()=>e.split("").map(i=>i.charCodeAt(0))),this._onBinary.fire(e))}};Au=Ze([ie(0,Bt),ie(1,Pm),ie(2,At)],Au);var Jg={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>!(e.action===32&&e.button===3)},ANY:{events:31,restrict:e=>!0}};function Fh(e,i){let n=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(n|=64,n|=e.action):(n|=e.button&3,e.button&4&&(n|=64),e.button&8&&(n|=128),e.action===32?n|=32:e.action===0&&!i&&(n|=3)),n}var Zh=String.fromCharCode,em={DEFAULT:e=>{let i=[Fh(e,!1)+32,e.col+32,e.row+32];return i[0]>255||i[1]>255||i[2]>255?"":`\x1B[M${Zh(i[0])}${Zh(i[1])}${Zh(i[2])}`},SGR:e=>{let i=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Fh(e,!0)};${e.col};${e.row}${i}`},SGR_PIXELS:e=>{let i=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Fh(e,!0)};${e.x};${e.y}${i}`}},zu=class extends ve{constructor(e,i,n){super(),this._bufferService=e,this._coreService=i,this._optionsService=n,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new V),this.onProtocolChange=this._onProtocolChange.event;for(let l of Object.keys(Jg))this.addProtocol(l,Jg[l]);for(let l of Object.keys(em))this.addEncoding(l,em[l]);this.reset()}addProtocol(e,i){this._protocols[e]=i}addEncoding(e,i){this._encodings[e]=i}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,i,n){if(e.deltaY===0||e.shiftKey||i===void 0||n===void 0)return 0;let l=i/n,o=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(o/=l+0,Math.abs(e.deltaY)<50&&(o*=.3),this._wheelPartialScroll+=o,o=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(o*=this._bufferService.rows),o}_applyScrollModifier(e,i){return i.altKey||i.ctrlKey||i.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(e))return!1;let i=this._encodings[this._activeEncoding](e);return i&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(i):this._coreService.triggerDataEvent(i,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,i,n){if(n){if(e.x!==i.x||e.y!==i.y)return!1}else if(e.col!==i.col||e.row!==i.row)return!1;return!(e.button!==i.button||e.action!==i.action||e.ctrl!==i.ctrl||e.alt!==i.alt||e.shift!==i.shift)}};zu=Ze([ie(0,Bt),ie(1,hr),ie(2,At)],zu);var Qh=[[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]],Ox=[[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]],ht;function Lx(e,i){let n=0,l=i.length-1,o;if(e<i[0][0]||e>i[l][1])return!1;for(;l>=n;)if(o=n+l>>1,e>i[o][1])n=o+1;else if(e<i[o][0])l=o-1;else return!0;return!1}var Nx=class{constructor(){if(this.version="6",!ht){ht=new Uint8Array(65536),ht.fill(1),ht[0]=0,ht.fill(0,1,32),ht.fill(0,127,160),ht.fill(2,4352,4448),ht[9001]=2,ht[9002]=2,ht.fill(2,11904,42192),ht[12351]=1,ht.fill(2,44032,55204),ht.fill(2,63744,64256),ht.fill(2,65040,65050),ht.fill(2,65072,65136),ht.fill(2,65280,65377),ht.fill(2,65504,65511);for(let e=0;e<Qh.length;++e)ht.fill(0,Qh[e][0],Qh[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?ht[e]:Lx(e,Ox)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,i){let n=this.wcwidth(e),l=n===0&&i!==0;if(l){let o=nr.extractWidth(i);o===0?l=!1:o>n&&(n=o)}return nr.createPropertyValue(0,n,l)}},nr=class Za{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new V,this.onChange=this._onChange.event;let i=new Nx;this.register(i),this._active=i.version,this._activeProvider=i}static extractShouldJoin(i){return(i&1)!==0}static extractWidth(i){return i>>1&3}static extractCharKind(i){return i>>3}static createPropertyValue(i,n,l=!1){return(i&16777215)<<3|(n&3)<<1|(l?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(i){if(!this._providers[i])throw new Error(`unknown Unicode version "${i}"`);this._active=i,this._activeProvider=this._providers[i],this._onChange.fire(i)}register(i){this._providers[i.version]=i}wcwidth(i){return this._activeProvider.wcwidth(i)}getStringCellWidth(i){let n=0,l=0,o=i.length;for(let h=0;h<o;++h){let d=i.charCodeAt(h);if(55296<=d&&d<=56319){if(++h>=o)return n+this.wcwidth(d);let f=i.charCodeAt(h);56320<=f&&f<=57343?d=(d-55296)*1024+f-56320+65536:n+=this.wcwidth(f)}let _=this.charProperties(d,l),p=Za.extractWidth(_);Za.extractShouldJoin(_)&&(p-=Za.extractWidth(l)),n+=p,l=_}return n}charProperties(i,n){return this._activeProvider.charProperties(i,n)}},Hx=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,i){this._charsets[e]=i,this.glevel===e&&(this.charset=i)}};function tm(e){let i=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1)?.get(e.cols-1),n=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);n&&i&&(n.isWrapped=i[3]!==0&&i[3]!==32)}var il=2147483647,jx=256,wv=class Ou{constructor(i=32,n=32){if(this.maxLength=i,this.maxSubParamsLength=n,n>jx)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(i),this.length=0,this._subParams=new Int32Array(n),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(i),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(i){let n=new Ou;if(!i.length)return n;for(let l=Array.isArray(i[0])?1:0;l<i.length;++l){let o=i[l];if(Array.isArray(o))for(let h=0;h<o.length;++h)n.addSubParam(o[h]);else n.addParam(o)}return n}clone(){let i=new Ou(this.maxLength,this.maxSubParamsLength);return i.params.set(this.params),i.length=this.length,i._subParams.set(this._subParams),i._subParamsLength=this._subParamsLength,i._subParamsIdx.set(this._subParamsIdx),i._rejectDigits=this._rejectDigits,i._rejectSubDigits=this._rejectSubDigits,i._digitIsSub=this._digitIsSub,i}toArray(){let i=[];for(let n=0;n<this.length;++n){i.push(this.params[n]);let l=this._subParamsIdx[n]>>8,o=this._subParamsIdx[n]&255;o-l>0&&i.push(Array.prototype.slice.call(this._subParams,l,o))}return i}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(i){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(i<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=i>il?il:i}addSubParam(i){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(i<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=i>il?il:i,this._subParamsIdx[this.length-1]++}}hasSubParams(i){return(this._subParamsIdx[i]&255)-(this._subParamsIdx[i]>>8)>0}getSubParams(i){let n=this._subParamsIdx[i]>>8,l=this._subParamsIdx[i]&255;return l-n>0?this._subParams.subarray(n,l):null}getSubParamsAll(){let i={};for(let n=0;n<this.length;++n){let l=this._subParamsIdx[n]>>8,o=this._subParamsIdx[n]&255;o-l>0&&(i[n]=this._subParams.slice(l,o))}return i}addDigit(i){let n;if(this._rejectDigits||!(n=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let l=this._digitIsSub?this._subParams:this.params,o=l[n-1];l[n-1]=~o?Math.min(o*10+i,il):i}},sl=[],Ux=class{constructor(){this._state=0,this._active=sl,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,i){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(i),{dispose:()=>{let l=n.indexOf(i);l!==-1&&n.splice(l,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=sl}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=sl,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||sl,!this._active.length)this._handlerFb(this._id,"START");else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,i,n){if(!this._active.length)this._handlerFb(this._id,"PUT",co(e,i,n));else for(let l=this._active.length-1;l>=0;l--)this._active[l].put(e,i,n)}start(){this.reset(),this._state=1}put(e,i,n){if(this._state!==3){if(this._state===1)for(;i<n;){let l=e[i++];if(l===59){this._state=2,this._start();break}if(l<48||57<l){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+l-48}this._state===2&&n-i>0&&this._put(e,i,n)}}end(e,i=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",e);else{let n=!1,l=this._active.length-1,o=!1;if(this._stack.paused&&(l=this._stack.loopPosition-1,n=i,o=this._stack.fallThrough,this._stack.paused=!1),!o&&n===!1){for(;l>=0&&(n=this._active[l].end(e),n!==!0);l--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=l,this._stack.fallThrough=!1,n;l--}for(;l>=0;l--)if(n=this._active[l].end(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=l,this._stack.fallThrough=!0,n}this._active=sl,this._id=-1,this._state=0}}},Jt=class{constructor(i){this._handler=i,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(i,n,l){this._hitLimit||(this._data+=co(i,n,l),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(i){let n=!1;if(this._hitLimit)n=!1;else if(i&&(n=this._handler(this._data),n instanceof Promise))return n.then(l=>(this._data="",this._hitLimit=!1,l));return this._data="",this._hitLimit=!1,n}},rl=[],qx=class{constructor(){this._handlers=Object.create(null),this._active=rl,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=rl}registerHandler(e,i){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(i),{dispose:()=>{let l=n.indexOf(i);l!==-1&&n.splice(l,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=rl,this._ident=0}hook(e,i){if(this.reset(),this._ident=e,this._active=this._handlers[e]||rl,!this._active.length)this._handlerFb(this._ident,"HOOK",i);else for(let n=this._active.length-1;n>=0;n--)this._active[n].hook(i)}put(e,i,n){if(!this._active.length)this._handlerFb(this._ident,"PUT",co(e,i,n));else for(let l=this._active.length-1;l>=0;l--)this._active[l].put(e,i,n)}unhook(e,i=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let n=!1,l=this._active.length-1,o=!1;if(this._stack.paused&&(l=this._stack.loopPosition-1,n=i,o=this._stack.fallThrough,this._stack.paused=!1),!o&&n===!1){for(;l>=0&&(n=this._active[l].unhook(e),n!==!0);l--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=l,this._stack.fallThrough=!1,n;l--}for(;l>=0;l--)if(n=this._active[l].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=l,this._stack.fallThrough=!0,n}this._active=rl,this._ident=0}},ul=new wv;ul.addParam(0);var im=class{constructor(e){this._handler=e,this._data="",this._params=ul,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():ul,this._data="",this._hitLimit=!1}put(e,i,n){this._hitLimit||(this._data+=co(e,i,n),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let i=!1;if(this._hitLimit)i=!1;else if(e&&(i=this._handler(this._data,this._params),i instanceof Promise))return i.then(n=>(this._params=ul,this._data="",this._hitLimit=!1,n));return this._params=ul,this._data="",this._hitLimit=!1,i}},Wx=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,i){this.table.fill(e<<4|i)}add(e,i,n,l){this.table[i<<8|e]=n<<4|l}addMany(e,i,n,l){for(let o=0;o<e.length;o++)this.table[i<<8|e[o]]=n<<4|l}},_i=160,Px=(function(){let e=new Wx(4095),i=Array.apply(null,Array(256)).map((_,p)=>p),n=(_,p)=>i.slice(_,p),l=n(32,127),o=n(0,24);o.push(25),o.push.apply(o,n(28,32));let h=n(0,14),d;e.setDefault(1,0),e.addMany(l,0,2,0);for(d in h)e.addMany([24,26,153,154],d,3,0),e.addMany(n(128,144),d,3,0),e.addMany(n(144,152),d,3,0),e.add(156,d,0,0),e.add(27,d,11,1),e.add(157,d,4,8),e.addMany([152,158,159],d,0,7),e.add(155,d,11,3),e.add(144,d,11,9);return e.addMany(o,0,3,0),e.addMany(o,1,3,1),e.add(127,1,0,1),e.addMany(o,8,0,8),e.addMany(o,3,3,3),e.add(127,3,0,3),e.addMany(o,4,3,4),e.add(127,4,0,4),e.addMany(o,6,3,6),e.addMany(o,5,3,5),e.add(127,5,0,5),e.addMany(o,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(l,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(n(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(l,7,0,7),e.addMany(o,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(n(64,127),3,7,0),e.addMany(n(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(n(48,60),4,8,4),e.addMany(n(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(n(32,64),6,0,6),e.add(127,6,0,6),e.addMany(n(64,127),6,0,0),e.addMany(n(32,48),3,9,5),e.addMany(n(32,48),5,9,5),e.addMany(n(48,64),5,0,6),e.addMany(n(64,127),5,7,0),e.addMany(n(32,48),4,9,5),e.addMany(n(32,48),1,9,2),e.addMany(n(32,48),2,9,2),e.addMany(n(48,127),2,10,0),e.addMany(n(48,80),1,10,0),e.addMany(n(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(n(96,127),1,10,0),e.add(80,1,11,9),e.addMany(o,9,0,9),e.add(127,9,0,9),e.addMany(n(28,32),9,0,9),e.addMany(n(32,48),9,9,12),e.addMany(n(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(o,11,0,11),e.addMany(n(32,128),11,0,11),e.addMany(n(28,32),11,0,11),e.addMany(o,10,0,10),e.add(127,10,0,10),e.addMany(n(28,32),10,0,10),e.addMany(n(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(n(32,48),10,9,12),e.addMany(o,12,0,12),e.add(127,12,0,12),e.addMany(n(28,32),12,0,12),e.addMany(n(32,48),12,9,12),e.addMany(n(48,64),12,0,11),e.addMany(n(64,127),12,12,13),e.addMany(n(64,127),10,12,13),e.addMany(n(64,127),9,12,13),e.addMany(o,13,13,13),e.addMany(l,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(_i,0,2,0),e.add(_i,8,5,8),e.add(_i,6,0,6),e.add(_i,11,0,11),e.add(_i,13,13,13),e})(),Kx=class extends ve{constructor(e=Px){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new wv,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(i,n,l)=>{},this._executeHandlerFb=i=>{},this._csiHandlerFb=(i,n)=>{},this._escHandlerFb=i=>{},this._errorHandlerFb=i=>i,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register($e(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new Ux),this._dcsParser=this._register(new qx),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,i=[64,126]){let n=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(n=e.prefix.charCodeAt(0),n&&60>n||n>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let o=0;o<e.intermediates.length;++o){let h=e.intermediates.charCodeAt(o);if(32>h||h>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");n<<=8,n|=h}}if(e.final.length!==1)throw new Error("final must be a single byte");let l=e.final.charCodeAt(0);if(i[0]>l||l>i[1])throw new Error(`final must be in range ${i[0]} .. ${i[1]}`);return n<<=8,n|=l,n}identToString(e){let i=[];for(;e;)i.push(String.fromCharCode(e&255)),e>>=8;return i.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,i){let n=this._identifier(e,[48,126]);this._escHandlers[n]===void 0&&(this._escHandlers[n]=[]);let l=this._escHandlers[n];return l.push(i),{dispose:()=>{let o=l.indexOf(i);o!==-1&&l.splice(o,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,i){this._executeHandlers[e.charCodeAt(0)]=i}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,i){let n=this._identifier(e);this._csiHandlers[n]===void 0&&(this._csiHandlers[n]=[]);let l=this._csiHandlers[n];return l.push(i),{dispose:()=>{let o=l.indexOf(i);o!==-1&&l.splice(o,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,i){return this._dcsParser.registerHandler(this._identifier(e),i)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,i){return this._oscParser.registerHandler(e,i)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}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(e,i,n,l,o){this._parseStack.state=e,this._parseStack.handlers=i,this._parseStack.handlerPos=n,this._parseStack.transition=l,this._parseStack.chunkPos=o}parse(e,i,n){let l=0,o=0,h=0,d;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,h=this._parseStack.chunkPos+1;else{if(n===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let _=this._parseStack.handlers,p=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(n===!1&&p>-1){for(;p>=0&&(d=_[p](this._params),d!==!0);p--)if(d instanceof Promise)return this._parseStack.handlerPos=p,d}this._parseStack.handlers=[];break;case 4:if(n===!1&&p>-1){for(;p>=0&&(d=_[p](),d!==!0);p--)if(d instanceof Promise)return this._parseStack.handlerPos=p,d}this._parseStack.handlers=[];break;case 6:if(l=e[this._parseStack.chunkPos],d=this._dcsParser.unhook(l!==24&&l!==26,n),d)return d;l===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(l=e[this._parseStack.chunkPos],d=this._oscParser.end(l!==24&&l!==26,n),d)return d;l===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,h=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let _=h;_<i;++_){switch(l=e[_],o=this._transitions.table[this.currentState<<8|(l<160?l:_i)],o>>4){case 2:for(let x=_+1;;++x){if(x>=i||(l=e[x])<32||l>126&&l<_i){this._printHandler(e,_,x),_=x-1;break}if(++x>=i||(l=e[x])<32||l>126&&l<_i){this._printHandler(e,_,x),_=x-1;break}if(++x>=i||(l=e[x])<32||l>126&&l<_i){this._printHandler(e,_,x),_=x-1;break}if(++x>=i||(l=e[x])<32||l>126&&l<_i){this._printHandler(e,_,x),_=x-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:_,code:l,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let p=this._csiHandlers[this._collect<<8|l],f=p?p.length-1:-1;for(;f>=0&&(d=p[f](this._params),d!==!0);f--)if(d instanceof Promise)return this._preserveStack(3,p,f,o,_),d;f<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(++_<i&&(l=e[_])>47&&l<60);_--;break;case 9:this._collect<<=8,this._collect|=l;break;case 10:let S=this._escHandlers[this._collect<<8|l],y=S?S.length-1:-1;for(;y>=0&&(d=S[y](),d!==!0);y--)if(d instanceof Promise)return this._preserveStack(4,S,y,o,_),d;y<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 x=_+1;;++x)if(x>=i||(l=e[x])===24||l===26||l===27||l>127&&l<_i){this._dcsParser.put(e,_,x),_=x-1;break}break;case 14:if(d=this._dcsParser.unhook(l!==24&&l!==26),d)return this._preserveStack(6,[],0,o,_),d;l===27&&(o|=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 x=_+1;;x++)if(x>=i||(l=e[x])<32||l>127&&l<_i){this._oscParser.put(e,_,x),_=x-1;break}break;case 6:if(d=this._oscParser.end(l!==24&&l!==26),d)return this._preserveStack(5,[],0,o,_),d;l===27&&(o|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=o&15}}},Yx=/^([\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})$/,$x=/^[\da-f]+$/;function sm(e){if(!e)return;let i=e.toLowerCase();if(i.indexOf("rgb:")===0){i=i.slice(4);let n=Yx.exec(i);if(n){let l=n[1]?15:n[4]?255:n[7]?4095:65535;return[Math.round(parseInt(n[1]||n[4]||n[7]||n[10],16)/l*255),Math.round(parseInt(n[2]||n[5]||n[8]||n[11],16)/l*255),Math.round(parseInt(n[3]||n[6]||n[9]||n[12],16)/l*255)]}}else if(i.indexOf("#")===0&&(i=i.slice(1),$x.exec(i)&&[3,6,9,12].includes(i.length))){let n=i.length/3,l=[0,0,0];for(let o=0;o<3;++o){let h=parseInt(i.slice(n*o,n*o+n),16);l[o]=n===1?h<<4:n===2?h:n===3?h>>4:h>>8}return l}}function Jh(e,i){let n=e.toString(16),l=n.length<2?"0"+n:n;switch(i){case 4:return n[0];case 8:return l;case 12:return(l+l).slice(0,3);default:return l+l}}function Ix(e,i=16){let[n,l,o]=e;return`rgb:${Jh(n,i)}/${Jh(l,i)}/${Jh(o,i)}`}var Xx={"(":0,")":1,"*":2,"+":3,"-":1,".":2},zs=131072,rm=10;function nm(e,i){if(e>24)return i.setWinLines||!1;switch(e){case 1:return!!i.restoreWin;case 2:return!!i.minimizeWin;case 3:return!!i.setWinPosition;case 4:return!!i.setWinSizePixels;case 5:return!!i.raiseWin;case 6:return!!i.lowerWin;case 7:return!!i.refreshWin;case 8:return!!i.setWinSizeChars;case 9:return!!i.maximizeWin;case 10:return!!i.fullscreenWin;case 11:return!!i.getWinState;case 13:return!!i.getWinPosition;case 14:return!!i.getWinSizePixels;case 15:return!!i.getScreenSizePixels;case 16:return!!i.getCellSizePixels;case 18:return!!i.getWinSizeChars;case 19:return!!i.getScreenSizeChars;case 20:return!!i.getIconTitle;case 21:return!!i.getWinTitle;case 22:return!!i.pushTitle;case 23:return!!i.popTitle;case 24:return!!i.setWinLines}return!1}var lm=5e3,am=0,Gx=class extends ve{constructor(e,i,n,l,o,h,d,_,p=new Kx){super(),this._bufferService=e,this._charsetService=i,this._coreService=n,this._logService=l,this._optionsService=o,this._oscLinkService=h,this._coreMouseService=d,this._unicodeService=_,this._parser=p,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new fb,this._utf8Decoder=new _b,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=nt.clone(),this._eraseAttrDataInternal=nt.clone(),this._onRequestBell=this._register(new V),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new V),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new V),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new V),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new V),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new V),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new V),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new V),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new V),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new V),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new V),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new V),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new V),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 Lu(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(f=>this._activeBuffer=f.activeBuffer)),this._parser.setCsiHandlerFallback((f,S)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(f),params:S.toArray()})}),this._parser.setEscHandlerFallback(f=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(f)})}),this._parser.setExecuteHandlerFallback(f=>{this._logService.debug("Unknown EXECUTE code: ",{code:f})}),this._parser.setOscHandlerFallback((f,S,y)=>{this._logService.debug("Unknown OSC code: ",{identifier:f,action:S,data:y})}),this._parser.setDcsHandlerFallback((f,S,y)=>{S==="HOOK"&&(y=y.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(f),action:S,payload:y})}),this._parser.setPrintHandler((f,S,y)=>this.print(f,S,y)),this._parser.registerCsiHandler({final:"@"},f=>this.insertChars(f)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},f=>this.scrollLeft(f)),this._parser.registerCsiHandler({final:"A"},f=>this.cursorUp(f)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},f=>this.scrollRight(f)),this._parser.registerCsiHandler({final:"B"},f=>this.cursorDown(f)),this._parser.registerCsiHandler({final:"C"},f=>this.cursorForward(f)),this._parser.registerCsiHandler({final:"D"},f=>this.cursorBackward(f)),this._parser.registerCsiHandler({final:"E"},f=>this.cursorNextLine(f)),this._parser.registerCsiHandler({final:"F"},f=>this.cursorPrecedingLine(f)),this._parser.registerCsiHandler({final:"G"},f=>this.cursorCharAbsolute(f)),this._parser.registerCsiHandler({final:"H"},f=>this.cursorPosition(f)),this._parser.registerCsiHandler({final:"I"},f=>this.cursorForwardTab(f)),this._parser.registerCsiHandler({final:"J"},f=>this.eraseInDisplay(f,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},f=>this.eraseInDisplay(f,!0)),this._parser.registerCsiHandler({final:"K"},f=>this.eraseInLine(f,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},f=>this.eraseInLine(f,!0)),this._parser.registerCsiHandler({final:"L"},f=>this.insertLines(f)),this._parser.registerCsiHandler({final:"M"},f=>this.deleteLines(f)),this._parser.registerCsiHandler({final:"P"},f=>this.deleteChars(f)),this._parser.registerCsiHandler({final:"S"},f=>this.scrollUp(f)),this._parser.registerCsiHandler({final:"T"},f=>this.scrollDown(f)),this._parser.registerCsiHandler({final:"X"},f=>this.eraseChars(f)),this._parser.registerCsiHandler({final:"Z"},f=>this.cursorBackwardTab(f)),this._parser.registerCsiHandler({final:"`"},f=>this.charPosAbsolute(f)),this._parser.registerCsiHandler({final:"a"},f=>this.hPositionRelative(f)),this._parser.registerCsiHandler({final:"b"},f=>this.repeatPrecedingCharacter(f)),this._parser.registerCsiHandler({final:"c"},f=>this.sendDeviceAttributesPrimary(f)),this._parser.registerCsiHandler({prefix:">",final:"c"},f=>this.sendDeviceAttributesSecondary(f)),this._parser.registerCsiHandler({final:"d"},f=>this.linePosAbsolute(f)),this._parser.registerCsiHandler({final:"e"},f=>this.vPositionRelative(f)),this._parser.registerCsiHandler({final:"f"},f=>this.hVPosition(f)),this._parser.registerCsiHandler({final:"g"},f=>this.tabClear(f)),this._parser.registerCsiHandler({final:"h"},f=>this.setMode(f)),this._parser.registerCsiHandler({prefix:"?",final:"h"},f=>this.setModePrivate(f)),this._parser.registerCsiHandler({final:"l"},f=>this.resetMode(f)),this._parser.registerCsiHandler({prefix:"?",final:"l"},f=>this.resetModePrivate(f)),this._parser.registerCsiHandler({final:"m"},f=>this.charAttributes(f)),this._parser.registerCsiHandler({final:"n"},f=>this.deviceStatus(f)),this._parser.registerCsiHandler({prefix:"?",final:"n"},f=>this.deviceStatusPrivate(f)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},f=>this.softReset(f)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},f=>this.setCursorStyle(f)),this._parser.registerCsiHandler({final:"r"},f=>this.setScrollRegion(f)),this._parser.registerCsiHandler({final:"s"},f=>this.saveCursor(f)),this._parser.registerCsiHandler({final:"t"},f=>this.windowOptions(f)),this._parser.registerCsiHandler({final:"u"},f=>this.restoreCursor(f)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},f=>this.insertColumns(f)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},f=>this.deleteColumns(f)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},f=>this.selectProtected(f)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},f=>this.requestMode(f,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},f=>this.requestMode(f,!1)),this._parser.setExecuteHandler(K.BEL,()=>this.bell()),this._parser.setExecuteHandler(K.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(K.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(K.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(K.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(K.BS,()=>this.backspace()),this._parser.setExecuteHandler(K.HT,()=>this.tab()),this._parser.setExecuteHandler(K.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(K.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(Va.IND,()=>this.index()),this._parser.setExecuteHandler(Va.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(Va.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new Jt(f=>(this.setTitle(f),this.setIconName(f),!0))),this._parser.registerOscHandler(1,new Jt(f=>this.setIconName(f))),this._parser.registerOscHandler(2,new Jt(f=>this.setTitle(f))),this._parser.registerOscHandler(4,new Jt(f=>this.setOrReportIndexedColor(f))),this._parser.registerOscHandler(8,new Jt(f=>this.setHyperlink(f))),this._parser.registerOscHandler(10,new Jt(f=>this.setOrReportFgColor(f))),this._parser.registerOscHandler(11,new Jt(f=>this.setOrReportBgColor(f))),this._parser.registerOscHandler(12,new Jt(f=>this.setOrReportCursorColor(f))),this._parser.registerOscHandler(104,new Jt(f=>this.restoreIndexedColor(f))),this._parser.registerOscHandler(110,new Jt(f=>this.restoreFgColor(f))),this._parser.registerOscHandler(111,new Jt(f=>this.restoreBgColor(f))),this._parser.registerOscHandler(112,new Jt(f=>this.restoreCursorColor(f))),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(let f in ut)this._parser.registerEscHandler({intermediates:"(",final:f},()=>this.selectCharset("("+f)),this._parser.registerEscHandler({intermediates:")",final:f},()=>this.selectCharset(")"+f)),this._parser.registerEscHandler({intermediates:"*",final:f},()=>this.selectCharset("*"+f)),this._parser.registerEscHandler({intermediates:"+",final:f},()=>this.selectCharset("+"+f)),this._parser.registerEscHandler({intermediates:"-",final:f},()=>this.selectCharset("-"+f)),this._parser.registerEscHandler({intermediates:".",final:f},()=>this.selectCharset("."+f)),this._parser.registerEscHandler({intermediates:"/",final:f},()=>this.selectCharset("/"+f));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(f=>(this._logService.error("Parsing error: ",f),f)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new im((f,S)=>this.requestStatusString(f,S)))}getAttrData(){return this._curAttrData}_preserveStack(e,i,n,l){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=i,this._parseStack.decodedLength=n,this._parseStack.position=l}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((i,n)=>setTimeout(()=>n("#SLOW_TIMEOUT"),lm))]).catch(i=>{if(i!=="#SLOW_TIMEOUT")throw i;console.warn(`async parser handler taking longer than ${lm} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,i){let n,l=this._activeBuffer.x,o=this._activeBuffer.y,h=0,d=this._parseStack.paused;if(d){if(n=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,i))return this._logSlowResolvingAsync(n),n;l=this._parseStack.cursorStartX,o=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>zs&&(h=this._parseStack.position+zs)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,f=>String.fromCharCode(f)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(f=>f.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<zs&&(this._parseBuffer=new Uint32Array(Math.min(e.length,zs))),d||this._dirtyRowTracker.clearRange(),e.length>zs)for(let f=h;f<e.length;f+=zs){let S=f+zs<e.length?f+zs:e.length,y=typeof e=="string"?this._stringDecoder.decode(e.substring(f,S),this._parseBuffer):this._utf8Decoder.decode(e.subarray(f,S),this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,y))return this._preserveStack(l,o,y,f),this._logSlowResolvingAsync(n),n}else if(!d){let f=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,f))return this._preserveStack(l,o,f,0),this._logSlowResolvingAsync(n),n}(this._activeBuffer.x!==l||this._activeBuffer.y!==o)&&this._onCursorMove.fire();let _=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),p=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);p<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(p,this._bufferService.rows-1),end:Math.min(_,this._bufferService.rows-1)})}print(e,i,n){let l,o,h=this._charsetService.charset,d=this._optionsService.rawOptions.screenReaderMode,_=this._bufferService.cols,p=this._coreService.decPrivateModes.wraparound,f=this._coreService.modes.insertMode,S=this._curAttrData,y=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&n-i>0&&y.getWidth(this._activeBuffer.x-1)===2&&y.setCellFromCodepoint(this._activeBuffer.x-1,0,1,S);let x=this._parser.precedingJoinState;for(let C=i;C<n;++C){if(l=e[C],l<127&&h){let X=h[String.fromCharCode(l)];X&&(l=X.charCodeAt(0))}let b=this._unicodeService.charProperties(l,x);o=nr.extractWidth(b);let R=nr.extractShouldJoin(b),L=R?nr.extractWidth(x):0;if(x=b,d&&this._onA11yChar.fire(Os(l)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+o-L>_){if(p){let X=y,se=this._activeBuffer.x-L;for(this._activeBuffer.x=L,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),y=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),L>0&&y instanceof cl&&y.copyCellsFrom(X,se,0,L,!1);se<_;)X.setCellFromCodepoint(se++,0,1,S)}else if(this._activeBuffer.x=_-1,o===2)continue}if(R&&this._activeBuffer.x){let X=y.getWidth(this._activeBuffer.x-1)?1:2;y.addCodepointToCell(this._activeBuffer.x-X,l,o);for(let se=o-L;--se>=0;)y.setCellFromCodepoint(this._activeBuffer.x++,0,0,S);continue}if(f&&(y.insertCells(this._activeBuffer.x,o-L,this._activeBuffer.getNullCell(S)),y.getWidth(_-1)===2&&y.setCellFromCodepoint(_-1,0,1,S)),y.setCellFromCodepoint(this._activeBuffer.x++,l,o,S),o>0)for(;--o;)y.setCellFromCodepoint(this._activeBuffer.x++,0,0,S)}this._parser.precedingJoinState=x,this._activeBuffer.x<_&&n-i>0&&y.getWidth(this._activeBuffer.x)===0&&!y.hasContent(this._activeBuffer.x)&&y.setCellFromCodepoint(this._activeBuffer.x,0,1,S),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,i){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,n=>nm(n.params[0],this._optionsService.rawOptions.windowOptions)?i(n):!0):this._parser.registerCsiHandler(e,i)}registerDcsHandler(e,i){return this._parser.registerDcsHandler(e,new im(i))}registerEscHandler(e,i){return this._parser.registerEscHandler(e,i)}registerOscHandler(e,i){return this._parser.registerOscHandler(e,new Jt(i))}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;let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(e,i){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+i):(this._activeBuffer.x=e,this._activeBuffer.y=i),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,i){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+i)}cursorUp(e){let i=this._activeBuffer.y-this._activeBuffer.scrollTop;return i>=0?this._moveCursor(0,-Math.min(i,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let i=this._activeBuffer.scrollBottom-this._activeBuffer.y;return i>=0?this._moveCursor(0,Math.min(i,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let i=e.params[0];return i===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:i===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let i=e.params[0]||1;for(;i--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let i=e.params[0]||1;for(;i--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let i=e.params[0];return i===1&&(this._curAttrData.bg|=536870912),(i===2||i===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,i,n,l=!1,o=!1){let h=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);h.replaceCells(i,n,this._activeBuffer.getNullCell(this._eraseAttrData()),o),l&&(h.isWrapped=!1)}_resetBufferLine(e,i=!1){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n&&(n.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),i),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),n.isWrapped=!1)}eraseInDisplay(e,i=!1){this._restrictCursor(this._bufferService.cols);let n;switch(e.params[0]){case 0:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,i);n<this._bufferService.rows;n++)this._resetBufferLine(n,i);this._dirtyRowTracker.markDirty(n);break;case 1:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n,0,this._activeBuffer.x+1,!0,i),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(n+1).isWrapped=!1);n--;)this._resetBufferLine(n,i);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(n=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,n-1);n--&&!this._activeBuffer.lines.get(this._activeBuffer.ybase+n)?.getTrimmedLength(););for(;n>=0;n--)this._bufferService.scroll(this._eraseAttrData())}else{for(n=this._bufferService.rows,this._dirtyRowTracker.markDirty(n-1);n--;)this._resetBufferLine(n,i);this._dirtyRowTracker.markDirty(0)}break;case 3:let l=this._activeBuffer.lines.length-this._bufferService.rows;l>0&&(this._activeBuffer.lines.trimStart(l),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-l,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-l,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,i=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,i);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,i);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,i);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let i=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,l=this._bufferService.rows-1-this._activeBuffer.scrollBottom,o=this._bufferService.rows-1+this._activeBuffer.ybase-l+1;for(;i--;)this._activeBuffer.lines.splice(o-1,1),this._activeBuffer.lines.splice(n,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let i=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,l;for(l=this._bufferService.rows-1-this._activeBuffer.scrollBottom,l=this._bufferService.rows-1+this._activeBuffer.ybase-l;i--;)this._activeBuffer.lines.splice(n,1),this._activeBuffer.lines.splice(l,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e){this._restrictCursor();let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return i&&(i.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return i&&(i.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let i=e.params[0]||1;for(;i--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(e){let i=e.params[0]||1;for(;i--;)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(nt));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let l=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);l.deleteCells(0,i,this._activeBuffer.getNullCell(this._eraseAttrData())),l.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let l=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);l.insertCells(0,i,this._activeBuffer.getNullCell(this._eraseAttrData())),l.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let l=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);l.insertCells(this._activeBuffer.x,i,this._activeBuffer.getNullCell(this._eraseAttrData())),l.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let l=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);l.deleteCells(this._activeBuffer.x,i,this._activeBuffer.getNullCell(this._eraseAttrData())),l.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return i&&(i.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let i=this._parser.precedingJoinState;if(!i)return!0;let n=e.params[0]||1,l=nr.extractWidth(i),o=this._activeBuffer.x-l,h=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(o),d=new Uint32Array(h.length*n),_=0;for(let f=0;f<h.length;){let S=h.codePointAt(f)||0;d[_++]=S,f+=S>65535?2:1}let p=_;for(let f=1;f<n;++f)d.copyWithin(p,0,_),p+=_;return this.print(d,0,p),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(K.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(K.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(K.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(K.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(K.ESC+"[>83;40003;0c")),!0}_is(e){return(this._optionsService.rawOptions.termName+"").indexOf(e)===0}setMode(e){for(let i=0;i<e.length;i++)switch(e.params[i]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0;break}return!0}setModePrivate(e){for(let i=0;i<e.length;i++)switch(e.params[i]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,sr),this._charsetService.setgCharset(1,sr),this._charsetService.setgCharset(2,sr),this._charsetService.setgCharset(3,sr);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(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!0;break}return!0}resetMode(e){for(let i=0;i<e.length;i++)switch(e.params[i]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(e){for(let i=0;i<e.length;i++)switch(e.params[i]){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:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),e.params[i]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0);break}return!0}requestMode(e,i){let n;(R=>(R[R.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",R[R.SET=1]="SET",R[R.RESET=2]="RESET",R[R.PERMANENTLY_SET=3]="PERMANENTLY_SET",R[R.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(n||={});let l=this._coreService.decPrivateModes,{activeProtocol:o,activeEncoding:h}=this._coreMouseService,d=this._coreService,{buffers:_,cols:p}=this._bufferService,{active:f,alt:S}=_,y=this._optionsService.rawOptions,x=(R,L)=>(d.triggerDataEvent(`${K.ESC}[${i?"":"?"}${R};${L}$y`),!0),C=R=>R?1:2,b=e.params[0];return i?b===2?x(b,4):b===4?x(b,C(d.modes.insertMode)):b===12?x(b,3):b===20?x(b,C(y.convertEol)):x(b,0):b===1?x(b,C(l.applicationCursorKeys)):b===3?x(b,y.windowOptions.setWinLines?p===80?2:p===132?1:0:0):b===6?x(b,C(l.origin)):b===7?x(b,C(l.wraparound)):b===8?x(b,3):b===9?x(b,C(o==="X10")):b===12?x(b,C(y.cursorBlink)):b===25?x(b,C(!d.isCursorHidden)):b===45?x(b,C(l.reverseWraparound)):b===66?x(b,C(l.applicationKeypad)):b===67?x(b,4):b===1e3?x(b,C(o==="VT200")):b===1002?x(b,C(o==="DRAG")):b===1003?x(b,C(o==="ANY")):b===1004?x(b,C(l.sendFocus)):b===1005?x(b,4):b===1006?x(b,C(h==="SGR")):b===1015?x(b,4):b===1016?x(b,C(h==="SGR_PIXELS")):b===1048?x(b,1):b===47||b===1047||b===1049?x(b,C(f===S)):b===2004?x(b,C(l.bracketedPasteMode)):b===2026?x(b,C(l.synchronizedOutput)):x(b,0)}_updateAttrColor(e,i,n,l,o){return i===2?(e|=50331648,e&=-16777216,e|=ml.fromColorRGB([n,l,o])):i===5&&(e&=-50331904,e|=33554432|n&255),e}_extractColor(e,i,n){let l=[0,0,-1,0,0,0],o=0,h=0;do{if(l[h+o]=e.params[i+h],e.hasSubParams(i+h)){let d=e.getSubParams(i+h),_=0;do l[1]===5&&(o=1),l[h+_+1+o]=d[_];while(++_<d.length&&_+h+1+o<l.length);break}if(l[1]===5&&h+o>=2||l[1]===2&&h+o>=5)break;l[1]&&(o=1)}while(++h+i<e.length&&h+o<l.length);for(let d=2;d<l.length;++d)l[d]===-1&&(l[d]=0);switch(l[0]){case 38:n.fg=this._updateAttrColor(n.fg,l[1],l[3],l[4],l[5]);break;case 48:n.bg=this._updateAttrColor(n.bg,l[1],l[3],l[4],l[5]);break;case 58:n.extended=n.extended.clone(),n.extended.underlineColor=this._updateAttrColor(n.extended.underlineColor,l[1],l[3],l[4],l[5])}return h}_processUnderline(e,i){i.extended=i.extended.clone(),(!~e||e>5)&&(e=1),i.extended.underlineStyle=e,i.fg|=268435456,e===0&&(i.fg&=-268435457),i.updateExtended()}_processSGR0(e){e.fg=nt.fg,e.bg=nt.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let i=e.length,n,l=this._curAttrData;for(let o=0;o<i;o++)n=e.params[o],n>=30&&n<=37?(l.fg&=-50331904,l.fg|=16777216|n-30):n>=40&&n<=47?(l.bg&=-50331904,l.bg|=16777216|n-40):n>=90&&n<=97?(l.fg&=-50331904,l.fg|=16777216|n-90|8):n>=100&&n<=107?(l.bg&=-50331904,l.bg|=16777216|n-100|8):n===0?this._processSGR0(l):n===1?l.fg|=134217728:n===3?l.bg|=67108864:n===4?(l.fg|=268435456,this._processUnderline(e.hasSubParams(o)?e.getSubParams(o)[0]:1,l)):n===5?l.fg|=536870912:n===7?l.fg|=67108864:n===8?l.fg|=1073741824:n===9?l.fg|=2147483648:n===2?l.bg|=134217728:n===21?this._processUnderline(2,l):n===22?(l.fg&=-134217729,l.bg&=-134217729):n===23?l.bg&=-67108865:n===24?(l.fg&=-268435457,this._processUnderline(0,l)):n===25?l.fg&=-536870913:n===27?l.fg&=-67108865:n===28?l.fg&=-1073741825:n===29?l.fg&=2147483647:n===39?(l.fg&=-67108864,l.fg|=nt.fg&16777215):n===49?(l.bg&=-67108864,l.bg|=nt.bg&16777215):n===38||n===48||n===58?o+=this._extractColor(e,o,l):n===53?l.bg|=1073741824:n===55?l.bg&=-1073741825:n===59?(l.extended=l.extended.clone(),l.extended.underlineColor=-1,l.updateExtended()):n===100?(l.fg&=-67108864,l.fg|=nt.fg&16777215,l.bg&=-67108864,l.bg|=nt.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",n);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${K.ESC}[0n`);break;case 6:let i=this._activeBuffer.y+1,n=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${K.ESC}[${i};${n}R`);break}return!0}deviceStatusPrivate(e){if(e.params[0]===6){let i=this._activeBuffer.y+1,n=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${K.ESC}[?${i};${n}R`)}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=nt.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(e){let i=e.length===0?1:e.params[0];if(i===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(i){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar";break}let n=i%2===1;this._coreService.decPrivateModes.cursorBlink=n}return!0}setScrollRegion(e){let i=e.params[0]||1,n;return(e.length<2||(n=e.params[1])>this._bufferService.rows||n===0)&&(n=this._bufferService.rows),n>i&&(this._activeBuffer.scrollTop=i-1,this._activeBuffer.scrollBottom=n-1,this._setCursor(0,0)),!0}windowOptions(e){if(!nm(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let i=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:i!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${K.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(i===0||i===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>rm&&this._windowTitleStack.shift()),(i===0||i===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>rm&&this._iconNameStack.shift());break;case 23:(i===0||i===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(i===0||i===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let i=[],n=e.split(";");for(;n.length>1;){let l=n.shift(),o=n.shift();if(/^\d+$/.exec(l)){let h=parseInt(l);if(om(h))if(o==="?")i.push({type:0,index:h});else{let d=sm(o);d&&i.push({type:1,index:h,color:d})}}}return i.length&&this._onColor.fire(i),!0}setHyperlink(e){let i=e.indexOf(";");if(i===-1)return!0;let n=e.slice(0,i).trim(),l=e.slice(i+1);return l?this._createHyperlink(n,l):n.trim()?!1:this._finishHyperlink()}_createHyperlink(e,i){this._getCurrentLinkId()&&this._finishHyperlink();let n=e.split(":"),l,o=n.findIndex(h=>h.startsWith("id="));return o!==-1&&(l=n[o].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:l,uri:i}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,i){let n=e.split(";");for(let l=0;l<n.length&&!(i>=this._specialColors.length);++l,++i)if(n[l]==="?")this._onColor.fire([{type:0,index:this._specialColors[i]}]);else{let o=sm(n[l]);o&&this._onColor.fire([{type:1,index:this._specialColors[i],color:o}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let i=[],n=e.split(";");for(let l=0;l<n.length;++l)if(/^\d+$/.exec(n[l])){let o=parseInt(n[l]);om(o)&&i.push({type:2,index:o})}return i.length&&this._onColor.fire(i),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,sr),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(Xx[e[0]],ut[e[1]]||sr),!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){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=nt.clone(),this._eraseAttrDataInternal=nt.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new gi;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let i=0;i<this._bufferService.rows;++i){let n=this._activeBuffer.ybase+this._activeBuffer.y+i,l=this._activeBuffer.lines.get(n);l&&(l.fill(e),l.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,i){let n=d=>(this._coreService.triggerDataEvent(`${K.ESC}${d}${K.ESC}\\`),!0),l=this._bufferService.buffer,o=this._optionsService.rawOptions;return n(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${l.scrollTop+1};${l.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[o.cursorStyle]-(o.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,i){this._dirtyRowTracker.markRangeDirty(e,i)}},Lu=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}markRangeDirty(e,i){e>i&&(am=e,e=i,i=am),e<this.start&&(this.start=e),i>this.end&&(this.end=i)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};Lu=Ze([ie(0,Bt)],Lu);function om(e){return 0<=e&&e<256}var Vx=5e7,cm=12,Fx=50,Zx=class extends ve{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new V),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,i){if(i!==void 0&&this._syncCalls>i){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let n;for(;n=this._writeBuffer.shift();){this._action(n);let l=this._callbacks.shift();l&&l()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,i){if(this._pendingData>Vx)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(i),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(i)}_innerWrite(e=0,i=!0){let n=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let l=this._writeBuffer[this._bufferOffset],o=this._action(l,i);if(o){let d=_=>performance.now()-n>=cm?setTimeout(()=>this._innerWrite(0,_)):this._innerWrite(n,_);o.catch(_=>(queueMicrotask(()=>{throw _}),Promise.resolve(!1))).then(d);return}let h=this._callbacks[this._bufferOffset];if(h&&h(),this._bufferOffset++,this._pendingData-=l.length,performance.now()-n>=cm)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>Fx&&(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()}},Nu=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let i=this._bufferService.buffer;if(e.id===void 0){let _=i.addMarker(i.ybase+i.y),p={data:e,id:this._nextId++,lines:[_]};return _.onDispose(()=>this._removeMarkerFromLink(p,_)),this._dataByLinkId.set(p.id,p),p.id}let n=e,l=this._getEntryIdKey(n),o=this._entriesWithId.get(l);if(o)return this.addLineToLink(o.id,i.ybase+i.y),o.id;let h=i.addMarker(i.ybase+i.y),d={id:this._nextId++,key:this._getEntryIdKey(n),data:n,lines:[h]};return h.onDispose(()=>this._removeMarkerFromLink(d,h)),this._entriesWithId.set(d.key,d),this._dataByLinkId.set(d.id,d),d.id}addLineToLink(e,i){let n=this._dataByLinkId.get(e);if(n&&n.lines.every(l=>l.line!==i)){let l=this._bufferService.buffer.addMarker(i);n.lines.push(l),l.onDispose(()=>this._removeMarkerFromLink(n,l))}}getLinkData(e){return this._dataByLinkId.get(e)?.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,i){let n=e.lines.indexOf(i);n!==-1&&(e.lines.splice(n,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};Nu=Ze([ie(0,Bt)],Nu);var hm=!1,Qx=class extends ve{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new Jr),this._onBinary=this._register(new V),this.onBinary=this._onBinary.event,this._onData=this._register(new V),this.onData=this._onData.event,this._onLineFeed=this._register(new V),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new V),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new V),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new V),this._instantiationService=new xx,this.optionsService=this._register(new Ax(e)),this._instantiationService.setService(At,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(Bu)),this._instantiationService.setService(Bt,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(Mu)),this._instantiationService.setService(Pm,this._logService),this.coreService=this._register(this._instantiationService.createInstance(Au)),this._instantiationService.setService(hr,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(zu)),this._instantiationService.setService(Wm,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(nr)),this._instantiationService.setService(vb,this.unicodeService),this._charsetService=this._instantiationService.createInstance(Hx),this._instantiationService.setService(mb,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(Nu),this._instantiationService.setService(Km,this._oscLinkService),this._inputHandler=this._register(new Gx(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(Ct.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(Ct.forward(this._bufferService.onResize,this._onResize)),this._register(Ct.forward(this.coreService.onData,this._onData)),this._register(Ct.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new Zx((i,n)=>this._inputHandler.parse(i,n))),this._register(Ct.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new V),this._onScroll.event(e=>{this._onScrollApi?.fire(e.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(e){for(let i in e)this.optionsService.options[i]=e[i]}write(e,i){this._writeBuffer.write(e,i)}writeSync(e,i){this._logService.logLevel<=3&&!hm&&(this._logService.warn("writeSync is unreliable and will be removed soon."),hm=!0),this._writeBuffer.writeSync(e,i)}input(e,i=!0){this.coreService.triggerDataEvent(e,i)}resize(e,i){isNaN(e)||isNaN(i)||(e=Math.max(e,bv),i=Math.max(i,xv),this._bufferService.resize(e,i))}scroll(e,i=!1){this._bufferService.scroll(e,i)}scrollLines(e,i){this._bufferService.scrollLines(e,i)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let i=e-this._bufferService.buffer.ydisp;i!==0&&this.scrollLines(i)}registerEscHandler(e,i){return this._inputHandler.registerEscHandler(e,i)}registerDcsHandler(e,i){return this._inputHandler.registerDcsHandler(e,i)}registerCsiHandler(e,i){return this._inputHandler.registerCsiHandler(e,i)}registerOscHandler(e,i){return this._inputHandler.registerOscHandler(e,i)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,i=this.optionsService.rawOptions.windowsPty;i&&i.buildNumber!==void 0&&i.buildNumber!==void 0?e=i.backend==="conpty"&&i.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(tm.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(tm(this._bufferService),!1))),this._windowsWrappingHeuristics.value=$e(()=>{for(let i of e)i.dispose()})}}},Jx={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:["'",'"']};function ew(e,i,n,l){let o={type:0,cancel:!1,key:void 0},h=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key==="UIKeyInputUpArrow"?i?o.key=K.ESC+"OA":o.key=K.ESC+"[A":e.key==="UIKeyInputLeftArrow"?i?o.key=K.ESC+"OD":o.key=K.ESC+"[D":e.key==="UIKeyInputRightArrow"?i?o.key=K.ESC+"OC":o.key=K.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(i?o.key=K.ESC+"OB":o.key=K.ESC+"[B");break;case 8:o.key=e.ctrlKey?"\b":K.DEL,e.altKey&&(o.key=K.ESC+o.key);break;case 9:if(e.shiftKey){o.key=K.ESC+"[Z";break}o.key=K.HT,o.cancel=!0;break;case 13:o.key=e.altKey?K.ESC+K.CR:K.CR,o.cancel=!0;break;case 27:o.key=K.ESC,e.altKey&&(o.key=K.ESC+K.ESC),o.cancel=!0;break;case 37:if(e.metaKey)break;h?o.key=K.ESC+"[1;"+(h+1)+"D":i?o.key=K.ESC+"OD":o.key=K.ESC+"[D";break;case 39:if(e.metaKey)break;h?o.key=K.ESC+"[1;"+(h+1)+"C":i?o.key=K.ESC+"OC":o.key=K.ESC+"[C";break;case 38:if(e.metaKey)break;h?o.key=K.ESC+"[1;"+(h+1)+"A":i?o.key=K.ESC+"OA":o.key=K.ESC+"[A";break;case 40:if(e.metaKey)break;h?o.key=K.ESC+"[1;"+(h+1)+"B":i?o.key=K.ESC+"OB":o.key=K.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(o.key=K.ESC+"[2~");break;case 46:h?o.key=K.ESC+"[3;"+(h+1)+"~":o.key=K.ESC+"[3~";break;case 36:h?o.key=K.ESC+"[1;"+(h+1)+"H":i?o.key=K.ESC+"OH":o.key=K.ESC+"[H";break;case 35:h?o.key=K.ESC+"[1;"+(h+1)+"F":i?o.key=K.ESC+"OF":o.key=K.ESC+"[F";break;case 33:e.shiftKey?o.type=2:e.ctrlKey?o.key=K.ESC+"[5;"+(h+1)+"~":o.key=K.ESC+"[5~";break;case 34:e.shiftKey?o.type=3:e.ctrlKey?o.key=K.ESC+"[6;"+(h+1)+"~":o.key=K.ESC+"[6~";break;case 112:h?o.key=K.ESC+"[1;"+(h+1)+"P":o.key=K.ESC+"OP";break;case 113:h?o.key=K.ESC+"[1;"+(h+1)+"Q":o.key=K.ESC+"OQ";break;case 114:h?o.key=K.ESC+"[1;"+(h+1)+"R":o.key=K.ESC+"OR";break;case 115:h?o.key=K.ESC+"[1;"+(h+1)+"S":o.key=K.ESC+"OS";break;case 116:h?o.key=K.ESC+"[15;"+(h+1)+"~":o.key=K.ESC+"[15~";break;case 117:h?o.key=K.ESC+"[17;"+(h+1)+"~":o.key=K.ESC+"[17~";break;case 118:h?o.key=K.ESC+"[18;"+(h+1)+"~":o.key=K.ESC+"[18~";break;case 119:h?o.key=K.ESC+"[19;"+(h+1)+"~":o.key=K.ESC+"[19~";break;case 120:h?o.key=K.ESC+"[20;"+(h+1)+"~":o.key=K.ESC+"[20~";break;case 121:h?o.key=K.ESC+"[21;"+(h+1)+"~":o.key=K.ESC+"[21~";break;case 122:h?o.key=K.ESC+"[23;"+(h+1)+"~":o.key=K.ESC+"[23~";break;case 123:h?o.key=K.ESC+"[24;"+(h+1)+"~":o.key=K.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?o.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?o.key=K.NUL:e.keyCode>=51&&e.keyCode<=55?o.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?o.key=K.DEL:e.keyCode===219?o.key=K.ESC:e.keyCode===220?o.key=K.FS:e.keyCode===221&&(o.key=K.GS);else if((!n||l)&&e.altKey&&!e.metaKey){let d=Jx[e.keyCode]?.[e.shiftKey?1:0];if(d)o.key=K.ESC+d;else if(e.keyCode>=65&&e.keyCode<=90){let _=e.ctrlKey?e.keyCode-64:e.keyCode+32,p=String.fromCharCode(_);e.shiftKey&&(p=p.toUpperCase()),o.key=K.ESC+p}else if(e.keyCode===32)o.key=K.ESC+(e.ctrlKey?K.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let _=e.code.slice(3,4);e.shiftKey||(_=_.toLowerCase()),o.key=K.ESC+_,o.cancel=!0}}else n&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(o.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?o.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(o.key=K.US),e.key==="@"&&(o.key=K.NUL));break}return o}var et=0,tw=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new so,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new so,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((o,h)=>this._getKey(o)-this._getKey(h)),i=0,n=0,l=new Array(this._array.length+this._insertedValues.length);for(let o=0;o<l.length;o++)n>=this._array.length||this._getKey(e[i])<=this._getKey(this._array[n])?(l[o]=e[i],i++):l[o]=this._array[n++];this._array=l,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let i=this._getKey(e);if(i===void 0||(et=this._search(i),et===-1)||this._getKey(this._array[et])!==i)return!1;do if(this._array[et]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(et),!0;while(++et<this._array.length&&this._getKey(this._array[et])===i);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((o,h)=>o-h),i=0,n=new Array(this._array.length-e.length),l=0;for(let o=0;o<this._array.length;o++)e[i]===o?i++:n[l++]=this._array[o];this._array=n,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(et=this._search(e),!(et<0||et>=this._array.length)&&this._getKey(this._array[et])===e))do yield this._array[et];while(++et<this._array.length&&this._getKey(this._array[et])===e)}forEachByKey(e,i){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(et=this._search(e),!(et<0||et>=this._array.length)&&this._getKey(this._array[et])===e))do i(this._array[et]);while(++et<this._array.length&&this._getKey(this._array[et])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let i=0,n=this._array.length-1;for(;n>=i;){let l=i+n>>1,o=this._getKey(this._array[l]);if(o>e)n=l-1;else if(o<e)i=l+1;else{for(;l>0&&this._getKey(this._array[l-1])===e;)l--;return l}}return i}},eu=0,um=0,iw=class extends ve{constructor(){super(),this._decorations=new tw(e=>e?.marker.line),this._onDecorationRegistered=this._register(new V),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new V),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register($e(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let i=new sw(e);if(i){let n=i.marker.onDispose(()=>i.dispose()),l=i.onDispose(()=>{l.dispose(),i&&(this._decorations.delete(i)&&this._onDecorationRemoved.fire(i),n.dispose())});this._decorations.insert(i),this._onDecorationRegistered.fire(i)}return i}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,i,n){let l=0,o=0;for(let h of this._decorations.getKeyIterator(i))l=h.options.x??0,o=l+(h.options.width??1),e>=l&&e<o&&(!n||(h.options.layer??"bottom")===n)&&(yield h)}forEachDecorationAtCell(e,i,n,l){this._decorations.forEachByKey(i,o=>{eu=o.options.x??0,um=eu+(o.options.width??1),e>=eu&&e<um&&(!n||(o.options.layer??"bottom")===n)&&l(o)})}},sw=class extends Ns{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new V),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new V),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=Xe.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=Xe.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},rw=1e3,nw=class{constructor(e,i=rw){this._renderCallback=e,this._debounceThresholdMS=i,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,i,n){this._rowCount=n,e=e!==void 0?e:0,i=i!==void 0?i:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,i):i;let l=performance.now();if(l-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=l,this._innerRefresh();else if(!this._additionalRefreshRequested){let o=l-this._lastRefreshMs,h=this._debounceThresholdMS-o;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},h)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),i=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,i)}},dm=20,ro=class extends ve{constructor(e,i,n,l){super(),this._terminal=e,this._coreBrowserService=n,this._renderService=l,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let o=this._coreBrowserService.mainDocument;this._accessibilityContainer=o.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=o.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let h=0;h<this._terminal.rows;h++)this._rowElements[h]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[h]);if(this._topBoundaryFocusListener=h=>this._handleBoundaryFocus(h,0),this._bottomBoundaryFocusListener=h=>this._handleBoundaryFocus(h,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=o.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new nw(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(h=>this._handleResize(h.rows))),this._register(this._terminal.onRender(h=>this._refreshRows(h.start,h.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(h=>this._handleChar(h))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
68
|
+
`))),this._register(this._terminal.onA11yTab(h=>this._handleTab(h))),this._register(this._terminal.onKey(h=>this._handleKey(h.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(ue(o,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register($e(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let i=0;i<e;i++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<dm+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
69
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===dm+1&&(this._liveRegion.textContent+=iu.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,i){this._liveRegionDebouncer.refresh(e,i,this._terminal.rows)}_renderRows(e,i){let n=this._terminal.buffer,l=n.lines.length.toString();for(let o=e;o<=i;o++){let h=n.lines.get(n.ydisp+o),d=[],_=h?.translateToString(!0,void 0,void 0,d)||"",p=(n.ydisp+o+1).toString(),f=this._rowElements[o];f&&(_.length===0?(f.textContent=" ",this._rowColumns.set(f,[0,1])):(f.textContent=_,this._rowColumns.set(f,d)),f.setAttribute("aria-posinset",p),f.setAttribute("aria-setsize",l),this._alignRowWidth(f))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,i){let n=e.target,l=this._rowElements[i===0?1:this._rowElements.length-2],o=n.getAttribute("aria-posinset"),h=i===0?"1":`${this._terminal.buffer.lines.length}`;if(o===h||e.relatedTarget!==l)return;let d,_;if(i===0?(d=n,_=this._rowElements.pop(),this._rowContainer.removeChild(_)):(d=this._rowElements.shift(),_=n,this._rowContainer.removeChild(d)),d.removeEventListener("focus",this._topBoundaryFocusListener),_.removeEventListener("focus",this._bottomBoundaryFocusListener),i===0){let p=this._createAccessibilityTreeNode();this._rowElements.unshift(p),this._rowContainer.insertAdjacentElement("afterbegin",p)}else{let p=this._createAccessibilityTreeNode();this._rowElements.push(p),this._rowContainer.appendChild(p)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(i===0?-1:1),this._rowElements[i===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error("anchorNode and/or focusNode are null");return}let i={node:e.anchorNode,offset:e.anchorOffset},n={node:e.focusNode,offset:e.focusOffset};if((i.node.compareDocumentPosition(n.node)&Node.DOCUMENT_POSITION_PRECEDING||i.node===n.node&&i.offset>n.offset)&&([i,n]=[n,i]),i.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(i={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(i.node))return;let l=this._rowElements.slice(-1)[0];if(n.node.compareDocumentPosition(l)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(n={node:l,offset:l.textContent?.length??0}),!this._rowContainer.contains(n.node))return;let o=({node:_,offset:p})=>{let f=_ instanceof Text?_.parentNode:_,S=parseInt(f?.getAttribute("aria-posinset"),10)-1;if(isNaN(S))return console.warn("row is invalid. Race condition?"),null;let y=this._rowColumns.get(f);if(!y)return console.warn("columns is null. Race condition?"),null;let x=p<y.length?y[p]:y.slice(-1)[0]+1;return x>=this._terminal.cols&&(++S,x=0),{row:S,column:x}},h=o(i),d=o(n);if(!(!h||!d)){if(h.row>d.row||h.row===d.row&&h.column>=d.column)throw new Error("invalid range");this._terminal.select(h.column,h.row,(d.row-h.row)*this._terminal.cols-h.column+d.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let i=this._rowContainer.children.length;i<this._terminal.rows;i++)this._rowElements[i]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[i]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){e.style.transform="";let i=e.getBoundingClientRect().width,n=this._rowColumns.get(e)?.slice(-1)?.[0];if(!n)return;let l=n*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${l/i})`}};ro=Ze([ie(1,Pu),ie(2,rs),ie(3,ns)],ro);var Hu=class extends ve{constructor(e,i,n,l,o){super(),this._element=e,this._mouseService=i,this._renderService=n,this._bufferService=l,this._linkProviderService=o,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new V),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new V),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register($e(()=>{ar(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(ue(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(ue(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(ue(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(ue(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let i=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!i)return;this._isMouseOut=!1;let n=e.composedPath();for(let l=0;l<n.length;l++){let o=n[l];if(o.classList.contains("xterm"))break;if(o.classList.contains("xterm-hover"))return}(!this._lastBufferCell||i.x!==this._lastBufferCell.x||i.y!==this._lastBufferCell.y)&&(this._handleHover(i),this._lastBufferCell=i)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,i){(!this._activeProviderReplies||!i)&&(this._activeProviderReplies?.forEach(l=>{l?.forEach(o=>{o.link.dispose&&o.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let n=!1;for(let[l,o]of this._linkProviderService.linkProviders.entries())i?this._activeProviderReplies?.get(l)&&(n=this._checkLinkProviderResult(l,e,n)):o.provideLinks(e.y,h=>{if(this._isMouseOut)return;let d=h?.map(_=>({link:_}));this._activeProviderReplies?.set(l,d),n=this._checkLinkProviderResult(l,e,n),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,i){let n=new Set;for(let l=0;l<i.size;l++){let o=i.get(l);if(o)for(let h=0;h<o.length;h++){let d=o[h],_=d.link.range.start.y<e?0:d.link.range.start.x,p=d.link.range.end.y>e?this._bufferService.cols:d.link.range.end.x;for(let f=_;f<=p;f++){if(n.has(f)){o.splice(h--,1);break}n.add(f)}}}}_checkLinkProviderResult(e,i,n){if(!this._activeProviderReplies)return n;let l=this._activeProviderReplies.get(e),o=!1;for(let h=0;h<e;h++)(!this._activeProviderReplies.has(h)||this._activeProviderReplies.get(h))&&(o=!0);if(!o&&l){let h=l.find(d=>this._linkAtPosition(d.link,i));h&&(n=!0,this._handleNewLink(h))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!n)for(let h=0;h<this._activeProviderReplies.size;h++){let d=this._activeProviderReplies.get(h)?.find(_=>this._linkAtPosition(_.link,i));if(d){n=!0,this._handleNewLink(d);break}}return n}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let i=this._positionFromMouseEvent(e,this._element,this._mouseService);i&&this._mouseDownLink&&lw(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,i)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,i){!this._currentLink||!this._lastMouseEvent||(!e||!i||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=i)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,ar(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let i=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);i&&this._linkAtPosition(e.link,i)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:n=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==n&&(this._currentLink.state.decorations.pointerCursor=n,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",n))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:n=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==n&&(this._currentLink.state.decorations.underline=n,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,n))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(n=>{if(!this._currentLink)return;let l=n.start===0?0:n.start+1+this._bufferService.buffer.ydisp,o=this._bufferService.buffer.ydisp+1+n.end;if(this._currentLink.link.range.start.y>=l&&this._currentLink.link.range.end.y<=o&&(this._clearCurrentLink(l,o),this._lastMouseEvent)){let h=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);h&&this._askForLink(h,!1)}})))}_linkHover(e,i,n){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(i,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),i.hover&&i.hover(n,i.text)}_fireUnderlineEvent(e,i){let n=e.range,l=this._bufferService.buffer.ydisp,o=this._createLinkUnderlineEvent(n.start.x-1,n.start.y-l-1,n.end.x,n.end.y-l-1,void 0);(i?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(o)}_linkLeave(e,i,n){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(i,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),i.leave&&i.leave(n,i.text)}_linkAtPosition(e,i){let n=e.range.start.y*this._bufferService.cols+e.range.start.x,l=e.range.end.y*this._bufferService.cols+e.range.end.x,o=i.y*this._bufferService.cols+i.x;return n<=o&&o<=l}_positionFromMouseEvent(e,i,n){let l=n.getCoords(e,i,this._bufferService.cols,this._bufferService.rows);if(l)return{x:l[0],y:l[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,i,n,l,o){return{x1:e,y1:i,x2:n,y2:l,cols:this._bufferService.cols,fg:o}}};Hu=Ze([ie(1,Ku),ie(2,ns),ie(3,Bt),ie(4,$m)],Hu);function lw(e,i){return e.text===i.text&&e.range.start.x===i.range.start.x&&e.range.start.y===i.range.start.y&&e.range.end.x===i.range.end.x&&e.range.end.y===i.range.end.y}var aw=class extends Qx{constructor(e={}){super(e),this._linkifier=this._register(new Jr),this.browser=hv,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new Jr),this._onCursorMove=this._register(new V),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new V),this.onKey=this._onKey.event,this._onRender=this._register(new V),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new V),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new V),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new V),this.onBell=this._onBell.event,this._onFocus=this._register(new V),this._onBlur=this._register(new V),this._onA11yCharEmitter=this._register(new V),this._onA11yTabEmitter=this._register(new V),this._onWillOpen=this._register(new V),this._setup(),this._decorationService=this._instantiationService.createInstance(iw),this._instantiationService.setService(vl,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(F1),this._instantiationService.setService($m,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(ru)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(i=>this.refresh(i?.start??0,i?.end??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(i=>this._reportWindowsOptions(i))),this._register(this._inputHandler.onColor(i=>this._handleColorEvent(i))),this._register(Ct.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(Ct.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(Ct.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(Ct.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(i=>this._afterResize(i.cols,i.rows))),this._register($e(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}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}_handleColorEvent(e){if(this._themeService)for(let i of e){let n,l="";switch(i.index){case 256:n="foreground",l="10";break;case 257:n="background",l="11";break;case 258:n="cursor",l="12";break;default:n="ansi",l="4;"+i.index}switch(i.type){case 0:let o=Ke.toColorRGB(n==="ansi"?this._themeService.colors.ansi[i.index]:this._themeService.colors[n]);this.coreService.triggerDataEvent(`${K.ESC}]${l};${Ix(o)}${ov.ST}`);break;case 1:if(n==="ansi")this._themeService.modifyColors(h=>h.ansi[i.index]=lt.toColor(...i.color));else{let h=n;this._themeService.modifyColors(d=>d[h]=lt.toColor(...i.color))}break;case 2:this._themeService.restoreColor(i.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(ro,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(K.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(K.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,i=this.buffer.lines.get(e);if(!i)return;let n=Math.min(this.buffer.x,this.cols-1),l=this._renderService.dimensions.css.cell.height,o=i.getWidth(n),h=this._renderService.dimensions.css.cell.width*o,d=this.buffer.y*this._renderService.dimensions.css.cell.height,_=n*this._renderService.dimensions.css.cell.width;this.textarea.style.left=_+"px",this.textarea.style.top=d+"px",this.textarea.style.width=h+"px",this.textarea.style.height=l+"px",this.textarea.style.lineHeight=l+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(ue(this.element,"copy",i=>{this.hasSelection()&&ub(i,this._selectionService)}));let e=i=>db(i,this.textarea,this.coreService,this.optionsService);this._register(ue(this.textarea,"paste",e)),this._register(ue(this.element,"paste",e)),uv?this._register(ue(this.element,"mousedown",i=>{i.button===2&&xg(i,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(ue(this.element,"contextmenu",i=>{xg(i,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),Zu&&this._register(ue(this.element,"auxclick",i=>{i.button===1&&Nm(i,this.textarea,this.screenElement)}))}_bindKeys(){this._register(ue(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(ue(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(ue(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(ue(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(ue(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(ue(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(ue(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){if(!e)throw new Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.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"),e.appendChild(this.element);let i=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),i.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(ue(this.screenElement,"mousemove",o=>this.updateCursorStyle(o))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),i.appendChild(this.screenElement);let n=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",tu.get()),_v||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._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>n.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(G1,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(rs,this._coreBrowserService),this._register(ue(this.textarea,"focus",o=>this._handleTextAreaFocus(o))),this._register(ue(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(ku,this._document,this._helperContainer),this._instantiationService.setService(ho,this._charSizeService),this._themeService=this._instantiationService.createInstance(Du),this._instantiationService.setService(tn,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(to),this._instantiationService.setService(Ym,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(Tu,this.rows,this.screenElement)),this._instantiationService.setService(ns,this._renderService),this._register(this._renderService.onRenderedViewportChange(o=>this._onRender.fire(o))),this.onResize(o=>this._renderService.resize(o.cols,o.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(xu,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(Eu),this._instantiationService.setService(Ku,this._mouseService);let l=this._linkifier.value=this._register(this._instantiationService.createInstance(Hu,this.screenElement));this.element.appendChild(i);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),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._viewport=this._register(this._instantiationService.createInstance(yu,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(o=>{super.scrollLines(o,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(Ru,this.element,this.screenElement,l)),this._instantiationService.setService(yb,this._selectionService),this._register(this._selectionService.onRequestScrollLines(o=>this.scrollLines(o.amount,o.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(o=>this._renderService.handleSelectionChanged(o.start,o.end,o.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(o=>{this.textarea.value=o,this.textarea.focus(),this.textarea.select()})),this._register(Ct.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(bu,this.screenElement)),this._register(ue(this.element,"mousedown",o=>this._selectionService.handleMouseDown(o))),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(ro,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",o=>this._handleScreenReaderModeOptionChange(o))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(eo,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",o=>{!this._overviewRulerRenderer&&o&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(eo,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(Cu,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,i=this.element;function n(h){let d=e._mouseService.getMouseReportCoords(h,e.screenElement);if(!d)return!1;let _,p;switch(h.overrideType||h.type){case"mousemove":p=32,h.buttons===void 0?(_=3,h.button!==void 0&&(_=h.button<3?h.button:3)):_=h.buttons&1?0:h.buttons&4?1:h.buttons&2?2:3;break;case"mouseup":p=0,_=h.button<3?h.button:3;break;case"mousedown":p=1,_=h.button<3?h.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(h)===!1)return!1;let f=h.deltaY;if(f===0||e.coreMouseService.consumeWheelEvent(h,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return!1;p=f<0?0:1,_=4;break;default:return!1}return p===void 0||_===void 0||_>4?!1:e.coreMouseService.triggerMouseEvent({col:d.col,row:d.row,x:d.x,y:d.y,button:_,action:p,ctrl:h.ctrlKey,alt:h.altKey,shift:h.shiftKey})}let l={mouseup:null,wheel:null,mousedrag:null,mousemove:null},o={mouseup:h=>(n(h),h.buttons||(this._document.removeEventListener("mouseup",l.mouseup),l.mousedrag&&this._document.removeEventListener("mousemove",l.mousedrag)),this.cancel(h)),wheel:h=>(n(h),this.cancel(h,!0)),mousedrag:h=>{h.buttons&&n(h)},mousemove:h=>{h.buttons||n(h)}};this._register(this.coreMouseService.onProtocolChange(h=>{h?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(h)),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()),h&8?l.mousemove||(i.addEventListener("mousemove",o.mousemove),l.mousemove=o.mousemove):(i.removeEventListener("mousemove",l.mousemove),l.mousemove=null),h&16?l.wheel||(i.addEventListener("wheel",o.wheel,{passive:!1}),l.wheel=o.wheel):(i.removeEventListener("wheel",l.wheel),l.wheel=null),h&2?l.mouseup||(l.mouseup=o.mouseup):(this._document.removeEventListener("mouseup",l.mouseup),l.mouseup=null),h&4?l.mousedrag||(l.mousedrag=o.mousedrag):(this._document.removeEventListener("mousemove",l.mousedrag),l.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(ue(i,"mousedown",h=>{if(h.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(h)))return n(h),l.mouseup&&this._document.addEventListener("mouseup",l.mouseup),l.mousedrag&&this._document.addEventListener("mousemove",l.mousedrag),this.cancel(h)})),this._register(ue(i,"wheel",h=>{if(!l.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(h)===!1)return!1;if(!this.buffer.hasScrollback){if(h.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(h,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return this.cancel(h,!0);let d=K.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(h.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(d,!0),this.cancel(h,!0)}}},{passive:!1}))}refresh(e,i){this._renderService?.refreshRows(e,i)}updateCursorStyle(e){this._selectionService?.shouldColumnSelect(e)?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(e,i){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,i),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let i=e-this._bufferService.buffer.ydisp;i!==0&&this.scrollLines(i)}paste(e){Lm(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let i=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),i}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,i,n){this._selectionService.setSelection(e,i,n)}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(e,i){this._selectionService?.selectLines(e,i)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let i=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!i&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!i&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let n=ew(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),n.type===3||n.type===2){let l=this.rows-1;return this.scrollLines(n.type===2?-l:l),this.cancel(e,!0)}if(n.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(n.cancel&&this.cancel(e,!0),!n.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((n.key===K.ETX||n.key===K.CR)&&(this.textarea.value=""),this._onKey.fire({key:n.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(n.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,i){let n=e.isMac&&!this.options.macOptionIsMeta&&i.altKey&&!i.ctrlKey&&!i.metaKey||e.isWindows&&i.altKey&&i.ctrlKey&&!i.metaKey||e.isWindows&&i.getModifierState("AltGraph");return i.type==="keypress"?n:n&&(!i.keyCode||i.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(ow(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let i;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)i=e.charCode;else if(e.which===null||e.which===void 0)i=e.keyCode;else if(e.which!==0&&e.charCode!==0)i=e.which;else return!1;return!i||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(i=String.fromCharCode(i),this._onKey.fire({key:i,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(i,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType==="insertText"&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let i=e.data;return this.coreService.triggerDataEvent(i,!0),this.cancel(e),!0}return!1}resize(e,i){if(e===this.cols&&i===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,i)}_afterResize(e,i){this._charSizeService?.measure()}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 e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(nt));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(K.ESC+"[I"):this.coreService.triggerDataEvent(K.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let i=this._renderService.dimensions.css.canvas.width.toFixed(0),n=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${K.ESC}[4;${n};${i}t`);break;case 1:let l=this._renderService.dimensions.css.cell.width.toFixed(0),o=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${K.ESC}[6;${o};${l}t`);break}}cancel(e,i){if(!(!this.options.cancelEvents&&!i))return e.preventDefault(),e.stopPropagation(),!1}};function ow(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var cw=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,i){let n={instance:i,dispose:i.dispose,isDisposed:!1};this._addons.push(n),i.dispose=()=>this._wrappedAddonDispose(n),i.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let i=-1;for(let n=0;n<this._addons.length;n++)if(this._addons[n]===e){i=n;break}if(i===-1)throw new Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(i,1)}},hw=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,i){if(!(e<0||e>=this._line.length))return i?(this._line.loadCell(e,i),i):this._line.loadCell(e,new gi)}translateToString(e,i,n){return this._line.translateToString(e,i,n)}},fm=class{constructor(e,i){this._buffer=e,this.type=i}init(e){return this._buffer=e,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(e){let i=this._buffer.lines.get(e);if(i)return new hw(i)}getNullCell(){return new gi}},uw=class extends ve{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new V),this.onBufferChange=this._onBufferChange.event,this._normal=new fm(this._core.buffers.normal,"normal"),this._alternate=new fm(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)}},dw=class{constructor(e){this._core=e}registerCsiHandler(e,i){return this._core.registerCsiHandler(e,n=>i(n.toArray()))}addCsiHandler(e,i){return this.registerCsiHandler(e,i)}registerDcsHandler(e,i){return this._core.registerDcsHandler(e,(n,l)=>i(n,l.toArray()))}addDcsHandler(e,i){return this.registerDcsHandler(e,i)}registerEscHandler(e,i){return this._core.registerEscHandler(e,i)}addEscHandler(e,i){return this.registerEscHandler(e,i)}registerOscHandler(e,i){return this._core.registerOscHandler(e,i)}addOscHandler(e,i){return this.registerOscHandler(e,i)}},fw=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},_w=["cols","rows"],Mi=0,pw=class extends ve{constructor(e){super(),this._core=this._register(new aw(e)),this._addonManager=this._register(new cw),this._publicOptions={...this._core.options};let i=l=>this._core.options[l],n=(l,o)=>{this._checkReadonlyOptions(l),this._core.options[l]=o};for(let l in this._core.options){let o={get:i.bind(this,l),set:n.bind(this,l)};Object.defineProperty(this._publicOptions,l,o)}}_checkReadonlyOptions(e){if(_w.includes(e))throw new Error(`Option "${e}" 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 dw(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new fw(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 uw(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,i="none";switch(this._core.coreMouseService.activeProtocol){case"X10":i="x10";break;case"VT200":i="vt200";break;case"DRAG":i="drag";break;case"ANY":i="any";break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:i,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let i in e)this._publicOptions[i]=e[i]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,i=!0){this._core.input(e,i)}resize(e,i){this._verifyIntegers(e,i),this._core.resize(e,i)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,i,n){this._verifyIntegers(e,i,n),this._core.select(e,i,n)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,i){this._verifyIntegers(e,i),this._core.selectLines(e,i)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,i){this._core.write(e,i)}writeln(e,i){this._core.write(e),this._core.write(`\r
|
|
70
|
+
`,i)}paste(e){this._core.paste(e)}refresh(e,i){this._verifyIntegers(e,i),this._core.refresh(e,i)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return tu.get()},set promptLabel(e){tu.set(e)},get tooMuchOutput(){return iu.get()},set tooMuchOutput(e){iu.set(e)}}}_verifyIntegers(...e){for(Mi of e)if(Mi===1/0||isNaN(Mi)||Mi%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(Mi of e)if(Mi&&(Mi===1/0||isNaN(Mi)||Mi%1!==0||Mi<0))throw new Error("This API only accepts positive integers")}};var gw=2,mw=1,vw=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let i=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(i._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let i=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),l=parseInt(n.getPropertyValue("height")),o=Math.max(0,parseInt(n.getPropertyValue("width"))),h=window.getComputedStyle(this._terminal.element),d={top:parseInt(h.getPropertyValue("padding-top")),bottom:parseInt(h.getPropertyValue("padding-bottom")),right:parseInt(h.getPropertyValue("padding-right")),left:parseInt(h.getPropertyValue("padding-left"))},_=d.top+d.bottom,p=d.right+d.left,f=l-_,S=o-p-i;return{cols:Math.max(gw,Math.floor(S/e.css.cell.width)),rows:Math.max(mw,Math.floor(f/e.css.cell.height))}}};var Sw=class{constructor(i,n,l,o={}){this._terminal=i,this._regex=n,this._handler=l,this._options=o}provideLinks(i,n){let l=bw.computeLink(i,this._regex,this._terminal,this._handler);n(this._addCallbacks(l))}_addCallbacks(i){return i.map(n=>(n.leave=this._options.leave,n.hover=(l,o)=>{if(this._options.hover){let{range:h}=n;this._options.hover(l,o,h)}},n))}};function yw(e){try{let i=new URL(e),n=i.password&&i.username?`${i.protocol}//${i.username}:${i.password}@${i.host}`:i.username?`${i.protocol}//${i.username}@${i.host}`:`${i.protocol}//${i.host}`;return e.toLocaleLowerCase().startsWith(n.toLocaleLowerCase())}catch{return!1}}var bw=class Qa{static computeLink(i,n,l,o){let h=new RegExp(n.source,(n.flags||"")+"g"),[d,_]=Qa._getWindowedLineStrings(i-1,l),p=d.join(""),f,S=[];for(;f=h.exec(p);){let y=f[0];if(!yw(y))continue;let[x,C]=Qa._mapStrIdx(l,_,0,f.index),[b,R]=Qa._mapStrIdx(l,x,C,y.length);if(x===-1||C===-1||b===-1||R===-1)continue;let L={start:{x:C+1,y:x+1},end:{x:R,y:b+1}};S.push({range:L,text:y,activate:o})}return S}static _getWindowedLineStrings(i,n){let l,o=i,h=i,d=0,_="",p=[];if(l=n.buffer.active.getLine(i)){let f=l.translateToString(!0);if(l.isWrapped&&f[0]!==" "){for(d=0;(l=n.buffer.active.getLine(--o))&&d<2048&&(_=l.translateToString(!0),d+=_.length,p.push(_),!(!l.isWrapped||_.indexOf(" ")!==-1)););p.reverse()}for(p.push(f),d=0;(l=n.buffer.active.getLine(++h))&&l.isWrapped&&d<2048&&(_=l.translateToString(!0),d+=_.length,p.push(_),_.indexOf(" ")===-1););}return[p,o]}static _mapStrIdx(i,n,l,o){let h=i.buffer.active,d=h.getNullCell(),_=l;for(;o;){let p=h.getLine(n);if(!p)return[-1,-1];for(let f=_;f<p.length;++f){p.getCell(f,d);let S=d.getChars();if(d.getWidth()&&(o-=S.length||1,f===p.length-1&&S==="")){let y=h.getLine(n+1);y&&y.isWrapped&&(y.getCell(0,d),d.getWidth()===2&&(o+=1))}if(o<0)return[n,f]}n++,_=0}return[n,_]}},xw=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function ww(e,i){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=i}else console.warn("Opening link blocked as opener could not be cleared")}var Cw=class{constructor(i=ww,n={}){this._handler=i,this._options=n}activate(i){this._terminal=i;let n=this._options,l=n.urlRegex||xw;this._linkProvider=this._terminal.registerLinkProvider(new Sw(this._terminal,l,this._handler,n))}dispose(){this._linkProvider?.dispose()}};function kw(){const e=O.useRef(null),{connect:i,wsRef:n,onOutput:l,onExit:o,setConnectionCallbacks:h,addOutputLine:d}=en(),{path:_,setTerminalConnected:p}=Mt();return O.useEffect(()=>{if(!e.current||!_)return;const f=new pw({theme:{background:"#1a1a2e",foreground:"#e0e0e0",cursor:"#4ade80",selectionBackground:"rgba(74, 222, 128, 0.3)"},fontFamily:"'Inconsolata', 'Menlo', 'Courier New', monospace",fontSize:14,cursorBlink:!0}),S=new vw;f.loadAddon(S),f.loadAddon(new Cw),f.open(e.current),S.fit(),l.current=C=>{f.write(C),C.replace(/\x1b\[[?>=!]?[0-9;]*[a-zA-Z]/g,"").replace(/\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)/g,"").replace(/\x1b[()][0-9A-Z]/g,"").replace(/\x1b./g,"").replace(/\r/g,"").split(`
|
|
71
|
+
`).map(L=>L.trim()).filter(L=>L.length>0).filter(L=>!L.match(/^\(thinking\)$/)).forEach(L=>d(L))},o.current=()=>f.writeln(`\r
|
|
72
|
+
[Process exited. Refresh to restart]`),h(()=>p(!0),()=>{p(!1),f.writeln(`\r
|
|
73
|
+
[Connection lost]`)});const y=i(_);f.onData(C=>{y?.readyState===WebSocket.OPEN&&y.send(JSON.stringify({type:"input",data:C}))});const x=new ResizeObserver(()=>{S.fit(),y?.readyState===WebSocket.OPEN&&y.send(JSON.stringify({type:"resize",cols:f.cols,rows:f.rows}))});return x.observe(e.current),()=>{x.disconnect(),f.dispose(),y?.close()}},[_]),m.jsx("div",{ref:e,className:"h-full w-full"})}function Ew(){const[e,i]=O.useState(!1),[n,l]=O.useState(!1),{sendPrompt:o}=en(),h=()=>{o("Run the dev server for this project so I can preview it in the browser. Use npm run dev or the appropriate command."),l(!0),setTimeout(()=>{i(!0),l(!1)},4e3)},d=()=>{i(!1),setTimeout(()=>i(!0),100)};return e?m.jsxs("div",{className:"h-full flex flex-col",style:{background:"#f8fafc"},children:[m.jsxs("div",{style:{padding:"8px 16px",borderBottom:"1px solid #e5e7eb",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0,background:"#fff"},children:[m.jsx("span",{style:{fontSize:"12px",color:"#9ca3af",fontFamily:"'SF Mono', monospace"},children:"localhost:5173"}),m.jsx("button",{onClick:d,style:{padding:"4px 10px",borderRadius:"6px",border:"1px solid #e5e7eb",background:"#fff",color:"#6b7280",fontSize:"12px",cursor:"pointer"},children:"↻ Refresh"})]}),m.jsx("iframe",{src:"http://localhost:5173",style:{flex:1,border:"none",width:"100%"},sandbox:"allow-scripts allow-same-origin allow-forms allow-popups",title:"Live Preview"})]}):m.jsx("div",{className:"h-full flex items-center justify-center",style:{background:"#f8fafc"},children:m.jsxs("div",{className:"text-center",children:[m.jsx("div",{className:"text-3xl mb-3",children:"🌐"}),m.jsx("div",{style:{color:"#374151",fontSize:"15px",fontWeight:600,marginBottom:"4px"},children:"Live Preview"}),m.jsx("div",{style:{color:"#9ca3af",fontSize:"12px",marginBottom:"20px"},children:"localhost:5173"}),m.jsx("button",{onClick:h,disabled:n,style:{padding:"10px 24px",borderRadius:"10px",border:"none",background:n?"#e5e7eb":"#22c55e",color:n?"#9ca3af":"#fff",fontSize:"14px",fontWeight:600,cursor:n?"not-allowed":"pointer",transition:"all 0.15s"},children:n?"⏳ Starting...":"▶ View Tool"}),m.jsx("div",{style:{color:"#9ca3af",fontSize:"11px",marginTop:"10px"},children:"Starts the dev server and shows your app here"})]})})}function Qu(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ur=Qu();function Cv(e){ur=e}var rr={exec:()=>null};function Ee(e,i=""){let n=typeof e=="string"?e:e.source,l={replace:(o,h)=>{let d=typeof h=="string"?h:h.source;return d=d.replace(Dt.caret,"$1"),n=n.replace(o,d),l},getRegex:()=>new RegExp(n,i)};return l}var Tw=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Dt={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,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ 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,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"),blockquoteBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}>`)},Rw=/^(?:[ \t]*(?:\n|$))+/,Dw=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Mw=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,bl=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Bw=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ju=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,kv=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ev=Ee(kv).replace(/bull/g,Ju).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(),Aw=Ee(kv).replace(/bull/g,Ju).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(),ed=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,zw=/^[^\n]+/,td=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Ow=Ee(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",td).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Lw=Ee(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ju).getRegex(),_o="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",id=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Nw=Ee("^ {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",id).replace("tag",_o).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Tv=Ee(ed).replace("hr",bl).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[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_o).getRegex(),Hw=Ee(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Tv).getRegex(),sd={blockquote:Hw,code:Dw,def:Ow,fences:Mw,heading:Bw,hr:bl,html:Nw,lheading:Ev,list:Lw,newline:Rw,paragraph:Tv,table:rr,text:zw},_m=Ee("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",bl).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[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_o).getRegex(),jw={...sd,lheading:Aw,table:_m,paragraph:Ee(ed).replace("hr",bl).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",_m).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_o).getRegex()},Uw={...sd,html:Ee(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",id).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:rr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ee(ed).replace("hr",bl).replace("heading",` *#{1,6} *[^
|
|
74
|
+
]`).replace("lheading",Ev).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},qw=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ww=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Rv=/^( {2,}|\\)\n(?!\s*$)/,Pw=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,po=/[\p{P}\p{S}]/u,rd=/[\s\p{P}\p{S}]/u,Dv=/[^\s\p{P}\p{S}]/u,Kw=Ee(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,rd).getRegex(),Mv=/(?!~)[\p{P}\p{S}]/u,Yw=/(?!~)[\s\p{P}\p{S}]/u,$w=/(?:[^\s\p{P}\p{S}]|~)/u,Bv=/(?![*_])[\p{P}\p{S}]/u,Iw=/(?![*_])[\s\p{P}\p{S}]/u,Xw=/(?:[^\s\p{P}\p{S}]|[*_])/u,Gw=Ee(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Tw?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Av=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Vw=Ee(Av,"u").replace(/punct/g,po).getRegex(),Fw=Ee(Av,"u").replace(/punct/g,Mv).getRegex(),zv="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Zw=Ee(zv,"gu").replace(/notPunctSpace/g,Dv).replace(/punctSpace/g,rd).replace(/punct/g,po).getRegex(),Qw=Ee(zv,"gu").replace(/notPunctSpace/g,$w).replace(/punctSpace/g,Yw).replace(/punct/g,Mv).getRegex(),Jw=Ee("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Dv).replace(/punctSpace/g,rd).replace(/punct/g,po).getRegex(),eC=Ee(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Bv).getRegex(),tC="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",iC=Ee(tC,"gu").replace(/notPunctSpace/g,Xw).replace(/punctSpace/g,Iw).replace(/punct/g,Bv).getRegex(),sC=Ee(/\\(punct)/,"gu").replace(/punct/g,po).getRegex(),rC=Ee(/^<(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(),nC=Ee(id).replace("(?:-->|$)","-->").getRegex(),lC=Ee("^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",nC).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),no=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,aC=Ee(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",no).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ov=Ee(/^!?\[(label)\]\[(ref)\]/).replace("label",no).replace("ref",td).getRegex(),Lv=Ee(/^!?\[(ref)\](?:\[\])?/).replace("ref",td).getRegex(),oC=Ee("reflink|nolink(?!\\()","g").replace("reflink",Ov).replace("nolink",Lv).getRegex(),pm=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,nd={_backpedal:rr,anyPunctuation:sC,autolink:rC,blockSkip:Gw,br:Rv,code:Ww,del:rr,delLDelim:rr,delRDelim:rr,emStrongLDelim:Vw,emStrongRDelimAst:Zw,emStrongRDelimUnd:Jw,escape:qw,link:aC,nolink:Lv,punctuation:Kw,reflink:Ov,reflinkSearch:oC,tag:lC,text:Pw,url:rr},cC={...nd,link:Ee(/^!?\[(label)\]\((.*?)\)/).replace("label",no).getRegex(),reflink:Ee(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",no).getRegex()},ju={...nd,emStrongRDelimAst:Qw,emStrongLDelim:Fw,delLDelim:eC,delRDelim:iC,url:Ee(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",pm).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:Ee(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",pm).getRegex()},hC={...ju,br:Ee(Rv).replace("{2,}","*").getRegex(),text:Ee(ju.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},$a={normal:sd,gfm:jw,pedantic:Uw},nl={normal:nd,gfm:ju,breaks:hC,pedantic:cC},uC={"&":"&","<":"<",">":">",'"':""","'":"'"},gm=e=>uC[e];function Ai(e,i){if(i){if(Dt.escapeTest.test(e))return e.replace(Dt.escapeReplace,gm)}else if(Dt.escapeTestNoEncode.test(e))return e.replace(Dt.escapeReplaceNoEncode,gm);return e}function mm(e){try{e=encodeURI(e).replace(Dt.percentDecode,"%")}catch{return null}return e}function vm(e,i){let n=e.replace(Dt.findPipe,(h,d,_)=>{let p=!1,f=d;for(;--f>=0&&_[f]==="\\";)p=!p;return p?"|":" |"}),l=n.split(Dt.splitPipe),o=0;if(l[0].trim()||l.shift(),l.length>0&&!l.at(-1)?.trim()&&l.pop(),i)if(l.length>i)l.splice(i);else for(;l.length<i;)l.push("");for(;o<l.length;o++)l[o]=l[o].trim().replace(Dt.slashPipe,"|");return l}function ll(e,i,n){let l=e.length;if(l===0)return"";let o=0;for(;o<l&&e.charAt(l-o-1)===i;)o++;return e.slice(0,l-o)}function dC(e,i){if(e.indexOf(i[1])===-1)return-1;let n=0;for(let l=0;l<e.length;l++)if(e[l]==="\\")l++;else if(e[l]===i[0])n++;else if(e[l]===i[1]&&(n--,n<0))return l;return n>0?-2:-1}function fC(e,i=0){let n=i,l="";for(let o of e)if(o===" "){let h=4-n%4;l+=" ".repeat(h),n+=h}else l+=o,n++;return l}function Sm(e,i,n,l,o){let h=i.href,d=i.title||null,_=e[1].replace(o.other.outputLinkReplace,"$1");l.state.inLink=!0;let p={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:h,title:d,text:_,tokens:l.inlineTokens(_)};return l.state.inLink=!1,p}function _C(e,i,n){let l=e.match(n.other.indentCodeCompensation);if(l===null)return i;let o=l[1];return i.split(`
|
|
75
|
+
`).map(h=>{let d=h.match(n.other.beginningSpace);if(d===null)return h;let[_]=d;return _.length>=o.length?h.slice(o.length):h}).join(`
|
|
76
|
+
`)}var lo=class{options;rules;lexer;constructor(e){this.options=e||ur}space(e){let i=this.rules.block.newline.exec(e);if(i&&i[0].length>0)return{type:"space",raw:i[0]}}code(e){let i=this.rules.block.code.exec(e);if(i){let n=i[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:i[0],codeBlockStyle:"indented",text:this.options.pedantic?n:ll(n,`
|
|
77
|
+
`)}}}fences(e){let i=this.rules.block.fences.exec(e);if(i){let n=i[0],l=_C(n,i[3]||"",this.rules);return{type:"code",raw:n,lang:i[2]?i[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):i[2],text:l}}}heading(e){let i=this.rules.block.heading.exec(e);if(i){let n=i[2].trim();if(this.rules.other.endingHash.test(n)){let l=ll(n,"#");(this.options.pedantic||!l||this.rules.other.endingSpaceChar.test(l))&&(n=l.trim())}return{type:"heading",raw:i[0],depth:i[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let i=this.rules.block.hr.exec(e);if(i)return{type:"hr",raw:ll(i[0],`
|
|
78
|
+
`)}}blockquote(e){let i=this.rules.block.blockquote.exec(e);if(i){let n=ll(i[0],`
|
|
79
|
+
`).split(`
|
|
80
|
+
`),l="",o="",h=[];for(;n.length>0;){let d=!1,_=[],p;for(p=0;p<n.length;p++)if(this.rules.other.blockquoteStart.test(n[p]))_.push(n[p]),d=!0;else if(!d)_.push(n[p]);else break;n=n.slice(p);let f=_.join(`
|
|
81
|
+
`),S=f.replace(this.rules.other.blockquoteSetextReplace,`
|
|
82
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");l=l?`${l}
|
|
83
|
+
${f}`:f,o=o?`${o}
|
|
84
|
+
${S}`:S;let y=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(S,h,!0),this.lexer.state.top=y,n.length===0)break;let x=h.at(-1);if(x?.type==="code")break;if(x?.type==="blockquote"){let C=x,b=C.raw+`
|
|
85
|
+
`+n.join(`
|
|
86
|
+
`),R=this.blockquote(b);h[h.length-1]=R,l=l.substring(0,l.length-C.raw.length)+R.raw,o=o.substring(0,o.length-C.text.length)+R.text;break}else if(x?.type==="list"){let C=x,b=C.raw+`
|
|
87
|
+
`+n.join(`
|
|
88
|
+
`),R=this.list(b);h[h.length-1]=R,l=l.substring(0,l.length-x.raw.length)+R.raw,o=o.substring(0,o.length-C.raw.length)+R.raw,n=b.substring(h.at(-1).raw.length).split(`
|
|
89
|
+
`);continue}}return{type:"blockquote",raw:l,tokens:h,text:o}}}list(e){let i=this.rules.block.list.exec(e);if(i){let n=i[1].trim(),l=n.length>1,o={type:"list",raw:"",ordered:l,start:l?+n.slice(0,-1):"",loose:!1,items:[]};n=l?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=l?n:"[*+-]");let h=this.rules.other.listItemRegex(n),d=!1;for(;e;){let p=!1,f="",S="";if(!(i=h.exec(e))||this.rules.block.hr.test(e))break;f=i[0],e=e.substring(f.length);let y=fC(i[2].split(`
|
|
90
|
+
`,1)[0],i[1].length),x=e.split(`
|
|
91
|
+
`,1)[0],C=!y.trim(),b=0;if(this.options.pedantic?(b=2,S=y.trimStart()):C?b=i[1].length+1:(b=y.search(this.rules.other.nonSpaceChar),b=b>4?1:b,S=y.slice(b),b+=i[1].length),C&&this.rules.other.blankLine.test(x)&&(f+=x+`
|
|
92
|
+
`,e=e.substring(x.length+1),p=!0),!p){let R=this.rules.other.nextBulletRegex(b),L=this.rules.other.hrRegex(b),X=this.rules.other.fencesBeginRegex(b),se=this.rules.other.headingBeginRegex(b),$=this.rules.other.htmlBeginRegex(b),W=this.rules.other.blockquoteBeginRegex(b);for(;e;){let Y=e.split(`
|
|
93
|
+
`,1)[0],Q;if(x=Y,this.options.pedantic?(x=x.replace(this.rules.other.listReplaceNesting," "),Q=x):Q=x.replace(this.rules.other.tabCharGlobal," "),X.test(x)||se.test(x)||$.test(x)||W.test(x)||R.test(x)||L.test(x))break;if(Q.search(this.rules.other.nonSpaceChar)>=b||!x.trim())S+=`
|
|
94
|
+
`+Q.slice(b);else{if(C||y.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||X.test(y)||se.test(y)||L.test(y))break;S+=`
|
|
95
|
+
`+x}C=!x.trim(),f+=Y+`
|
|
96
|
+
`,e=e.substring(Y.length+1),y=Q.slice(b)}}o.loose||(d?o.loose=!0:this.rules.other.doubleBlankLine.test(f)&&(d=!0)),o.items.push({type:"list_item",raw:f,task:!!this.options.gfm&&this.rules.other.listIsTask.test(S),loose:!1,text:S,tokens:[]}),o.raw+=f}let _=o.items.at(-1);if(_)_.raw=_.raw.trimEnd(),_.text=_.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let p of o.items){if(this.lexer.state.top=!1,p.tokens=this.lexer.blockTokens(p.text,[]),p.task){if(p.text=p.text.replace(this.rules.other.listReplaceTask,""),p.tokens[0]?.type==="text"||p.tokens[0]?.type==="paragraph"){p.tokens[0].raw=p.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),p.tokens[0].text=p.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let S=this.lexer.inlineQueue.length-1;S>=0;S--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[S].src)){this.lexer.inlineQueue[S].src=this.lexer.inlineQueue[S].src.replace(this.rules.other.listReplaceTask,"");break}}let f=this.rules.other.listTaskCheckbox.exec(p.raw);if(f){let S={type:"checkbox",raw:f[0]+" ",checked:f[0]!=="[ ]"};p.checked=S.checked,o.loose?p.tokens[0]&&["paragraph","text"].includes(p.tokens[0].type)&&"tokens"in p.tokens[0]&&p.tokens[0].tokens?(p.tokens[0].raw=S.raw+p.tokens[0].raw,p.tokens[0].text=S.raw+p.tokens[0].text,p.tokens[0].tokens.unshift(S)):p.tokens.unshift({type:"paragraph",raw:S.raw,text:S.raw,tokens:[S]}):p.tokens.unshift(S)}}if(!o.loose){let f=p.tokens.filter(y=>y.type==="space"),S=f.length>0&&f.some(y=>this.rules.other.anyLine.test(y.raw));o.loose=S}}if(o.loose)for(let p of o.items){p.loose=!0;for(let f of p.tokens)f.type==="text"&&(f.type="paragraph")}return o}}html(e){let i=this.rules.block.html.exec(e);if(i)return{type:"html",block:!0,raw:i[0],pre:i[1]==="pre"||i[1]==="script"||i[1]==="style",text:i[0]}}def(e){let i=this.rules.block.def.exec(e);if(i){let n=i[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),l=i[2]?i[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=i[3]?i[3].substring(1,i[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):i[3];return{type:"def",tag:n,raw:i[0],href:l,title:o}}}table(e){let i=this.rules.block.table.exec(e);if(!i||!this.rules.other.tableDelimiter.test(i[2]))return;let n=vm(i[1]),l=i[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=i[3]?.trim()?i[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
97
|
+
`):[],h={type:"table",raw:i[0],header:[],align:[],rows:[]};if(n.length===l.length){for(let d of l)this.rules.other.tableAlignRight.test(d)?h.align.push("right"):this.rules.other.tableAlignCenter.test(d)?h.align.push("center"):this.rules.other.tableAlignLeft.test(d)?h.align.push("left"):h.align.push(null);for(let d=0;d<n.length;d++)h.header.push({text:n[d],tokens:this.lexer.inline(n[d]),header:!0,align:h.align[d]});for(let d of o)h.rows.push(vm(d,h.header.length).map((_,p)=>({text:_,tokens:this.lexer.inline(_),header:!1,align:h.align[p]})));return h}}lheading(e){let i=this.rules.block.lheading.exec(e);if(i)return{type:"heading",raw:i[0],depth:i[2].charAt(0)==="="?1:2,text:i[1],tokens:this.lexer.inline(i[1])}}paragraph(e){let i=this.rules.block.paragraph.exec(e);if(i){let n=i[1].charAt(i[1].length-1)===`
|
|
98
|
+
`?i[1].slice(0,-1):i[1];return{type:"paragraph",raw:i[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let i=this.rules.block.text.exec(e);if(i)return{type:"text",raw:i[0],text:i[0],tokens:this.lexer.inline(i[0])}}escape(e){let i=this.rules.inline.escape.exec(e);if(i)return{type:"escape",raw:i[0],text:i[1]}}tag(e){let i=this.rules.inline.tag.exec(e);if(i)return!this.lexer.state.inLink&&this.rules.other.startATag.test(i[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(i[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(i[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(i[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:i[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:i[0]}}link(e){let i=this.rules.inline.link.exec(e);if(i){let n=i[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let h=ll(n.slice(0,-1),"\\");if((n.length-h.length)%2===0)return}else{let h=dC(i[2],"()");if(h===-2)return;if(h>-1){let d=(i[0].indexOf("!")===0?5:4)+i[1].length+h;i[2]=i[2].substring(0,h),i[0]=i[0].substring(0,d).trim(),i[3]=""}}let l=i[2],o="";if(this.options.pedantic){let h=this.rules.other.pedanticHrefTitle.exec(l);h&&(l=h[1],o=h[3])}else o=i[3]?i[3].slice(1,-1):"";return l=l.trim(),this.rules.other.startAngleBracket.test(l)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?l=l.slice(1):l=l.slice(1,-1)),Sm(i,{href:l&&l.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},i[0],this.lexer,this.rules)}}reflink(e,i){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let l=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=i[l.toLowerCase()];if(!o){let h=n[0].charAt(0);return{type:"text",raw:h,text:h}}return Sm(n,o,n[0],this.lexer,this.rules)}}emStrong(e,i,n=""){let l=this.rules.inline.emStrongLDelim.exec(e);if(!(!l||l[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(l[1]||l[2])||!n||this.rules.inline.punctuation.exec(n))){let o=[...l[0]].length-1,h,d,_=o,p=0,f=l[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(f.lastIndex=0,i=i.slice(-1*e.length+o);(l=f.exec(i))!=null;){if(h=l[1]||l[2]||l[3]||l[4]||l[5]||l[6],!h)continue;if(d=[...h].length,l[3]||l[4]){_+=d;continue}else if((l[5]||l[6])&&o%3&&!((o+d)%3)){p+=d;continue}if(_-=d,_>0)continue;d=Math.min(d,d+_+p);let S=[...l[0]][0].length,y=e.slice(0,o+l.index+S+d);if(Math.min(o,d)%2){let C=y.slice(1,-1);return{type:"em",raw:y,text:C,tokens:this.lexer.inlineTokens(C)}}let x=y.slice(2,-2);return{type:"strong",raw:y,text:x,tokens:this.lexer.inlineTokens(x)}}}}codespan(e){let i=this.rules.inline.code.exec(e);if(i){let n=i[2].replace(this.rules.other.newLineCharGlobal," "),l=this.rules.other.nonSpaceChar.test(n),o=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return l&&o&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:i[0],text:n}}}br(e){let i=this.rules.inline.br.exec(e);if(i)return{type:"br",raw:i[0]}}del(e,i,n=""){let l=this.rules.inline.delLDelim.exec(e);if(l&&(!l[1]||!n||this.rules.inline.punctuation.exec(n))){let o=[...l[0]].length-1,h,d,_=o,p=this.rules.inline.delRDelim;for(p.lastIndex=0,i=i.slice(-1*e.length+o);(l=p.exec(i))!=null;){if(h=l[1]||l[2]||l[3]||l[4]||l[5]||l[6],!h||(d=[...h].length,d!==o))continue;if(l[3]||l[4]){_+=d;continue}if(_-=d,_>0)continue;d=Math.min(d,d+_);let f=[...l[0]][0].length,S=e.slice(0,o+l.index+f+d),y=S.slice(o,-o);return{type:"del",raw:S,text:y,tokens:this.lexer.inlineTokens(y)}}}}autolink(e){let i=this.rules.inline.autolink.exec(e);if(i){let n,l;return i[2]==="@"?(n=i[1],l="mailto:"+n):(n=i[1],l=n),{type:"link",raw:i[0],text:n,href:l,tokens:[{type:"text",raw:n,text:n}]}}}url(e){let i;if(i=this.rules.inline.url.exec(e)){let n,l;if(i[2]==="@")n=i[0],l="mailto:"+n;else{let o;do o=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])?.[0]??"";while(o!==i[0]);n=i[0],i[1]==="www."?l="http://"+i[0]:l=i[0]}return{type:"link",raw:i[0],text:n,href:l,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){let i=this.rules.inline.text.exec(e);if(i){let n=this.lexer.state.inRawBlock;return{type:"text",raw:i[0],text:i[0],escaped:n}}}},bi=class Uu{tokens;options;state;inlineQueue;tokenizer;constructor(i){this.tokens=[],this.tokens.links=Object.create(null),this.options=i||ur,this.options.tokenizer=this.options.tokenizer||new lo,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 n={other:Dt,block:$a.normal,inline:nl.normal};this.options.pedantic?(n.block=$a.pedantic,n.inline=nl.pedantic):this.options.gfm&&(n.block=$a.gfm,this.options.breaks?n.inline=nl.breaks:n.inline=nl.gfm),this.tokenizer.rules=n}static get rules(){return{block:$a,inline:nl}}static lex(i,n){return new Uu(n).lex(i)}static lexInline(i,n){return new Uu(n).inlineTokens(i)}lex(i){i=i.replace(Dt.carriageReturn,`
|
|
99
|
+
`),this.blockTokens(i,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let l=this.inlineQueue[n];this.inlineTokens(l.src,l.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(i,n=[],l=!1){for(this.options.pedantic&&(i=i.replace(Dt.tabCharGlobal," ").replace(Dt.spaceLine,""));i;){let o;if(this.options.extensions?.block?.some(d=>(o=d.call({lexer:this},i,n))?(i=i.substring(o.raw.length),n.push(o),!0):!1))continue;if(o=this.tokenizer.space(i)){i=i.substring(o.raw.length);let d=n.at(-1);o.raw.length===1&&d!==void 0?d.raw+=`
|
|
100
|
+
`:n.push(o);continue}if(o=this.tokenizer.code(i)){i=i.substring(o.raw.length);let d=n.at(-1);d?.type==="paragraph"||d?.type==="text"?(d.raw+=(d.raw.endsWith(`
|
|
101
|
+
`)?"":`
|
|
102
|
+
`)+o.raw,d.text+=`
|
|
103
|
+
`+o.text,this.inlineQueue.at(-1).src=d.text):n.push(o);continue}if(o=this.tokenizer.fences(i)){i=i.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.heading(i)){i=i.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.hr(i)){i=i.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.blockquote(i)){i=i.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.list(i)){i=i.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.html(i)){i=i.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.def(i)){i=i.substring(o.raw.length);let d=n.at(-1);d?.type==="paragraph"||d?.type==="text"?(d.raw+=(d.raw.endsWith(`
|
|
104
|
+
`)?"":`
|
|
105
|
+
`)+o.raw,d.text+=`
|
|
106
|
+
`+o.raw,this.inlineQueue.at(-1).src=d.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title},n.push(o));continue}if(o=this.tokenizer.table(i)){i=i.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.lheading(i)){i=i.substring(o.raw.length),n.push(o);continue}let h=i;if(this.options.extensions?.startBlock){let d=1/0,_=i.slice(1),p;this.options.extensions.startBlock.forEach(f=>{p=f.call({lexer:this},_),typeof p=="number"&&p>=0&&(d=Math.min(d,p))}),d<1/0&&d>=0&&(h=i.substring(0,d+1))}if(this.state.top&&(o=this.tokenizer.paragraph(h))){let d=n.at(-1);l&&d?.type==="paragraph"?(d.raw+=(d.raw.endsWith(`
|
|
107
|
+
`)?"":`
|
|
108
|
+
`)+o.raw,d.text+=`
|
|
109
|
+
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=d.text):n.push(o),l=h.length!==i.length,i=i.substring(o.raw.length);continue}if(o=this.tokenizer.text(i)){i=i.substring(o.raw.length);let d=n.at(-1);d?.type==="text"?(d.raw+=(d.raw.endsWith(`
|
|
110
|
+
`)?"":`
|
|
111
|
+
`)+o.raw,d.text+=`
|
|
112
|
+
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=d.text):n.push(o);continue}if(i){let d="Infinite loop on byte: "+i.charCodeAt(0);if(this.options.silent){console.error(d);break}else throw new Error(d)}}return this.state.top=!0,n}inline(i,n=[]){return this.inlineQueue.push({src:i,tokens:n}),n}inlineTokens(i,n=[]){let l=i,o=null;if(this.tokens.links){let p=Object.keys(this.tokens.links);if(p.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(l))!=null;)p.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(l))!=null;)l=l.slice(0,o.index)+"++"+l.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let h;for(;(o=this.tokenizer.rules.inline.blockSkip.exec(l))!=null;)h=o[2]?o[2].length:0,l=l.slice(0,o.index+h)+"["+"a".repeat(o[0].length-h-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);l=this.options.hooks?.emStrongMask?.call({lexer:this},l)??l;let d=!1,_="";for(;i;){d||(_=""),d=!1;let p;if(this.options.extensions?.inline?.some(S=>(p=S.call({lexer:this},i,n))?(i=i.substring(p.raw.length),n.push(p),!0):!1))continue;if(p=this.tokenizer.escape(i)){i=i.substring(p.raw.length),n.push(p);continue}if(p=this.tokenizer.tag(i)){i=i.substring(p.raw.length),n.push(p);continue}if(p=this.tokenizer.link(i)){i=i.substring(p.raw.length),n.push(p);continue}if(p=this.tokenizer.reflink(i,this.tokens.links)){i=i.substring(p.raw.length);let S=n.at(-1);p.type==="text"&&S?.type==="text"?(S.raw+=p.raw,S.text+=p.text):n.push(p);continue}if(p=this.tokenizer.emStrong(i,l,_)){i=i.substring(p.raw.length),n.push(p);continue}if(p=this.tokenizer.codespan(i)){i=i.substring(p.raw.length),n.push(p);continue}if(p=this.tokenizer.br(i)){i=i.substring(p.raw.length),n.push(p);continue}if(p=this.tokenizer.del(i,l,_)){i=i.substring(p.raw.length),n.push(p);continue}if(p=this.tokenizer.autolink(i)){i=i.substring(p.raw.length),n.push(p);continue}if(!this.state.inLink&&(p=this.tokenizer.url(i))){i=i.substring(p.raw.length),n.push(p);continue}let f=i;if(this.options.extensions?.startInline){let S=1/0,y=i.slice(1),x;this.options.extensions.startInline.forEach(C=>{x=C.call({lexer:this},y),typeof x=="number"&&x>=0&&(S=Math.min(S,x))}),S<1/0&&S>=0&&(f=i.substring(0,S+1))}if(p=this.tokenizer.inlineText(f)){i=i.substring(p.raw.length),p.raw.slice(-1)!=="_"&&(_=p.raw.slice(-1)),d=!0;let S=n.at(-1);S?.type==="text"?(S.raw+=p.raw,S.text+=p.text):n.push(p);continue}if(i){let S="Infinite loop on byte: "+i.charCodeAt(0);if(this.options.silent){console.error(S);break}else throw new Error(S)}}return n}},ao=class{options;parser;constructor(e){this.options=e||ur}space(e){return""}code({text:e,lang:i,escaped:n}){let l=(i||"").match(Dt.notSpaceStart)?.[0],o=e.replace(Dt.endingNewline,"")+`
|
|
113
|
+
`;return l?'<pre><code class="language-'+Ai(l)+'">'+(n?o:Ai(o,!0))+`</code></pre>
|
|
114
|
+
`:"<pre><code>"+(n?o:Ai(o,!0))+`</code></pre>
|
|
115
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
|
116
|
+
${this.parser.parse(e)}</blockquote>
|
|
117
|
+
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:i}){return`<h${i}>${this.parser.parseInline(e)}</h${i}>
|
|
118
|
+
`}hr(e){return`<hr>
|
|
119
|
+
`}list(e){let i=e.ordered,n=e.start,l="";for(let d=0;d<e.items.length;d++){let _=e.items[d];l+=this.listitem(_)}let o=i?"ol":"ul",h=i&&n!==1?' start="'+n+'"':"";return"<"+o+h+`>
|
|
120
|
+
`+l+"</"+o+`>
|
|
121
|
+
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
122
|
+
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
123
|
+
`}table(e){let i="",n="";for(let o=0;o<e.header.length;o++)n+=this.tablecell(e.header[o]);i+=this.tablerow({text:n});let l="";for(let o=0;o<e.rows.length;o++){let h=e.rows[o];n="";for(let d=0;d<h.length;d++)n+=this.tablecell(h[d]);l+=this.tablerow({text:n})}return l&&(l=`<tbody>${l}</tbody>`),`<table>
|
|
124
|
+
<thead>
|
|
125
|
+
`+i+`</thead>
|
|
126
|
+
`+l+`</table>
|
|
127
|
+
`}tablerow({text:e}){return`<tr>
|
|
128
|
+
${e}</tr>
|
|
129
|
+
`}tablecell(e){let i=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+i+`</${n}>
|
|
130
|
+
`}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>${Ai(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:i,tokens:n}){let l=this.parser.parseInline(n),o=mm(e);if(o===null)return l;e=o;let h='<a href="'+e+'"';return i&&(h+=' title="'+Ai(i)+'"'),h+=">"+l+"</a>",h}image({href:e,title:i,text:n,tokens:l}){l&&(n=this.parser.parseInline(l,this.parser.textRenderer));let o=mm(e);if(o===null)return Ai(n);e=o;let h=`<img src="${e}" alt="${Ai(n)}"`;return i&&(h+=` title="${Ai(i)}"`),h+=">",h}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Ai(e.text)}},ld=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""}checkbox({raw:e}){return e}},xi=class qu{options;renderer;textRenderer;constructor(i){this.options=i||ur,this.options.renderer=this.options.renderer||new ao,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ld}static parse(i,n){return new qu(n).parse(i)}static parseInline(i,n){return new qu(n).parseInline(i)}parse(i){let n="";for(let l=0;l<i.length;l++){let o=i[l];if(this.options.extensions?.renderers?.[o.type]){let d=o,_=this.options.extensions.renderers[d.type].call({parser:this},d);if(_!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(d.type)){n+=_||"";continue}}let h=o;switch(h.type){case"space":{n+=this.renderer.space(h);break}case"hr":{n+=this.renderer.hr(h);break}case"heading":{n+=this.renderer.heading(h);break}case"code":{n+=this.renderer.code(h);break}case"table":{n+=this.renderer.table(h);break}case"blockquote":{n+=this.renderer.blockquote(h);break}case"list":{n+=this.renderer.list(h);break}case"checkbox":{n+=this.renderer.checkbox(h);break}case"html":{n+=this.renderer.html(h);break}case"def":{n+=this.renderer.def(h);break}case"paragraph":{n+=this.renderer.paragraph(h);break}case"text":{n+=this.renderer.text(h);break}default:{let d='Token with "'+h.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return n}parseInline(i,n=this.renderer){let l="";for(let o=0;o<i.length;o++){let h=i[o];if(this.options.extensions?.renderers?.[h.type]){let _=this.options.extensions.renderers[h.type].call({parser:this},h);if(_!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(h.type)){l+=_||"";continue}}let d=h;switch(d.type){case"escape":{l+=n.text(d);break}case"html":{l+=n.html(d);break}case"link":{l+=n.link(d);break}case"image":{l+=n.image(d);break}case"checkbox":{l+=n.checkbox(d);break}case"strong":{l+=n.strong(d);break}case"em":{l+=n.em(d);break}case"codespan":{l+=n.codespan(d);break}case"br":{l+=n.br(d);break}case"del":{l+=n.del(d);break}case"text":{l+=n.text(d);break}default:{let _='Token with "'+d.type+'" type was not found.';if(this.options.silent)return console.error(_),"";throw new Error(_)}}}return l}},dl=class{options;block;constructor(e){this.options=e||ur}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?bi.lex:bi.lexInline}provideParser(){return this.block?xi.parse:xi.parseInline}},pC=class{defaults=Qu();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=xi;Renderer=ao;TextRenderer=ld;Lexer=bi;Tokenizer=lo;Hooks=dl;constructor(...e){this.use(...e)}walkTokens(e,i){let n=[];for(let l of e)switch(n=n.concat(i.call(this,l)),l.type){case"table":{let o=l;for(let h of o.header)n=n.concat(this.walkTokens(h.tokens,i));for(let h of o.rows)for(let d of h)n=n.concat(this.walkTokens(d.tokens,i));break}case"list":{let o=l;n=n.concat(this.walkTokens(o.items,i));break}default:{let o=l;this.defaults.extensions?.childTokens?.[o.type]?this.defaults.extensions.childTokens[o.type].forEach(h=>{let d=o[h].flat(1/0);n=n.concat(this.walkTokens(d,i))}):o.tokens&&(n=n.concat(this.walkTokens(o.tokens,i)))}}return n}use(...e){let i=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let l={...n};if(l.async=this.defaults.async||l.async||!1,n.extensions&&(n.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let h=i.renderers[o.name];h?i.renderers[o.name]=function(...d){let _=o.renderer.apply(this,d);return _===!1&&(_=h.apply(this,d)),_}:i.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let h=i[o.level];h?h.unshift(o.tokenizer):i[o.level]=[o.tokenizer],o.start&&(o.level==="block"?i.startBlock?i.startBlock.push(o.start):i.startBlock=[o.start]:o.level==="inline"&&(i.startInline?i.startInline.push(o.start):i.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(i.childTokens[o.name]=o.childTokens)}),l.extensions=i),n.renderer){let o=this.defaults.renderer||new ao(this.defaults);for(let h in n.renderer){if(!(h in o))throw new Error(`renderer '${h}' does not exist`);if(["options","parser"].includes(h))continue;let d=h,_=n.renderer[d],p=o[d];o[d]=(...f)=>{let S=_.apply(o,f);return S===!1&&(S=p.apply(o,f)),S||""}}l.renderer=o}if(n.tokenizer){let o=this.defaults.tokenizer||new lo(this.defaults);for(let h in n.tokenizer){if(!(h in o))throw new Error(`tokenizer '${h}' does not exist`);if(["options","rules","lexer"].includes(h))continue;let d=h,_=n.tokenizer[d],p=o[d];o[d]=(...f)=>{let S=_.apply(o,f);return S===!1&&(S=p.apply(o,f)),S}}l.tokenizer=o}if(n.hooks){let o=this.defaults.hooks||new dl;for(let h in n.hooks){if(!(h in o))throw new Error(`hook '${h}' does not exist`);if(["options","block"].includes(h))continue;let d=h,_=n.hooks[d],p=o[d];dl.passThroughHooks.has(h)?o[d]=f=>{if(this.defaults.async&&dl.passThroughHooksRespectAsync.has(h))return(async()=>{let y=await _.call(o,f);return p.call(o,y)})();let S=_.call(o,f);return p.call(o,S)}:o[d]=(...f)=>{if(this.defaults.async)return(async()=>{let y=await _.apply(o,f);return y===!1&&(y=await p.apply(o,f)),y})();let S=_.apply(o,f);return S===!1&&(S=p.apply(o,f)),S}}l.hooks=o}if(n.walkTokens){let o=this.defaults.walkTokens,h=n.walkTokens;l.walkTokens=function(d){let _=[];return _.push(h.call(this,d)),o&&(_=_.concat(o.call(this,d))),_}}this.defaults={...this.defaults,...l}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,i){return bi.lex(e,i??this.defaults)}parser(e,i){return xi.parse(e,i??this.defaults)}parseMarkdown(e){return(i,n)=>{let l={...n},o={...this.defaults,...l},h=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&l.async===!1)return h(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof i>"u"||i===null)return h(new Error("marked(): input parameter is undefined or null"));if(typeof i!="string")return h(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(i)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=e),o.async)return(async()=>{let d=o.hooks?await o.hooks.preprocess(i):i,_=await(o.hooks?await o.hooks.provideLexer():e?bi.lex:bi.lexInline)(d,o),p=o.hooks?await o.hooks.processAllTokens(_):_;o.walkTokens&&await Promise.all(this.walkTokens(p,o.walkTokens));let f=await(o.hooks?await o.hooks.provideParser():e?xi.parse:xi.parseInline)(p,o);return o.hooks?await o.hooks.postprocess(f):f})().catch(h);try{o.hooks&&(i=o.hooks.preprocess(i));let d=(o.hooks?o.hooks.provideLexer():e?bi.lex:bi.lexInline)(i,o);o.hooks&&(d=o.hooks.processAllTokens(d)),o.walkTokens&&this.walkTokens(d,o.walkTokens);let _=(o.hooks?o.hooks.provideParser():e?xi.parse:xi.parseInline)(d,o);return o.hooks&&(_=o.hooks.postprocess(_)),_}catch(d){return h(d)}}}onError(e,i){return n=>{if(n.message+=`
|
|
131
|
+
Please report this to https://github.com/markedjs/marked.`,e){let l="<p>An error occurred:</p><pre>"+Ai(n.message+"",!0)+"</pre>";return i?Promise.resolve(l):l}if(i)return Promise.reject(n);throw n}}},cr=new pC;function Le(e,i){return cr.parse(e,i)}Le.options=Le.setOptions=function(e){return cr.setOptions(e),Le.defaults=cr.defaults,Cv(Le.defaults),Le};Le.getDefaults=Qu;Le.defaults=ur;Le.use=function(...e){return cr.use(...e),Le.defaults=cr.defaults,Cv(Le.defaults),Le};Le.walkTokens=function(e,i){return cr.walkTokens(e,i)};Le.parseInline=cr.parseInline;Le.Parser=xi;Le.parser=xi.parse;Le.Renderer=ao;Le.TextRenderer=ld;Le.Lexer=bi;Le.lexer=bi.lex;Le.Tokenizer=lo;Le.Hooks=dl;Le.parse=Le;Le.options;Le.setOptions;Le.use;Le.walkTokens;Le.parseInline;xi.parse;bi.lex;function gC(e){return e.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"").replace(/\bon\w+\s*=\s*"[^"]*"/gi,"").replace(/\bon\w+\s*=\s*'[^']*'/gi,"").replace(/javascript\s*:/gi,"")}function ym(e){const i=[];let n="",l=!1;for(const o of e){if(o==='"'){l=!l;continue}if(o===","&&!l){i.push(n.trim()),n="";continue}n+=o}return i.push(n.trim()),i}function mC({content:e}){const i=e.trim().split(`
|
|
132
|
+
`).filter(Boolean);if(i.length===0)return m.jsx("p",{className:"text-sm text-[var(--text-secondary)]",children:"Empty CSV"});const n=ym(i[0]),l=i.slice(1).map(o=>ym(o));return m.jsx("div",{className:"overflow-auto",children:m.jsxs("table",{className:"text-sm border-collapse w-full",children:[m.jsx("thead",{children:m.jsx("tr",{children:n.map((o,h)=>m.jsx("th",{className:"border border-[var(--border)] px-3 py-1.5 text-left font-semibold bg-[var(--bg-sidebar)] text-[var(--text-primary)]",children:o.trim()},h))})}),m.jsx("tbody",{children:l.map((o,h)=>m.jsx("tr",{className:"even:bg-[var(--bg-sidebar)]",children:o.map((d,_)=>m.jsx("td",{className:"border border-[var(--border)] px-3 py-1.5 text-[var(--text-primary)]",children:d.trim()},_))},h))})]})})}const go="h-full bg-[var(--bg-secondary)] flex flex-col";function vC({output:e}){return e.status==="empty"?m.jsx(yC,{}):e.status==="processing"?m.jsx(bC,{outcome:e.outcome,fileCount:e.fileCount}):e.status==="error"?m.jsx(xC,{message:e.message}):m.jsx(SC,{output:e})}function SC({output:e}){const{selectedOutcome:i}=ss(),[n,l]=O.useState(!1),[o,h]=O.useState(""),[d,_]=O.useState(null),p=e.path.split("/").pop()||e.path,f=e.path.endsWith(".csv"),S=()=>{navigator.clipboard.writeText(e.content)},y=()=>{const C=new Blob([e.content],{type:"text/plain"}),b=URL.createObjectURL(C),R=document.createElement("a");R.href=b,R.download=p,R.click(),URL.revokeObjectURL(b)},x=()=>{if(d||!o.trim())return;const C=o.trim();Jy({id:crypto.randomUUID(),name:C,outcomeKey:i||"custom",content:e.content,createdAt:Date.now()}),_(C)};return m.jsxs("div",{className:`${go}`,children:[m.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-[var(--border)] shrink-0",children:[m.jsx("span",{className:"text-sm font-medium text-[var(--text-primary)] truncate",children:p}),m.jsxs("div",{className:"flex gap-2 ml-2 shrink-0",children:[m.jsx("button",{onClick:S,"aria-label":"Copy output to clipboard",className:"text-xs px-3 py-1 rounded border border-[var(--border)] text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:bg-[var(--bg-sidebar)] transition-colors",children:"Copy"}),m.jsx("button",{onClick:y,"aria-label":"Download output file",className:"text-xs px-3 py-1 rounded border border-[var(--border)] text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:bg-[var(--bg-sidebar)] transition-colors",children:"Download"})]})]}),m.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 min-h-0",children:f?m.jsx(mC,{content:e.content}):m.jsx("div",{className:"output-prose",dangerouslySetInnerHTML:{__html:gC(Le.parse(e.content,{async:!1}))}})}),m.jsxs("div",{className:"shrink-0 px-4 py-1.5 border-t border-[var(--border)] text-xs text-green-600",children:["✓ Saved to ",e.path]}),m.jsx("div",{className:"shrink-0 px-4 py-2 border-t border-[var(--border)]",children:d?m.jsxs("p",{className:"text-xs text-indigo-600 font-medium",children:["⭐ Saved as ‘",d,"’"]}):n?m.jsxs("div",{className:"flex gap-2",children:[m.jsx("input",{type:"text",value:o,onChange:C=>h(C.target.value),placeholder:"Template name...",className:"flex-1 text-xs px-2 py-1 rounded border border-[var(--border)] bg-[var(--bg-secondary)] text-[var(--text-primary)] outline-none focus:ring-1 focus:ring-indigo-400",autoFocus:!0,onKeyDown:C=>{C.key==="Enter"&&x()}}),m.jsx("button",{onClick:x,className:"text-xs px-3 py-1 rounded bg-indigo-600 text-white font-medium hover:bg-indigo-700 transition-colors",children:"Save"})]}):m.jsx("button",{onClick:()=>l(!0),className:"w-full text-xs py-2 rounded-lg border border-dashed transition-colors hover:border-indigo-400 hover:text-indigo-600",style:{borderColor:"var(--border)",color:"var(--text-secondary)",background:"transparent",cursor:"pointer"},children:"⭐ Like this style? Save it as a template"})})]})}function yC(){const{loadOutput:e}=ss(),[i,n]=O.useState(!1),l=async()=>{n(!0);try{const h=await(await fetch("/api/pick-file")).json();h?.path&&(await(await fetch(`/api/read-file?path=${encodeURIComponent(h.path)}`)).json())?.content&&await e(h.path)}catch{}n(!1)};return m.jsxs("div",{className:`${go} items-center justify-center gap-3`,children:[m.jsx("span",{className:"text-4xl",children:"📄"}),m.jsx("p",{className:"text-base font-medium text-[var(--text-primary)]",children:"Your output will appear here"}),m.jsx("p",{className:"text-sm text-[var(--text-secondary)]",children:"Pick a folder and outcome, then hit Go"}),m.jsx("button",{onClick:l,disabled:i,style:{padding:"8px 20px",borderRadius:"10px",border:"1px solid var(--border)",background:"transparent",color:"var(--text-secondary)",fontSize:"13px",fontWeight:500,cursor:i?"not-allowed":"pointer",marginTop:"8px",transition:"all 0.15s"},children:i?"Opening...":"📂 Open a document"})]})}function bC({outcome:e,fileCount:i}){const{folderPath:n,loadOutput:l}=ss(),[o,h]=O.useState(!1),d=async()=>{if(n){h(!0);try{const p=await(await fetch(`/api/latest-output?folderPath=${encodeURIComponent(n)}`)).json();p?.path&&await l(p.path)}catch{}h(!1)}};return m.jsxs("div",{className:`${go} items-center justify-center gap-2`,children:[m.jsx("span",{className:"text-4xl animate-pulse",children:"⏳"}),m.jsxs("p",{className:"text-base font-medium text-[var(--text-primary)]",children:[e," — ",i," documents..."]}),m.jsx("p",{className:"text-sm text-[var(--text-secondary)]",children:"Claude is working — check the terminal for progress"}),m.jsx("button",{onClick:d,disabled:o,style:{padding:"8px 18px",borderRadius:"8px",border:"1px solid var(--border)",background:"transparent",color:"var(--text-secondary)",fontSize:"12px",fontWeight:500,cursor:o?"not-allowed":"pointer",marginTop:"12px"},children:o?"Checking...":"Check if done"})]})}function xC({message:e}){const{folderPath:i,loadOutput:n}=ss(),[l,o]=O.useState(!1),[h,d]=O.useState(!1),_=async()=>{if(i){o(!0),d(!1);try{const f=await(await fetch(`/api/latest-output?folderPath=${encodeURIComponent(i)}`)).json();f?.path?await n(f.path):d(!0)}catch{d(!0)}o(!1)}};return m.jsxs("div",{className:`${go} items-center justify-center gap-3`,children:[m.jsx("span",{className:"text-4xl",children:"⚠️"}),m.jsx("p",{style:{fontSize:"13px",color:"#dc2626",textAlign:"center",maxWidth:"300px"},children:e}),m.jsx("button",{onClick:_,disabled:l,style:{padding:"10px 24px",borderRadius:"10px",border:"none",background:"#6366f1",color:"#fff",fontSize:"14px",fontWeight:600,cursor:l?"not-allowed":"pointer",opacity:l?.6:1,marginTop:"8px"},children:l?"Checking...":"Check for output"}),h&&m.jsx("p",{style:{fontSize:"12px",color:"#f59e0b",textAlign:"center"},children:"No output file found yet. Claude may still be working — try again in a moment."}),m.jsx("p",{style:{fontSize:"11px",color:"#9ca3af",textAlign:"center"},children:"Click to check if Claude has finished writing the output file"})]})}function wC(){const[e,i]=O.useState(!0),{mode:n}=Mt(),l=ss();return Ey(),O.useEffect(()=>(n==="document"?document.documentElement.classList.add("doc-mode"):document.documentElement.classList.remove("doc-mode"),()=>document.documentElement.classList.remove("doc-mode")),[n]),m.jsxs("div",{className:"h-full flex flex-col",style:{background:"#f8fafc"},children:[m.jsx(By,{}),m.jsx(Ay,{}),m.jsxs("div",{className:"flex-1 flex min-h-0",children:[m.jsx(zy,{open:e,onToggle:()=>i(!e)}),m.jsx(lb,{open:e}),m.jsxs("div",{className:"flex-1 flex min-w-0",children:[m.jsx("div",{className:"flex-1 min-w-0 flex flex-col",style:{background:"#1a1a2e"},children:m.jsx(kw,{})}),m.jsx("div",{style:{width:"45%",flexShrink:0,borderLeft:"1px solid #e5e7eb"},children:n==="developer"?m.jsx(Ew,{}):m.jsx(vC,{output:l.output})})]})]})]})}function CC(){return m.jsx(ky,{children:m.jsx(wC,{})})}function kC(){const{path:e,setProjectPath:i}=Mt();return e?m.jsx(CC,{}):m.jsx(My,{onProjectSelected:i})}function EC(){return m.jsx(my,{children:m.jsx(Sy,{children:m.jsx(kC,{})})})}_y.createRoot(document.getElementById("root")).render(m.jsx(O.StrictMode,{children:m.jsx(EC,{})}));
|