ai-kanban-terminal 0.3.0 → 0.7.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/dist/assets/index-CXyv9MVx.js +102 -0
- package/dist/assets/index-CvNpFeWU.css +47 -0
- package/dist/index.html +2 -2
- package/package.json +6 -5
- package/server.js +105 -23
- package/dist/assets/index-CMu989wp.js +0 -91
- package/dist/assets/index-DCBCU9ry.css +0 -32
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const u of a.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&n(u)}).observe(document,{childList:!0,subtree:!0});function r(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(o){if(o.ep)return;o.ep=!0;const a=r(o);fetch(o.href,a)}})();var nl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function dg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function fg(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}),r}var eh={exports:{}},Vs={},th={exports:{}},Te={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Ky;function oD(){if(Ky)return Te;Ky=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),u=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),v=Symbol.iterator;function y(M){return M===null||typeof M!="object"?null:(M=v&&M[v]||M["@@iterator"],typeof M=="function"?M:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,S={};function C(M,j,oe){this.props=M,this.context=j,this.refs=S,this.updater=oe||m}C.prototype.isReactComponent={},C.prototype.setState=function(M,j){if(typeof M!="object"&&typeof M!="function"&&M!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,j,"setState")},C.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function E(){}E.prototype=C.prototype;function x(M,j,oe){this.props=M,this.context=j,this.refs=S,this.updater=oe||m}var k=x.prototype=new E;k.constructor=x,w(k,C.prototype),k.isPureReactComponent=!0;var D=Array.isArray,U=Object.prototype.hasOwnProperty,W={current:null},P={key:!0,ref:!0,__self:!0,__source:!0};function F(M,j,oe){var ce,de={},fe=null,we=null;if(j!=null)for(ce in j.ref!==void 0&&(we=j.ref),j.key!==void 0&&(fe=""+j.key),j)U.call(j,ce)&&!P.hasOwnProperty(ce)&&(de[ce]=j[ce]);var Ce=arguments.length-2;if(Ce===1)de.children=oe;else if(1<Ce){for(var De=Array(Ce),Je=0;Je<Ce;Je++)De[Je]=arguments[Je+2];de.children=De}if(M&&M.defaultProps)for(ce in Ce=M.defaultProps,Ce)de[ce]===void 0&&(de[ce]=Ce[ce]);return{$$typeof:e,type:M,key:fe,ref:we,props:de,_owner:W.current}}function Q(M,j){return{$$typeof:e,type:M.type,key:j,ref:M.ref,props:M.props,_owner:M._owner}}function K(M){return typeof M=="object"&&M!==null&&M.$$typeof===e}function q(M){var j={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(oe){return j[oe]})}var I=/\/+/g;function O(M,j){return typeof M=="object"&&M!==null&&M.key!=null?q(""+M.key):j.toString(36)}function H(M,j,oe,ce,de){var fe=typeof M;(fe==="undefined"||fe==="boolean")&&(M=null);var we=!1;if(M===null)we=!0;else switch(fe){case"string":case"number":we=!0;break;case"object":switch(M.$$typeof){case e:case t:we=!0}}if(we)return we=M,de=de(we),M=ce===""?"."+O(we,0):ce,D(de)?(oe="",M!=null&&(oe=M.replace(I,"$&/")+"/"),H(de,j,oe,"",function(Je){return Je})):de!=null&&(K(de)&&(de=Q(de,oe+(!de.key||we&&we.key===de.key?"":(""+de.key).replace(I,"$&/")+"/")+M)),j.push(de)),1;if(we=0,ce=ce===""?".":ce+":",D(M))for(var Ce=0;Ce<M.length;Ce++){fe=M[Ce];var De=ce+O(fe,Ce);we+=H(fe,j,oe,De,de)}else if(De=y(M),typeof De=="function")for(M=De.call(M),Ce=0;!(fe=M.next()).done;)fe=fe.value,De=ce+O(fe,Ce++),we+=H(fe,j,oe,De,de);else if(fe==="object")throw j=String(M),Error("Objects are not valid as a React child (found: "+(j==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":j)+"). If you meant to render a collection of children, use an array instead.");return we}function $(M,j,oe){if(M==null)return M;var ce=[],de=0;return H(M,ce,"","",function(fe){return j.call(oe,fe,de++)}),ce}function G(M){if(M._status===-1){var j=M._result;j=j(),j.then(function(oe){(M._status===0||M._status===-1)&&(M._status=1,M._result=oe)},function(oe){(M._status===0||M._status===-1)&&(M._status=2,M._result=oe)}),M._status===-1&&(M._status=0,M._result=j)}if(M._status===1)return M._result.default;throw M._result}var ie={current:null},B={transition:null},ee={ReactCurrentDispatcher:ie,ReactCurrentBatchConfig:B,ReactCurrentOwner:W};function Z(){throw Error("act(...) is not supported in production builds of React.")}return Te.Children={map:$,forEach:function(M,j,oe){$(M,function(){j.apply(this,arguments)},oe)},count:function(M){var j=0;return $(M,function(){j++}),j},toArray:function(M){return $(M,function(j){return j})||[]},only:function(M){if(!K(M))throw Error("React.Children.only expected to receive a single React element child.");return M}},Te.Component=C,Te.Fragment=r,Te.Profiler=o,Te.PureComponent=x,Te.StrictMode=n,Te.Suspense=f,Te.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ee,Te.act=Z,Te.cloneElement=function(M,j,oe){if(M==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+M+".");var ce=w({},M.props),de=M.key,fe=M.ref,we=M._owner;if(j!=null){if(j.ref!==void 0&&(fe=j.ref,we=W.current),j.key!==void 0&&(de=""+j.key),M.type&&M.type.defaultProps)var Ce=M.type.defaultProps;for(De in j)U.call(j,De)&&!P.hasOwnProperty(De)&&(ce[De]=j[De]===void 0&&Ce!==void 0?Ce[De]:j[De])}var De=arguments.length-2;if(De===1)ce.children=oe;else if(1<De){Ce=Array(De);for(var Je=0;Je<De;Je++)Ce[Je]=arguments[Je+2];ce.children=Ce}return{$$typeof:e,type:M.type,key:de,ref:fe,props:ce,_owner:we}},Te.createContext=function(M){return M={$$typeof:u,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},M.Provider={$$typeof:a,_context:M},M.Consumer=M},Te.createElement=F,Te.createFactory=function(M){var j=F.bind(null,M);return j.type=M,j},Te.createRef=function(){return{current:null}},Te.forwardRef=function(M){return{$$typeof:h,render:M}},Te.isValidElement=K,Te.lazy=function(M){return{$$typeof:g,_payload:{_status:-1,_result:M},_init:G}},Te.memo=function(M,j){return{$$typeof:d,type:M,compare:j===void 0?null:j}},Te.startTransition=function(M){var j=B.transition;B.transition={};try{M()}finally{B.transition=j}},Te.unstable_act=Z,Te.useCallback=function(M,j){return ie.current.useCallback(M,j)},Te.useContext=function(M){return ie.current.useContext(M)},Te.useDebugValue=function(){},Te.useDeferredValue=function(M){return ie.current.useDeferredValue(M)},Te.useEffect=function(M,j){return ie.current.useEffect(M,j)},Te.useId=function(){return ie.current.useId()},Te.useImperativeHandle=function(M,j,oe){return ie.current.useImperativeHandle(M,j,oe)},Te.useInsertionEffect=function(M,j){return ie.current.useInsertionEffect(M,j)},Te.useLayoutEffect=function(M,j){return ie.current.useLayoutEffect(M,j)},Te.useMemo=function(M,j){return ie.current.useMemo(M,j)},Te.useReducer=function(M,j,oe){return ie.current.useReducer(M,j,oe)},Te.useRef=function(M){return ie.current.useRef(M)},Te.useState=function(M){return ie.current.useState(M)},Te.useSyncExternalStore=function(M,j,oe){return ie.current.useSyncExternalStore(M,j,oe)},Te.useTransition=function(){return ie.current.useTransition()},Te.version="18.3.1",Te}var Vy;function ut(){return Vy||(Vy=1,th.exports=oD()),th.exports}/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Gy;function aD(){if(Gy)return Vs;Gy=1;var e=ut(),t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function u(h,f,d){var g,v={},y=null,m=null;d!==void 0&&(y=""+d),f.key!==void 0&&(y=""+f.key),f.ref!==void 0&&(m=f.ref);for(g in f)n.call(f,g)&&!a.hasOwnProperty(g)&&(v[g]=f[g]);if(h&&h.defaultProps)for(g in f=h.defaultProps,f)v[g]===void 0&&(v[g]=f[g]);return{$$typeof:t,type:h,key:y,ref:m,props:v,_owner:o.current}}return Vs.Fragment=r,Vs.jsx=u,Vs.jsxs=u,Vs}var Yy;function lD(){return Yy||(Yy=1,eh.exports=aD()),eh.exports}var Fe=lD(),ge=ut();const uD=dg(ge);var sl={},rh={exports:{}},Ft={},ih={exports:{}},nh={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var Xy;function cD(){return Xy||(Xy=1,(function(e){function t(B,ee){var Z=B.length;B.push(ee);e:for(;0<Z;){var M=Z-1>>>1,j=B[M];if(0<o(j,ee))B[M]=ee,B[Z]=j,Z=M;else break e}}function r(B){return B.length===0?null:B[0]}function n(B){if(B.length===0)return null;var ee=B[0],Z=B.pop();if(Z!==ee){B[0]=Z;e:for(var M=0,j=B.length,oe=j>>>1;M<oe;){var ce=2*(M+1)-1,de=B[ce],fe=ce+1,we=B[fe];if(0>o(de,Z))fe<j&&0>o(we,de)?(B[M]=we,B[fe]=Z,M=fe):(B[M]=de,B[ce]=Z,M=ce);else if(fe<j&&0>o(we,Z))B[M]=we,B[fe]=Z,M=fe;else break e}}return ee}function o(B,ee){var Z=B.sortIndex-ee.sortIndex;return Z!==0?Z:B.id-ee.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var u=Date,h=u.now();e.unstable_now=function(){return u.now()-h}}var f=[],d=[],g=1,v=null,y=3,m=!1,w=!1,S=!1,C=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function k(B){for(var ee=r(d);ee!==null;){if(ee.callback===null)n(d);else if(ee.startTime<=B)n(d),ee.sortIndex=ee.expirationTime,t(f,ee);else break;ee=r(d)}}function D(B){if(S=!1,k(B),!w)if(r(f)!==null)w=!0,G(U);else{var ee=r(d);ee!==null&&ie(D,ee.startTime-B)}}function U(B,ee){w=!1,S&&(S=!1,E(F),F=-1),m=!0;var Z=y;try{for(k(ee),v=r(f);v!==null&&(!(v.expirationTime>ee)||B&&!q());){var M=v.callback;if(typeof M=="function"){v.callback=null,y=v.priorityLevel;var j=M(v.expirationTime<=ee);ee=e.unstable_now(),typeof j=="function"?v.callback=j:v===r(f)&&n(f),k(ee)}else n(f);v=r(f)}if(v!==null)var oe=!0;else{var ce=r(d);ce!==null&&ie(D,ce.startTime-ee),oe=!1}return oe}finally{v=null,y=Z,m=!1}}var W=!1,P=null,F=-1,Q=5,K=-1;function q(){return!(e.unstable_now()-K<Q)}function I(){if(P!==null){var B=e.unstable_now();K=B;var ee=!0;try{ee=P(!0,B)}finally{ee?O():(W=!1,P=null)}}else W=!1}var O;if(typeof x=="function")O=function(){x(I)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,$=H.port2;H.port1.onmessage=I,O=function(){$.postMessage(null)}}else O=function(){C(I,0)};function G(B){P=B,W||(W=!0,O())}function ie(B,ee){F=C(function(){B(e.unstable_now())},ee)}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(B){B.callback=null},e.unstable_continueExecution=function(){w||m||(w=!0,G(U))},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Q=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_getFirstCallbackNode=function(){return r(f)},e.unstable_next=function(B){switch(y){case 1:case 2:case 3:var ee=3;break;default:ee=y}var Z=y;y=ee;try{return B()}finally{y=Z}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(B,ee){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var Z=y;y=B;try{return ee()}finally{y=Z}},e.unstable_scheduleCallback=function(B,ee,Z){var M=e.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?M+Z:M):Z=M,B){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return j=Z+j,B={id:g++,callback:ee,priorityLevel:B,startTime:Z,expirationTime:j,sortIndex:-1},Z>M?(B.sortIndex=Z,t(d,B),r(f)===null&&B===r(d)&&(S?(E(F),F=-1):S=!0,ie(D,Z-M))):(B.sortIndex=j,t(f,B),w||m||(w=!0,G(U))),B},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(B){var ee=y;return function(){var Z=y;y=ee;try{return B.apply(this,arguments)}finally{y=Z}}}})(nh)),nh}var Zy;function hD(){return Zy||(Zy=1,ih.exports=cD()),ih.exports}/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var Jy;function dD(){if(Jy)return Ft;Jy=1;var e=ut(),t=hD();function r(i){for(var s="https://reactjs.org/docs/error-decoder.html?invariant="+i,l=1;l<arguments.length;l++)s+="&args[]="+encodeURIComponent(arguments[l]);return"Minified React error #"+i+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var n=new Set,o={};function a(i,s){u(i,s),u(i+"Capture",s)}function u(i,s){for(o[i]=s,i=0;i<s.length;i++)n.add(s[i])}var h=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f=Object.prototype.hasOwnProperty,d=/^[: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]*$/,g={},v={};function y(i){return f.call(v,i)?!0:f.call(g,i)?!1:d.test(i)?v[i]=!0:(g[i]=!0,!1)}function m(i,s,l,c){if(l!==null&&l.type===0)return!1;switch(typeof s){case"function":case"symbol":return!0;case"boolean":return c?!1:l!==null?!l.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function w(i,s,l,c){if(s===null||typeof s>"u"||m(i,s,l,c))return!0;if(c)return!1;if(l!==null)switch(l.type){case 3:return!s;case 4:return s===!1;case 5:return isNaN(s);case 6:return isNaN(s)||1>s}return!1}function S(i,s,l,c,p,_,b){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=c,this.attributeNamespace=p,this.mustUseProperty=l,this.propertyName=i,this.type=s,this.sanitizeURL=_,this.removeEmptyString=b}var C={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){C[i]=new S(i,0,!1,i,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var s=i[0];C[s]=new S(s,1,!1,i[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(i){C[i]=new S(i,2,!1,i.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){C[i]=new S(i,2,!1,i,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(i){C[i]=new S(i,3,!1,i.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(i){C[i]=new S(i,3,!0,i,null,!1,!1)}),["capture","download"].forEach(function(i){C[i]=new S(i,4,!1,i,null,!1,!1)}),["cols","rows","size","span"].forEach(function(i){C[i]=new S(i,6,!1,i,null,!1,!1)}),["rowSpan","start"].forEach(function(i){C[i]=new S(i,5,!1,i.toLowerCase(),null,!1,!1)});var E=/[\-:]([a-z])/g;function x(i){return i[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(i){var s=i.replace(E,x);C[s]=new S(s,1,!1,i,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var s=i.replace(E,x);C[s]=new S(s,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(i){var s=i.replace(E,x);C[s]=new S(s,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(i){C[i]=new S(i,1,!1,i.toLowerCase(),null,!1,!1)}),C.xlinkHref=new S("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(i){C[i]=new S(i,1,!1,i.toLowerCase(),null,!0,!0)});function k(i,s,l,c){var p=C.hasOwnProperty(s)?C[s]:null;(p!==null?p.type!==0:c||!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(w(s,l,p,c)&&(l=null),c||p===null?y(s)&&(l===null?i.removeAttribute(s):i.setAttribute(s,""+l)):p.mustUseProperty?i[p.propertyName]=l===null?p.type===3?!1:"":l:(s=p.attributeName,c=p.attributeNamespace,l===null?i.removeAttribute(s):(p=p.type,l=p===3||p===4&&l===!0?"":""+l,c?i.setAttributeNS(c,s,l):i.setAttribute(s,l))))}var D=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,U=Symbol.for("react.element"),W=Symbol.for("react.portal"),P=Symbol.for("react.fragment"),F=Symbol.for("react.strict_mode"),Q=Symbol.for("react.profiler"),K=Symbol.for("react.provider"),q=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),H=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),ie=Symbol.for("react.offscreen"),B=Symbol.iterator;function ee(i){return i===null||typeof i!="object"?null:(i=B&&i[B]||i["@@iterator"],typeof i=="function"?i:null)}var Z=Object.assign,M;function j(i){if(M===void 0)try{throw Error()}catch(l){var s=l.stack.trim().match(/\n( *(at )?)/);M=s&&s[1]||""}return`
|
|
34
|
+
`+M+i}var oe=!1;function ce(i,s){if(!i||oe)return"";oe=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(s)if(s=function(){throw Error()},Object.defineProperty(s.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(s,[])}catch(z){var c=z}Reflect.construct(i,[],s)}else{try{s.call()}catch(z){c=z}i.call(s.prototype)}else{try{throw Error()}catch(z){c=z}i()}}catch(z){if(z&&c&&typeof z.stack=="string"){for(var p=z.stack.split(`
|
|
35
|
+
`),_=c.stack.split(`
|
|
36
|
+
`),b=p.length-1,T=_.length-1;1<=b&&0<=T&&p[b]!==_[T];)T--;for(;1<=b&&0<=T;b--,T--)if(p[b]!==_[T]){if(b!==1||T!==1)do if(b--,T--,0>T||p[b]!==_[T]){var R=`
|
|
37
|
+
`+p[b].replace(" at new "," at ");return i.displayName&&R.includes("<anonymous>")&&(R=R.replace("<anonymous>",i.displayName)),R}while(1<=b&&0<=T);break}}}finally{oe=!1,Error.prepareStackTrace=l}return(i=i?i.displayName||i.name:"")?j(i):""}function de(i){switch(i.tag){case 5:return j(i.type);case 16:return j("Lazy");case 13:return j("Suspense");case 19:return j("SuspenseList");case 0:case 2:case 15:return i=ce(i.type,!1),i;case 11:return i=ce(i.type.render,!1),i;case 1:return i=ce(i.type,!0),i;default:return""}}function fe(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case P:return"Fragment";case W:return"Portal";case Q:return"Profiler";case F:return"StrictMode";case O:return"Suspense";case H:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case q:return(i.displayName||"Context")+".Consumer";case K:return(i._context.displayName||"Context")+".Provider";case I:var s=i.render;return i=i.displayName,i||(i=s.displayName||s.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case $:return s=i.displayName||null,s!==null?s:fe(i.type)||"Memo";case G:s=i._payload,i=i._init;try{return fe(i(s))}catch{}}return null}function we(i){var s=i.type;switch(i.tag){case 24:return"Cache";case 9:return(s.displayName||"Context")+".Consumer";case 10:return(s._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=s.render,i=i.displayName||i.name||"",s.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return s;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return fe(s);case 8:return s===F?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s}return null}function Ce(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function De(i){var s=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Je(i){var s=De(i)?"checked":"value",l=Object.getOwnPropertyDescriptor(i.constructor.prototype,s),c=""+i[s];if(!i.hasOwnProperty(s)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var p=l.get,_=l.set;return Object.defineProperty(i,s,{configurable:!0,get:function(){return p.call(this)},set:function(b){c=""+b,_.call(this,b)}}),Object.defineProperty(i,s,{enumerable:l.enumerable}),{getValue:function(){return c},setValue:function(b){c=""+b},stopTracking:function(){i._valueTracker=null,delete i[s]}}}}function Jt(i){i._valueTracker||(i._valueTracker=Je(i))}function zt(i){if(!i)return!1;var s=i._valueTracker;if(!s)return!0;var l=s.getValue(),c="";return i&&(c=De(i)?i.checked?"true":"false":i.value),i=c,i!==l?(s.setValue(i),!0):!1}function ke(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function Yr(i,s){var l=s.checked;return Z({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:l??i._wrapperState.initialChecked})}function Me(i,s){var l=s.defaultValue==null?"":s.defaultValue,c=s.checked!=null?s.checked:s.defaultChecked;l=Ce(s.value!=null?s.value:l),i._wrapperState={initialChecked:c,initialValue:l,controlled:s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null}}function Yi(i,s){s=s.checked,s!=null&&k(i,"checked",s,!1)}function Oe(i,s){Yi(i,s);var l=Ce(s.value),c=s.type;if(l!=null)c==="number"?(l===0&&i.value===""||i.value!=l)&&(i.value=""+l):i.value!==""+l&&(i.value=""+l);else if(c==="submit"||c==="reset"){i.removeAttribute("value");return}s.hasOwnProperty("value")?Ar(i,s.type,l):s.hasOwnProperty("defaultValue")&&Ar(i,s.type,Ce(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(i.defaultChecked=!!s.defaultChecked)}function Xr(i,s,l){if(s.hasOwnProperty("value")||s.hasOwnProperty("defaultValue")){var c=s.type;if(!(c!=="submit"&&c!=="reset"||s.value!==void 0&&s.value!==null))return;s=""+i._wrapperState.initialValue,l||s===i.value||(i.value=s),i.defaultValue=s}l=i.name,l!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,l!==""&&(i.name=l)}function Ar(i,s,l){(s!=="number"||ke(i.ownerDocument)!==i)&&(l==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+l&&(i.defaultValue=""+l))}var Xi=Array.isArray;function vr(i,s,l,c){if(i=i.options,s){s={};for(var p=0;p<l.length;p++)s["$"+l[p]]=!0;for(l=0;l<i.length;l++)p=s.hasOwnProperty("$"+i[l].value),i[l].selected!==p&&(i[l].selected=p),p&&c&&(i[l].defaultSelected=!0)}else{for(l=""+Ce(l),s=null,p=0;p<i.length;p++){if(i[p].value===l){i[p].selected=!0,c&&(i[p].defaultSelected=!0);return}s!==null||i[p].disabled||(s=i[p])}s!==null&&(s.selected=!0)}}function Qt(i,s){if(s.dangerouslySetInnerHTML!=null)throw Error(r(91));return Z({},s,{value:void 0,defaultValue:void 0,children:""+i._wrapperState.initialValue})}function mt(i,s){var l=s.value;if(l==null){if(l=s.children,s=s.defaultValue,l!=null){if(s!=null)throw Error(r(92));if(Xi(l)){if(1<l.length)throw Error(r(93));l=l[0]}s=l}s==null&&(s=""),l=s}i._wrapperState={initialValue:Ce(l)}}function Zi(i,s){var l=Ce(s.value),c=Ce(s.defaultValue);l!=null&&(l=""+l,l!==i.value&&(i.value=l),s.defaultValue==null&&i.defaultValue!==l&&(i.defaultValue=l)),c!=null&&(i.defaultValue=""+c)}function Ji(i){var s=i.textContent;s===i._wrapperState.initialValue&&s!==""&&s!==null&&(i.value=s)}function Yo(i){switch(i){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function On(i,s){return i==null||i==="http://www.w3.org/1999/xhtml"?Yo(s):i==="http://www.w3.org/2000/svg"&&s==="foreignObject"?"http://www.w3.org/1999/xhtml":i}var mr,cs=(function(i){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(s,l,c,p){MSApp.execUnsafeLocalFunction(function(){return i(s,l,c,p)})}:i})(function(i,s){if(i.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in i)i.innerHTML=s;else{for(mr=mr||document.createElement("div"),mr.innerHTML="<svg>"+s.valueOf().toString()+"</svg>",s=mr.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;s.firstChild;)i.appendChild(s.firstChild)}});function mi(i,s){if(s){var l=i.firstChild;if(l&&l===i.lastChild&&l.nodeType===3){l.nodeValue=s;return}}i.textContent=s}var Qi={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Xo=["Webkit","ms","Moz","O"];Object.keys(Qi).forEach(function(i){Xo.forEach(function(s){s=s+i.charAt(0).toUpperCase()+i.substring(1),Qi[s]=Qi[i]})});function yr(i,s,l){return s==null||typeof s=="boolean"||s===""?"":l||typeof s!="number"||s===0||Qi.hasOwnProperty(i)&&Qi[i]?(""+s).trim():s+"px"}function Ir(i,s){i=i.style;for(var l in s)if(s.hasOwnProperty(l)){var c=l.indexOf("--")===0,p=yr(l,s[l],c);l==="float"&&(l="cssFloat"),c?i.setProperty(l,p):i[l]=p}}var hT=Z({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function du(i,s){if(s){if(hT[i]&&(s.children!=null||s.dangerouslySetInnerHTML!=null))throw Error(r(137,i));if(s.dangerouslySetInnerHTML!=null){if(s.children!=null)throw Error(r(60));if(typeof s.dangerouslySetInnerHTML!="object"||!("__html"in s.dangerouslySetInnerHTML))throw Error(r(61))}if(s.style!=null&&typeof s.style!="object")throw Error(r(62))}}function fu(i,s){if(i.indexOf("-")===-1)return typeof s.is=="string";switch(i){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 pu=null;function _u(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var gu=null,Rn=null,Pn=null;function uv(i){if(i=Ms(i)){if(typeof gu!="function")throw Error(r(280));var s=i.stateNode;s&&(s=ya(s),gu(i.stateNode,i.type,s))}}function cv(i){Rn?Pn?Pn.push(i):Pn=[i]:Rn=i}function hv(){if(Rn){var i=Rn,s=Pn;if(Pn=Rn=null,uv(i),s)for(i=0;i<s.length;i++)uv(s[i])}}function dv(i,s){return i(s)}function fv(){}var vu=!1;function pv(i,s,l){if(vu)return i(s,l);vu=!0;try{return dv(i,s,l)}finally{vu=!1,(Rn!==null||Pn!==null)&&(fv(),hv())}}function hs(i,s){var l=i.stateNode;if(l===null)return null;var c=ya(l);if(c===null)return null;l=c[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":(c=!c.disabled)||(i=i.type,c=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!c;break e;default:i=!1}if(i)return null;if(l&&typeof l!="function")throw Error(r(231,s,typeof l));return l}var mu=!1;if(h)try{var ds={};Object.defineProperty(ds,"passive",{get:function(){mu=!0}}),window.addEventListener("test",ds,ds),window.removeEventListener("test",ds,ds)}catch{mu=!1}function dT(i,s,l,c,p,_,b,T,R){var z=Array.prototype.slice.call(arguments,3);try{s.apply(l,z)}catch(X){this.onError(X)}}var fs=!1,Zo=null,Jo=!1,yu=null,fT={onError:function(i){fs=!0,Zo=i}};function pT(i,s,l,c,p,_,b,T,R){fs=!1,Zo=null,dT.apply(fT,arguments)}function _T(i,s,l,c,p,_,b,T,R){if(pT.apply(this,arguments),fs){if(fs){var z=Zo;fs=!1,Zo=null}else throw Error(r(198));Jo||(Jo=!0,yu=z)}}function en(i){var s=i,l=i;if(i.alternate)for(;s.return;)s=s.return;else{i=s;do s=i,(s.flags&4098)!==0&&(l=s.return),i=s.return;while(i)}return s.tag===3?l:null}function _v(i){if(i.tag===13){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function gv(i){if(en(i)!==i)throw Error(r(188))}function gT(i){var s=i.alternate;if(!s){if(s=en(i),s===null)throw Error(r(188));return s!==i?null:i}for(var l=i,c=s;;){var p=l.return;if(p===null)break;var _=p.alternate;if(_===null){if(c=p.return,c!==null){l=c;continue}break}if(p.child===_.child){for(_=p.child;_;){if(_===l)return gv(p),i;if(_===c)return gv(p),s;_=_.sibling}throw Error(r(188))}if(l.return!==c.return)l=p,c=_;else{for(var b=!1,T=p.child;T;){if(T===l){b=!0,l=p,c=_;break}if(T===c){b=!0,c=p,l=_;break}T=T.sibling}if(!b){for(T=_.child;T;){if(T===l){b=!0,l=_,c=p;break}if(T===c){b=!0,c=_,l=p;break}T=T.sibling}if(!b)throw Error(r(189))}}if(l.alternate!==c)throw Error(r(190))}if(l.tag!==3)throw Error(r(188));return l.stateNode.current===l?i:s}function vv(i){return i=gT(i),i!==null?mv(i):null}function mv(i){if(i.tag===5||i.tag===6)return i;for(i=i.child;i!==null;){var s=mv(i);if(s!==null)return s;i=i.sibling}return null}var yv=t.unstable_scheduleCallback,Sv=t.unstable_cancelCallback,vT=t.unstable_shouldYield,mT=t.unstable_requestPaint,Ye=t.unstable_now,yT=t.unstable_getCurrentPriorityLevel,Su=t.unstable_ImmediatePriority,wv=t.unstable_UserBlockingPriority,Qo=t.unstable_NormalPriority,ST=t.unstable_LowPriority,Cv=t.unstable_IdlePriority,ea=null,Lr=null;function wT(i){if(Lr&&typeof Lr.onCommitFiberRoot=="function")try{Lr.onCommitFiberRoot(ea,i,void 0,(i.current.flags&128)===128)}catch{}}var Sr=Math.clz32?Math.clz32:ET,CT=Math.log,bT=Math.LN2;function ET(i){return i>>>=0,i===0?32:31-(CT(i)/bT|0)|0}var ta=64,ra=4194304;function ps(i){switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function ia(i,s){var l=i.pendingLanes;if(l===0)return 0;var c=0,p=i.suspendedLanes,_=i.pingedLanes,b=l&268435455;if(b!==0){var T=b&~p;T!==0?c=ps(T):(_&=b,_!==0&&(c=ps(_)))}else b=l&~p,b!==0?c=ps(b):_!==0&&(c=ps(_));if(c===0)return 0;if(s!==0&&s!==c&&(s&p)===0&&(p=c&-c,_=s&-s,p>=_||p===16&&(_&4194240)!==0))return s;if((c&4)!==0&&(c|=l&16),s=i.entangledLanes,s!==0)for(i=i.entanglements,s&=c;0<s;)l=31-Sr(s),p=1<<l,c|=i[l],s&=~p;return c}function xT(i,s){switch(i){case 1:case 2:case 4:return s+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function TT(i,s){for(var l=i.suspendedLanes,c=i.pingedLanes,p=i.expirationTimes,_=i.pendingLanes;0<_;){var b=31-Sr(_),T=1<<b,R=p[b];R===-1?((T&l)===0||(T&c)!==0)&&(p[b]=xT(T,s)):R<=s&&(i.expiredLanes|=T),_&=~T}}function wu(i){return i=i.pendingLanes&-1073741825,i!==0?i:i&1073741824?1073741824:0}function bv(){var i=ta;return ta<<=1,(ta&4194240)===0&&(ta=64),i}function Cu(i){for(var s=[],l=0;31>l;l++)s.push(i);return s}function _s(i,s,l){i.pendingLanes|=s,s!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,s=31-Sr(s),i[s]=l}function kT(i,s){var l=i.pendingLanes&~s;i.pendingLanes=s,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=s,i.mutableReadLanes&=s,i.entangledLanes&=s,s=i.entanglements;var c=i.eventTimes;for(i=i.expirationTimes;0<l;){var p=31-Sr(l),_=1<<p;s[p]=0,c[p]=-1,i[p]=-1,l&=~_}}function bu(i,s){var l=i.entangledLanes|=s;for(i=i.entanglements;l;){var c=31-Sr(l),p=1<<c;p&s|i[c]&s&&(i[c]|=s),l&=~p}}var Ae=0;function Ev(i){return i&=-i,1<i?4<i?(i&268435455)!==0?16:536870912:4:1}var xv,Eu,Tv,kv,Dv,xu=!1,na=[],yi=null,Si=null,wi=null,gs=new Map,vs=new Map,Ci=[],DT="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Ov(i,s){switch(i){case"focusin":case"focusout":yi=null;break;case"dragenter":case"dragleave":Si=null;break;case"mouseover":case"mouseout":wi=null;break;case"pointerover":case"pointerout":gs.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":vs.delete(s.pointerId)}}function ms(i,s,l,c,p,_){return i===null||i.nativeEvent!==_?(i={blockedOn:s,domEventName:l,eventSystemFlags:c,nativeEvent:_,targetContainers:[p]},s!==null&&(s=Ms(s),s!==null&&Eu(s)),i):(i.eventSystemFlags|=c,s=i.targetContainers,p!==null&&s.indexOf(p)===-1&&s.push(p),i)}function OT(i,s,l,c,p){switch(s){case"focusin":return yi=ms(yi,i,s,l,c,p),!0;case"dragenter":return Si=ms(Si,i,s,l,c,p),!0;case"mouseover":return wi=ms(wi,i,s,l,c,p),!0;case"pointerover":var _=p.pointerId;return gs.set(_,ms(gs.get(_)||null,i,s,l,c,p)),!0;case"gotpointercapture":return _=p.pointerId,vs.set(_,ms(vs.get(_)||null,i,s,l,c,p)),!0}return!1}function Rv(i){var s=tn(i.target);if(s!==null){var l=en(s);if(l!==null){if(s=l.tag,s===13){if(s=_v(l),s!==null){i.blockedOn=s,Dv(i.priority,function(){Tv(l)});return}}else if(s===3&&l.stateNode.current.memoizedState.isDehydrated){i.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}i.blockedOn=null}function sa(i){if(i.blockedOn!==null)return!1;for(var s=i.targetContainers;0<s.length;){var l=ku(i.domEventName,i.eventSystemFlags,s[0],i.nativeEvent);if(l===null){l=i.nativeEvent;var c=new l.constructor(l.type,l);pu=c,l.target.dispatchEvent(c),pu=null}else return s=Ms(l),s!==null&&Eu(s),i.blockedOn=l,!1;s.shift()}return!0}function Pv(i,s,l){sa(i)&&l.delete(s)}function RT(){xu=!1,yi!==null&&sa(yi)&&(yi=null),Si!==null&&sa(Si)&&(Si=null),wi!==null&&sa(wi)&&(wi=null),gs.forEach(Pv),vs.forEach(Pv)}function ys(i,s){i.blockedOn===s&&(i.blockedOn=null,xu||(xu=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,RT)))}function Ss(i){function s(p){return ys(p,i)}if(0<na.length){ys(na[0],i);for(var l=1;l<na.length;l++){var c=na[l];c.blockedOn===i&&(c.blockedOn=null)}}for(yi!==null&&ys(yi,i),Si!==null&&ys(Si,i),wi!==null&&ys(wi,i),gs.forEach(s),vs.forEach(s),l=0;l<Ci.length;l++)c=Ci[l],c.blockedOn===i&&(c.blockedOn=null);for(;0<Ci.length&&(l=Ci[0],l.blockedOn===null);)Rv(l),l.blockedOn===null&&Ci.shift()}var Mn=D.ReactCurrentBatchConfig,oa=!0;function PT(i,s,l,c){var p=Ae,_=Mn.transition;Mn.transition=null;try{Ae=1,Tu(i,s,l,c)}finally{Ae=p,Mn.transition=_}}function MT(i,s,l,c){var p=Ae,_=Mn.transition;Mn.transition=null;try{Ae=4,Tu(i,s,l,c)}finally{Ae=p,Mn.transition=_}}function Tu(i,s,l,c){if(oa){var p=ku(i,s,l,c);if(p===null)ju(i,s,c,aa,l),Ov(i,c);else if(OT(p,i,s,l,c))c.stopPropagation();else if(Ov(i,c),s&4&&-1<DT.indexOf(i)){for(;p!==null;){var _=Ms(p);if(_!==null&&xv(_),_=ku(i,s,l,c),_===null&&ju(i,s,c,aa,l),_===p)break;p=_}p!==null&&c.stopPropagation()}else ju(i,s,c,null,l)}}var aa=null;function ku(i,s,l,c){if(aa=null,i=_u(c),i=tn(i),i!==null)if(s=en(i),s===null)i=null;else if(l=s.tag,l===13){if(i=_v(s),i!==null)return i;i=null}else if(l===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;i=null}else s!==i&&(i=null);return aa=i,null}function Mv(i){switch(i){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(yT()){case Su:return 1;case wv:return 4;case Qo:case ST:return 16;case Cv:return 536870912;default:return 16}default:return 16}}var bi=null,Du=null,la=null;function Av(){if(la)return la;var i,s=Du,l=s.length,c,p="value"in bi?bi.value:bi.textContent,_=p.length;for(i=0;i<l&&s[i]===p[i];i++);var b=l-i;for(c=1;c<=b&&s[l-c]===p[_-c];c++);return la=p.slice(i,1<c?1-c:void 0)}function ua(i){var s=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&s===13&&(i=13)):i=s,i===10&&(i=13),32<=i||i===13?i:0}function ca(){return!0}function Iv(){return!1}function Wt(i){function s(l,c,p,_,b){this._reactName=l,this._targetInst=p,this.type=c,this.nativeEvent=_,this.target=b,this.currentTarget=null;for(var T in i)i.hasOwnProperty(T)&&(l=i[T],this[T]=l?l(_):_[T]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?ca:Iv,this.isPropagationStopped=Iv,this}return Z(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=ca)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=ca)},persist:function(){},isPersistent:ca}),s}var An={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ou=Wt(An),ws=Z({},An,{view:0,detail:0}),AT=Wt(ws),Ru,Pu,Cs,ha=Z({},ws,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Au,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Cs&&(Cs&&i.type==="mousemove"?(Ru=i.screenX-Cs.screenX,Pu=i.screenY-Cs.screenY):Pu=Ru=0,Cs=i),Ru)},movementY:function(i){return"movementY"in i?i.movementY:Pu}}),Lv=Wt(ha),IT=Z({},ha,{dataTransfer:0}),LT=Wt(IT),BT=Z({},ws,{relatedTarget:0}),Mu=Wt(BT),NT=Z({},An,{animationName:0,elapsedTime:0,pseudoElement:0}),qT=Wt(NT),FT=Z({},An,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),HT=Wt(FT),zT=Z({},An,{data:0}),Bv=Wt(zT),WT={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},UT={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"},jT={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $T(i){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(i):(i=jT[i])?!!s[i]:!1}function Au(){return $T}var KT=Z({},ws,{key:function(i){if(i.key){var s=WT[i.key]||i.key;if(s!=="Unidentified")return s}return i.type==="keypress"?(i=ua(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?UT[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Au,charCode:function(i){return i.type==="keypress"?ua(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?ua(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),VT=Wt(KT),GT=Z({},ha,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Nv=Wt(GT),YT=Z({},ws,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Au}),XT=Wt(YT),ZT=Z({},An,{propertyName:0,elapsedTime:0,pseudoElement:0}),JT=Wt(ZT),QT=Z({},ha,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),ek=Wt(QT),tk=[9,13,27,32],Iu=h&&"CompositionEvent"in window,bs=null;h&&"documentMode"in document&&(bs=document.documentMode);var rk=h&&"TextEvent"in window&&!bs,qv=h&&(!Iu||bs&&8<bs&&11>=bs),Fv=" ",Hv=!1;function zv(i,s){switch(i){case"keyup":return tk.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wv(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var In=!1;function ik(i,s){switch(i){case"compositionend":return Wv(s);case"keypress":return s.which!==32?null:(Hv=!0,Fv);case"textInput":return i=s.data,i===Fv&&Hv?null:i;default:return null}}function nk(i,s){if(In)return i==="compositionend"||!Iu&&zv(i,s)?(i=Av(),la=Du=bi=null,In=!1,i):null;switch(i){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 qv&&s.locale!=="ko"?null:s.data;default:return null}}var sk={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 Uv(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s==="input"?!!sk[i.type]:s==="textarea"}function jv(i,s,l,c){cv(c),s=ga(s,"onChange"),0<s.length&&(l=new Ou("onChange","change",null,l,c),i.push({event:l,listeners:s}))}var Es=null,xs=null;function ok(i){lm(i,0)}function da(i){var s=Fn(i);if(zt(s))return i}function ak(i,s){if(i==="change")return s}var $v=!1;if(h){var Lu;if(h){var Bu="oninput"in document;if(!Bu){var Kv=document.createElement("div");Kv.setAttribute("oninput","return;"),Bu=typeof Kv.oninput=="function"}Lu=Bu}else Lu=!1;$v=Lu&&(!document.documentMode||9<document.documentMode)}function Vv(){Es&&(Es.detachEvent("onpropertychange",Gv),xs=Es=null)}function Gv(i){if(i.propertyName==="value"&&da(xs)){var s=[];jv(s,xs,i,_u(i)),pv(ok,s)}}function lk(i,s,l){i==="focusin"?(Vv(),Es=s,xs=l,Es.attachEvent("onpropertychange",Gv)):i==="focusout"&&Vv()}function uk(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return da(xs)}function ck(i,s){if(i==="click")return da(s)}function hk(i,s){if(i==="input"||i==="change")return da(s)}function dk(i,s){return i===s&&(i!==0||1/i===1/s)||i!==i&&s!==s}var wr=typeof Object.is=="function"?Object.is:dk;function Ts(i,s){if(wr(i,s))return!0;if(typeof i!="object"||i===null||typeof s!="object"||s===null)return!1;var l=Object.keys(i),c=Object.keys(s);if(l.length!==c.length)return!1;for(c=0;c<l.length;c++){var p=l[c];if(!f.call(s,p)||!wr(i[p],s[p]))return!1}return!0}function Yv(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function Xv(i,s){var l=Yv(i);i=0;for(var c;l;){if(l.nodeType===3){if(c=i+l.textContent.length,i<=s&&c>=s)return{node:l,offset:s-i};i=c}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Yv(l)}}function Zv(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?Zv(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function Jv(){for(var i=window,s=ke();s instanceof i.HTMLIFrameElement;){try{var l=typeof s.contentWindow.location.href=="string"}catch{l=!1}if(l)i=s.contentWindow;else break;s=ke(i.document)}return s}function Nu(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s&&(s==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||s==="textarea"||i.contentEditable==="true")}function fk(i){var s=Jv(),l=i.focusedElem,c=i.selectionRange;if(s!==l&&l&&l.ownerDocument&&Zv(l.ownerDocument.documentElement,l)){if(c!==null&&Nu(l)){if(s=c.start,i=c.end,i===void 0&&(i=s),"selectionStart"in l)l.selectionStart=s,l.selectionEnd=Math.min(i,l.value.length);else if(i=(s=l.ownerDocument||document)&&s.defaultView||window,i.getSelection){i=i.getSelection();var p=l.textContent.length,_=Math.min(c.start,p);c=c.end===void 0?_:Math.min(c.end,p),!i.extend&&_>c&&(p=c,c=_,_=p),p=Xv(l,_);var b=Xv(l,c);p&&b&&(i.rangeCount!==1||i.anchorNode!==p.node||i.anchorOffset!==p.offset||i.focusNode!==b.node||i.focusOffset!==b.offset)&&(s=s.createRange(),s.setStart(p.node,p.offset),i.removeAllRanges(),_>c?(i.addRange(s),i.extend(b.node,b.offset)):(s.setEnd(b.node,b.offset),i.addRange(s)))}}for(s=[],i=l;i=i.parentNode;)i.nodeType===1&&s.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<s.length;l++)i=s[l],i.element.scrollLeft=i.left,i.element.scrollTop=i.top}}var pk=h&&"documentMode"in document&&11>=document.documentMode,Ln=null,qu=null,ks=null,Fu=!1;function Qv(i,s,l){var c=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Fu||Ln==null||Ln!==ke(c)||(c=Ln,"selectionStart"in c&&Nu(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),ks&&Ts(ks,c)||(ks=c,c=ga(qu,"onSelect"),0<c.length&&(s=new Ou("onSelect","select",null,s,l),i.push({event:s,listeners:c}),s.target=Ln)))}function fa(i,s){var l={};return l[i.toLowerCase()]=s.toLowerCase(),l["Webkit"+i]="webkit"+s,l["Moz"+i]="moz"+s,l}var Bn={animationend:fa("Animation","AnimationEnd"),animationiteration:fa("Animation","AnimationIteration"),animationstart:fa("Animation","AnimationStart"),transitionend:fa("Transition","TransitionEnd")},Hu={},em={};h&&(em=document.createElement("div").style,"AnimationEvent"in window||(delete Bn.animationend.animation,delete Bn.animationiteration.animation,delete Bn.animationstart.animation),"TransitionEvent"in window||delete Bn.transitionend.transition);function pa(i){if(Hu[i])return Hu[i];if(!Bn[i])return i;var s=Bn[i],l;for(l in s)if(s.hasOwnProperty(l)&&l in em)return Hu[i]=s[l];return i}var tm=pa("animationend"),rm=pa("animationiteration"),im=pa("animationstart"),nm=pa("transitionend"),sm=new Map,om="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Ei(i,s){sm.set(i,s),a(s,[i])}for(var zu=0;zu<om.length;zu++){var Wu=om[zu],_k=Wu.toLowerCase(),gk=Wu[0].toUpperCase()+Wu.slice(1);Ei(_k,"on"+gk)}Ei(tm,"onAnimationEnd"),Ei(rm,"onAnimationIteration"),Ei(im,"onAnimationStart"),Ei("dblclick","onDoubleClick"),Ei("focusin","onFocus"),Ei("focusout","onBlur"),Ei(nm,"onTransitionEnd"),u("onMouseEnter",["mouseout","mouseover"]),u("onMouseLeave",["mouseout","mouseover"]),u("onPointerEnter",["pointerout","pointerover"]),u("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ds="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(" "),vk=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ds));function am(i,s,l){var c=i.type||"unknown-event";i.currentTarget=l,_T(c,s,void 0,i),i.currentTarget=null}function lm(i,s){s=(s&4)!==0;for(var l=0;l<i.length;l++){var c=i[l],p=c.event;c=c.listeners;e:{var _=void 0;if(s)for(var b=c.length-1;0<=b;b--){var T=c[b],R=T.instance,z=T.currentTarget;if(T=T.listener,R!==_&&p.isPropagationStopped())break e;am(p,T,z),_=R}else for(b=0;b<c.length;b++){if(T=c[b],R=T.instance,z=T.currentTarget,T=T.listener,R!==_&&p.isPropagationStopped())break e;am(p,T,z),_=R}}}if(Jo)throw i=yu,Jo=!1,yu=null,i}function Be(i,s){var l=s[Xu];l===void 0&&(l=s[Xu]=new Set);var c=i+"__bubble";l.has(c)||(um(s,i,2,!1),l.add(c))}function Uu(i,s,l){var c=0;s&&(c|=4),um(l,i,c,s)}var _a="_reactListening"+Math.random().toString(36).slice(2);function Os(i){if(!i[_a]){i[_a]=!0,n.forEach(function(l){l!=="selectionchange"&&(vk.has(l)||Uu(l,!1,i),Uu(l,!0,i))});var s=i.nodeType===9?i:i.ownerDocument;s===null||s[_a]||(s[_a]=!0,Uu("selectionchange",!1,s))}}function um(i,s,l,c){switch(Mv(s)){case 1:var p=PT;break;case 4:p=MT;break;default:p=Tu}l=p.bind(null,s,l,i),p=void 0,!mu||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(p=!0),c?p!==void 0?i.addEventListener(s,l,{capture:!0,passive:p}):i.addEventListener(s,l,!0):p!==void 0?i.addEventListener(s,l,{passive:p}):i.addEventListener(s,l,!1)}function ju(i,s,l,c,p){var _=c;if((s&1)===0&&(s&2)===0&&c!==null)e:for(;;){if(c===null)return;var b=c.tag;if(b===3||b===4){var T=c.stateNode.containerInfo;if(T===p||T.nodeType===8&&T.parentNode===p)break;if(b===4)for(b=c.return;b!==null;){var R=b.tag;if((R===3||R===4)&&(R=b.stateNode.containerInfo,R===p||R.nodeType===8&&R.parentNode===p))return;b=b.return}for(;T!==null;){if(b=tn(T),b===null)return;if(R=b.tag,R===5||R===6){c=_=b;continue e}T=T.parentNode}}c=c.return}pv(function(){var z=_,X=_u(l),J=[];e:{var Y=sm.get(i);if(Y!==void 0){var se=Ou,le=i;switch(i){case"keypress":if(ua(l)===0)break e;case"keydown":case"keyup":se=VT;break;case"focusin":le="focus",se=Mu;break;case"focusout":le="blur",se=Mu;break;case"beforeblur":case"afterblur":se=Mu;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":se=Lv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":se=LT;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":se=XT;break;case tm:case rm:case im:se=qT;break;case nm:se=JT;break;case"scroll":se=AT;break;case"wheel":se=ek;break;case"copy":case"cut":case"paste":se=HT;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":se=Nv}var ue=(s&4)!==0,Xe=!ue&&i==="scroll",L=ue?Y!==null?Y+"Capture":null:Y;ue=[];for(var A=z,N;A!==null;){N=A;var te=N.stateNode;if(N.tag===5&&te!==null&&(N=te,L!==null&&(te=hs(A,L),te!=null&&ue.push(Rs(A,te,N)))),Xe)break;A=A.return}0<ue.length&&(Y=new se(Y,le,null,l,X),J.push({event:Y,listeners:ue}))}}if((s&7)===0){e:{if(Y=i==="mouseover"||i==="pointerover",se=i==="mouseout"||i==="pointerout",Y&&l!==pu&&(le=l.relatedTarget||l.fromElement)&&(tn(le)||le[Zr]))break e;if((se||Y)&&(Y=X.window===X?X:(Y=X.ownerDocument)?Y.defaultView||Y.parentWindow:window,se?(le=l.relatedTarget||l.toElement,se=z,le=le?tn(le):null,le!==null&&(Xe=en(le),le!==Xe||le.tag!==5&&le.tag!==6)&&(le=null)):(se=null,le=z),se!==le)){if(ue=Lv,te="onMouseLeave",L="onMouseEnter",A="mouse",(i==="pointerout"||i==="pointerover")&&(ue=Nv,te="onPointerLeave",L="onPointerEnter",A="pointer"),Xe=se==null?Y:Fn(se),N=le==null?Y:Fn(le),Y=new ue(te,A+"leave",se,l,X),Y.target=Xe,Y.relatedTarget=N,te=null,tn(X)===z&&(ue=new ue(L,A+"enter",le,l,X),ue.target=N,ue.relatedTarget=Xe,te=ue),Xe=te,se&&le)t:{for(ue=se,L=le,A=0,N=ue;N;N=Nn(N))A++;for(N=0,te=L;te;te=Nn(te))N++;for(;0<A-N;)ue=Nn(ue),A--;for(;0<N-A;)L=Nn(L),N--;for(;A--;){if(ue===L||L!==null&&ue===L.alternate)break t;ue=Nn(ue),L=Nn(L)}ue=null}else ue=null;se!==null&&cm(J,Y,se,ue,!1),le!==null&&Xe!==null&&cm(J,Xe,le,ue,!0)}}e:{if(Y=z?Fn(z):window,se=Y.nodeName&&Y.nodeName.toLowerCase(),se==="select"||se==="input"&&Y.type==="file")var he=ak;else if(Uv(Y))if($v)he=hk;else{he=uk;var pe=lk}else(se=Y.nodeName)&&se.toLowerCase()==="input"&&(Y.type==="checkbox"||Y.type==="radio")&&(he=ck);if(he&&(he=he(i,z))){jv(J,he,l,X);break e}pe&&pe(i,Y,z),i==="focusout"&&(pe=Y._wrapperState)&&pe.controlled&&Y.type==="number"&&Ar(Y,"number",Y.value)}switch(pe=z?Fn(z):window,i){case"focusin":(Uv(pe)||pe.contentEditable==="true")&&(Ln=pe,qu=z,ks=null);break;case"focusout":ks=qu=Ln=null;break;case"mousedown":Fu=!0;break;case"contextmenu":case"mouseup":case"dragend":Fu=!1,Qv(J,l,X);break;case"selectionchange":if(pk)break;case"keydown":case"keyup":Qv(J,l,X)}var _e;if(Iu)e:{switch(i){case"compositionstart":var ve="onCompositionStart";break e;case"compositionend":ve="onCompositionEnd";break e;case"compositionupdate":ve="onCompositionUpdate";break e}ve=void 0}else In?zv(i,l)&&(ve="onCompositionEnd"):i==="keydown"&&l.keyCode===229&&(ve="onCompositionStart");ve&&(qv&&l.locale!=="ko"&&(In||ve!=="onCompositionStart"?ve==="onCompositionEnd"&&In&&(_e=Av()):(bi=X,Du="value"in bi?bi.value:bi.textContent,In=!0)),pe=ga(z,ve),0<pe.length&&(ve=new Bv(ve,i,null,l,X),J.push({event:ve,listeners:pe}),_e?ve.data=_e:(_e=Wv(l),_e!==null&&(ve.data=_e)))),(_e=rk?ik(i,l):nk(i,l))&&(z=ga(z,"onBeforeInput"),0<z.length&&(X=new Bv("onBeforeInput","beforeinput",null,l,X),J.push({event:X,listeners:z}),X.data=_e))}lm(J,s)})}function Rs(i,s,l){return{instance:i,listener:s,currentTarget:l}}function ga(i,s){for(var l=s+"Capture",c=[];i!==null;){var p=i,_=p.stateNode;p.tag===5&&_!==null&&(p=_,_=hs(i,l),_!=null&&c.unshift(Rs(i,_,p)),_=hs(i,s),_!=null&&c.push(Rs(i,_,p))),i=i.return}return c}function Nn(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5);return i||null}function cm(i,s,l,c,p){for(var _=s._reactName,b=[];l!==null&&l!==c;){var T=l,R=T.alternate,z=T.stateNode;if(R!==null&&R===c)break;T.tag===5&&z!==null&&(T=z,p?(R=hs(l,_),R!=null&&b.unshift(Rs(l,R,T))):p||(R=hs(l,_),R!=null&&b.push(Rs(l,R,T)))),l=l.return}b.length!==0&&i.push({event:s,listeners:b})}var mk=/\r\n?/g,yk=/\u0000|\uFFFD/g;function hm(i){return(typeof i=="string"?i:""+i).replace(mk,`
|
|
38
|
+
`).replace(yk,"")}function va(i,s,l){if(s=hm(s),hm(i)!==s&&l)throw Error(r(425))}function ma(){}var $u=null,Ku=null;function Vu(i,s){return i==="textarea"||i==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var Gu=typeof setTimeout=="function"?setTimeout:void 0,Sk=typeof clearTimeout=="function"?clearTimeout:void 0,dm=typeof Promise=="function"?Promise:void 0,wk=typeof queueMicrotask=="function"?queueMicrotask:typeof dm<"u"?function(i){return dm.resolve(null).then(i).catch(Ck)}:Gu;function Ck(i){setTimeout(function(){throw i})}function Yu(i,s){var l=s,c=0;do{var p=l.nextSibling;if(i.removeChild(l),p&&p.nodeType===8)if(l=p.data,l==="/$"){if(c===0){i.removeChild(p),Ss(s);return}c--}else l!=="$"&&l!=="$?"&&l!=="$!"||c++;l=p}while(l);Ss(s)}function xi(i){for(;i!=null;i=i.nextSibling){var s=i.nodeType;if(s===1||s===3)break;if(s===8){if(s=i.data,s==="$"||s==="$!"||s==="$?")break;if(s==="/$")return null}}return i}function fm(i){i=i.previousSibling;for(var s=0;i;){if(i.nodeType===8){var l=i.data;if(l==="$"||l==="$!"||l==="$?"){if(s===0)return i;s--}else l==="/$"&&s++}i=i.previousSibling}return null}var qn=Math.random().toString(36).slice(2),Br="__reactFiber$"+qn,Ps="__reactProps$"+qn,Zr="__reactContainer$"+qn,Xu="__reactEvents$"+qn,bk="__reactListeners$"+qn,Ek="__reactHandles$"+qn;function tn(i){var s=i[Br];if(s)return s;for(var l=i.parentNode;l;){if(s=l[Zr]||l[Br]){if(l=s.alternate,s.child!==null||l!==null&&l.child!==null)for(i=fm(i);i!==null;){if(l=i[Br])return l;i=fm(i)}return s}i=l,l=i.parentNode}return null}function Ms(i){return i=i[Br]||i[Zr],!i||i.tag!==5&&i.tag!==6&&i.tag!==13&&i.tag!==3?null:i}function Fn(i){if(i.tag===5||i.tag===6)return i.stateNode;throw Error(r(33))}function ya(i){return i[Ps]||null}var Zu=[],Hn=-1;function Ti(i){return{current:i}}function Ne(i){0>Hn||(i.current=Zu[Hn],Zu[Hn]=null,Hn--)}function Le(i,s){Hn++,Zu[Hn]=i.current,i.current=s}var ki={},Et=Ti(ki),It=Ti(!1),rn=ki;function zn(i,s){var l=i.type.contextTypes;if(!l)return ki;var c=i.stateNode;if(c&&c.__reactInternalMemoizedUnmaskedChildContext===s)return c.__reactInternalMemoizedMaskedChildContext;var p={},_;for(_ in l)p[_]=s[_];return c&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=s,i.__reactInternalMemoizedMaskedChildContext=p),p}function Lt(i){return i=i.childContextTypes,i!=null}function Sa(){Ne(It),Ne(Et)}function pm(i,s,l){if(Et.current!==ki)throw Error(r(168));Le(Et,s),Le(It,l)}function _m(i,s,l){var c=i.stateNode;if(s=s.childContextTypes,typeof c.getChildContext!="function")return l;c=c.getChildContext();for(var p in c)if(!(p in s))throw Error(r(108,we(i)||"Unknown",p));return Z({},l,c)}function wa(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||ki,rn=Et.current,Le(Et,i),Le(It,It.current),!0}function gm(i,s,l){var c=i.stateNode;if(!c)throw Error(r(169));l?(i=_m(i,s,rn),c.__reactInternalMemoizedMergedChildContext=i,Ne(It),Ne(Et),Le(Et,i)):Ne(It),Le(It,l)}var Jr=null,Ca=!1,Ju=!1;function vm(i){Jr===null?Jr=[i]:Jr.push(i)}function xk(i){Ca=!0,vm(i)}function Di(){if(!Ju&&Jr!==null){Ju=!0;var i=0,s=Ae;try{var l=Jr;for(Ae=1;i<l.length;i++){var c=l[i];do c=c(!0);while(c!==null)}Jr=null,Ca=!1}catch(p){throw Jr!==null&&(Jr=Jr.slice(i+1)),yv(Su,Di),p}finally{Ae=s,Ju=!1}}return null}var Wn=[],Un=0,ba=null,Ea=0,er=[],tr=0,nn=null,Qr=1,ei="";function sn(i,s){Wn[Un++]=Ea,Wn[Un++]=ba,ba=i,Ea=s}function mm(i,s,l){er[tr++]=Qr,er[tr++]=ei,er[tr++]=nn,nn=i;var c=Qr;i=ei;var p=32-Sr(c)-1;c&=~(1<<p),l+=1;var _=32-Sr(s)+p;if(30<_){var b=p-p%5;_=(c&(1<<b)-1).toString(32),c>>=b,p-=b,Qr=1<<32-Sr(s)+p|l<<p|c,ei=_+i}else Qr=1<<_|l<<p|c,ei=i}function Qu(i){i.return!==null&&(sn(i,1),mm(i,1,0))}function ec(i){for(;i===ba;)ba=Wn[--Un],Wn[Un]=null,Ea=Wn[--Un],Wn[Un]=null;for(;i===nn;)nn=er[--tr],er[tr]=null,ei=er[--tr],er[tr]=null,Qr=er[--tr],er[tr]=null}var Ut=null,jt=null,He=!1,Cr=null;function ym(i,s){var l=sr(5,null,null,0);l.elementType="DELETED",l.stateNode=s,l.return=i,s=i.deletions,s===null?(i.deletions=[l],i.flags|=16):s.push(l)}function Sm(i,s){switch(i.tag){case 5:var l=i.type;return s=s.nodeType!==1||l.toLowerCase()!==s.nodeName.toLowerCase()?null:s,s!==null?(i.stateNode=s,Ut=i,jt=xi(s.firstChild),!0):!1;case 6:return s=i.pendingProps===""||s.nodeType!==3?null:s,s!==null?(i.stateNode=s,Ut=i,jt=null,!0):!1;case 13:return s=s.nodeType!==8?null:s,s!==null?(l=nn!==null?{id:Qr,overflow:ei}:null,i.memoizedState={dehydrated:s,treeContext:l,retryLane:1073741824},l=sr(18,null,null,0),l.stateNode=s,l.return=i,i.child=l,Ut=i,jt=null,!0):!1;default:return!1}}function tc(i){return(i.mode&1)!==0&&(i.flags&128)===0}function rc(i){if(He){var s=jt;if(s){var l=s;if(!Sm(i,s)){if(tc(i))throw Error(r(418));s=xi(l.nextSibling);var c=Ut;s&&Sm(i,s)?ym(c,l):(i.flags=i.flags&-4097|2,He=!1,Ut=i)}}else{if(tc(i))throw Error(r(418));i.flags=i.flags&-4097|2,He=!1,Ut=i}}}function wm(i){for(i=i.return;i!==null&&i.tag!==5&&i.tag!==3&&i.tag!==13;)i=i.return;Ut=i}function xa(i){if(i!==Ut)return!1;if(!He)return wm(i),He=!0,!1;var s;if((s=i.tag!==3)&&!(s=i.tag!==5)&&(s=i.type,s=s!=="head"&&s!=="body"&&!Vu(i.type,i.memoizedProps)),s&&(s=jt)){if(tc(i))throw Cm(),Error(r(418));for(;s;)ym(i,s),s=xi(s.nextSibling)}if(wm(i),i.tag===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));e:{for(i=i.nextSibling,s=0;i;){if(i.nodeType===8){var l=i.data;if(l==="/$"){if(s===0){jt=xi(i.nextSibling);break e}s--}else l!=="$"&&l!=="$!"&&l!=="$?"||s++}i=i.nextSibling}jt=null}}else jt=Ut?xi(i.stateNode.nextSibling):null;return!0}function Cm(){for(var i=jt;i;)i=xi(i.nextSibling)}function jn(){jt=Ut=null,He=!1}function ic(i){Cr===null?Cr=[i]:Cr.push(i)}var Tk=D.ReactCurrentBatchConfig;function As(i,s,l){if(i=l.ref,i!==null&&typeof i!="function"&&typeof i!="object"){if(l._owner){if(l=l._owner,l){if(l.tag!==1)throw Error(r(309));var c=l.stateNode}if(!c)throw Error(r(147,i));var p=c,_=""+i;return s!==null&&s.ref!==null&&typeof s.ref=="function"&&s.ref._stringRef===_?s.ref:(s=function(b){var T=p.refs;b===null?delete T[_]:T[_]=b},s._stringRef=_,s)}if(typeof i!="string")throw Error(r(284));if(!l._owner)throw Error(r(290,i))}return i}function Ta(i,s){throw i=Object.prototype.toString.call(s),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":i))}function bm(i){var s=i._init;return s(i._payload)}function Em(i){function s(L,A){if(i){var N=L.deletions;N===null?(L.deletions=[A],L.flags|=16):N.push(A)}}function l(L,A){if(!i)return null;for(;A!==null;)s(L,A),A=A.sibling;return null}function c(L,A){for(L=new Map;A!==null;)A.key!==null?L.set(A.key,A):L.set(A.index,A),A=A.sibling;return L}function p(L,A){return L=Bi(L,A),L.index=0,L.sibling=null,L}function _(L,A,N){return L.index=N,i?(N=L.alternate,N!==null?(N=N.index,N<A?(L.flags|=2,A):N):(L.flags|=2,A)):(L.flags|=1048576,A)}function b(L){return i&&L.alternate===null&&(L.flags|=2),L}function T(L,A,N,te){return A===null||A.tag!==6?(A=Gc(N,L.mode,te),A.return=L,A):(A=p(A,N),A.return=L,A)}function R(L,A,N,te){var he=N.type;return he===P?X(L,A,N.props.children,te,N.key):A!==null&&(A.elementType===he||typeof he=="object"&&he!==null&&he.$$typeof===G&&bm(he)===A.type)?(te=p(A,N.props),te.ref=As(L,A,N),te.return=L,te):(te=Xa(N.type,N.key,N.props,null,L.mode,te),te.ref=As(L,A,N),te.return=L,te)}function z(L,A,N,te){return A===null||A.tag!==4||A.stateNode.containerInfo!==N.containerInfo||A.stateNode.implementation!==N.implementation?(A=Yc(N,L.mode,te),A.return=L,A):(A=p(A,N.children||[]),A.return=L,A)}function X(L,A,N,te,he){return A===null||A.tag!==7?(A=fn(N,L.mode,te,he),A.return=L,A):(A=p(A,N),A.return=L,A)}function J(L,A,N){if(typeof A=="string"&&A!==""||typeof A=="number")return A=Gc(""+A,L.mode,N),A.return=L,A;if(typeof A=="object"&&A!==null){switch(A.$$typeof){case U:return N=Xa(A.type,A.key,A.props,null,L.mode,N),N.ref=As(L,null,A),N.return=L,N;case W:return A=Yc(A,L.mode,N),A.return=L,A;case G:var te=A._init;return J(L,te(A._payload),N)}if(Xi(A)||ee(A))return A=fn(A,L.mode,N,null),A.return=L,A;Ta(L,A)}return null}function Y(L,A,N,te){var he=A!==null?A.key:null;if(typeof N=="string"&&N!==""||typeof N=="number")return he!==null?null:T(L,A,""+N,te);if(typeof N=="object"&&N!==null){switch(N.$$typeof){case U:return N.key===he?R(L,A,N,te):null;case W:return N.key===he?z(L,A,N,te):null;case G:return he=N._init,Y(L,A,he(N._payload),te)}if(Xi(N)||ee(N))return he!==null?null:X(L,A,N,te,null);Ta(L,N)}return null}function se(L,A,N,te,he){if(typeof te=="string"&&te!==""||typeof te=="number")return L=L.get(N)||null,T(A,L,""+te,he);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case U:return L=L.get(te.key===null?N:te.key)||null,R(A,L,te,he);case W:return L=L.get(te.key===null?N:te.key)||null,z(A,L,te,he);case G:var pe=te._init;return se(L,A,N,pe(te._payload),he)}if(Xi(te)||ee(te))return L=L.get(N)||null,X(A,L,te,he,null);Ta(A,te)}return null}function le(L,A,N,te){for(var he=null,pe=null,_e=A,ve=A=0,dt=null;_e!==null&&ve<N.length;ve++){_e.index>ve?(dt=_e,_e=null):dt=_e.sibling;var Pe=Y(L,_e,N[ve],te);if(Pe===null){_e===null&&(_e=dt);break}i&&_e&&Pe.alternate===null&&s(L,_e),A=_(Pe,A,ve),pe===null?he=Pe:pe.sibling=Pe,pe=Pe,_e=dt}if(ve===N.length)return l(L,_e),He&&sn(L,ve),he;if(_e===null){for(;ve<N.length;ve++)_e=J(L,N[ve],te),_e!==null&&(A=_(_e,A,ve),pe===null?he=_e:pe.sibling=_e,pe=_e);return He&&sn(L,ve),he}for(_e=c(L,_e);ve<N.length;ve++)dt=se(_e,L,ve,N[ve],te),dt!==null&&(i&&dt.alternate!==null&&_e.delete(dt.key===null?ve:dt.key),A=_(dt,A,ve),pe===null?he=dt:pe.sibling=dt,pe=dt);return i&&_e.forEach(function(Ni){return s(L,Ni)}),He&&sn(L,ve),he}function ue(L,A,N,te){var he=ee(N);if(typeof he!="function")throw Error(r(150));if(N=he.call(N),N==null)throw Error(r(151));for(var pe=he=null,_e=A,ve=A=0,dt=null,Pe=N.next();_e!==null&&!Pe.done;ve++,Pe=N.next()){_e.index>ve?(dt=_e,_e=null):dt=_e.sibling;var Ni=Y(L,_e,Pe.value,te);if(Ni===null){_e===null&&(_e=dt);break}i&&_e&&Ni.alternate===null&&s(L,_e),A=_(Ni,A,ve),pe===null?he=Ni:pe.sibling=Ni,pe=Ni,_e=dt}if(Pe.done)return l(L,_e),He&&sn(L,ve),he;if(_e===null){for(;!Pe.done;ve++,Pe=N.next())Pe=J(L,Pe.value,te),Pe!==null&&(A=_(Pe,A,ve),pe===null?he=Pe:pe.sibling=Pe,pe=Pe);return He&&sn(L,ve),he}for(_e=c(L,_e);!Pe.done;ve++,Pe=N.next())Pe=se(_e,L,ve,Pe.value,te),Pe!==null&&(i&&Pe.alternate!==null&&_e.delete(Pe.key===null?ve:Pe.key),A=_(Pe,A,ve),pe===null?he=Pe:pe.sibling=Pe,pe=Pe);return i&&_e.forEach(function(sD){return s(L,sD)}),He&&sn(L,ve),he}function Xe(L,A,N,te){if(typeof N=="object"&&N!==null&&N.type===P&&N.key===null&&(N=N.props.children),typeof N=="object"&&N!==null){switch(N.$$typeof){case U:e:{for(var he=N.key,pe=A;pe!==null;){if(pe.key===he){if(he=N.type,he===P){if(pe.tag===7){l(L,pe.sibling),A=p(pe,N.props.children),A.return=L,L=A;break e}}else if(pe.elementType===he||typeof he=="object"&&he!==null&&he.$$typeof===G&&bm(he)===pe.type){l(L,pe.sibling),A=p(pe,N.props),A.ref=As(L,pe,N),A.return=L,L=A;break e}l(L,pe);break}else s(L,pe);pe=pe.sibling}N.type===P?(A=fn(N.props.children,L.mode,te,N.key),A.return=L,L=A):(te=Xa(N.type,N.key,N.props,null,L.mode,te),te.ref=As(L,A,N),te.return=L,L=te)}return b(L);case W:e:{for(pe=N.key;A!==null;){if(A.key===pe)if(A.tag===4&&A.stateNode.containerInfo===N.containerInfo&&A.stateNode.implementation===N.implementation){l(L,A.sibling),A=p(A,N.children||[]),A.return=L,L=A;break e}else{l(L,A);break}else s(L,A);A=A.sibling}A=Yc(N,L.mode,te),A.return=L,L=A}return b(L);case G:return pe=N._init,Xe(L,A,pe(N._payload),te)}if(Xi(N))return le(L,A,N,te);if(ee(N))return ue(L,A,N,te);Ta(L,N)}return typeof N=="string"&&N!==""||typeof N=="number"?(N=""+N,A!==null&&A.tag===6?(l(L,A.sibling),A=p(A,N),A.return=L,L=A):(l(L,A),A=Gc(N,L.mode,te),A.return=L,L=A),b(L)):l(L,A)}return Xe}var $n=Em(!0),xm=Em(!1),ka=Ti(null),Da=null,Kn=null,nc=null;function sc(){nc=Kn=Da=null}function oc(i){var s=ka.current;Ne(ka),i._currentValue=s}function ac(i,s,l){for(;i!==null;){var c=i.alternate;if((i.childLanes&s)!==s?(i.childLanes|=s,c!==null&&(c.childLanes|=s)):c!==null&&(c.childLanes&s)!==s&&(c.childLanes|=s),i===l)break;i=i.return}}function Vn(i,s){Da=i,nc=Kn=null,i=i.dependencies,i!==null&&i.firstContext!==null&&((i.lanes&s)!==0&&(Bt=!0),i.firstContext=null)}function rr(i){var s=i._currentValue;if(nc!==i)if(i={context:i,memoizedValue:s,next:null},Kn===null){if(Da===null)throw Error(r(308));Kn=i,Da.dependencies={lanes:0,firstContext:i}}else Kn=Kn.next=i;return s}var on=null;function lc(i){on===null?on=[i]:on.push(i)}function Tm(i,s,l,c){var p=s.interleaved;return p===null?(l.next=l,lc(s)):(l.next=p.next,p.next=l),s.interleaved=l,ti(i,c)}function ti(i,s){i.lanes|=s;var l=i.alternate;for(l!==null&&(l.lanes|=s),l=i,i=i.return;i!==null;)i.childLanes|=s,l=i.alternate,l!==null&&(l.childLanes|=s),l=i,i=i.return;return l.tag===3?l.stateNode:null}var Oi=!1;function uc(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function km(i,s){i=i.updateQueue,s.updateQueue===i&&(s.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function ri(i,s){return{eventTime:i,lane:s,tag:0,payload:null,callback:null,next:null}}function Ri(i,s,l){var c=i.updateQueue;if(c===null)return null;if(c=c.shared,(Re&2)!==0){var p=c.pending;return p===null?s.next=s:(s.next=p.next,p.next=s),c.pending=s,ti(i,l)}return p=c.interleaved,p===null?(s.next=s,lc(c)):(s.next=p.next,p.next=s),c.interleaved=s,ti(i,l)}function Oa(i,s,l){if(s=s.updateQueue,s!==null&&(s=s.shared,(l&4194240)!==0)){var c=s.lanes;c&=i.pendingLanes,l|=c,s.lanes=l,bu(i,l)}}function Dm(i,s){var l=i.updateQueue,c=i.alternate;if(c!==null&&(c=c.updateQueue,l===c)){var p=null,_=null;if(l=l.firstBaseUpdate,l!==null){do{var b={eventTime:l.eventTime,lane:l.lane,tag:l.tag,payload:l.payload,callback:l.callback,next:null};_===null?p=_=b:_=_.next=b,l=l.next}while(l!==null);_===null?p=_=s:_=_.next=s}else p=_=s;l={baseState:c.baseState,firstBaseUpdate:p,lastBaseUpdate:_,shared:c.shared,effects:c.effects},i.updateQueue=l;return}i=l.lastBaseUpdate,i===null?l.firstBaseUpdate=s:i.next=s,l.lastBaseUpdate=s}function Ra(i,s,l,c){var p=i.updateQueue;Oi=!1;var _=p.firstBaseUpdate,b=p.lastBaseUpdate,T=p.shared.pending;if(T!==null){p.shared.pending=null;var R=T,z=R.next;R.next=null,b===null?_=z:b.next=z,b=R;var X=i.alternate;X!==null&&(X=X.updateQueue,T=X.lastBaseUpdate,T!==b&&(T===null?X.firstBaseUpdate=z:T.next=z,X.lastBaseUpdate=R))}if(_!==null){var J=p.baseState;b=0,X=z=R=null,T=_;do{var Y=T.lane,se=T.eventTime;if((c&Y)===Y){X!==null&&(X=X.next={eventTime:se,lane:0,tag:T.tag,payload:T.payload,callback:T.callback,next:null});e:{var le=i,ue=T;switch(Y=s,se=l,ue.tag){case 1:if(le=ue.payload,typeof le=="function"){J=le.call(se,J,Y);break e}J=le;break e;case 3:le.flags=le.flags&-65537|128;case 0:if(le=ue.payload,Y=typeof le=="function"?le.call(se,J,Y):le,Y==null)break e;J=Z({},J,Y);break e;case 2:Oi=!0}}T.callback!==null&&T.lane!==0&&(i.flags|=64,Y=p.effects,Y===null?p.effects=[T]:Y.push(T))}else se={eventTime:se,lane:Y,tag:T.tag,payload:T.payload,callback:T.callback,next:null},X===null?(z=X=se,R=J):X=X.next=se,b|=Y;if(T=T.next,T===null){if(T=p.shared.pending,T===null)break;Y=T,T=Y.next,Y.next=null,p.lastBaseUpdate=Y,p.shared.pending=null}}while(!0);if(X===null&&(R=J),p.baseState=R,p.firstBaseUpdate=z,p.lastBaseUpdate=X,s=p.shared.interleaved,s!==null){p=s;do b|=p.lane,p=p.next;while(p!==s)}else _===null&&(p.shared.lanes=0);un|=b,i.lanes=b,i.memoizedState=J}}function Om(i,s,l){if(i=s.effects,s.effects=null,i!==null)for(s=0;s<i.length;s++){var c=i[s],p=c.callback;if(p!==null){if(c.callback=null,c=l,typeof p!="function")throw Error(r(191,p));p.call(c)}}}var Is={},Nr=Ti(Is),Ls=Ti(Is),Bs=Ti(Is);function an(i){if(i===Is)throw Error(r(174));return i}function cc(i,s){switch(Le(Bs,s),Le(Ls,i),Le(Nr,Is),i=s.nodeType,i){case 9:case 11:s=(s=s.documentElement)?s.namespaceURI:On(null,"");break;default:i=i===8?s.parentNode:s,s=i.namespaceURI||null,i=i.tagName,s=On(s,i)}Ne(Nr),Le(Nr,s)}function Gn(){Ne(Nr),Ne(Ls),Ne(Bs)}function Rm(i){an(Bs.current);var s=an(Nr.current),l=On(s,i.type);s!==l&&(Le(Ls,i),Le(Nr,l))}function hc(i){Ls.current===i&&(Ne(Nr),Ne(Ls))}var We=Ti(0);function Pa(i){for(var s=i;s!==null;){if(s.tag===13){var l=s.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||l.data==="$?"||l.data==="$!"))return s}else if(s.tag===19&&s.memoizedProps.revealOrder!==void 0){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var dc=[];function fc(){for(var i=0;i<dc.length;i++)dc[i]._workInProgressVersionPrimary=null;dc.length=0}var Ma=D.ReactCurrentDispatcher,pc=D.ReactCurrentBatchConfig,ln=0,Ue=null,it=null,ct=null,Aa=!1,Ns=!1,qs=0,kk=0;function xt(){throw Error(r(321))}function _c(i,s){if(s===null)return!1;for(var l=0;l<s.length&&l<i.length;l++)if(!wr(i[l],s[l]))return!1;return!0}function gc(i,s,l,c,p,_){if(ln=_,Ue=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,Ma.current=i===null||i.memoizedState===null?Pk:Mk,i=l(c,p),Ns){_=0;do{if(Ns=!1,qs=0,25<=_)throw Error(r(301));_+=1,ct=it=null,s.updateQueue=null,Ma.current=Ak,i=l(c,p)}while(Ns)}if(Ma.current=Ba,s=it!==null&&it.next!==null,ln=0,ct=it=Ue=null,Aa=!1,s)throw Error(r(300));return i}function vc(){var i=qs!==0;return qs=0,i}function qr(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ct===null?Ue.memoizedState=ct=i:ct=ct.next=i,ct}function ir(){if(it===null){var i=Ue.alternate;i=i!==null?i.memoizedState:null}else i=it.next;var s=ct===null?Ue.memoizedState:ct.next;if(s!==null)ct=s,it=i;else{if(i===null)throw Error(r(310));it=i,i={memoizedState:it.memoizedState,baseState:it.baseState,baseQueue:it.baseQueue,queue:it.queue,next:null},ct===null?Ue.memoizedState=ct=i:ct=ct.next=i}return ct}function Fs(i,s){return typeof s=="function"?s(i):s}function mc(i){var s=ir(),l=s.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=i;var c=it,p=c.baseQueue,_=l.pending;if(_!==null){if(p!==null){var b=p.next;p.next=_.next,_.next=b}c.baseQueue=p=_,l.pending=null}if(p!==null){_=p.next,c=c.baseState;var T=b=null,R=null,z=_;do{var X=z.lane;if((ln&X)===X)R!==null&&(R=R.next={lane:0,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null}),c=z.hasEagerState?z.eagerState:i(c,z.action);else{var J={lane:X,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null};R===null?(T=R=J,b=c):R=R.next=J,Ue.lanes|=X,un|=X}z=z.next}while(z!==null&&z!==_);R===null?b=c:R.next=T,wr(c,s.memoizedState)||(Bt=!0),s.memoizedState=c,s.baseState=b,s.baseQueue=R,l.lastRenderedState=c}if(i=l.interleaved,i!==null){p=i;do _=p.lane,Ue.lanes|=_,un|=_,p=p.next;while(p!==i)}else p===null&&(l.lanes=0);return[s.memoizedState,l.dispatch]}function yc(i){var s=ir(),l=s.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=i;var c=l.dispatch,p=l.pending,_=s.memoizedState;if(p!==null){l.pending=null;var b=p=p.next;do _=i(_,b.action),b=b.next;while(b!==p);wr(_,s.memoizedState)||(Bt=!0),s.memoizedState=_,s.baseQueue===null&&(s.baseState=_),l.lastRenderedState=_}return[_,c]}function Pm(){}function Mm(i,s){var l=Ue,c=ir(),p=s(),_=!wr(c.memoizedState,p);if(_&&(c.memoizedState=p,Bt=!0),c=c.queue,Sc(Lm.bind(null,l,c,i),[i]),c.getSnapshot!==s||_||ct!==null&&ct.memoizedState.tag&1){if(l.flags|=2048,Hs(9,Im.bind(null,l,c,p,s),void 0,null),ht===null)throw Error(r(349));(ln&30)!==0||Am(l,s,p)}return p}function Am(i,s,l){i.flags|=16384,i={getSnapshot:s,value:l},s=Ue.updateQueue,s===null?(s={lastEffect:null,stores:null},Ue.updateQueue=s,s.stores=[i]):(l=s.stores,l===null?s.stores=[i]:l.push(i))}function Im(i,s,l,c){s.value=l,s.getSnapshot=c,Bm(s)&&Nm(i)}function Lm(i,s,l){return l(function(){Bm(s)&&Nm(i)})}function Bm(i){var s=i.getSnapshot;i=i.value;try{var l=s();return!wr(i,l)}catch{return!0}}function Nm(i){var s=ti(i,1);s!==null&&Tr(s,i,1,-1)}function qm(i){var s=qr();return typeof i=="function"&&(i=i()),s.memoizedState=s.baseState=i,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Fs,lastRenderedState:i},s.queue=i,i=i.dispatch=Rk.bind(null,Ue,i),[s.memoizedState,i]}function Hs(i,s,l,c){return i={tag:i,create:s,destroy:l,deps:c,next:null},s=Ue.updateQueue,s===null?(s={lastEffect:null,stores:null},Ue.updateQueue=s,s.lastEffect=i.next=i):(l=s.lastEffect,l===null?s.lastEffect=i.next=i:(c=l.next,l.next=i,i.next=c,s.lastEffect=i)),i}function Fm(){return ir().memoizedState}function Ia(i,s,l,c){var p=qr();Ue.flags|=i,p.memoizedState=Hs(1|s,l,void 0,c===void 0?null:c)}function La(i,s,l,c){var p=ir();c=c===void 0?null:c;var _=void 0;if(it!==null){var b=it.memoizedState;if(_=b.destroy,c!==null&&_c(c,b.deps)){p.memoizedState=Hs(s,l,_,c);return}}Ue.flags|=i,p.memoizedState=Hs(1|s,l,_,c)}function Hm(i,s){return Ia(8390656,8,i,s)}function Sc(i,s){return La(2048,8,i,s)}function zm(i,s){return La(4,2,i,s)}function Wm(i,s){return La(4,4,i,s)}function Um(i,s){if(typeof s=="function")return i=i(),s(i),function(){s(null)};if(s!=null)return i=i(),s.current=i,function(){s.current=null}}function jm(i,s,l){return l=l!=null?l.concat([i]):null,La(4,4,Um.bind(null,s,i),l)}function wc(){}function $m(i,s){var l=ir();s=s===void 0?null:s;var c=l.memoizedState;return c!==null&&s!==null&&_c(s,c[1])?c[0]:(l.memoizedState=[i,s],i)}function Km(i,s){var l=ir();s=s===void 0?null:s;var c=l.memoizedState;return c!==null&&s!==null&&_c(s,c[1])?c[0]:(i=i(),l.memoizedState=[i,s],i)}function Vm(i,s,l){return(ln&21)===0?(i.baseState&&(i.baseState=!1,Bt=!0),i.memoizedState=l):(wr(l,s)||(l=bv(),Ue.lanes|=l,un|=l,i.baseState=!0),s)}function Dk(i,s){var l=Ae;Ae=l!==0&&4>l?l:4,i(!0);var c=pc.transition;pc.transition={};try{i(!1),s()}finally{Ae=l,pc.transition=c}}function Gm(){return ir().memoizedState}function Ok(i,s,l){var c=Ii(i);if(l={lane:c,action:l,hasEagerState:!1,eagerState:null,next:null},Ym(i))Xm(s,l);else if(l=Tm(i,s,l,c),l!==null){var p=Rt();Tr(l,i,c,p),Zm(l,s,c)}}function Rk(i,s,l){var c=Ii(i),p={lane:c,action:l,hasEagerState:!1,eagerState:null,next:null};if(Ym(i))Xm(s,p);else{var _=i.alternate;if(i.lanes===0&&(_===null||_.lanes===0)&&(_=s.lastRenderedReducer,_!==null))try{var b=s.lastRenderedState,T=_(b,l);if(p.hasEagerState=!0,p.eagerState=T,wr(T,b)){var R=s.interleaved;R===null?(p.next=p,lc(s)):(p.next=R.next,R.next=p),s.interleaved=p;return}}catch{}finally{}l=Tm(i,s,p,c),l!==null&&(p=Rt(),Tr(l,i,c,p),Zm(l,s,c))}}function Ym(i){var s=i.alternate;return i===Ue||s!==null&&s===Ue}function Xm(i,s){Ns=Aa=!0;var l=i.pending;l===null?s.next=s:(s.next=l.next,l.next=s),i.pending=s}function Zm(i,s,l){if((l&4194240)!==0){var c=s.lanes;c&=i.pendingLanes,l|=c,s.lanes=l,bu(i,l)}}var Ba={readContext:rr,useCallback:xt,useContext:xt,useEffect:xt,useImperativeHandle:xt,useInsertionEffect:xt,useLayoutEffect:xt,useMemo:xt,useReducer:xt,useRef:xt,useState:xt,useDebugValue:xt,useDeferredValue:xt,useTransition:xt,useMutableSource:xt,useSyncExternalStore:xt,useId:xt,unstable_isNewReconciler:!1},Pk={readContext:rr,useCallback:function(i,s){return qr().memoizedState=[i,s===void 0?null:s],i},useContext:rr,useEffect:Hm,useImperativeHandle:function(i,s,l){return l=l!=null?l.concat([i]):null,Ia(4194308,4,Um.bind(null,s,i),l)},useLayoutEffect:function(i,s){return Ia(4194308,4,i,s)},useInsertionEffect:function(i,s){return Ia(4,2,i,s)},useMemo:function(i,s){var l=qr();return s=s===void 0?null:s,i=i(),l.memoizedState=[i,s],i},useReducer:function(i,s,l){var c=qr();return s=l!==void 0?l(s):s,c.memoizedState=c.baseState=s,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:s},c.queue=i,i=i.dispatch=Ok.bind(null,Ue,i),[c.memoizedState,i]},useRef:function(i){var s=qr();return i={current:i},s.memoizedState=i},useState:qm,useDebugValue:wc,useDeferredValue:function(i){return qr().memoizedState=i},useTransition:function(){var i=qm(!1),s=i[0];return i=Dk.bind(null,i[1]),qr().memoizedState=i,[s,i]},useMutableSource:function(){},useSyncExternalStore:function(i,s,l){var c=Ue,p=qr();if(He){if(l===void 0)throw Error(r(407));l=l()}else{if(l=s(),ht===null)throw Error(r(349));(ln&30)!==0||Am(c,s,l)}p.memoizedState=l;var _={value:l,getSnapshot:s};return p.queue=_,Hm(Lm.bind(null,c,_,i),[i]),c.flags|=2048,Hs(9,Im.bind(null,c,_,l,s),void 0,null),l},useId:function(){var i=qr(),s=ht.identifierPrefix;if(He){var l=ei,c=Qr;l=(c&~(1<<32-Sr(c)-1)).toString(32)+l,s=":"+s+"R"+l,l=qs++,0<l&&(s+="H"+l.toString(32)),s+=":"}else l=kk++,s=":"+s+"r"+l.toString(32)+":";return i.memoizedState=s},unstable_isNewReconciler:!1},Mk={readContext:rr,useCallback:$m,useContext:rr,useEffect:Sc,useImperativeHandle:jm,useInsertionEffect:zm,useLayoutEffect:Wm,useMemo:Km,useReducer:mc,useRef:Fm,useState:function(){return mc(Fs)},useDebugValue:wc,useDeferredValue:function(i){var s=ir();return Vm(s,it.memoizedState,i)},useTransition:function(){var i=mc(Fs)[0],s=ir().memoizedState;return[i,s]},useMutableSource:Pm,useSyncExternalStore:Mm,useId:Gm,unstable_isNewReconciler:!1},Ak={readContext:rr,useCallback:$m,useContext:rr,useEffect:Sc,useImperativeHandle:jm,useInsertionEffect:zm,useLayoutEffect:Wm,useMemo:Km,useReducer:yc,useRef:Fm,useState:function(){return yc(Fs)},useDebugValue:wc,useDeferredValue:function(i){var s=ir();return it===null?s.memoizedState=i:Vm(s,it.memoizedState,i)},useTransition:function(){var i=yc(Fs)[0],s=ir().memoizedState;return[i,s]},useMutableSource:Pm,useSyncExternalStore:Mm,useId:Gm,unstable_isNewReconciler:!1};function br(i,s){if(i&&i.defaultProps){s=Z({},s),i=i.defaultProps;for(var l in i)s[l]===void 0&&(s[l]=i[l]);return s}return s}function Cc(i,s,l,c){s=i.memoizedState,l=l(c,s),l=l==null?s:Z({},s,l),i.memoizedState=l,i.lanes===0&&(i.updateQueue.baseState=l)}var Na={isMounted:function(i){return(i=i._reactInternals)?en(i)===i:!1},enqueueSetState:function(i,s,l){i=i._reactInternals;var c=Rt(),p=Ii(i),_=ri(c,p);_.payload=s,l!=null&&(_.callback=l),s=Ri(i,_,p),s!==null&&(Tr(s,i,p,c),Oa(s,i,p))},enqueueReplaceState:function(i,s,l){i=i._reactInternals;var c=Rt(),p=Ii(i),_=ri(c,p);_.tag=1,_.payload=s,l!=null&&(_.callback=l),s=Ri(i,_,p),s!==null&&(Tr(s,i,p,c),Oa(s,i,p))},enqueueForceUpdate:function(i,s){i=i._reactInternals;var l=Rt(),c=Ii(i),p=ri(l,c);p.tag=2,s!=null&&(p.callback=s),s=Ri(i,p,c),s!==null&&(Tr(s,i,c,l),Oa(s,i,c))}};function Jm(i,s,l,c,p,_,b){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(c,_,b):s.prototype&&s.prototype.isPureReactComponent?!Ts(l,c)||!Ts(p,_):!0}function Qm(i,s,l){var c=!1,p=ki,_=s.contextType;return typeof _=="object"&&_!==null?_=rr(_):(p=Lt(s)?rn:Et.current,c=s.contextTypes,_=(c=c!=null)?zn(i,p):ki),s=new s(l,_),i.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=Na,i.stateNode=s,s._reactInternals=i,c&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=p,i.__reactInternalMemoizedMaskedChildContext=_),s}function ey(i,s,l,c){i=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(l,c),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(l,c),s.state!==i&&Na.enqueueReplaceState(s,s.state,null)}function bc(i,s,l,c){var p=i.stateNode;p.props=l,p.state=i.memoizedState,p.refs={},uc(i);var _=s.contextType;typeof _=="object"&&_!==null?p.context=rr(_):(_=Lt(s)?rn:Et.current,p.context=zn(i,_)),p.state=i.memoizedState,_=s.getDerivedStateFromProps,typeof _=="function"&&(Cc(i,s,_,l),p.state=i.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof p.getSnapshotBeforeUpdate=="function"||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(s=p.state,typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount(),s!==p.state&&Na.enqueueReplaceState(p,p.state,null),Ra(i,l,p,c),p.state=i.memoizedState),typeof p.componentDidMount=="function"&&(i.flags|=4194308)}function Yn(i,s){try{var l="",c=s;do l+=de(c),c=c.return;while(c);var p=l}catch(_){p=`
|
|
39
|
+
Error generating stack: `+_.message+`
|
|
40
|
+
`+_.stack}return{value:i,source:s,stack:p,digest:null}}function Ec(i,s,l){return{value:i,source:null,stack:l??null,digest:s??null}}function xc(i,s){try{console.error(s.value)}catch(l){setTimeout(function(){throw l})}}var Ik=typeof WeakMap=="function"?WeakMap:Map;function ty(i,s,l){l=ri(-1,l),l.tag=3,l.payload={element:null};var c=s.value;return l.callback=function(){ja||(ja=!0,Hc=c),xc(i,s)},l}function ry(i,s,l){l=ri(-1,l),l.tag=3;var c=i.type.getDerivedStateFromError;if(typeof c=="function"){var p=s.value;l.payload=function(){return c(p)},l.callback=function(){xc(i,s)}}var _=i.stateNode;return _!==null&&typeof _.componentDidCatch=="function"&&(l.callback=function(){xc(i,s),typeof c!="function"&&(Mi===null?Mi=new Set([this]):Mi.add(this));var b=s.stack;this.componentDidCatch(s.value,{componentStack:b!==null?b:""})}),l}function iy(i,s,l){var c=i.pingCache;if(c===null){c=i.pingCache=new Ik;var p=new Set;c.set(s,p)}else p=c.get(s),p===void 0&&(p=new Set,c.set(s,p));p.has(l)||(p.add(l),i=Gk.bind(null,i,s,l),s.then(i,i))}function ny(i){do{var s;if((s=i.tag===13)&&(s=i.memoizedState,s=s!==null?s.dehydrated!==null:!0),s)return i;i=i.return}while(i!==null);return null}function sy(i,s,l,c,p){return(i.mode&1)===0?(i===s?i.flags|=65536:(i.flags|=128,l.flags|=131072,l.flags&=-52805,l.tag===1&&(l.alternate===null?l.tag=17:(s=ri(-1,1),s.tag=2,Ri(l,s,1))),l.lanes|=1),i):(i.flags|=65536,i.lanes=p,i)}var Lk=D.ReactCurrentOwner,Bt=!1;function Ot(i,s,l,c){s.child=i===null?xm(s,null,l,c):$n(s,i.child,l,c)}function oy(i,s,l,c,p){l=l.render;var _=s.ref;return Vn(s,p),c=gc(i,s,l,c,_,p),l=vc(),i!==null&&!Bt?(s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~p,ii(i,s,p)):(He&&l&&Qu(s),s.flags|=1,Ot(i,s,c,p),s.child)}function ay(i,s,l,c,p){if(i===null){var _=l.type;return typeof _=="function"&&!Vc(_)&&_.defaultProps===void 0&&l.compare===null&&l.defaultProps===void 0?(s.tag=15,s.type=_,ly(i,s,_,c,p)):(i=Xa(l.type,null,c,s,s.mode,p),i.ref=s.ref,i.return=s,s.child=i)}if(_=i.child,(i.lanes&p)===0){var b=_.memoizedProps;if(l=l.compare,l=l!==null?l:Ts,l(b,c)&&i.ref===s.ref)return ii(i,s,p)}return s.flags|=1,i=Bi(_,c),i.ref=s.ref,i.return=s,s.child=i}function ly(i,s,l,c,p){if(i!==null){var _=i.memoizedProps;if(Ts(_,c)&&i.ref===s.ref)if(Bt=!1,s.pendingProps=c=_,(i.lanes&p)!==0)(i.flags&131072)!==0&&(Bt=!0);else return s.lanes=i.lanes,ii(i,s,p)}return Tc(i,s,l,c,p)}function uy(i,s,l){var c=s.pendingProps,p=c.children,_=i!==null?i.memoizedState:null;if(c.mode==="hidden")if((s.mode&1)===0)s.memoizedState={baseLanes:0,cachePool:null,transitions:null},Le(Zn,$t),$t|=l;else{if((l&1073741824)===0)return i=_!==null?_.baseLanes|l:l,s.lanes=s.childLanes=1073741824,s.memoizedState={baseLanes:i,cachePool:null,transitions:null},s.updateQueue=null,Le(Zn,$t),$t|=i,null;s.memoizedState={baseLanes:0,cachePool:null,transitions:null},c=_!==null?_.baseLanes:l,Le(Zn,$t),$t|=c}else _!==null?(c=_.baseLanes|l,s.memoizedState=null):c=l,Le(Zn,$t),$t|=c;return Ot(i,s,p,l),s.child}function cy(i,s){var l=s.ref;(i===null&&l!==null||i!==null&&i.ref!==l)&&(s.flags|=512,s.flags|=2097152)}function Tc(i,s,l,c,p){var _=Lt(l)?rn:Et.current;return _=zn(s,_),Vn(s,p),l=gc(i,s,l,c,_,p),c=vc(),i!==null&&!Bt?(s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~p,ii(i,s,p)):(He&&c&&Qu(s),s.flags|=1,Ot(i,s,l,p),s.child)}function hy(i,s,l,c,p){if(Lt(l)){var _=!0;wa(s)}else _=!1;if(Vn(s,p),s.stateNode===null)Fa(i,s),Qm(s,l,c),bc(s,l,c,p),c=!0;else if(i===null){var b=s.stateNode,T=s.memoizedProps;b.props=T;var R=b.context,z=l.contextType;typeof z=="object"&&z!==null?z=rr(z):(z=Lt(l)?rn:Et.current,z=zn(s,z));var X=l.getDerivedStateFromProps,J=typeof X=="function"||typeof b.getSnapshotBeforeUpdate=="function";J||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(T!==c||R!==z)&&ey(s,b,c,z),Oi=!1;var Y=s.memoizedState;b.state=Y,Ra(s,c,b,p),R=s.memoizedState,T!==c||Y!==R||It.current||Oi?(typeof X=="function"&&(Cc(s,l,X,c),R=s.memoizedState),(T=Oi||Jm(s,l,T,c,Y,R,z))?(J||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount()),typeof b.componentDidMount=="function"&&(s.flags|=4194308)):(typeof b.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=c,s.memoizedState=R),b.props=c,b.state=R,b.context=z,c=T):(typeof b.componentDidMount=="function"&&(s.flags|=4194308),c=!1)}else{b=s.stateNode,km(i,s),T=s.memoizedProps,z=s.type===s.elementType?T:br(s.type,T),b.props=z,J=s.pendingProps,Y=b.context,R=l.contextType,typeof R=="object"&&R!==null?R=rr(R):(R=Lt(l)?rn:Et.current,R=zn(s,R));var se=l.getDerivedStateFromProps;(X=typeof se=="function"||typeof b.getSnapshotBeforeUpdate=="function")||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(T!==J||Y!==R)&&ey(s,b,c,R),Oi=!1,Y=s.memoizedState,b.state=Y,Ra(s,c,b,p);var le=s.memoizedState;T!==J||Y!==le||It.current||Oi?(typeof se=="function"&&(Cc(s,l,se,c),le=s.memoizedState),(z=Oi||Jm(s,l,z,c,Y,le,R)||!1)?(X||typeof b.UNSAFE_componentWillUpdate!="function"&&typeof b.componentWillUpdate!="function"||(typeof b.componentWillUpdate=="function"&&b.componentWillUpdate(c,le,R),typeof b.UNSAFE_componentWillUpdate=="function"&&b.UNSAFE_componentWillUpdate(c,le,R)),typeof b.componentDidUpdate=="function"&&(s.flags|=4),typeof b.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof b.componentDidUpdate!="function"||T===i.memoizedProps&&Y===i.memoizedState||(s.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||T===i.memoizedProps&&Y===i.memoizedState||(s.flags|=1024),s.memoizedProps=c,s.memoizedState=le),b.props=c,b.state=le,b.context=R,c=z):(typeof b.componentDidUpdate!="function"||T===i.memoizedProps&&Y===i.memoizedState||(s.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||T===i.memoizedProps&&Y===i.memoizedState||(s.flags|=1024),c=!1)}return kc(i,s,l,c,_,p)}function kc(i,s,l,c,p,_){cy(i,s);var b=(s.flags&128)!==0;if(!c&&!b)return p&&gm(s,l,!1),ii(i,s,_);c=s.stateNode,Lk.current=s;var T=b&&typeof l.getDerivedStateFromError!="function"?null:c.render();return s.flags|=1,i!==null&&b?(s.child=$n(s,i.child,null,_),s.child=$n(s,null,T,_)):Ot(i,s,T,_),s.memoizedState=c.state,p&&gm(s,l,!0),s.child}function dy(i){var s=i.stateNode;s.pendingContext?pm(i,s.pendingContext,s.pendingContext!==s.context):s.context&&pm(i,s.context,!1),cc(i,s.containerInfo)}function fy(i,s,l,c,p){return jn(),ic(p),s.flags|=256,Ot(i,s,l,c),s.child}var Dc={dehydrated:null,treeContext:null,retryLane:0};function Oc(i){return{baseLanes:i,cachePool:null,transitions:null}}function py(i,s,l){var c=s.pendingProps,p=We.current,_=!1,b=(s.flags&128)!==0,T;if((T=b)||(T=i!==null&&i.memoizedState===null?!1:(p&2)!==0),T?(_=!0,s.flags&=-129):(i===null||i.memoizedState!==null)&&(p|=1),Le(We,p&1),i===null)return rc(s),i=s.memoizedState,i!==null&&(i=i.dehydrated,i!==null)?((s.mode&1)===0?s.lanes=1:i.data==="$!"?s.lanes=8:s.lanes=1073741824,null):(b=c.children,i=c.fallback,_?(c=s.mode,_=s.child,b={mode:"hidden",children:b},(c&1)===0&&_!==null?(_.childLanes=0,_.pendingProps=b):_=Za(b,c,0,null),i=fn(i,c,l,null),_.return=s,i.return=s,_.sibling=i,s.child=_,s.child.memoizedState=Oc(l),s.memoizedState=Dc,i):Rc(s,b));if(p=i.memoizedState,p!==null&&(T=p.dehydrated,T!==null))return Bk(i,s,b,c,T,p,l);if(_){_=c.fallback,b=s.mode,p=i.child,T=p.sibling;var R={mode:"hidden",children:c.children};return(b&1)===0&&s.child!==p?(c=s.child,c.childLanes=0,c.pendingProps=R,s.deletions=null):(c=Bi(p,R),c.subtreeFlags=p.subtreeFlags&14680064),T!==null?_=Bi(T,_):(_=fn(_,b,l,null),_.flags|=2),_.return=s,c.return=s,c.sibling=_,s.child=c,c=_,_=s.child,b=i.child.memoizedState,b=b===null?Oc(l):{baseLanes:b.baseLanes|l,cachePool:null,transitions:b.transitions},_.memoizedState=b,_.childLanes=i.childLanes&~l,s.memoizedState=Dc,c}return _=i.child,i=_.sibling,c=Bi(_,{mode:"visible",children:c.children}),(s.mode&1)===0&&(c.lanes=l),c.return=s,c.sibling=null,i!==null&&(l=s.deletions,l===null?(s.deletions=[i],s.flags|=16):l.push(i)),s.child=c,s.memoizedState=null,c}function Rc(i,s){return s=Za({mode:"visible",children:s},i.mode,0,null),s.return=i,i.child=s}function qa(i,s,l,c){return c!==null&&ic(c),$n(s,i.child,null,l),i=Rc(s,s.pendingProps.children),i.flags|=2,s.memoizedState=null,i}function Bk(i,s,l,c,p,_,b){if(l)return s.flags&256?(s.flags&=-257,c=Ec(Error(r(422))),qa(i,s,b,c)):s.memoizedState!==null?(s.child=i.child,s.flags|=128,null):(_=c.fallback,p=s.mode,c=Za({mode:"visible",children:c.children},p,0,null),_=fn(_,p,b,null),_.flags|=2,c.return=s,_.return=s,c.sibling=_,s.child=c,(s.mode&1)!==0&&$n(s,i.child,null,b),s.child.memoizedState=Oc(b),s.memoizedState=Dc,_);if((s.mode&1)===0)return qa(i,s,b,null);if(p.data==="$!"){if(c=p.nextSibling&&p.nextSibling.dataset,c)var T=c.dgst;return c=T,_=Error(r(419)),c=Ec(_,c,void 0),qa(i,s,b,c)}if(T=(b&i.childLanes)!==0,Bt||T){if(c=ht,c!==null){switch(b&-b){case 4:p=2;break;case 16:p=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:p=32;break;case 536870912:p=268435456;break;default:p=0}p=(p&(c.suspendedLanes|b))!==0?0:p,p!==0&&p!==_.retryLane&&(_.retryLane=p,ti(i,p),Tr(c,i,p,-1))}return Kc(),c=Ec(Error(r(421))),qa(i,s,b,c)}return p.data==="$?"?(s.flags|=128,s.child=i.child,s=Yk.bind(null,i),p._reactRetry=s,null):(i=_.treeContext,jt=xi(p.nextSibling),Ut=s,He=!0,Cr=null,i!==null&&(er[tr++]=Qr,er[tr++]=ei,er[tr++]=nn,Qr=i.id,ei=i.overflow,nn=s),s=Rc(s,c.children),s.flags|=4096,s)}function _y(i,s,l){i.lanes|=s;var c=i.alternate;c!==null&&(c.lanes|=s),ac(i.return,s,l)}function Pc(i,s,l,c,p){var _=i.memoizedState;_===null?i.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:c,tail:l,tailMode:p}:(_.isBackwards=s,_.rendering=null,_.renderingStartTime=0,_.last=c,_.tail=l,_.tailMode=p)}function gy(i,s,l){var c=s.pendingProps,p=c.revealOrder,_=c.tail;if(Ot(i,s,c.children,l),c=We.current,(c&2)!==0)c=c&1|2,s.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=s.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&_y(i,l,s);else if(i.tag===19)_y(i,l,s);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break e;for(;i.sibling===null;){if(i.return===null||i.return===s)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}c&=1}if(Le(We,c),(s.mode&1)===0)s.memoizedState=null;else switch(p){case"forwards":for(l=s.child,p=null;l!==null;)i=l.alternate,i!==null&&Pa(i)===null&&(p=l),l=l.sibling;l=p,l===null?(p=s.child,s.child=null):(p=l.sibling,l.sibling=null),Pc(s,!1,p,l,_);break;case"backwards":for(l=null,p=s.child,s.child=null;p!==null;){if(i=p.alternate,i!==null&&Pa(i)===null){s.child=p;break}i=p.sibling,p.sibling=l,l=p,p=i}Pc(s,!0,l,null,_);break;case"together":Pc(s,!1,null,null,void 0);break;default:s.memoizedState=null}return s.child}function Fa(i,s){(s.mode&1)===0&&i!==null&&(i.alternate=null,s.alternate=null,s.flags|=2)}function ii(i,s,l){if(i!==null&&(s.dependencies=i.dependencies),un|=s.lanes,(l&s.childLanes)===0)return null;if(i!==null&&s.child!==i.child)throw Error(r(153));if(s.child!==null){for(i=s.child,l=Bi(i,i.pendingProps),s.child=l,l.return=s;i.sibling!==null;)i=i.sibling,l=l.sibling=Bi(i,i.pendingProps),l.return=s;l.sibling=null}return s.child}function Nk(i,s,l){switch(s.tag){case 3:dy(s),jn();break;case 5:Rm(s);break;case 1:Lt(s.type)&&wa(s);break;case 4:cc(s,s.stateNode.containerInfo);break;case 10:var c=s.type._context,p=s.memoizedProps.value;Le(ka,c._currentValue),c._currentValue=p;break;case 13:if(c=s.memoizedState,c!==null)return c.dehydrated!==null?(Le(We,We.current&1),s.flags|=128,null):(l&s.child.childLanes)!==0?py(i,s,l):(Le(We,We.current&1),i=ii(i,s,l),i!==null?i.sibling:null);Le(We,We.current&1);break;case 19:if(c=(l&s.childLanes)!==0,(i.flags&128)!==0){if(c)return gy(i,s,l);s.flags|=128}if(p=s.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),Le(We,We.current),c)break;return null;case 22:case 23:return s.lanes=0,uy(i,s,l)}return ii(i,s,l)}var vy,Mc,my,yy;vy=function(i,s){for(var l=s.child;l!==null;){if(l.tag===5||l.tag===6)i.appendChild(l.stateNode);else if(l.tag!==4&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===s)break;for(;l.sibling===null;){if(l.return===null||l.return===s)return;l=l.return}l.sibling.return=l.return,l=l.sibling}},Mc=function(){},my=function(i,s,l,c){var p=i.memoizedProps;if(p!==c){i=s.stateNode,an(Nr.current);var _=null;switch(l){case"input":p=Yr(i,p),c=Yr(i,c),_=[];break;case"select":p=Z({},p,{value:void 0}),c=Z({},c,{value:void 0}),_=[];break;case"textarea":p=Qt(i,p),c=Qt(i,c),_=[];break;default:typeof p.onClick!="function"&&typeof c.onClick=="function"&&(i.onclick=ma)}du(l,c);var b;l=null;for(z in p)if(!c.hasOwnProperty(z)&&p.hasOwnProperty(z)&&p[z]!=null)if(z==="style"){var T=p[z];for(b in T)T.hasOwnProperty(b)&&(l||(l={}),l[b]="")}else z!=="dangerouslySetInnerHTML"&&z!=="children"&&z!=="suppressContentEditableWarning"&&z!=="suppressHydrationWarning"&&z!=="autoFocus"&&(o.hasOwnProperty(z)?_||(_=[]):(_=_||[]).push(z,null));for(z in c){var R=c[z];if(T=p!=null?p[z]:void 0,c.hasOwnProperty(z)&&R!==T&&(R!=null||T!=null))if(z==="style")if(T){for(b in T)!T.hasOwnProperty(b)||R&&R.hasOwnProperty(b)||(l||(l={}),l[b]="");for(b in R)R.hasOwnProperty(b)&&T[b]!==R[b]&&(l||(l={}),l[b]=R[b])}else l||(_||(_=[]),_.push(z,l)),l=R;else z==="dangerouslySetInnerHTML"?(R=R?R.__html:void 0,T=T?T.__html:void 0,R!=null&&T!==R&&(_=_||[]).push(z,R)):z==="children"?typeof R!="string"&&typeof R!="number"||(_=_||[]).push(z,""+R):z!=="suppressContentEditableWarning"&&z!=="suppressHydrationWarning"&&(o.hasOwnProperty(z)?(R!=null&&z==="onScroll"&&Be("scroll",i),_||T===R||(_=[])):(_=_||[]).push(z,R))}l&&(_=_||[]).push("style",l);var z=_;(s.updateQueue=z)&&(s.flags|=4)}},yy=function(i,s,l,c){l!==c&&(s.flags|=4)};function zs(i,s){if(!He)switch(i.tailMode){case"hidden":s=i.tail;for(var l=null;s!==null;)s.alternate!==null&&(l=s),s=s.sibling;l===null?i.tail=null:l.sibling=null;break;case"collapsed":l=i.tail;for(var c=null;l!==null;)l.alternate!==null&&(c=l),l=l.sibling;c===null?s||i.tail===null?i.tail=null:i.tail.sibling=null:c.sibling=null}}function Tt(i){var s=i.alternate!==null&&i.alternate.child===i.child,l=0,c=0;if(s)for(var p=i.child;p!==null;)l|=p.lanes|p.childLanes,c|=p.subtreeFlags&14680064,c|=p.flags&14680064,p.return=i,p=p.sibling;else for(p=i.child;p!==null;)l|=p.lanes|p.childLanes,c|=p.subtreeFlags,c|=p.flags,p.return=i,p=p.sibling;return i.subtreeFlags|=c,i.childLanes=l,s}function qk(i,s,l){var c=s.pendingProps;switch(ec(s),s.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Tt(s),null;case 1:return Lt(s.type)&&Sa(),Tt(s),null;case 3:return c=s.stateNode,Gn(),Ne(It),Ne(Et),fc(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(i===null||i.child===null)&&(xa(s)?s.flags|=4:i===null||i.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,Cr!==null&&(Uc(Cr),Cr=null))),Mc(i,s),Tt(s),null;case 5:hc(s);var p=an(Bs.current);if(l=s.type,i!==null&&s.stateNode!=null)my(i,s,l,c,p),i.ref!==s.ref&&(s.flags|=512,s.flags|=2097152);else{if(!c){if(s.stateNode===null)throw Error(r(166));return Tt(s),null}if(i=an(Nr.current),xa(s)){c=s.stateNode,l=s.type;var _=s.memoizedProps;switch(c[Br]=s,c[Ps]=_,i=(s.mode&1)!==0,l){case"dialog":Be("cancel",c),Be("close",c);break;case"iframe":case"object":case"embed":Be("load",c);break;case"video":case"audio":for(p=0;p<Ds.length;p++)Be(Ds[p],c);break;case"source":Be("error",c);break;case"img":case"image":case"link":Be("error",c),Be("load",c);break;case"details":Be("toggle",c);break;case"input":Me(c,_),Be("invalid",c);break;case"select":c._wrapperState={wasMultiple:!!_.multiple},Be("invalid",c);break;case"textarea":mt(c,_),Be("invalid",c)}du(l,_),p=null;for(var b in _)if(_.hasOwnProperty(b)){var T=_[b];b==="children"?typeof T=="string"?c.textContent!==T&&(_.suppressHydrationWarning!==!0&&va(c.textContent,T,i),p=["children",T]):typeof T=="number"&&c.textContent!==""+T&&(_.suppressHydrationWarning!==!0&&va(c.textContent,T,i),p=["children",""+T]):o.hasOwnProperty(b)&&T!=null&&b==="onScroll"&&Be("scroll",c)}switch(l){case"input":Jt(c),Xr(c,_,!0);break;case"textarea":Jt(c),Ji(c);break;case"select":case"option":break;default:typeof _.onClick=="function"&&(c.onclick=ma)}c=p,s.updateQueue=c,c!==null&&(s.flags|=4)}else{b=p.nodeType===9?p:p.ownerDocument,i==="http://www.w3.org/1999/xhtml"&&(i=Yo(l)),i==="http://www.w3.org/1999/xhtml"?l==="script"?(i=b.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild)):typeof c.is=="string"?i=b.createElement(l,{is:c.is}):(i=b.createElement(l),l==="select"&&(b=i,c.multiple?b.multiple=!0:c.size&&(b.size=c.size))):i=b.createElementNS(i,l),i[Br]=s,i[Ps]=c,vy(i,s,!1,!1),s.stateNode=i;e:{switch(b=fu(l,c),l){case"dialog":Be("cancel",i),Be("close",i),p=c;break;case"iframe":case"object":case"embed":Be("load",i),p=c;break;case"video":case"audio":for(p=0;p<Ds.length;p++)Be(Ds[p],i);p=c;break;case"source":Be("error",i),p=c;break;case"img":case"image":case"link":Be("error",i),Be("load",i),p=c;break;case"details":Be("toggle",i),p=c;break;case"input":Me(i,c),p=Yr(i,c),Be("invalid",i);break;case"option":p=c;break;case"select":i._wrapperState={wasMultiple:!!c.multiple},p=Z({},c,{value:void 0}),Be("invalid",i);break;case"textarea":mt(i,c),p=Qt(i,c),Be("invalid",i);break;default:p=c}du(l,p),T=p;for(_ in T)if(T.hasOwnProperty(_)){var R=T[_];_==="style"?Ir(i,R):_==="dangerouslySetInnerHTML"?(R=R?R.__html:void 0,R!=null&&cs(i,R)):_==="children"?typeof R=="string"?(l!=="textarea"||R!=="")&&mi(i,R):typeof R=="number"&&mi(i,""+R):_!=="suppressContentEditableWarning"&&_!=="suppressHydrationWarning"&&_!=="autoFocus"&&(o.hasOwnProperty(_)?R!=null&&_==="onScroll"&&Be("scroll",i):R!=null&&k(i,_,R,b))}switch(l){case"input":Jt(i),Xr(i,c,!1);break;case"textarea":Jt(i),Ji(i);break;case"option":c.value!=null&&i.setAttribute("value",""+Ce(c.value));break;case"select":i.multiple=!!c.multiple,_=c.value,_!=null?vr(i,!!c.multiple,_,!1):c.defaultValue!=null&&vr(i,!!c.multiple,c.defaultValue,!0);break;default:typeof p.onClick=="function"&&(i.onclick=ma)}switch(l){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}}c&&(s.flags|=4)}s.ref!==null&&(s.flags|=512,s.flags|=2097152)}return Tt(s),null;case 6:if(i&&s.stateNode!=null)yy(i,s,i.memoizedProps,c);else{if(typeof c!="string"&&s.stateNode===null)throw Error(r(166));if(l=an(Bs.current),an(Nr.current),xa(s)){if(c=s.stateNode,l=s.memoizedProps,c[Br]=s,(_=c.nodeValue!==l)&&(i=Ut,i!==null))switch(i.tag){case 3:va(c.nodeValue,l,(i.mode&1)!==0);break;case 5:i.memoizedProps.suppressHydrationWarning!==!0&&va(c.nodeValue,l,(i.mode&1)!==0)}_&&(s.flags|=4)}else c=(l.nodeType===9?l:l.ownerDocument).createTextNode(c),c[Br]=s,s.stateNode=c}return Tt(s),null;case 13:if(Ne(We),c=s.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(He&&jt!==null&&(s.mode&1)!==0&&(s.flags&128)===0)Cm(),jn(),s.flags|=98560,_=!1;else if(_=xa(s),c!==null&&c.dehydrated!==null){if(i===null){if(!_)throw Error(r(318));if(_=s.memoizedState,_=_!==null?_.dehydrated:null,!_)throw Error(r(317));_[Br]=s}else jn(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Tt(s),_=!1}else Cr!==null&&(Uc(Cr),Cr=null),_=!0;if(!_)return s.flags&65536?s:null}return(s.flags&128)!==0?(s.lanes=l,s):(c=c!==null,c!==(i!==null&&i.memoizedState!==null)&&c&&(s.child.flags|=8192,(s.mode&1)!==0&&(i===null||(We.current&1)!==0?nt===0&&(nt=3):Kc())),s.updateQueue!==null&&(s.flags|=4),Tt(s),null);case 4:return Gn(),Mc(i,s),i===null&&Os(s.stateNode.containerInfo),Tt(s),null;case 10:return oc(s.type._context),Tt(s),null;case 17:return Lt(s.type)&&Sa(),Tt(s),null;case 19:if(Ne(We),_=s.memoizedState,_===null)return Tt(s),null;if(c=(s.flags&128)!==0,b=_.rendering,b===null)if(c)zs(_,!1);else{if(nt!==0||i!==null&&(i.flags&128)!==0)for(i=s.child;i!==null;){if(b=Pa(i),b!==null){for(s.flags|=128,zs(_,!1),c=b.updateQueue,c!==null&&(s.updateQueue=c,s.flags|=4),s.subtreeFlags=0,c=l,l=s.child;l!==null;)_=l,i=c,_.flags&=14680066,b=_.alternate,b===null?(_.childLanes=0,_.lanes=i,_.child=null,_.subtreeFlags=0,_.memoizedProps=null,_.memoizedState=null,_.updateQueue=null,_.dependencies=null,_.stateNode=null):(_.childLanes=b.childLanes,_.lanes=b.lanes,_.child=b.child,_.subtreeFlags=0,_.deletions=null,_.memoizedProps=b.memoizedProps,_.memoizedState=b.memoizedState,_.updateQueue=b.updateQueue,_.type=b.type,i=b.dependencies,_.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),l=l.sibling;return Le(We,We.current&1|2),s.child}i=i.sibling}_.tail!==null&&Ye()>Jn&&(s.flags|=128,c=!0,zs(_,!1),s.lanes=4194304)}else{if(!c)if(i=Pa(b),i!==null){if(s.flags|=128,c=!0,l=i.updateQueue,l!==null&&(s.updateQueue=l,s.flags|=4),zs(_,!0),_.tail===null&&_.tailMode==="hidden"&&!b.alternate&&!He)return Tt(s),null}else 2*Ye()-_.renderingStartTime>Jn&&l!==1073741824&&(s.flags|=128,c=!0,zs(_,!1),s.lanes=4194304);_.isBackwards?(b.sibling=s.child,s.child=b):(l=_.last,l!==null?l.sibling=b:s.child=b,_.last=b)}return _.tail!==null?(s=_.tail,_.rendering=s,_.tail=s.sibling,_.renderingStartTime=Ye(),s.sibling=null,l=We.current,Le(We,c?l&1|2:l&1),s):(Tt(s),null);case 22:case 23:return $c(),c=s.memoizedState!==null,i!==null&&i.memoizedState!==null!==c&&(s.flags|=8192),c&&(s.mode&1)!==0?($t&1073741824)!==0&&(Tt(s),s.subtreeFlags&6&&(s.flags|=8192)):Tt(s),null;case 24:return null;case 25:return null}throw Error(r(156,s.tag))}function Fk(i,s){switch(ec(s),s.tag){case 1:return Lt(s.type)&&Sa(),i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 3:return Gn(),Ne(It),Ne(Et),fc(),i=s.flags,(i&65536)!==0&&(i&128)===0?(s.flags=i&-65537|128,s):null;case 5:return hc(s),null;case 13:if(Ne(We),i=s.memoizedState,i!==null&&i.dehydrated!==null){if(s.alternate===null)throw Error(r(340));jn()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 19:return Ne(We),null;case 4:return Gn(),null;case 10:return oc(s.type._context),null;case 22:case 23:return $c(),null;case 24:return null;default:return null}}var Ha=!1,kt=!1,Hk=typeof WeakSet=="function"?WeakSet:Set,ae=null;function Xn(i,s){var l=i.ref;if(l!==null)if(typeof l=="function")try{l(null)}catch(c){Ke(i,s,c)}else l.current=null}function Ac(i,s,l){try{l()}catch(c){Ke(i,s,c)}}var Sy=!1;function zk(i,s){if($u=oa,i=Jv(),Nu(i)){if("selectionStart"in i)var l={start:i.selectionStart,end:i.selectionEnd};else e:{l=(l=i.ownerDocument)&&l.defaultView||window;var c=l.getSelection&&l.getSelection();if(c&&c.rangeCount!==0){l=c.anchorNode;var p=c.anchorOffset,_=c.focusNode;c=c.focusOffset;try{l.nodeType,_.nodeType}catch{l=null;break e}var b=0,T=-1,R=-1,z=0,X=0,J=i,Y=null;t:for(;;){for(var se;J!==l||p!==0&&J.nodeType!==3||(T=b+p),J!==_||c!==0&&J.nodeType!==3||(R=b+c),J.nodeType===3&&(b+=J.nodeValue.length),(se=J.firstChild)!==null;)Y=J,J=se;for(;;){if(J===i)break t;if(Y===l&&++z===p&&(T=b),Y===_&&++X===c&&(R=b),(se=J.nextSibling)!==null)break;J=Y,Y=J.parentNode}J=se}l=T===-1||R===-1?null:{start:T,end:R}}else l=null}l=l||{start:0,end:0}}else l=null;for(Ku={focusedElem:i,selectionRange:l},oa=!1,ae=s;ae!==null;)if(s=ae,i=s.child,(s.subtreeFlags&1028)!==0&&i!==null)i.return=s,ae=i;else for(;ae!==null;){s=ae;try{var le=s.alternate;if((s.flags&1024)!==0)switch(s.tag){case 0:case 11:case 15:break;case 1:if(le!==null){var ue=le.memoizedProps,Xe=le.memoizedState,L=s.stateNode,A=L.getSnapshotBeforeUpdate(s.elementType===s.type?ue:br(s.type,ue),Xe);L.__reactInternalSnapshotBeforeUpdate=A}break;case 3:var N=s.stateNode.containerInfo;N.nodeType===1?N.textContent="":N.nodeType===9&&N.documentElement&&N.removeChild(N.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(te){Ke(s,s.return,te)}if(i=s.sibling,i!==null){i.return=s.return,ae=i;break}ae=s.return}return le=Sy,Sy=!1,le}function Ws(i,s,l){var c=s.updateQueue;if(c=c!==null?c.lastEffect:null,c!==null){var p=c=c.next;do{if((p.tag&i)===i){var _=p.destroy;p.destroy=void 0,_!==void 0&&Ac(s,l,_)}p=p.next}while(p!==c)}}function za(i,s){if(s=s.updateQueue,s=s!==null?s.lastEffect:null,s!==null){var l=s=s.next;do{if((l.tag&i)===i){var c=l.create;l.destroy=c()}l=l.next}while(l!==s)}}function Ic(i){var s=i.ref;if(s!==null){var l=i.stateNode;switch(i.tag){case 5:i=l;break;default:i=l}typeof s=="function"?s(i):s.current=i}}function wy(i){var s=i.alternate;s!==null&&(i.alternate=null,wy(s)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(s=i.stateNode,s!==null&&(delete s[Br],delete s[Ps],delete s[Xu],delete s[bk],delete s[Ek])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function Cy(i){return i.tag===5||i.tag===3||i.tag===4}function by(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Cy(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Lc(i,s,l){var c=i.tag;if(c===5||c===6)i=i.stateNode,s?l.nodeType===8?l.parentNode.insertBefore(i,s):l.insertBefore(i,s):(l.nodeType===8?(s=l.parentNode,s.insertBefore(i,l)):(s=l,s.appendChild(i)),l=l._reactRootContainer,l!=null||s.onclick!==null||(s.onclick=ma));else if(c!==4&&(i=i.child,i!==null))for(Lc(i,s,l),i=i.sibling;i!==null;)Lc(i,s,l),i=i.sibling}function Bc(i,s,l){var c=i.tag;if(c===5||c===6)i=i.stateNode,s?l.insertBefore(i,s):l.appendChild(i);else if(c!==4&&(i=i.child,i!==null))for(Bc(i,s,l),i=i.sibling;i!==null;)Bc(i,s,l),i=i.sibling}var yt=null,Er=!1;function Pi(i,s,l){for(l=l.child;l!==null;)Ey(i,s,l),l=l.sibling}function Ey(i,s,l){if(Lr&&typeof Lr.onCommitFiberUnmount=="function")try{Lr.onCommitFiberUnmount(ea,l)}catch{}switch(l.tag){case 5:kt||Xn(l,s);case 6:var c=yt,p=Er;yt=null,Pi(i,s,l),yt=c,Er=p,yt!==null&&(Er?(i=yt,l=l.stateNode,i.nodeType===8?i.parentNode.removeChild(l):i.removeChild(l)):yt.removeChild(l.stateNode));break;case 18:yt!==null&&(Er?(i=yt,l=l.stateNode,i.nodeType===8?Yu(i.parentNode,l):i.nodeType===1&&Yu(i,l),Ss(i)):Yu(yt,l.stateNode));break;case 4:c=yt,p=Er,yt=l.stateNode.containerInfo,Er=!0,Pi(i,s,l),yt=c,Er=p;break;case 0:case 11:case 14:case 15:if(!kt&&(c=l.updateQueue,c!==null&&(c=c.lastEffect,c!==null))){p=c=c.next;do{var _=p,b=_.destroy;_=_.tag,b!==void 0&&((_&2)!==0||(_&4)!==0)&&Ac(l,s,b),p=p.next}while(p!==c)}Pi(i,s,l);break;case 1:if(!kt&&(Xn(l,s),c=l.stateNode,typeof c.componentWillUnmount=="function"))try{c.props=l.memoizedProps,c.state=l.memoizedState,c.componentWillUnmount()}catch(T){Ke(l,s,T)}Pi(i,s,l);break;case 21:Pi(i,s,l);break;case 22:l.mode&1?(kt=(c=kt)||l.memoizedState!==null,Pi(i,s,l),kt=c):Pi(i,s,l);break;default:Pi(i,s,l)}}function xy(i){var s=i.updateQueue;if(s!==null){i.updateQueue=null;var l=i.stateNode;l===null&&(l=i.stateNode=new Hk),s.forEach(function(c){var p=Xk.bind(null,i,c);l.has(c)||(l.add(c),c.then(p,p))})}}function xr(i,s){var l=s.deletions;if(l!==null)for(var c=0;c<l.length;c++){var p=l[c];try{var _=i,b=s,T=b;e:for(;T!==null;){switch(T.tag){case 5:yt=T.stateNode,Er=!1;break e;case 3:yt=T.stateNode.containerInfo,Er=!0;break e;case 4:yt=T.stateNode.containerInfo,Er=!0;break e}T=T.return}if(yt===null)throw Error(r(160));Ey(_,b,p),yt=null,Er=!1;var R=p.alternate;R!==null&&(R.return=null),p.return=null}catch(z){Ke(p,s,z)}}if(s.subtreeFlags&12854)for(s=s.child;s!==null;)Ty(s,i),s=s.sibling}function Ty(i,s){var l=i.alternate,c=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:if(xr(s,i),Fr(i),c&4){try{Ws(3,i,i.return),za(3,i)}catch(ue){Ke(i,i.return,ue)}try{Ws(5,i,i.return)}catch(ue){Ke(i,i.return,ue)}}break;case 1:xr(s,i),Fr(i),c&512&&l!==null&&Xn(l,l.return);break;case 5:if(xr(s,i),Fr(i),c&512&&l!==null&&Xn(l,l.return),i.flags&32){var p=i.stateNode;try{mi(p,"")}catch(ue){Ke(i,i.return,ue)}}if(c&4&&(p=i.stateNode,p!=null)){var _=i.memoizedProps,b=l!==null?l.memoizedProps:_,T=i.type,R=i.updateQueue;if(i.updateQueue=null,R!==null)try{T==="input"&&_.type==="radio"&&_.name!=null&&Yi(p,_),fu(T,b);var z=fu(T,_);for(b=0;b<R.length;b+=2){var X=R[b],J=R[b+1];X==="style"?Ir(p,J):X==="dangerouslySetInnerHTML"?cs(p,J):X==="children"?mi(p,J):k(p,X,J,z)}switch(T){case"input":Oe(p,_);break;case"textarea":Zi(p,_);break;case"select":var Y=p._wrapperState.wasMultiple;p._wrapperState.wasMultiple=!!_.multiple;var se=_.value;se!=null?vr(p,!!_.multiple,se,!1):Y!==!!_.multiple&&(_.defaultValue!=null?vr(p,!!_.multiple,_.defaultValue,!0):vr(p,!!_.multiple,_.multiple?[]:"",!1))}p[Ps]=_}catch(ue){Ke(i,i.return,ue)}}break;case 6:if(xr(s,i),Fr(i),c&4){if(i.stateNode===null)throw Error(r(162));p=i.stateNode,_=i.memoizedProps;try{p.nodeValue=_}catch(ue){Ke(i,i.return,ue)}}break;case 3:if(xr(s,i),Fr(i),c&4&&l!==null&&l.memoizedState.isDehydrated)try{Ss(s.containerInfo)}catch(ue){Ke(i,i.return,ue)}break;case 4:xr(s,i),Fr(i);break;case 13:xr(s,i),Fr(i),p=i.child,p.flags&8192&&(_=p.memoizedState!==null,p.stateNode.isHidden=_,!_||p.alternate!==null&&p.alternate.memoizedState!==null||(Fc=Ye())),c&4&&xy(i);break;case 22:if(X=l!==null&&l.memoizedState!==null,i.mode&1?(kt=(z=kt)||X,xr(s,i),kt=z):xr(s,i),Fr(i),c&8192){if(z=i.memoizedState!==null,(i.stateNode.isHidden=z)&&!X&&(i.mode&1)!==0)for(ae=i,X=i.child;X!==null;){for(J=ae=X;ae!==null;){switch(Y=ae,se=Y.child,Y.tag){case 0:case 11:case 14:case 15:Ws(4,Y,Y.return);break;case 1:Xn(Y,Y.return);var le=Y.stateNode;if(typeof le.componentWillUnmount=="function"){c=Y,l=Y.return;try{s=c,le.props=s.memoizedProps,le.state=s.memoizedState,le.componentWillUnmount()}catch(ue){Ke(c,l,ue)}}break;case 5:Xn(Y,Y.return);break;case 22:if(Y.memoizedState!==null){Oy(J);continue}}se!==null?(se.return=Y,ae=se):Oy(J)}X=X.sibling}e:for(X=null,J=i;;){if(J.tag===5){if(X===null){X=J;try{p=J.stateNode,z?(_=p.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none"):(T=J.stateNode,R=J.memoizedProps.style,b=R!=null&&R.hasOwnProperty("display")?R.display:null,T.style.display=yr("display",b))}catch(ue){Ke(i,i.return,ue)}}}else if(J.tag===6){if(X===null)try{J.stateNode.nodeValue=z?"":J.memoizedProps}catch(ue){Ke(i,i.return,ue)}}else if((J.tag!==22&&J.tag!==23||J.memoizedState===null||J===i)&&J.child!==null){J.child.return=J,J=J.child;continue}if(J===i)break e;for(;J.sibling===null;){if(J.return===null||J.return===i)break e;X===J&&(X=null),J=J.return}X===J&&(X=null),J.sibling.return=J.return,J=J.sibling}}break;case 19:xr(s,i),Fr(i),c&4&&xy(i);break;case 21:break;default:xr(s,i),Fr(i)}}function Fr(i){var s=i.flags;if(s&2){try{e:{for(var l=i.return;l!==null;){if(Cy(l)){var c=l;break e}l=l.return}throw Error(r(160))}switch(c.tag){case 5:var p=c.stateNode;c.flags&32&&(mi(p,""),c.flags&=-33);var _=by(i);Bc(i,_,p);break;case 3:case 4:var b=c.stateNode.containerInfo,T=by(i);Lc(i,T,b);break;default:throw Error(r(161))}}catch(R){Ke(i,i.return,R)}i.flags&=-3}s&4096&&(i.flags&=-4097)}function Wk(i,s,l){ae=i,ky(i)}function ky(i,s,l){for(var c=(i.mode&1)!==0;ae!==null;){var p=ae,_=p.child;if(p.tag===22&&c){var b=p.memoizedState!==null||Ha;if(!b){var T=p.alternate,R=T!==null&&T.memoizedState!==null||kt;T=Ha;var z=kt;if(Ha=b,(kt=R)&&!z)for(ae=p;ae!==null;)b=ae,R=b.child,b.tag===22&&b.memoizedState!==null?Ry(p):R!==null?(R.return=b,ae=R):Ry(p);for(;_!==null;)ae=_,ky(_),_=_.sibling;ae=p,Ha=T,kt=z}Dy(i)}else(p.subtreeFlags&8772)!==0&&_!==null?(_.return=p,ae=_):Dy(i)}}function Dy(i){for(;ae!==null;){var s=ae;if((s.flags&8772)!==0){var l=s.alternate;try{if((s.flags&8772)!==0)switch(s.tag){case 0:case 11:case 15:kt||za(5,s);break;case 1:var c=s.stateNode;if(s.flags&4&&!kt)if(l===null)c.componentDidMount();else{var p=s.elementType===s.type?l.memoizedProps:br(s.type,l.memoizedProps);c.componentDidUpdate(p,l.memoizedState,c.__reactInternalSnapshotBeforeUpdate)}var _=s.updateQueue;_!==null&&Om(s,_,c);break;case 3:var b=s.updateQueue;if(b!==null){if(l=null,s.child!==null)switch(s.child.tag){case 5:l=s.child.stateNode;break;case 1:l=s.child.stateNode}Om(s,b,l)}break;case 5:var T=s.stateNode;if(l===null&&s.flags&4){l=T;var R=s.memoizedProps;switch(s.type){case"button":case"input":case"select":case"textarea":R.autoFocus&&l.focus();break;case"img":R.src&&(l.src=R.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(s.memoizedState===null){var z=s.alternate;if(z!==null){var X=z.memoizedState;if(X!==null){var J=X.dehydrated;J!==null&&Ss(J)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}kt||s.flags&512&&Ic(s)}catch(Y){Ke(s,s.return,Y)}}if(s===i){ae=null;break}if(l=s.sibling,l!==null){l.return=s.return,ae=l;break}ae=s.return}}function Oy(i){for(;ae!==null;){var s=ae;if(s===i){ae=null;break}var l=s.sibling;if(l!==null){l.return=s.return,ae=l;break}ae=s.return}}function Ry(i){for(;ae!==null;){var s=ae;try{switch(s.tag){case 0:case 11:case 15:var l=s.return;try{za(4,s)}catch(R){Ke(s,l,R)}break;case 1:var c=s.stateNode;if(typeof c.componentDidMount=="function"){var p=s.return;try{c.componentDidMount()}catch(R){Ke(s,p,R)}}var _=s.return;try{Ic(s)}catch(R){Ke(s,_,R)}break;case 5:var b=s.return;try{Ic(s)}catch(R){Ke(s,b,R)}}}catch(R){Ke(s,s.return,R)}if(s===i){ae=null;break}var T=s.sibling;if(T!==null){T.return=s.return,ae=T;break}ae=s.return}}var Uk=Math.ceil,Wa=D.ReactCurrentDispatcher,Nc=D.ReactCurrentOwner,nr=D.ReactCurrentBatchConfig,Re=0,ht=null,Qe=null,St=0,$t=0,Zn=Ti(0),nt=0,Us=null,un=0,Ua=0,qc=0,js=null,Nt=null,Fc=0,Jn=1/0,ni=null,ja=!1,Hc=null,Mi=null,$a=!1,Ai=null,Ka=0,$s=0,zc=null,Va=-1,Ga=0;function Rt(){return(Re&6)!==0?Ye():Va!==-1?Va:Va=Ye()}function Ii(i){return(i.mode&1)===0?1:(Re&2)!==0&&St!==0?St&-St:Tk.transition!==null?(Ga===0&&(Ga=bv()),Ga):(i=Ae,i!==0||(i=window.event,i=i===void 0?16:Mv(i.type)),i)}function Tr(i,s,l,c){if(50<$s)throw $s=0,zc=null,Error(r(185));_s(i,l,c),((Re&2)===0||i!==ht)&&(i===ht&&((Re&2)===0&&(Ua|=l),nt===4&&Li(i,St)),qt(i,c),l===1&&Re===0&&(s.mode&1)===0&&(Jn=Ye()+500,Ca&&Di()))}function qt(i,s){var l=i.callbackNode;TT(i,s);var c=ia(i,i===ht?St:0);if(c===0)l!==null&&Sv(l),i.callbackNode=null,i.callbackPriority=0;else if(s=c&-c,i.callbackPriority!==s){if(l!=null&&Sv(l),s===1)i.tag===0?xk(My.bind(null,i)):vm(My.bind(null,i)),wk(function(){(Re&6)===0&&Di()}),l=null;else{switch(Ev(c)){case 1:l=Su;break;case 4:l=wv;break;case 16:l=Qo;break;case 536870912:l=Cv;break;default:l=Qo}l=Hy(l,Py.bind(null,i))}i.callbackPriority=s,i.callbackNode=l}}function Py(i,s){if(Va=-1,Ga=0,(Re&6)!==0)throw Error(r(327));var l=i.callbackNode;if(Qn()&&i.callbackNode!==l)return null;var c=ia(i,i===ht?St:0);if(c===0)return null;if((c&30)!==0||(c&i.expiredLanes)!==0||s)s=Ya(i,c);else{s=c;var p=Re;Re|=2;var _=Iy();(ht!==i||St!==s)&&(ni=null,Jn=Ye()+500,hn(i,s));do try{Kk();break}catch(T){Ay(i,T)}while(!0);sc(),Wa.current=_,Re=p,Qe!==null?s=0:(ht=null,St=0,s=nt)}if(s!==0){if(s===2&&(p=wu(i),p!==0&&(c=p,s=Wc(i,p))),s===1)throw l=Us,hn(i,0),Li(i,c),qt(i,Ye()),l;if(s===6)Li(i,c);else{if(p=i.current.alternate,(c&30)===0&&!jk(p)&&(s=Ya(i,c),s===2&&(_=wu(i),_!==0&&(c=_,s=Wc(i,_))),s===1))throw l=Us,hn(i,0),Li(i,c),qt(i,Ye()),l;switch(i.finishedWork=p,i.finishedLanes=c,s){case 0:case 1:throw Error(r(345));case 2:dn(i,Nt,ni);break;case 3:if(Li(i,c),(c&130023424)===c&&(s=Fc+500-Ye(),10<s)){if(ia(i,0)!==0)break;if(p=i.suspendedLanes,(p&c)!==c){Rt(),i.pingedLanes|=i.suspendedLanes&p;break}i.timeoutHandle=Gu(dn.bind(null,i,Nt,ni),s);break}dn(i,Nt,ni);break;case 4:if(Li(i,c),(c&4194240)===c)break;for(s=i.eventTimes,p=-1;0<c;){var b=31-Sr(c);_=1<<b,b=s[b],b>p&&(p=b),c&=~_}if(c=p,c=Ye()-c,c=(120>c?120:480>c?480:1080>c?1080:1920>c?1920:3e3>c?3e3:4320>c?4320:1960*Uk(c/1960))-c,10<c){i.timeoutHandle=Gu(dn.bind(null,i,Nt,ni),c);break}dn(i,Nt,ni);break;case 5:dn(i,Nt,ni);break;default:throw Error(r(329))}}}return qt(i,Ye()),i.callbackNode===l?Py.bind(null,i):null}function Wc(i,s){var l=js;return i.current.memoizedState.isDehydrated&&(hn(i,s).flags|=256),i=Ya(i,s),i!==2&&(s=Nt,Nt=l,s!==null&&Uc(s)),i}function Uc(i){Nt===null?Nt=i:Nt.push.apply(Nt,i)}function jk(i){for(var s=i;;){if(s.flags&16384){var l=s.updateQueue;if(l!==null&&(l=l.stores,l!==null))for(var c=0;c<l.length;c++){var p=l[c],_=p.getSnapshot;p=p.value;try{if(!wr(_(),p))return!1}catch{return!1}}}if(l=s.child,s.subtreeFlags&16384&&l!==null)l.return=s,s=l;else{if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function Li(i,s){for(s&=~qc,s&=~Ua,i.suspendedLanes|=s,i.pingedLanes&=~s,i=i.expirationTimes;0<s;){var l=31-Sr(s),c=1<<l;i[l]=-1,s&=~c}}function My(i){if((Re&6)!==0)throw Error(r(327));Qn();var s=ia(i,0);if((s&1)===0)return qt(i,Ye()),null;var l=Ya(i,s);if(i.tag!==0&&l===2){var c=wu(i);c!==0&&(s=c,l=Wc(i,c))}if(l===1)throw l=Us,hn(i,0),Li(i,s),qt(i,Ye()),l;if(l===6)throw Error(r(345));return i.finishedWork=i.current.alternate,i.finishedLanes=s,dn(i,Nt,ni),qt(i,Ye()),null}function jc(i,s){var l=Re;Re|=1;try{return i(s)}finally{Re=l,Re===0&&(Jn=Ye()+500,Ca&&Di())}}function cn(i){Ai!==null&&Ai.tag===0&&(Re&6)===0&&Qn();var s=Re;Re|=1;var l=nr.transition,c=Ae;try{if(nr.transition=null,Ae=1,i)return i()}finally{Ae=c,nr.transition=l,Re=s,(Re&6)===0&&Di()}}function $c(){$t=Zn.current,Ne(Zn)}function hn(i,s){i.finishedWork=null,i.finishedLanes=0;var l=i.timeoutHandle;if(l!==-1&&(i.timeoutHandle=-1,Sk(l)),Qe!==null)for(l=Qe.return;l!==null;){var c=l;switch(ec(c),c.tag){case 1:c=c.type.childContextTypes,c!=null&&Sa();break;case 3:Gn(),Ne(It),Ne(Et),fc();break;case 5:hc(c);break;case 4:Gn();break;case 13:Ne(We);break;case 19:Ne(We);break;case 10:oc(c.type._context);break;case 22:case 23:$c()}l=l.return}if(ht=i,Qe=i=Bi(i.current,null),St=$t=s,nt=0,Us=null,qc=Ua=un=0,Nt=js=null,on!==null){for(s=0;s<on.length;s++)if(l=on[s],c=l.interleaved,c!==null){l.interleaved=null;var p=c.next,_=l.pending;if(_!==null){var b=_.next;_.next=p,c.next=b}l.pending=c}on=null}return i}function Ay(i,s){do{var l=Qe;try{if(sc(),Ma.current=Ba,Aa){for(var c=Ue.memoizedState;c!==null;){var p=c.queue;p!==null&&(p.pending=null),c=c.next}Aa=!1}if(ln=0,ct=it=Ue=null,Ns=!1,qs=0,Nc.current=null,l===null||l.return===null){nt=1,Us=s,Qe=null;break}e:{var _=i,b=l.return,T=l,R=s;if(s=St,T.flags|=32768,R!==null&&typeof R=="object"&&typeof R.then=="function"){var z=R,X=T,J=X.tag;if((X.mode&1)===0&&(J===0||J===11||J===15)){var Y=X.alternate;Y?(X.updateQueue=Y.updateQueue,X.memoizedState=Y.memoizedState,X.lanes=Y.lanes):(X.updateQueue=null,X.memoizedState=null)}var se=ny(b);if(se!==null){se.flags&=-257,sy(se,b,T,_,s),se.mode&1&&iy(_,z,s),s=se,R=z;var le=s.updateQueue;if(le===null){var ue=new Set;ue.add(R),s.updateQueue=ue}else le.add(R);break e}else{if((s&1)===0){iy(_,z,s),Kc();break e}R=Error(r(426))}}else if(He&&T.mode&1){var Xe=ny(b);if(Xe!==null){(Xe.flags&65536)===0&&(Xe.flags|=256),sy(Xe,b,T,_,s),ic(Yn(R,T));break e}}_=R=Yn(R,T),nt!==4&&(nt=2),js===null?js=[_]:js.push(_),_=b;do{switch(_.tag){case 3:_.flags|=65536,s&=-s,_.lanes|=s;var L=ty(_,R,s);Dm(_,L);break e;case 1:T=R;var A=_.type,N=_.stateNode;if((_.flags&128)===0&&(typeof A.getDerivedStateFromError=="function"||N!==null&&typeof N.componentDidCatch=="function"&&(Mi===null||!Mi.has(N)))){_.flags|=65536,s&=-s,_.lanes|=s;var te=ry(_,T,s);Dm(_,te);break e}}_=_.return}while(_!==null)}By(l)}catch(he){s=he,Qe===l&&l!==null&&(Qe=l=l.return);continue}break}while(!0)}function Iy(){var i=Wa.current;return Wa.current=Ba,i===null?Ba:i}function Kc(){(nt===0||nt===3||nt===2)&&(nt=4),ht===null||(un&268435455)===0&&(Ua&268435455)===0||Li(ht,St)}function Ya(i,s){var l=Re;Re|=2;var c=Iy();(ht!==i||St!==s)&&(ni=null,hn(i,s));do try{$k();break}catch(p){Ay(i,p)}while(!0);if(sc(),Re=l,Wa.current=c,Qe!==null)throw Error(r(261));return ht=null,St=0,nt}function $k(){for(;Qe!==null;)Ly(Qe)}function Kk(){for(;Qe!==null&&!vT();)Ly(Qe)}function Ly(i){var s=Fy(i.alternate,i,$t);i.memoizedProps=i.pendingProps,s===null?By(i):Qe=s,Nc.current=null}function By(i){var s=i;do{var l=s.alternate;if(i=s.return,(s.flags&32768)===0){if(l=qk(l,s,$t),l!==null){Qe=l;return}}else{if(l=Fk(l,s),l!==null){l.flags&=32767,Qe=l;return}if(i!==null)i.flags|=32768,i.subtreeFlags=0,i.deletions=null;else{nt=6,Qe=null;return}}if(s=s.sibling,s!==null){Qe=s;return}Qe=s=i}while(s!==null);nt===0&&(nt=5)}function dn(i,s,l){var c=Ae,p=nr.transition;try{nr.transition=null,Ae=1,Vk(i,s,l,c)}finally{nr.transition=p,Ae=c}return null}function Vk(i,s,l,c){do Qn();while(Ai!==null);if((Re&6)!==0)throw Error(r(327));l=i.finishedWork;var p=i.finishedLanes;if(l===null)return null;if(i.finishedWork=null,i.finishedLanes=0,l===i.current)throw Error(r(177));i.callbackNode=null,i.callbackPriority=0;var _=l.lanes|l.childLanes;if(kT(i,_),i===ht&&(Qe=ht=null,St=0),(l.subtreeFlags&2064)===0&&(l.flags&2064)===0||$a||($a=!0,Hy(Qo,function(){return Qn(),null})),_=(l.flags&15990)!==0,(l.subtreeFlags&15990)!==0||_){_=nr.transition,nr.transition=null;var b=Ae;Ae=1;var T=Re;Re|=4,Nc.current=null,zk(i,l),Ty(l,i),fk(Ku),oa=!!$u,Ku=$u=null,i.current=l,Wk(l),mT(),Re=T,Ae=b,nr.transition=_}else i.current=l;if($a&&($a=!1,Ai=i,Ka=p),_=i.pendingLanes,_===0&&(Mi=null),wT(l.stateNode),qt(i,Ye()),s!==null)for(c=i.onRecoverableError,l=0;l<s.length;l++)p=s[l],c(p.value,{componentStack:p.stack,digest:p.digest});if(ja)throw ja=!1,i=Hc,Hc=null,i;return(Ka&1)!==0&&i.tag!==0&&Qn(),_=i.pendingLanes,(_&1)!==0?i===zc?$s++:($s=0,zc=i):$s=0,Di(),null}function Qn(){if(Ai!==null){var i=Ev(Ka),s=nr.transition,l=Ae;try{if(nr.transition=null,Ae=16>i?16:i,Ai===null)var c=!1;else{if(i=Ai,Ai=null,Ka=0,(Re&6)!==0)throw Error(r(331));var p=Re;for(Re|=4,ae=i.current;ae!==null;){var _=ae,b=_.child;if((ae.flags&16)!==0){var T=_.deletions;if(T!==null){for(var R=0;R<T.length;R++){var z=T[R];for(ae=z;ae!==null;){var X=ae;switch(X.tag){case 0:case 11:case 15:Ws(8,X,_)}var J=X.child;if(J!==null)J.return=X,ae=J;else for(;ae!==null;){X=ae;var Y=X.sibling,se=X.return;if(wy(X),X===z){ae=null;break}if(Y!==null){Y.return=se,ae=Y;break}ae=se}}}var le=_.alternate;if(le!==null){var ue=le.child;if(ue!==null){le.child=null;do{var Xe=ue.sibling;ue.sibling=null,ue=Xe}while(ue!==null)}}ae=_}}if((_.subtreeFlags&2064)!==0&&b!==null)b.return=_,ae=b;else e:for(;ae!==null;){if(_=ae,(_.flags&2048)!==0)switch(_.tag){case 0:case 11:case 15:Ws(9,_,_.return)}var L=_.sibling;if(L!==null){L.return=_.return,ae=L;break e}ae=_.return}}var A=i.current;for(ae=A;ae!==null;){b=ae;var N=b.child;if((b.subtreeFlags&2064)!==0&&N!==null)N.return=b,ae=N;else e:for(b=A;ae!==null;){if(T=ae,(T.flags&2048)!==0)try{switch(T.tag){case 0:case 11:case 15:za(9,T)}}catch(he){Ke(T,T.return,he)}if(T===b){ae=null;break e}var te=T.sibling;if(te!==null){te.return=T.return,ae=te;break e}ae=T.return}}if(Re=p,Di(),Lr&&typeof Lr.onPostCommitFiberRoot=="function")try{Lr.onPostCommitFiberRoot(ea,i)}catch{}c=!0}return c}finally{Ae=l,nr.transition=s}}return!1}function Ny(i,s,l){s=Yn(l,s),s=ty(i,s,1),i=Ri(i,s,1),s=Rt(),i!==null&&(_s(i,1,s),qt(i,s))}function Ke(i,s,l){if(i.tag===3)Ny(i,i,l);else for(;s!==null;){if(s.tag===3){Ny(s,i,l);break}else if(s.tag===1){var c=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(Mi===null||!Mi.has(c))){i=Yn(l,i),i=ry(s,i,1),s=Ri(s,i,1),i=Rt(),s!==null&&(_s(s,1,i),qt(s,i));break}}s=s.return}}function Gk(i,s,l){var c=i.pingCache;c!==null&&c.delete(s),s=Rt(),i.pingedLanes|=i.suspendedLanes&l,ht===i&&(St&l)===l&&(nt===4||nt===3&&(St&130023424)===St&&500>Ye()-Fc?hn(i,0):qc|=l),qt(i,s)}function qy(i,s){s===0&&((i.mode&1)===0?s=1:(s=ra,ra<<=1,(ra&130023424)===0&&(ra=4194304)));var l=Rt();i=ti(i,s),i!==null&&(_s(i,s,l),qt(i,l))}function Yk(i){var s=i.memoizedState,l=0;s!==null&&(l=s.retryLane),qy(i,l)}function Xk(i,s){var l=0;switch(i.tag){case 13:var c=i.stateNode,p=i.memoizedState;p!==null&&(l=p.retryLane);break;case 19:c=i.stateNode;break;default:throw Error(r(314))}c!==null&&c.delete(s),qy(i,l)}var Fy;Fy=function(i,s,l){if(i!==null)if(i.memoizedProps!==s.pendingProps||It.current)Bt=!0;else{if((i.lanes&l)===0&&(s.flags&128)===0)return Bt=!1,Nk(i,s,l);Bt=(i.flags&131072)!==0}else Bt=!1,He&&(s.flags&1048576)!==0&&mm(s,Ea,s.index);switch(s.lanes=0,s.tag){case 2:var c=s.type;Fa(i,s),i=s.pendingProps;var p=zn(s,Et.current);Vn(s,l),p=gc(null,s,c,i,p,l);var _=vc();return s.flags|=1,typeof p=="object"&&p!==null&&typeof p.render=="function"&&p.$$typeof===void 0?(s.tag=1,s.memoizedState=null,s.updateQueue=null,Lt(c)?(_=!0,wa(s)):_=!1,s.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,uc(s),p.updater=Na,s.stateNode=p,p._reactInternals=s,bc(s,c,i,l),s=kc(null,s,c,!0,_,l)):(s.tag=0,He&&_&&Qu(s),Ot(null,s,p,l),s=s.child),s;case 16:c=s.elementType;e:{switch(Fa(i,s),i=s.pendingProps,p=c._init,c=p(c._payload),s.type=c,p=s.tag=Jk(c),i=br(c,i),p){case 0:s=Tc(null,s,c,i,l);break e;case 1:s=hy(null,s,c,i,l);break e;case 11:s=oy(null,s,c,i,l);break e;case 14:s=ay(null,s,c,br(c.type,i),l);break e}throw Error(r(306,c,""))}return s;case 0:return c=s.type,p=s.pendingProps,p=s.elementType===c?p:br(c,p),Tc(i,s,c,p,l);case 1:return c=s.type,p=s.pendingProps,p=s.elementType===c?p:br(c,p),hy(i,s,c,p,l);case 3:e:{if(dy(s),i===null)throw Error(r(387));c=s.pendingProps,_=s.memoizedState,p=_.element,km(i,s),Ra(s,c,null,l);var b=s.memoizedState;if(c=b.element,_.isDehydrated)if(_={element:c,isDehydrated:!1,cache:b.cache,pendingSuspenseBoundaries:b.pendingSuspenseBoundaries,transitions:b.transitions},s.updateQueue.baseState=_,s.memoizedState=_,s.flags&256){p=Yn(Error(r(423)),s),s=fy(i,s,c,l,p);break e}else if(c!==p){p=Yn(Error(r(424)),s),s=fy(i,s,c,l,p);break e}else for(jt=xi(s.stateNode.containerInfo.firstChild),Ut=s,He=!0,Cr=null,l=xm(s,null,c,l),s.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(jn(),c===p){s=ii(i,s,l);break e}Ot(i,s,c,l)}s=s.child}return s;case 5:return Rm(s),i===null&&rc(s),c=s.type,p=s.pendingProps,_=i!==null?i.memoizedProps:null,b=p.children,Vu(c,p)?b=null:_!==null&&Vu(c,_)&&(s.flags|=32),cy(i,s),Ot(i,s,b,l),s.child;case 6:return i===null&&rc(s),null;case 13:return py(i,s,l);case 4:return cc(s,s.stateNode.containerInfo),c=s.pendingProps,i===null?s.child=$n(s,null,c,l):Ot(i,s,c,l),s.child;case 11:return c=s.type,p=s.pendingProps,p=s.elementType===c?p:br(c,p),oy(i,s,c,p,l);case 7:return Ot(i,s,s.pendingProps,l),s.child;case 8:return Ot(i,s,s.pendingProps.children,l),s.child;case 12:return Ot(i,s,s.pendingProps.children,l),s.child;case 10:e:{if(c=s.type._context,p=s.pendingProps,_=s.memoizedProps,b=p.value,Le(ka,c._currentValue),c._currentValue=b,_!==null)if(wr(_.value,b)){if(_.children===p.children&&!It.current){s=ii(i,s,l);break e}}else for(_=s.child,_!==null&&(_.return=s);_!==null;){var T=_.dependencies;if(T!==null){b=_.child;for(var R=T.firstContext;R!==null;){if(R.context===c){if(_.tag===1){R=ri(-1,l&-l),R.tag=2;var z=_.updateQueue;if(z!==null){z=z.shared;var X=z.pending;X===null?R.next=R:(R.next=X.next,X.next=R),z.pending=R}}_.lanes|=l,R=_.alternate,R!==null&&(R.lanes|=l),ac(_.return,l,s),T.lanes|=l;break}R=R.next}}else if(_.tag===10)b=_.type===s.type?null:_.child;else if(_.tag===18){if(b=_.return,b===null)throw Error(r(341));b.lanes|=l,T=b.alternate,T!==null&&(T.lanes|=l),ac(b,l,s),b=_.sibling}else b=_.child;if(b!==null)b.return=_;else for(b=_;b!==null;){if(b===s){b=null;break}if(_=b.sibling,_!==null){_.return=b.return,b=_;break}b=b.return}_=b}Ot(i,s,p.children,l),s=s.child}return s;case 9:return p=s.type,c=s.pendingProps.children,Vn(s,l),p=rr(p),c=c(p),s.flags|=1,Ot(i,s,c,l),s.child;case 14:return c=s.type,p=br(c,s.pendingProps),p=br(c.type,p),ay(i,s,c,p,l);case 15:return ly(i,s,s.type,s.pendingProps,l);case 17:return c=s.type,p=s.pendingProps,p=s.elementType===c?p:br(c,p),Fa(i,s),s.tag=1,Lt(c)?(i=!0,wa(s)):i=!1,Vn(s,l),Qm(s,c,p),bc(s,c,p,l),kc(null,s,c,!0,i,l);case 19:return gy(i,s,l);case 22:return uy(i,s,l)}throw Error(r(156,s.tag))};function Hy(i,s){return yv(i,s)}function Zk(i,s,l,c){this.tag=i,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function sr(i,s,l,c){return new Zk(i,s,l,c)}function Vc(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Jk(i){if(typeof i=="function")return Vc(i)?1:0;if(i!=null){if(i=i.$$typeof,i===I)return 11;if(i===$)return 14}return 2}function Bi(i,s){var l=i.alternate;return l===null?(l=sr(i.tag,s,i.key,i.mode),l.elementType=i.elementType,l.type=i.type,l.stateNode=i.stateNode,l.alternate=i,i.alternate=l):(l.pendingProps=s,l.type=i.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=i.flags&14680064,l.childLanes=i.childLanes,l.lanes=i.lanes,l.child=i.child,l.memoizedProps=i.memoizedProps,l.memoizedState=i.memoizedState,l.updateQueue=i.updateQueue,s=i.dependencies,l.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},l.sibling=i.sibling,l.index=i.index,l.ref=i.ref,l}function Xa(i,s,l,c,p,_){var b=2;if(c=i,typeof i=="function")Vc(i)&&(b=1);else if(typeof i=="string")b=5;else e:switch(i){case P:return fn(l.children,p,_,s);case F:b=8,p|=8;break;case Q:return i=sr(12,l,s,p|2),i.elementType=Q,i.lanes=_,i;case O:return i=sr(13,l,s,p),i.elementType=O,i.lanes=_,i;case H:return i=sr(19,l,s,p),i.elementType=H,i.lanes=_,i;case ie:return Za(l,p,_,s);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case K:b=10;break e;case q:b=9;break e;case I:b=11;break e;case $:b=14;break e;case G:b=16,c=null;break e}throw Error(r(130,i==null?i:typeof i,""))}return s=sr(b,l,s,p),s.elementType=i,s.type=c,s.lanes=_,s}function fn(i,s,l,c){return i=sr(7,i,c,s),i.lanes=l,i}function Za(i,s,l,c){return i=sr(22,i,c,s),i.elementType=ie,i.lanes=l,i.stateNode={isHidden:!1},i}function Gc(i,s,l){return i=sr(6,i,null,s),i.lanes=l,i}function Yc(i,s,l){return s=sr(4,i.children!==null?i.children:[],i.key,s),s.lanes=l,s.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},s}function Qk(i,s,l,c,p){this.tag=s,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Cu(0),this.expirationTimes=Cu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Cu(0),this.identifierPrefix=c,this.onRecoverableError=p,this.mutableSourceEagerHydrationData=null}function Xc(i,s,l,c,p,_,b,T,R){return i=new Qk(i,s,l,T,R),s===1?(s=1,_===!0&&(s|=8)):s=0,_=sr(3,null,null,s),i.current=_,_.stateNode=i,_.memoizedState={element:c,isDehydrated:l,cache:null,transitions:null,pendingSuspenseBoundaries:null},uc(_),i}function eD(i,s,l){var c=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:W,key:c==null?null:""+c,children:i,containerInfo:s,implementation:l}}function zy(i){if(!i)return ki;i=i._reactInternals;e:{if(en(i)!==i||i.tag!==1)throw Error(r(170));var s=i;do{switch(s.tag){case 3:s=s.stateNode.context;break e;case 1:if(Lt(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break e}}s=s.return}while(s!==null);throw Error(r(171))}if(i.tag===1){var l=i.type;if(Lt(l))return _m(i,l,s)}return s}function Wy(i,s,l,c,p,_,b,T,R){return i=Xc(l,c,!0,i,p,_,b,T,R),i.context=zy(null),l=i.current,c=Rt(),p=Ii(l),_=ri(c,p),_.callback=s??null,Ri(l,_,p),i.current.lanes=p,_s(i,p,c),qt(i,c),i}function Ja(i,s,l,c){var p=s.current,_=Rt(),b=Ii(p);return l=zy(l),s.context===null?s.context=l:s.pendingContext=l,s=ri(_,b),s.payload={element:i},c=c===void 0?null:c,c!==null&&(s.callback=c),i=Ri(p,s,b),i!==null&&(Tr(i,p,b,_),Oa(i,p,b)),b}function Qa(i){if(i=i.current,!i.child)return null;switch(i.child.tag){case 5:return i.child.stateNode;default:return i.child.stateNode}}function Uy(i,s){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var l=i.retryLane;i.retryLane=l!==0&&l<s?l:s}}function Zc(i,s){Uy(i,s),(i=i.alternate)&&Uy(i,s)}function tD(){return null}var jy=typeof reportError=="function"?reportError:function(i){console.error(i)};function Jc(i){this._internalRoot=i}el.prototype.render=Jc.prototype.render=function(i){var s=this._internalRoot;if(s===null)throw Error(r(409));Ja(i,s,null,null)},el.prototype.unmount=Jc.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var s=i.containerInfo;cn(function(){Ja(null,i,null,null)}),s[Zr]=null}};function el(i){this._internalRoot=i}el.prototype.unstable_scheduleHydration=function(i){if(i){var s=kv();i={blockedOn:null,target:i,priority:s};for(var l=0;l<Ci.length&&s!==0&&s<Ci[l].priority;l++);Ci.splice(l,0,i),l===0&&Rv(i)}};function Qc(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function tl(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11&&(i.nodeType!==8||i.nodeValue!==" react-mount-point-unstable "))}function $y(){}function rD(i,s,l,c,p){if(p){if(typeof c=="function"){var _=c;c=function(){var z=Qa(b);_.call(z)}}var b=Wy(s,c,i,0,null,!1,!1,"",$y);return i._reactRootContainer=b,i[Zr]=b.current,Os(i.nodeType===8?i.parentNode:i),cn(),b}for(;p=i.lastChild;)i.removeChild(p);if(typeof c=="function"){var T=c;c=function(){var z=Qa(R);T.call(z)}}var R=Xc(i,0,!1,null,null,!1,!1,"",$y);return i._reactRootContainer=R,i[Zr]=R.current,Os(i.nodeType===8?i.parentNode:i),cn(function(){Ja(s,R,l,c)}),R}function rl(i,s,l,c,p){var _=l._reactRootContainer;if(_){var b=_;if(typeof p=="function"){var T=p;p=function(){var R=Qa(b);T.call(R)}}Ja(s,b,i,p)}else b=rD(l,s,i,p,c);return Qa(b)}xv=function(i){switch(i.tag){case 3:var s=i.stateNode;if(s.current.memoizedState.isDehydrated){var l=ps(s.pendingLanes);l!==0&&(bu(s,l|1),qt(s,Ye()),(Re&6)===0&&(Jn=Ye()+500,Di()))}break;case 13:cn(function(){var c=ti(i,1);if(c!==null){var p=Rt();Tr(c,i,1,p)}}),Zc(i,1)}},Eu=function(i){if(i.tag===13){var s=ti(i,134217728);if(s!==null){var l=Rt();Tr(s,i,134217728,l)}Zc(i,134217728)}},Tv=function(i){if(i.tag===13){var s=Ii(i),l=ti(i,s);if(l!==null){var c=Rt();Tr(l,i,s,c)}Zc(i,s)}},kv=function(){return Ae},Dv=function(i,s){var l=Ae;try{return Ae=i,s()}finally{Ae=l}},gu=function(i,s,l){switch(s){case"input":if(Oe(i,l),s=l.name,l.type==="radio"&&s!=null){for(l=i;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll("input[name="+JSON.stringify(""+s)+'][type="radio"]'),s=0;s<l.length;s++){var c=l[s];if(c!==i&&c.form===i.form){var p=ya(c);if(!p)throw Error(r(90));zt(c),Oe(c,p)}}}break;case"textarea":Zi(i,l);break;case"select":s=l.value,s!=null&&vr(i,!!l.multiple,s,!1)}},dv=jc,fv=cn;var iD={usingClientEntryPoint:!1,Events:[Ms,Fn,ya,cv,hv,jc]},Ks={findFiberByHostInstance:tn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},nD={bundleType:Ks.bundleType,version:Ks.version,rendererPackageName:Ks.rendererPackageName,rendererConfig:Ks.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:D.ReactCurrentDispatcher,findHostInstanceByFiber:function(i){return i=vv(i),i===null?null:i.stateNode},findFiberByHostInstance:Ks.findFiberByHostInstance||tD,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var il=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!il.isDisabled&&il.supportsFiber)try{ea=il.inject(nD),Lr=il}catch{}}return Ft.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=iD,Ft.createPortal=function(i,s){var l=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Qc(s))throw Error(r(200));return eD(i,s,null,l)},Ft.createRoot=function(i,s){if(!Qc(i))throw Error(r(299));var l=!1,c="",p=jy;return s!=null&&(s.unstable_strictMode===!0&&(l=!0),s.identifierPrefix!==void 0&&(c=s.identifierPrefix),s.onRecoverableError!==void 0&&(p=s.onRecoverableError)),s=Xc(i,1,!1,null,null,l,!1,c,p),i[Zr]=s.current,Os(i.nodeType===8?i.parentNode:i),new Jc(s)},Ft.findDOMNode=function(i){if(i==null)return null;if(i.nodeType===1)return i;var s=i._reactInternals;if(s===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=vv(s),i=i===null?null:i.stateNode,i},Ft.flushSync=function(i){return cn(i)},Ft.hydrate=function(i,s,l){if(!tl(s))throw Error(r(200));return rl(null,i,s,!0,l)},Ft.hydrateRoot=function(i,s,l){if(!Qc(i))throw Error(r(405));var c=l!=null&&l.hydratedSources||null,p=!1,_="",b=jy;if(l!=null&&(l.unstable_strictMode===!0&&(p=!0),l.identifierPrefix!==void 0&&(_=l.identifierPrefix),l.onRecoverableError!==void 0&&(b=l.onRecoverableError)),s=Wy(s,null,i,1,l??null,p,!1,_,b),i[Zr]=s.current,Os(i),c)for(i=0;i<c.length;i++)l=c[i],p=l._getVersion,p=p(l._source),s.mutableSourceEagerHydrationData==null?s.mutableSourceEagerHydrationData=[l,p]:s.mutableSourceEagerHydrationData.push(l,p);return new el(s)},Ft.render=function(i,s,l){if(!tl(s))throw Error(r(200));return rl(null,i,s,!1,l)},Ft.unmountComponentAtNode=function(i){if(!tl(i))throw Error(r(40));return i._reactRootContainer?(cn(function(){rl(null,null,i,!1,function(){i._reactRootContainer=null,i[Zr]=null})}),!0):!1},Ft.unstable_batchedUpdates=jc,Ft.unstable_renderSubtreeIntoContainer=function(i,s,l,c){if(!tl(l))throw Error(r(200));if(i==null||i._reactInternals===void 0)throw Error(r(38));return rl(i,s,l,!1,c)},Ft.version="18.3.1-next-f1338f8080-20240426",Ft}var Qy;function jb(){if(Qy)return rh.exports;Qy=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(t){console.error(t)}}return e(),rh.exports=dD(),rh.exports}var e0;function fD(){if(e0)return sl;e0=1;var e=jb();return sl.createRoot=e.createRoot,sl.hydrateRoot=e.hydrateRoot,sl}var pD=fD();const _D=dg(pD);var sh={},Kt={},oh={exports:{}};/*!
|
|
41
|
+
Copyright (c) 2018 Jed Watson.
|
|
42
|
+
Licensed under the MIT License (MIT), see
|
|
43
|
+
http://jedwatson.github.io/classnames
|
|
44
|
+
*/var t0;function pr(){return t0||(t0=1,(function(e){(function(){var t={}.hasOwnProperty;function r(){for(var a="",u=0;u<arguments.length;u++){var h=arguments[u];h&&(a=o(a,n(h)))}return a}function n(a){if(typeof a=="string"||typeof a=="number")return a;if(typeof a!="object")return"";if(Array.isArray(a))return r.apply(null,a);if(a.toString!==Object.prototype.toString&&!a.toString.toString().includes("[native code]"))return a.toString();var u="";for(var h in a)t.call(a,h)&&a[h]&&(u=o(u,h));return u}function o(a,u){return u?a?a+" "+u:a+u:a}e.exports?(r.default=r,e.exports=r):window.classNames=r})()})(oh)),oh.exports}var ah,r0;function $b(){if(r0)return ah;r0=1;var e=typeof nl=="object"&&nl&&nl.Object===Object&&nl;return ah=e,ah}var lh,i0;function Mr(){if(i0)return lh;i0=1;var e=$b(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return lh=r,lh}var uh,n0;function os(){if(n0)return uh;n0=1;var e=Mr(),t=e.Symbol;return uh=t,uh}var ch,s0;function gD(){if(s0)return ch;s0=1;var e=os(),t=Object.prototype,r=t.hasOwnProperty,n=t.toString,o=e?e.toStringTag:void 0;function a(u){var h=r.call(u,o),f=u[o];try{u[o]=void 0;var d=!0}catch{}var g=n.call(u);return d&&(h?u[o]=f:delete u[o]),g}return ch=a,ch}var hh,o0;function vD(){if(o0)return hh;o0=1;var e=Object.prototype,t=e.toString;function r(n){return t.call(n)}return hh=r,hh}var dh,a0;function Fo(){if(a0)return dh;a0=1;var e=os(),t=gD(),r=vD(),n="[object Null]",o="[object Undefined]",a=e?e.toStringTag:void 0;function u(h){return h==null?h===void 0?o:n:a&&a in Object(h)?t(h):r(h)}return dh=u,dh}var fh,l0;function Gr(){if(l0)return fh;l0=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return fh=e,fh}var ph,u0;function Kb(){if(u0)return ph;u0=1;var e=Fo(),t=Gr(),r="[object AsyncFunction]",n="[object Function]",o="[object GeneratorFunction]",a="[object Proxy]";function u(h){if(!t(h))return!1;var f=e(h);return f==n||f==o||f==r||f==a}return ph=u,ph}var _h,c0;function mD(){if(c0)return _h;c0=1;var e=Mr(),t=e["__core-js_shared__"];return _h=t,_h}var gh,h0;function yD(){if(h0)return gh;h0=1;var e=mD(),t=(function(){var n=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function r(n){return!!t&&t in n}return gh=r,gh}var vh,d0;function Vb(){if(d0)return vh;d0=1;var e=Function.prototype,t=e.toString;function r(n){if(n!=null){try{return t.call(n)}catch{}try{return n+""}catch{}}return""}return vh=r,vh}var mh,f0;function SD(){if(f0)return mh;f0=1;var e=Kb(),t=yD(),r=Gr(),n=Vb(),o=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,u=Function.prototype,h=Object.prototype,f=u.toString,d=h.hasOwnProperty,g=RegExp("^"+f.call(d).replace(o,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function v(y){if(!r(y)||t(y))return!1;var m=e(y)?g:a;return m.test(n(y))}return mh=v,mh}var yh,p0;function wD(){if(p0)return yh;p0=1;function e(t,r){return t==null?void 0:t[r]}return yh=e,yh}var Sh,_0;function En(){if(_0)return Sh;_0=1;var e=SD(),t=wD();function r(n,o){var a=t(n,o);return e(a)?a:void 0}return Sh=r,Sh}var wh,g0;function Gb(){if(g0)return wh;g0=1;var e=En(),t=(function(){try{var r=e(Object,"defineProperty");return r({},"",{}),r}catch{}})();return wh=t,wh}var Ch,v0;function pg(){if(v0)return Ch;v0=1;var e=Gb();function t(r,n,o){n=="__proto__"&&e?e(r,n,{configurable:!0,enumerable:!0,value:o,writable:!0}):r[n]=o}return Ch=t,Ch}var bh,m0;function CD(){if(m0)return bh;m0=1;function e(t,r,n,o){for(var a=-1,u=t==null?0:t.length;++a<u;){var h=t[a];r(o,h,n(h),t)}return o}return bh=e,bh}var Eh,y0;function bD(){if(y0)return Eh;y0=1;function e(t){return function(r,n,o){for(var a=-1,u=Object(r),h=o(r),f=h.length;f--;){var d=h[t?f:++a];if(n(u[d],d,u)===!1)break}return r}}return Eh=e,Eh}var xh,S0;function ED(){if(S0)return xh;S0=1;var e=bD(),t=e();return xh=t,xh}var Th,w0;function xD(){if(w0)return Th;w0=1;function e(t,r){for(var n=-1,o=Array(t);++n<t;)o[n]=r(n);return o}return Th=e,Th}var kh,C0;function xn(){if(C0)return kh;C0=1;function e(t){return t!=null&&typeof t=="object"}return kh=e,kh}var Dh,b0;function TD(){if(b0)return Dh;b0=1;var e=Fo(),t=xn(),r="[object Arguments]";function n(o){return t(o)&&e(o)==r}return Dh=n,Dh}var Oh,E0;function Fl(){if(E0)return Oh;E0=1;var e=TD(),t=xn(),r=Object.prototype,n=r.hasOwnProperty,o=r.propertyIsEnumerable,a=e((function(){return arguments})())?e:function(u){return t(u)&&n.call(u,"callee")&&!o.call(u,"callee")};return Oh=a,Oh}var Rh,x0;function _r(){if(x0)return Rh;x0=1;var e=Array.isArray;return Rh=e,Rh}var Co={exports:{}},Ph,T0;function kD(){if(T0)return Ph;T0=1;function e(){return!1}return Ph=e,Ph}Co.exports;var k0;function Hl(){return k0||(k0=1,(function(e,t){var r=Mr(),n=kD(),o=t&&!t.nodeType&&t,a=o&&!0&&e&&!e.nodeType&&e,u=a&&a.exports===o,h=u?r.Buffer:void 0,f=h?h.isBuffer:void 0,d=f||n;e.exports=d})(Co,Co.exports)),Co.exports}var Mh,D0;function _g(){if(D0)return Mh;D0=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function r(n,o){var a=typeof n;return o=o??e,!!o&&(a=="number"||a!="symbol"&&t.test(n))&&n>-1&&n%1==0&&n<o}return Mh=r,Mh}var Ah,O0;function gg(){if(O0)return Ah;O0=1;var e=9007199254740991;function t(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=e}return Ah=t,Ah}var Ih,R0;function DD(){if(R0)return Ih;R0=1;var e=Fo(),t=gg(),r=xn(),n="[object Arguments]",o="[object Array]",a="[object Boolean]",u="[object Date]",h="[object Error]",f="[object Function]",d="[object Map]",g="[object Number]",v="[object Object]",y="[object RegExp]",m="[object Set]",w="[object String]",S="[object WeakMap]",C="[object ArrayBuffer]",E="[object DataView]",x="[object Float32Array]",k="[object Float64Array]",D="[object Int8Array]",U="[object Int16Array]",W="[object Int32Array]",P="[object Uint8Array]",F="[object Uint8ClampedArray]",Q="[object Uint16Array]",K="[object Uint32Array]",q={};q[x]=q[k]=q[D]=q[U]=q[W]=q[P]=q[F]=q[Q]=q[K]=!0,q[n]=q[o]=q[C]=q[a]=q[E]=q[u]=q[h]=q[f]=q[d]=q[g]=q[v]=q[y]=q[m]=q[w]=q[S]=!1;function I(O){return r(O)&&t(O.length)&&!!q[e(O)]}return Ih=I,Ih}var Lh,P0;function vg(){if(P0)return Lh;P0=1;function e(t){return function(r){return t(r)}}return Lh=e,Lh}var bo={exports:{}};bo.exports;var M0;function mg(){return M0||(M0=1,(function(e,t){var r=$b(),n=t&&!t.nodeType&&t,o=n&&!0&&e&&!e.nodeType&&e,a=o&&o.exports===n,u=a&&r.process,h=(function(){try{var f=o&&o.require&&o.require("util").types;return f||u&&u.binding&&u.binding("util")}catch{}})();e.exports=h})(bo,bo.exports)),bo.exports}var Bh,A0;function yg(){if(A0)return Bh;A0=1;var e=DD(),t=vg(),r=mg(),n=r&&r.isTypedArray,o=n?t(n):e;return Bh=o,Bh}var Nh,I0;function Yb(){if(I0)return Nh;I0=1;var e=xD(),t=Fl(),r=_r(),n=Hl(),o=_g(),a=yg(),u=Object.prototype,h=u.hasOwnProperty;function f(d,g){var v=r(d),y=!v&&t(d),m=!v&&!y&&n(d),w=!v&&!y&&!m&&a(d),S=v||y||m||w,C=S?e(d.length,String):[],E=C.length;for(var x in d)(g||h.call(d,x))&&!(S&&(x=="length"||m&&(x=="offset"||x=="parent")||w&&(x=="buffer"||x=="byteLength"||x=="byteOffset")||o(x,E)))&&C.push(x);return C}return Nh=f,Nh}var qh,L0;function zl(){if(L0)return qh;L0=1;var e=Object.prototype;function t(r){var n=r&&r.constructor,o=typeof n=="function"&&n.prototype||e;return r===o}return qh=t,qh}var Fh,B0;function Xb(){if(B0)return Fh;B0=1;function e(t,r){return function(n){return t(r(n))}}return Fh=e,Fh}var Hh,N0;function OD(){if(N0)return Hh;N0=1;var e=Xb(),t=e(Object.keys,Object);return Hh=t,Hh}var zh,q0;function Zb(){if(q0)return zh;q0=1;var e=zl(),t=OD(),r=Object.prototype,n=r.hasOwnProperty;function o(a){if(!e(a))return t(a);var u=[];for(var h in Object(a))n.call(a,h)&&h!="constructor"&&u.push(h);return u}return zh=o,zh}var Wh,F0;function Wl(){if(F0)return Wh;F0=1;var e=Kb(),t=gg();function r(n){return n!=null&&t(n.length)&&!e(n)}return Wh=r,Wh}var Uh,H0;function Tn(){if(H0)return Uh;H0=1;var e=Yb(),t=Zb(),r=Wl();function n(o){return r(o)?e(o):t(o)}return Uh=n,Uh}var jh,z0;function RD(){if(z0)return jh;z0=1;var e=ED(),t=Tn();function r(n,o){return n&&e(n,o,t)}return jh=r,jh}var $h,W0;function PD(){if(W0)return $h;W0=1;var e=Wl();function t(r,n){return function(o,a){if(o==null)return o;if(!e(o))return r(o,a);for(var u=o.length,h=n?u:-1,f=Object(o);(n?h--:++h<u)&&a(f[h],h,f)!==!1;);return o}}return $h=t,$h}var Kh,U0;function MD(){if(U0)return Kh;U0=1;var e=RD(),t=PD(),r=t(e);return Kh=r,Kh}var Vh,j0;function AD(){if(j0)return Vh;j0=1;var e=MD();function t(r,n,o,a){return e(r,function(u,h,f){n(a,u,o(u),f)}),a}return Vh=t,Vh}var Gh,$0;function ID(){if($0)return Gh;$0=1;function e(){this.__data__=[],this.size=0}return Gh=e,Gh}var Yh,K0;function Sg(){if(K0)return Yh;K0=1;function e(t,r){return t===r||t!==t&&r!==r}return Yh=e,Yh}var Xh,V0;function Ul(){if(V0)return Xh;V0=1;var e=Sg();function t(r,n){for(var o=r.length;o--;)if(e(r[o][0],n))return o;return-1}return Xh=t,Xh}var Zh,G0;function LD(){if(G0)return Zh;G0=1;var e=Ul(),t=Array.prototype,r=t.splice;function n(o){var a=this.__data__,u=e(a,o);if(u<0)return!1;var h=a.length-1;return u==h?a.pop():r.call(a,u,1),--this.size,!0}return Zh=n,Zh}var Jh,Y0;function BD(){if(Y0)return Jh;Y0=1;var e=Ul();function t(r){var n=this.__data__,o=e(n,r);return o<0?void 0:n[o][1]}return Jh=t,Jh}var Qh,X0;function ND(){if(X0)return Qh;X0=1;var e=Ul();function t(r){return e(this.__data__,r)>-1}return Qh=t,Qh}var ed,Z0;function qD(){if(Z0)return ed;Z0=1;var e=Ul();function t(r,n){var o=this.__data__,a=e(o,r);return a<0?(++this.size,o.push([r,n])):o[a][1]=n,this}return ed=t,ed}var td,J0;function jl(){if(J0)return td;J0=1;var e=ID(),t=LD(),r=BD(),n=ND(),o=qD();function a(u){var h=-1,f=u==null?0:u.length;for(this.clear();++h<f;){var d=u[h];this.set(d[0],d[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=n,a.prototype.set=o,td=a,td}var rd,Q0;function FD(){if(Q0)return rd;Q0=1;var e=jl();function t(){this.__data__=new e,this.size=0}return rd=t,rd}var id,eS;function HD(){if(eS)return id;eS=1;function e(t){var r=this.__data__,n=r.delete(t);return this.size=r.size,n}return id=e,id}var nd,tS;function zD(){if(tS)return nd;tS=1;function e(t){return this.__data__.get(t)}return nd=e,nd}var sd,rS;function WD(){if(rS)return sd;rS=1;function e(t){return this.__data__.has(t)}return sd=e,sd}var od,iS;function wg(){if(iS)return od;iS=1;var e=En(),t=Mr(),r=e(t,"Map");return od=r,od}var ad,nS;function $l(){if(nS)return ad;nS=1;var e=En(),t=e(Object,"create");return ad=t,ad}var ld,sS;function UD(){if(sS)return ld;sS=1;var e=$l();function t(){this.__data__=e?e(null):{},this.size=0}return ld=t,ld}var ud,oS;function jD(){if(oS)return ud;oS=1;function e(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}return ud=e,ud}var cd,aS;function $D(){if(aS)return cd;aS=1;var e=$l(),t="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function o(a){var u=this.__data__;if(e){var h=u[a];return h===t?void 0:h}return n.call(u,a)?u[a]:void 0}return cd=o,cd}var hd,lS;function KD(){if(lS)return hd;lS=1;var e=$l(),t=Object.prototype,r=t.hasOwnProperty;function n(o){var a=this.__data__;return e?a[o]!==void 0:r.call(a,o)}return hd=n,hd}var dd,uS;function VD(){if(uS)return dd;uS=1;var e=$l(),t="__lodash_hash_undefined__";function r(n,o){var a=this.__data__;return this.size+=this.has(n)?0:1,a[n]=e&&o===void 0?t:o,this}return dd=r,dd}var fd,cS;function GD(){if(cS)return fd;cS=1;var e=UD(),t=jD(),r=$D(),n=KD(),o=VD();function a(u){var h=-1,f=u==null?0:u.length;for(this.clear();++h<f;){var d=u[h];this.set(d[0],d[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=n,a.prototype.set=o,fd=a,fd}var pd,hS;function YD(){if(hS)return pd;hS=1;var e=GD(),t=jl(),r=wg();function n(){this.size=0,this.__data__={hash:new e,map:new(r||t),string:new e}}return pd=n,pd}var _d,dS;function XD(){if(dS)return _d;dS=1;function e(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}return _d=e,_d}var gd,fS;function Kl(){if(fS)return gd;fS=1;var e=XD();function t(r,n){var o=r.__data__;return e(n)?o[typeof n=="string"?"string":"hash"]:o.map}return gd=t,gd}var vd,pS;function ZD(){if(pS)return vd;pS=1;var e=Kl();function t(r){var n=e(this,r).delete(r);return this.size-=n?1:0,n}return vd=t,vd}var md,_S;function JD(){if(_S)return md;_S=1;var e=Kl();function t(r){return e(this,r).get(r)}return md=t,md}var yd,gS;function QD(){if(gS)return yd;gS=1;var e=Kl();function t(r){return e(this,r).has(r)}return yd=t,yd}var Sd,vS;function eO(){if(vS)return Sd;vS=1;var e=Kl();function t(r,n){var o=e(this,r),a=o.size;return o.set(r,n),this.size+=o.size==a?0:1,this}return Sd=t,Sd}var wd,mS;function Cg(){if(mS)return wd;mS=1;var e=YD(),t=ZD(),r=JD(),n=QD(),o=eO();function a(u){var h=-1,f=u==null?0:u.length;for(this.clear();++h<f;){var d=u[h];this.set(d[0],d[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=n,a.prototype.set=o,wd=a,wd}var Cd,yS;function tO(){if(yS)return Cd;yS=1;var e=jl(),t=wg(),r=Cg(),n=200;function o(a,u){var h=this.__data__;if(h instanceof e){var f=h.__data__;if(!t||f.length<n-1)return f.push([a,u]),this.size=++h.size,this;h=this.__data__=new r(f)}return h.set(a,u),this.size=h.size,this}return Cd=o,Cd}var bd,SS;function bg(){if(SS)return bd;SS=1;var e=jl(),t=FD(),r=HD(),n=zD(),o=WD(),a=tO();function u(h){var f=this.__data__=new e(h);this.size=f.size}return u.prototype.clear=t,u.prototype.delete=r,u.prototype.get=n,u.prototype.has=o,u.prototype.set=a,bd=u,bd}var Ed,wS;function rO(){if(wS)return Ed;wS=1;var e="__lodash_hash_undefined__";function t(r){return this.__data__.set(r,e),this}return Ed=t,Ed}var xd,CS;function iO(){if(CS)return xd;CS=1;function e(t){return this.__data__.has(t)}return xd=e,xd}var Td,bS;function nO(){if(bS)return Td;bS=1;var e=Cg(),t=rO(),r=iO();function n(o){var a=-1,u=o==null?0:o.length;for(this.__data__=new e;++a<u;)this.add(o[a])}return n.prototype.add=n.prototype.push=t,n.prototype.has=r,Td=n,Td}var kd,ES;function sO(){if(ES)return kd;ES=1;function e(t,r){for(var n=-1,o=t==null?0:t.length;++n<o;)if(r(t[n],n,t))return!0;return!1}return kd=e,kd}var Dd,xS;function oO(){if(xS)return Dd;xS=1;function e(t,r){return t.has(r)}return Dd=e,Dd}var Od,TS;function Jb(){if(TS)return Od;TS=1;var e=nO(),t=sO(),r=oO(),n=1,o=2;function a(u,h,f,d,g,v){var y=f&n,m=u.length,w=h.length;if(m!=w&&!(y&&w>m))return!1;var S=v.get(u),C=v.get(h);if(S&&C)return S==h&&C==u;var E=-1,x=!0,k=f&o?new e:void 0;for(v.set(u,h),v.set(h,u);++E<m;){var D=u[E],U=h[E];if(d)var W=y?d(U,D,E,h,u,v):d(D,U,E,u,h,v);if(W!==void 0){if(W)continue;x=!1;break}if(k){if(!t(h,function(P,F){if(!r(k,F)&&(D===P||g(D,P,f,d,v)))return k.push(F)})){x=!1;break}}else if(!(D===U||g(D,U,f,d,v))){x=!1;break}}return v.delete(u),v.delete(h),x}return Od=a,Od}var Rd,kS;function Qb(){if(kS)return Rd;kS=1;var e=Mr(),t=e.Uint8Array;return Rd=t,Rd}var Pd,DS;function aO(){if(DS)return Pd;DS=1;function e(t){var r=-1,n=Array(t.size);return t.forEach(function(o,a){n[++r]=[a,o]}),n}return Pd=e,Pd}var Md,OS;function lO(){if(OS)return Md;OS=1;function e(t){var r=-1,n=Array(t.size);return t.forEach(function(o){n[++r]=o}),n}return Md=e,Md}var Ad,RS;function uO(){if(RS)return Ad;RS=1;var e=os(),t=Qb(),r=Sg(),n=Jb(),o=aO(),a=lO(),u=1,h=2,f="[object Boolean]",d="[object Date]",g="[object Error]",v="[object Map]",y="[object Number]",m="[object RegExp]",w="[object Set]",S="[object String]",C="[object Symbol]",E="[object ArrayBuffer]",x="[object DataView]",k=e?e.prototype:void 0,D=k?k.valueOf:void 0;function U(W,P,F,Q,K,q,I){switch(F){case x:if(W.byteLength!=P.byteLength||W.byteOffset!=P.byteOffset)return!1;W=W.buffer,P=P.buffer;case E:return!(W.byteLength!=P.byteLength||!q(new t(W),new t(P)));case f:case d:case y:return r(+W,+P);case g:return W.name==P.name&&W.message==P.message;case m:case S:return W==P+"";case v:var O=o;case w:var H=Q&u;if(O||(O=a),W.size!=P.size&&!H)return!1;var $=I.get(W);if($)return $==P;Q|=h,I.set(W,P);var G=n(O(W),O(P),Q,K,q,I);return I.delete(W),G;case C:if(D)return D.call(W)==D.call(P)}return!1}return Ad=U,Ad}var Id,PS;function Eg(){if(PS)return Id;PS=1;function e(t,r){for(var n=-1,o=r.length,a=t.length;++n<o;)t[a+n]=r[n];return t}return Id=e,Id}var Ld,MS;function eE(){if(MS)return Ld;MS=1;var e=Eg(),t=_r();function r(n,o,a){var u=o(n);return t(n)?u:e(u,a(n))}return Ld=r,Ld}var Bd,AS;function cO(){if(AS)return Bd;AS=1;function e(t,r){for(var n=-1,o=t==null?0:t.length,a=0,u=[];++n<o;){var h=t[n];r(h,n,t)&&(u[a++]=h)}return u}return Bd=e,Bd}var Nd,IS;function tE(){if(IS)return Nd;IS=1;function e(){return[]}return Nd=e,Nd}var qd,LS;function xg(){if(LS)return qd;LS=1;var e=cO(),t=tE(),r=Object.prototype,n=r.propertyIsEnumerable,o=Object.getOwnPropertySymbols,a=o?function(u){return u==null?[]:(u=Object(u),e(o(u),function(h){return n.call(u,h)}))}:t;return qd=a,qd}var Fd,BS;function rE(){if(BS)return Fd;BS=1;var e=eE(),t=xg(),r=Tn();function n(o){return e(o,r,t)}return Fd=n,Fd}var Hd,NS;function hO(){if(NS)return Hd;NS=1;var e=rE(),t=1,r=Object.prototype,n=r.hasOwnProperty;function o(a,u,h,f,d,g){var v=h&t,y=e(a),m=y.length,w=e(u),S=w.length;if(m!=S&&!v)return!1;for(var C=m;C--;){var E=y[C];if(!(v?E in u:n.call(u,E)))return!1}var x=g.get(a),k=g.get(u);if(x&&k)return x==u&&k==a;var D=!0;g.set(a,u),g.set(u,a);for(var U=v;++C<m;){E=y[C];var W=a[E],P=u[E];if(f)var F=v?f(P,W,E,u,a,g):f(W,P,E,a,u,g);if(!(F===void 0?W===P||d(W,P,h,f,g):F)){D=!1;break}U||(U=E=="constructor")}if(D&&!U){var Q=a.constructor,K=u.constructor;Q!=K&&"constructor"in a&&"constructor"in u&&!(typeof Q=="function"&&Q instanceof Q&&typeof K=="function"&&K instanceof K)&&(D=!1)}return g.delete(a),g.delete(u),D}return Hd=o,Hd}var zd,qS;function dO(){if(qS)return zd;qS=1;var e=En(),t=Mr(),r=e(t,"DataView");return zd=r,zd}var Wd,FS;function fO(){if(FS)return Wd;FS=1;var e=En(),t=Mr(),r=e(t,"Promise");return Wd=r,Wd}var Ud,HS;function pO(){if(HS)return Ud;HS=1;var e=En(),t=Mr(),r=e(t,"Set");return Ud=r,Ud}var jd,zS;function _O(){if(zS)return jd;zS=1;var e=En(),t=Mr(),r=e(t,"WeakMap");return jd=r,jd}var $d,WS;function Ho(){if(WS)return $d;WS=1;var e=dO(),t=wg(),r=fO(),n=pO(),o=_O(),a=Fo(),u=Vb(),h="[object Map]",f="[object Object]",d="[object Promise]",g="[object Set]",v="[object WeakMap]",y="[object DataView]",m=u(e),w=u(t),S=u(r),C=u(n),E=u(o),x=a;return(e&&x(new e(new ArrayBuffer(1)))!=y||t&&x(new t)!=h||r&&x(r.resolve())!=d||n&&x(new n)!=g||o&&x(new o)!=v)&&(x=function(k){var D=a(k),U=D==f?k.constructor:void 0,W=U?u(U):"";if(W)switch(W){case m:return y;case w:return h;case S:return d;case C:return g;case E:return v}return D}),$d=x,$d}var Kd,US;function gO(){if(US)return Kd;US=1;var e=bg(),t=Jb(),r=uO(),n=hO(),o=Ho(),a=_r(),u=Hl(),h=yg(),f=1,d="[object Arguments]",g="[object Array]",v="[object Object]",y=Object.prototype,m=y.hasOwnProperty;function w(S,C,E,x,k,D){var U=a(S),W=a(C),P=U?g:o(S),F=W?g:o(C);P=P==d?v:P,F=F==d?v:F;var Q=P==v,K=F==v,q=P==F;if(q&&u(S)){if(!u(C))return!1;U=!0,Q=!1}if(q&&!Q)return D||(D=new e),U||h(S)?t(S,C,E,x,k,D):r(S,C,P,E,x,k,D);if(!(E&f)){var I=Q&&m.call(S,"__wrapped__"),O=K&&m.call(C,"__wrapped__");if(I||O){var H=I?S.value():S,$=O?C.value():C;return D||(D=new e),k(H,$,E,x,D)}}return q?(D||(D=new e),n(S,C,E,x,k,D)):!1}return Kd=w,Kd}var Vd,jS;function Tg(){if(jS)return Vd;jS=1;var e=gO(),t=xn();function r(n,o,a,u,h){return n===o?!0:n==null||o==null||!t(n)&&!t(o)?n!==n&&o!==o:e(n,o,a,u,r,h)}return Vd=r,Vd}var Gd,$S;function vO(){if($S)return Gd;$S=1;var e=bg(),t=Tg(),r=1,n=2;function o(a,u,h,f){var d=h.length,g=d,v=!f;if(a==null)return!g;for(a=Object(a);d--;){var y=h[d];if(v&&y[2]?y[1]!==a[y[0]]:!(y[0]in a))return!1}for(;++d<g;){y=h[d];var m=y[0],w=a[m],S=y[1];if(v&&y[2]){if(w===void 0&&!(m in a))return!1}else{var C=new e;if(f)var E=f(w,S,m,a,u,C);if(!(E===void 0?t(S,w,r|n,f,C):E))return!1}}return!0}return Gd=o,Gd}var Yd,KS;function iE(){if(KS)return Yd;KS=1;var e=Gr();function t(r){return r===r&&!e(r)}return Yd=t,Yd}var Xd,VS;function mO(){if(VS)return Xd;VS=1;var e=iE(),t=Tn();function r(n){for(var o=t(n),a=o.length;a--;){var u=o[a],h=n[u];o[a]=[u,h,e(h)]}return o}return Xd=r,Xd}var Zd,GS;function nE(){if(GS)return Zd;GS=1;function e(t,r){return function(n){return n==null?!1:n[t]===r&&(r!==void 0||t in Object(n))}}return Zd=e,Zd}var Jd,YS;function yO(){if(YS)return Jd;YS=1;var e=vO(),t=mO(),r=nE();function n(o){var a=t(o);return a.length==1&&a[0][2]?r(a[0][0],a[0][1]):function(u){return u===o||e(u,o,a)}}return Jd=n,Jd}var Qd,XS;function Vl(){if(XS)return Qd;XS=1;var e=Fo(),t=xn(),r="[object Symbol]";function n(o){return typeof o=="symbol"||t(o)&&e(o)==r}return Qd=n,Qd}var ef,ZS;function kg(){if(ZS)return ef;ZS=1;var e=_r(),t=Vl(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function o(a,u){if(e(a))return!1;var h=typeof a;return h=="number"||h=="symbol"||h=="boolean"||a==null||t(a)?!0:n.test(a)||!r.test(a)||u!=null&&a in Object(u)}return ef=o,ef}var tf,JS;function SO(){if(JS)return tf;JS=1;var e=Cg(),t="Expected a function";function r(n,o){if(typeof n!="function"||o!=null&&typeof o!="function")throw new TypeError(t);var a=function(){var u=arguments,h=o?o.apply(this,u):u[0],f=a.cache;if(f.has(h))return f.get(h);var d=n.apply(this,u);return a.cache=f.set(h,d)||f,d};return a.cache=new(r.Cache||e),a}return r.Cache=e,tf=r,tf}var rf,QS;function wO(){if(QS)return rf;QS=1;var e=SO(),t=500;function r(n){var o=e(n,function(u){return a.size===t&&a.clear(),u}),a=o.cache;return o}return rf=r,rf}var nf,e1;function CO(){if(e1)return nf;e1=1;var e=wO(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=e(function(o){var a=[];return o.charCodeAt(0)===46&&a.push(""),o.replace(t,function(u,h,f,d){a.push(f?d.replace(r,"$1"):h||u)}),a});return nf=n,nf}var sf,t1;function Dg(){if(t1)return sf;t1=1;function e(t,r){for(var n=-1,o=t==null?0:t.length,a=Array(o);++n<o;)a[n]=r(t[n],n,t);return a}return sf=e,sf}var of,r1;function bO(){if(r1)return of;r1=1;var e=os(),t=Dg(),r=_r(),n=Vl(),o=e?e.prototype:void 0,a=o?o.toString:void 0;function u(h){if(typeof h=="string")return h;if(r(h))return t(h,u)+"";if(n(h))return a?a.call(h):"";var f=h+"";return f=="0"&&1/h==-1/0?"-0":f}return of=u,of}var af,i1;function Og(){if(i1)return af;i1=1;var e=bO();function t(r){return r==null?"":e(r)}return af=t,af}var lf,n1;function Gl(){if(n1)return lf;n1=1;var e=_r(),t=kg(),r=CO(),n=Og();function o(a,u){return e(a)?a:t(a,u)?[a]:r(n(a))}return lf=o,lf}var uf,s1;function zo(){if(s1)return uf;s1=1;var e=Vl();function t(r){if(typeof r=="string"||e(r))return r;var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}return uf=t,uf}var cf,o1;function Rg(){if(o1)return cf;o1=1;var e=Gl(),t=zo();function r(n,o){o=e(o,n);for(var a=0,u=o.length;n!=null&&a<u;)n=n[t(o[a++])];return a&&a==u?n:void 0}return cf=r,cf}var hf,a1;function sE(){if(a1)return hf;a1=1;var e=Rg();function t(r,n,o){var a=r==null?void 0:e(r,n);return a===void 0?o:a}return hf=t,hf}var df,l1;function EO(){if(l1)return df;l1=1;function e(t,r){return t!=null&&r in Object(t)}return df=e,df}var ff,u1;function xO(){if(u1)return ff;u1=1;var e=Gl(),t=Fl(),r=_r(),n=_g(),o=gg(),a=zo();function u(h,f,d){f=e(f,h);for(var g=-1,v=f.length,y=!1;++g<v;){var m=a(f[g]);if(!(y=h!=null&&d(h,m)))break;h=h[m]}return y||++g!=v?y:(v=h==null?0:h.length,!!v&&o(v)&&n(m,v)&&(r(h)||t(h)))}return ff=u,ff}var pf,c1;function TO(){if(c1)return pf;c1=1;var e=EO(),t=xO();function r(n,o){return n!=null&&t(n,o,e)}return pf=r,pf}var _f,h1;function kO(){if(h1)return _f;h1=1;var e=Tg(),t=sE(),r=TO(),n=kg(),o=iE(),a=nE(),u=zo(),h=1,f=2;function d(g,v){return n(g)&&o(v)?a(u(g),v):function(y){var m=t(y,g);return m===void 0&&m===v?r(y,g):e(v,m,h|f)}}return _f=d,_f}var gf,d1;function Pg(){if(d1)return gf;d1=1;function e(t){return t}return gf=e,gf}var vf,f1;function DO(){if(f1)return vf;f1=1;function e(t){return function(r){return r==null?void 0:r[t]}}return vf=e,vf}var mf,p1;function OO(){if(p1)return mf;p1=1;var e=Rg();function t(r){return function(n){return e(n,r)}}return mf=t,mf}var yf,_1;function RO(){if(_1)return yf;_1=1;var e=DO(),t=OO(),r=kg(),n=zo();function o(a){return r(a)?e(n(a)):t(a)}return yf=o,yf}var Sf,g1;function oE(){if(g1)return Sf;g1=1;var e=yO(),t=kO(),r=Pg(),n=_r(),o=RO();function a(u){return typeof u=="function"?u:u==null?r:typeof u=="object"?n(u)?t(u[0],u[1]):e(u):o(u)}return Sf=a,Sf}var wf,v1;function PO(){if(v1)return wf;v1=1;var e=CD(),t=AD(),r=oE(),n=_r();function o(a,u){return function(h,f){var d=n(h)?e:t,g=u?u():{};return d(h,a,r(f,2),g)}}return wf=o,wf}var Cf,m1;function MO(){if(m1)return Cf;m1=1;var e=pg(),t=PO(),r=Object.prototype,n=r.hasOwnProperty,o=t(function(a,u,h){n.call(a,h)?++a[h]:e(a,h,1)});return Cf=o,Cf}var bf,y1;function Mg(){if(y1)return bf;y1=1;var e=pg(),t=Sg(),r=Object.prototype,n=r.hasOwnProperty;function o(a,u,h){var f=a[u];(!(n.call(a,u)&&t(f,h))||h===void 0&&!(u in a))&&e(a,u,h)}return bf=o,bf}var Ef,S1;function aE(){if(S1)return Ef;S1=1;var e=Mg(),t=Gl(),r=_g(),n=Gr(),o=zo();function a(u,h,f,d){if(!n(u))return u;h=t(h,u);for(var g=-1,v=h.length,y=v-1,m=u;m!=null&&++g<v;){var w=o(h[g]),S=f;if(w==="__proto__"||w==="constructor"||w==="prototype")return u;if(g!=y){var C=m[w];S=d?d(C,w,m):void 0,S===void 0&&(S=n(C)?C:r(h[g+1])?[]:{})}e(m,w,S),m=m[w]}return u}return Ef=a,Ef}var xf,w1;function AO(){if(w1)return xf;w1=1;var e=Rg(),t=aE(),r=Gl();function n(o,a,u){for(var h=-1,f=a.length,d={};++h<f;){var g=a[h],v=e(o,g);u(v,g)&&t(d,r(g,o),v)}return d}return xf=n,xf}var Tf,C1;function lE(){if(C1)return Tf;C1=1;var e=Xb(),t=e(Object.getPrototypeOf,Object);return Tf=t,Tf}var kf,b1;function uE(){if(b1)return kf;b1=1;var e=Eg(),t=lE(),r=xg(),n=tE(),o=Object.getOwnPropertySymbols,a=o?function(u){for(var h=[];u;)e(h,r(u)),u=t(u);return h}:n;return kf=a,kf}var Df,E1;function IO(){if(E1)return Df;E1=1;function e(t){var r=[];if(t!=null)for(var n in Object(t))r.push(n);return r}return Df=e,Df}var Of,x1;function LO(){if(x1)return Of;x1=1;var e=Gr(),t=zl(),r=IO(),n=Object.prototype,o=n.hasOwnProperty;function a(u){if(!e(u))return r(u);var h=t(u),f=[];for(var d in u)d=="constructor"&&(h||!o.call(u,d))||f.push(d);return f}return Of=a,Of}var Rf,T1;function Ag(){if(T1)return Rf;T1=1;var e=Yb(),t=LO(),r=Wl();function n(o){return r(o)?e(o,!0):t(o)}return Rf=n,Rf}var Pf,k1;function cE(){if(k1)return Pf;k1=1;var e=eE(),t=uE(),r=Ag();function n(o){return e(o,r,t)}return Pf=n,Pf}var Mf,D1;function BO(){if(D1)return Mf;D1=1;var e=Dg(),t=oE(),r=AO(),n=cE();function o(a,u){if(a==null)return{};var h=e(n(a),function(f){return[f]});return u=t(u),r(a,h,function(f,d){return u(f,d[0])})}return Mf=o,Mf}function hE(e){let t=null;return()=>(t==null&&(t=e()),t)}function NO(e,t){return e.filter(r=>r!==t)}function qO(e,t){const r=new Set,n=a=>r.add(a);e.forEach(n),t.forEach(n);const o=[];return r.forEach(a=>o.push(a)),o}class FO{enter(t){const r=this.entered.length,n=o=>this.isNodeInDocument(o)&&(!o.contains||o.contains(t));return this.entered=qO(this.entered.filter(n),[t]),r===0&&this.entered.length>0}leave(t){const r=this.entered.length;return this.entered=NO(this.entered.filter(this.isNodeInDocument),t),r>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class HO{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(t=>{Object.defineProperty(this.item,t,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${t}" until the drop event.`),null}})})}loadDataTransfer(t){if(t){const r={};Object.keys(this.config.exposeProperties).forEach(n=>{const o=this.config.exposeProperties[n];o!=null&&(r[n]={value:o(t,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,r)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(t,r){return r===t.getSourceId()}endDrag(){}constructor(t){this.config=t,this.item={},this.initializeExposedProperties()}}const dE="__NATIVE_FILE__",fE="__NATIVE_URL__",pE="__NATIVE_TEXT__",_E="__NATIVE_HTML__",O1=Object.freeze(Object.defineProperty({__proto__:null,FILE:dE,HTML:_E,TEXT:pE,URL:fE},Symbol.toStringTag,{value:"Module"}));function Af(e,t,r){const n=t.reduce((o,a)=>o||e.getData(a),"");return n??r}const p_={[dE]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[_E]:{exposeProperties:{html:(e,t)=>Af(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[fE]:{exposeProperties:{urls:(e,t)=>Af(e,t,"").split(`
|
|
45
|
+
`),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[pE]:{exposeProperties:{text:(e,t)=>Af(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function zO(e,t){const r=p_[e];if(!r)throw new Error(`native type ${e} has no configuration`);const n=new HO(r);return n.loadDataTransfer(t),n}function If(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(p_).filter(r=>{const n=p_[r];return n!=null&&n.matchesTypes?n.matchesTypes.some(o=>t.indexOf(o)>-1):!1})[0]||null}const WO=hE(()=>/firefox/i.test(navigator.userAgent)),gE=hE(()=>!!window.safari);class R1{interpolate(t){const{xs:r,ys:n,c1s:o,c2s:a,c3s:u}=this;let h=r.length-1;if(t===r[h])return n[h];let f=0,d=u.length-1,g;for(;f<=d;){g=Math.floor(.5*(f+d));const m=r[g];if(m<t)f=g+1;else if(m>t)d=g-1;else return n[g]}h=Math.max(0,d);const v=t-r[h],y=v*v;return n[h]+o[h]*v+a[h]*y+u[h]*v*y}constructor(t,r){const{length:n}=t,o=[];for(let m=0;m<n;m++)o.push(m);o.sort((m,w)=>t[m]<t[w]?-1:1);const a=[],u=[];let h,f;for(let m=0;m<n-1;m++)h=t[m+1]-t[m],f=r[m+1]-r[m],a.push(h),u.push(f/h);const d=[u[0]];for(let m=0;m<a.length-1;m++){const w=u[m],S=u[m+1];if(w*S<=0)d.push(0);else{h=a[m];const C=a[m+1],E=h+C;d.push(3*E/((E+C)/w+(E+h)/S))}}d.push(u[u.length-1]);const g=[],v=[];let y;for(let m=0;m<d.length-1;m++){y=u[m];const w=d[m],S=1/a[m],C=w+d[m+1]-y-y;g.push((y-w-C)*S),v.push(C*S*S)}this.xs=t,this.ys=r,this.c1s=d,this.c2s=g,this.c3s=v}}const UO=1;function vE(e){const t=e.nodeType===UO?e:e.parentElement;if(!t)return null;const{top:r,left:n}=t.getBoundingClientRect();return{x:n,y:r}}function ol(e){return{x:e.clientX,y:e.clientY}}function jO(e){var t;return e.nodeName==="IMG"&&(WO()||!(!((t=document.documentElement)===null||t===void 0)&&t.contains(e)))}function $O(e,t,r,n){let o=e?t.width:r,a=e?t.height:n;return gE()&&e&&(a/=window.devicePixelRatio,o/=window.devicePixelRatio),{dragPreviewWidth:o,dragPreviewHeight:a}}function KO(e,t,r,n,o){const a=jO(t),h=vE(a?e:t),f={x:r.x-h.x,y:r.y-h.y},{offsetWidth:d,offsetHeight:g}=e,{anchorX:v,anchorY:y}=n,{dragPreviewWidth:m,dragPreviewHeight:w}=$O(a,t,d,g),S=()=>{let W=new R1([0,.5,1],[f.y,f.y/g*w,f.y+w-g]).interpolate(y);return gE()&&a&&(W+=(window.devicePixelRatio-1)*w),W},C=()=>new R1([0,.5,1],[f.x,f.x/d*m,f.x+m-d]).interpolate(v),{offsetX:E,offsetY:x}=o,k=E===0||E,D=x===0||x;return{x:k?E:C(),y:D?x:S()}}let VO=class{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var t;return!((t=this.globalContext)===null||t===void 0)&&t.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var t;return((t=this.optionsArgs)===null||t===void 0?void 0:t.rootElement)||this.window}constructor(t,r){this.ownerDocument=null,this.globalContext=t,this.optionsArgs=r}};function GO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function P1(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable}))),n.forEach(function(o){GO(e,o,r[o])})}return e}class YO{profile(){var t,r;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((t=this.dragStartSourceIds)===null||t===void 0?void 0:t.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((r=this.dragOverTargetIds)===null||r===void 0?void 0:r.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const t=this.rootElement;if(t!==void 0){if(t.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");t.__isReactDndBackendSetUp=!0,this.addEventListeners(t)}}teardown(){const t=this.rootElement;if(t!==void 0&&(t.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var r;(r=this.window)===null||r===void 0||r.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(t,r,n){return this.sourcePreviewNodeOptions.set(t,n),this.sourcePreviewNodes.set(t,r),()=>{this.sourcePreviewNodes.delete(t),this.sourcePreviewNodeOptions.delete(t)}}connectDragSource(t,r,n){this.sourceNodes.set(t,r),this.sourceNodeOptions.set(t,n);const o=u=>this.handleDragStart(u,t),a=u=>this.handleSelectStart(u);return r.setAttribute("draggable","true"),r.addEventListener("dragstart",o),r.addEventListener("selectstart",a),()=>{this.sourceNodes.delete(t),this.sourceNodeOptions.delete(t),r.removeEventListener("dragstart",o),r.removeEventListener("selectstart",a),r.setAttribute("draggable","false")}}connectDropTarget(t,r){const n=u=>this.handleDragEnter(u,t),o=u=>this.handleDragOver(u,t),a=u=>this.handleDrop(u,t);return r.addEventListener("dragenter",n),r.addEventListener("dragover",o),r.addEventListener("drop",a),()=>{r.removeEventListener("dragenter",n),r.removeEventListener("dragover",o),r.removeEventListener("drop",a)}}addEventListeners(t){t.addEventListener&&(t.addEventListener("dragstart",this.handleTopDragStart),t.addEventListener("dragstart",this.handleTopDragStartCapture,!0),t.addEventListener("dragend",this.handleTopDragEndCapture,!0),t.addEventListener("dragenter",this.handleTopDragEnter),t.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.addEventListener("dragover",this.handleTopDragOver),t.addEventListener("dragover",this.handleTopDragOverCapture,!0),t.addEventListener("drop",this.handleTopDrop),t.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(t){t.removeEventListener&&(t.removeEventListener("dragstart",this.handleTopDragStart),t.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),t.removeEventListener("dragend",this.handleTopDragEndCapture,!0),t.removeEventListener("dragenter",this.handleTopDragEnter),t.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.removeEventListener("dragover",this.handleTopDragOver),t.removeEventListener("dragover",this.handleTopDragOverCapture,!0),t.removeEventListener("drop",this.handleTopDrop),t.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const t=this.monitor.getSourceId(),r=this.sourceNodeOptions.get(t);return P1({dropEffect:this.altKeyPressed?"copy":"move"},r||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const t=this.monitor.getSourceId(),r=this.sourcePreviewNodeOptions.get(t);return P1({anchorX:.5,anchorY:.5,captureDraggingState:!1},r||{})}isDraggingNativeItem(){const t=this.monitor.getItemType();return Object.keys(O1).some(r=>O1[r]===t)}beginDragNativeItem(t,r){this.clearCurrentDragSourceNode(),this.currentNativeSource=zO(t,r),this.currentNativeHandle=this.registry.addSource(t,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(t){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=t;const r=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var n;return(n=this.rootElement)===null||n===void 0?void 0:n.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},r)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var t;(t=this.window)===null||t===void 0||t.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(t,r){t.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(r))}handleDragEnter(t,r){this.dragEnterTargetIds.unshift(r)}handleDragOver(t,r){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(r)}handleDrop(t,r){this.dropTargetIds.unshift(r)}constructor(t,r,n){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=o=>{const a=this.sourceNodes.get(o);return a&&vE(a)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=o=>!!(o&&this.document&&this.document.body&&this.document.body.contains(o)),this.endDragIfSourceWasRemovedFromDOM=()=>{const o=this.currentDragSourceNode;o==null||this.isNodeInDocument(o)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=o=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(o||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=o=>{if(o.defaultPrevented)return;const{dragStartSourceIds:a}=this;this.dragStartSourceIds=null;const u=ol(o);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(a||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:u});const{dataTransfer:h}=o,f=If(h);if(this.monitor.isDragging()){if(h&&typeof h.setDragImage=="function"){const g=this.monitor.getSourceId(),v=this.sourceNodes.get(g),y=this.sourcePreviewNodes.get(g)||v;if(y){const{anchorX:m,anchorY:w,offsetX:S,offsetY:C}=this.getCurrentSourcePreviewNodeOptions(),k=KO(v,y,u,{anchorX:m,anchorY:w},{offsetX:S,offsetY:C});h.setDragImage(y,k.x,k.y)}}try{h==null||h.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(o.target);const{captureDraggingState:d}=this.getCurrentSourcePreviewNodeOptions();d?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(f)this.beginDragNativeItem(f);else{if(h&&!h.types&&(o.target&&!o.target.hasAttribute||!o.target.hasAttribute("draggable")))return;o.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=o=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var a;(a=this.currentNativeSource)===null||a===void 0||a.loadDataTransfer(o.dataTransfer)}if(!this.enterLeaveCounter.enter(o.target)||this.monitor.isDragging())return;const{dataTransfer:h}=o,f=If(h);f&&this.beginDragNativeItem(f,h)},this.handleTopDragEnter=o=>{const{dragEnterTargetIds:a}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=o.altKey,a.length>0&&this.actions.hover(a,{clientOffset:ol(o)}),a.some(h=>this.monitor.canDropOnTarget(h))&&(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=o=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var a;(a=this.currentNativeSource)===null||a===void 0||a.loadDataTransfer(o.dataTransfer)}},this.handleTopDragOver=o=>{const{dragOverTargetIds:a}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none");return}this.altKeyPressed=o.altKey,this.lastClientOffset=ol(o),this.scheduleHover(a),(a||[]).some(h=>this.monitor.canDropOnTarget(h))?(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?o.preventDefault():(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=o=>{this.isDraggingNativeItem()&&o.preventDefault(),this.enterLeaveCounter.leave(o.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=o=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var a;o.preventDefault(),(a=this.currentNativeSource)===null||a===void 0||a.loadDataTransfer(o.dataTransfer)}else If(o.dataTransfer)&&o.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=o=>{const{dropTargetIds:a}=this;this.dropTargetIds=[],this.actions.hover(a,{clientOffset:ol(o)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=o=>{const a=o.target;typeof a.dragDrop=="function"&&(a.tagName==="INPUT"||a.tagName==="SELECT"||a.tagName==="TEXTAREA"||a.isContentEditable||(o.preventDefault(),a.dragDrop()))},this.options=new VO(r,n),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new FO(this.isNodeInDocument)}}const XO=function(t,r,n){return new YO(t,r,n)};function Se(e,t,...r){if(ZO()&&t===void 0)throw new Error("invariant requires an error message argument");if(!e){let n;if(t===void 0)n=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let o=0;n=new Error(t.replace(/%s/g,function(){return r[o++]})),n.name="Invariant Violation"}throw n.framesToPop=1,n}}function ZO(){return typeof process<"u"&&!0}var $i;(function(e){e.mouse="mouse",e.touch="touch",e.keyboard="keyboard"})($i||($i={}));class JO{get delay(){var t;return(t=this.args.delay)!==null&&t!==void 0?t:0}get scrollAngleRanges(){return this.args.scrollAngleRanges}get getDropTargetElementsAtPoint(){return this.args.getDropTargetElementsAtPoint}get ignoreContextMenu(){var t;return(t=this.args.ignoreContextMenu)!==null&&t!==void 0?t:!1}get enableHoverOutsideTarget(){var t;return(t=this.args.enableHoverOutsideTarget)!==null&&t!==void 0?t:!1}get enableKeyboardEvents(){var t;return(t=this.args.enableKeyboardEvents)!==null&&t!==void 0?t:!1}get enableMouseEvents(){var t;return(t=this.args.enableMouseEvents)!==null&&t!==void 0?t:!1}get enableTouchEvents(){var t;return(t=this.args.enableTouchEvents)!==null&&t!==void 0?t:!0}get touchSlop(){return this.args.touchSlop||0}get delayTouchStart(){var t,r,n,o;return(o=(n=(t=this.args)===null||t===void 0?void 0:t.delayTouchStart)!==null&&n!==void 0?n:(r=this.args)===null||r===void 0?void 0:r.delay)!==null&&o!==void 0?o:0}get delayMouseStart(){var t,r,n,o;return(o=(n=(t=this.args)===null||t===void 0?void 0:t.delayMouseStart)!==null&&n!==void 0?n:(r=this.args)===null||r===void 0?void 0:r.delay)!==null&&o!==void 0?o:0}get window(){if(this.context&&this.context.window)return this.context.window;if(typeof window<"u")return window}get document(){var t;if(!((t=this.context)===null||t===void 0)&&t.document)return this.context.document;if(this.window)return this.window.document}get rootElement(){var t;return((t=this.args)===null||t===void 0?void 0:t.rootElement)||this.document}constructor(t,r){this.args=t,this.context=r}}function QO(e,t,r,n){return Math.sqrt(Math.pow(Math.abs(r-e),2)+Math.pow(Math.abs(n-t),2))}function eR(e,t,r,n,o){if(!o)return!1;const a=Math.atan2(n-t,r-e)*180/Math.PI+180;for(let u=0;u<o.length;++u){const h=o[u];if(h&&(h.start==null||a>=h.start)&&(h.end==null||a<=h.end))return!0}return!1}const tR={Left:1},rR={Left:0};function Lf(e){return e.button===void 0||e.button===rR.Left}function iR(e){return e.buttons===void 0||(e.buttons&tR.Left)===0}function mE(e){return!!e.targetTouches}const nR=1;function sR(e){const t=e.nodeType===nR?e:e.parentElement;if(!t)return;const{top:r,left:n}=t.getBoundingClientRect();return{x:n,y:r}}function oR(e,t){if(e.targetTouches.length===1)return Pl(e.targetTouches[0]);if(t&&e.touches.length===1&&e.touches[0].target===t.target)return Pl(e.touches[0])}function Pl(e,t){return mE(e)?oR(e,t):{x:e.clientX,y:e.clientY}}const M1=(()=>{let e=!1;try{addEventListener("test",()=>{},Object.defineProperty({},"passive",{get(){return e=!0,!0}}))}catch{}return e})(),Gs={[$i.mouse]:{start:"mousedown",move:"mousemove",end:"mouseup",contextmenu:"contextmenu"},[$i.touch]:{start:"touchstart",move:"touchmove",end:"touchend"},[$i.keyboard]:{keydown:"keydown"}};class Ao{profile(){var t;return{sourceNodes:this.sourceNodes.size,sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,targetNodes:this.targetNodes.size,dragOverTargetIds:((t=this.dragOverTargetIds)===null||t===void 0?void 0:t.length)||0}}get document(){return this.options.document}setup(){const t=this.options.rootElement;t&&(Se(!Ao.isSetUp,"Cannot have two Touch backends at the same time."),Ao.isSetUp=!0,this.addEventListener(t,"start",this.getTopMoveStartHandler()),this.addEventListener(t,"start",this.handleTopMoveStartCapture,!0),this.addEventListener(t,"move",this.handleTopMove),this.addEventListener(t,"move",this.handleTopMoveCapture,!0),this.addEventListener(t,"end",this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.addEventListener(t,"contextmenu",this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.addEventListener(t,"keydown",this.handleCancelOnEscape,!0))}teardown(){const t=this.options.rootElement;t&&(Ao.isSetUp=!1,this._mouseClientOffset={},this.removeEventListener(t,"start",this.handleTopMoveStartCapture,!0),this.removeEventListener(t,"start",this.handleTopMoveStart),this.removeEventListener(t,"move",this.handleTopMoveCapture,!0),this.removeEventListener(t,"move",this.handleTopMove),this.removeEventListener(t,"end",this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.removeEventListener(t,"contextmenu",this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.removeEventListener(t,"keydown",this.handleCancelOnEscape,!0),this.uninstallSourceNodeRemovalObserver())}addEventListener(t,r,n,o=!1){const a=M1?{capture:o,passive:!1}:o;this.listenerTypes.forEach(function(u){const h=Gs[u][r];h&&t.addEventListener(h,n,a)})}removeEventListener(t,r,n,o=!1){const a=M1?{capture:o,passive:!1}:o;this.listenerTypes.forEach(function(u){const h=Gs[u][r];h&&t.removeEventListener(h,n,a)})}connectDragSource(t,r){const n=this.handleMoveStart.bind(this,t);return this.sourceNodes.set(t,r),this.addEventListener(r,"start",n),()=>{this.sourceNodes.delete(t),this.removeEventListener(r,"start",n)}}connectDragPreview(t,r,n){return this.sourcePreviewNodeOptions.set(t,n),this.sourcePreviewNodes.set(t,r),()=>{this.sourcePreviewNodes.delete(t),this.sourcePreviewNodeOptions.delete(t)}}connectDropTarget(t,r){const n=this.options.rootElement;if(!this.document||!n)return()=>{};const o=a=>{if(!this.document||!n||!this.monitor.isDragging())return;let u;switch(a.type){case Gs.mouse.move:u={x:a.clientX,y:a.clientY};break;case Gs.touch.move:var h,f;u={x:((h=a.touches[0])===null||h===void 0?void 0:h.clientX)||0,y:((f=a.touches[0])===null||f===void 0?void 0:f.clientY)||0};break}const d=u!=null?this.document.elementFromPoint(u.x,u.y):void 0,g=d&&r.contains(d);if(d===r||g)return this.handleMove(a,t)};return this.addEventListener(this.document.body,"move",o),this.targetNodes.set(t,r),()=>{this.document&&(this.targetNodes.delete(t),this.removeEventListener(this.document.body,"move",o))}}getTopMoveStartHandler(){return!this.options.delayTouchStart&&!this.options.delayMouseStart?this.handleTopMoveStart:this.handleTopMoveStartDelay}installSourceNodeRemovalObserver(t){this.uninstallSourceNodeRemovalObserver(),this.draggedSourceNode=t,this.draggedSourceNodeRemovalObserver=new MutationObserver(()=>{t&&!t.parentElement&&(this.resurrectSourceNode(),this.uninstallSourceNodeRemovalObserver())}),!(!t||!t.parentElement)&&this.draggedSourceNodeRemovalObserver.observe(t.parentElement,{childList:!0})}resurrectSourceNode(){this.document&&this.draggedSourceNode&&(this.draggedSourceNode.style.display="none",this.draggedSourceNode.removeAttribute("data-reactid"),this.document.body.appendChild(this.draggedSourceNode))}uninstallSourceNodeRemovalObserver(){this.draggedSourceNodeRemovalObserver&&this.draggedSourceNodeRemovalObserver.disconnect(),this.draggedSourceNodeRemovalObserver=void 0,this.draggedSourceNode=void 0}constructor(t,r,n){this.getSourceClientOffset=o=>{const a=this.sourceNodes.get(o);return a&&sR(a)},this.handleTopMoveStartCapture=o=>{Lf(o)&&(this.moveStartSourceIds=[])},this.handleMoveStart=o=>{Array.isArray(this.moveStartSourceIds)&&this.moveStartSourceIds.unshift(o)},this.handleTopMoveStart=o=>{if(!Lf(o))return;const a=Pl(o);a&&(mE(o)&&(this.lastTargetTouchFallback=o.targetTouches[0]),this._mouseClientOffset=a),this.waitingForDelay=!1},this.handleTopMoveStartDelay=o=>{if(!Lf(o))return;const a=o.type===Gs.touch.start?this.options.delayTouchStart:this.options.delayMouseStart;this.timeout=setTimeout(this.handleTopMoveStart.bind(this,o),a),this.waitingForDelay=!0},this.handleTopMoveCapture=()=>{this.dragOverTargetIds=[]},this.handleMove=(o,a)=>{this.dragOverTargetIds&&this.dragOverTargetIds.unshift(a)},this.handleTopMove=o=>{if(this.timeout&&clearTimeout(this.timeout),!this.document||this.waitingForDelay)return;const{moveStartSourceIds:a,dragOverTargetIds:u}=this,h=this.options.enableHoverOutsideTarget,f=Pl(o,this.lastTargetTouchFallback);if(!f)return;if(this._isScrolling||!this.monitor.isDragging()&&eR(this._mouseClientOffset.x||0,this._mouseClientOffset.y||0,f.x,f.y,this.options.scrollAngleRanges)){this._isScrolling=!0;return}if(!this.monitor.isDragging()&&this._mouseClientOffset.hasOwnProperty("x")&&a&&QO(this._mouseClientOffset.x||0,this._mouseClientOffset.y||0,f.x,f.y)>(this.options.touchSlop?this.options.touchSlop:0)&&(this.moveStartSourceIds=void 0,this.actions.beginDrag(a,{clientOffset:this._mouseClientOffset,getSourceClientOffset:this.getSourceClientOffset,publishSource:!1})),!this.monitor.isDragging())return;const d=this.sourceNodes.get(this.monitor.getSourceId());this.installSourceNodeRemovalObserver(d),this.actions.publishDragSource(),o.cancelable&&o.preventDefault();const g=(u||[]).map(w=>this.targetNodes.get(w)).filter(w=>!!w),v=this.options.getDropTargetElementsAtPoint?this.options.getDropTargetElementsAtPoint(f.x,f.y,g):this.document.elementsFromPoint(f.x,f.y),y=[];for(const w in v){if(!v.hasOwnProperty(w))continue;let S=v[w];for(S!=null&&y.push(S);S;)S=S.parentElement,S&&y.indexOf(S)===-1&&y.push(S)}const m=y.filter(w=>g.indexOf(w)>-1).map(w=>this._getDropTargetId(w)).filter(w=>!!w).filter((w,S,C)=>C.indexOf(w)===S);if(h)for(const w in this.targetNodes){const S=this.targetNodes.get(w);if(d&&S&&S.contains(d)&&m.indexOf(w)===-1){m.unshift(w);break}}m.reverse(),this.actions.hover(m,{clientOffset:f})},this._getDropTargetId=o=>{const a=this.targetNodes.keys();let u=a.next();for(;u.done===!1;){const h=u.value;if(o===this.targetNodes.get(h))return h;u=a.next()}},this.handleTopMoveEndCapture=o=>{if(this._isScrolling=!1,this.lastTargetTouchFallback=void 0,!!iR(o)){if(!this.monitor.isDragging()||this.monitor.didDrop()){this.moveStartSourceIds=void 0;return}o.cancelable&&o.preventDefault(),this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.drop(),this.actions.endDrag()}},this.handleCancelOnEscape=o=>{o.key==="Escape"&&this.monitor.isDragging()&&(this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.endDrag())},this.options=new JO(n,r),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.sourceNodes=new Map,this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.targetNodes=new Map,this.listenerTypes=[],this._mouseClientOffset={},this._isScrolling=!1,this.options.enableMouseEvents&&this.listenerTypes.push($i.mouse),this.options.enableTouchEvents&&this.listenerTypes.push($i.touch),this.options.enableKeyboardEvents&&this.listenerTypes.push($i.keyboard)}}const aR=function(t,r={},n={}){return new Ao(t,r,n)};var yE=e=>{throw TypeError(e)},SE=(e,t,r)=>t.has(e)||yE("Cannot "+r),ye=(e,t,r)=>(SE(e,t,"read from private field"),r?r.call(e):t.get(e)),lr=(e,t,r)=>t.has(e)?yE("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),_n=(e,t,r,n)=>(SE(e,t,"write to private field"),t.set(e,r),r),Wi,lR=class{constructor(){lr(this,Wi),this.register=t=>{ye(this,Wi).push(t)},this.unregister=t=>{for(;ye(this,Wi).indexOf(t)!==-1;)ye(this,Wi).splice(ye(this,Wi).indexOf(t),1)},this.backendChanged=t=>{for(let r of ye(this,Wi))r.backendChanged(t)},_n(this,Wi,[])}};Wi=new WeakMap;var Xt,Eo,Zt,pi,gn,__,g_,v_,vl,ml,xo,wE=class yl{constructor(t,r,n){if(lr(this,Xt),lr(this,Eo),lr(this,Zt),lr(this,pi),lr(this,gn),lr(this,__,(o,a,u)=>{if(!u.backend)throw new Error(`You must specify a 'backend' property in your Backend entry: ${JSON.stringify(u)}`);let h=u.backend(o,a,u.options),f=u.id,d=!u.id&&h&&h.constructor;if(d&&(f=h.constructor.name),!f)throw new Error(`You must specify an 'id' property in your Backend entry: ${JSON.stringify(u)}
|
|
46
|
+
see this guide: https://github.com/louisbrunner/dnd-multi-backend/tree/master/packages/react-dnd-multi-backend#migrating-from-5xx`);if(d&&console.warn(`Deprecation notice: You are using a pipeline which doesn't include backends' 'id'.
|
|
47
|
+
This might be unsupported in the future, please specify 'id' explicitely for every backend.`),ye(this,Zt)[f])throw new Error(`You must specify a unique 'id' property in your Backend entry:
|
|
48
|
+
${JSON.stringify(u)} (conflicts with: ${JSON.stringify(ye(this,Zt)[f])})`);return{id:f,instance:h,preview:u.preview??!1,transition:u.transition,skipDispatchOnTransition:u.skipDispatchOnTransition??!1}}),this.setup=()=>{if(!(typeof window>"u")){if(yl.isSetUp)throw new Error("Cannot have two MultiBackends at the same time.");yl.isSetUp=!0,ye(this,g_).call(this,window),ye(this,Zt)[ye(this,Xt)].instance.setup()}},this.teardown=()=>{typeof window>"u"||(yl.isSetUp=!1,ye(this,v_).call(this,window),ye(this,Zt)[ye(this,Xt)].instance.teardown())},this.connectDragSource=(o,a,u)=>ye(this,xo).call(this,"connectDragSource",o,a,u),this.connectDragPreview=(o,a,u)=>ye(this,xo).call(this,"connectDragPreview",o,a,u),this.connectDropTarget=(o,a,u)=>ye(this,xo).call(this,"connectDropTarget",o,a,u),this.profile=()=>ye(this,Zt)[ye(this,Xt)].instance.profile(),this.previewEnabled=()=>ye(this,Zt)[ye(this,Xt)].preview,this.previewsList=()=>ye(this,Eo),this.backendsList=()=>ye(this,pi),lr(this,g_,o=>{for(let a of ye(this,pi))a.transition&&o.addEventListener(a.transition.event,ye(this,vl))}),lr(this,v_,o=>{for(let a of ye(this,pi))a.transition&&o.removeEventListener(a.transition.event,ye(this,vl))}),lr(this,vl,o=>{var u;let a=ye(this,Xt);if(ye(this,pi).some(h=>h.id!==ye(this,Xt)&&h.transition&&h.transition.check(o)?(_n(this,Xt,h.id),!0):!1),ye(this,Xt)!==a){ye(this,Zt)[a].instance.teardown();for(let[g,v]of Object.entries(ye(this,gn)))v.unsubscribe(),v.unsubscribe=ye(this,ml).call(this,v.func,...v.args);ye(this,Eo).backendChanged(this);let h=ye(this,Zt)[ye(this,Xt)];if(h.instance.setup(),h.skipDispatchOnTransition)return;let f=o.constructor,d=new f(o.type,o);(u=o.target)==null||u.dispatchEvent(d)}}),lr(this,ml,(o,a,u,h)=>ye(this,Zt)[ye(this,Xt)].instance[o](a,u,h)),lr(this,xo,(o,a,u,h)=>{let f=`${o}_${a}`,d=ye(this,ml).call(this,o,a,u,h);return ye(this,gn)[f]={func:o,args:[a,u,h],unsubscribe:d},()=>{ye(this,gn)[f].unsubscribe(),delete ye(this,gn)[f]}}),!n||!n.backends||n.backends.length<1)throw new Error(`You must specify at least one Backend, if you are coming from 2.x.x (or don't understand this error)
|
|
49
|
+
see this guide: https://github.com/louisbrunner/dnd-multi-backend/tree/master/packages/react-dnd-multi-backend#migrating-from-2xx`);_n(this,Eo,new lR),_n(this,Zt,{}),_n(this,pi,[]);for(let o of n.backends){let a=ye(this,__).call(this,t,r,o);ye(this,Zt)[a.id]=a,ye(this,pi).push(a)}_n(this,Xt,ye(this,pi)[0].id),_n(this,gn,{})}};Xt=new WeakMap,Eo=new WeakMap,Zt=new WeakMap,pi=new WeakMap,gn=new WeakMap,__=new WeakMap,g_=new WeakMap,v_=new WeakMap,vl=new WeakMap,ml=new WeakMap,xo=new WeakMap,wE.isSetUp=!1;var uR=wE,CE=(e,t,r)=>new uR(e,t,r),Wo=(e,t)=>({event:e,check:t}),bE=Wo("touchstart",e=>{let t=e;return t.touches!==null&&t.touches!==void 0}),cR=Wo("dragstart",e=>e.type.indexOf("drag")!==-1||e.type.indexOf("drop")!==-1),hR=Wo("mousedown",e=>e.type.indexOf("touch")===-1&&e.type.indexOf("mouse")!==-1),EE=Wo("pointerdown",e=>e.pointerType==="mouse"),dR={backends:[{id:"html5",backend:XO,transition:EE},{id:"touch",backend:aR,options:{enableMouseEvents:!0},preview:!0,transition:bE}]};const fR=Object.freeze(Object.defineProperty({__proto__:null,HTML5toTouch:dR},Symbol.toStringTag,{value:"Module"})),pR=fg(fR),Uo=ge.createContext({dragDropManager:void 0});function or(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var A1=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),I1=function(){return Math.random().toString(36).substring(7).split("").join(".")},L1={INIT:"@@redux/INIT"+I1(),REPLACE:"@@redux/REPLACE"+I1()};function _R(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function xE(e,t,r){var n;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(or(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(or(1));return r(xE)(e,t)}if(typeof e!="function")throw new Error(or(2));var o=e,a=t,u=[],h=u,f=!1;function d(){h===u&&(h=u.slice())}function g(){if(f)throw new Error(or(3));return a}function v(S){if(typeof S!="function")throw new Error(or(4));if(f)throw new Error(or(5));var C=!0;return d(),h.push(S),function(){if(C){if(f)throw new Error(or(6));C=!1,d();var x=h.indexOf(S);h.splice(x,1),u=null}}}function y(S){if(!_R(S))throw new Error(or(7));if(typeof S.type>"u")throw new Error(or(8));if(f)throw new Error(or(9));try{f=!0,a=o(a,S)}finally{f=!1}for(var C=u=h,E=0;E<C.length;E++){var x=C[E];x()}return S}function m(S){if(typeof S!="function")throw new Error(or(10));o=S,y({type:L1.REPLACE})}function w(){var S,C=v;return S={subscribe:function(x){if(typeof x!="object"||x===null)throw new Error(or(11));function k(){x.next&&x.next(g())}k();var D=C(k);return{unsubscribe:D}}},S[A1]=function(){return this},S}return y({type:L1.INIT}),n={dispatch:y,subscribe:v,getState:g,replaceReducer:m},n[A1]=w,n}function gR(e,t,r){return t.split(".").reduce((n,o)=>n&&n[o]?n[o]:r||null,e)}function vR(e,t){return e.filter(r=>r!==t)}function TE(e){return typeof e=="object"}function mR(e,t){const r=new Map,n=a=>{r.set(a,r.has(a)?r.get(a)+1:1)};e.forEach(n),t.forEach(n);const o=[];return r.forEach((a,u)=>{a===1&&o.push(u)}),o}function yR(e,t){return e.filter(r=>t.indexOf(r)>-1)}const Ig="dnd-core/INIT_COORDS",Yl="dnd-core/BEGIN_DRAG",Lg="dnd-core/PUBLISH_DRAG_SOURCE",Xl="dnd-core/HOVER",Zl="dnd-core/DROP",Jl="dnd-core/END_DRAG";function B1(e,t){return{type:Ig,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const SR={type:Ig,payload:{clientOffset:null,sourceClientOffset:null}};function wR(e){return function(r=[],n={publishSource:!0}){const{publishSource:o=!0,clientOffset:a,getSourceClientOffset:u}=n,h=e.getMonitor(),f=e.getRegistry();e.dispatch(B1(a)),CR(r,h,f);const d=xR(r,h);if(d==null){e.dispatch(SR);return}let g=null;if(a){if(!u)throw new Error("getSourceClientOffset must be defined");bR(u),g=u(d)}e.dispatch(B1(a,g));const y=f.getSource(d).beginDrag(h,d);if(y==null)return;ER(y),f.pinSource(d);const m=f.getSourceType(d);return{type:Yl,payload:{itemType:m,item:y,sourceId:d,clientOffset:a||null,sourceClientOffset:g||null,isSourcePublic:!!o}}}}function CR(e,t,r){Se(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(n){Se(r.getSource(n),"Expected sourceIds to be registered.")})}function bR(e){Se(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function ER(e){Se(TE(e),"Item must be an object.")}function xR(e,t){let r=null;for(let n=e.length-1;n>=0;n--)if(t.canDragSource(e[n])){r=e[n];break}return r}function TR(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function kR(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable}))),n.forEach(function(o){TR(e,o,r[o])})}return e}function DR(e){return function(r={}){const n=e.getMonitor(),o=e.getRegistry();OR(n),MR(n).forEach((u,h)=>{const f=RR(u,h,o,n),d={type:Zl,payload:{dropResult:kR({},r,f)}};e.dispatch(d)})}}function OR(e){Se(e.isDragging(),"Cannot call drop while not dragging."),Se(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function RR(e,t,r,n){const o=r.getTarget(e);let a=o?o.drop(n,e):void 0;return PR(a),typeof a>"u"&&(a=t===0?{}:n.getDropResult()),a}function PR(e){Se(typeof e>"u"||TE(e),"Drop result must either be an object or undefined.")}function MR(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function AR(e){return function(){const r=e.getMonitor(),n=e.getRegistry();IR(r);const o=r.getSourceId();return o!=null&&(n.getSource(o,!0).endDrag(r,o),n.unpinSource()),{type:Jl}}}function IR(e){Se(e.isDragging(),"Cannot call endDrag while not dragging.")}function m_(e,t){return t===null?e===null:Array.isArray(e)?e.some(r=>r===t):e===t}function LR(e){return function(r,{clientOffset:n}={}){BR(r);const o=r.slice(0),a=e.getMonitor(),u=e.getRegistry(),h=a.getItemType();return qR(o,u,h),NR(o,a,u),FR(o,a,u),{type:Xl,payload:{targetIds:o,clientOffset:n||null}}}}function BR(e){Se(Array.isArray(e),"Expected targetIds to be an array.")}function NR(e,t,r){Se(t.isDragging(),"Cannot call hover while not dragging."),Se(!t.didDrop(),"Cannot call hover after drop.");for(let n=0;n<e.length;n++){const o=e[n];Se(e.lastIndexOf(o)===n,"Expected targetIds to be unique in the passed array.");const a=r.getTarget(o);Se(a,"Expected targetIds to be registered.")}}function qR(e,t,r){for(let n=e.length-1;n>=0;n--){const o=e[n],a=t.getTargetType(o);m_(a,r)||e.splice(n,1)}}function FR(e,t,r){e.forEach(function(n){r.getTarget(n).hover(t,n)})}function HR(e){return function(){if(e.getMonitor().isDragging())return{type:Lg}}}function zR(e){return{beginDrag:wR(e),publishDragSource:HR(e),hover:LR(e),drop:DR(e),endDrag:AR(e)}}class WR{receiveBackend(t){this.backend=t}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const t=this,{dispatch:r}=this.store;function n(a){return(...u)=>{const h=a.apply(t,u);typeof h<"u"&&r(h)}}const o=zR(this);return Object.keys(o).reduce((a,u)=>{const h=o[u];return a[u]=n(h),a},{})}dispatch(t){this.store.dispatch(t)}constructor(t,r){this.isSetUp=!1,this.handleRefCountChange=()=>{const n=this.store.getState().refCount>0;this.backend&&(n&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!n&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=t,this.monitor=r,t.subscribe(this.handleRefCountChange)}}function UR(e,t){return{x:e.x+t.x,y:e.y+t.y}}function kE(e,t){return{x:e.x-t.x,y:e.y-t.y}}function jR(e){const{clientOffset:t,initialClientOffset:r,initialSourceClientOffset:n}=e;return!t||!r||!n?null:kE(UR(t,n),r)}function $R(e){const{clientOffset:t,initialClientOffset:r}=e;return!t||!r?null:kE(t,r)}const Io=[],Bg=[];Io.__IS_NONE__=!0;Bg.__IS_ALL__=!0;function KR(e,t){return e===Io?!1:e===Bg||typeof t>"u"?!0:yR(t,e).length>0}class VR{subscribeToStateChange(t,r={}){const{handlerIds:n}=r;Se(typeof t=="function","listener must be a function."),Se(typeof n>"u"||Array.isArray(n),"handlerIds, when specified, must be an array of strings.");let o=this.store.getState().stateId;const a=()=>{const u=this.store.getState(),h=u.stateId;try{h===o||h===o+1&&!KR(u.dirtyHandlerIds,n)||t()}finally{o=h}};return this.store.subscribe(a)}subscribeToOffsetChange(t){Se(typeof t=="function","listener must be a function.");let r=this.store.getState().dragOffset;const n=()=>{const o=this.store.getState().dragOffset;o!==r&&(r=o,t())};return this.store.subscribe(n)}canDragSource(t){if(!t)return!1;const r=this.registry.getSource(t);return Se(r,`Expected to find a valid source. sourceId=${t}`),this.isDragging()?!1:r.canDrag(this,t)}canDropOnTarget(t){if(!t)return!1;const r=this.registry.getTarget(t);if(Se(r,`Expected to find a valid target. targetId=${t}`),!this.isDragging()||this.didDrop())return!1;const n=this.registry.getTargetType(t),o=this.getItemType();return m_(n,o)&&r.canDrop(this,t)}isDragging(){return!!this.getItemType()}isDraggingSource(t){if(!t)return!1;const r=this.registry.getSource(t,!0);if(Se(r,`Expected to find a valid source. sourceId=${t}`),!this.isDragging()||!this.isSourcePublic())return!1;const n=this.registry.getSourceType(t),o=this.getItemType();return n!==o?!1:r.isDragging(this,t)}isOverTarget(t,r={shallow:!1}){if(!t)return!1;const{shallow:n}=r;if(!this.isDragging())return!1;const o=this.registry.getTargetType(t),a=this.getItemType();if(a&&!m_(o,a))return!1;const u=this.getTargetIds();if(!u.length)return!1;const h=u.indexOf(t);return n?h===u.length-1:h>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return jR(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return $R(this.store.getState().dragOffset)}constructor(t,r){this.store=t,this.registry=r}}const N1=typeof global<"u"?global:self,DE=N1.MutationObserver||N1.WebKitMutationObserver;function OE(e){return function(){const r=setTimeout(o,0),n=setInterval(o,50);function o(){clearTimeout(r),clearInterval(n),e()}}}function GR(e){let t=1;const r=new DE(e),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){t=-t,n.data=t}}const YR=typeof DE=="function"?GR:OE;class XR{enqueueTask(t){const{queue:r,requestFlush:n}=this;r.length||(n(),this.flushing=!0),r[r.length]=t}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:t}=this;for(;this.index<t.length;){const r=this.index;if(this.index++,t[r].call(),this.index>this.capacity){for(let n=0,o=t.length-this.index;n<o;n++)t[n]=t[n+this.index];t.length-=this.index,this.index=0}}t.length=0,this.index=0,this.flushing=!1},this.registerPendingError=t=>{this.pendingErrors.push(t),this.requestErrorThrow()},this.requestFlush=YR(this.flush),this.requestErrorThrow=OE(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class ZR{call(){try{this.task&&this.task()}catch(t){this.onError(t)}finally{this.task=null,this.release(this)}}constructor(t,r){this.onError=t,this.release=r,this.task=null}}class JR{create(t){const r=this.freeTasks,n=r.length?r.pop():new ZR(this.onError,o=>r[r.length]=o);return n.task=t,n}constructor(t){this.onError=t,this.freeTasks=[]}}const RE=new XR,QR=new JR(RE.registerPendingError);function e2(e){RE.enqueueTask(QR.create(e))}const Ng="dnd-core/ADD_SOURCE",qg="dnd-core/ADD_TARGET",Fg="dnd-core/REMOVE_SOURCE",Ql="dnd-core/REMOVE_TARGET";function t2(e){return{type:Ng,payload:{sourceId:e}}}function r2(e){return{type:qg,payload:{targetId:e}}}function i2(e){return{type:Fg,payload:{sourceId:e}}}function n2(e){return{type:Ql,payload:{targetId:e}}}function s2(e){Se(typeof e.canDrag=="function","Expected canDrag to be a function."),Se(typeof e.beginDrag=="function","Expected beginDrag to be a function."),Se(typeof e.endDrag=="function","Expected endDrag to be a function.")}function o2(e){Se(typeof e.canDrop=="function","Expected canDrop to be a function."),Se(typeof e.hover=="function","Expected hover to be a function."),Se(typeof e.drop=="function","Expected beginDrag to be a function.")}function y_(e,t){if(t&&Array.isArray(e)){e.forEach(r=>y_(r,!1));return}Se(typeof e=="string"||typeof e=="symbol",t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var hr;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(hr||(hr={}));let a2=0;function l2(){return a2++}function u2(e){const t=l2().toString();switch(e){case hr.SOURCE:return`S${t}`;case hr.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function q1(e){switch(e[0]){case"S":return hr.SOURCE;case"T":return hr.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function F1(e,t){const r=e.entries();let n=!1;do{const{done:o,value:[,a]}=r.next();if(a===t)return!0;n=!!o}while(!n);return!1}class c2{addSource(t,r){y_(t),s2(r);const n=this.addHandler(hr.SOURCE,t,r);return this.store.dispatch(t2(n)),n}addTarget(t,r){y_(t,!0),o2(r);const n=this.addHandler(hr.TARGET,t,r);return this.store.dispatch(r2(n)),n}containsHandler(t){return F1(this.dragSources,t)||F1(this.dropTargets,t)}getSource(t,r=!1){return Se(this.isSourceId(t),"Expected a valid source ID."),r&&t===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(t)}getTarget(t){return Se(this.isTargetId(t),"Expected a valid target ID."),this.dropTargets.get(t)}getSourceType(t){return Se(this.isSourceId(t),"Expected a valid source ID."),this.types.get(t)}getTargetType(t){return Se(this.isTargetId(t),"Expected a valid target ID."),this.types.get(t)}isSourceId(t){return q1(t)===hr.SOURCE}isTargetId(t){return q1(t)===hr.TARGET}removeSource(t){Se(this.getSource(t),"Expected an existing source."),this.store.dispatch(i2(t)),e2(()=>{this.dragSources.delete(t),this.types.delete(t)})}removeTarget(t){Se(this.getTarget(t),"Expected an existing target."),this.store.dispatch(n2(t)),this.dropTargets.delete(t),this.types.delete(t)}pinSource(t){const r=this.getSource(t);Se(r,"Expected an existing source."),this.pinnedSourceId=t,this.pinnedSource=r}unpinSource(){Se(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(t,r,n){const o=u2(t);return this.types.set(o,r),t===hr.SOURCE?this.dragSources.set(o,n):t===hr.TARGET&&this.dropTargets.set(o,n),o}constructor(t){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=t}}const h2=(e,t)=>e===t;function d2(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function f2(e,t,r=h2){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(!r(e[n],t[n]))return!1;return!0}function p2(e=Io,t){switch(t.type){case Xl:break;case Ng:case qg:case Ql:case Fg:return Io;case Yl:case Lg:case Jl:case Zl:default:return Bg}const{targetIds:r=[],prevTargetIds:n=[]}=t.payload,o=mR(r,n);if(!(o.length>0||!f2(r,n)))return Io;const u=n[n.length-1],h=r[r.length-1];return u!==h&&(u&&o.push(u),h&&o.push(h)),o}function _2(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function g2(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable}))),n.forEach(function(o){_2(e,o,r[o])})}return e}const H1={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function v2(e=H1,t){const{payload:r}=t;switch(t.type){case Ig:case Yl:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case Xl:return d2(e.clientOffset,r.clientOffset)?e:g2({},e,{clientOffset:r.clientOffset});case Jl:case Zl:return H1;default:return e}}function m2(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function es(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable}))),n.forEach(function(o){m2(e,o,r[o])})}return e}const y2={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function S2(e=y2,t){const{payload:r}=t;switch(t.type){case Yl:return es({},e,{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case Lg:return es({},e,{isSourcePublic:!0});case Xl:return es({},e,{targetIds:r.targetIds});case Ql:return e.targetIds.indexOf(r.targetId)===-1?e:es({},e,{targetIds:vR(e.targetIds,r.targetId)});case Zl:return es({},e,{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case Jl:return es({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function w2(e=0,t){switch(t.type){case Ng:case qg:return e+1;case Fg:case Ql:return e-1;default:return e}}function C2(e=0){return e+1}function b2(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function E2(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable}))),n.forEach(function(o){b2(e,o,r[o])})}return e}function x2(e={},t){return{dirtyHandlerIds:p2(e.dirtyHandlerIds,{type:t.type,payload:E2({},t.payload,{prevTargetIds:gR(e,"dragOperation.targetIds",[])})}),dragOffset:v2(e.dragOffset,t),refCount:w2(e.refCount,t),dragOperation:S2(e.dragOperation,t),stateId:C2(e.stateId)}}function T2(e,t=void 0,r={},n=!1){const o=k2(n),a=new VR(o,new c2(o)),u=new WR(o,a),h=e(u,t,r);return u.receiveBackend(h),u}function k2(e){const t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return xE(x2,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}function D2(e,t){if(e==null)return{};var r=O2(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function O2(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,a;for(a=0;a<n.length;a++)o=n[a],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}let z1=0;const Sl=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var PE=ge.memo(function(t){var{children:r}=t,n=D2(t,["children"]);const[o,a]=R2(n);return ge.useEffect(()=>{if(a){const u=ME();return++z1,()=>{--z1===0&&(u[Sl]=null)}}},[]),Fe.jsx(Uo.Provider,{value:o,children:r})});function R2(e){if("manager"in e)return[{dragDropManager:e.manager},!1];const t=P2(e.backend,e.context,e.options,e.debugMode),r=!e.context;return[t,r]}function P2(e,t=ME(),r,n){const o=t;return o[Sl]||(o[Sl]={dragDropManager:T2(e,t,r,n)}),o[Sl]}function ME(){return typeof global<"u"?global:window}const M2=ge.memo(function({connect:t,src:r}){return ge.useEffect(()=>{if(typeof Image>"u")return;let n=!1;const o=new Image;return o.src=r,o.onload=()=>{t(o),n=!0},()=>{n&&t(null)}}),null});var Bf,W1;function A2(){return W1||(W1=1,Bf=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,o,a;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(a=Object.keys(t),n=a.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,a[o]))return!1;for(o=n;o--!==0;){var u=a[o];if(!e(t[u],r[u]))return!1}return!0}return t!==t&&r!==r}),Bf}var I2=A2();const L2=dg(I2),wn=typeof window<"u"?ge.useLayoutEffect:ge.useEffect;function AE(e,t,r){const[n,o]=ge.useState(()=>t(e)),a=ge.useCallback(()=>{const u=t(e);L2(n,u)||(o(u),r&&r())},[n,e,r]);return wn(a),[n,a]}function B2(e,t,r){const[n,o]=AE(e,t,r);return wn(function(){const u=e.getHandlerId();if(u!=null)return e.subscribeToStateChange(o,{handlerIds:[u]})},[e,o]),n}function IE(e,t,r){return B2(t,e||(()=>({})),()=>r.reconnect())}function LE(e,t){const r=[...t||[]];return t==null&&typeof e!="function"&&r.push(e),ge.useMemo(()=>typeof e=="function"?e():e,r)}function N2(e){return ge.useMemo(()=>e.hooks.dragSource(),[e])}function q2(e){return ge.useMemo(()=>e.hooks.dragPreview(),[e])}let Nf=!1,qf=!1;class F2{receiveHandlerId(t){this.sourceId=t}getHandlerId(){return this.sourceId}canDrag(){Se(!Nf,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Nf=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Nf=!1}}isDragging(){if(!this.sourceId)return!1;Se(!qf,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return qf=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{qf=!1}}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}isDraggingSource(t){return this.internalMonitor.isDraggingSource(t)}isOverTarget(t,r){return this.internalMonitor.isOverTarget(t,r)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(t){return this.internalMonitor.subscribeToOffsetChange(t)}canDragSource(t){return this.internalMonitor.canDragSource(t)}canDropOnTarget(t){return this.internalMonitor.canDropOnTarget(t)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.sourceId=null,this.internalMonitor=t.getMonitor()}}let Ff=!1;class H2{receiveHandlerId(t){this.targetId=t}getHandlerId(){return this.targetId}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}canDrop(){if(!this.targetId)return!1;Se(!Ff,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return Ff=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Ff=!1}}isOver(t){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,t):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.targetId=null,this.internalMonitor=t.getMonitor()}}function z2(e,t,r){const n=r.getRegistry(),o=n.addTarget(e,t);return[o,()=>n.removeTarget(o)]}function W2(e,t,r){const n=r.getRegistry(),o=n.addSource(e,t);return[o,()=>n.removeSource(o)]}function S_(e,t,r,n){let o;if(o!==void 0)return!!o;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;const a=Object.keys(e),u=Object.keys(t);if(a.length!==u.length)return!1;const h=Object.prototype.hasOwnProperty.bind(t);for(let f=0;f<a.length;f++){const d=a[f];if(!h(d))return!1;const g=e[d],v=t[d];if(o=void 0,o===!1||o===void 0&&g!==v)return!1}return!0}function w_(e){return e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function U2(e){if(typeof e.type=="string")return;const t=e.type.displayName||e.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${t} into a <div>, or turn it into a drag source or a drop target itself.`)}function j2(e){return(t=null,r=null)=>{if(!ge.isValidElement(t)){const a=t;return e(a,r),a}const n=t;return U2(n),$2(n,r?a=>e(a,r):e)}}function BE(e){const t={};return Object.keys(e).forEach(r=>{const n=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{const o=j2(n);t[r]=()=>o}}),t}function U1(e,t){typeof e=="function"?e(t):e.current=t}function $2(e,t){const r=e.ref;return Se(typeof r!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),r?ge.cloneElement(e,{ref:n=>{U1(r,n),U1(t,n)}}):ge.cloneElement(e,{ref:t})}class K2{receiveHandlerId(t){this.handlerId!==t&&(this.handlerId=t,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(t){this.dragSourceOptionsInternal=t}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(t){this.dragPreviewOptionsInternal=t}reconnect(){const t=this.reconnectDragSource();this.reconnectDragPreview(t)}reconnectDragSource(){const t=this.dragSource,r=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return r&&this.disconnectDragSource(),this.handlerId?t?(r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=t,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,t,this.dragSourceOptions)),r):(this.lastConnectedDragSource=t,r):r}reconnectDragPreview(t=!1){const r=this.dragPreview,n=t||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(n&&this.disconnectDragPreview(),!!this.handlerId){if(!r){this.lastConnectedDragPreview=r;return}n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=r,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,r,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!S_(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!S_(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(t){this.hooks=BE({dragSource:(r,n)=>{this.clearDragSource(),this.dragSourceOptions=n||null,w_(r)?this.dragSourceRef=r:this.dragSourceNode=r,this.reconnectDragSource()},dragPreview:(r,n)=>{this.clearDragPreview(),this.dragPreviewOptions=n||null,w_(r)?this.dragPreviewRef=r:this.dragPreviewNode=r,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=t}}class V2{get connectTarget(){return this.dropTarget}reconnect(){const t=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();t&&this.disconnectDropTarget();const r=this.dropTarget;if(this.handlerId){if(!r){this.lastConnectedDropTarget=r;return}t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=r,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,r,this.dropTargetOptions))}}receiveHandlerId(t){t!==this.handlerId&&(this.handlerId=t,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(t){this.dropTargetOptionsInternal=t}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!S_(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(t){this.hooks=BE({dropTarget:(r,n)=>{this.clearDropTarget(),this.dropTargetOptions=n,w_(r)?this.dropTargetRef=r:this.dropTargetNode=r,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=t}}function Gi(){const{dragDropManager:e}=ge.useContext(Uo);return Se(e!=null,"Expected drag drop context"),e}function G2(e,t){const r=Gi(),n=ge.useMemo(()=>new K2(r.getBackend()),[r]);return wn(()=>(n.dragSourceOptions=e||null,n.reconnect(),()=>n.disconnectDragSource()),[n,e]),wn(()=>(n.dragPreviewOptions=t||null,n.reconnect(),()=>n.disconnectDragPreview()),[n,t]),n}function Y2(){const e=Gi();return ge.useMemo(()=>new F2(e),[e])}class X2{beginDrag(){const t=this.spec,r=this.monitor;let n=null;return typeof t.item=="object"?n=t.item:typeof t.item=="function"?n=t.item(r):n={},n??null}canDrag(){const t=this.spec,r=this.monitor;return typeof t.canDrag=="boolean"?t.canDrag:typeof t.canDrag=="function"?t.canDrag(r):!0}isDragging(t,r){const n=this.spec,o=this.monitor,{isDragging:a}=n;return a?a(o):r===t.getSourceId()}endDrag(){const t=this.spec,r=this.monitor,n=this.connector,{end:o}=t;o&&o(r.getItem(),r),n.reconnect()}constructor(t,r,n){this.spec=t,this.monitor=r,this.connector=n}}function Z2(e,t,r){const n=ge.useMemo(()=>new X2(e,t,r),[t,r]);return ge.useEffect(()=>{n.spec=e},[e]),n}function J2(e){return ge.useMemo(()=>{const t=e.type;return Se(t!=null,"spec.type must be defined"),t},[e])}function Q2(e,t,r){const n=Gi(),o=Z2(e,t,r),a=J2(e);wn(function(){if(a!=null){const[h,f]=W2(a,o,n);return t.receiveHandlerId(h),r.receiveHandlerId(h),f}},[n,t,r,o,a])}function NE(e,t){const r=LE(e,t);Se(!r.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const n=Y2(),o=G2(r.options,r.previewOptions);return Q2(r,n,o),[IE(r.collect,n,o),N2(o),q2(o)]}function qE(e){const r=Gi().getMonitor(),[n,o]=AE(r,e);return ge.useEffect(()=>r.subscribeToOffsetChange(o)),ge.useEffect(()=>r.subscribeToStateChange(o)),n}function eP(e){return ge.useMemo(()=>e.hooks.dropTarget(),[e])}function tP(e){const t=Gi(),r=ge.useMemo(()=>new V2(t.getBackend()),[t]);return wn(()=>(r.dropTargetOptions=e||null,r.reconnect(),()=>r.disconnectDropTarget()),[e]),r}function rP(){const e=Gi();return ge.useMemo(()=>new H2(e),[e])}function iP(e){const{accept:t}=e;return ge.useMemo(()=>(Se(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}class nP{canDrop(){const t=this.spec,r=this.monitor;return t.canDrop?t.canDrop(r.getItem(),r):!0}hover(){const t=this.spec,r=this.monitor;t.hover&&t.hover(r.getItem(),r)}drop(){const t=this.spec,r=this.monitor;if(t.drop)return t.drop(r.getItem(),r)}constructor(t,r){this.spec=t,this.monitor=r}}function sP(e,t){const r=ge.useMemo(()=>new nP(e,t),[t]);return ge.useEffect(()=>{r.spec=e},[e]),r}function oP(e,t,r){const n=Gi(),o=sP(e,t),a=iP(e);wn(function(){const[h,f]=z2(a,o,n);return t.receiveHandlerId(h),r.receiveHandlerId(h),f},[n,t,o,r,a.map(u=>u.toString()).join("|")])}function FE(e,t){const r=LE(e,t),n=rP(),o=tP(r.options);return oP(r,n,o),[IE(r.collect,n,o),eP(o)]}const aP=Object.freeze(Object.defineProperty({__proto__:null,DndContext:Uo,DndProvider:PE,DragPreviewImage:M2,useDrag:NE,useDragDropManager:Gi,useDragLayer:qE,useDrop:FE},Symbol.toStringTag,{value:"Module"})),eu=fg(aP);var Hg=ge.createContext(void 0),C_=(e,t)=>({x:e.x-t.x,y:e.y-t.y}),lP=(e,t)=>({x:e.x+t.x,y:e.y+t.y}),uP=e=>{let t=e.getInitialClientOffset(),r=e.getInitialSourceClientOffset();return t===null||r===null?{x:0,y:0}:C_(t,r)},cP=(e,t)=>{switch(e){case"left":case"top-start":case"bottom-start":return 0;case"right":case"top-end":case"bottom-end":return t.width;default:return t.width/2}},hP=(e,t)=>{switch(e){case"top":case"top-start":case"top-end":return 0;case"bottom":case"bottom-start":case"bottom-end":return t.height;default:return t.height/2}},dP=(e,t,r="center",n={x:0,y:0})=>{let o=e.getClientOffset();if(o===null)return null;if(!t.current||!t.current.getBoundingClientRect)return C_(o,uP(e));let a=t.current.getBoundingClientRect(),u={x:cP(r,a),y:hP(r,a)};return lP(C_(o,u),n)},fP=e=>{let t=`translate(${e.x.toFixed(1)}px, ${e.y.toFixed(1)}px)`;return{pointerEvents:"none",position:"fixed",top:0,left:0,transform:t,WebkitTransform:t}},HE=e=>{let t=ge.useRef(null),r=qE(n=>({currentOffset:dP(n,t,e==null?void 0:e.placement,e==null?void 0:e.padding),isDragging:n.isDragging(),itemType:n.getItemType(),item:n.getItem(),monitor:n}));return!r.isDragging||r.currentOffset===null?{display:!1}:{display:!0,itemType:r.itemType,item:r.item,style:fP(r.currentOffset),monitor:r.monitor,ref:t}},pP=e=>{let t=HE({placement:e.placement,padding:e.padding});if(!t.display)return null;let{display:r,...n}=t,o;return"children"in e?typeof e.children=="function"?o=e.children(n):o=e.children:o=e.generator(n),Fe.jsx(Hg.Provider,{value:n,children:o})},_P=jb(),zE=ge.createContext(null),gP=({portal:e,...t})=>{let[r,n]=ge.useState(null);return Fe.jsxs(zE.Provider,{value:e??r,children:[Fe.jsx(PE,{backend:CE,...t}),e?null:Fe.jsx("div",{ref:n})]})},WE=()=>{let[e,t]=ge.useState(!1),r=ge.useContext(Uo);return ge.useEffect(()=>{var a;let n=(a=r==null?void 0:r.dragDropManager)==null?void 0:a.getBackend(),o={backendChanged:u=>{t(u.previewEnabled())}};return t(n.previewEnabled()),n.previewsList().register(o),()=>{n.previewsList().unregister(o)}},[r,r.dragDropManager]),e},UE=e=>{let t=WE(),r=ge.useContext(zE);if(!t)return null;let n=Fe.jsx(pP,{...e});return r!==null?_P.createPortal(n,r):n};UE.Context=Hg;var vP=(e,t,r,n)=>{let o=r.getBackend();r.receiveBackend(n);let a=t(e);return r.receiveBackend(o),a},jE=(e,t)=>{var h;let r=ge.useContext(Uo),n=(h=r==null?void 0:r.dragDropManager)==null?void 0:h.getBackend();if(n===void 0)throw new Error("could not find backend, make sure you are using a <DndProvider />");let o=t(e),a={},u=n.backendsList();for(let f of u)a[f.id]=vP(e,t,r.dragDropManager,f.instance);return[o,a]},mP=e=>jE(e,NE),yP=e=>jE(e,FE),SP=e=>{let t=WE(),r=HE(e);return t?r:{display:!1}};const wP=Object.freeze(Object.defineProperty({__proto__:null,DndProvider:gP,HTML5DragTransition:cR,MouseTransition:hR,MultiBackend:CE,PointerTransition:EE,Preview:UE,PreviewContext:Hg,TouchTransition:bE,createTransition:Wo,useMultiDrag:mP,useMultiDrop:yP,usePreview:SP},Symbol.toStringTag,{value:"Module"})),CP=fg(wP);var Hf={},Ys={},al={},j1;function $E(){if(j1)return al;j1=1,Object.defineProperty(al,"__esModule",{value:!0}),al.default=r;let e;const t=new Uint8Array(16);function r(){if(!e&&(e=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!e))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return e(t)}return al}var ts={},Xs={},Zs={},$1;function bP(){if($1)return Zs;$1=1,Object.defineProperty(Zs,"__esModule",{value:!0}),Zs.default=void 0;var e=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;return Zs.default=e,Zs}var K1;function tu(){if(K1)return Xs;K1=1,Object.defineProperty(Xs,"__esModule",{value:!0}),Xs.default=void 0;var e=t(bP());function t(o){return o&&o.__esModule?o:{default:o}}function r(o){return typeof o=="string"&&e.default.test(o)}var n=r;return Xs.default=n,Xs}var V1;function ru(){if(V1)return ts;V1=1,Object.defineProperty(ts,"__esModule",{value:!0}),ts.default=void 0,ts.unsafeStringify=n;var e=t(tu());function t(u){return u&&u.__esModule?u:{default:u}}const r=[];for(let u=0;u<256;++u)r.push((u+256).toString(16).slice(1));function n(u,h=0){return r[u[h+0]]+r[u[h+1]]+r[u[h+2]]+r[u[h+3]]+"-"+r[u[h+4]]+r[u[h+5]]+"-"+r[u[h+6]]+r[u[h+7]]+"-"+r[u[h+8]]+r[u[h+9]]+"-"+r[u[h+10]]+r[u[h+11]]+r[u[h+12]]+r[u[h+13]]+r[u[h+14]]+r[u[h+15]]}function o(u,h=0){const f=n(u,h);if(!(0,e.default)(f))throw TypeError("Stringified UUID is invalid");return f}var a=o;return ts.default=a,ts}var G1;function EP(){if(G1)return Ys;G1=1,Object.defineProperty(Ys,"__esModule",{value:!0}),Ys.default=void 0;var e=r($E()),t=ru();function r(d){return d&&d.__esModule?d:{default:d}}let n,o,a=0,u=0;function h(d,g,v){let y=g&&v||0;const m=g||new Array(16);d=d||{};let w=d.node||n,S=d.clockseq!==void 0?d.clockseq:o;if(w==null||S==null){const U=d.random||(d.rng||e.default)();w==null&&(w=n=[U[0]|1,U[1],U[2],U[3],U[4],U[5]]),S==null&&(S=o=(U[6]<<8|U[7])&16383)}let C=d.msecs!==void 0?d.msecs:Date.now(),E=d.nsecs!==void 0?d.nsecs:u+1;const x=C-a+(E-u)/1e4;if(x<0&&d.clockseq===void 0&&(S=S+1&16383),(x<0||C>a)&&d.nsecs===void 0&&(E=0),E>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");a=C,u=E,o=S,C+=122192928e5;const k=((C&268435455)*1e4+E)%4294967296;m[y++]=k>>>24&255,m[y++]=k>>>16&255,m[y++]=k>>>8&255,m[y++]=k&255;const D=C/4294967296*1e4&268435455;m[y++]=D>>>8&255,m[y++]=D&255,m[y++]=D>>>24&15|16,m[y++]=D>>>16&255,m[y++]=S>>>8|128,m[y++]=S&255;for(let U=0;U<6;++U)m[y+U]=w[U];return g||(0,t.unsafeStringify)(m)}var f=h;return Ys.default=f,Ys}var Js={},qi={},Qs={},Y1;function KE(){if(Y1)return Qs;Y1=1,Object.defineProperty(Qs,"__esModule",{value:!0}),Qs.default=void 0;var e=t(tu());function t(o){return o&&o.__esModule?o:{default:o}}function r(o){if(!(0,e.default)(o))throw TypeError("Invalid UUID");let a;const u=new Uint8Array(16);return u[0]=(a=parseInt(o.slice(0,8),16))>>>24,u[1]=a>>>16&255,u[2]=a>>>8&255,u[3]=a&255,u[4]=(a=parseInt(o.slice(9,13),16))>>>8,u[5]=a&255,u[6]=(a=parseInt(o.slice(14,18),16))>>>8,u[7]=a&255,u[8]=(a=parseInt(o.slice(19,23),16))>>>8,u[9]=a&255,u[10]=(a=parseInt(o.slice(24,36),16))/1099511627776&255,u[11]=a/4294967296&255,u[12]=a>>>24&255,u[13]=a>>>16&255,u[14]=a>>>8&255,u[15]=a&255,u}var n=r;return Qs.default=n,Qs}var X1;function VE(){if(X1)return qi;X1=1,Object.defineProperty(qi,"__esModule",{value:!0}),qi.URL=qi.DNS=void 0,qi.default=u;var e=ru(),t=r(KE());function r(h){return h&&h.__esModule?h:{default:h}}function n(h){h=unescape(encodeURIComponent(h));const f=[];for(let d=0;d<h.length;++d)f.push(h.charCodeAt(d));return f}const o="6ba7b810-9dad-11d1-80b4-00c04fd430c8";qi.DNS=o;const a="6ba7b811-9dad-11d1-80b4-00c04fd430c8";qi.URL=a;function u(h,f,d){function g(v,y,m,w){var S;if(typeof v=="string"&&(v=n(v)),typeof y=="string"&&(y=(0,t.default)(y)),((S=y)===null||S===void 0?void 0:S.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let C=new Uint8Array(16+v.length);if(C.set(y),C.set(v,y.length),C=d(C),C[6]=C[6]&15|f,C[8]=C[8]&63|128,m){w=w||0;for(let E=0;E<16;++E)m[w+E]=C[E];return m}return(0,e.unsafeStringify)(C)}try{g.name=h}catch{}return g.DNS=o,g.URL=a,g}return qi}var eo={},Z1;function xP(){if(Z1)return eo;Z1=1,Object.defineProperty(eo,"__esModule",{value:!0}),eo.default=void 0;function e(m){if(typeof m=="string"){const w=unescape(encodeURIComponent(m));m=new Uint8Array(w.length);for(let S=0;S<w.length;++S)m[S]=w.charCodeAt(S)}return t(n(o(m),m.length*8))}function t(m){const w=[],S=m.length*32,C="0123456789abcdef";for(let E=0;E<S;E+=8){const x=m[E>>5]>>>E%32&255,k=parseInt(C.charAt(x>>>4&15)+C.charAt(x&15),16);w.push(k)}return w}function r(m){return(m+64>>>9<<4)+14+1}function n(m,w){m[w>>5]|=128<<w%32,m[r(w)-1]=w;let S=1732584193,C=-271733879,E=-1732584194,x=271733878;for(let k=0;k<m.length;k+=16){const D=S,U=C,W=E,P=x;S=f(S,C,E,x,m[k],7,-680876936),x=f(x,S,C,E,m[k+1],12,-389564586),E=f(E,x,S,C,m[k+2],17,606105819),C=f(C,E,x,S,m[k+3],22,-1044525330),S=f(S,C,E,x,m[k+4],7,-176418897),x=f(x,S,C,E,m[k+5],12,1200080426),E=f(E,x,S,C,m[k+6],17,-1473231341),C=f(C,E,x,S,m[k+7],22,-45705983),S=f(S,C,E,x,m[k+8],7,1770035416),x=f(x,S,C,E,m[k+9],12,-1958414417),E=f(E,x,S,C,m[k+10],17,-42063),C=f(C,E,x,S,m[k+11],22,-1990404162),S=f(S,C,E,x,m[k+12],7,1804603682),x=f(x,S,C,E,m[k+13],12,-40341101),E=f(E,x,S,C,m[k+14],17,-1502002290),C=f(C,E,x,S,m[k+15],22,1236535329),S=d(S,C,E,x,m[k+1],5,-165796510),x=d(x,S,C,E,m[k+6],9,-1069501632),E=d(E,x,S,C,m[k+11],14,643717713),C=d(C,E,x,S,m[k],20,-373897302),S=d(S,C,E,x,m[k+5],5,-701558691),x=d(x,S,C,E,m[k+10],9,38016083),E=d(E,x,S,C,m[k+15],14,-660478335),C=d(C,E,x,S,m[k+4],20,-405537848),S=d(S,C,E,x,m[k+9],5,568446438),x=d(x,S,C,E,m[k+14],9,-1019803690),E=d(E,x,S,C,m[k+3],14,-187363961),C=d(C,E,x,S,m[k+8],20,1163531501),S=d(S,C,E,x,m[k+13],5,-1444681467),x=d(x,S,C,E,m[k+2],9,-51403784),E=d(E,x,S,C,m[k+7],14,1735328473),C=d(C,E,x,S,m[k+12],20,-1926607734),S=g(S,C,E,x,m[k+5],4,-378558),x=g(x,S,C,E,m[k+8],11,-2022574463),E=g(E,x,S,C,m[k+11],16,1839030562),C=g(C,E,x,S,m[k+14],23,-35309556),S=g(S,C,E,x,m[k+1],4,-1530992060),x=g(x,S,C,E,m[k+4],11,1272893353),E=g(E,x,S,C,m[k+7],16,-155497632),C=g(C,E,x,S,m[k+10],23,-1094730640),S=g(S,C,E,x,m[k+13],4,681279174),x=g(x,S,C,E,m[k],11,-358537222),E=g(E,x,S,C,m[k+3],16,-722521979),C=g(C,E,x,S,m[k+6],23,76029189),S=g(S,C,E,x,m[k+9],4,-640364487),x=g(x,S,C,E,m[k+12],11,-421815835),E=g(E,x,S,C,m[k+15],16,530742520),C=g(C,E,x,S,m[k+2],23,-995338651),S=v(S,C,E,x,m[k],6,-198630844),x=v(x,S,C,E,m[k+7],10,1126891415),E=v(E,x,S,C,m[k+14],15,-1416354905),C=v(C,E,x,S,m[k+5],21,-57434055),S=v(S,C,E,x,m[k+12],6,1700485571),x=v(x,S,C,E,m[k+3],10,-1894986606),E=v(E,x,S,C,m[k+10],15,-1051523),C=v(C,E,x,S,m[k+1],21,-2054922799),S=v(S,C,E,x,m[k+8],6,1873313359),x=v(x,S,C,E,m[k+15],10,-30611744),E=v(E,x,S,C,m[k+6],15,-1560198380),C=v(C,E,x,S,m[k+13],21,1309151649),S=v(S,C,E,x,m[k+4],6,-145523070),x=v(x,S,C,E,m[k+11],10,-1120210379),E=v(E,x,S,C,m[k+2],15,718787259),C=v(C,E,x,S,m[k+9],21,-343485551),S=a(S,D),C=a(C,U),E=a(E,W),x=a(x,P)}return[S,C,E,x]}function o(m){if(m.length===0)return[];const w=m.length*8,S=new Uint32Array(r(w));for(let C=0;C<w;C+=8)S[C>>5]|=(m[C/8]&255)<<C%32;return S}function a(m,w){const S=(m&65535)+(w&65535);return(m>>16)+(w>>16)+(S>>16)<<16|S&65535}function u(m,w){return m<<w|m>>>32-w}function h(m,w,S,C,E,x){return a(u(a(a(w,m),a(C,x)),E),S)}function f(m,w,S,C,E,x,k){return h(w&S|~w&C,m,w,E,x,k)}function d(m,w,S,C,E,x,k){return h(w&C|S&~C,m,w,E,x,k)}function g(m,w,S,C,E,x,k){return h(w^S^C,m,w,E,x,k)}function v(m,w,S,C,E,x,k){return h(S^(w|~C),m,w,E,x,k)}var y=e;return eo.default=y,eo}var J1;function TP(){if(J1)return Js;J1=1,Object.defineProperty(Js,"__esModule",{value:!0}),Js.default=void 0;var e=r(VE()),t=r(xP());function r(a){return a&&a.__esModule?a:{default:a}}var o=(0,e.default)("v3",48,t.default);return Js.default=o,Js}var to={},ro={},Q1;function kP(){if(Q1)return ro;Q1=1,Object.defineProperty(ro,"__esModule",{value:!0}),ro.default=void 0;var t={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};return ro.default=t,ro}var ew;function DP(){if(ew)return to;ew=1,Object.defineProperty(to,"__esModule",{value:!0}),to.default=void 0;var e=n(kP()),t=n($E()),r=ru();function n(u){return u&&u.__esModule?u:{default:u}}function o(u,h,f){if(e.default.randomUUID&&!h&&!u)return e.default.randomUUID();u=u||{};const d=u.random||(u.rng||t.default)();if(d[6]=d[6]&15|64,d[8]=d[8]&63|128,h){f=f||0;for(let g=0;g<16;++g)h[f+g]=d[g];return h}return(0,r.unsafeStringify)(d)}var a=o;return to.default=a,to}var io={},no={},tw;function OP(){if(tw)return no;tw=1,Object.defineProperty(no,"__esModule",{value:!0}),no.default=void 0;function e(o,a,u,h){switch(o){case 0:return a&u^~a&h;case 1:return a^u^h;case 2:return a&u^a&h^u&h;case 3:return a^u^h}}function t(o,a){return o<<a|o>>>32-a}function r(o){const a=[1518500249,1859775393,2400959708,3395469782],u=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof o=="string"){const g=unescape(encodeURIComponent(o));o=[];for(let v=0;v<g.length;++v)o.push(g.charCodeAt(v))}else Array.isArray(o)||(o=Array.prototype.slice.call(o));o.push(128);const h=o.length/4+2,f=Math.ceil(h/16),d=new Array(f);for(let g=0;g<f;++g){const v=new Uint32Array(16);for(let y=0;y<16;++y)v[y]=o[g*64+y*4]<<24|o[g*64+y*4+1]<<16|o[g*64+y*4+2]<<8|o[g*64+y*4+3];d[g]=v}d[f-1][14]=(o.length-1)*8/Math.pow(2,32),d[f-1][14]=Math.floor(d[f-1][14]),d[f-1][15]=(o.length-1)*8&4294967295;for(let g=0;g<f;++g){const v=new Uint32Array(80);for(let E=0;E<16;++E)v[E]=d[g][E];for(let E=16;E<80;++E)v[E]=t(v[E-3]^v[E-8]^v[E-14]^v[E-16],1);let y=u[0],m=u[1],w=u[2],S=u[3],C=u[4];for(let E=0;E<80;++E){const x=Math.floor(E/20),k=t(y,5)+e(x,m,w,S)+C+a[x]+v[E]>>>0;C=S,S=w,w=t(m,30)>>>0,m=y,y=k}u[0]=u[0]+y>>>0,u[1]=u[1]+m>>>0,u[2]=u[2]+w>>>0,u[3]=u[3]+S>>>0,u[4]=u[4]+C>>>0}return[u[0]>>24&255,u[0]>>16&255,u[0]>>8&255,u[0]&255,u[1]>>24&255,u[1]>>16&255,u[1]>>8&255,u[1]&255,u[2]>>24&255,u[2]>>16&255,u[2]>>8&255,u[2]&255,u[3]>>24&255,u[3]>>16&255,u[3]>>8&255,u[3]&255,u[4]>>24&255,u[4]>>16&255,u[4]>>8&255,u[4]&255]}var n=r;return no.default=n,no}var rw;function RP(){if(rw)return io;rw=1,Object.defineProperty(io,"__esModule",{value:!0}),io.default=void 0;var e=r(VE()),t=r(OP());function r(a){return a&&a.__esModule?a:{default:a}}var o=(0,e.default)("v5",80,t.default);return io.default=o,io}var so={},iw;function PP(){if(iw)return so;iw=1,Object.defineProperty(so,"__esModule",{value:!0}),so.default=void 0;var e="00000000-0000-0000-0000-000000000000";return so.default=e,so}var oo={},nw;function MP(){if(nw)return oo;nw=1,Object.defineProperty(oo,"__esModule",{value:!0}),oo.default=void 0;var e=t(tu());function t(o){return o&&o.__esModule?o:{default:o}}function r(o){if(!(0,e.default)(o))throw TypeError("Invalid UUID");return parseInt(o.slice(14,15),16)}var n=r;return oo.default=n,oo}var sw;function AP(){return sw||(sw=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"NIL",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"parse",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(e,"v1",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"v3",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(e,"v4",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"v5",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"validate",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(e,"version",{enumerable:!0,get:function(){return u.default}});var t=g(EP()),r=g(TP()),n=g(DP()),o=g(RP()),a=g(PP()),u=g(MP()),h=g(tu()),f=g(ru()),d=g(KE());function g(v){return v&&v.__esModule?v:{default:v}}})(Hf)),Hf}var si={},ow;function gr(){if(ow)return si;ow=1;var e=si&&si.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(si,"__esModule",{value:!0}),si.MosaicWindowContext=si.MosaicContext=void 0;var t=e(ut());return si.MosaicContext=t.default.createContext(void 0),si.MosaicWindowContext=t.default.createContext(void 0),si}var kr={},zf,aw;function IP(){if(aw)return zf;aw=1;var e=os(),t=Fl(),r=_r(),n=e?e.isConcatSpreadable:void 0;function o(a){return r(a)||t(a)||!!(n&&a&&a[n])}return zf=o,zf}var Wf,lw;function LP(){if(lw)return Wf;lw=1;var e=Eg(),t=IP();function r(n,o,a,u,h){var f=-1,d=n.length;for(a||(a=t),h||(h=[]);++f<d;){var g=n[f];o>0&&a(g)?o>1?r(g,o-1,a,u,h):e(h,g):u||(h[h.length]=g)}return h}return Wf=r,Wf}var Uf,uw;function BP(){if(uw)return Uf;uw=1;var e=LP();function t(r){var n=r==null?0:r.length;return n?e(r,1):[]}return Uf=t,Uf}var Dr={},jf,cw;function NP(){if(cw)return jf;cw=1;function e(t,r,n){return t===t&&(n!==void 0&&(t=t<=n?t:n),r!==void 0&&(t=t>=r?t:r)),t}return jf=e,jf}var $f,hw;function qP(){if(hw)return $f;hw=1;var e=/\s/;function t(r){for(var n=r.length;n--&&e.test(r.charAt(n)););return n}return $f=t,$f}var Kf,dw;function FP(){if(dw)return Kf;dw=1;var e=qP(),t=/^\s+/;function r(n){return n&&n.slice(0,e(n)+1).replace(t,"")}return Kf=r,Kf}var Vf,fw;function zg(){if(fw)return Vf;fw=1;var e=FP(),t=Gr(),r=Vl(),n=NaN,o=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,u=/^0o[0-7]+$/i,h=parseInt;function f(d){if(typeof d=="number")return d;if(r(d))return n;if(t(d)){var g=typeof d.valueOf=="function"?d.valueOf():d;d=t(g)?g+"":g}if(typeof d!="string")return d===0?d:+d;d=e(d);var v=a.test(d);return v||u.test(d)?h(d.slice(2),v?2:8):o.test(d)?n:+d}return Vf=f,Vf}var Gf,pw;function HP(){if(pw)return Gf;pw=1;var e=NP(),t=zg();function r(n,o,a){return a===void 0&&(a=o,o=void 0),a!==void 0&&(a=t(a),a=a===a?a:0),o!==void 0&&(o=t(o),o=o===o?o:0),e(t(n),o,a)}return Gf=r,Gf}var Yf,_w;function zP(){if(_w)return Yf;_w=1;var e=Mr(),t=function(){return e.Date.now()};return Yf=t,Yf}var Xf,gw;function WP(){if(gw)return Xf;gw=1;var e=Gr(),t=zP(),r=zg(),n="Expected a function",o=Math.max,a=Math.min;function u(h,f,d){var g,v,y,m,w,S,C=0,E=!1,x=!1,k=!0;if(typeof h!="function")throw new TypeError(n);f=r(f)||0,e(d)&&(E=!!d.leading,x="maxWait"in d,y=x?o(r(d.maxWait)||0,f):y,k="trailing"in d?!!d.trailing:k);function D(O){var H=g,$=v;return g=v=void 0,C=O,m=h.apply($,H),m}function U(O){return C=O,w=setTimeout(F,f),E?D(O):m}function W(O){var H=O-S,$=O-C,G=f-H;return x?a(G,y-$):G}function P(O){var H=O-S,$=O-C;return S===void 0||H>=f||H<0||x&&$>=y}function F(){var O=t();if(P(O))return Q(O);w=setTimeout(F,W(O))}function Q(O){return w=void 0,k&&g?D(O):(g=v=void 0,m)}function K(){w!==void 0&&clearTimeout(w),C=0,g=S=v=w=void 0}function q(){return w===void 0?m:Q(t())}function I(){var O=t(),H=P(O);if(g=arguments,v=this,S=O,H){if(w===void 0)return U(S);if(x)return clearTimeout(w),w=setTimeout(F,f),D(S)}return w===void 0&&(w=setTimeout(F,f)),m}return I.cancel=K,I.flush=q,I}return Xf=u,Xf}var Zf,vw;function UP(){if(vw)return Zf;vw=1;var e=WP(),t=Gr(),r="Expected a function";function n(o,a,u){var h=!0,f=!0;if(typeof o!="function")throw new TypeError(r);return t(u)&&(h="leading"in u?!!u.leading:h,f="trailing"in u?!!u.trailing:f),e(o,a,{leading:h,maxWait:a,trailing:f})}return Zf=n,Zf}var ao={},lo={},mw;function jP(){if(mw)return lo;mw=1,Object.defineProperty(lo,"__esModule",{value:!0}),lo.assertNever=void 0;function e(t){throw new Error("Unhandled case: "+JSON.stringify(t))}return lo.assertNever=e,lo}var yw;function GE(){return yw||(yw=1,(function(e){var t=ao&&ao.__assign||function(){return t=Object.assign||function(n){for(var o,a=1,u=arguments.length;a<u;a++){o=arguments[a];for(var h in o)Object.prototype.hasOwnProperty.call(o,h)&&(n[h]=o[h])}return n},t.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.BoundingBox=void 0;var r=jP();(function(n){function o(){return{top:0,right:0,bottom:0,left:0}}n.empty=o;function a(d,g,v){var y=u(d,g,v);return v==="column"?{first:t(t({},d),{bottom:100-y}),second:t(t({},d),{top:y})}:v==="row"?{first:t(t({},d),{right:100-y}),second:t(t({},d),{left:y})}:(0,r.assertNever)(v)}n.split=a;function u(d,g,v){var y=d.top,m=d.right,w=d.bottom,S=d.left;if(v==="column"){var C=100-y-w;return C*g/100+y}else if(v==="row"){var E=100-m-S;return E*g/100+S}else return(0,r.assertNever)(v)}n.getAbsoluteSplitPercentage=u;function h(d,g,v){var y=d.top,m=d.right,w=d.bottom,S=d.left;if(v==="column"){var C=100-y-w;return(g-y)/C*100}else if(v==="row"){var E=100-m-S;return(g-S)/E*100}else return(0,r.assertNever)(v)}n.getRelativeSplitPercentage=h;function f(d){var g=d.top,v=d.right,y=d.bottom,m=d.left;return{top:"".concat(g,"%"),right:"".concat(v,"%"),bottom:"".concat(y,"%"),left:"".concat(m,"%")}}n.asStyles=f})(e.BoundingBox||(e.BoundingBox={}))})(ao)),ao}var Sw;function $P(){if(Sw)return Dr;Sw=1;var e=Dr&&Dr.__extends||(function(){var y=function(m,w){return y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(S,C){S.__proto__=C}||function(S,C){for(var E in C)Object.prototype.hasOwnProperty.call(C,E)&&(S[E]=C[E])},y(m,w)};return function(m,w){if(typeof w!="function"&&w!==null)throw new TypeError("Class extends value "+String(w)+" is not a constructor or null");y(m,w);function S(){this.constructor=m}m.prototype=w===null?Object.create(w):(S.prototype=w.prototype,new S)}})(),t=Dr&&Dr.__assign||function(){return t=Object.assign||function(y){for(var m,w=1,S=arguments.length;w<S;w++){m=arguments[w];for(var C in m)Object.prototype.hasOwnProperty.call(m,C)&&(y[C]=m[C])}return y},t.apply(this,arguments)},r=Dr&&Dr.__importDefault||function(y){return y&&y.__esModule?y:{default:y}};Object.defineProperty(Dr,"__esModule",{value:!0}),Dr.Split=void 0;var n=r(pr()),o=r(HP()),a=r(UP()),u=r(ut()),h=GE(),f=1e3/30,d={capture:!0,passive:!1},g=(function(y){e(m,y);function m(){var w=y!==null&&y.apply(this,arguments)||this;return w.rootElement=u.default.createRef(),w.listenersBound=!1,w.onMouseDown=function(S){!v(S)&&S.button!==0||(S.preventDefault(),w.bindListeners())},w.onMouseUp=function(S){w.unbindListeners();var C=w.calculateRelativePercentage(S);w.props.onRelease(C)},w.onMouseMove=function(S){S.preventDefault(),w.throttledUpdatePercentage(S)},w.throttledUpdatePercentage=(0,a.default)(function(S){var C=w.calculateRelativePercentage(S);C!==w.props.splitPercentage&&w.props.onChange(C)},f),w}return m.prototype.render=function(){var w=this.props.direction;return u.default.createElement("div",{className:(0,n.default)("mosaic-split",{"-row":w==="row","-column":w==="column"}),ref:this.rootElement,onMouseDown:this.onMouseDown,style:this.computeStyle()},u.default.createElement("div",{className:"mosaic-split-line"}))},m.prototype.componentDidMount=function(){this.rootElement.current.addEventListener("touchstart",this.onMouseDown,d)},m.prototype.componentWillUnmount=function(){this.unbindListeners(),this.rootElement.current&&this.rootElement.current.ownerDocument.removeEventListener("touchstart",this.onMouseDown,d)},m.prototype.bindListeners=function(){this.listenersBound||(this.rootElement.current.ownerDocument.addEventListener("mousemove",this.onMouseMove,!0),this.rootElement.current.ownerDocument.addEventListener("touchmove",this.onMouseMove,d),this.rootElement.current.ownerDocument.addEventListener("mouseup",this.onMouseUp,!0),this.rootElement.current.ownerDocument.addEventListener("touchend",this.onMouseUp,!0),this.listenersBound=!0)},m.prototype.unbindListeners=function(){this.rootElement.current&&(this.rootElement.current.ownerDocument.removeEventListener("mousemove",this.onMouseMove,!0),this.rootElement.current.ownerDocument.removeEventListener("touchmove",this.onMouseMove,d),this.rootElement.current.ownerDocument.removeEventListener("mouseup",this.onMouseUp,!0),this.rootElement.current.ownerDocument.removeEventListener("touchend",this.onMouseUp,!0),this.listenersBound=!1)},m.prototype.computeStyle=function(){var w,S=this.props,C=S.boundingBox,E=S.direction,x=S.splitPercentage,k=E==="column"?"top":"left",D=h.BoundingBox.getAbsoluteSplitPercentage(C,x,E);return t(t({},h.BoundingBox.asStyles(C)),(w={},w[k]="".concat(D,"%"),w))},m.prototype.calculateRelativePercentage=function(w){var S=this.props,C=S.minimumPaneSizePercentage,E=S.direction,x=S.boundingBox,k=this.rootElement.current.parentElement.getBoundingClientRect(),D=v(w)?w.changedTouches[0]:w,U;E==="column"?U=(D.clientY-k.top)/k.height*100:U=(D.clientX-k.left)/k.width*100;var W=h.BoundingBox.getRelativeSplitPercentage(x,U,E);return(0,o.default)(W,C,100-C)},m.defaultProps={onChange:function(){},onRelease:function(){},minimumPaneSizePercentage:20},m})(u.default.PureComponent);Dr.Split=g;function v(y){return y.changedTouches!=null}return Dr}var uo={},Jf,ww;function KP(){if(ww)return Jf;ww=1;function e(t,r){for(var n=-1,o=t==null?0:t.length;++n<o&&r(t[n],n,t)!==!1;);return t}return Jf=e,Jf}var Qf,Cw;function iu(){if(Cw)return Qf;Cw=1;var e=Mg(),t=pg();function r(n,o,a,u){var h=!a;a||(a={});for(var f=-1,d=o.length;++f<d;){var g=o[f],v=u?u(a[g],n[g],g,a,n):void 0;v===void 0&&(v=n[g]),h?t(a,g,v):e(a,g,v)}return a}return Qf=r,Qf}var ep,bw;function VP(){if(bw)return ep;bw=1;var e=iu(),t=Tn();function r(n,o){return n&&e(o,t(o),n)}return ep=r,ep}var tp,Ew;function GP(){if(Ew)return tp;Ew=1;var e=iu(),t=Ag();function r(n,o){return n&&e(o,t(o),n)}return tp=r,tp}var To={exports:{}};To.exports;var xw;function YP(){return xw||(xw=1,(function(e,t){var r=Mr(),n=t&&!t.nodeType&&t,o=n&&!0&&e&&!e.nodeType&&e,a=o&&o.exports===n,u=a?r.Buffer:void 0,h=u?u.allocUnsafe:void 0;function f(d,g){if(g)return d.slice();var v=d.length,y=h?h(v):new d.constructor(v);return d.copy(y),y}e.exports=f})(To,To.exports)),To.exports}var rp,Tw;function XP(){if(Tw)return rp;Tw=1;function e(t,r){var n=-1,o=t.length;for(r||(r=Array(o));++n<o;)r[n]=t[n];return r}return rp=e,rp}var ip,kw;function ZP(){if(kw)return ip;kw=1;var e=iu(),t=xg();function r(n,o){return e(n,t(n),o)}return ip=r,ip}var np,Dw;function JP(){if(Dw)return np;Dw=1;var e=iu(),t=uE();function r(n,o){return e(n,t(n),o)}return np=r,np}var sp,Ow;function QP(){if(Ow)return sp;Ow=1;var e=Object.prototype,t=e.hasOwnProperty;function r(n){var o=n.length,a=new n.constructor(o);return o&&typeof n[0]=="string"&&t.call(n,"index")&&(a.index=n.index,a.input=n.input),a}return sp=r,sp}var op,Rw;function Wg(){if(Rw)return op;Rw=1;var e=Qb();function t(r){var n=new r.constructor(r.byteLength);return new e(n).set(new e(r)),n}return op=t,op}var ap,Pw;function eM(){if(Pw)return ap;Pw=1;var e=Wg();function t(r,n){var o=n?e(r.buffer):r.buffer;return new r.constructor(o,r.byteOffset,r.byteLength)}return ap=t,ap}var lp,Mw;function tM(){if(Mw)return lp;Mw=1;var e=/\w*$/;function t(r){var n=new r.constructor(r.source,e.exec(r));return n.lastIndex=r.lastIndex,n}return lp=t,lp}var up,Aw;function rM(){if(Aw)return up;Aw=1;var e=os(),t=e?e.prototype:void 0,r=t?t.valueOf:void 0;function n(o){return r?Object(r.call(o)):{}}return up=n,up}var cp,Iw;function iM(){if(Iw)return cp;Iw=1;var e=Wg();function t(r,n){var o=n?e(r.buffer):r.buffer;return new r.constructor(o,r.byteOffset,r.length)}return cp=t,cp}var hp,Lw;function nM(){if(Lw)return hp;Lw=1;var e=Wg(),t=eM(),r=tM(),n=rM(),o=iM(),a="[object Boolean]",u="[object Date]",h="[object Map]",f="[object Number]",d="[object RegExp]",g="[object Set]",v="[object String]",y="[object Symbol]",m="[object ArrayBuffer]",w="[object DataView]",S="[object Float32Array]",C="[object Float64Array]",E="[object Int8Array]",x="[object Int16Array]",k="[object Int32Array]",D="[object Uint8Array]",U="[object Uint8ClampedArray]",W="[object Uint16Array]",P="[object Uint32Array]";function F(Q,K,q){var I=Q.constructor;switch(K){case m:return e(Q);case a:case u:return new I(+Q);case w:return t(Q,q);case S:case C:case E:case x:case k:case D:case U:case W:case P:return o(Q,q);case h:return new I;case f:case v:return new I(Q);case d:return r(Q);case g:return new I;case y:return n(Q)}}return hp=F,hp}var dp,Bw;function sM(){if(Bw)return dp;Bw=1;var e=Gr(),t=Object.create,r=(function(){function n(){}return function(o){if(!e(o))return{};if(t)return t(o);n.prototype=o;var a=new n;return n.prototype=void 0,a}})();return dp=r,dp}var fp,Nw;function oM(){if(Nw)return fp;Nw=1;var e=sM(),t=lE(),r=zl();function n(o){return typeof o.constructor=="function"&&!r(o)?e(t(o)):{}}return fp=n,fp}var pp,qw;function aM(){if(qw)return pp;qw=1;var e=Ho(),t=xn(),r="[object Map]";function n(o){return t(o)&&e(o)==r}return pp=n,pp}var _p,Fw;function lM(){if(Fw)return _p;Fw=1;var e=aM(),t=vg(),r=mg(),n=r&&r.isMap,o=n?t(n):e;return _p=o,_p}var gp,Hw;function uM(){if(Hw)return gp;Hw=1;var e=Ho(),t=xn(),r="[object Set]";function n(o){return t(o)&&e(o)==r}return gp=n,gp}var vp,zw;function cM(){if(zw)return vp;zw=1;var e=uM(),t=vg(),r=mg(),n=r&&r.isSet,o=n?t(n):e;return vp=o,vp}var mp,Ww;function hM(){if(Ww)return mp;Ww=1;var e=bg(),t=KP(),r=Mg(),n=VP(),o=GP(),a=YP(),u=XP(),h=ZP(),f=JP(),d=rE(),g=cE(),v=Ho(),y=QP(),m=nM(),w=oM(),S=_r(),C=Hl(),E=lM(),x=Gr(),k=cM(),D=Tn(),U=Ag(),W=1,P=2,F=4,Q="[object Arguments]",K="[object Array]",q="[object Boolean]",I="[object Date]",O="[object Error]",H="[object Function]",$="[object GeneratorFunction]",G="[object Map]",ie="[object Number]",B="[object Object]",ee="[object RegExp]",Z="[object Set]",M="[object String]",j="[object Symbol]",oe="[object WeakMap]",ce="[object ArrayBuffer]",de="[object DataView]",fe="[object Float32Array]",we="[object Float64Array]",Ce="[object Int8Array]",De="[object Int16Array]",Je="[object Int32Array]",Jt="[object Uint8Array]",zt="[object Uint8ClampedArray]",ke="[object Uint16Array]",Yr="[object Uint32Array]",Me={};Me[Q]=Me[K]=Me[ce]=Me[de]=Me[q]=Me[I]=Me[fe]=Me[we]=Me[Ce]=Me[De]=Me[Je]=Me[G]=Me[ie]=Me[B]=Me[ee]=Me[Z]=Me[M]=Me[j]=Me[Jt]=Me[zt]=Me[ke]=Me[Yr]=!0,Me[O]=Me[H]=Me[oe]=!1;function Yi(Oe,Xr,Ar,Xi,vr,Qt){var mt,Zi=Xr&W,Ji=Xr&P,Yo=Xr&F;if(Ar&&(mt=vr?Ar(Oe,Xi,vr,Qt):Ar(Oe)),mt!==void 0)return mt;if(!x(Oe))return Oe;var On=S(Oe);if(On){if(mt=y(Oe),!Zi)return u(Oe,mt)}else{var mr=v(Oe),cs=mr==H||mr==$;if(C(Oe))return a(Oe,Zi);if(mr==B||mr==Q||cs&&!vr){if(mt=Ji||cs?{}:w(Oe),!Zi)return Ji?f(Oe,o(mt,Oe)):h(Oe,n(mt,Oe))}else{if(!Me[mr])return vr?Oe:{};mt=m(Oe,mr,Zi)}}Qt||(Qt=new e);var mi=Qt.get(Oe);if(mi)return mi;Qt.set(Oe,mt),k(Oe)?Oe.forEach(function(yr){mt.add(Yi(yr,Xr,Ar,yr,Oe,Qt))}):E(Oe)&&Oe.forEach(function(yr,Ir){mt.set(Ir,Yi(yr,Xr,Ar,Ir,Oe,Qt))});var Qi=Yo?Ji?g:d:Ji?U:D,Xo=On?void 0:Qi(Oe);return t(Xo||Oe,function(yr,Ir){Xo&&(Ir=yr,yr=Oe[Ir]),r(mt,Ir,Yi(yr,Xr,Ar,Ir,Oe,Qt))}),mt}return mp=Yi,mp}var yp,Uw;function dM(){if(Uw)return yp;Uw=1;var e=hM(),t=4;function r(n){return e(n,t)}return yp=r,yp}var jw;function nu(){return jw||(jw=1,(function(e){var t=uo&&uo.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(e,"__esModule",{value:!0}),e.getAndAssertNodeAtPathExists=e.getNodeAtPath=e.getLeaves=e.getPathToCorner=e.getOtherDirection=e.getOtherBranch=e.createBalancedTreeFromLeaves=e.isParent=e.Corner=void 0;var r=t(dM()),n=t(sE());function o(w,S){if(S===void 0&&(S="row"),u(w)){var C=d(S);return{direction:S,first:o(w.first,C),second:o(w.second,C)}}else return w}var a;(function(w){w[w.TOP_LEFT=1]="TOP_LEFT",w[w.TOP_RIGHT=2]="TOP_RIGHT",w[w.BOTTOM_LEFT=3]="BOTTOM_LEFT",w[w.BOTTOM_RIGHT=4]="BOTTOM_RIGHT"})(a=e.Corner||(e.Corner={}));function u(w){return w.direction!=null}e.isParent=u;function h(w,S){if(S===void 0&&(S="row"),w.length===0)return null;for(var C=(0,r.default)(w),E=[];C.length>1;){for(;C.length>0;)C.length>1?E.push({direction:"row",first:C.shift(),second:C.shift()}):E.unshift(C.shift());C=E,E=[]}return o(C[0],S)}e.createBalancedTreeFromLeaves=h;function f(w){if(w==="first")return"second";if(w==="second")return"first";throw new Error("Branch '".concat(w,"' not a valid branch"))}e.getOtherBranch=f;function d(w){return w==="row"?"column":"row"}e.getOtherDirection=d;function g(w,S){for(var C=w,E=[];u(C);)C.direction==="row"&&(S===a.TOP_LEFT||S===a.BOTTOM_LEFT)||C.direction==="column"&&(S===a.TOP_LEFT||S===a.TOP_RIGHT)?(E.push("first"),C=C.first):(E.push("second"),C=C.second);return E}e.getPathToCorner=g;function v(w){return w==null?[]:u(w)?v(w.first).concat(v(w.second)):[w]}e.getLeaves=v;function y(w,S){return S.length>0?(0,n.default)(w,S,null):w}e.getNodeAtPath=y;function m(w,S){if(w==null)throw new Error("Root is empty, cannot fetch path");var C=y(w,S);if(C==null)throw new Error("Path [".concat(S.join(", "),"] did not resolve to a node"));return C}e.getAndAssertNodeAtPathExists=m})(uo)),uo}var $w;function fM(){if($w)return kr;$w=1;var e=kr&&kr.__extends||(function(){var v=function(y,m){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,S){w.__proto__=S}||function(w,S){for(var C in S)Object.prototype.hasOwnProperty.call(S,C)&&(w[C]=S[C])},v(y,m)};return function(y,m){if(typeof m!="function"&&m!==null)throw new TypeError("Class extends value "+String(m)+" is not a constructor or null");v(y,m);function w(){this.constructor=y}y.prototype=m===null?Object.create(m):(w.prototype=m.prototype,new w)}})(),t=kr&&kr.__assign||function(){return t=Object.assign||function(v){for(var y,m=1,w=arguments.length;m<w;m++){y=arguments[m];for(var S in y)Object.prototype.hasOwnProperty.call(y,S)&&(v[S]=y[S])}return v},t.apply(this,arguments)},r=kr&&kr.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(kr,"__esModule",{value:!0}),kr.MosaicRoot=void 0;var n=r(BP()),o=r(ut()),a=gr(),u=$P(),h=GE(),f=nu(),d=(function(v){e(y,v);function y(){var m=v!==null&&v.apply(this,arguments)||this;return m.onResize=function(w,S,C){m.context.mosaicActions.updateTree([{path:S,spec:{splitPercentage:{$set:w}}}],C)},m}return y.prototype.render=function(){var m=this.props.root;return o.default.createElement("div",{className:"mosaic-root"},this.renderRecursively(m,h.BoundingBox.empty(),[]))},y.prototype.renderRecursively=function(m,w,S){if((0,f.isParent)(m)){var C=m.splitPercentage==null?50:m.splitPercentage,E=h.BoundingBox.split(w,C,m.direction),x=E.first,k=E.second;return(0,n.default)([this.renderRecursively(m.first,x,S.concat("first")),this.renderSplit(m.direction,w,C,S),this.renderRecursively(m.second,k,S.concat("second"))].filter(g))}else return o.default.createElement("div",{key:m,className:"mosaic-tile",style:t({},h.BoundingBox.asStyles(w))},this.props.renderTile(m,S))},y.prototype.renderSplit=function(m,w,S,C){var E=this,x=this.props.resize;return x!=="DISABLED"?o.default.createElement(u.Split,t({key:C.join(",")+"splitter"},x,{boundingBox:w,splitPercentage:S,direction:m,onChange:function(k){return E.onResize(k,C,!0)},onRelease:function(k){return E.onResize(k,C,!1)}})):null},y.contextType=a.MosaicContext,y})(o.default.PureComponent);kr.MosaicRoot=d;function g(v){return v!==null}return kr}var oi={},Sp,Kw;function Ug(){if(Kw)return Sp;Kw=1;function e(){}return Sp=e,Sp}var Or={},wp,Vw;function pM(){if(Vw)return wp;Vw=1;function e(t,r,n,o){var a=-1,u=t==null?0:t.length;for(o&&u&&(n=t[++a]);++a<u;)n=r(n,t[a],a,t);return n}return wp=e,wp}var Cp,Gw;function _M(){if(Gw)return Cp;Gw=1;function e(t){return function(r){return t==null?void 0:t[r]}}return Cp=e,Cp}var bp,Yw;function gM(){if(Yw)return bp;Yw=1;var e=_M(),t={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},r=e(t);return bp=r,bp}var Ep,Xw;function vM(){if(Xw)return Ep;Xw=1;var e=gM(),t=Og(),r=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,n="\\u0300-\\u036f",o="\\ufe20-\\ufe2f",a="\\u20d0-\\u20ff",u=n+o+a,h="["+u+"]",f=RegExp(h,"g");function d(g){return g=t(g),g&&g.replace(r,e).replace(f,"")}return Ep=d,Ep}var xp,Zw;function mM(){if(Zw)return xp;Zw=1;var e=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function t(r){return r.match(e)||[]}return xp=t,xp}var Tp,Jw;function yM(){if(Jw)return Tp;Jw=1;var e=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function t(r){return e.test(r)}return Tp=t,Tp}var kp,Qw;function SM(){if(Qw)return kp;Qw=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",o=t+r+n,a="\\u2700-\\u27bf",u="a-z\\xdf-\\xf6\\xf8-\\xff",h="\\xac\\xb1\\xd7\\xf7",f="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",d="\\u2000-\\u206f",g=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",v="A-Z\\xc0-\\xd6\\xd8-\\xde",y="\\ufe0e\\ufe0f",m=h+f+d+g,w="['’]",S="["+m+"]",C="["+o+"]",E="\\d+",x="["+a+"]",k="["+u+"]",D="[^"+e+m+E+a+u+v+"]",U="\\ud83c[\\udffb-\\udfff]",W="(?:"+C+"|"+U+")",P="[^"+e+"]",F="(?:\\ud83c[\\udde6-\\uddff]){2}",Q="[\\ud800-\\udbff][\\udc00-\\udfff]",K="["+v+"]",q="\\u200d",I="(?:"+k+"|"+D+")",O="(?:"+K+"|"+D+")",H="(?:"+w+"(?:d|ll|m|re|s|t|ve))?",$="(?:"+w+"(?:D|LL|M|RE|S|T|VE))?",G=W+"?",ie="["+y+"]?",B="(?:"+q+"(?:"+[P,F,Q].join("|")+")"+ie+G+")*",ee="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Z="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",M=ie+G+B,j="(?:"+[x,F,Q].join("|")+")"+M,oe=RegExp([K+"?"+k+"+"+H+"(?="+[S,K,"$"].join("|")+")",O+"+"+$+"(?="+[S,K+I,"$"].join("|")+")",K+"?"+I+"+"+H,K+"+"+$,Z,ee,E,j].join("|"),"g");function ce(de){return de.match(oe)||[]}return kp=ce,kp}var Dp,eC;function wM(){if(eC)return Dp;eC=1;var e=mM(),t=yM(),r=Og(),n=SM();function o(a,u,h){return a=r(a),u=h?void 0:u,u===void 0?t(a)?n(a):e(a):a.match(u)||[]}return Dp=o,Dp}var Op,tC;function CM(){if(tC)return Op;tC=1;var e=pM(),t=vM(),r=wM(),n="['’]",o=RegExp(n,"g");function a(u){return function(h){return e(r(t(h).replace(o,"")),u,"")}}return Op=a,Op}var Rp,rC;function bM(){if(rC)return Rp;rC=1;var e=CM(),t=e(function(r,n,o){return r+(o?"-":"")+n.toLowerCase()});return Rp=t,Rp}var iC;function kn(){return iC||(iC=1,(function(e){var t=Or&&Or.__createBinding||(Object.create?(function(d,g,v,y){y===void 0&&(y=v);var m=Object.getOwnPropertyDescriptor(g,v);(!m||("get"in m?!g.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return g[v]}}),Object.defineProperty(d,y,m)}):(function(d,g,v,y){y===void 0&&(y=v),d[y]=g[v]})),r=Or&&Or.__setModuleDefault||(Object.create?(function(d,g){Object.defineProperty(d,"default",{enumerable:!0,value:g})}):function(d,g){d.default=g}),n=Or&&Or.__importStar||function(d){if(d&&d.__esModule)return d;var g={};if(d!=null)for(var v in d)v!=="default"&&Object.prototype.hasOwnProperty.call(d,v)&&t(g,d,v);return r(g,d),g},o=Or&&Or.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(e,"__esModule",{value:!0}),e.OptionalBlueprint=void 0;var a=o(pr()),u=o(bM()),h=n(ut()),f=gr();(function(d){d.Icon=function(y){var m=y.icon,w=y.className,S=y.size,C=S===void 0?"standard":S,E=h.useContext(f.MosaicContext).blueprintNamespace;return h.createElement("span",{className:(0,a.default)(w,v(E,m),"".concat(E,"-icon-").concat(C))})};function g(y){for(var m=[],w=1;w<arguments.length;w++)m[w-1]=arguments[w];return m.map(function(S){return"".concat(y,"-").concat((0,u.default)(S))}).join(" ")}d.getClasses=g;function v(y,m){return"".concat(y,"-icon-").concat((0,u.default)(m))}d.getIconClass=v})(e.OptionalBlueprint||(e.OptionalBlueprint={}))})(Or)),Or}var nC;function YE(){if(nC)return oi;nC=1;var e=oi&&oi.__extends||(function(){var f=function(d,g){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,y){v.__proto__=y}||function(v,y){for(var m in y)Object.prototype.hasOwnProperty.call(y,m)&&(v[m]=y[m])},f(d,g)};return function(d,g){if(typeof g!="function"&&g!==null)throw new TypeError("Class extends value "+String(g)+" is not a constructor or null");f(d,g);function v(){this.constructor=d}d.prototype=g===null?Object.create(g):(v.prototype=g.prototype,new v)}})(),t=oi&&oi.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(oi,"__esModule",{value:!0}),oi.MosaicZeroState=void 0;var r=t(pr()),n=t(Ug()),o=t(ut()),a=gr(),u=kn(),h=(function(f){e(d,f);function d(){var g=f!==null&&f.apply(this,arguments)||this;return g.replace=function(){return Promise.resolve(g.props.createNode()).then(function(v){return g.context.mosaicActions.replaceWith([],v)}).catch(n.default)},g}return d.prototype.render=function(){return o.default.createElement("div",{className:(0,r.default)("mosaic-zero-state",u.OptionalBlueprint.getClasses(this.context.blueprintNamespace,"NON_IDEAL_STATE"))},o.default.createElement("div",{className:u.OptionalBlueprint.getClasses(this.context.blueprintNamespace,"NON_IDEAL_STATE_VISUAL")},o.default.createElement(u.OptionalBlueprint.Icon,{className:"default-zero-state-icon",size:"large",icon:"APPLICATIONS"})),o.default.createElement("h4",{className:u.OptionalBlueprint.getClasses(this.context.blueprintNamespace,"HEADING")},"No Windows Present"),o.default.createElement("div",null,this.props.createNode&&o.default.createElement("button",{className:(0,r.default)(u.OptionalBlueprint.getClasses(this.context.blueprintNamespace,"BUTTON"),u.OptionalBlueprint.getIconClass(this.context.blueprintNamespace,"ADD")),onClick:this.replace},"Add New Window")))},d.contextType=a.MosaicContext,d})(o.default.PureComponent);return oi.MosaicZeroState=h,oi}var co={},Pp,sC;function EM(){if(sC)return Pp;sC=1;var e=Dg();function t(r,n){return e(n,function(o){return r[o]})}return Pp=t,Pp}var Mp,oC;function XE(){if(oC)return Mp;oC=1;var e=EM(),t=Tn();function r(n){return n==null?[]:e(n,t(n))}return Mp=r,Mp}var ho={},aC;function jg(){return aC||(aC=1,Object.defineProperty(ho,"__esModule",{value:!0}),ho.MosaicDropTargetPosition=void 0,ho.MosaicDropTargetPosition={TOP:"top",BOTTOM:"bottom",LEFT:"left",RIGHT:"right"}),ho}var Vt={},fo={},lC;function su(){return lC||(lC=1,Object.defineProperty(fo,"__esModule",{value:!0}),fo.MosaicDragType=void 0,fo.MosaicDragType={WINDOW:"MosaicWindow"}),fo}var uC;function ZE(){if(uC)return Vt;uC=1;var e=Vt&&Vt.__createBinding||(Object.create?(function(g,v,y,m){m===void 0&&(m=y);var w=Object.getOwnPropertyDescriptor(v,y);(!w||("get"in w?!v.__esModule:w.writable||w.configurable))&&(w={enumerable:!0,get:function(){return v[y]}}),Object.defineProperty(g,m,w)}):(function(g,v,y,m){m===void 0&&(m=y),g[m]=v[y]})),t=Vt&&Vt.__setModuleDefault||(Object.create?(function(g,v){Object.defineProperty(g,"default",{enumerable:!0,value:v})}):function(g,v){g.default=v}),r=Vt&&Vt.__importStar||function(g){if(g&&g.__esModule)return g;var v={};if(g!=null)for(var y in g)y!=="default"&&Object.prototype.hasOwnProperty.call(g,y)&&e(v,g,y);return t(v,g),v},n=Vt&&Vt.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(Vt,"__esModule",{value:!0}),Vt.MosaicDropTarget=void 0;var o=n(pr()),a=r(ut()),u=eu,h=gr(),f=su();function d(g){var v=g.path,y=g.position,m=(0,a.useContext)(h.MosaicContext).mosaicId,w=(0,u.useDrop)({accept:f.MosaicDragType.WINDOW,drop:function(k,D){return m===(k==null?void 0:k.mosaicId)?{path:v,position:y}:{}},collect:function(k){return{isOver:k.isOver(),draggedMosaicId:(k.getItem()||{}).mosaicId}}}),S=w[0],C=S.isOver,E=S.draggedMosaicId,x=w[1];return a.default.createElement("div",{ref:x,className:(0,o.default)("drop-target",y,{"drop-target-hover":C&&E===m})})}return Vt.MosaicDropTarget=d,Vt}var cC;function xM(){return cC||(cC=1,(function(e){var t=co&&co.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(e,"__esModule",{value:!0}),e.RootDropTargets=void 0;var r=t(pr()),n=t(XE()),o=t(ut()),a=eu,u=jg(),h=ZE(),f=su();e.RootDropTargets=o.default.memo(function(){var g=(0,a.useDrop)({accept:f.MosaicDragType.WINDOW,collect:function(y){return{isDragging:y.getItem()!==null&&y.getItemType()===f.MosaicDragType.WINDOW}}})[0].isDragging,v=d(g,0);return o.default.createElement("div",{className:(0,r.default)("drop-target-container",{"-dragging":v})},(0,n.default)(u.MosaicDropTargetPosition).map(function(y){return o.default.createElement(h.MosaicDropTarget,{position:y,path:[],key:y})}))}),e.RootDropTargets.displayName="RootDropTargets";function d(g,v){var y=o.default.useRef(g),m=o.default.useState(0),w=m[1],S=function(C){y.current=C,w(function(E){return E+1})};return g||(y.current=!1),o.default.useEffect(function(){if(!(y.current===g||!g)){var C=window.setTimeout(function(){return S(!0)},v);return function(){window.clearTimeout(C)}}},[g]),y.current}})(co)),co}var wt={},ll={exports:{}},hC;function TM(){return hC||(hC=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});function r(P){return typeof P=="object"&&!("toString"in P)?Object.prototype.toString.call(P).slice(8,-1):P}var n=typeof process=="object"&&!0;function o(P,F){if(!P)throw n?new Error("Invariant failed"):new Error(F())}t.invariant=o;var a=Object.prototype.hasOwnProperty,u=Array.prototype.splice,h=Object.prototype.toString;function f(P){return h.call(P).slice(8,-1)}var d=Object.assign||(function(P,F){return g(F).forEach(function(Q){a.call(F,Q)&&(P[Q]=F[Q])}),P}),g=typeof Object.getOwnPropertySymbols=="function"?function(P){return Object.keys(P).concat(Object.getOwnPropertySymbols(P))}:function(P){return Object.keys(P)};function v(P){return Array.isArray(P)?d(P.constructor(P.length),P):f(P)==="Map"?new Map(P):f(P)==="Set"?new Set(P):P&&typeof P=="object"?d(Object.create(Object.getPrototypeOf(P)),P):P}var y=(function(){function P(){this.commands=d({},m),this.update=this.update.bind(this),this.update.extend=this.extend=this.extend.bind(this),this.update.isEquals=function(F,Q){return F===Q},this.update.newContext=function(){return new P().update}}return Object.defineProperty(P.prototype,"isEquals",{get:function(){return this.update.isEquals},set:function(F){this.update.isEquals=F},enumerable:!0,configurable:!0}),P.prototype.extend=function(F,Q){this.commands[F]=Q},P.prototype.update=function(F,Q){var K=this,q=typeof Q=="function"?{$apply:Q}:Q;Array.isArray(F)&&Array.isArray(q)||o(!Array.isArray(q),function(){return"update(): You provided an invalid spec to update(). The spec may not contain an array except as the value of $set, $push, $unshift, $splice or any custom command allowing an array value."}),o(typeof q=="object"&&q!==null,function(){return"update(): You provided an invalid spec to update(). The spec and every included key path must be plain objects containing one of the "+("following commands: "+Object.keys(K.commands).join(", ")+".")});var I=F;return g(q).forEach(function(O){if(a.call(K.commands,O)){var H=F===I;I=K.commands[O](q[O],I,q,F),H&&K.isEquals(I,F)&&(I=F)}else{var $=f(F)==="Map"?K.update(F.get(O),q[O]):K.update(F[O],q[O]),G=f(I)==="Map"?I.get(O):I[O];(!K.isEquals($,G)||typeof $>"u"&&!a.call(F,O))&&(I===F&&(I=v(F)),f(I)==="Map"?I.set(O,$):I[O]=$)}}),I},P})();t.Context=y;var m={$push:function(P,F,Q){return S(F,Q,"$push"),P.length?F.concat(P):F},$unshift:function(P,F,Q){return S(F,Q,"$unshift"),P.length?P.concat(F):F},$splice:function(P,F,Q,K){return E(F,Q),P.forEach(function(q){x(q),F===K&&q.length&&(F=v(K)),u.apply(F,q)}),F},$set:function(P,F,Q){return D(Q),P},$toggle:function(P,F){C(P,"$toggle");var Q=P.length?v(F):F;return P.forEach(function(K){Q[K]=!F[K]}),Q},$unset:function(P,F,Q,K){return C(P,"$unset"),P.forEach(function(q){Object.hasOwnProperty.call(F,q)&&(F===K&&(F=v(K)),delete F[q])}),F},$add:function(P,F,Q,K){return W(F,"$add"),C(P,"$add"),f(F)==="Map"?P.forEach(function(q){var I=q[0],O=q[1];F===K&&F.get(I)!==O&&(F=v(K)),F.set(I,O)}):P.forEach(function(q){F===K&&!F.has(q)&&(F=v(K)),F.add(q)}),F},$remove:function(P,F,Q,K){return W(F,"$remove"),C(P,"$remove"),P.forEach(function(q){F===K&&F.has(q)&&(F=v(K)),F.delete(q)}),F},$merge:function(P,F,Q,K){return U(F,P),g(P).forEach(function(q){P[q]!==F[q]&&(F===K&&(F=v(K)),F[q]=P[q])}),F},$apply:function(P,F){return k(P),P(F)}},w=new y;t.isEquals=w.update.isEquals,t.extend=w.extend,t.default=w.update,t.default.default=e.exports=d(t.default,t);function S(P,F,Q){o(Array.isArray(P),function(){return"update(): expected target of "+r(Q)+" to be an array; got "+r(P)+"."}),C(F[Q],Q)}function C(P,F){o(Array.isArray(P),function(){return"update(): expected spec of "+r(F)+" to be an array; got "+r(P)+". Did you forget to wrap your parameter in an array?"})}function E(P,F){o(Array.isArray(P),function(){return"Expected $splice target to be an array; got "+r(P)}),x(F.$splice)}function x(P){o(Array.isArray(P),function(){return"update(): expected spec of $splice to be an array of arrays; got "+r(P)+". Did you forget to wrap your parameters in an array?"})}function k(P){o(typeof P=="function",function(){return"update(): expected spec of $apply to be a function; got "+r(P)+"."})}function D(P){o(Object.keys(P).length===1,function(){return"Cannot have more than one key in an object with $set"})}function U(P,F){o(F&&typeof F=="object",function(){return"update(): $merge expects a spec of type 'object'; got "+r(F)}),o(P&&typeof P=="object",function(){return"update(): $merge expects a target of type 'object'; got "+r(P)})}function W(P,F){var Q=f(P);o(Q==="Map"||Q==="Set",function(){return"update(): "+r(F)+" expects a target of type Set or Map; got "+r(Q)})}})(ll,ll.exports)),ll.exports}var Ap,dC;function $g(){if(dC)return Ap;dC=1;function e(t,r,n){var o=-1,a=t.length;r<0&&(r=-r>a?0:a+r),n=n>a?a:n,n<0&&(n+=a),a=r>n?0:n-r>>>0,r>>>=0;for(var u=Array(a);++o<a;)u[o]=t[o+r];return u}return Ap=e,Ap}var Ip,fC;function kM(){if(fC)return Ip;fC=1;var e=zg(),t=1/0,r=17976931348623157e292;function n(o){if(!o)return o===0?o:0;if(o=e(o),o===t||o===-t){var a=o<0?-1:1;return a*r}return o===o?o:0}return Ip=n,Ip}var Lp,pC;function Kg(){if(pC)return Lp;pC=1;var e=kM();function t(r){var n=e(r),o=n%1;return n===n?o?n-o:n:0}return Lp=t,Lp}var Bp,_C;function DM(){if(_C)return Bp;_C=1;var e=$g(),t=Kg();function r(n,o,a){var u=n==null?0:n.length;return u?(o=a||o===void 0?1:t(o),e(n,o<0?0:o,u)):[]}return Bp=r,Bp}var Np,gC;function JE(){if(gC)return Np;gC=1;var e=$g(),t=Kg();function r(n,o,a){var u=n==null?0:n.length;return u?(o=a||o===void 0?1:t(o),o=u-o,e(n,0,o<0?0:o)):[]}return Np=r,Np}var qp,vC;function QE(){if(vC)return qp;vC=1;var e=Tg();function t(r,n){return e(r,n)}return qp=t,qp}var Fp,mC;function OM(){if(mC)return Fp;mC=1;function e(t){var r=t==null?0:t.length;return r?t[r-1]:void 0}return Fp=e,Fp}var Hp,yC;function RM(){if(yC)return Hp;yC=1;var e=aE();function t(r,n,o){return r==null?r:e(r,n,o)}return Hp=t,Hp}var zp,SC;function PM(){if(SC)return zp;SC=1;var e=$g(),t=Kg();function r(n,o,a){return n&&n.length?(o=a||o===void 0?1:t(o),e(n,0,o<0?0:o)):[]}return zp=r,zp}var wC;function Vg(){if(wC)return wt;wC=1;var e=wt&&wt.__importDefault||function(E){return E&&E.__esModule?E:{default:E}};Object.defineProperty(wt,"__esModule",{value:!0}),wt.createExpandUpdate=wt.createHideUpdate=wt.createDragToUpdates=wt.createRemoveUpdate=wt.updateTree=wt.buildSpecFromUpdate=void 0;var t=e(TM()),r=e(DM()),n=e(JE()),o=e(QE()),a=e(OM()),u=e(RM()),h=e(PM()),f=jg(),d=nu();function g(E){return E.path.length>0?(0,u.default)({},E.path,E.spec):E.spec}wt.buildSpecFromUpdate=g;function v(E,x){var k=E;return x.forEach(function(D){k=(0,t.default)(k,g(D))}),k}wt.updateTree=v;function y(E,x){var k=(0,n.default)(x),D=(0,a.default)(x),U=k.concat((0,d.getOtherBranch)(D)),W=(0,d.getAndAssertNodeAtPathExists)(E,U);return{path:k,spec:{$set:W}}}wt.createRemoveUpdate=y;function m(E,x,k){return(0,o.default)((0,h.default)(E,k),(0,h.default)(x,k))}function w(E,x,k,D){var U=(0,d.getAndAssertNodeAtPathExists)(E,k),W=[],P=m(x,k,k.length);if(P)U=v(U,[y(U,(0,r.default)(x,k.length))]);else{W.push(y(E,x));var F=m(x,k,x.length-1);F&&k.splice(x.length-1,1)}var Q=(0,d.getAndAssertNodeAtPathExists)(E,x),K,q;D===f.MosaicDropTargetPosition.LEFT||D===f.MosaicDropTargetPosition.TOP?(K=Q,q=U):(K=U,q=Q);var I="column";return(D===f.MosaicDropTargetPosition.LEFT||D===f.MosaicDropTargetPosition.RIGHT)&&(I="row"),W.push({path:k,spec:{$set:{first:K,second:q,direction:I}}}),W}wt.createDragToUpdates=w;function S(E){var x=(0,n.default)(E),k=(0,a.default)(E),D;return k==="first"?D=0:D=100,{path:x,spec:{splitPercentage:{$set:D}}}}wt.createHideUpdate=S;function C(E,x){for(var k,D={},U=E.length-1;U>=0;U--){var W=E[U],P=W==="first"?x:100-x;D=(k={splitPercentage:{$set:P}},k[W]=D,k)}return{spec:D,path:[]}}return wt.createExpandUpdate=C,wt}var CC;function MM(){if(CC)return Kt;CC=1;var e=Kt&&Kt.__extends||(function(){var x=function(k,D){return x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(U,W){U.__proto__=W}||function(U,W){for(var P in W)Object.prototype.hasOwnProperty.call(W,P)&&(U[P]=W[P])},x(k,D)};return function(k,D){if(typeof D!="function"&&D!==null)throw new TypeError("Class extends value "+String(D)+" is not a constructor or null");x(k,D);function U(){this.constructor=k}k.prototype=D===null?Object.create(D):(U.prototype=D.prototype,new U)}})(),t=Kt&&Kt.__assign||function(){return t=Object.assign||function(x){for(var k,D=1,U=arguments.length;D<U;D++){k=arguments[D];for(var W in k)Object.prototype.hasOwnProperty.call(k,W)&&(x[W]=k[W])}return x},t.apply(this,arguments)},r=Kt&&Kt.__importDefault||function(x){return x&&x.__esModule?x:{default:x}};Object.defineProperty(Kt,"__esModule",{value:!0}),Kt.Mosaic=Kt.MosaicWithoutDragDropContext=void 0;var n=r(pr());r(MO()),r(Tn()),r(BO());var o=pR,a=r(ut()),u=eu,h=CP,f=AP(),d=gr(),g=fM(),v=YE(),y=xM(),m=Vg(),w=70;function S(x){return x.initialValue!=null}var C=(function(x){e(k,x);function k(){var D=this,U;return D=x.apply(this,arguments)||this,D.state={currentNode:null,lastInitialValue:null,mosaicId:(U=D.props.mosaicId)!==null&&U!==void 0?U:(0,f.v4)()},D.updateRoot=function(W,P){P===void 0&&(P=!1);var F=D.getRoot()||{};D.replaceRoot((0,m.updateTree)(F,W),P)},D.replaceRoot=function(W,P){P===void 0&&(P=!1),D.props.onChange(W),!P&&D.props.onRelease&&D.props.onRelease(W),S(D.props)&&D.setState({currentNode:W})},D.actions={updateTree:D.updateRoot,remove:function(W){W.length===0?D.replaceRoot(null):D.updateRoot([(0,m.createRemoveUpdate)(D.getRoot(),W)])},expand:function(W,P){return P===void 0&&(P=w),D.updateRoot([(0,m.createExpandUpdate)(W,P)])},getRoot:function(){return D.getRoot()},hide:function(W){return D.updateRoot([(0,m.createHideUpdate)(W)])},replaceWith:function(W,P){return D.updateRoot([{path:W,spec:{$set:P}}])}},D.childContext={mosaicActions:D.actions,mosaicId:D.state.mosaicId,blueprintNamespace:D.props.blueprintNamespace},D}return k.getDerivedStateFromProps=function(D,U){return D.mosaicId&&(U.mosaicId,D.mosaicId),S(D)&&D.initialValue!==U.lastInitialValue?{lastInitialValue:D.initialValue,currentNode:D.initialValue}:null},k.prototype.render=function(){var D=this.props.className;return a.default.createElement(d.MosaicContext.Provider,{value:this.childContext},a.default.createElement("div",{className:(0,n.default)(D,"mosaic mosaic-drop-target")},this.renderTree(),a.default.createElement(y.RootDropTargets,null)))},k.prototype.getRoot=function(){return S(this.props)?this.state.currentNode:this.props.value},k.prototype.renderTree=function(){var D=this.getRoot();if(this.validateTree(D),D==null)return this.props.zeroStateView;var U=this.props,W=U.renderTile,P=U.resize;return a.default.createElement(g.MosaicRoot,{root:D,renderTile:W,resize:P})},k.prototype.validateTree=function(D){},k.defaultProps={onChange:function(){},zeroStateView:a.default.createElement(v.MosaicZeroState,null),className:"mosaic-blueprint-theme",blueprintNamespace:"bp3"},k})(a.default.PureComponent);Kt.MosaicWithoutDragDropContext=C;var E=(function(x){e(k,x);function k(){return x!==null&&x.apply(this,arguments)||this}return k.prototype.render=function(){return a.default.createElement(u.DndProvider,t({backend:h.MultiBackend,options:o.HTML5toTouch},this.props.dragAndDropManager&&{manager:this.props.dragAndDropManager}),a.default.createElement(C,t({},this.props)))},k})(a.default.PureComponent);return Kt.Mosaic=E,Kt}var st={},Wp,bC;function AM(){if(bC)return Wp;bC=1;var e="Expected a function";function t(r,n,o){if(typeof r!="function")throw new TypeError(e);return setTimeout(function(){r.apply(void 0,o)},n)}return Wp=t,Wp}var Up,EC;function IM(){if(EC)return Up;EC=1;function e(t,r,n){switch(n.length){case 0:return t.call(r);case 1:return t.call(r,n[0]);case 2:return t.call(r,n[0],n[1]);case 3:return t.call(r,n[0],n[1],n[2])}return t.apply(r,n)}return Up=e,Up}var jp,xC;function LM(){if(xC)return jp;xC=1;var e=IM(),t=Math.max;function r(n,o,a){return o=t(o===void 0?n.length-1:o,0),function(){for(var u=arguments,h=-1,f=t(u.length-o,0),d=Array(f);++h<f;)d[h]=u[o+h];h=-1;for(var g=Array(o+1);++h<o;)g[h]=u[h];return g[o]=a(d),e(n,this,g)}}return jp=r,jp}var $p,TC;function BM(){if(TC)return $p;TC=1;function e(t){return function(){return t}}return $p=e,$p}var Kp,kC;function NM(){if(kC)return Kp;kC=1;var e=BM(),t=Gb(),r=Pg(),n=t?function(o,a){return t(o,"toString",{configurable:!0,enumerable:!1,value:e(a),writable:!0})}:r;return Kp=n,Kp}var Vp,DC;function qM(){if(DC)return Vp;DC=1;var e=800,t=16,r=Date.now;function n(o){var a=0,u=0;return function(){var h=r(),f=t-(h-u);if(u=h,f>0){if(++a>=e)return arguments[0]}else a=0;return o.apply(void 0,arguments)}}return Vp=n,Vp}var Gp,OC;function FM(){if(OC)return Gp;OC=1;var e=NM(),t=qM(),r=t(e);return Gp=r,Gp}var Yp,RC;function HM(){if(RC)return Yp;RC=1;var e=Pg(),t=LM(),r=FM();function n(o,a){return r(t(o,a,e),o+"")}return Yp=n,Yp}var Xp,PC;function zM(){if(PC)return Xp;PC=1;var e=AM(),t=HM(),r=t(function(n,o){return e(n,1,o)});return Xp=r,Xp}var Zp,MC;function WM(){if(MC)return Zp;MC=1;var e=Zb(),t=Ho(),r=Fl(),n=_r(),o=Wl(),a=Hl(),u=zl(),h=yg(),f="[object Map]",d="[object Set]",g=Object.prototype,v=g.hasOwnProperty;function y(m){if(m==null)return!0;if(o(m)&&(n(m)||typeof m=="string"||typeof m.splice=="function"||a(m)||h(m)||r(m)))return!m.length;var w=t(m);if(w==f||w==d)return!m.size;if(u(m))return!e(m).length;for(var S in m)if(v.call(m,S))return!1;return!0}return Zp=y,Zp}var ai={},li={},po={},AC;function jo(){return AC||(AC=1,(function(e){var t=po&&po.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(e,"__esModule",{value:!0}),e.createDefaultToolbarButton=e.DefaultToolbarButton=void 0;var r=t(pr()),n=t(ut()),o=gr(),a=kn(),u=function(f){var d=f.title,g=f.className,v=f.onClick,y=f.text,m=n.default.useContext(o.MosaicContext).blueprintNamespace;return n.default.createElement("button",{title:d,onClick:v,className:(0,r.default)("mosaic-default-control",a.OptionalBlueprint.getClasses(m,"BUTTON","MINIMAL"),g)},y&&n.default.createElement("span",{className:"control-text"},y))};e.DefaultToolbarButton=u;var h=function(f,d,g,v){return n.default.createElement(e.DefaultToolbarButton,{title:f,className:d,onClick:g,text:v})};e.createDefaultToolbarButton=h})(po)),po}var IC;function ex(){if(IC)return li;IC=1;var e=li&&li.__extends||(function(){var f=function(d,g){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,y){v.__proto__=y}||function(v,y){for(var m in y)Object.prototype.hasOwnProperty.call(y,m)&&(v[m]=y[m])},f(d,g)};return function(d,g){if(typeof g!="function"&&g!==null)throw new TypeError("Class extends value "+String(g)+" is not a constructor or null");f(d,g);function v(){this.constructor=d}d.prototype=g===null?Object.create(g):(v.prototype=g.prototype,new v)}})(),t=li&&li.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(li,"__esModule",{value:!0}),li.ExpandButton=void 0;var r=t(pr()),n=t(ut()),o=gr(),a=kn(),u=jo(),h=(function(f){e(d,f);function d(){return f!==null&&f.apply(this,arguments)||this}return d.prototype.render=function(){var g=this;return n.default.createElement(o.MosaicContext.Consumer,null,function(v){var y=v.mosaicActions;return n.default.createElement(u.DefaultToolbarButton,{title:"Expand",className:(0,r.default)("expand-button",a.OptionalBlueprint.getIconClass(g.context.blueprintNamespace,"MAXIMIZE")),onClick:g.createExpand(y)})})},d.prototype.createExpand=function(g){var v=this;return function(){g.expand(v.context.mosaicWindowActions.getPath()),v.props.onClick&&v.props.onClick()}},d.contextType=o.MosaicWindowContext,d})(n.default.PureComponent);return li.ExpandButton=h,li}var ui={},LC;function tx(){if(LC)return ui;LC=1;var e=ui&&ui.__extends||(function(){var f=function(d,g){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,y){v.__proto__=y}||function(v,y){for(var m in y)Object.prototype.hasOwnProperty.call(y,m)&&(v[m]=y[m])},f(d,g)};return function(d,g){if(typeof g!="function"&&g!==null)throw new TypeError("Class extends value "+String(g)+" is not a constructor or null");f(d,g);function v(){this.constructor=d}d.prototype=g===null?Object.create(g):(v.prototype=g.prototype,new v)}})(),t=ui&&ui.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(ui,"__esModule",{value:!0}),ui.RemoveButton=void 0;var r=t(pr()),n=t(ut()),o=gr(),a=kn(),u=jo(),h=(function(f){e(d,f);function d(){return f!==null&&f.apply(this,arguments)||this}return d.prototype.render=function(){var g=this;return n.default.createElement(o.MosaicContext.Consumer,null,function(v){var y=v.mosaicActions,m=v.blueprintNamespace;return n.default.createElement(u.DefaultToolbarButton,{title:"Close Window",className:(0,r.default)("close-button",a.OptionalBlueprint.getIconClass(m,"CROSS")),onClick:g.createRemove(y)})})},d.prototype.createRemove=function(g){var v=this;return function(){g.remove(v.context.mosaicWindowActions.getPath()),v.props.onClick&&v.props.onClick()}},d.contextType=o.MosaicWindowContext,d})(n.default.PureComponent);return ui.RemoveButton=h,ui}var ci={},BC;function rx(){if(BC)return ci;BC=1;var e=ci&&ci.__extends||(function(){var d=function(g,v){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,m){y.__proto__=m}||function(y,m){for(var w in m)Object.prototype.hasOwnProperty.call(m,w)&&(y[w]=m[w])},d(g,v)};return function(g,v){if(typeof v!="function"&&v!==null)throw new TypeError("Class extends value "+String(v)+" is not a constructor or null");d(g,v);function y(){this.constructor=g}g.prototype=v===null?Object.create(v):(y.prototype=v.prototype,new y)}})(),t=ci&&ci.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(ci,"__esModule",{value:!0}),ci.ReplaceButton=void 0;var r=t(pr()),n=t(Ug()),o=t(ut()),a=gr(),u=kn(),h=jo(),f=(function(d){e(g,d);function g(){var v=d!==null&&d.apply(this,arguments)||this;return v.replace=function(){v.context.mosaicWindowActions.replaceWithNew().then(function(){v.props.onClick&&v.props.onClick()}).catch(n.default)},v}return g.prototype.render=function(){return o.default.createElement(h.DefaultToolbarButton,{title:"Replace Window",className:(0,r.default)("replace-button",u.OptionalBlueprint.getIconClass(this.context.blueprintNamespace,"EXCHANGE")),onClick:this.replace})},g.contextType=a.MosaicWindowContext,g})(o.default.PureComponent);return ci.ReplaceButton=f,ci}var hi={},NC;function ix(){if(NC)return hi;NC=1;var e=hi&&hi.__extends||(function(){var d=function(g,v){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,m){y.__proto__=m}||function(y,m){for(var w in m)Object.prototype.hasOwnProperty.call(m,w)&&(y[w]=m[w])},d(g,v)};return function(g,v){if(typeof v!="function"&&v!==null)throw new TypeError("Class extends value "+String(v)+" is not a constructor or null");d(g,v);function y(){this.constructor=g}g.prototype=v===null?Object.create(v):(y.prototype=v.prototype,new y)}})(),t=hi&&hi.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(hi,"__esModule",{value:!0}),hi.SplitButton=void 0;var r=t(pr()),n=t(Ug()),o=t(ut()),a=gr(),u=kn(),h=jo(),f=(function(d){e(g,d);function g(){var v=d!==null&&d.apply(this,arguments)||this;return v.split=function(){v.context.mosaicWindowActions.split().then(function(){v.props.onClick&&v.props.onClick()}).catch(n.default)},v}return g.prototype.render=function(){return o.default.createElement(h.DefaultToolbarButton,{title:"Split Window",className:(0,r.default)("split-button",u.OptionalBlueprint.getIconClass(this.context.blueprintNamespace,"ADD_COLUMN_RIGHT")),onClick:this.split})},g.contextType=a.MosaicWindowContext,g})(o.default.PureComponent);return hi.SplitButton=f,hi}var qC;function nx(){if(qC)return ai;qC=1;var e=ai&&ai.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(ai,"__esModule",{value:!0}),ai.DEFAULT_CONTROLS_WITHOUT_CREATION=ai.DEFAULT_CONTROLS_WITH_CREATION=void 0;var t=e(ut()),r=ex(),n=tx(),o=rx(),a=ix();return ai.DEFAULT_CONTROLS_WITH_CREATION=t.default.Children.toArray([t.default.createElement(o.ReplaceButton,null),t.default.createElement(a.SplitButton,null),t.default.createElement(r.ExpandButton,null),t.default.createElement(n.RemoveButton,null)]),ai.DEFAULT_CONTROLS_WITHOUT_CREATION=t.default.Children.toArray([t.default.createElement(r.ExpandButton,null),t.default.createElement(n.RemoveButton,null)]),ai}var di={},FC;function sx(){if(FC)return di;FC=1;var e=di&&di.__extends||(function(){var o=function(a,u){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,f){h.__proto__=f}||function(h,f){for(var d in f)Object.prototype.hasOwnProperty.call(f,d)&&(h[d]=f[d])},o(a,u)};return function(a,u){if(typeof u!="function"&&u!==null)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");o(a,u);function h(){this.constructor=a}a.prototype=u===null?Object.create(u):(h.prototype=u.prototype,new h)}})(),t=di&&di.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(di,"__esModule",{value:!0}),di.Separator=void 0;var r=t(ut()),n=(function(o){e(a,o);function a(){return o!==null&&o.apply(this,arguments)||this}return a.prototype.render=function(){return r.default.createElement("div",{className:"separator"})},a})(r.default.PureComponent);return di.Separator=n,di}var HC;function UM(){if(HC)return st;HC=1;var e=st&&st.__extends||(function(){var K=function(q,I){return K=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(O,H){O.__proto__=H}||function(O,H){for(var $ in H)Object.prototype.hasOwnProperty.call(H,$)&&(O[$]=H[$])},K(q,I)};return function(q,I){if(typeof I!="function"&&I!==null)throw new TypeError("Class extends value "+String(I)+" is not a constructor or null");K(q,I);function O(){this.constructor=q}q.prototype=I===null?Object.create(I):(O.prototype=I.prototype,new O)}})(),t=st&&st.__assign||function(){return t=Object.assign||function(K){for(var q,I=1,O=arguments.length;I<O;I++){q=arguments[I];for(var H in q)Object.prototype.hasOwnProperty.call(q,H)&&(K[H]=q[H])}return K},t.apply(this,arguments)},r=st&&st.__createBinding||(Object.create?(function(K,q,I,O){O===void 0&&(O=I);var H=Object.getOwnPropertyDescriptor(q,I);(!H||("get"in H?!q.__esModule:H.writable||H.configurable))&&(H={enumerable:!0,get:function(){return q[I]}}),Object.defineProperty(K,O,H)}):(function(K,q,I,O){O===void 0&&(O=I),K[O]=q[I]})),n=st&&st.__setModuleDefault||(Object.create?(function(K,q){Object.defineProperty(K,"default",{enumerable:!0,value:q})}):function(K,q){K.default=q}),o=st&&st.__importStar||function(K){if(K&&K.__esModule)return K;var q={};if(K!=null)for(var I in K)I!=="default"&&Object.prototype.hasOwnProperty.call(K,I)&&r(q,K,I);return n(q,K),q},a=st&&st.__importDefault||function(K){return K&&K.__esModule?K:{default:K}};Object.defineProperty(st,"__esModule",{value:!0}),st.MosaicWindow=st.InternalMosaicWindow=void 0;var u=a(pr()),h=a(zM()),f=a(JE()),d=a(WM()),g=a(QE()),v=a(XE()),y=o(ut()),m=eu,w=nx(),S=sx(),C=gr(),E=jg(),x=ZE(),k=su(),D=Vg(),U=nu(),W=kn(),P=(function(K){e(q,K);function q(){var I=K!==null&&K.apply(this,arguments)||this;return I.state={additionalControlsOpen:!1},I.rootElement=null,I.renderDropTarget=function(O){var H=I.props.path;return y.default.createElement(x.MosaicDropTarget,{position:O,path:H,key:O})},I.split=function(){for(var O=[],H=0;H<arguments.length;H++)O[H]=arguments[H];I.checkCreateNode();var $=I.props,G=$.createNode,ie=$.path,B=I.context.mosaicActions,ee=B.getRoot(),Z=I.rootElement.offsetWidth>I.rootElement.offsetHeight?"row":"column";return Promise.resolve(G.apply(void 0,O)).then(function(M){return B.replaceWith(ie,{direction:Z,second:M,first:(0,U.getAndAssertNodeAtPathExists)(ee,ie)})})},I.swap=function(){for(var O=[],H=0;H<arguments.length;H++)O[H]=arguments[H];I.checkCreateNode();var $=I.context.mosaicActions,G=I.props,ie=G.createNode,B=G.path;return Promise.resolve(ie.apply(void 0,O)).then(function(ee){return $.replaceWith(B,ee)})},I.setAdditionalControlsOpen=function(O){var H,$,G=O==="toggle"?!I.state.additionalControlsOpen:O;I.setState({additionalControlsOpen:G}),($=(H=I.props).onAdditionalControlsToggle)===null||$===void 0||$.call(H,G)},I.getPath=function(){return I.props.path},I.connectDragSource=function(O){var H=I.props.connectDragSource;return H(O)},I.childContext={blueprintNamespace:I.context.blueprintNamespace,mosaicWindowActions:{split:I.split,replaceWithNew:I.swap,setAdditionalControlsOpen:I.setAdditionalControlsOpen,getPath:I.getPath,connectDragSource:I.connectDragSource}},I}return q.prototype.render=function(){var I=this,O=this.props,H=O.className,$=O.isOver,G=O.renderPreview,ie=O.additionalControls,B=O.connectDropTarget,ee=O.connectDragPreview,Z=O.draggedMosaicId,M=O.disableAdditionalControlsOverlay;return y.default.createElement(C.MosaicWindowContext.Provider,{value:this.childContext},B(y.default.createElement("div",{className:(0,u.default)("mosaic-window mosaic-drop-target",H,{"drop-target-hover":$&&Z===this.context.mosaicId,"additional-controls-open":this.state.additionalControlsOpen}),ref:function(j){return I.rootElement=j}},this.renderToolbar(),y.default.createElement("div",{className:"mosaic-window-body"},this.props.children),!M&&y.default.createElement("div",{className:"mosaic-window-body-overlay",onClick:function(){I.setAdditionalControlsOpen(!1)}}),y.default.createElement("div",{className:"mosaic-window-additional-actions-bar"},ie),ee(G(this.props)),y.default.createElement("div",{className:"drop-target-container"},(0,v.default)(E.MosaicDropTargetPosition).map(this.renderDropTarget)))))},q.prototype.getToolbarControls=function(){var I=this.props,O=I.toolbarControls,H=I.createNode;return O||(H?w.DEFAULT_CONTROLS_WITH_CREATION:w.DEFAULT_CONTROLS_WITHOUT_CREATION)},q.prototype.renderToolbar=function(){var I,O=this,H=this.props,$=H.title,G=H.draggable,ie=H.additionalControls,B=H.additionalControlButtonText,ee=H.path,Z=H.renderToolbar,M=this.state.additionalControlsOpen,j=this.getToolbarControls(),oe=G&&ee.length>0,ce=oe?this.props.connectDragSource:function(Ce){return Ce};if(Z){var de=ce(Z(this.props,G));return y.default.createElement("div",{className:(0,u.default)("mosaic-window-toolbar",{draggable:oe})},de)}var fe=ce(y.default.createElement("div",{title:$,className:"mosaic-window-title"},$)),we=!(0,d.default)(ie);return y.default.createElement("div",{className:(0,u.default)("mosaic-window-toolbar",{draggable:oe})},fe,y.default.createElement("div",{className:(0,u.default)("mosaic-window-controls",W.OptionalBlueprint.getClasses("BUTTON_GROUP"))},we&&y.default.createElement("button",{onClick:function(){return O.setAdditionalControlsOpen(!M)},className:(0,u.default)(W.OptionalBlueprint.getClasses(this.context.blueprintNamespace,"BUTTON","MINIMAL"),W.OptionalBlueprint.getIconClass(this.context.blueprintNamespace,"MORE"),(I={},I[W.OptionalBlueprint.getClasses(this.context.blueprintNamespace,"ACTIVE")]=M,I))},y.default.createElement("span",{className:"control-text"},B)),we&&y.default.createElement(S.Separator,null),j))},q.prototype.checkCreateNode=function(){if(this.props.createNode==null)throw new Error("Operation invalid unless `createNode` is defined")},q.defaultProps={additionalControlButtonText:"More",draggable:!0,renderPreview:function(I){var O=I.title;return y.default.createElement("div",{className:"mosaic-preview"},y.default.createElement("div",{className:"mosaic-window-toolbar"},y.default.createElement("div",{className:"mosaic-window-title"},O)),y.default.createElement("div",{className:"mosaic-window-body"},y.default.createElement("h4",null,O),y.default.createElement(W.OptionalBlueprint.Icon,{className:"default-preview-icon",size:"large",icon:"APPLICATION"})))},renderToolbar:null},q.contextType=C.MosaicContext,q})(y.default.Component);st.InternalMosaicWindow=P;function F(K){var q=(0,y.useContext)(C.MosaicContext),I=q.mosaicActions,O=q.mosaicId,H=(0,m.useDrag)({type:k.MosaicDragType.WINDOW,item:function(j){K.onDragStart&&K.onDragStart();var oe=(0,h.default)(function(){return I.hide(K.path)});return{mosaicId:O,hideTimer:oe}},end:function(j,oe){var ce=j.hideTimer;window.clearTimeout(ce);var de=K.path,fe=oe.getDropResult()||{},we=fe.position,Ce=fe.path;we!=null&&Ce!=null&&!(0,g.default)(Ce,de)?(I.updateTree((0,D.createDragToUpdates)(I.getRoot(),de,Ce,we)),K.onDragEnd&&K.onDragEnd("drop")):(I.updateTree([{path:(0,f.default)(de),spec:{splitPercentage:{$set:void 0}}}]),K.onDragEnd&&K.onDragEnd("reset"))}}),$=H[1],G=H[2],ie=(0,m.useDrop)({accept:k.MosaicDragType.WINDOW,collect:function(j){var oe;return{isOver:j.isOver(),draggedMosaicId:(oe=j.getItem())===null||oe===void 0?void 0:oe.mosaicId}}}),B=ie[0],ee=B.isOver,Z=B.draggedMosaicId,M=ie[1];return y.default.createElement(P,t({},K,{connectDragPreview:G,connectDragSource:$,connectDropTarget:M,isOver:ee,draggedMosaicId:Z}))}var Q=(function(K){e(q,K);function q(){return K!==null&&K.apply(this,arguments)||this}return q.prototype.render=function(){return y.default.createElement(F,t({},this.props))},q})(y.default.PureComponent);return st.MosaicWindow=Q,st}var zC;function jM(){return zC||(zC=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_CONTROLS_WITHOUT_CREATION=e.DEFAULT_CONTROLS_WITH_CREATION=e.RemoveButton=e.SplitButton=e.ReplaceButton=e.ExpandButton=e.Separator=e.MosaicZeroState=e.DefaultToolbarButton=e.createDefaultToolbarButton=e.MosaicWindow=e.isParent=e.getPathToCorner=e.getOtherDirection=e.getOtherBranch=e.getNodeAtPath=e.getLeaves=e.getAndAssertNodeAtPathExists=e.Corner=e.createBalancedTreeFromLeaves=e.updateTree=e.createRemoveUpdate=e.createHideUpdate=e.createExpandUpdate=e.createDragToUpdates=e.buildSpecFromUpdate=e.MosaicWindowContext=e.MosaicContext=e.MosaicDragType=e.MosaicWithoutDragDropContext=e.Mosaic=void 0;/**
|
|
50
|
+
* @license
|
|
51
|
+
* Copyright 2019 Kevin Verdieck, originally developed at Palantir Technologies, Inc.
|
|
52
|
+
*
|
|
53
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
54
|
+
* you may not use this file except in compliance with the License.
|
|
55
|
+
* You may obtain a copy of the License at
|
|
56
|
+
*
|
|
57
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
58
|
+
*
|
|
59
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
60
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
61
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
62
|
+
* See the License for the specific language governing permissions and
|
|
63
|
+
* limitations under the License.
|
|
64
|
+
*/var t=MM();Object.defineProperty(e,"Mosaic",{enumerable:!0,get:function(){return t.Mosaic}}),Object.defineProperty(e,"MosaicWithoutDragDropContext",{enumerable:!0,get:function(){return t.MosaicWithoutDragDropContext}});var r=su();Object.defineProperty(e,"MosaicDragType",{enumerable:!0,get:function(){return r.MosaicDragType}});var n=gr();Object.defineProperty(e,"MosaicContext",{enumerable:!0,get:function(){return n.MosaicContext}}),Object.defineProperty(e,"MosaicWindowContext",{enumerable:!0,get:function(){return n.MosaicWindowContext}});var o=Vg();Object.defineProperty(e,"buildSpecFromUpdate",{enumerable:!0,get:function(){return o.buildSpecFromUpdate}}),Object.defineProperty(e,"createDragToUpdates",{enumerable:!0,get:function(){return o.createDragToUpdates}}),Object.defineProperty(e,"createExpandUpdate",{enumerable:!0,get:function(){return o.createExpandUpdate}}),Object.defineProperty(e,"createHideUpdate",{enumerable:!0,get:function(){return o.createHideUpdate}}),Object.defineProperty(e,"createRemoveUpdate",{enumerable:!0,get:function(){return o.createRemoveUpdate}}),Object.defineProperty(e,"updateTree",{enumerable:!0,get:function(){return o.updateTree}});var a=nu();Object.defineProperty(e,"createBalancedTreeFromLeaves",{enumerable:!0,get:function(){return a.createBalancedTreeFromLeaves}}),Object.defineProperty(e,"Corner",{enumerable:!0,get:function(){return a.Corner}}),Object.defineProperty(e,"getAndAssertNodeAtPathExists",{enumerable:!0,get:function(){return a.getAndAssertNodeAtPathExists}}),Object.defineProperty(e,"getLeaves",{enumerable:!0,get:function(){return a.getLeaves}}),Object.defineProperty(e,"getNodeAtPath",{enumerable:!0,get:function(){return a.getNodeAtPath}}),Object.defineProperty(e,"getOtherBranch",{enumerable:!0,get:function(){return a.getOtherBranch}}),Object.defineProperty(e,"getOtherDirection",{enumerable:!0,get:function(){return a.getOtherDirection}}),Object.defineProperty(e,"getPathToCorner",{enumerable:!0,get:function(){return a.getPathToCorner}}),Object.defineProperty(e,"isParent",{enumerable:!0,get:function(){return a.isParent}});var u=UM();Object.defineProperty(e,"MosaicWindow",{enumerable:!0,get:function(){return u.MosaicWindow}});var h=jo();Object.defineProperty(e,"createDefaultToolbarButton",{enumerable:!0,get:function(){return h.createDefaultToolbarButton}}),Object.defineProperty(e,"DefaultToolbarButton",{enumerable:!0,get:function(){return h.DefaultToolbarButton}});var f=YE();Object.defineProperty(e,"MosaicZeroState",{enumerable:!0,get:function(){return f.MosaicZeroState}});var d=sx();Object.defineProperty(e,"Separator",{enumerable:!0,get:function(){return d.Separator}});var g=ex();Object.defineProperty(e,"ExpandButton",{enumerable:!0,get:function(){return g.ExpandButton}});var v=rx();Object.defineProperty(e,"ReplaceButton",{enumerable:!0,get:function(){return v.ReplaceButton}});var y=ix();Object.defineProperty(e,"SplitButton",{enumerable:!0,get:function(){return y.SplitButton}});var m=tx();Object.defineProperty(e,"RemoveButton",{enumerable:!0,get:function(){return m.RemoveButton}});var w=nx();Object.defineProperty(e,"DEFAULT_CONTROLS_WITH_CREATION",{enumerable:!0,get:function(){return w.DEFAULT_CONTROLS_WITH_CREATION}}),Object.defineProperty(e,"DEFAULT_CONTROLS_WITHOUT_CREATION",{enumerable:!0,get:function(){return w.DEFAULT_CONTROLS_WITHOUT_CREATION}})})(sh)),sh}var WC=jM();const Kr=Object.create(null);Kr.open="0";Kr.close="1";Kr.ping="2";Kr.pong="3";Kr.message="4";Kr.upgrade="5";Kr.noop="6";const wl=Object.create(null);Object.keys(Kr).forEach(e=>{wl[Kr[e]]=e});const b_={type:"error",data:"parser error"},ox=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",ax=typeof ArrayBuffer=="function",lx=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Gg=({type:e,data:t},r,n)=>ox&&t instanceof Blob?r?n(t):UC(t,n):ax&&(t instanceof ArrayBuffer||lx(t))?r?n(t):UC(new Blob([t]),n):n(Kr[e]+(t||"")),UC=(e,t)=>{const r=new FileReader;return r.onload=function(){const n=r.result.split(",")[1];t("b"+(n||""))},r.readAsDataURL(e)};function jC(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Jp;function $M(e,t){if(ox&&e.data instanceof Blob)return e.data.arrayBuffer().then(jC).then(t);if(ax&&(e.data instanceof ArrayBuffer||lx(e.data)))return t(jC(e.data));Gg(e,!1,r=>{Jp||(Jp=new TextEncoder),t(Jp.encode(r))})}const $C="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ko=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<$C.length;e++)ko[$C.charCodeAt(e)]=e;const KM=e=>{let t=e.length*.75,r=e.length,n,o=0,a,u,h,f;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const d=new ArrayBuffer(t),g=new Uint8Array(d);for(n=0;n<r;n+=4)a=ko[e.charCodeAt(n)],u=ko[e.charCodeAt(n+1)],h=ko[e.charCodeAt(n+2)],f=ko[e.charCodeAt(n+3)],g[o++]=a<<2|u>>4,g[o++]=(u&15)<<4|h>>2,g[o++]=(h&3)<<6|f&63;return d},VM=typeof ArrayBuffer=="function",Yg=(e,t)=>{if(typeof e!="string")return{type:"message",data:ux(e,t)};const r=e.charAt(0);return r==="b"?{type:"message",data:GM(e.substring(1),t)}:wl[r]?e.length>1?{type:wl[r],data:e.substring(1)}:{type:wl[r]}:b_},GM=(e,t)=>{if(VM){const r=KM(e);return ux(r,t)}else return{base64:!0,data:e}},ux=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},cx="",YM=(e,t)=>{const r=e.length,n=new Array(r);let o=0;e.forEach((a,u)=>{Gg(a,!1,h=>{n[u]=h,++o===r&&t(n.join(cx))})})},XM=(e,t)=>{const r=e.split(cx),n=[];for(let o=0;o<r.length;o++){const a=Yg(r[o],t);if(n.push(a),a.type==="error")break}return n};function ZM(){return new TransformStream({transform(e,t){$M(e,r=>{const n=r.length;let o;if(n<126)o=new Uint8Array(1),new DataView(o.buffer).setUint8(0,n);else if(n<65536){o=new Uint8Array(3);const a=new DataView(o.buffer);a.setUint8(0,126),a.setUint16(1,n)}else{o=new Uint8Array(9);const a=new DataView(o.buffer);a.setUint8(0,127),a.setBigUint64(1,BigInt(n))}e.data&&typeof e.data!="string"&&(o[0]|=128),t.enqueue(o),t.enqueue(r)})}})}let Qp;function ul(e){return e.reduce((t,r)=>t+r.length,0)}function cl(e,t){if(e[0].length===t)return e.shift();const r=new Uint8Array(t);let n=0;for(let o=0;o<t;o++)r[o]=e[0][n++],n===e[0].length&&(e.shift(),n=0);return e.length&&n<e[0].length&&(e[0]=e[0].slice(n)),r}function JM(e,t){Qp||(Qp=new TextDecoder);const r=[];let n=0,o=-1,a=!1;return new TransformStream({transform(u,h){for(r.push(u);;){if(n===0){if(ul(r)<1)break;const f=cl(r,1);a=(f[0]&128)===128,o=f[0]&127,o<126?n=3:o===126?n=1:n=2}else if(n===1){if(ul(r)<2)break;const f=cl(r,2);o=new DataView(f.buffer,f.byteOffset,f.length).getUint16(0),n=3}else if(n===2){if(ul(r)<8)break;const f=cl(r,8),d=new DataView(f.buffer,f.byteOffset,f.length),g=d.getUint32(0);if(g>Math.pow(2,21)-1){h.enqueue(b_);break}o=g*Math.pow(2,32)+d.getUint32(4),n=3}else{if(ul(r)<o)break;const f=cl(r,o);h.enqueue(Yg(a?f:Qp.decode(f),t)),n=0}if(o===0||o>e){h.enqueue(b_);break}}}})}const hx=4;function rt(e){if(e)return QM(e)}function QM(e){for(var t in rt.prototype)e[t]=rt.prototype[t];return e}rt.prototype.on=rt.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};rt.prototype.once=function(e,t){function r(){this.off(e,r),t.apply(this,arguments)}return r.fn=t,this.on(e,r),this};rt.prototype.off=rt.prototype.removeListener=rt.prototype.removeAllListeners=rt.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var r=this._callbacks["$"+e];if(!r)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var n,o=0;o<r.length;o++)if(n=r[o],n===t||n.fn===t){r.splice(o,1);break}return r.length===0&&delete this._callbacks["$"+e],this};rt.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),r=this._callbacks["$"+e],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(r){r=r.slice(0);for(var n=0,o=r.length;n<o;++n)r[n].apply(this,t)}return this};rt.prototype.emitReserved=rt.prototype.emit;rt.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};rt.prototype.hasListeners=function(e){return!!this.listeners(e).length};const ou=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,r)=>r(t,0),dr=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),eA="arraybuffer";function dx(e,...t){return t.reduce((r,n)=>(e.hasOwnProperty(n)&&(r[n]=e[n]),r),{})}const tA=dr.setTimeout,rA=dr.clearTimeout;function au(e,t){t.useNativeTimers?(e.setTimeoutFn=tA.bind(dr),e.clearTimeoutFn=rA.bind(dr)):(e.setTimeoutFn=dr.setTimeout.bind(dr),e.clearTimeoutFn=dr.clearTimeout.bind(dr))}const iA=1.33;function nA(e){return typeof e=="string"?sA(e):Math.ceil((e.byteLength||e.size)*iA)}function sA(e){let t=0,r=0;for(let n=0,o=e.length;n<o;n++)t=e.charCodeAt(n),t<128?r+=1:t<2048?r+=2:t<55296||t>=57344?r+=3:(n++,r+=4);return r}function fx(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function oA(e){let t="";for(let r in e)e.hasOwnProperty(r)&&(t.length&&(t+="&"),t+=encodeURIComponent(r)+"="+encodeURIComponent(e[r]));return t}function aA(e){let t={},r=e.split("&");for(let n=0,o=r.length;n<o;n++){let a=r[n].split("=");t[decodeURIComponent(a[0])]=decodeURIComponent(a[1])}return t}class lA extends Error{constructor(t,r,n){super(t),this.description=r,this.context=n,this.type="TransportError"}}class Xg extends rt{constructor(t){super(),this.writable=!1,au(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,r,n){return super.emitReserved("error",new lA(t,r,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const r=Yg(t,this.socket.binaryType);this.onPacket(r)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,r={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(r)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const r=oA(t);return r.length?"?"+r:""}}class uA extends Xg{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const r=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let n=0;this._polling&&(n++,this.once("pollComplete",function(){--n||r()})),this.writable||(n++,this.once("drain",function(){--n||r()}))}else r()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const r=n=>{if(this.readyState==="opening"&&n.type==="open"&&this.onOpen(),n.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(n)};XM(t,this.socket.binaryType).forEach(r),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,YM(t,r=>{this.doWrite(r,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",r=this.query||{};return this.opts.timestampRequests!==!1&&(r[this.opts.timestampParam]=fx()),!this.supportsBinary&&!r.sid&&(r.b64=1),this.createUri(t,r)}}let px=!1;try{px=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const cA=px;function hA(){}class dA extends uA{constructor(t){if(super(t),typeof location<"u"){const r=location.protocol==="https:";let n=location.port;n||(n=r?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||n!==t.port}}doWrite(t,r){const n=this.request({method:"POST",data:t});n.on("success",r),n.on("error",(o,a)=>{this.onError("xhr post error",o,a)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(r,n)=>{this.onError("xhr poll error",r,n)}),this.pollXhr=t}}class jr extends rt{constructor(t,r,n){super(),this.createRequest=t,au(this,n),this._opts=n,this._method=n.method||"GET",this._uri=r,this._data=n.data!==void 0?n.data:null,this._create()}_create(){var t;const r=dx(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");r.xdomain=!!this._opts.xd;const n=this._xhr=this.createRequest(r);try{n.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let o in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(o)&&n.setRequestHeader(o,this._opts.extraHeaders[o])}}catch{}if(this._method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(n),"withCredentials"in n&&(n.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(n.timeout=this._opts.requestTimeout),n.onreadystatechange=()=>{var o;n.readyState===3&&((o=this._opts.cookieJar)===null||o===void 0||o.parseCookies(n.getResponseHeader("set-cookie"))),n.readyState===4&&(n.status===200||n.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof n.status=="number"?n.status:0)},0))},n.send(this._data)}catch(o){this.setTimeoutFn(()=>{this._onError(o)},0);return}typeof document<"u"&&(this._index=jr.requestsCount++,jr.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=hA,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete jr.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}jr.requestsCount=0;jr.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",KC);else if(typeof addEventListener=="function"){const e="onpagehide"in dr?"pagehide":"unload";addEventListener(e,KC,!1)}}function KC(){for(let e in jr.requests)jr.requests.hasOwnProperty(e)&&jr.requests[e].abort()}const fA=(function(){const e=_x({xdomain:!1});return e&&e.responseType!==null})();class pA extends dA{constructor(t){super(t);const r=t&&t.forceBase64;this.supportsBinary=fA&&!r}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new jr(_x,this.uri(),t)}}function _x(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||cA))return new XMLHttpRequest}catch{}if(!t)try{return new dr[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const gx=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class _A extends Xg{get name(){return"websocket"}doOpen(){const t=this.uri(),r=this.opts.protocols,n=gx?{}:dx(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,r,n)}catch(o){return this.emitReserved("error",o)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let r=0;r<t.length;r++){const n=t[r],o=r===t.length-1;Gg(n,this.supportsBinary,a=>{try{this.doWrite(n,a)}catch{}o&&ou(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",r=this.query||{};return this.opts.timestampRequests&&(r[this.opts.timestampParam]=fx()),this.supportsBinary||(r.b64=1),this.createUri(t,r)}}const e_=dr.WebSocket||dr.MozWebSocket;class gA extends _A{createSocket(t,r,n){return gx?new e_(t,r,n):r?new e_(t,r):new e_(t)}doWrite(t,r){this.ws.send(r)}}class vA extends Xg{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const r=JM(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=t.readable.pipeThrough(r).getReader(),o=ZM();o.readable.pipeTo(t.writable),this._writer=o.writable.getWriter();const a=()=>{n.read().then(({done:h,value:f})=>{h||(this.onPacket(f),a())}).catch(h=>{})};a();const u={type:"open"};this.query.sid&&(u.data=`{"sid":"${this.query.sid}"}`),this._writer.write(u).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let r=0;r<t.length;r++){const n=t[r],o=r===t.length-1;this._writer.write(n).then(()=>{o&&ou(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const mA={websocket:gA,webtransport:vA,polling:pA},yA=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,SA=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function E_(e){if(e.length>8e3)throw"URI too long";const t=e,r=e.indexOf("["),n=e.indexOf("]");r!=-1&&n!=-1&&(e=e.substring(0,r)+e.substring(r,n).replace(/:/g,";")+e.substring(n,e.length));let o=yA.exec(e||""),a={},u=14;for(;u--;)a[SA[u]]=o[u]||"";return r!=-1&&n!=-1&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=wA(a,a.path),a.queryKey=CA(a,a.query),a}function wA(e,t){const r=/\/{2,9}/g,n=t.replace(r,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&n.splice(0,1),t.slice(-1)=="/"&&n.splice(n.length-1,1),n}function CA(e,t){const r={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(n,o,a){o&&(r[o]=a)}),r}const x_=typeof addEventListener=="function"&&typeof removeEventListener=="function",Cl=[];x_&&addEventListener("offline",()=>{Cl.forEach(e=>e())},!1);class Ki extends rt{constructor(t,r){if(super(),this.binaryType=eA,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(r=t,t=null),t){const n=E_(t);r.hostname=n.host,r.secure=n.protocol==="https"||n.protocol==="wss",r.port=n.port,n.query&&(r.query=n.query)}else r.host&&(r.hostname=E_(r.host).host);au(this,r),this.secure=r.secure!=null?r.secure:typeof location<"u"&&location.protocol==="https:",r.hostname&&!r.port&&(r.port=this.secure?"443":"80"),this.hostname=r.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=r.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},r.transports.forEach(n=>{const o=n.prototype.name;this.transports.push(o),this._transportsByName[o]=n}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},r),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=aA(this.opts.query)),x_&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Cl.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const r=Object.assign({},this.opts.query);r.EIO=hx,r.transport=t,this.id&&(r.sid=this.id);const n=Object.assign({},this.opts,{query:r,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](n)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&Ki.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const r=this.createTransport(t);r.open(),this.setTransport(r)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",r=>this._onClose("transport close",r))}onOpen(){this.readyState="open",Ki.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const r=new Error("server error");r.code=t.data,this._onError(r);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let r=1;for(let n=0;n<this.writeBuffer.length;n++){const o=this.writeBuffer[n].data;if(o&&(r+=nA(o)),n>0&&r>this._maxPayload)return this.writeBuffer.slice(0,n);r+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,ou(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,r,n){return this._sendPacket("message",t,r,n),this}send(t,r,n){return this._sendPacket("message",t,r,n),this}_sendPacket(t,r,n,o){if(typeof r=="function"&&(o=r,r=void 0),typeof n=="function"&&(o=n,n=null),this.readyState==="closing"||this.readyState==="closed")return;n=n||{},n.compress=n.compress!==!1;const a={type:t,data:r,options:n};this.emitReserved("packetCreate",a),this.writeBuffer.push(a),o&&this.once("flush",o),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},r=()=>{this.off("upgrade",r),this.off("upgradeError",r),t()},n=()=>{this.once("upgrade",r),this.once("upgradeError",r)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?n():t()}):this.upgrading?n():t()),this}_onError(t){if(Ki.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,r){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),x_&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const n=Cl.indexOf(this._offlineEventListener);n!==-1&&Cl.splice(n,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,r),this.writeBuffer=[],this._prevBufferLen=0}}}Ki.protocol=hx;class bA extends Ki{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let r=this.createTransport(t),n=!1;Ki.priorWebsocketSuccess=!1;const o=()=>{n||(r.send([{type:"ping",data:"probe"}]),r.once("packet",v=>{if(!n)if(v.type==="pong"&&v.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",r),!r)return;Ki.priorWebsocketSuccess=r.name==="websocket",this.transport.pause(()=>{n||this.readyState!=="closed"&&(g(),this.setTransport(r),r.send([{type:"upgrade"}]),this.emitReserved("upgrade",r),r=null,this.upgrading=!1,this.flush())})}else{const y=new Error("probe error");y.transport=r.name,this.emitReserved("upgradeError",y)}}))};function a(){n||(n=!0,g(),r.close(),r=null)}const u=v=>{const y=new Error("probe error: "+v);y.transport=r.name,a(),this.emitReserved("upgradeError",y)};function h(){u("transport closed")}function f(){u("socket closed")}function d(v){r&&v.name!==r.name&&a()}const g=()=>{r.removeListener("open",o),r.removeListener("error",u),r.removeListener("close",h),this.off("close",f),this.off("upgrading",d)};r.once("open",o),r.once("error",u),r.once("close",h),this.once("close",f),this.once("upgrading",d),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{n||r.open()},200):r.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const r=[];for(let n=0;n<t.length;n++)~this.transports.indexOf(t[n])&&r.push(t[n]);return r}}let EA=class extends bA{constructor(t,r={}){const n=typeof t=="object"?t:r;(!n.transports||n.transports&&typeof n.transports[0]=="string")&&(n.transports=(n.transports||["polling","websocket","webtransport"]).map(o=>mA[o]).filter(o=>!!o)),super(t,n)}};function xA(e,t="",r){let n=e;r=r||typeof location<"u"&&location,e==null&&(e=r.protocol+"//"+r.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=r.protocol+e:e=r.host+e),/^(https?|wss?):\/\//.test(e)||(typeof r<"u"?e=r.protocol+"//"+e:e="https://"+e),n=E_(e)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";const a=n.host.indexOf(":")!==-1?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+a+":"+n.port+t,n.href=n.protocol+"://"+a+(r&&r.port===n.port?"":":"+n.port),n}const TA=typeof ArrayBuffer=="function",kA=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,vx=Object.prototype.toString,DA=typeof Blob=="function"||typeof Blob<"u"&&vx.call(Blob)==="[object BlobConstructor]",OA=typeof File=="function"||typeof File<"u"&&vx.call(File)==="[object FileConstructor]";function Zg(e){return TA&&(e instanceof ArrayBuffer||kA(e))||DA&&e instanceof Blob||OA&&e instanceof File}function bl(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let r=0,n=e.length;r<n;r++)if(bl(e[r]))return!0;return!1}if(Zg(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return bl(e.toJSON(),!0);for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&bl(e[r]))return!0;return!1}function RA(e){const t=[],r=e.data,n=e;return n.data=T_(r,t),n.attachments=t.length,{packet:n,buffers:t}}function T_(e,t){if(!e)return e;if(Zg(e)){const r={_placeholder:!0,num:t.length};return t.push(e),r}else if(Array.isArray(e)){const r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=T_(e[n],t);return r}else if(typeof e=="object"&&!(e instanceof Date)){const r={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=T_(e[n],t));return r}return e}function PA(e,t){return e.data=k_(e.data,t),delete e.attachments,e}function k_(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let r=0;r<e.length;r++)e[r]=k_(e[r],t);else if(typeof e=="object")for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(e[r]=k_(e[r],t));return e}const mx=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],MA=5;var be;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(be||(be={}));class AA{constructor(t){this.replacer=t}encode(t){return(t.type===be.EVENT||t.type===be.ACK)&&bl(t)?this.encodeAsBinary({type:t.type===be.EVENT?be.BINARY_EVENT:be.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let r=""+t.type;return(t.type===be.BINARY_EVENT||t.type===be.BINARY_ACK)&&(r+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(r+=t.nsp+","),t.id!=null&&(r+=t.id),t.data!=null&&(r+=JSON.stringify(t.data,this.replacer)),r}encodeAsBinary(t){const r=RA(t),n=this.encodeAsString(r.packet),o=r.buffers;return o.unshift(n),o}}class Jg extends rt{constructor(t){super(),this.reviver=t}add(t){let r;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");r=this.decodeString(t);const n=r.type===be.BINARY_EVENT;n||r.type===be.BINARY_ACK?(r.type=n?be.EVENT:be.ACK,this.reconstructor=new IA(r),r.attachments===0&&super.emitReserved("decoded",r)):super.emitReserved("decoded",r)}else if(Zg(t)||t.base64)if(this.reconstructor)r=this.reconstructor.takeBinaryData(t),r&&(this.reconstructor=null,super.emitReserved("decoded",r));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let r=0;const n={type:Number(t.charAt(0))};if(be[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===be.BINARY_EVENT||n.type===be.BINARY_ACK){const a=r+1;for(;t.charAt(++r)!=="-"&&r!=t.length;);const u=t.substring(a,r);if(u!=Number(u)||t.charAt(r)!=="-")throw new Error("Illegal attachments");n.attachments=Number(u)}if(t.charAt(r+1)==="/"){const a=r+1;for(;++r&&!(t.charAt(r)===","||r===t.length););n.nsp=t.substring(a,r)}else n.nsp="/";const o=t.charAt(r+1);if(o!==""&&Number(o)==o){const a=r+1;for(;++r;){const u=t.charAt(r);if(u==null||Number(u)!=u){--r;break}if(r===t.length)break}n.id=Number(t.substring(a,r+1))}if(t.charAt(++r)){const a=this.tryParse(t.substr(r));if(Jg.isPayloadValid(n.type,a))n.data=a;else throw new Error("invalid payload")}return n}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,r){switch(t){case be.CONNECT:return Ml(r);case be.DISCONNECT:return r===void 0;case be.CONNECT_ERROR:return typeof r=="string"||Ml(r);case be.EVENT:case be.BINARY_EVENT:return Array.isArray(r)&&(typeof r[0]=="number"||typeof r[0]=="string"&&mx.indexOf(r[0])===-1);case be.ACK:case be.BINARY_ACK:return Array.isArray(r)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class IA{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const r=PA(this.reconPack,this.buffers);return this.finishedReconstruction(),r}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function LA(e){return typeof e=="string"}const BA=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};function NA(e){return e===void 0||BA(e)}function Ml(e){return Object.prototype.toString.call(e)==="[object Object]"}function qA(e,t){switch(e){case be.CONNECT:return t===void 0||Ml(t);case be.DISCONNECT:return t===void 0;case be.EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&mx.indexOf(t[0])===-1);case be.ACK:return Array.isArray(t);case be.CONNECT_ERROR:return typeof t=="string"||Ml(t);default:return!1}}function FA(e){return LA(e.nsp)&&NA(e.id)&&qA(e.type,e.data)}const HA=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Jg,Encoder:AA,get PacketType(){return be},isPacketValid:FA,protocol:MA},Symbol.toStringTag,{value:"Module"}));function Pr(e,t,r){return e.on(t,r),function(){e.off(t,r)}}const zA=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class yx extends rt{constructor(t,r,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=r,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Pr(t,"open",this.onopen.bind(this)),Pr(t,"packet",this.onpacket.bind(this)),Pr(t,"error",this.onerror.bind(this)),Pr(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...r){var n,o,a;if(zA.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(r.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(r),this;const u={type:be.EVENT,data:r};if(u.options={},u.options.compress=this.flags.compress!==!1,typeof r[r.length-1]=="function"){const g=this.ids++,v=r.pop();this._registerAckCallback(g,v),u.id=g}const h=(o=(n=this.io.engine)===null||n===void 0?void 0:n.transport)===null||o===void 0?void 0:o.writable,f=this.connected&&!(!((a=this.io.engine)===null||a===void 0)&&a._hasPingExpired());return this.flags.volatile&&!h||(f?(this.notifyOutgoingListeners(u),this.packet(u)):this.sendBuffer.push(u)),this.flags={},this}_registerAckCallback(t,r){var n;const o=(n=this.flags.timeout)!==null&&n!==void 0?n:this._opts.ackTimeout;if(o===void 0){this.acks[t]=r;return}const a=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let h=0;h<this.sendBuffer.length;h++)this.sendBuffer[h].id===t&&this.sendBuffer.splice(h,1);r.call(this,new Error("operation has timed out"))},o),u=(...h)=>{this.io.clearTimeoutFn(a),r.apply(this,h)};u.withError=!0,this.acks[t]=u}emitWithAck(t,...r){return new Promise((n,o)=>{const a=(u,h)=>u?o(u):n(h);a.withError=!0,r.push(a),this.emit(t,...r)})}_addToQueue(t){let r;typeof t[t.length-1]=="function"&&(r=t.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((o,...a)=>(this._queue[0],o!==null?n.tryCount>this._opts.retries&&(this._queue.shift(),r&&r(o)):(this._queue.shift(),r&&r(null,...a)),n.pending=!1,this._drainQueue())),this._queue.push(n),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const r=this._queue[0];r.pending&&!t||(r.pending=!0,r.tryCount++,this.flags=r.flags,this.emit.apply(this,r.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:be.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,r){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,r),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(n=>String(n.id)===t)){const n=this.acks[t];delete this.acks[t],n.withError&&n.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case be.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case be.EVENT:case be.BINARY_EVENT:this.onevent(t);break;case be.ACK:case be.BINARY_ACK:this.onack(t);break;case be.DISCONNECT:this.ondisconnect();break;case be.CONNECT_ERROR:this.destroy();const n=new Error(t.data.message);n.data=t.data.data,this.emitReserved("connect_error",n);break}}onevent(t){const r=t.data||[];t.id!=null&&r.push(this.ack(t.id)),this.connected?this.emitEvent(r):this.receiveBuffer.push(Object.freeze(r))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const r=this._anyListeners.slice();for(const n of r)n.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const r=this;let n=!1;return function(...o){n||(n=!0,r.packet({type:be.ACK,id:t,data:o}))}}onack(t){const r=this.acks[t.id];typeof r=="function"&&(delete this.acks[t.id],r.withError&&t.data.unshift(null),r.apply(this,t.data))}onconnect(t,r){this.id=t,this.recovered=r&&this._pid===r,this._pid=r,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:be.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const r=this._anyListeners;for(let n=0;n<r.length;n++)if(t===r[n])return r.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const r=this._anyOutgoingListeners;for(let n=0;n<r.length;n++)if(t===r[n])return r.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const r=this._anyOutgoingListeners.slice();for(const n of r)n.apply(this,t.data)}}}function as(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}as.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),r=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-r:e+r}return Math.min(e,this.max)|0};as.prototype.reset=function(){this.attempts=0};as.prototype.setMin=function(e){this.ms=e};as.prototype.setMax=function(e){this.max=e};as.prototype.setJitter=function(e){this.jitter=e};class D_ extends rt{constructor(t,r){var n;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(r=t,t=void 0),r=r||{},r.path=r.path||"/socket.io",this.opts=r,au(this,r),this.reconnection(r.reconnection!==!1),this.reconnectionAttempts(r.reconnectionAttempts||1/0),this.reconnectionDelay(r.reconnectionDelay||1e3),this.reconnectionDelayMax(r.reconnectionDelayMax||5e3),this.randomizationFactor((n=r.randomizationFactor)!==null&&n!==void 0?n:.5),this.backoff=new as({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(r.timeout==null?2e4:r.timeout),this._readyState="closed",this.uri=t;const o=r.parser||HA;this.encoder=new o.Encoder,this.decoder=new o.Decoder,this._autoConnect=r.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var r;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(r=this.backoff)===null||r===void 0||r.setMin(t),this)}randomizationFactor(t){var r;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(r=this.backoff)===null||r===void 0||r.setJitter(t),this)}reconnectionDelayMax(t){var r;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(r=this.backoff)===null||r===void 0||r.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new EA(this.uri,this.opts);const r=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const o=Pr(r,"open",function(){n.onopen(),t&&t()}),a=h=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",h),t?t(h):this.maybeReconnectOnOpen()},u=Pr(r,"error",a);if(this._timeout!==!1){const h=this._timeout,f=this.setTimeoutFn(()=>{o(),a(new Error("timeout")),r.close()},h);this.opts.autoUnref&&f.unref(),this.subs.push(()=>{this.clearTimeoutFn(f)})}return this.subs.push(o),this.subs.push(u),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Pr(t,"ping",this.onping.bind(this)),Pr(t,"data",this.ondata.bind(this)),Pr(t,"error",this.onerror.bind(this)),Pr(t,"close",this.onclose.bind(this)),Pr(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(r){this.onclose("parse error",r)}}ondecoded(t){ou(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,r){let n=this.nsps[t];return n?this._autoConnect&&!n.active&&n.connect():(n=new yx(this,t,r),this.nsps[t]=n),n}_destroy(t){const r=Object.keys(this.nsps);for(const n of r)if(this.nsps[n].active)return;this._close()}_packet(t){const r=this.encoder.encode(t);for(let n=0;n<r.length;n++)this.engine.write(r[n],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,r){var n;this.cleanup(),(n=this.engine)===null||n===void 0||n.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,r),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const r=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(o=>{o?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",o)):t.onreconnect()}))},r);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const _o={};function El(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const r=xA(e,t.path||"/socket.io"),n=r.source,o=r.id,a=r.path,u=_o[o]&&a in _o[o].nsps,h=t.forceNew||t["force new connection"]||t.multiplex===!1||u;let f;return h?f=new D_(n,t):(_o[o]||(_o[o]=new D_(n,t)),f=_o[o]),r.query&&!t.query&&(t.query=r.queryKey),f.socket(r.path,t)}Object.assign(El,{Manager:D_,Socket:yx,io:El,connect:El});/**
|
|
65
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
66
|
+
* @license MIT
|
|
67
|
+
*
|
|
68
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
69
|
+
* @license MIT
|
|
70
|
+
*
|
|
71
|
+
* Originally forked from (with the author's permission):
|
|
72
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
73
|
+
* http://bellard.org/jslinux/
|
|
74
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
75
|
+
*/var Sx=Object.defineProperty,WA=Object.getOwnPropertyDescriptor,UA=(e,t)=>{for(var r in t)Sx(e,r,{get:t[r],enumerable:!0})},Ge=(e,t,r,n)=>{for(var o=n>1?void 0:n?WA(t,r):t,a=e.length-1,u;a>=0;a--)(u=e[a])&&(o=(n?u(t,r,o):u(o))||o);return n&&o&&Sx(t,r,o),o},ne=(e,t)=>(r,n)=>t(r,n,e),VC="Terminal input",O_={get:()=>VC,set:e=>VC=e},GC="Too much output to announce, navigate to rows manually to read",R_={get:()=>GC,set:e=>GC=e};function jA(e){return e.replace(/\r?\n/g,"\r")}function $A(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function KA(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function VA(e,t,r,n){if(e.stopPropagation(),e.clipboardData){let o=e.clipboardData.getData("text/plain");wx(o,t,r,n)}}function wx(e,t,r,n){e=jA(e),e=$A(e,r.decPrivateModes.bracketedPasteMode&&n.rawOptions.ignoreBracketedPasteMode!==!0),r.triggerDataEvent(e,!0),t.value=""}function Cx(e,t,r){let n=r.getBoundingClientRect(),o=e.clientX-n.left-10,a=e.clientY-n.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${o}px`,t.style.top=`${a}px`,t.style.zIndex="1000",t.focus()}function YC(e,t,r,n,o){Cx(e,t,r),o&&n.rightClickSelect(e),t.value=n.selectionText,t.select()}function Ui(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function lu(e,t=0,r=e.length){let n="";for(let o=t;o<r;++o){let a=e[o];a>65535?(a-=65536,n+=String.fromCharCode((a>>10)+55296)+String.fromCharCode(a%1024+56320)):n+=String.fromCharCode(a)}return n}var GA=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let r=e.length;if(!r)return 0;let n=0,o=0;if(this._interim){let a=e.charCodeAt(o++);56320<=a&&a<=57343?t[n++]=(this._interim-55296)*1024+a-56320+65536:(t[n++]=this._interim,t[n++]=a),this._interim=0}for(let a=o;a<r;++a){let u=e.charCodeAt(a);if(55296<=u&&u<=56319){if(++a>=r)return this._interim=u,n;let h=e.charCodeAt(a);56320<=h&&h<=57343?t[n++]=(u-55296)*1024+h-56320+65536:(t[n++]=u,t[n++]=h);continue}u!==65279&&(t[n++]=u)}return n}},YA=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let r=e.length;if(!r)return 0;let n=0,o,a,u,h,f=0,d=0;if(this.interim[0]){let y=!1,m=this.interim[0];m&=(m&224)===192?31:(m&240)===224?15:7;let w=0,S;for(;(S=this.interim[++w]&63)&&w<4;)m<<=6,m|=S;let C=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,E=C-w;for(;d<E;){if(d>=r)return 0;if(S=e[d++],(S&192)!==128){d--,y=!0;break}else this.interim[w++]=S,m<<=6,m|=S&63}y||(C===2?m<128?d--:t[n++]=m:C===3?m<2048||m>=55296&&m<=57343||m===65279||(t[n++]=m):m<65536||m>1114111||(t[n++]=m)),this.interim.fill(0)}let g=r-4,v=d;for(;v<r;){for(;v<g&&!((o=e[v])&128)&&!((a=e[v+1])&128)&&!((u=e[v+2])&128)&&!((h=e[v+3])&128);)t[n++]=o,t[n++]=a,t[n++]=u,t[n++]=h,v+=4;if(o=e[v++],o<128)t[n++]=o;else if((o&224)===192){if(v>=r)return this.interim[0]=o,n;if(a=e[v++],(a&192)!==128){v--;continue}if(f=(o&31)<<6|a&63,f<128){v--;continue}t[n++]=f}else if((o&240)===224){if(v>=r)return this.interim[0]=o,n;if(a=e[v++],(a&192)!==128){v--;continue}if(v>=r)return this.interim[0]=o,this.interim[1]=a,n;if(u=e[v++],(u&192)!==128){v--;continue}if(f=(o&15)<<12|(a&63)<<6|u&63,f<2048||f>=55296&&f<=57343||f===65279)continue;t[n++]=f}else if((o&248)===240){if(v>=r)return this.interim[0]=o,n;if(a=e[v++],(a&192)!==128){v--;continue}if(v>=r)return this.interim[0]=o,this.interim[1]=a,n;if(u=e[v++],(u&192)!==128){v--;continue}if(v>=r)return this.interim[0]=o,this.interim[1]=a,this.interim[2]=u,n;if(h=e[v++],(h&192)!==128){v--;continue}if(f=(o&7)<<18|(a&63)<<12|(u&63)<<6|h&63,f<65536||f>1114111)continue;t[n++]=f}}return n}},bx="",ji=" ",$o=class Ex{constructor(){this.fg=0,this.bg=0,this.extended=new Al}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new Ex;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}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}},Al=class xx{constructor(t=0,r=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=r}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new xx(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},fr=class Tx extends $o{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Al,this.combinedData=""}static fromCharData(t){let r=new Tx;return r.setFromCharData(t),r}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?Ui(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let r=!1;if(t[1].length>2)r=!0;else if(t[1].length===2){let n=t[1].charCodeAt(0);if(55296<=n&&n<=56319){let o=t[1].charCodeAt(1);56320<=o&&o<=57343?this.content=(n-55296)*1024+o-56320+65536|t[2]<<22:r=!0}else r=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;r&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},XC="di$target",P_="di$dependencies",t_=new Map;function XA(e){return e[P_]||[]}function vt(e){if(t_.has(e))return t_.get(e);let t=function(r,n,o){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");ZA(t,r,o)};return t._id=e,t_.set(e,t),t}function ZA(e,t,r){t[XC]===t?t[P_].push({id:e,index:r}):(t[P_]=[{id:e,index:r}],t[XC]=t)}var Mt=vt("BufferService"),kx=vt("CoreMouseService"),Dn=vt("CoreService"),JA=vt("CharsetService"),Qg=vt("InstantiationService"),Dx=vt("LogService"),At=vt("OptionsService"),Ox=vt("OscLinkService"),QA=vt("UnicodeService"),Ko=vt("DecorationService"),M_=class{constructor(e,t,r){this._bufferService=e,this._optionsService=t,this._oscLinkService=r}provideLinks(e,t){var g;let r=this._bufferService.buffer.lines.get(e-1);if(!r){t(void 0);return}let n=[],o=this._optionsService.rawOptions.linkHandler,a=new fr,u=r.getTrimmedLength(),h=-1,f=-1,d=!1;for(let v=0;v<u;v++)if(!(f===-1&&!r.hasContent(v))){if(r.loadCell(v,a),a.hasExtendedAttrs()&&a.extended.urlId)if(f===-1){f=v,h=a.extended.urlId;continue}else d=a.extended.urlId!==h;else f!==-1&&(d=!0);if(d||f!==-1&&v===u-1){let y=(g=this._oscLinkService.getLinkData(h))==null?void 0:g.uri;if(y){let m={start:{x:f+1,y:e},end:{x:v+(!d&&v===u-1?1:0),y:e}},w=!1;if(!(o!=null&&o.allowNonHttpProtocols))try{let S=new URL(y);["http:","https:"].includes(S.protocol)||(w=!0)}catch{w=!0}w||n.push({text:y,range:m,activate:(S,C)=>o?o.activate(S,C,m):eI(S,C),hover:(S,C)=>{var E;return(E=o==null?void 0:o.hover)==null?void 0:E.call(o,S,C,m)},leave:(S,C)=>{var E;return(E=o==null?void 0:o.leave)==null?void 0:E.call(o,S,C,m)}})}d=!1,a.hasExtendedAttrs()&&a.extended.urlId?(f=v,h=a.extended.urlId):(f=-1,h=-1)}}t(n)}};M_=Ge([ne(0,Mt),ne(1,At),ne(2,Ox)],M_);function eI(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
76
|
+
|
|
77
|
+
WARNING: This link could potentially be dangerous`)){let r=window.open();if(r){try{r.opener=null}catch{}r.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}var uu=vt("CharSizeService"),gi=vt("CoreBrowserService"),ev=vt("MouseService"),vi=vt("RenderService"),tI=vt("SelectionService"),Rx=vt("CharacterJoinerService"),ls=vt("ThemeService"),Px=vt("LinkProviderService"),rI=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?ZC.isErrorNoTelemetry(e)?new ZC(e.message+`
|
|
78
|
+
|
|
79
|
+
`+e.stack):new Error(e.message+`
|
|
80
|
+
|
|
81
|
+
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(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)}},iI=new rI;function xl(e){nI(e)||iI.onUnexpectedError(e)}var A_="Canceled";function nI(e){return e instanceof sI?!0:e instanceof Error&&e.name===A_&&e.message===A_}var sI=class extends Error{constructor(){super(A_),this.name=this.message}};function oI(e){return new Error(`Illegal argument: ${e}`)}var ZC=class I_ extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof I_)return t;let r=new I_;return r.message=t.message,r.stack=t.stack,r}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},L_=class Mx extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,Mx.prototype)}};function Gt(e,t=0){return e[e.length-(1+t)]}var aI;(e=>{function t(a){return a<0}e.isLessThan=t;function r(a){return a<=0}e.isLessThanOrEqual=r;function n(a){return a>0}e.isGreaterThan=n;function o(a){return a===0}e.isNeitherLessOrGreaterThan=o,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(aI||(aI={}));function lI(e,t){let r=this,n=!1,o;return function(){return n||(n=!0,t||(o=e.apply(r,arguments))),o}}var Ax;(e=>{function t(D){return D&&typeof D=="object"&&typeof D[Symbol.iterator]=="function"}e.is=t;let r=Object.freeze([]);function n(){return r}e.empty=n;function*o(D){yield D}e.single=o;function a(D){return t(D)?D:o(D)}e.wrap=a;function u(D){return D||r}e.from=u;function*h(D){for(let U=D.length-1;U>=0;U--)yield D[U]}e.reverse=h;function f(D){return!D||D[Symbol.iterator]().next().done===!0}e.isEmpty=f;function d(D){return D[Symbol.iterator]().next().value}e.first=d;function g(D,U){let W=0;for(let P of D)if(U(P,W++))return!0;return!1}e.some=g;function v(D,U){for(let W of D)if(U(W))return W}e.find=v;function*y(D,U){for(let W of D)U(W)&&(yield W)}e.filter=y;function*m(D,U){let W=0;for(let P of D)yield U(P,W++)}e.map=m;function*w(D,U){let W=0;for(let P of D)yield*U(P,W++)}e.flatMap=w;function*S(...D){for(let U of D)yield*U}e.concat=S;function C(D,U,W){let P=W;for(let F of D)P=U(P,F);return P}e.reduce=C;function*E(D,U,W=D.length){for(U<0&&(U+=D.length),W<0?W+=D.length:W>D.length&&(W=D.length);U<W;U++)yield D[U]}e.slice=E;function x(D,U=Number.POSITIVE_INFINITY){let W=[];if(U===0)return[W,D];let P=D[Symbol.iterator]();for(let F=0;F<U;F++){let Q=P.next();if(Q.done)return[W,e.empty()];W.push(Q.value)}return[W,{[Symbol.iterator](){return P}}]}e.consume=x;async function k(D){let U=[];for await(let W of D)U.push(W);return Promise.resolve(U)}e.asyncToArray=k})(Ax||(Ax={}));function Cn(e){if(Ax.is(e)){let t=[];for(let r of e)if(r)try{r.dispose()}catch(n){t.push(n)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function uI(...e){return ze(()=>Cn(e))}function ze(e){return{dispose:lI(()=>{e()})}}var Ix=class Lx{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{Cn(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?Lx.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(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),void 0)}};Ix.DISABLE_DISPOSED_WARNING=!1;var Vi=Ix,xe=class{constructor(){this._store=new Vi,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};xe.None=Object.freeze({dispose(){}});var ss=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)==null||t.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)==null||e.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},_i=typeof window=="object"?window:globalThis,B_=class N_{constructor(t){this.element=t,this.next=N_.Undefined,this.prev=N_.Undefined}};B_.Undefined=new B_(void 0);var je=B_,JC=class{constructor(){this._first=je.Undefined,this._last=je.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===je.Undefined}clear(){let e=this._first;for(;e!==je.Undefined;){let t=e.next;e.prev=je.Undefined,e.next=je.Undefined,e=t}this._first=je.Undefined,this._last=je.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new je(e);if(this._first===je.Undefined)this._first=r,this._last=r;else if(t){let o=this._last;this._last=r,r.prev=o,o.next=r}else{let o=this._first;this._first=r,r.next=o,o.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==je.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==je.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==je.Undefined&&e.next!==je.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===je.Undefined&&e.next===je.Undefined?(this._first=je.Undefined,this._last=je.Undefined):e.next===je.Undefined?(this._last=this._last.prev,this._last.next=je.Undefined):e.prev===je.Undefined&&(this._first=this._first.next,this._first.prev=je.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==je.Undefined;)yield e.element,e=e.next}},cI=globalThis.performance&&typeof globalThis.performance.now=="function",hI=class Bx{static create(t){return new Bx(t)}constructor(t){this._now=cI&&t===!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}},bt;(e=>{e.None=()=>xe.None;function t(I,O){return v(I,()=>{},0,void 0,!0,void 0,O)}e.defer=t;function r(I){return(O,H=null,$)=>{let G=!1,ie;return ie=I(B=>{if(!G)return ie?ie.dispose():G=!0,O.call(H,B)},null,$),G&&ie.dispose(),ie}}e.once=r;function n(I,O,H){return d(($,G=null,ie)=>I(B=>$.call(G,O(B)),null,ie),H)}e.map=n;function o(I,O,H){return d(($,G=null,ie)=>I(B=>{O(B),$.call(G,B)},null,ie),H)}e.forEach=o;function a(I,O,H){return d(($,G=null,ie)=>I(B=>O(B)&&$.call(G,B),null,ie),H)}e.filter=a;function u(I){return I}e.signal=u;function h(...I){return(O,H=null,$)=>{let G=uI(...I.map(ie=>ie(B=>O.call(H,B))));return g(G,$)}}e.any=h;function f(I,O,H,$){let G=H;return n(I,ie=>(G=O(G,ie),G),$)}e.reduce=f;function d(I,O){let H,$={onWillAddFirstListener(){H=I(G.fire,G)},onDidRemoveLastListener(){H==null||H.dispose()}},G=new re($);return O==null||O.add(G),G.event}function g(I,O){return O instanceof Array?O.push(I):O&&O.add(I),I}function v(I,O,H=100,$=!1,G=!1,ie,B){let ee,Z,M,j=0,oe,ce={leakWarningThreshold:ie,onWillAddFirstListener(){ee=I(fe=>{j++,Z=O(Z,fe),$&&!M&&(de.fire(Z),Z=void 0),oe=()=>{let we=Z;Z=void 0,M=void 0,(!$||j>1)&&de.fire(we),j=0},typeof H=="number"?(clearTimeout(M),M=setTimeout(oe,H)):M===void 0&&(M=0,queueMicrotask(oe))})},onWillRemoveListener(){G&&j>0&&(oe==null||oe())},onDidRemoveLastListener(){oe=void 0,ee.dispose()}},de=new re(ce);return B==null||B.add(de),de.event}e.debounce=v;function y(I,O=0,H){return e.debounce(I,($,G)=>$?($.push(G),$):[G],O,void 0,!0,void 0,H)}e.accumulate=y;function m(I,O=($,G)=>$===G,H){let $=!0,G;return a(I,ie=>{let B=$||!O(ie,G);return $=!1,G=ie,B},H)}e.latch=m;function w(I,O,H){return[e.filter(I,O,H),e.filter(I,$=>!O($),H)]}e.split=w;function S(I,O=!1,H=[],$){let G=H.slice(),ie=I(Z=>{G?G.push(Z):ee.fire(Z)});$&&$.add(ie);let B=()=>{G==null||G.forEach(Z=>ee.fire(Z)),G=null},ee=new re({onWillAddFirstListener(){ie||(ie=I(Z=>ee.fire(Z)),$&&$.add(ie))},onDidAddFirstListener(){G&&(O?setTimeout(B):B())},onDidRemoveLastListener(){ie&&ie.dispose(),ie=null}});return $&&$.add(ee),ee.event}e.buffer=S;function C(I,O){return(H,$,G)=>{let ie=O(new x);return I(function(B){let ee=ie.evaluate(B);ee!==E&&H.call($,ee)},void 0,G)}}e.chain=C;let E=Symbol("HaltChainable");class x{constructor(){this.steps=[]}map(O){return this.steps.push(O),this}forEach(O){return this.steps.push(H=>(O(H),H)),this}filter(O){return this.steps.push(H=>O(H)?H:E),this}reduce(O,H){let $=H;return this.steps.push(G=>($=O($,G),$)),this}latch(O=(H,$)=>H===$){let H=!0,$;return this.steps.push(G=>{let ie=H||!O(G,$);return H=!1,$=G,ie?G:E}),this}evaluate(O){for(let H of this.steps)if(O=H(O),O===E)break;return O}}function k(I,O,H=$=>$){let $=(...ee)=>B.fire(H(...ee)),G=()=>I.on(O,$),ie=()=>I.removeListener(O,$),B=new re({onWillAddFirstListener:G,onDidRemoveLastListener:ie});return B.event}e.fromNodeEventEmitter=k;function D(I,O,H=$=>$){let $=(...ee)=>B.fire(H(...ee)),G=()=>I.addEventListener(O,$),ie=()=>I.removeEventListener(O,$),B=new re({onWillAddFirstListener:G,onDidRemoveLastListener:ie});return B.event}e.fromDOMEventEmitter=D;function U(I){return new Promise(O=>r(I)(O))}e.toPromise=U;function W(I){let O=new re;return I.then(H=>{O.fire(H)},()=>{O.fire(void 0)}).finally(()=>{O.dispose()}),O.event}e.fromPromise=W;function P(I,O){return I(H=>O.fire(H))}e.forward=P;function F(I,O,H){return O(H),I($=>O($))}e.runAndSubscribe=F;class Q{constructor(O,H){this._observable=O,this._counter=0,this._hasChanged=!1;let $={onWillAddFirstListener:()=>{O.addObserver(this)},onDidRemoveLastListener:()=>{O.removeObserver(this)}};this.emitter=new re($),H&&H.add(this.emitter)}beginUpdate(O){this._counter++}handlePossibleChange(O){}handleChange(O,H){this._hasChanged=!0}endUpdate(O){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function K(I,O){return new Q(I,O).emitter.event}e.fromObservable=K;function q(I){return(O,H,$)=>{let G=0,ie=!1,B={beginUpdate(){G++},endUpdate(){G--,G===0&&(I.reportChanges(),ie&&(ie=!1,O.call(H)))},handlePossibleChange(){},handleChange(){ie=!0}};I.addObserver(B),I.reportChanges();let ee={dispose(){I.removeObserver(B)}};return $ instanceof Vi?$.add(ee):Array.isArray($)&&$.push(ee),ee}}e.fromObservableLight=q})(bt||(bt={}));var q_=class F_{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${F_._idPool++}`,F_.all.add(this)}start(t){this._stopWatch=new hI,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};q_.all=new Set,q_._idPool=0;var dI=q_,fI=-1,Nx=class qx{constructor(t,r,n=(qx._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=r,this.name=n,this._warnCountdown=0}dispose(){var t;(t=this._stacks)==null||t.clear()}check(t,r){let n=this.threshold;if(n<=0||r<n)return;this._stacks||(this._stacks=new Map);let o=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,o+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=n*.5;let[a,u]=this.getMostFrequentStack(),h=`[${this.name}] potential listener LEAK detected, having ${r} listeners already. MOST frequent listener (${u}):`;console.warn(h),console.warn(a);let f=new gI(h,a);this._errorHandler(f)}return()=>{let a=this._stacks.get(t.value)||0;this._stacks.set(t.value,a-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,r=0;for(let[n,o]of this._stacks)(!t||r<o)&&(t=[n,o],r=o);return t}};Nx._idPool=1;var pI=Nx,_I=class Fx{constructor(t){this.value=t}static create(){let t=new Error;return new Fx(t.stack??"")}print(){console.warn(this.value.split(`
|
|
82
|
+
`).slice(2).join(`
|
|
83
|
+
`))}},gI=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},vI=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},mI=0,r_=class{constructor(e){this.value=e,this.id=mI++}},yI=2,SI,re=class{constructor(e){var t,r,n,o;this._size=0,this._options=e,this._leakageMon=(t=this._options)!=null&&t.leakWarningThreshold?new pI((e==null?void 0:e.onListenerError)??xl,((r=this._options)==null?void 0:r.leakWarningThreshold)??fI):void 0,this._perfMon=(n=this._options)!=null&&n._profName?new dI(this._options._profName):void 0,this._deliveryQueue=(o=this._options)==null?void 0:o.deliveryQueue}dispose(){var e,t,r,n;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)==null?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(r=(t=this._options)==null?void 0:t.onDidRemoveLastListener)==null||r.call(t),(n=this._leakageMon)==null||n.dispose())}get event(){return this._event??(this._event=(e,t,r)=>{var u,h,f,d,g;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let v=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(v);let y=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],m=new vI(`${v}. HINT: Stack shows most frequent listener (${y[1]}-times)`,y[0]);return(((u=this._options)==null?void 0:u.onListenerError)||xl)(m),xe.None}if(this._disposed)return xe.None;t&&(e=e.bind(t));let n=new r_(e),o;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(n.stack=_I.create(),o=this._leakageMon.check(n.stack,this._size+1)),this._listeners?this._listeners instanceof r_?(this._deliveryQueue??(this._deliveryQueue=new wI),this._listeners=[this._listeners,n]):this._listeners.push(n):((f=(h=this._options)==null?void 0:h.onWillAddFirstListener)==null||f.call(h,this),this._listeners=n,(g=(d=this._options)==null?void 0:d.onDidAddFirstListener)==null||g.call(d,this)),this._size++;let a=ze(()=>{o==null||o(),this._removeListener(n)});return r instanceof Vi?r.add(a):Array.isArray(r)&&r.push(a),a}),this._event}_removeListener(e){var o,a,u,h;if((a=(o=this._options)==null?void 0:o.onWillRemoveListener)==null||a.call(o,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(h=(u=this._options)==null?void 0:u.onDidRemoveLastListener)==null||h.call(u,this),this._size=0;return}let t=this._listeners,r=t.indexOf(e);if(r===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[r]=void 0;let n=this._deliveryQueue.current===this;if(this._size*yI<=t.length){let f=0;for(let d=0;d<t.length;d++)t[d]?t[f++]=t[d]:n&&(this._deliveryQueue.end--,f<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=f}}_deliver(e,t){var n;if(!e)return;let r=((n=this._options)==null?void 0:n.onListenerError)||xl;if(!r){e.value(t);return}try{e.value(t)}catch(o){r(o)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){var t,r,n,o;if((t=this._deliveryQueue)!=null&&t.current&&(this._deliverQueue(this._deliveryQueue),(r=this._perfMon)==null||r.stop()),(n=this._perfMon)==null||n.start(this._size),this._listeners)if(this._listeners instanceof r_)this._deliver(this._listeners,e);else{let a=this._deliveryQueue;a.enqueue(this,e,this._listeners.length),this._deliverQueue(a)}(o=this._perfMon)==null||o.stop()}hasListeners(){return this._size>0}},wI=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,r){this.i=0,this.end=r,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},H_=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new re,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new re,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,r){if(this.getZoomLevel(r)===t)return;let n=this.getWindowId(r);this.mapWindowIdToZoomLevel.set(n,t),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,r){this.mapWindowIdToZoomFactor.set(this.getWindowId(r),t)}setFullscreen(t,r){if(this.isFullscreen(r)===t)return;let n=this.getWindowId(r);this.mapWindowIdToFullScreen.set(n,t),this._onDidChangeFullscreen.fire(n)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};H_.INSTANCE=new H_;var tv=H_;function CI(e,t,r){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",r)}tv.INSTANCE.onDidChangeZoomLevel;function bI(e){return tv.INSTANCE.getZoomFactor(e)}tv.INSTANCE.onDidChangeFullscreen;var us=typeof navigator=="object"?navigator.userAgent:"",z_=us.indexOf("Firefox")>=0,EI=us.indexOf("AppleWebKit")>=0,rv=us.indexOf("Chrome")>=0,xI=!rv&&us.indexOf("Safari")>=0;us.indexOf("Electron/")>=0;us.indexOf("Android")>=0;var i_=!1;if(typeof _i.matchMedia=="function"){let e=_i.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=_i.matchMedia("(display-mode: fullscreen)");i_=e.matches,CI(_i,e,({matches:r})=>{i_&&t.matches||(i_=r)})}var ns="en",W_=!1,U_=!1,Tl=!1,Hx=!1,hl,kl=ns,QC=ns,TI,Rr,Sn=globalThis,Ct,zb;typeof Sn.vscode<"u"&&typeof Sn.vscode.process<"u"?Ct=Sn.vscode.process:typeof process<"u"&&typeof((zb=process==null?void 0:process.versions)==null?void 0:zb.node)=="string"&&(Ct=process);var Wb,kI=typeof((Wb=Ct==null?void 0:Ct.versions)==null?void 0:Wb.electron)=="string",DI=kI&&(Ct==null?void 0:Ct.type)==="renderer",Ub;if(typeof Ct=="object"){W_=Ct.platform==="win32",U_=Ct.platform==="darwin",Tl=Ct.platform==="linux",Tl&&Ct.env.SNAP&&Ct.env.SNAP_REVISION,Ct.env.CI||Ct.env.BUILD_ARTIFACTSTAGINGDIRECTORY,hl=ns,kl=ns;let e=Ct.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);hl=t.userLocale,QC=t.osLocale,kl=t.resolvedLanguage||ns,TI=(Ub=t.languagePack)==null?void 0:Ub.translationsConfigFile}catch{}Hx=!0}else typeof navigator=="object"&&!DI?(Rr=navigator.userAgent,W_=Rr.indexOf("Windows")>=0,U_=Rr.indexOf("Macintosh")>=0,(Rr.indexOf("Macintosh")>=0||Rr.indexOf("iPad")>=0||Rr.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Tl=Rr.indexOf("Linux")>=0,(Rr==null?void 0:Rr.indexOf("Mobi"))>=0,kl=globalThis._VSCODE_NLS_LANGUAGE||ns,hl=navigator.language.toLowerCase(),QC=hl):console.error("Unable to resolve platform.");var zx=W_,$r=U_,OI=Tl,eb=Hx,Vr=Rr,Fi=kl,RI;(e=>{function t(){return Fi}e.value=t;function r(){return Fi.length===2?Fi==="en":Fi.length>=3?Fi[0]==="e"&&Fi[1]==="n"&&Fi[2]==="-":!1}e.isDefaultVariant=r;function n(){return Fi==="en"}e.isDefault=n})(RI||(RI={}));var PI=typeof Sn.postMessage=="function"&&!Sn.importScripts;(()=>{if(PI){let e=[];Sn.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let n=0,o=e.length;n<o;n++){let a=e[n];if(a.id===r.data.vscodeScheduleAsyncWork){e.splice(n,1),a.callback();return}}});let t=0;return r=>{let n=++t;e.push({id:n,callback:r}),Sn.postMessage({vscodeScheduleAsyncWork:n},"*")}}return e=>setTimeout(e)})();var MI=!!(Vr&&Vr.indexOf("Chrome")>=0);Vr&&Vr.indexOf("Firefox")>=0;!MI&&Vr&&Vr.indexOf("Safari")>=0;Vr&&Vr.indexOf("Edg/")>=0;Vr&&Vr.indexOf("Android")>=0;var rs=typeof navigator=="object"?navigator:{};eb||document.queryCommandSupported&&document.queryCommandSupported("copy")||rs&&rs.clipboard&&rs.clipboard.writeText,eb||rs&&rs.clipboard&&rs.clipboard.readText;var iv=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},n_=new iv,tb=new iv,rb=new iv,AI=new Array(230),Wx;(e=>{function t(h){return n_.keyCodeToStr(h)}e.toString=t;function r(h){return n_.strToKeyCode(h)}e.fromString=r;function n(h){return tb.keyCodeToStr(h)}e.toUserSettingsUS=n;function o(h){return rb.keyCodeToStr(h)}e.toUserSettingsGeneral=o;function a(h){return tb.strToKeyCode(h)||rb.strToKeyCode(h)}e.fromUserSettings=a;function u(h){if(h>=98&&h<=113)return null;switch(h){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return n_.keyCodeToStr(h)}e.toElectronAccelerator=u})(Wx||(Wx={}));var II=class Ux{constructor(t,r,n,o,a){this.ctrlKey=t,this.shiftKey=r,this.altKey=n,this.metaKey=o,this.keyCode=a}equals(t){return t instanceof Ux&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){let t=this.ctrlKey?"1":"0",r=this.shiftKey?"1":"0",n=this.altKey?"1":"0",o=this.metaKey?"1":"0";return`K${t}${r}${n}${o}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new LI([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},LI=class{constructor(e){if(e.length===0)throw oI("chords");this.chords=e}getHashCode(){let e="";for(let t=0,r=this.chords.length;t<r;t++)t!==0&&(e+=";"),e+=this.chords[t].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let t=0;t<this.chords.length;t++)if(!this.chords[t].equals(e.chords[t]))return!1;return!0}};function BI(e){if(e.charCode){let r=String.fromCharCode(e.charCode).toUpperCase();return Wx.fromString(r)}let t=e.keyCode;if(t===3)return 7;if(z_)switch(t){case 59:return 85;case 60:if(OI)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if($r)return 57;break}else if(EI&&($r&&t===93||!$r&&t===92))return 57;return AI[t]||0}var NI=$r?256:2048,qI=512,FI=1024,HI=$r?2048:256,ib=class{constructor(e){var r;this._standardKeyboardEventBrand=!0;let t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=(r=t.getModifierState)==null?void 0:r.call(t,"AltGraph"),this.keyCode=BI(t),this.code=t.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 t=0;return this.ctrlKey&&(t|=NI),this.altKey&&(t|=qI),this.shiftKey&&(t|=FI),this.metaKey&&(t|=HI),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new II(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},nb=new WeakMap;function zI(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,r=e.parent.location;if(t.origin!=="null"&&r.origin!=="null"&&t.origin!==r.origin)return null}catch{return null}return e.parent}var WI=class{static getSameOriginWindowChain(e){let t=nb.get(e);if(!t){t=[],nb.set(e,t);let r=e,n;do n=zI(r),n?t.push({window:new WeakRef(r),iframeElement:r.frameElement||null}):t.push({window:new WeakRef(r),iframeElement:null}),r=n;while(r)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let r=0,n=0,o=this.getSameOriginWindowChain(e);for(let a of o){let u=a.window.deref();if(r+=(u==null?void 0:u.scrollY)??0,n+=(u==null?void 0:u.scrollX)??0,u===t||!a.iframeElement)break;let h=a.iframeElement.getBoundingClientRect();r+=h.top,n+=h.left}return{top:r,left:n}}},dl=class{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=t.button===0,this.middleButton=t.button===1,this.rightButton=t.button===2,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail||1,t.type==="dblclick"&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,typeof t.pageX=="number"?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let r=WI.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=r.left,this.posy-=r.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},sb=class{constructor(e,t=0,r=0){var o;this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=r,this.deltaX=t;let n=!1;if(rv){let a=navigator.userAgent.match(/Chrome\/(\d+)/);n=(a?parseInt(a[1]):123)<=122}if(e){let a=e,u=e,h=((o=e.view)==null?void 0:o.devicePixelRatio)||1;if(typeof a.wheelDeltaY<"u")n?this.deltaY=a.wheelDeltaY/(120*h):this.deltaY=a.wheelDeltaY/120;else if(typeof u.VERTICAL_AXIS<"u"&&u.axis===u.VERTICAL_AXIS)this.deltaY=-u.detail/3;else if(e.type==="wheel"){let f=e;f.deltaMode===f.DOM_DELTA_LINE?z_&&!$r?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof a.wheelDeltaX<"u")xI&&zx?this.deltaX=-(a.wheelDeltaX/120):n?this.deltaX=a.wheelDeltaX/(120*h):this.deltaX=a.wheelDeltaX/120;else if(typeof u.HORIZONTAL_AXIS<"u"&&u.axis===u.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let f=e;f.deltaMode===f.DOM_DELTA_LINE?z_&&!$r?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(n?this.deltaY=e.wheelDelta/(120*h):this.deltaY=e.wheelDelta/120)}}preventDefault(){var e;(e=this.browserEvent)==null||e.preventDefault()}stopPropagation(){var e;(e=this.browserEvent)==null||e.stopPropagation()}},jx=Object.freeze(function(e,t){let r=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(r)}}}),UI;(e=>{function t(r){return r===e.None||r===e.Cancelled||r instanceof jI?!0:!r||typeof r!="object"?!1:typeof r.isCancellationRequested=="boolean"&&typeof r.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:bt.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:jx})})(UI||(UI={}));var jI=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?jx:(this._emitter||(this._emitter=new re),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},nv=class{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new L_("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new L_("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},$I=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){var e;(e=this.disposable)==null||e.dispose(),this.disposable=void 0}cancelAndSet(e,t,r=globalThis){if(this.isDisposed)throw new L_("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let n=r.setInterval(()=>{e()},t);this.disposable=ze(()=>{r.clearInterval(n),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},KI;(e=>{async function t(n){let o,a=await Promise.all(n.map(u=>u.then(h=>h,h=>{o||(o=h)})));if(typeof o<"u")throw o;return a}e.settled=t;function r(n){return new Promise(async(o,a)=>{try{await n(o,a)}catch(u){a(u)}})}e.withAsyncBody=r})(KI||(KI={}));var ob=class ur{static fromArray(t){return new ur(r=>{r.emitMany(t)})}static fromPromise(t){return new ur(async r=>{r.emitMany(await t)})}static fromPromises(t){return new ur(async r=>{await Promise.all(t.map(async n=>r.emitOne(await n)))})}static merge(t){return new ur(async r=>{await Promise.all(t.map(async n=>{for await(let o of n)r.emitOne(o)}))})}constructor(t,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new re,queueMicrotask(async()=>{let n={emitOne:o=>this.emitOne(o),emitMany:o=>this.emitMany(o),reject:o=>this.reject(o)};try{await Promise.resolve(t(n)),this.resolve()}catch(o){this.reject(o)}finally{n.emitOne=void 0,n.emitMany=void 0,n.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t<this._results.length)return{done:!1,value:this._results[t++]};if(this._state===1)return{done:!0,value:void 0};await bt.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>{var r;return(r=this._onReturn)==null||r.call(this),{done:!0,value:void 0}}}}static map(t,r){return new ur(async n=>{for await(let o of t)n.emitOne(r(o))})}map(t){return ur.map(this,t)}static filter(t,r){return new ur(async n=>{for await(let o of t)r(o)&&n.emitOne(o)})}filter(t){return ur.filter(this,t)}static coalesce(t){return ur.filter(t,r=>!!r)}coalesce(){return ur.coalesce(this)}static async toPromise(t){let r=[];for await(let n of t)r.push(n);return r}toPromise(){return ur.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};ob.EMPTY=ob.fromArray([]);var{getWindow:Ur,getWindowId:VI,onDidRegisterWindow:GI}=(function(){let e=new Map,t={window:_i,disposables:new Vi};e.set(_i.vscodeWindowId,t);let r=new re,n=new re,o=new re;function a(u,h){return(typeof u=="number"?e.get(u):void 0)??(h?t:void 0)}return{onDidRegisterWindow:r.event,onWillUnregisterWindow:o.event,onDidUnregisterWindow:n.event,registerWindow(u){if(e.has(u.vscodeWindowId))return xe.None;let h=new Vi,f={window:u,disposables:h.add(new Vi)};return e.set(u.vscodeWindowId,f),h.add(ze(()=>{e.delete(u.vscodeWindowId),n.fire(u)})),h.add(me(u,ft.BEFORE_UNLOAD,()=>{o.fire(u)})),r.fire(f),h},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(u){return u.vscodeWindowId},hasWindow(u){return e.has(u)},getWindowById:a,getWindow(u){var d;let h=u;if((d=h==null?void 0:h.ownerDocument)!=null&&d.defaultView)return h.ownerDocument.defaultView.window;let f=u;return f!=null&&f.view?f.view.window:_i},getDocument(u){return Ur(u).document}}})(),YI=class{constructor(e,t,r,n){this._node=e,this._type=t,this._handler=r,this._options=n||!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 me(e,t,r,n){return new YI(e,t,r,n)}var ab=function(e,t,r,n){return me(e,t,r,n)},sv,XI=class extends $I{constructor(e){super(),this.defaultTarget=e&&Ur(e)}cancelAndSet(e,t,r){return super.cancelAndSet(e,t,r??this.defaultTarget)}},lb=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){xl(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,r=new Map,n=new Map,o=a=>{r.set(a,!1);let u=e.get(a)??[];for(t.set(a,u),e.set(a,[]),n.set(a,!0);u.length>0;)u.sort(lb.sort),u.shift().execute();n.set(a,!1)};sv=(a,u,h=0)=>{let f=VI(a),d=new lb(u,h),g=e.get(f);return g||(g=[],e.set(f,g)),g.push(d),r.get(f)||(r.set(f,!0),a.requestAnimationFrame(()=>o(f))),d}})();function ZI(e){let t=e.getBoundingClientRect(),r=Ur(e);return{left:t.left+r.scrollX,top:t.top+r.scrollY,width:t.width,height:t.height}}var ft={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"},JI=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 t=Ht(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=Ht(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=Ht(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=Ht(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=Ht(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=Ht(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=Ht(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=Ht(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=Ht(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=Ht(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=Ht(e);this._paddingRight!==t&&(this._paddingRight=t,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 t=Ht(e);this._fontSize!==t&&(this._fontSize=t,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 t=Ht(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=Ht(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),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,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function Ht(e){return typeof e=="number"?`${e}px`:e}function Lo(e){return new JI(e)}var $x=class{constructor(){this._hooks=new Vi,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let r=this._onStopCallback;this._onStopCallback=null,e&&r&&r(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,r,n,o){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=n,this._onStopCallback=o;let a=e;try{e.setPointerCapture(t),this._hooks.add(ze(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{a=Ur(e)}this._hooks.add(me(a,ft.POINTER_MOVE,u=>{if(u.buttons!==r){this.stopMonitoring(!0);return}u.preventDefault(),this._pointerMoveCallback(u)})),this._hooks.add(me(a,ft.POINTER_UP,u=>this.stopMonitoring(!0)))}};function QI(e,t,r){let n=null,o=null;if(typeof r.value=="function"?(n="value",o=r.value,o.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof r.get=="function"&&(n="get",o=r.get),!o)throw new Error("not supported");let a=`$memoize$${t}`;r[n]=function(...u){return this.hasOwnProperty(a)||Object.defineProperty(this,a,{configurable:!1,enumerable:!1,writable:!1,value:o.apply(this,u)}),this[a]}}var Wr;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(Wr||(Wr={}));var Do=class Dt extends xe{constructor(){super(),this.dispatched=!1,this.targets=new JC,this.ignoreTargets=new JC,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(bt.runAndSubscribe(GI,({window:t,disposables:r})=>{r.add(me(t.document,"touchstart",n=>this.onTouchStart(n),{passive:!1})),r.add(me(t.document,"touchend",n=>this.onTouchEnd(t,n))),r.add(me(t.document,"touchmove",n=>this.onTouchMove(n),{passive:!1}))},{window:_i,disposables:this._store}))}static addTarget(t){if(!Dt.isTouchDevice())return xe.None;Dt.INSTANCE||(Dt.INSTANCE=new Dt);let r=Dt.INSTANCE.targets.push(t);return ze(r)}static ignoreTarget(t){if(!Dt.isTouchDevice())return xe.None;Dt.INSTANCE||(Dt.INSTANCE=new Dt);let r=Dt.INSTANCE.ignoreTargets.push(t);return ze(r)}static isTouchDevice(){return"ontouchstart"in _i||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(t){let r=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let n=0,o=t.targetTouches.length;n<o;n++){let a=t.targetTouches.item(n);this.activeTouches[a.identifier]={id:a.identifier,initialTarget:a.target,initialTimeStamp:r,initialPageX:a.pageX,initialPageY:a.pageY,rollingTimestamps:[r],rollingPageX:[a.pageX],rollingPageY:[a.pageY]};let u=this.newGestureEvent(Wr.Start,a.target);u.pageX=a.pageX,u.pageY=a.pageY,this.dispatchEvent(u)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}onTouchEnd(t,r){let n=Date.now(),o=Object.keys(this.activeTouches).length;for(let a=0,u=r.changedTouches.length;a<u;a++){let h=r.changedTouches.item(a);if(!this.activeTouches.hasOwnProperty(String(h.identifier))){console.warn("move of an UNKNOWN touch",h);continue}let f=this.activeTouches[h.identifier],d=Date.now()-f.initialTimeStamp;if(d<Dt.HOLD_DELAY&&Math.abs(f.initialPageX-Gt(f.rollingPageX))<30&&Math.abs(f.initialPageY-Gt(f.rollingPageY))<30){let g=this.newGestureEvent(Wr.Tap,f.initialTarget);g.pageX=Gt(f.rollingPageX),g.pageY=Gt(f.rollingPageY),this.dispatchEvent(g)}else if(d>=Dt.HOLD_DELAY&&Math.abs(f.initialPageX-Gt(f.rollingPageX))<30&&Math.abs(f.initialPageY-Gt(f.rollingPageY))<30){let g=this.newGestureEvent(Wr.Contextmenu,f.initialTarget);g.pageX=Gt(f.rollingPageX),g.pageY=Gt(f.rollingPageY),this.dispatchEvent(g)}else if(o===1){let g=Gt(f.rollingPageX),v=Gt(f.rollingPageY),y=Gt(f.rollingTimestamps)-f.rollingTimestamps[0],m=g-f.rollingPageX[0],w=v-f.rollingPageY[0],S=[...this.targets].filter(C=>f.initialTarget instanceof Node&&C.contains(f.initialTarget));this.inertia(t,S,n,Math.abs(m)/y,m>0?1:-1,g,Math.abs(w)/y,w>0?1:-1,v)}this.dispatchEvent(this.newGestureEvent(Wr.End,f.initialTarget)),delete this.activeTouches[h.identifier]}this.dispatched&&(r.preventDefault(),r.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,r){let n=document.createEvent("CustomEvent");return n.initEvent(t,!1,!0),n.initialTarget=r,n.tapCount=0,n}dispatchEvent(t){if(t.type===Wr.Tap){let r=new Date().getTime(),n=0;r-this._lastSetTapCountTime>Dt.CLEAR_TAP_COUNT_TIME?n=1:n=2,this._lastSetTapCountTime=r,t.tapCount=n}else(t.type===Wr.Change||t.type===Wr.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let n of this.ignoreTargets)if(n.contains(t.initialTarget))return;let r=[];for(let n of this.targets)if(n.contains(t.initialTarget)){let o=0,a=t.initialTarget;for(;a&&a!==n;)o++,a=a.parentElement;r.push([o,n])}r.sort((n,o)=>n[0]-o[0]);for(let[n,o]of r)o.dispatchEvent(t),this.dispatched=!0}}inertia(t,r,n,o,a,u,h,f,d){this.handle=sv(t,()=>{let g=Date.now(),v=g-n,y=0,m=0,w=!0;o+=Dt.SCROLL_FRICTION*v,h+=Dt.SCROLL_FRICTION*v,o>0&&(w=!1,y=a*o*v),h>0&&(w=!1,m=f*h*v);let S=this.newGestureEvent(Wr.Change);S.translationX=y,S.translationY=m,r.forEach(C=>C.dispatchEvent(S)),w||this.inertia(t,r,g,o,a,u+y,h,f,d+m)})}onTouchMove(t){let r=Date.now();for(let n=0,o=t.changedTouches.length;n<o;n++){let a=t.changedTouches.item(n);if(!this.activeTouches.hasOwnProperty(String(a.identifier))){console.warn("end of an UNKNOWN touch",a);continue}let u=this.activeTouches[a.identifier],h=this.newGestureEvent(Wr.Change,u.initialTarget);h.translationX=a.pageX-Gt(u.rollingPageX),h.translationY=a.pageY-Gt(u.rollingPageY),h.pageX=a.pageX,h.pageY=a.pageY,this.dispatchEvent(h),u.rollingPageX.length>3&&(u.rollingPageX.shift(),u.rollingPageY.shift(),u.rollingTimestamps.shift()),u.rollingPageX.push(a.pageX),u.rollingPageY.push(a.pageY),u.rollingTimestamps.push(r)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};Do.SCROLL_FRICTION=-.005,Do.HOLD_DELAY=700,Do.CLEAR_TAP_COUNT_TIME=400,Ge([QI],Do,"isTouchDevice",1);var eL=Do,ov=class extends xe{onclick(e,t){this._register(me(e,ft.CLICK,r=>t(new dl(Ur(e),r))))}onmousedown(e,t){this._register(me(e,ft.MOUSE_DOWN,r=>t(new dl(Ur(e),r))))}onmouseover(e,t){this._register(me(e,ft.MOUSE_OVER,r=>t(new dl(Ur(e),r))))}onmouseleave(e,t){this._register(me(e,ft.MOUSE_LEAVE,r=>t(new dl(Ur(e),r))))}onkeydown(e,t){this._register(me(e,ft.KEY_DOWN,r=>t(new ib(r))))}onkeyup(e,t){this._register(me(e,ft.KEY_UP,r=>t(new ib(r))))}oninput(e,t){this._register(me(e,ft.INPUT,t))}onblur(e,t){this._register(me(e,ft.BLUR,t))}onfocus(e,t){this._register(me(e,ft.FOCUS,t))}onchange(e,t){this._register(me(e,ft.CHANGE,t))}ignoreGesture(e){return eL.ignoreTarget(e)}},ub=11,tL=class extends ov{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=ub+"px",this.domNode.style.height=ub+"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 $x),this._register(ab(this.bgDomNode,ft.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(ab(this.domNode,ft.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new XI),this._pointerdownScheduleRepeatTimer=this._register(new nv)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,Ur(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},rL=class j_{constructor(t,r,n,o,a,u,h){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(r=r|0,n=n|0,o=o|0,a=a|0,u=u|0,h=h|0),this.rawScrollLeft=o,this.rawScrollTop=h,r<0&&(r=0),o+r>n&&(o=n-r),o<0&&(o=0),a<0&&(a=0),h+a>u&&(h=u-a),h<0&&(h=0),this.width=r,this.scrollWidth=n,this.scrollLeft=o,this.height=a,this.scrollHeight=u,this.scrollTop=h}equals(t){return this.rawScrollLeft===t.rawScrollLeft&&this.rawScrollTop===t.rawScrollTop&&this.width===t.width&&this.scrollWidth===t.scrollWidth&&this.scrollLeft===t.scrollLeft&&this.height===t.height&&this.scrollHeight===t.scrollHeight&&this.scrollTop===t.scrollTop}withScrollDimensions(t,r){return new j_(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,r?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,r?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new j_(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<"u"?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<"u"?t.scrollTop:this.rawScrollTop)}createScrollEvent(t,r){let n=this.width!==t.width,o=this.scrollWidth!==t.scrollWidth,a=this.scrollLeft!==t.scrollLeft,u=this.height!==t.height,h=this.scrollHeight!==t.scrollHeight,f=this.scrollTop!==t.scrollTop;return{inSmoothScrolling:r,oldWidth:t.width,oldScrollWidth:t.scrollWidth,oldScrollLeft:t.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:t.height,oldScrollHeight:t.scrollHeight,oldScrollTop:t.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:n,scrollWidthChanged:o,scrollLeftChanged:a,heightChanged:u,scrollHeightChanged:h,scrollTopChanged:f}}},iL=class extends xe{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new re),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new rL(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,t){var n;let r=this._state.withScrollDimensions(e,t);this._setState(r,!!this._smoothScrolling),(n=this._smoothScrolling)==null||n.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){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 r=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===r.scrollLeft&&this._smoothScrolling.to.scrollTop===r.scrollTop)return;let n;t?n=new hb(this._smoothScrolling.from,r,this._smoothScrolling.startTime,this._smoothScrolling.duration):n=this._smoothScrolling.combine(this._state,r,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=n}else{let r=this._state.withScrollPosition(e);this._smoothScrolling=hb.start(this._state,r,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(),t=this._state.withScrollPosition(e);if(this._setState(t,!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,t){let r=this._state;r.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(r,t)))}},cb=class{constructor(e,t,r){this.scrollLeft=e,this.scrollTop=t,this.isDone=r}};function s_(e,t){let r=t-e;return function(n){return e+r*oL(n)}}function nL(e,t,r){return function(n){return n<r?e(n/r):t((n-r)/(1-r))}}var hb=class $_{constructor(t,r,n,o){this.from=t,this.to=r,this.duration=o,this.startTime=n,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(t,r,n){if(Math.abs(t-r)>2.5*n){let o,a;return t<r?(o=t+.75*n,a=r-.75*n):(o=t-.75*n,a=r+.75*n),nL(s_(t,o),s_(a,r),.33)}return s_(t,r)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(t){this.to=t.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(t){let r=(t-this.startTime)/this.duration;if(r<1){let n=this.scrollLeft(r),o=this.scrollTop(r);return new cb(n,o,!1)}return new cb(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,r,n){return $_.start(t,r,n)}static start(t,r,n){n=n+10;let o=Date.now()-10;return new $_(t,r,o,n)}};function sL(e){return Math.pow(e,3)}function oL(e){return 1-sL(1-e)}var aL=class extends xe{constructor(e,t,r){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=r,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new nv)}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(()=>{var e;(e=this._domNode)==null||e.setClassName(this._visibleClassName)},0))}_hide(e){var t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(t=this._domNode)==null||t.setClassName(this._invisibleClassName+(e?" fade":"")))}},lL=140,Kx=class extends ov{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 aL(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new $x),this._shouldRender=!0,this.domNode=Lo(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(me(this.domNode.domNode,ft.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new tL(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,r,n){this.slider=Lo(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof r=="number"&&this.slider.setWidth(r),typeof n=="number"&&this.slider.setHeight(n),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(me(this.slider.domNode,ft.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 t=this.domNode.domNode.getClientRects()[0].top,r=t+this._scrollbarState.getSliderPosition(),n=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),o=this._sliderPointerPosition(e);r<=o&&o<=n?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,r;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,r=e.offsetY;else{let o=ZI(this.domNode.domNode);t=e.pageX-o.left,r=e.pageY-o.top}let n=this._pointerDownRelativePosition(t,r);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(n):this._scrollbarState.getDesiredScrollPositionFromOffset(n)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),r=this._sliderOrthogonalPointerPosition(e),n=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,o=>{let a=this._sliderOrthogonalPointerPosition(o),u=Math.abs(a-r);if(zx&&u>lL){this._setDesiredScrollPositionNow(n.getScrollPosition());return}let h=this._sliderPointerPosition(o)-t;this._setDesiredScrollPositionNow(n.getDesiredScrollPositionFromDelta(h))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},Vx=class K_{constructor(t,r,n,o,a,u){this._scrollbarSize=Math.round(r),this._oppositeScrollbarSize=Math.round(n),this._arrowSize=Math.round(t),this._visibleSize=o,this._scrollSize=a,this._scrollPosition=u,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new K_(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let r=Math.round(t);return this._visibleSize!==r?(this._visibleSize=r,this._refreshComputedValues(),!0):!1}setScrollSize(t){let r=Math.round(t);return this._scrollSize!==r?(this._scrollSize=r,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let r=Math.round(t);return this._scrollPosition!==r?(this._scrollPosition=r,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,r,n,o,a){let u=Math.max(0,n-t),h=Math.max(0,u-2*r),f=o>0&&o>n;if(!f)return{computedAvailableSize:Math.round(u),computedIsNeeded:f,computedSliderSize:Math.round(h),computedSliderRatio:0,computedSliderPosition:0};let d=Math.round(Math.max(20,Math.floor(n*h/o))),g=(h-d)/(o-n),v=a*g;return{computedAvailableSize:Math.round(u),computedIsNeeded:f,computedSliderSize:Math.round(d),computedSliderRatio:g,computedSliderPosition:Math.round(v)}}_refreshComputedValues(){let t=K_._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.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(t){if(!this._computedIsNeeded)return 0;let r=t-this._arrowSize-this._computedSliderSize/2;return Math.round(r/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let r=t-this._arrowSize,n=this._scrollPosition;return r<this._computedSliderPosition?n-=this._visibleSize:n+=this._visibleSize,n}getDesiredScrollPositionFromDelta(t){if(!this._computedIsNeeded)return 0;let r=this._computedSliderPosition+t;return Math.round(r/this._computedSliderRatio)}},uL=class extends Kx{constructor(e,t,r){let n=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:r,scrollbarState:new Vx(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,n.width,n.scrollWidth,o.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),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,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}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}},cL=class extends Kx{constructor(e,t,r){let n=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:r,scrollbarState:new Vx(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,n.height,n.scrollHeight,o.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),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,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},hL=500,db=50,dL=class{constructor(e,t,r){this.timestamp=e,this.deltaX=t,this.deltaY=r,this.score=0}},V_=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let t=1,r=0,n=1,o=this._rear;do{let a=o===this._front?t:Math.pow(2,-n);if(t-=a,r+=this._memory[o].score*a,o===this._front)break;o=(this._capacity+o-1)%this._capacity,n++}while(!0);return r<=.5}acceptStandardWheelEvent(t){if(rv){let r=Ur(t.browserEvent),n=bI(r);this.accept(Date.now(),t.deltaX*n,t.deltaY*n)}else this.accept(Date.now(),t.deltaX,t.deltaY)}accept(t,r,n){let o=null,a=new dL(t,r,n);this._front===-1&&this._rear===-1?(this._memory[0]=a,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]=a),a.score=this._computeScore(a,o)}_computeScore(t,r){if(Math.abs(t.deltaX)>0&&Math.abs(t.deltaY)>0)return 1;let n=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(n+=.25),r){let o=Math.abs(t.deltaX),a=Math.abs(t.deltaY),u=Math.abs(r.deltaX),h=Math.abs(r.deltaY),f=Math.max(Math.min(o,u),1),d=Math.max(Math.min(a,h),1),g=Math.max(o,u),v=Math.max(a,h);g%f===0&&v%d===0&&(n-=.5)}return Math.min(Math.max(n,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};V_.INSTANCE=new V_;var fL=V_,pL=class extends ov{constructor(e,t,r){super(),this._onScroll=this._register(new re),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new re),this.onWillScroll=this._onWillScroll.event,this._options=gL(t),this._scrollable=r,this._register(this._scrollable.onScroll(o=>{this._onWillScroll.fire(o),this._onDidScroll(o),this._onScroll.fire(o)}));let n={onMouseWheel:o=>this._onMouseWheel(o),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new cL(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new uL(this._scrollable,this._options,n)),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=Lo(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Lo(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Lo(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 nv),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=Cn(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,$r&&(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 sb(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=Cn(this._mouseWheelToDispose),e)){let t=r=>{this._onMouseWheel(new sb(r))};this._mouseWheelToDispose.push(me(this._listenOnDomNode,ft.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){var o;if((o=e.browserEvent)!=null&&o.defaultPrevented)return;let t=fL.INSTANCE;t.acceptStandardWheelEvent(e);let r=!1;if(e.deltaY||e.deltaX){let a=e.deltaY*this._options.mouseWheelScrollSensitivity,u=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&u+a===0?u=a=0:Math.abs(a)>=Math.abs(u)?u=0:a=0),this._options.flipAxes&&([a,u]=[u,a]);let h=!$r&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||h)&&!u&&(u=a,a=0),e.browserEvent&&e.browserEvent.altKey&&(u=u*this._options.fastScrollSensitivity,a=a*this._options.fastScrollSensitivity);let f=this._scrollable.getFutureScrollPosition(),d={};if(a){let g=db*a,v=f.scrollTop-(g<0?Math.floor(g):Math.ceil(g));this._verticalScrollbar.writeScrollPosition(d,v)}if(u){let g=db*u,v=f.scrollLeft-(g<0?Math.floor(g):Math.ceil(g));this._horizontalScrollbar.writeScrollPosition(d,v)}d=this._scrollable.validateScrollPosition(d),(f.scrollLeft!==d.scrollLeft||f.scrollTop!==d.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(d):this._scrollable.setScrollPositionNow(d),r=!0)}let n=r;!n&&this._options.alwaysConsumeMouseWheel&&(n=!0),!n&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(n=!0),n&&(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(),t=e.scrollTop>0,r=e.scrollLeft>0,n=r?" left":"",o=t?" top":"",a=r||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${n}`),this._topShadowDomNode.setClassName(`shadow${o}`),this._topLeftShadowDomNode.setClassName(`shadow${a}${o}${n}`)}}_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(),hL)}},_L=class extends pL{constructor(e,t,r){super(e,t,r)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function gL(e){let t={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 t.horizontalSliderSize=typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<"u"?e.verticalSliderSize:t.verticalScrollbarSize,$r&&(t.className+=" mac"),t}var G_=class extends xe{constructor(e,t,r,n,o,a,u,h){super(),this._bufferService=r,this._optionsService=u,this._renderService=h,this._onRequestScrollLines=this._register(new re),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let f=this._register(new iL({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:d=>sv(n.window,d)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{f.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new _L(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},f)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(o.onProtocolChange(d=>{this._scrollableElement.updateOptions({handleMouseWheel:!(d&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(bt.runAndSubscribe(a.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=a.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(ze(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=n.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(ze(()=>this._styleElement.remove())),this._register(bt.runAndSubscribe(a.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${a.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${a.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${a.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
|
|
84
|
+
`)})),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(d=>this._handleScroll(d)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){var e;return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:((e=this._optionsService.rawOptions.overviewRuler)==null?void 0:e.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 t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),r=t-this._bufferService.buffer.ydisp;r!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(r)),this._isHandlingScroll=!1}};G_=Ge([ne(2,Mt),ne(3,gi),ne(4,kx),ne(5,ls),ne(6,At),ne(7,vi)],G_);var Y_=class extends xe{constructor(e,t,r,n,o){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=r,this._decorationService=n,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(a=>this._removeDecoration(a))),this._register(ze(()=>{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){var n;let t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",((n=e==null?void 0:e.options)==null?void 0:n.layer)==="top"),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let r=e.options.x??0;return r&&r>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let r=this._decorationElements.get(e);r||(r=this._createElement(e),e.element=r,this._decorationElements.set(e,r),this._container.appendChild(r),e.onDispose(()=>{this._decorationElements.delete(e),r.remove()})),r.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(r.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,r.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,r.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,r.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(r)}}_refreshXPosition(e,t=e.element){if(!t)return;let r=e.options.x??0;(e.options.anchor||"left")==="right"?t.style.right=r?`${r*this._renderService.dimensions.css.cell.width}px`:"":t.style.left=r?`${r*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){var t;(t=this._decorationElements.get(e))==null||t.remove(),this._decorationElements.delete(e),e.dispose()}};Y_=Ge([ne(1,Mt),ne(2,gi),ne(3,Ko),ne(4,vi)],Y_);var vL=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 t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(t,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,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,r){return t>=e.startBufferLine-this._linePadding[r||"full"]&&t<=e.endBufferLine+this._linePadding[r||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},Hr={full:0,left:0,center:0,right:0},Hi={full:0,left:0,center:0,right:0},go={full:0,left:0,center:0,right:0},Il=class extends xe{constructor(e,t,r,n,o,a,u,h){var d;super(),this._viewportElement=e,this._screenElement=t,this._bufferService=r,this._decorationService=n,this._renderService=o,this._optionsService=a,this._themeService=u,this._coreBrowserService=h,this._colorZoneStore=new vL,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(),(d=this._viewportElement.parentElement)==null||d.insertBefore(this._canvas,this._viewportElement),this._register(ze(()=>{var g;return(g=this._canvas)==null?void 0:g.remove()}));let f=this._canvas.getContext("2d");if(f)this._ctx=f;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(){var e;return((e=this._optionsService.options.overviewRuler)==null?void 0:e.width)||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),t=Math.ceil((this._canvas.width-1)/3);Hi.full=this._canvas.width,Hi.left=e,Hi.center=t,Hi.right=e,this._refreshDrawHeightConstants(),go.full=1,go.left=1,go.center=1+Hi.left,go.right=1+Hi.left+Hi.center}_refreshDrawHeightConstants(){Hr.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);Hr.left=t,Hr.center=t,Hr.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Hr.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Hr.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Hr.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Hr.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 t of this._decorationService.decorations)this._colorZoneStore.addDecoration(t);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let t of e)t.position!=="full"&&this._renderColorZone(t);for(let t of e)t.position==="full"&&this._renderColorZone(t);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(go[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-Hr[e.position||"full"]/2),Hi[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+Hr[e.position||"full"]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};Il=Ge([ne(2,Mt),ne(3,Ko),ne(4,vi),ne(5,At),ne(6,ls),ne(7,gi)],Il);var V;(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=`
|
|
85
|
+
`,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=""))(V||(V={}));var Dl;(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=""))(Dl||(Dl={}));var Gx;(e=>e.ST=`${V.ESC}\\`)(Gx||(Gx={}));var X_=class{constructor(e,t,r,n,o,a){this._textarea=e,this._compositionView=t,this._bufferService=r,this._optionsService=n,this._coreService=o,this._renderService=a,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 t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let r;t.start+=this._dataAlreadySent.length,this._isComposing?r=this._textarea.value.substring(t.start,this._compositionPosition.start):r=this._textarea.value.substring(t.start),r.length>0&&this._coreService.triggerDataEvent(r,!0)}},0)}else{this._isSendingComposition=!1;let t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,r=t.replace(e,"");this._dataAlreadySent=r,t.length>e.length?this._coreService.triggerDataEvent(r,!0):t.length<e.length?this._coreService.triggerDataEvent(`${V.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),r=this._renderService.dimensions.css.cell.height,n=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,o=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=o+"px",this._compositionView.style.top=n+"px",this._compositionView.style.height=r+"px",this._compositionView.style.lineHeight=r+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let a=this._compositionView.getBoundingClientRect();this._textarea.style.left=o+"px",this._textarea.style.top=n+"px",this._textarea.style.width=Math.max(a.width,1)+"px",this._textarea.style.height=Math.max(a.height,1)+"px",this._textarea.style.lineHeight=a.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};X_=Ge([ne(2,Mt),ne(3,At),ne(4,Dn),ne(5,vi)],X_);var pt=0,_t=0,gt=0,Ve=0,fb={css:"#00000000",rgba:0},tt;(e=>{function t(o,a,u,h){return h!==void 0?`#${pn(o)}${pn(a)}${pn(u)}${pn(h)}`:`#${pn(o)}${pn(a)}${pn(u)}`}e.toCss=t;function r(o,a,u,h=255){return(o<<24|a<<16|u<<8|h)>>>0}e.toRgba=r;function n(o,a,u,h){return{css:e.toCss(o,a,u,h),rgba:e.toRgba(o,a,u,h)}}e.toColor=n})(tt||(tt={}));var qe;(e=>{function t(f,d){if(Ve=(d.rgba&255)/255,Ve===1)return{css:d.css,rgba:d.rgba};let g=d.rgba>>24&255,v=d.rgba>>16&255,y=d.rgba>>8&255,m=f.rgba>>24&255,w=f.rgba>>16&255,S=f.rgba>>8&255;pt=m+Math.round((g-m)*Ve),_t=w+Math.round((v-w)*Ve),gt=S+Math.round((y-S)*Ve);let C=tt.toCss(pt,_t,gt),E=tt.toRgba(pt,_t,gt);return{css:C,rgba:E}}e.blend=t;function r(f){return(f.rgba&255)===255}e.isOpaque=r;function n(f,d,g){let v=Ol.ensureContrastRatio(f.rgba,d.rgba,g);if(v)return tt.toColor(v>>24&255,v>>16&255,v>>8&255)}e.ensureContrastRatio=n;function o(f){let d=(f.rgba|255)>>>0;return[pt,_t,gt]=Ol.toChannels(d),{css:tt.toCss(pt,_t,gt),rgba:d}}e.opaque=o;function a(f,d){return Ve=Math.round(d*255),[pt,_t,gt]=Ol.toChannels(f.rgba),{css:tt.toCss(pt,_t,gt,Ve),rgba:tt.toRgba(pt,_t,gt,Ve)}}e.opacity=a;function u(f,d){return Ve=f.rgba&255,a(f,Ve*d/255)}e.multiplyOpacity=u;function h(f){return[f.rgba>>24&255,f.rgba>>16&255,f.rgba>>8&255]}e.toColorRGB=h})(qe||(qe={}));var $e;(e=>{let t,r;try{let o=document.createElement("canvas");o.width=1,o.height=1;let a=o.getContext("2d",{willReadFrequently:!0});a&&(t=a,t.globalCompositeOperation="copy",r=t.createLinearGradient(0,0,1,1))}catch{}function n(o){if(o.match(/#[\da-f]{3,8}/i))switch(o.length){case 4:return pt=parseInt(o.slice(1,2).repeat(2),16),_t=parseInt(o.slice(2,3).repeat(2),16),gt=parseInt(o.slice(3,4).repeat(2),16),tt.toColor(pt,_t,gt);case 5:return pt=parseInt(o.slice(1,2).repeat(2),16),_t=parseInt(o.slice(2,3).repeat(2),16),gt=parseInt(o.slice(3,4).repeat(2),16),Ve=parseInt(o.slice(4,5).repeat(2),16),tt.toColor(pt,_t,gt,Ve);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 a=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(a)return pt=parseInt(a[1]),_t=parseInt(a[2]),gt=parseInt(a[3]),Ve=Math.round((a[5]===void 0?1:parseFloat(a[5]))*255),tt.toColor(pt,_t,gt,Ve);if(!t||!r)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=r,t.fillStyle=o,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[pt,_t,gt,Ve]=t.getImageData(0,0,1,1).data,Ve!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:tt.toRgba(pt,_t,gt,Ve),css:o}}e.toColor=n})($e||($e={}));var Pt;(e=>{function t(n){return r(n>>16&255,n>>8&255,n&255)}e.relativeLuminance=t;function r(n,o,a){let u=n/255,h=o/255,f=a/255,d=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4),g=h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4),v=f<=.03928?f/12.92:Math.pow((f+.055)/1.055,2.4);return d*.2126+g*.7152+v*.0722}e.relativeLuminance2=r})(Pt||(Pt={}));var Ol;(e=>{function t(u,h){if(Ve=(h&255)/255,Ve===1)return h;let f=h>>24&255,d=h>>16&255,g=h>>8&255,v=u>>24&255,y=u>>16&255,m=u>>8&255;return pt=v+Math.round((f-v)*Ve),_t=y+Math.round((d-y)*Ve),gt=m+Math.round((g-m)*Ve),tt.toRgba(pt,_t,gt)}e.blend=t;function r(u,h,f){let d=Pt.relativeLuminance(u>>8),g=Pt.relativeLuminance(h>>8);if(fi(d,g)<f){if(g<d){let m=n(u,h,f),w=fi(d,Pt.relativeLuminance(m>>8));if(w<f){let S=o(u,h,f),C=fi(d,Pt.relativeLuminance(S>>8));return w>C?m:S}return m}let v=o(u,h,f),y=fi(d,Pt.relativeLuminance(v>>8));if(y<f){let m=n(u,h,f),w=fi(d,Pt.relativeLuminance(m>>8));return y>w?v:m}return v}}e.ensureContrastRatio=r;function n(u,h,f){let d=u>>24&255,g=u>>16&255,v=u>>8&255,y=h>>24&255,m=h>>16&255,w=h>>8&255,S=fi(Pt.relativeLuminance2(y,m,w),Pt.relativeLuminance2(d,g,v));for(;S<f&&(y>0||m>0||w>0);)y-=Math.max(0,Math.ceil(y*.1)),m-=Math.max(0,Math.ceil(m*.1)),w-=Math.max(0,Math.ceil(w*.1)),S=fi(Pt.relativeLuminance2(y,m,w),Pt.relativeLuminance2(d,g,v));return(y<<24|m<<16|w<<8|255)>>>0}e.reduceLuminance=n;function o(u,h,f){let d=u>>24&255,g=u>>16&255,v=u>>8&255,y=h>>24&255,m=h>>16&255,w=h>>8&255,S=fi(Pt.relativeLuminance2(y,m,w),Pt.relativeLuminance2(d,g,v));for(;S<f&&(y<255||m<255||w<255);)y=Math.min(255,y+Math.ceil((255-y)*.1)),m=Math.min(255,m+Math.ceil((255-m)*.1)),w=Math.min(255,w+Math.ceil((255-w)*.1)),S=fi(Pt.relativeLuminance2(y,m,w),Pt.relativeLuminance2(d,g,v));return(y<<24|m<<16|w<<8|255)>>>0}e.increaseLuminance=o;function a(u){return[u>>24&255,u>>16&255,u>>8&255,u&255]}e.toChannels=a})(Ol||(Ol={}));function pn(e){let t=e.toString(16);return t.length<2?"0"+t:t}function fi(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var mL=class extends $o{constructor(e,t,r){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=r}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Ll=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new fr}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let r=[],n=t.translateToString(!0),o=0,a=0,u=0,h=t.getFg(0),f=t.getBg(0);for(let d=0;d<t.getTrimmedLength();d++)if(t.loadCell(d,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==h||this._workCell.bg!==f){if(d-o>1){let g=this._getJoinedRanges(n,u,a,t,o);for(let v=0;v<g.length;v++)r.push(g[v])}o=d,u=a,h=this._workCell.fg,f=this._workCell.bg}a+=this._workCell.getChars().length||ji.length}if(this._bufferService.cols-o>1){let d=this._getJoinedRanges(n,u,a,t,o);for(let g=0;g<d.length;g++)r.push(d[g])}return r}_getJoinedRanges(e,t,r,n,o){let a=e.substring(t,r),u=[];try{u=this._characterJoiners[0].handler(a)}catch(h){console.error(h)}for(let h=1;h<this._characterJoiners.length;h++)try{let f=this._characterJoiners[h].handler(a);for(let d=0;d<f.length;d++)Ll._mergeRanges(u,f[d])}catch(f){console.error(f)}return this._stringRangesToCellRanges(u,n,o),u}_stringRangesToCellRanges(e,t,r){let n=0,o=!1,a=0,u=e[n];if(u){for(let h=r;h<this._bufferService.cols;h++){let f=t.getWidth(h),d=t.getString(h).length||ji.length;if(f!==0){if(!o&&u[0]<=a&&(u[0]=h,o=!0),u[1]<=a){if(u[1]=h,u=e[++n],!u)break;u[0]<=a?(u[0]=h,o=!0):o=!1}a+=d}}u&&(u[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let r=!1;for(let n=0;n<e.length;n++){let o=e[n];if(r){if(t[1]<=o[0])return e[n-1][1]=t[1],e;if(t[1]<=o[1])return e[n-1][1]=Math.max(t[1],o[1]),e.splice(n,1),e;e.splice(n,1),n--}else{if(t[1]<=o[0])return e.splice(n,0,t),e;if(t[1]<=o[1])return o[0]=Math.min(t[0],o[0]),e;t[0]<o[1]&&(o[0]=Math.min(t[0],o[0]),r=!0);continue}}return r?e[e.length-1][1]=t[1]:e.push(t),e}};Ll=Ge([ne(0,Mt)],Ll);function yL(e){return 57508<=e&&e<=57558}function SL(e){return 9472<=e&&e<=9631}function wL(e){return yL(e)||SL(e)}function CL(){return{css:{canvas:fl(),cell:fl()},device:{canvas:fl(),cell:fl(),char:{width:0,height:0,left:0,top:0}}}}function fl(){return{width:0,height:0}}var Z_=class{constructor(e,t,r,n,o,a,u){this._document=e,this._characterJoinerService=t,this._optionsService=r,this._coreBrowserService=n,this._coreService=o,this._decorationService=a,this._themeService=u,this._workCell=new fr,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,r){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=r}createRow(e,t,r,n,o,a,u,h,f,d,g){let v=[],y=this._characterJoinerService.getJoinedCharacters(t),m=this._themeService.colors,w=e.getNoBgTrimmedLength();r&&w<a+1&&(w=a+1);let S,C=0,E="",x=0,k=0,D=0,U=0,W=!1,P=0,F=!1,Q=0,K=0,q=[],I=d!==-1&&g!==-1;for(let O=0;O<w;O++){e.loadCell(O,this._workCell);let H=this._workCell.getWidth();if(H===0)continue;let $=!1,G=O>=K,ie=O,B=this._workCell;if(y.length>0&&O===y[0][0]&&G){let ke=y.shift(),Yr=this._isCellInSelection(ke[0],t);for(x=ke[0]+1;x<ke[1];x++)G&&(G=Yr===this._isCellInSelection(x,t));G&&(G=!r||a<ke[0]||a>=ke[1]),G?($=!0,B=new mL(this._workCell,e.translateToString(!0,ke[0],ke[1]),ke[1]-ke[0]),ie=ke[1]-1,H=B.getWidth()):K=ke[1]}let ee=this._isCellInSelection(O,t),Z=r&&O===a,M=I&&O>=d&&O<=g,j=!1;this._decorationService.forEachDecorationAtCell(O,t,void 0,ke=>{j=!0});let oe=B.getChars()||ji;if(oe===" "&&(B.isUnderline()||B.isOverline())&&(oe=" "),Q=H*h-f.get(oe,B.isBold(),B.isItalic()),!S)S=this._document.createElement("span");else if(C&&(ee&&F||!ee&&!F&&B.bg===k)&&(ee&&F&&m.selectionForeground||B.fg===D)&&B.extended.ext===U&&M===W&&Q===P&&!Z&&!$&&!j&&G){B.isInvisible()?E+=ji:E+=oe,C++;continue}else C&&(S.textContent=E),S=this._document.createElement("span"),C=0,E="";if(k=B.bg,D=B.fg,U=B.extended.ext,W=M,P=Q,F=ee,$&&a>=O&&a<=ie&&(a=O),!this._coreService.isCursorHidden&&Z&&this._coreService.isCursorInitialized){if(q.push("xterm-cursor"),this._coreBrowserService.isFocused)u&&q.push("xterm-cursor-blink"),q.push(n==="bar"?"xterm-cursor-bar":n==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(o)switch(o){case"outline":q.push("xterm-cursor-outline");break;case"block":q.push("xterm-cursor-block");break;case"bar":q.push("xterm-cursor-bar");break;case"underline":q.push("xterm-cursor-underline");break}}if(B.isBold()&&q.push("xterm-bold"),B.isItalic()&&q.push("xterm-italic"),B.isDim()&&q.push("xterm-dim"),B.isInvisible()?E=ji:E=B.getChars()||ji,B.isUnderline()&&(q.push(`xterm-underline-${B.extended.underlineStyle}`),E===" "&&(E=" "),!B.isUnderlineColorDefault()))if(B.isUnderlineColorRGB())S.style.textDecorationColor=`rgb(${$o.toColorRGB(B.getUnderlineColor()).join(",")})`;else{let ke=B.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&B.isBold()&&ke<8&&(ke+=8),S.style.textDecorationColor=m.ansi[ke].css}B.isOverline()&&(q.push("xterm-overline"),E===" "&&(E=" ")),B.isStrikethrough()&&q.push("xterm-strikethrough"),M&&(S.style.textDecoration="underline");let ce=B.getFgColor(),de=B.getFgColorMode(),fe=B.getBgColor(),we=B.getBgColorMode(),Ce=!!B.isInverse();if(Ce){let ke=ce;ce=fe,fe=ke;let Yr=de;de=we,we=Yr}let De,Je,Jt=!1;this._decorationService.forEachDecorationAtCell(O,t,void 0,ke=>{ke.options.layer!=="top"&&Jt||(ke.backgroundColorRGB&&(we=50331648,fe=ke.backgroundColorRGB.rgba>>8&16777215,De=ke.backgroundColorRGB),ke.foregroundColorRGB&&(de=50331648,ce=ke.foregroundColorRGB.rgba>>8&16777215,Je=ke.foregroundColorRGB),Jt=ke.options.layer==="top")}),!Jt&&ee&&(De=this._coreBrowserService.isFocused?m.selectionBackgroundOpaque:m.selectionInactiveBackgroundOpaque,fe=De.rgba>>8&16777215,we=50331648,Jt=!0,m.selectionForeground&&(de=50331648,ce=m.selectionForeground.rgba>>8&16777215,Je=m.selectionForeground)),Jt&&q.push("xterm-decoration-top");let zt;switch(we){case 16777216:case 33554432:zt=m.ansi[fe],q.push(`xterm-bg-${fe}`);break;case 50331648:zt=tt.toColor(fe>>16,fe>>8&255,fe&255),this._addStyle(S,`background-color:#${pb((fe>>>0).toString(16),"0",6)}`);break;case 0:default:Ce?(zt=m.foreground,q.push("xterm-bg-257")):zt=m.background}switch(De||B.isDim()&&(De=qe.multiplyOpacity(zt,.5)),de){case 16777216:case 33554432:B.isBold()&&ce<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ce+=8),this._applyMinimumContrast(S,zt,m.ansi[ce],B,De,void 0)||q.push(`xterm-fg-${ce}`);break;case 50331648:let ke=tt.toColor(ce>>16&255,ce>>8&255,ce&255);this._applyMinimumContrast(S,zt,ke,B,De,Je)||this._addStyle(S,`color:#${pb(ce.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(S,zt,m.foreground,B,De,Je)||Ce&&q.push("xterm-fg-257")}q.length&&(S.className=q.join(" "),q.length=0),!Z&&!$&&!j&&G?C++:S.textContent=E,Q!==this.defaultSpacing&&(S.style.letterSpacing=`${Q}px`),v.push(S),O=ie}return S&&C&&(S.textContent=E),v}_applyMinimumContrast(e,t,r,n,o,a){if(this._optionsService.rawOptions.minimumContrastRatio===1||wL(n.getCode()))return!1;let u=this._getContrastCache(n),h;if(!o&&!a&&(h=u.getColor(t.rgba,r.rgba)),h===void 0){let f=this._optionsService.rawOptions.minimumContrastRatio/(n.isDim()?2:1);h=qe.ensureContrastRatio(o||t,a||r,f),u.setColor((o||t).rgba,(a||r).rgba,h??null)}return h?(this._addStyle(e,`color:${h.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute("style",`${e.getAttribute("style")||""}${t};`)}_isCellInSelection(e,t){let r=this._selectionStart,n=this._selectionEnd;return!r||!n?!1:this._columnSelectMode?r[0]<=n[0]?e>=r[0]&&t>=r[1]&&e<n[0]&&t<=n[1]:e<r[0]&&t>=r[1]&&e>=n[0]&&t<=n[1]:t>r[1]&&t<n[1]||r[1]===n[1]&&t===r[1]&&e>=r[0]&&e<n[0]||r[1]<n[1]&&t===n[1]&&e<n[0]||r[1]<n[1]&&t===r[1]&&e>=r[0]}};Z_=Ge([ne(1,Rx),ne(2,At),ne(3,gi),ne(4,Dn),ne(5,Ko),ne(6,ls)],Z_);function pb(e,t,r){for(;e.length<r;)e=t+e;return e}var bL=class{constructor(e,t){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 r=e.createElement("span");r.classList.add("xterm-char-measure-element");let n=e.createElement("span");n.classList.add("xterm-char-measure-element"),n.style.fontWeight="bold";let o=e.createElement("span");o.classList.add("xterm-char-measure-element"),o.style.fontStyle="italic";let a=e.createElement("span");a.classList.add("xterm-char-measure-element"),a.style.fontWeight="bold",a.style.fontStyle="italic",this._measureElements=[r,n,o,a],this._container.appendChild(r),this._container.appendChild(n),this._container.appendChild(o),this._container.appendChild(a),t.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,t,r,n){e===this._font&&t===this._fontSize&&r===this._weight&&n===this._weightBold||(this._font=e,this._fontSize=t,this._weight=r,this._weightBold=n,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${r}`,this._measureElements[1].style.fontWeight=`${n}`,this._measureElements[2].style.fontWeight=`${r}`,this._measureElements[3].style.fontWeight=`${n}`,this.clear())}get(e,t,r){let n=0;if(!t&&!r&&e.length===1&&(n=e.charCodeAt(0))<256){if(this._flat[n]!==-9999)return this._flat[n];let u=this._measure(e,0);return u>0&&(this._flat[n]=u),u}let o=e;t&&(o+="B"),r&&(o+="I");let a=this._holey.get(o);if(a===void 0){let u=0;t&&(u|=1),r&&(u|=2),a=this._measure(e,u),a>0&&this._holey.set(o,a)}return a}_measure(e,t){let r=this._measureElements[t];return r.textContent=e.repeat(32),r.offsetWidth/32}},EL=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,t,r,n=!1){if(this.selectionStart=t,this.selectionEnd=r,!t||!r||t[0]===r[0]&&t[1]===r[1]){this.clear();return}let o=e.buffers.active.ydisp,a=t[1]-o,u=r[1]-o,h=Math.max(a,0),f=Math.min(u,e.rows-1);if(h>=e.rows||f<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=n,this.viewportStartRow=a,this.viewportEndRow=u,this.viewportCappedStartRow=h,this.viewportCappedEndRow=f,this.startCol=t[0],this.endCol=r[0]}isCellSelected(e,t,r){return this.hasSelection?(r-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&r>=this.viewportCappedStartRow&&t<this.endCol&&r<=this.viewportCappedEndRow:t<this.startCol&&r>=this.viewportCappedStartRow&&t>=this.endCol&&r<=this.viewportCappedEndRow:r>this.viewportStartRow&&r<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&r===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&r===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&r===this.viewportStartRow&&t>=this.startCol):!1}};function xL(){return new EL}var o_="xterm-dom-renderer-owner-",ar="xterm-rows",pl="xterm-fg-",_b="xterm-bg-",vo="xterm-focus",_l="xterm-selection",TL=1,J_=class extends xe{constructor(e,t,r,n,o,a,u,h,f,d,g,v,y,m){super(),this._terminal=e,this._document=t,this._element=r,this._screenElement=n,this._viewportElement=o,this._helperContainer=a,this._linkifier2=u,this._charSizeService=f,this._optionsService=d,this._bufferService=g,this._coreService=v,this._coreBrowserService=y,this._themeService=m,this._terminalClass=TL++,this._rowElements=[],this._selectionRenderModel=xL(),this.onRequestRedraw=this._register(new re).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(ar),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(_l),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=CL(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(w=>this._injectCss(w))),this._injectCss(this._themeService.colors),this._rowFactory=h.createInstance(Z_,document),this._element.classList.add(o_+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(w=>this._handleLinkHover(w))),this._register(this._linkifier2.onHideLinkUnderline(w=>this._handleLinkLeave(w))),this._register(ze(()=>{this._element.classList.remove(o_+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new bL(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 r of this._rowElements)r.style.width=`${this.dimensions.css.canvas.width}px`,r.style.height=`${this.dimensions.css.cell.height}px`,r.style.lineHeight=`${this.dimensions.css.cell.height}px`,r.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${ar} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,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 t=`${this._terminalSelector} .${ar} { 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}`;t+=`${this._terminalSelector} .${ar} .xterm-dim { color: ${qe.multiplyOpacity(e.foreground,.5).css};}`,t+=`${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 r=`blink_underline_${this._terminalClass}`,n=`blink_bar_${this._terminalClass}`,o=`blink_block_${this._terminalClass}`;t+=`@keyframes ${r} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${n} { 50% { box-shadow: none; }}`,t+=`@keyframes ${o} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${ar}.${vo} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${ar}.${vo} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${ar}.${vo} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${o} 1s step-end infinite;}${this._terminalSelector} .${ar} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${ar} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${ar} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${ar} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${ar} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${_l} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${_l} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${_l} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[a,u]of e.ansi.entries())t+=`${this._terminalSelector} .${pl}${a} { color: ${u.css}; }${this._terminalSelector} .${pl}${a}.xterm-dim { color: ${qe.multiplyOpacity(u,.5).css}; }${this._terminalSelector} .${_b}${a} { background-color: ${u.css}; }`;t+=`${this._terminalSelector} .${pl}257 { color: ${qe.opaque(e.background).css}; }${this._terminalSelector} .${pl}257.xterm-dim { color: ${qe.multiplyOpacity(qe.opaque(e.background),.5).css}; }${this._terminalSelector} .${_b}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_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,t){for(let r=this._rowElements.length;r<=t;r++){let n=this._document.createElement("div");this._rowContainer.appendChild(n),this._rowElements.push(n)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),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(vo),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(vo),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,r){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,r),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,r),!this._selectionRenderModel.hasSelection))return;let n=this._selectionRenderModel.viewportStartRow,o=this._selectionRenderModel.viewportEndRow,a=this._selectionRenderModel.viewportCappedStartRow,u=this._selectionRenderModel.viewportCappedEndRow,h=this._document.createDocumentFragment();if(r){let f=e[0]>t[0];h.appendChild(this._createSelectionElement(a,f?t[0]:e[0],f?e[0]:t[0],u-a+1))}else{let f=n===a?e[0]:0,d=a===o?t[0]:this._bufferService.cols;h.appendChild(this._createSelectionElement(a,f,d));let g=u-a-1;if(h.appendChild(this._createSelectionElement(a+1,0,this._bufferService.cols,g)),a!==u){let v=o===u?t[0]:this._bufferService.cols;h.appendChild(this._createSelectionElement(u,0,v))}}this._selectionContainer.appendChild(h)}_createSelectionElement(e,t,r,n=1){let o=this._document.createElement("div"),a=t*this.dimensions.css.cell.width,u=this.dimensions.css.cell.width*(r-t);return a+u>this.dimensions.css.canvas.width&&(u=this.dimensions.css.canvas.width-a),o.style.height=`${n*this.dimensions.css.cell.height}px`,o.style.top=`${e*this.dimensions.css.cell.height}px`,o.style.left=`${a}px`,o.style.width=`${u}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,t){let r=this._bufferService.buffer,n=r.ybase+r.y,o=Math.min(r.x,this._bufferService.cols-1),a=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,u=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,h=this._optionsService.rawOptions.cursorInactiveStyle;for(let f=e;f<=t;f++){let d=f+r.ydisp,g=this._rowElements[f],v=r.lines.get(d);if(!g||!v)break;g.replaceChildren(...this._rowFactory.createRow(v,d,d===n,u,h,o,a,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${o_}${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,t,r,n,o,a){r<0&&(e=0),n<0&&(t=0);let u=this._bufferService.rows-1;r=Math.max(Math.min(r,u),0),n=Math.max(Math.min(n,u),0),o=Math.min(o,this._bufferService.cols);let h=this._bufferService.buffer,f=h.ybase+h.y,d=Math.min(h.x,o-1),g=this._optionsService.rawOptions.cursorBlink,v=this._optionsService.rawOptions.cursorStyle,y=this._optionsService.rawOptions.cursorInactiveStyle;for(let m=r;m<=n;++m){let w=m+h.ydisp,S=this._rowElements[m],C=h.lines.get(w);if(!S||!C)break;S.replaceChildren(...this._rowFactory.createRow(C,w,w===f,v,y,d,g,this.dimensions.css.cell.width,this._widthCache,a?m===r?e:0:-1,a?(m===n?t:o)-1:-1))}}};J_=Ge([ne(7,Qg),ne(8,uu),ne(9,At),ne(10,Mt),ne(11,Dn),ne(12,gi),ne(13,ls)],J_);var Q_=class extends xe{constructor(e,t,r){super(),this._optionsService=r,this.width=0,this.height=0,this._onCharSizeChange=this._register(new re),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new DL(this._optionsService))}catch{this._measureStrategy=this._register(new kL(e,t,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())}};Q_=Ge([ne(2,At)],Q_);var Yx=class extends xe{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},kL=class extends Yx{constructor(e,t,r){super(),this._document=e,this._parentElement=t,this._optionsService=r,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}},DL=class extends Yx{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let t=this._ctx.measureText("W");if(!("width"in t&&"fontBoundingBoxAscent"in t&&"fontBoundingBoxDescent"in t))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},OL=class extends xe{constructor(e,t,r){super(),this._textarea=e,this._window=t,this.mainDocument=r,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new RL(this._window)),this._onDprChange=this._register(new re),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new re),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(n=>this._screenDprMonitor.setWindow(n))),this._register(bt.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(me(this._textarea,"focus",()=>this._isFocused=!0)),this._register(me(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}},RL=class extends xe{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new ss),this._onDprChange=this._register(new re),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(ze(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=me(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var e;this._outerListener&&((e=this._resolutionMediaMatchList)==null||e.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)}},PL=class extends xe{constructor(){super(),this.linkProviders=[],this._register(ze(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function av(e,t,r){let n=r.getBoundingClientRect(),o=e.getComputedStyle(r),a=parseInt(o.getPropertyValue("padding-left")),u=parseInt(o.getPropertyValue("padding-top"));return[t.clientX-n.left-a,t.clientY-n.top-u]}function ML(e,t,r,n,o,a,u,h,f){if(!a)return;let d=av(e,t,r);if(d)return d[0]=Math.ceil((d[0]+(f?u/2:0))/u),d[1]=Math.ceil(d[1]/h),d[0]=Math.min(Math.max(d[0],1),n+(f?1:0)),d[1]=Math.min(Math.max(d[1],1),o),d}var eg=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,r,n,o){return ML(window,e,t,r,n,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,o)}getMouseReportCoords(e,t){let r=av(window,e,t);if(this._charSizeService.hasValidSize)return r[0]=Math.min(Math.max(r[0],0),this._renderService.dimensions.css.canvas.width-1),r[1]=Math.min(Math.max(r[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(r[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(r[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(r[0]),y:Math.floor(r[1])}}};eg=Ge([ne(0,vi),ne(1,uu)],eg);var AL=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,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,t,r){this._rowCount=r,e=e!==void 0?e:0,t=t!==void 0?t: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,t):t,!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),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},Xx={};UA(Xx,{getSafariVersion:()=>LL,isChromeOS:()=>eT,isFirefox:()=>Zx,isIpad:()=>BL,isIphone:()=>NL,isLegacyEdge:()=>IL,isLinux:()=>lv,isMac:()=>Bl,isNode:()=>cu,isSafari:()=>Jx,isWindows:()=>Qx});var cu=typeof process<"u"&&"title"in process,Vo=cu?"node":navigator.userAgent,Go=cu?"node":navigator.platform,Zx=Vo.includes("Firefox"),IL=Vo.includes("Edge"),Jx=/^((?!chrome|android).)*safari/i.test(Vo);function LL(){if(!Jx)return 0;let e=Vo.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var Bl=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(Go),BL=Go==="iPad",NL=Go==="iPhone",Qx=["Windows","Win16","Win32","WinCE"].includes(Go),lv=Go.indexOf("Linux")>=0,eT=/\bCrOS\b/.test(Vo),tT=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 t=0,r=0,n=e.timeRemaining(),o=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),r=Math.max(t,r),o=e.timeRemaining(),r*1.5>o){n-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-t))}ms`),this._start();return}n=o}this.clear()}},qL=class extends tT{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},FL=class extends tT{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},Nl=!cu&&"requestIdleCallback"in window?FL:qL,HL=class{constructor(){this._queue=new Nl}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},tg=class extends xe{constructor(e,t,r,n,o,a,u,h,f){super(),this._rowCount=e,this._optionsService=r,this._charSizeService=n,this._coreService=o,this._coreBrowserService=h,this._renderer=this._register(new ss),this._pausedResizeTask=new HL,this._observerDisposable=this._register(new ss),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 re),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new re),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new re),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new re),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new AL((d,g)=>this._renderRows(d,g),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new zL(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(ze(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(u.onResize(()=>this._fullRefresh())),this._register(u.buffers.onBufferActivate(()=>{var d;return(d=this._renderer.value)==null?void 0:d.clear()})),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(a.onDecorationRegistered(()=>this._fullRefresh())),this._register(a.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(u.cols,u.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(u.buffer.y,u.buffer.y,!0))),this._register(f.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(d=>this._registerIntersectionObserver(d,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){let r=new e.IntersectionObserver(n=>this._handleIntersectionChange(n[n.length-1]),{threshold:0});r.observe(t),this._observerDisposable.value=ze(()=>r.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,t,r=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let n=this._syncOutputHandler.flush();n&&(e=Math.min(e,n.start),t=Math.max(t,n.end)),r||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),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:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}}resize(e,t){this._rowCount=t,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(t=>this.refreshRows(t.start,t.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(){var e,t;this._renderer.value&&((t=(e=this._renderer.value).clearTextureAtlas)==null||t.call(e),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var r;return(r=this._renderer.value)==null?void 0:r.handleResize(e,t)}):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){var e;(e=this._renderer.value)==null||e.handleCharSizeChanged()}handleBlur(){var e;(e=this._renderer.value)==null||e.handleBlur()}handleFocus(){var e;(e=this._renderer.value)==null||e.handleFocus()}handleSelectionChanged(e,t,r){var n;this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=r,(n=this._renderer.value)==null||n.handleSelectionChanged(e,t,r)}handleCursorMove(){var e;(e=this._renderer.value)==null||e.handleCursorMove()}clear(){var e;(e=this._renderer.value)==null||e.clear()}};tg=Ge([ne(2,At),ne(3,uu),ne(4,Dn),ne(5,Ko),ne(6,Mt),ne(7,gi),ne(8,ls)],tg);var zL=class{constructor(e,t,r){this._coreBrowserService=e,this._coreService=t,this._onTimeout=r,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,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 WL(e,t,r,n){let o=r.buffer.x,a=r.buffer.y;if(!r.buffer.hasScrollback)return $L(o,a,e,t,r,n)+hu(a,t,r,n)+KL(o,a,e,t,r,n);let u;if(a===t)return u=o>e?"D":"C",No(Math.abs(o-e),Bo(u,n));u=a>t?"D":"C";let h=Math.abs(a-t),f=jL(a>t?e:o,r)+(h-1)*r.cols+1+UL(a>t?o:e);return No(f,Bo(u,n))}function UL(e,t){return e-1}function jL(e,t){return t.cols-e}function $L(e,t,r,n,o,a){return hu(t,n,o,a).length===0?"":No(iT(e,t,e,t-bn(t,o),!1,o).length,Bo("D",a))}function hu(e,t,r,n){let o=e-bn(e,r),a=t-bn(t,r),u=Math.abs(o-a)-VL(e,t,r);return No(u,Bo(rT(e,t),n))}function KL(e,t,r,n,o,a){let u;hu(t,n,o,a).length>0?u=n-bn(n,o):u=t;let h=n,f=GL(e,t,r,n,o,a);return No(iT(e,u,r,h,f==="C",o).length,Bo(f,a))}function VL(e,t,r){var u;let n=0,o=e-bn(e,r),a=t-bn(t,r);for(let h=0;h<Math.abs(o-a);h++){let f=rT(e,t)==="A"?-1:1;(u=r.buffer.lines.get(o+f*h))!=null&&u.isWrapped&&n++}return n}function bn(e,t){let r=0,n=t.buffer.lines.get(e),o=n==null?void 0:n.isWrapped;for(;o&&e>=0&&e<t.rows;)r++,n=t.buffer.lines.get(--e),o=n==null?void 0:n.isWrapped;return r}function GL(e,t,r,n,o,a){let u;return hu(r,n,o,a).length>0?u=n-bn(n,o):u=t,e<r&&u<=n||e>=r&&u<n?"C":"D"}function rT(e,t){return e>t?"A":"B"}function iT(e,t,r,n,o,a){let u=e,h=t,f="";for(;(u!==r||h!==n)&&h>=0&&h<a.buffer.lines.length;)u+=o?1:-1,o&&u>a.cols-1?(f+=a.buffer.translateBufferLineToString(h,!1,e,u),u=0,e=0,h++):!o&&u<0&&(f+=a.buffer.translateBufferLineToString(h,!1,0,e+1),u=a.cols-1,e=u,h--);return f+a.buffer.translateBufferLineToString(h,!1,e,u)}function Bo(e,t){let r=t?"O":"[";return V.ESC+r+e}function No(e,t){e=Math.floor(e);let r="";for(let n=0;n<e;n++)r+=t;return r}var YL=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,t=this.selectionEnd;return!e||!t?!1:e[1]>t[1]||e[1]===t[1]&&e[0]>t[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 gb(e,t){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 t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var a_=50,XL=15,ZL=50,JL=500,QL=" ",eB=new RegExp(QL,"g"),rg=class extends xe{constructor(e,t,r,n,o,a,u,h,f){super(),this._element=e,this._screenElement=t,this._linkifier=r,this._bufferService=n,this._coreService=o,this._mouseService=a,this._optionsService=u,this._renderService=h,this._coreBrowserService=f,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new fr,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new re),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new re),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new re),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new re),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=d=>this._handleMouseMove(d),this._mouseUpListener=d=>this._handleMouseUp(d),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(d=>this._handleTrim(d)),this._register(this._bufferService.buffers.onBufferActivate(d=>this._handleBufferActivate(d))),this.enable(),this._model=new YL(this._bufferService),this._activeSelectionMode=0,this._register(ze(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(d=>{d.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,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";let r=this._bufferService.buffer,n=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return"";let o=e[0]<t[0]?e[0]:t[0],a=e[0]<t[0]?t[0]:e[0];for(let u=e[1];u<=t[1];u++){let h=r.translateBufferLineToString(u,!0,o,a);n.push(h)}}else{let o=e[1]===t[1]?t[0]:void 0;n.push(r.translateBufferLineToString(e[1],!0,e[0],o));for(let a=e[1]+1;a<=t[1]-1;a++){let u=r.lines.get(a),h=r.translateBufferLineToString(a,!0);u!=null&&u.isWrapped?n[n.length-1]+=h:n.push(h)}if(e[1]!==t[1]){let a=r.lines.get(t[1]),u=r.translateBufferLineToString(t[1],!0,0,t[0]);a&&a.isWrapped?n[n.length-1]+=u:n.push(u)}}return n.map(o=>o.replace(eB," ")).join(Qx?`\r
|
|
86
|
+
`:`
|
|
87
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),lv&&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 t=this._getMouseBufferCoords(e),r=this._model.finalSelectionStart,n=this._model.finalSelectionEnd;return!r||!n||!t?!1:this._areCoordsInSelection(t,r,n)}isCellInSelection(e,t){let r=this._model.finalSelectionStart,n=this._model.finalSelectionEnd;return!r||!n?!1:this._areCoordsInSelection([e,t],r,n)}_areCoordsInSelection(e,t,r){return e[1]>t[1]&&e[1]<r[1]||t[1]===r[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<r[0]||t[1]<r[1]&&e[1]===r[1]&&e[0]<r[0]||t[1]<r[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){var o,a;let r=(a=(o=this._linkifier.currentLink)==null?void 0:o.link)==null?void 0:a.range;if(r)return this._model.selectionStart=[r.start.x-1,r.start.y-1],this._model.selectionStartLength=gb(r,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let n=this._getMouseBufferCoords(e);return n?(this._selectWordAt(n,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=av(this._coreBrowserService.window,e,this._screenElement)[1],r=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=r?0:(t>r&&(t-=r),t=Math.min(Math.max(t,-a_),a_),t/=a_,t/Math.abs(t)+Math.round(t*(XL-1)))}shouldForceSelection(e){return Bl?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(),ZL)}_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 t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(Bl&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=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 r=this._bufferService.buffer;if(this._model.selectionEnd[1]<r.lines.length){let n=r.lines.get(this._model.selectionEnd[1]);n&&n.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}(!t||t[0]!==this._model.selectionEnd[0]||t[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 t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<JL&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let r=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(r&&r[0]!==void 0&&r[1]!==void 0){let n=WL(r[0]-1,r[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(n,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,r=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);if(!r){this._oldHasSelection&&this._fireOnSelectionChange(e,t,r);return}!e||!t||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||t[0]!==this._oldSelectionEnd[0]||t[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,t,r)}_fireOnSelectionChange(e,t,r){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=r,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(t=>this._handleTrim(t))}_convertViewportColToCharacterIndex(e,t){let r=t;for(let n=0;t>=n;n++){let o=e.loadCell(n,this._workCell).getChars().length;this._workCell.getWidth()===0?r--:o>1&&t!==n&&(r+=o-1)}return r}setSelection(e,t,r){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=r,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,r=!0,n=!0){if(e[0]>=this._bufferService.cols)return;let o=this._bufferService.buffer,a=o.lines.get(e[1]);if(!a)return;let u=o.translateBufferLineToString(e[1],!1),h=this._convertViewportColToCharacterIndex(a,e[0]),f=h,d=e[0]-h,g=0,v=0,y=0,m=0;if(u.charAt(h)===" "){for(;h>0&&u.charAt(h-1)===" ";)h--;for(;f<u.length&&u.charAt(f+1)===" ";)f++}else{let C=e[0],E=e[0];a.getWidth(C)===0&&(g++,C--),a.getWidth(E)===2&&(v++,E++);let x=a.getString(E).length;for(x>1&&(m+=x-1,f+=x-1);C>0&&h>0&&!this._isCharWordSeparator(a.loadCell(C-1,this._workCell));){a.loadCell(C-1,this._workCell);let k=this._workCell.getChars().length;this._workCell.getWidth()===0?(g++,C--):k>1&&(y+=k-1,h-=k-1),h--,C--}for(;E<a.length&&f+1<u.length&&!this._isCharWordSeparator(a.loadCell(E+1,this._workCell));){a.loadCell(E+1,this._workCell);let k=this._workCell.getChars().length;this._workCell.getWidth()===2?(v++,E++):k>1&&(m+=k-1,f+=k-1),f++,E++}}f++;let w=h+d-g+y,S=Math.min(this._bufferService.cols,f-h+g+v-y-m);if(!(!t&&u.slice(h,f).trim()==="")){if(r&&w===0&&a.getCodePoint(0)!==32){let C=o.lines.get(e[1]-1);if(C&&a.isWrapped&&C.getCodePoint(this._bufferService.cols-1)!==32){let E=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(E){let x=this._bufferService.cols-E.start;w-=x,S+=x}}}if(n&&w+S===this._bufferService.cols&&a.getCodePoint(this._bufferService.cols-1)!==32){let C=o.lines.get(e[1]+1);if(C!=null&&C.isWrapped&&C.getCodePoint(0)!==32){let E=this._getWordAt([0,e[1]+1],!1,!1,!0);E&&(S+=E.length)}}return{start:w,length:S}}}_selectWordAt(e,t){let r=this._getWordAt(e,t);if(r){for(;r.start<0;)r.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[r.start,e[1]],this._model.selectionStartLength=r.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let r=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,r--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,r++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,r]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),r={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=gb(r,this._bufferService.cols)}};rg=Ge([ne(3,Mt),ne(4,Dn),ne(5,ev),ne(6,At),ne(7,vi),ne(8,gi)],rg);var vb=class{constructor(){this._data={}}set(e,t,r){this._data[e]||(this._data[e]={}),this._data[e][t]=r}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},mb=class{constructor(){this._color=new vb,this._css=new vb}setCss(e,t,r){this._css.set(e,t,r)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,r){this._color.set(e,t,r)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},ot=Object.freeze((()=>{let e=[$e.toColor("#2e3436"),$e.toColor("#cc0000"),$e.toColor("#4e9a06"),$e.toColor("#c4a000"),$e.toColor("#3465a4"),$e.toColor("#75507b"),$e.toColor("#06989a"),$e.toColor("#d3d7cf"),$e.toColor("#555753"),$e.toColor("#ef2929"),$e.toColor("#8ae234"),$e.toColor("#fce94f"),$e.toColor("#729fcf"),$e.toColor("#ad7fa8"),$e.toColor("#34e2e2"),$e.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let r=0;r<216;r++){let n=t[r/36%6|0],o=t[r/6%6|0],a=t[r%6];e.push({css:tt.toCss(n,o,a),rgba:tt.toRgba(n,o,a)})}for(let r=0;r<24;r++){let n=8+r*10;e.push({css:tt.toCss(n,n,n),rgba:tt.toRgba(n,n,n)})}return e})()),vn=$e.toColor("#ffffff"),Oo=$e.toColor("#000000"),yb=$e.toColor("#ffffff"),Sb=Oo,mo={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},tB=vn,ig=class extends xe{constructor(e){super(),this._optionsService=e,this._contrastCache=new mb,this._halfContrastCache=new mb,this._onChangeColors=this._register(new re),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:vn,background:Oo,cursor:yb,cursorAccent:Sb,selectionForeground:void 0,selectionBackgroundTransparent:mo,selectionBackgroundOpaque:qe.blend(Oo,mo),selectionInactiveBackgroundTransparent:mo,selectionInactiveBackgroundOpaque:qe.blend(Oo,mo),scrollbarSliderBackground:qe.opacity(vn,.2),scrollbarSliderHoverBackground:qe.opacity(vn,.4),scrollbarSliderActiveBackground:qe.opacity(vn,.5),overviewRulerBorder:vn,ansi:ot.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 t=this._colors;if(t.foreground=Ie(e.foreground,vn),t.background=Ie(e.background,Oo),t.cursor=qe.blend(t.background,Ie(e.cursor,yb)),t.cursorAccent=qe.blend(t.background,Ie(e.cursorAccent,Sb)),t.selectionBackgroundTransparent=Ie(e.selectionBackground,mo),t.selectionBackgroundOpaque=qe.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=Ie(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=qe.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?Ie(e.selectionForeground,fb):void 0,t.selectionForeground===fb&&(t.selectionForeground=void 0),qe.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=qe.opacity(t.selectionBackgroundTransparent,.3)),qe.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=qe.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=Ie(e.scrollbarSliderBackground,qe.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=Ie(e.scrollbarSliderHoverBackground,qe.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=Ie(e.scrollbarSliderActiveBackground,qe.opacity(t.foreground,.5)),t.overviewRulerBorder=Ie(e.overviewRulerBorder,tB),t.ansi=ot.slice(),t.ansi[0]=Ie(e.black,ot[0]),t.ansi[1]=Ie(e.red,ot[1]),t.ansi[2]=Ie(e.green,ot[2]),t.ansi[3]=Ie(e.yellow,ot[3]),t.ansi[4]=Ie(e.blue,ot[4]),t.ansi[5]=Ie(e.magenta,ot[5]),t.ansi[6]=Ie(e.cyan,ot[6]),t.ansi[7]=Ie(e.white,ot[7]),t.ansi[8]=Ie(e.brightBlack,ot[8]),t.ansi[9]=Ie(e.brightRed,ot[9]),t.ansi[10]=Ie(e.brightGreen,ot[10]),t.ansi[11]=Ie(e.brightYellow,ot[11]),t.ansi[12]=Ie(e.brightBlue,ot[12]),t.ansi[13]=Ie(e.brightMagenta,ot[13]),t.ansi[14]=Ie(e.brightCyan,ot[14]),t.ansi[15]=Ie(e.brightWhite,ot[15]),e.extendedAnsi){let r=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let n=0;n<r;n++)t.ansi[n+16]=Ie(e.extendedAnsi[n],ot[n+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 t=0;t<this._restoreColors.ansi.length;++t)this._colors.ansi[t]=this._restoreColors.ansi[t];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()}}};ig=Ge([ne(0,At)],ig);function Ie(e,t){if(e!==void 0)try{return $e.toColor(e)}catch{}return t}var rB=class{constructor(...e){this._entries=new Map;for(let[t,r]of e)this.set(t,r)}set(e,t){let r=this._entries.get(e);return this._entries.set(e,t),r}forEach(e){for(let[t,r]of this._entries.entries())e(t,r)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},iB=class{constructor(){this._services=new rB,this._services.set(Qg,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let r=XA(e).sort((a,u)=>a.index-u.index),n=[];for(let a of r){let u=this._services.get(a.id);if(!u)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${a.id._id}.`);n.push(u)}let o=r.length>0?r[0].index:t.length;if(t.length!==o)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${o+1} conflicts with ${t.length} static arguments`);return new e(...t,...n)}},nB={trace:0,debug:1,info:2,warn:3,error:4,off:5},sB="xterm.js: ",ng=class extends xe{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=nB[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]=="function"&&(e[t]=e[t]())}_log(e,t,r){this._evalLazyOptionalParams(r),e.call(console,(this._optionsService.options.logger?"":sB)+t,...r)}trace(e,...t){var r;this._logLevel<=0&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.trace.bind(this._optionsService.options.logger))??console.log,e,t)}debug(e,...t){var r;this._logLevel<=1&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.debug.bind(this._optionsService.options.logger))??console.log,e,t)}info(e,...t){var r;this._logLevel<=2&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.info.bind(this._optionsService.options.logger))??console.info,e,t)}warn(e,...t){var r;this._logLevel<=3&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.warn.bind(this._optionsService.options.logger))??console.warn,e,t)}error(e,...t){var r;this._logLevel<=4&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.error.bind(this._optionsService.options.logger))??console.error,e,t)}};ng=Ge([ne(0,At)],ng);var wb=class extends xe{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new re),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new re),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new re),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 t=new Array(e);for(let r=0;r<Math.min(e,this.length);r++)t[r]=this._array[this._getCyclicIndex(r)];this._array=t,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._array[t]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}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,t,...r){if(t){for(let n=e;n<this._length-t;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let n=this._length-1;n>=e;n--)this._array[this._getCyclicIndex(n+r.length)]=this._array[this._getCyclicIndex(n)];for(let n=0;n<r.length;n++)this._array[this._getCyclicIndex(e+n)]=r[n];if(r.length&&this.onInsertEmitter.fire({index:e,amount:r.length}),this._length+r.length>this._maxLength){let n=this._length+r.length-this._maxLength;this._startIndex+=n,this._length=this._maxLength,this.onTrimEmitter.fire(n)}else this._length+=r.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,r){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+r<0)throw new Error("Cannot shift elements in list beyond index 0");if(r>0){for(let o=t-1;o>=0;o--)this.set(e+o+r,this.get(e+o));let n=e+t+r-this._length;if(n>0)for(this._length+=n;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let n=0;n<t;n++)this.set(e+n+r,this.get(e+n))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},Ee=3,et=Object.freeze(new $o),gl=0,l_=2,Ro=class nT{constructor(t,r,n=!1){this.isWrapped=n,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*Ee);let o=r||fr.fromCharData([0,bx,1,0]);for(let a=0;a<t;++a)this.setCell(a,o);this.length=t}get(t){let r=this._data[t*Ee+0],n=r&2097151;return[this._data[t*Ee+1],r&2097152?this._combined[t]:n?Ui(n):"",r>>22,r&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):n]}set(t,r){this._data[t*Ee+1]=r[0],r[1].length>1?(this._combined[t]=r[1],this._data[t*Ee+0]=t|2097152|r[2]<<22):this._data[t*Ee+0]=r[1].charCodeAt(0)|r[2]<<22}getWidth(t){return this._data[t*Ee+0]>>22}hasWidth(t){return this._data[t*Ee+0]&12582912}getFg(t){return this._data[t*Ee+1]}getBg(t){return this._data[t*Ee+2]}hasContent(t){return this._data[t*Ee+0]&4194303}getCodePoint(t){let r=this._data[t*Ee+0];return r&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):r&2097151}isCombined(t){return this._data[t*Ee+0]&2097152}getString(t){let r=this._data[t*Ee+0];return r&2097152?this._combined[t]:r&2097151?Ui(r&2097151):""}isProtected(t){return this._data[t*Ee+2]&536870912}loadCell(t,r){return gl=t*Ee,r.content=this._data[gl+0],r.fg=this._data[gl+1],r.bg=this._data[gl+2],r.content&2097152&&(r.combinedData=this._combined[t]),r.bg&268435456&&(r.extended=this._extendedAttrs[t]),r}setCell(t,r){r.content&2097152&&(this._combined[t]=r.combinedData),r.bg&268435456&&(this._extendedAttrs[t]=r.extended),this._data[t*Ee+0]=r.content,this._data[t*Ee+1]=r.fg,this._data[t*Ee+2]=r.bg}setCellFromCodepoint(t,r,n,o){o.bg&268435456&&(this._extendedAttrs[t]=o.extended),this._data[t*Ee+0]=r|n<<22,this._data[t*Ee+1]=o.fg,this._data[t*Ee+2]=o.bg}addCodepointToCell(t,r,n){let o=this._data[t*Ee+0];o&2097152?this._combined[t]+=Ui(r):o&2097151?(this._combined[t]=Ui(o&2097151)+Ui(r),o&=-2097152,o|=2097152):o=r|1<<22,n&&(o&=-12582913,o|=n<<22),this._data[t*Ee+0]=o}insertCells(t,r,n){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,n),r<this.length-t){let o=new fr;for(let a=this.length-t-r-1;a>=0;--a)this.setCell(t+r+a,this.loadCell(t+a,o));for(let a=0;a<r;++a)this.setCell(t+a,n)}else for(let o=t;o<this.length;++o)this.setCell(o,n);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,n)}deleteCells(t,r,n){if(t%=this.length,r<this.length-t){let o=new fr;for(let a=0;a<this.length-t-r;++a)this.setCell(t+a,this.loadCell(t+r+a,o));for(let a=this.length-r;a<this.length;++a)this.setCell(a,n)}else for(let o=t;o<this.length;++o)this.setCell(o,n);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,n),this.getWidth(t)===0&&!this.hasContent(t)&&this.setCellFromCodepoint(t,0,1,n)}replaceCells(t,r,n,o=!1){if(o){for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,n),r<this.length&&this.getWidth(r-1)===2&&!this.isProtected(r)&&this.setCellFromCodepoint(r,0,1,n);t<r&&t<this.length;)this.isProtected(t)||this.setCell(t,n),t++;return}for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,n),r<this.length&&this.getWidth(r-1)===2&&this.setCellFromCodepoint(r,0,1,n);t<r&&t<this.length;)this.setCell(t++,n)}resize(t,r){if(t===this.length)return this._data.length*4*l_<this._data.buffer.byteLength;let n=t*Ee;if(t>this.length){if(this._data.buffer.byteLength>=n*4)this._data=new Uint32Array(this._data.buffer,0,n);else{let o=new Uint32Array(n);o.set(this._data),this._data=o}for(let o=this.length;o<t;++o)this.setCell(o,r)}else{this._data=this._data.subarray(0,n);let o=Object.keys(this._combined);for(let u=0;u<o.length;u++){let h=parseInt(o[u],10);h>=t&&delete this._combined[h]}let a=Object.keys(this._extendedAttrs);for(let u=0;u<a.length;u++){let h=parseInt(a[u],10);h>=t&&delete this._extendedAttrs[h]}}return this.length=t,n*4*l_<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*l_<this._data.buffer.byteLength){let t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,r=!1){if(r){for(let n=0;n<this.length;++n)this.isProtected(n)||this.setCell(n,t);return}this._combined={},this._extendedAttrs={};for(let n=0;n<this.length;++n)this.setCell(n,t)}copyFrom(t){this.length!==t.length?this._data=new Uint32Array(t._data):this._data.set(t._data),this.length=t.length,this._combined={};for(let r in t._combined)this._combined[r]=t._combined[r];this._extendedAttrs={};for(let r in t._extendedAttrs)this._extendedAttrs[r]=t._extendedAttrs[r];this.isWrapped=t.isWrapped}clone(){let t=new nT(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let r in this._combined)t._combined[r]=this._combined[r];for(let r in this._extendedAttrs)t._extendedAttrs[r]=this._extendedAttrs[r];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Ee+0]&4194303)return t+(this._data[t*Ee+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Ee+0]&4194303||this._data[t*Ee+2]&50331648)return t+(this._data[t*Ee+0]>>22);return 0}copyCellsFrom(t,r,n,o,a){let u=t._data;if(a)for(let f=o-1;f>=0;f--){for(let d=0;d<Ee;d++)this._data[(n+f)*Ee+d]=u[(r+f)*Ee+d];u[(r+f)*Ee+2]&268435456&&(this._extendedAttrs[n+f]=t._extendedAttrs[r+f])}else for(let f=0;f<o;f++){for(let d=0;d<Ee;d++)this._data[(n+f)*Ee+d]=u[(r+f)*Ee+d];u[(r+f)*Ee+2]&268435456&&(this._extendedAttrs[n+f]=t._extendedAttrs[r+f])}let h=Object.keys(t._combined);for(let f=0;f<h.length;f++){let d=parseInt(h[f],10);d>=r&&(this._combined[d-r+n]=t._combined[d])}}translateToString(t,r,n,o){r=r??0,n=n??this.length,t&&(n=Math.min(n,this.getTrimmedLength())),o&&(o.length=0);let a="";for(;r<n;){let u=this._data[r*Ee+0],h=u&2097151,f=u&2097152?this._combined[r]:h?Ui(h):ji;if(a+=f,o)for(let d=0;d<f.length;++d)o.push(r);r+=u>>22||1}return o&&o.push(r),a}};function oB(e,t,r,n,o,a){let u=[];for(let h=0;h<e.length-1;h++){let f=h,d=e.get(++f);if(!d.isWrapped)continue;let g=[e.get(h)];for(;f<e.length&&d.isWrapped;)g.push(d),d=e.get(++f);if(!a&&n>=h&&n<f){h+=g.length-1;continue}let v=0,y=qo(g,v,t),m=1,w=0;for(;m<g.length;){let C=qo(g,m,t),E=C-w,x=r-y,k=Math.min(E,x);g[v].copyCellsFrom(g[m],w,y,k,!1),y+=k,y===r&&(v++,y=0),w+=k,w===C&&(m++,w=0),y===0&&v!==0&&g[v-1].getWidth(r-1)===2&&(g[v].copyCellsFrom(g[v-1],r-1,y++,1,!1),g[v-1].setCell(r-1,o))}g[v].replaceCells(y,r,o);let S=0;for(let C=g.length-1;C>0&&(C>v||g[C].getTrimmedLength()===0);C--)S++;S>0&&(u.push(h+g.length-S),u.push(S)),h+=g.length-1}return u}function aB(e,t){let r=[],n=0,o=t[n],a=0;for(let u=0;u<e.length;u++)if(o===u){let h=t[++n];e.onDeleteEmitter.fire({index:u-a,amount:h}),u+=h-1,a+=h,o=t[++n]}else r.push(u);return{layout:r,countRemoved:a}}function lB(e,t){let r=[];for(let n=0;n<t.length;n++)r.push(e.get(t[n]));for(let n=0;n<r.length;n++)e.set(n,r[n]);e.length=t.length}function uB(e,t,r){let n=[],o=e.map((f,d)=>qo(e,d,t)).reduce((f,d)=>f+d),a=0,u=0,h=0;for(;h<o;){if(o-h<r){n.push(o-h);break}a+=r;let f=qo(e,u,t);a>f&&(a-=f,u++);let d=e[u].getWidth(a-1)===2;d&&a--;let g=d?r-1:r;n.push(g),h+=g}return n}function qo(e,t,r){if(t===e.length-1)return e[t].getTrimmedLength();let n=!e[t].hasContent(r-1)&&e[t].getWidth(r-1)===1,o=e[t+1].getWidth(0)===2;return n&&o?r-1:r}var sT=class oT{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=oT._nextId++,this._onDispose=this.register(new re),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),Cn(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};sT._nextId=1;var cB=sT,lt={},mn=lt.B;lt[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:"≥","{":"π","|":"≠","}":"£","~":"·"};lt.A={"#":"£"};lt.B=void 0;lt[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};lt.C=lt[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};lt.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};lt.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};lt.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};lt.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};lt.E=lt[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};lt.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};lt.H=lt[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};lt["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var Cb=4294967295,bb=class{constructor(e,t,r){this._hasScrollback=e,this._optionsService=t,this._bufferService=r,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=et.clone(),this.savedCharset=mn,this.markers=[],this._nullCell=fr.fromCharData([0,bx,1,0]),this._whitespaceCell=fr.fromCharData([0,ji,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new Nl,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new wb(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 Al),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 Al),this._whitespaceCell}getBlankLine(e,t){return new Ro(this._bufferService.cols,this.getNullCell(e),t)}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 t=e+this._optionsService.rawOptions.scrollback;return t>Cb?Cb:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=et);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new wb(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let r=this.getNullCell(et),n=0,o=this._getCorrectBufferLength(t);if(o>this.lines.maxLength&&(this.lines.maxLength=o),this.lines.length>0){if(this._cols<e)for(let u=0;u<this.lines.length;u++)n+=+this.lines.get(u).resize(e,r);let a=0;if(this._rows<t)for(let u=this._rows;u<t;u++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new Ro(e,r)):this.ybase>0&&this.lines.length<=this.ybase+this.y+a+1?(this.ybase--,a++,this.ydisp>0&&this.ydisp--):this.lines.push(new Ro(e,r)));else for(let u=this._rows;u>t;u--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(o<this.lines.maxLength){let u=this.lines.length-o;u>0&&(this.lines.trimStart(u),this.ybase=Math.max(this.ybase-u,0),this.ydisp=Math.max(this.ydisp-u,0),this.savedY=Math.max(this.savedY-u,0)),this.lines.maxLength=o}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),a&&(this.y+=a),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let a=0;a<this.lines.length;a++)n+=+this.lines.get(a).resize(e,r);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),n>.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 t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>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,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let r=this._optionsService.rawOptions.reflowCursorLine,n=oB(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(et),r);if(n.length>0){let o=aB(this.lines,n);lB(this.lines,o.layout),this._reflowLargerAdjustViewport(e,t,o.countRemoved)}}_reflowLargerAdjustViewport(e,t,r){let n=this.getNullCell(et),o=r;for(;o-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new Ro(e,n))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-r,0)}_reflowSmaller(e,t){let r=this._optionsService.rawOptions.reflowCursorLine,n=this.getNullCell(et),o=[],a=0;for(let u=this.lines.length-1;u>=0;u--){let h=this.lines.get(u);if(!h||!h.isWrapped&&h.getTrimmedLength()<=e)continue;let f=[h];for(;h.isWrapped&&u>0;)h=this.lines.get(--u),f.unshift(h);if(!r){let k=this.ybase+this.y;if(k>=u&&k<u+f.length)continue}let d=f[f.length-1].getTrimmedLength(),g=uB(f,this._cols,e),v=g.length-f.length,y;this.ybase===0&&this.y!==this.lines.length-1?y=Math.max(0,this.y-this.lines.maxLength+v):y=Math.max(0,this.lines.length-this.lines.maxLength+v);let m=[];for(let k=0;k<v;k++){let D=this.getBlankLine(et,!0);m.push(D)}m.length>0&&(o.push({start:u+f.length+a,newLines:m}),a+=m.length),f.push(...m);let w=g.length-1,S=g[w];S===0&&(w--,S=g[w]);let C=f.length-v-1,E=d;for(;C>=0;){let k=Math.min(E,S);if(f[w]===void 0)break;if(f[w].copyCellsFrom(f[C],E-k,S-k,k,!0),S-=k,S===0&&(w--,S=g[w]),E-=k,E===0){C--;let D=Math.max(C,0);E=qo(f,D,this._cols)}}for(let k=0;k<f.length;k++)g[k]<e&&f[k].setCell(g[k],n);let x=v-y;for(;x-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+a)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+v,this.ybase+t-1)}if(o.length>0){let u=[],h=[];for(let S=0;S<this.lines.length;S++)h.push(this.lines.get(S));let f=this.lines.length,d=f-1,g=0,v=o[g];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+a);let y=0;for(let S=Math.min(this.lines.maxLength-1,f+a-1);S>=0;S--)if(v&&v.start>d+y){for(let C=v.newLines.length-1;C>=0;C--)this.lines.set(S--,v.newLines[C]);S++,u.push({index:d+1,amount:v.newLines.length}),y+=v.newLines.length,v=o[++g]}else this.lines.set(S,h[d--]);let m=0;for(let S=u.length-1;S>=0;S--)u[S].index+=m,this.lines.onInsertEmitter.fire(u[S]),m+=u[S].amount;let w=Math.max(0,f+a-this.lines.maxLength);w>0&&this.lines.onTrimEmitter.fire(w)}}translateBufferLineToString(e,t,r=0,n){let o=this.lines.get(e);return o?o.translateToString(t,r,n):""}getWrappedRangeForLine(e){let t=e,r=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;r+1<this.lines.length&&this.lines.get(r+1).isWrapped;)r++;return{first:t,last:r}}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 t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,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 t=new cB(e);return this.markers.push(t),t.register(this.lines.onTrim(r=>{t.line-=r,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(r=>{t.line>=r.index&&(t.line+=r.amount)})),t.register(this.lines.onDelete(r=>{t.line>=r.index&&t.line<r.index+r.amount&&t.dispose(),t.line>r.index&&(t.line-=r.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},hB=class extends xe{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new re),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 bb(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new bb(!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,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},aT=2,lT=1,sg=class extends xe{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new re),this.onResize=this._onResize.event,this._onScroll=this._register(new re),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,aT),this.rows=Math.max(e.rawOptions.rows||0,lT),this.buffers=this._register(new hB(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let r=this.cols!==e,n=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:r,rowsChanged:n})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let r=this.buffer,n;n=this._cachedBlankLine,(!n||n.length!==this.cols||n.getFg(0)!==e.fg||n.getBg(0)!==e.bg)&&(n=r.getBlankLine(e,t),this._cachedBlankLine=n),n.isWrapped=t;let o=r.ybase+r.scrollTop,a=r.ybase+r.scrollBottom;if(r.scrollTop===0){let u=r.lines.isFull;a===r.lines.length-1?u?r.lines.recycle().copyFrom(n):r.lines.push(n.clone()):r.lines.splice(a+1,0,n.clone()),u?this.isUserScrolling&&(r.ydisp=Math.max(r.ydisp-1,0)):(r.ybase++,this.isUserScrolling||r.ydisp++)}else{let u=a-o+1;r.lines.shiftElements(o+1,u-1,-1),r.lines.set(a,n.clone())}this.isUserScrolling||(r.ydisp=r.ybase),this._onScroll.fire(r.ydisp)}scrollLines(e,t){let r=this.buffer;if(e<0){if(r.ydisp===0)return;this.isUserScrolling=!0}else e+r.ydisp>=r.ybase&&(this.isUserScrolling=!1);let n=r.ydisp;r.ydisp=Math.max(Math.min(r.ydisp+e,r.ybase),0),n!==r.ydisp&&(t||this._onScroll.fire(r.ydisp))}};sg=Ge([ne(0,At)],sg);var is={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:Bl,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},dB=["normal","bold","100","200","300","400","500","600","700","800","900"],fB=class extends xe{constructor(e){super(),this._onOptionChange=this._register(new re),this.onOptionChange=this._onOptionChange.event;let t={...is};for(let r in e)if(r in t)try{let n=e[r];t[r]=this._sanitizeAndValidateOption(r,n)}catch(n){console.error(n)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(ze(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(r=>{r===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(r=>{e.indexOf(r)!==-1&&t()})}_setupOptions(){let e=r=>{if(!(r in is))throw new Error(`No option with key "${r}"`);return this.rawOptions[r]},t=(r,n)=>{if(!(r in is))throw new Error(`No option with key "${r}"`);n=this._sanitizeAndValidateOption(r,n),this.rawOptions[r]!==n&&(this.rawOptions[r]=n,this._onOptionChange.fire(r))};for(let r in this.rawOptions){let n={get:e.bind(this,r),set:t.bind(this,r)};Object.defineProperty(this.options,r,n)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=is[e]),!pB(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=is[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=dB.includes(t)?t:is[e];break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(`${e} cannot be less than 1, value: ${t}`);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(t*10)/10));break;case"scrollback":if(t=Math.min(t,4294967295),t<0)throw new Error(`${e} cannot be less than 0, value: ${t}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${t}`);break;case"rows":case"cols":if(!t&&t!==0)throw new Error(`${e} must be numeric, value: ${t}`);break;case"windowsPty":t=t??{};break}return t}};function pB(e){return e==="block"||e==="underline"||e==="bar"}function Po(e,t=5){if(typeof e!="object")return e;let r=Array.isArray(e)?[]:{};for(let n in e)r[n]=t<=1?e[n]:e[n]&&Po(e[n],t-1);return r}var Eb=Object.freeze({insertMode:!1}),xb=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),og=class extends xe{constructor(e,t,r){super(),this._bufferService=e,this._logService=t,this._optionsService=r,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new re),this.onData=this._onData.event,this._onUserInput=this._register(new re),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new re),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new re),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=Po(Eb),this.decPrivateModes=Po(xb)}reset(){this.modes=Po(Eb),this.decPrivateModes=Po(xb)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let r=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&r.ybase!==r.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(n=>n.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(t=>t.charCodeAt(0))),this._onBinary.fire(e))}};og=Ge([ne(0,Mt),ne(1,Dx),ne(2,At)],og);var Tb={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 u_(e,t){let r=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(r|=64,r|=e.action):(r|=e.button&3,e.button&4&&(r|=64),e.button&8&&(r|=128),e.action===32?r|=32:e.action===0&&!t&&(r|=3)),r}var c_=String.fromCharCode,kb={DEFAULT:e=>{let t=[u_(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${c_(t[0])}${c_(t[1])}${c_(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${u_(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${u_(e,!0)};${e.x};${e.y}${t}`}},ag=class extends xe{constructor(e,t,r){super(),this._bufferService=e,this._coreService=t,this._optionsService=r,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new re),this.onProtocolChange=this._onProtocolChange.event;for(let n of Object.keys(Tb))this.addProtocol(n,Tb[n]);for(let n of Object.keys(kb))this.addEncoding(n,kb[n]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}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,t,r){if(e.deltaY===0||e.shiftKey||t===void 0||r===void 0)return 0;let n=t/r,o=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(o/=n+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,t){return t.altKey||t.ctrlKey||t.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 t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!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,t,r){if(r){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return!(e.button!==t.button||e.action!==t.action||e.ctrl!==t.ctrl||e.alt!==t.alt||e.shift!==t.shift)}};ag=Ge([ne(0,Mt),ne(1,Dn),ne(2,At)],ag);var h_=[[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]],_B=[[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]],at;function gB(e,t){let r=0,n=t.length-1,o;if(e<t[0][0]||e>t[n][1])return!1;for(;n>=r;)if(o=r+n>>1,e>t[o][1])r=o+1;else if(e<t[o][0])n=o-1;else return!0;return!1}var vB=class{constructor(){if(this.version="6",!at){at=new Uint8Array(65536),at.fill(1),at[0]=0,at.fill(0,1,32),at.fill(0,127,160),at.fill(2,4352,4448),at[9001]=2,at[9002]=2,at.fill(2,11904,42192),at[12351]=1,at.fill(2,44032,55204),at.fill(2,63744,64256),at.fill(2,65040,65050),at.fill(2,65072,65136),at.fill(2,65280,65377),at.fill(2,65504,65511);for(let e=0;e<h_.length;++e)at.fill(0,h_[e][0],h_[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?at[e]:gB(e,_B)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let r=this.wcwidth(e),n=r===0&&t!==0;if(n){let o=yn.extractWidth(t);o===0?n=!1:o>r&&(r=o)}return yn.createPropertyValue(0,r,n)}},yn=class Rl{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new re,this.onChange=this._onChange.event;let t=new vB;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,r,n=!1){return(t&16777215)<<3|(r&3)<<1|(n?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let r=0,n=0,o=t.length;for(let a=0;a<o;++a){let u=t.charCodeAt(a);if(55296<=u&&u<=56319){if(++a>=o)return r+this.wcwidth(u);let d=t.charCodeAt(a);56320<=d&&d<=57343?u=(u-55296)*1024+d-56320+65536:r+=this.wcwidth(d)}let h=this.charProperties(u,n),f=Rl.extractWidth(h);Rl.extractShouldJoin(h)&&(f-=Rl.extractWidth(n)),r+=f,n=h}return r}charProperties(t,r){return this._activeProvider.charProperties(t,r)}},mB=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,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}};function Db(e){var n;let t=(n=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1))==null?void 0:n.get(e.cols-1),r=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);r&&t&&(r.isWrapped=t[3]!==0&&t[3]!==32)}var yo=2147483647,yB=256,uT=class lg{constructor(t=32,r=32){if(this.maxLength=t,this.maxSubParamsLength=r,r>yB)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(r),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let r=new lg;if(!t.length)return r;for(let n=Array.isArray(t[0])?1:0;n<t.length;++n){let o=t[n];if(Array.isArray(o))for(let a=0;a<o.length;++a)r.addSubParam(o[a]);else r.addParam(o)}return r}clone(){let t=new lg(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t}toArray(){let t=[];for(let r=0;r<this.length;++r){t.push(this.params[r]);let n=this._subParamsIdx[r]>>8,o=this._subParamsIdx[r]&255;o-n>0&&t.push(Array.prototype.slice.call(this._subParams,n,o))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(t){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=t>yo?yo:t}addSubParam(t){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=t>yo?yo:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let r=this._subParamsIdx[t]>>8,n=this._subParamsIdx[t]&255;return n-r>0?this._subParams.subarray(r,n):null}getSubParamsAll(){let t={};for(let r=0;r<this.length;++r){let n=this._subParamsIdx[r]>>8,o=this._subParamsIdx[r]&255;o-n>0&&(t[r]=this._subParams.slice(n,o))}return t}addDigit(t){let r;if(this._rejectDigits||!(r=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let n=this._digitIsSub?this._subParams:this.params,o=n[r-1];n[r-1]=~o?Math.min(o*10+t,yo):t}},So=[],SB=class{constructor(){this._state=0,this._active=So,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let r=this._handlers[e];return r.push(t),{dispose:()=>{let n=r.indexOf(t);n!==-1&&r.splice(n,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=So}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=So,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||So,!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,t,r){if(!this._active.length)this._handlerFb(this._id,"PUT",lu(e,t,r));else for(let n=this._active.length-1;n>=0;n--)this._active[n].put(e,t,r)}start(){this.reset(),this._state=1}put(e,t,r){if(this._state!==3){if(this._state===1)for(;t<r;){let n=e[t++];if(n===59){this._state=2,this._start();break}if(n<48||57<n){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+n-48}this._state===2&&r-t>0&&this._put(e,t,r)}}end(e,t=!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 r=!1,n=this._active.length-1,o=!1;if(this._stack.paused&&(n=this._stack.loopPosition-1,r=t,o=this._stack.fallThrough,this._stack.paused=!1),!o&&r===!1){for(;n>=0&&(r=this._active[n].end(e),r!==!0);n--)if(r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!1,r;n--}for(;n>=0;n--)if(r=this._active[n].end(!1),r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!0,r}this._active=So,this._id=-1,this._state=0}}},Yt=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,r){this._hitLimit||(this._data+=lu(e,t,r),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then(r=>(this._data="",this._hitLimit=!1,r));return this._data="",this._hitLimit=!1,t}},wo=[],wB=class{constructor(){this._handlers=Object.create(null),this._active=wo,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=wo}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let r=this._handlers[e];return r.push(t),{dispose:()=>{let n=r.indexOf(t);n!==-1&&r.splice(n,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=wo,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||wo,!this._active.length)this._handlerFb(this._ident,"HOOK",t);else for(let r=this._active.length-1;r>=0;r--)this._active[r].hook(t)}put(e,t,r){if(!this._active.length)this._handlerFb(this._ident,"PUT",lu(e,t,r));else for(let n=this._active.length-1;n>=0;n--)this._active[n].put(e,t,r)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let r=!1,n=this._active.length-1,o=!1;if(this._stack.paused&&(n=this._stack.loopPosition-1,r=t,o=this._stack.fallThrough,this._stack.paused=!1),!o&&r===!1){for(;n>=0&&(r=this._active[n].unhook(e),r!==!0);n--)if(r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!1,r;n--}for(;n>=0;n--)if(r=this._active[n].unhook(!1),r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!0,r}this._active=wo,this._ident=0}},Mo=new uT;Mo.addParam(0);var Ob=class{constructor(e){this._handler=e,this._data="",this._params=Mo,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():Mo,this._data="",this._hitLimit=!1}put(e,t,r){this._hitLimit||(this._data+=lu(e,t,r),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(r=>(this._params=Mo,this._data="",this._hitLimit=!1,r));return this._params=Mo,this._data="",this._hitLimit=!1,t}},CB=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,r,n){this.table[t<<8|e]=r<<4|n}addMany(e,t,r,n){for(let o=0;o<e.length;o++)this.table[t<<8|e[o]]=r<<4|n}},cr=160,bB=(function(){let e=new CB(4095),t=Array.apply(null,Array(256)).map((h,f)=>f),r=(h,f)=>t.slice(h,f),n=r(32,127),o=r(0,24);o.push(25),o.push.apply(o,r(28,32));let a=r(0,14),u;e.setDefault(1,0),e.addMany(n,0,2,0);for(u in a)e.addMany([24,26,153,154],u,3,0),e.addMany(r(128,144),u,3,0),e.addMany(r(144,152),u,3,0),e.add(156,u,0,0),e.add(27,u,11,1),e.add(157,u,4,8),e.addMany([152,158,159],u,0,7),e.add(155,u,11,3),e.add(144,u,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(n,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(r(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(n,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(r(64,127),3,7,0),e.addMany(r(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(r(48,60),4,8,4),e.addMany(r(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(r(32,64),6,0,6),e.add(127,6,0,6),e.addMany(r(64,127),6,0,0),e.addMany(r(32,48),3,9,5),e.addMany(r(32,48),5,9,5),e.addMany(r(48,64),5,0,6),e.addMany(r(64,127),5,7,0),e.addMany(r(32,48),4,9,5),e.addMany(r(32,48),1,9,2),e.addMany(r(32,48),2,9,2),e.addMany(r(48,127),2,10,0),e.addMany(r(48,80),1,10,0),e.addMany(r(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(r(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(r(28,32),9,0,9),e.addMany(r(32,48),9,9,12),e.addMany(r(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(o,11,0,11),e.addMany(r(32,128),11,0,11),e.addMany(r(28,32),11,0,11),e.addMany(o,10,0,10),e.add(127,10,0,10),e.addMany(r(28,32),10,0,10),e.addMany(r(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(r(32,48),10,9,12),e.addMany(o,12,0,12),e.add(127,12,0,12),e.addMany(r(28,32),12,0,12),e.addMany(r(32,48),12,9,12),e.addMany(r(48,64),12,0,11),e.addMany(r(64,127),12,12,13),e.addMany(r(64,127),10,12,13),e.addMany(r(64,127),9,12,13),e.addMany(o,13,13,13),e.addMany(n,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(cr,0,2,0),e.add(cr,8,5,8),e.add(cr,6,0,6),e.add(cr,11,0,11),e.add(cr,13,13,13),e})(),EB=class extends xe{constructor(e=bB){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 uT,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,r,n)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,r)=>{},this._escHandlerFb=t=>{},this._errorHandlerFb=t=>t,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(ze(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new SB),this._dcsParser=this._register(new wB),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,t=[64,126]){let r=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(r=e.prefix.charCodeAt(0),r&&60>r||r>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 a=e.intermediates.charCodeAt(o);if(32>a||a>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");r<<=8,r|=a}}if(e.final.length!==1)throw new Error("final must be a single byte");let n=e.final.charCodeAt(0);if(t[0]>n||n>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return r<<=8,r|=n,r}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let r=this._identifier(e,[48,126]);this._escHandlers[r]===void 0&&(this._escHandlers[r]=[]);let n=this._escHandlers[r];return n.push(t),{dispose:()=>{let o=n.indexOf(t);o!==-1&&n.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,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let r=this._identifier(e);this._csiHandlers[r]===void 0&&(this._csiHandlers[r]=[]);let n=this._csiHandlers[r];return n.push(t),{dispose:()=>{let o=n.indexOf(t);o!==-1&&n.splice(o,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}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,t,r,n,o){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=r,this._parseStack.transition=n,this._parseStack.chunkPos=o}parse(e,t,r){let n=0,o=0,a=0,u;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,a=this._parseStack.chunkPos+1;else{if(r===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let h=this._parseStack.handlers,f=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(r===!1&&f>-1){for(;f>=0&&(u=h[f](this._params),u!==!0);f--)if(u instanceof Promise)return this._parseStack.handlerPos=f,u}this._parseStack.handlers=[];break;case 4:if(r===!1&&f>-1){for(;f>=0&&(u=h[f](),u!==!0);f--)if(u instanceof Promise)return this._parseStack.handlerPos=f,u}this._parseStack.handlers=[];break;case 6:if(n=e[this._parseStack.chunkPos],u=this._dcsParser.unhook(n!==24&&n!==26,r),u)return u;n===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(n=e[this._parseStack.chunkPos],u=this._oscParser.end(n!==24&&n!==26,r),u)return u;n===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,a=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let h=a;h<t;++h){switch(n=e[h],o=this._transitions.table[this.currentState<<8|(n<160?n:cr)],o>>4){case 2:for(let y=h+1;;++y){if(y>=t||(n=e[y])<32||n>126&&n<cr){this._printHandler(e,h,y),h=y-1;break}if(++y>=t||(n=e[y])<32||n>126&&n<cr){this._printHandler(e,h,y),h=y-1;break}if(++y>=t||(n=e[y])<32||n>126&&n<cr){this._printHandler(e,h,y),h=y-1;break}if(++y>=t||(n=e[y])<32||n>126&&n<cr){this._printHandler(e,h,y),h=y-1;break}}break;case 3:this._executeHandlers[n]?this._executeHandlers[n]():this._executeHandlerFb(n),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:h,code:n,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let f=this._csiHandlers[this._collect<<8|n],d=f?f.length-1:-1;for(;d>=0&&(u=f[d](this._params),u!==!0);d--)if(u instanceof Promise)return this._preserveStack(3,f,d,o,h),u;d<0&&this._csiHandlerFb(this._collect<<8|n,this._params),this.precedingJoinState=0;break;case 8:do switch(n){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(n-48)}while(++h<t&&(n=e[h])>47&&n<60);h--;break;case 9:this._collect<<=8,this._collect|=n;break;case 10:let g=this._escHandlers[this._collect<<8|n],v=g?g.length-1:-1;for(;v>=0&&(u=g[v](),u!==!0);v--)if(u instanceof Promise)return this._preserveStack(4,g,v,o,h),u;v<0&&this._escHandlerFb(this._collect<<8|n),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|n,this._params);break;case 13:for(let y=h+1;;++y)if(y>=t||(n=e[y])===24||n===26||n===27||n>127&&n<cr){this._dcsParser.put(e,h,y),h=y-1;break}break;case 14:if(u=this._dcsParser.unhook(n!==24&&n!==26),u)return this._preserveStack(6,[],0,o,h),u;n===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 y=h+1;;y++)if(y>=t||(n=e[y])<32||n>127&&n<cr){this._oscParser.put(e,h,y),h=y-1;break}break;case 6:if(u=this._oscParser.end(n!==24&&n!==26),u)return this._preserveStack(5,[],0,o,h),u;n===27&&(o|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=o&15}}},xB=/^([\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})$/,TB=/^[\da-f]+$/;function Rb(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let r=xB.exec(t);if(r){let n=r[1]?15:r[4]?255:r[7]?4095:65535;return[Math.round(parseInt(r[1]||r[4]||r[7]||r[10],16)/n*255),Math.round(parseInt(r[2]||r[5]||r[8]||r[11],16)/n*255),Math.round(parseInt(r[3]||r[6]||r[9]||r[12],16)/n*255)]}}else if(t.indexOf("#")===0&&(t=t.slice(1),TB.exec(t)&&[3,6,9,12].includes(t.length))){let r=t.length/3,n=[0,0,0];for(let o=0;o<3;++o){let a=parseInt(t.slice(r*o,r*o+r),16);n[o]=r===1?a<<4:r===2?a:r===3?a>>4:a>>8}return n}}function d_(e,t){let r=e.toString(16),n=r.length<2?"0"+r:r;switch(t){case 4:return r[0];case 8:return n;case 12:return(n+n).slice(0,3);default:return n+n}}function kB(e,t=16){let[r,n,o]=e;return`rgb:${d_(r,t)}/${d_(n,t)}/${d_(o,t)}`}var DB={"(":0,")":1,"*":2,"+":3,"-":1,".":2},zi=131072,Pb=10;function Mb(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var Ab=5e3,Ib=0,OB=class extends xe{constructor(e,t,r,n,o,a,u,h,f=new EB){super(),this._bufferService=e,this._charsetService=t,this._coreService=r,this._logService=n,this._optionsService=o,this._oscLinkService=a,this._coreMouseService=u,this._unicodeService=h,this._parser=f,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new GA,this._utf8Decoder=new YA,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=et.clone(),this._eraseAttrDataInternal=et.clone(),this._onRequestBell=this._register(new re),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new re),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new re),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new re),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new re),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new re),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new re),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new re),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new re),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new re),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new re),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new re),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new re),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 ug(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(d=>this._activeBuffer=d.activeBuffer)),this._parser.setCsiHandlerFallback((d,g)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(d),params:g.toArray()})}),this._parser.setEscHandlerFallback(d=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(d)})}),this._parser.setExecuteHandlerFallback(d=>{this._logService.debug("Unknown EXECUTE code: ",{code:d})}),this._parser.setOscHandlerFallback((d,g,v)=>{this._logService.debug("Unknown OSC code: ",{identifier:d,action:g,data:v})}),this._parser.setDcsHandlerFallback((d,g,v)=>{g==="HOOK"&&(v=v.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(d),action:g,payload:v})}),this._parser.setPrintHandler((d,g,v)=>this.print(d,g,v)),this._parser.registerCsiHandler({final:"@"},d=>this.insertChars(d)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},d=>this.scrollLeft(d)),this._parser.registerCsiHandler({final:"A"},d=>this.cursorUp(d)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},d=>this.scrollRight(d)),this._parser.registerCsiHandler({final:"B"},d=>this.cursorDown(d)),this._parser.registerCsiHandler({final:"C"},d=>this.cursorForward(d)),this._parser.registerCsiHandler({final:"D"},d=>this.cursorBackward(d)),this._parser.registerCsiHandler({final:"E"},d=>this.cursorNextLine(d)),this._parser.registerCsiHandler({final:"F"},d=>this.cursorPrecedingLine(d)),this._parser.registerCsiHandler({final:"G"},d=>this.cursorCharAbsolute(d)),this._parser.registerCsiHandler({final:"H"},d=>this.cursorPosition(d)),this._parser.registerCsiHandler({final:"I"},d=>this.cursorForwardTab(d)),this._parser.registerCsiHandler({final:"J"},d=>this.eraseInDisplay(d,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},d=>this.eraseInDisplay(d,!0)),this._parser.registerCsiHandler({final:"K"},d=>this.eraseInLine(d,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},d=>this.eraseInLine(d,!0)),this._parser.registerCsiHandler({final:"L"},d=>this.insertLines(d)),this._parser.registerCsiHandler({final:"M"},d=>this.deleteLines(d)),this._parser.registerCsiHandler({final:"P"},d=>this.deleteChars(d)),this._parser.registerCsiHandler({final:"S"},d=>this.scrollUp(d)),this._parser.registerCsiHandler({final:"T"},d=>this.scrollDown(d)),this._parser.registerCsiHandler({final:"X"},d=>this.eraseChars(d)),this._parser.registerCsiHandler({final:"Z"},d=>this.cursorBackwardTab(d)),this._parser.registerCsiHandler({final:"`"},d=>this.charPosAbsolute(d)),this._parser.registerCsiHandler({final:"a"},d=>this.hPositionRelative(d)),this._parser.registerCsiHandler({final:"b"},d=>this.repeatPrecedingCharacter(d)),this._parser.registerCsiHandler({final:"c"},d=>this.sendDeviceAttributesPrimary(d)),this._parser.registerCsiHandler({prefix:">",final:"c"},d=>this.sendDeviceAttributesSecondary(d)),this._parser.registerCsiHandler({final:"d"},d=>this.linePosAbsolute(d)),this._parser.registerCsiHandler({final:"e"},d=>this.vPositionRelative(d)),this._parser.registerCsiHandler({final:"f"},d=>this.hVPosition(d)),this._parser.registerCsiHandler({final:"g"},d=>this.tabClear(d)),this._parser.registerCsiHandler({final:"h"},d=>this.setMode(d)),this._parser.registerCsiHandler({prefix:"?",final:"h"},d=>this.setModePrivate(d)),this._parser.registerCsiHandler({final:"l"},d=>this.resetMode(d)),this._parser.registerCsiHandler({prefix:"?",final:"l"},d=>this.resetModePrivate(d)),this._parser.registerCsiHandler({final:"m"},d=>this.charAttributes(d)),this._parser.registerCsiHandler({final:"n"},d=>this.deviceStatus(d)),this._parser.registerCsiHandler({prefix:"?",final:"n"},d=>this.deviceStatusPrivate(d)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},d=>this.softReset(d)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},d=>this.setCursorStyle(d)),this._parser.registerCsiHandler({final:"r"},d=>this.setScrollRegion(d)),this._parser.registerCsiHandler({final:"s"},d=>this.saveCursor(d)),this._parser.registerCsiHandler({final:"t"},d=>this.windowOptions(d)),this._parser.registerCsiHandler({final:"u"},d=>this.restoreCursor(d)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},d=>this.insertColumns(d)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},d=>this.deleteColumns(d)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},d=>this.selectProtected(d)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},d=>this.requestMode(d,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},d=>this.requestMode(d,!1)),this._parser.setExecuteHandler(V.BEL,()=>this.bell()),this._parser.setExecuteHandler(V.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(V.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(V.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(V.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(V.BS,()=>this.backspace()),this._parser.setExecuteHandler(V.HT,()=>this.tab()),this._parser.setExecuteHandler(V.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(V.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(Dl.IND,()=>this.index()),this._parser.setExecuteHandler(Dl.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(Dl.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new Yt(d=>(this.setTitle(d),this.setIconName(d),!0))),this._parser.registerOscHandler(1,new Yt(d=>this.setIconName(d))),this._parser.registerOscHandler(2,new Yt(d=>this.setTitle(d))),this._parser.registerOscHandler(4,new Yt(d=>this.setOrReportIndexedColor(d))),this._parser.registerOscHandler(8,new Yt(d=>this.setHyperlink(d))),this._parser.registerOscHandler(10,new Yt(d=>this.setOrReportFgColor(d))),this._parser.registerOscHandler(11,new Yt(d=>this.setOrReportBgColor(d))),this._parser.registerOscHandler(12,new Yt(d=>this.setOrReportCursorColor(d))),this._parser.registerOscHandler(104,new Yt(d=>this.restoreIndexedColor(d))),this._parser.registerOscHandler(110,new Yt(d=>this.restoreFgColor(d))),this._parser.registerOscHandler(111,new Yt(d=>this.restoreBgColor(d))),this._parser.registerOscHandler(112,new Yt(d=>this.restoreCursorColor(d))),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 d in lt)this._parser.registerEscHandler({intermediates:"(",final:d},()=>this.selectCharset("("+d)),this._parser.registerEscHandler({intermediates:")",final:d},()=>this.selectCharset(")"+d)),this._parser.registerEscHandler({intermediates:"*",final:d},()=>this.selectCharset("*"+d)),this._parser.registerEscHandler({intermediates:"+",final:d},()=>this.selectCharset("+"+d)),this._parser.registerEscHandler({intermediates:"-",final:d},()=>this.selectCharset("-"+d)),this._parser.registerEscHandler({intermediates:".",final:d},()=>this.selectCharset("."+d)),this._parser.registerEscHandler({intermediates:"/",final:d},()=>this.selectCharset("/"+d));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(d=>(this._logService.error("Parsing error: ",d),d)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new Ob((d,g)=>this.requestStatusString(d,g)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,r,n){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=r,this._parseStack.position=n}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,r)=>setTimeout(()=>r("#SLOW_TIMEOUT"),Ab))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${Ab} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let r,n=this._activeBuffer.x,o=this._activeBuffer.y,a=0,u=this._parseStack.paused;if(u){if(r=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(r),r;n=this._parseStack.cursorStartX,o=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>zi&&(a=this._parseStack.position+zi)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,d=>String.fromCharCode(d)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(d=>d.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<zi&&(this._parseBuffer=new Uint32Array(Math.min(e.length,zi))),u||this._dirtyRowTracker.clearRange(),e.length>zi)for(let d=a;d<e.length;d+=zi){let g=d+zi<e.length?d+zi:e.length,v=typeof e=="string"?this._stringDecoder.decode(e.substring(d,g),this._parseBuffer):this._utf8Decoder.decode(e.subarray(d,g),this._parseBuffer);if(r=this._parser.parse(this._parseBuffer,v))return this._preserveStack(n,o,v,d),this._logSlowResolvingAsync(r),r}else if(!u){let d=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(r=this._parser.parse(this._parseBuffer,d))return this._preserveStack(n,o,d,0),this._logSlowResolvingAsync(r),r}(this._activeBuffer.x!==n||this._activeBuffer.y!==o)&&this._onCursorMove.fire();let h=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),f=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);f<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(f,this._bufferService.rows-1),end:Math.min(h,this._bufferService.rows-1)})}print(e,t,r){let n,o,a=this._charsetService.charset,u=this._optionsService.rawOptions.screenReaderMode,h=this._bufferService.cols,f=this._coreService.decPrivateModes.wraparound,d=this._coreService.modes.insertMode,g=this._curAttrData,v=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&r-t>0&&v.getWidth(this._activeBuffer.x-1)===2&&v.setCellFromCodepoint(this._activeBuffer.x-1,0,1,g);let y=this._parser.precedingJoinState;for(let m=t;m<r;++m){if(n=e[m],n<127&&a){let E=a[String.fromCharCode(n)];E&&(n=E.charCodeAt(0))}let w=this._unicodeService.charProperties(n,y);o=yn.extractWidth(w);let S=yn.extractShouldJoin(w),C=S?yn.extractWidth(y):0;if(y=w,u&&this._onA11yChar.fire(Ui(n)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+o-C>h){if(f){let E=v,x=this._activeBuffer.x-C;for(this._activeBuffer.x=C,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),v=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),C>0&&v instanceof Ro&&v.copyCellsFrom(E,x,0,C,!1);x<h;)E.setCellFromCodepoint(x++,0,1,g)}else if(this._activeBuffer.x=h-1,o===2)continue}if(S&&this._activeBuffer.x){let E=v.getWidth(this._activeBuffer.x-1)?1:2;v.addCodepointToCell(this._activeBuffer.x-E,n,o);for(let x=o-C;--x>=0;)v.setCellFromCodepoint(this._activeBuffer.x++,0,0,g);continue}if(d&&(v.insertCells(this._activeBuffer.x,o-C,this._activeBuffer.getNullCell(g)),v.getWidth(h-1)===2&&v.setCellFromCodepoint(h-1,0,1,g)),v.setCellFromCodepoint(this._activeBuffer.x++,n,o,g),o>0)for(;--o;)v.setCellFromCodepoint(this._activeBuffer.x++,0,0,g)}this._parser.precedingJoinState=y,this._activeBuffer.x<h&&r-t>0&&v.getWidth(this._activeBuffer.x)===0&&!v.hasContent(this._activeBuffer.x)&&v.setCellFromCodepoint(this._activeBuffer.x,0,1,g),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,r=>Mb(r.params[0],this._optionsService.rawOptions.windowOptions)?t(r):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new Ob(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new Yt(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var e;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&e.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);t.hasWidth(this._activeBuffer.x)&&!t.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;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,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,r,n=!1,o=!1){let a=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);a.replaceCells(t,r,this._activeBuffer.getNullCell(this._eraseAttrData()),o),n&&(a.isWrapped=!1)}_resetBufferLine(e,t=!1){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);r&&(r.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),r.isWrapped=!1)}eraseInDisplay(e,t=!1){var n;this._restrictCursor(this._bufferService.cols);let r;switch(e.params[0]){case 0:for(r=this._activeBuffer.y,this._dirtyRowTracker.markDirty(r),this._eraseInBufferLine(r++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);r<this._bufferService.rows;r++)this._resetBufferLine(r,t);this._dirtyRowTracker.markDirty(r);break;case 1:for(r=this._activeBuffer.y,this._dirtyRowTracker.markDirty(r),this._eraseInBufferLine(r,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(r+1).isWrapped=!1);r--;)this._resetBufferLine(r,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(r=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,r-1);r--&&!((n=this._activeBuffer.lines.get(this._activeBuffer.ybase+r))!=null&&n.getTrimmedLength()););for(;r>=0;r--)this._bufferService.scroll(this._eraseAttrData())}else{for(r=this._bufferService.rows,this._dirtyRowTracker.markDirty(r-1);r--;)this._resetBufferLine(r,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let o=this._activeBuffer.lines.length-this._bufferService.rows;o>0&&(this._activeBuffer.lines.trimStart(o),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-o,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-o,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let r=this._activeBuffer.ybase+this._activeBuffer.y,n=this._bufferService.rows-1-this._activeBuffer.scrollBottom,o=this._bufferService.rows-1+this._activeBuffer.ybase-n+1;for(;t--;)this._activeBuffer.lines.splice(o-1,1),this._activeBuffer.lines.splice(r,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let r=this._activeBuffer.ybase+this._activeBuffer.y,n;for(n=this._bufferService.rows-1-this._activeBuffer.scrollBottom,n=this._bufferService.rows-1+this._activeBuffer.ybase-n;t--;)this._activeBuffer.lines.splice(r,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}insertChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(et));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 t=e.params[0]||1;for(let r=this._activeBuffer.scrollTop;r<=this._activeBuffer.scrollBottom;++r){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+r);n.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.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 t=e.params[0]||1;for(let r=this._activeBuffer.scrollTop;r<=this._activeBuffer.scrollBottom;++r){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+r);n.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.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 t=e.params[0]||1;for(let r=this._activeBuffer.scrollTop;r<=this._activeBuffer.scrollBottom;++r){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+r);n.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.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 t=e.params[0]||1;for(let r=this._activeBuffer.scrollTop;r<=this._activeBuffer.scrollBottom;++r){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+r);n.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let t=this._parser.precedingJoinState;if(!t)return!0;let r=e.params[0]||1,n=yn.extractWidth(t),o=this._activeBuffer.x-n,a=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(o),u=new Uint32Array(a.length*r),h=0;for(let d=0;d<a.length;){let g=a.codePointAt(d)||0;u[h++]=g,d+=g>65535?2:1}let f=h;for(let d=1;d<r;++d)u.copyWithin(f,0,h),f+=h;return this.print(u,0,f),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(V.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(V.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(V.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(V.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(V.ESC+"[>83;40003;0c")),!0}_is(e){return(this._optionsService.rawOptions.termName+"").indexOf(e)===0}setMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0;break}return!0}setModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,mn),this._charsetService.setgCharset(1,mn),this._charsetService.setgCharset(2,mn),this._charsetService.setgCharset(3,mn);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 t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006: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[t]===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,t){(S=>(S[S.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",S[S.SET=1]="SET",S[S.RESET=2]="RESET",S[S.PERMANENTLY_SET=3]="PERMANENTLY_SET",S[S.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(void 0||(r={}));let n=this._coreService.decPrivateModes,{activeProtocol:o,activeEncoding:a}=this._coreMouseService,u=this._coreService,{buffers:h,cols:f}=this._bufferService,{active:d,alt:g}=h,v=this._optionsService.rawOptions,y=(S,C)=>(u.triggerDataEvent(`${V.ESC}[${t?"":"?"}${S};${C}$y`),!0),m=S=>S?1:2,w=e.params[0];return t?w===2?y(w,4):w===4?y(w,m(u.modes.insertMode)):w===12?y(w,3):w===20?y(w,m(v.convertEol)):y(w,0):w===1?y(w,m(n.applicationCursorKeys)):w===3?y(w,v.windowOptions.setWinLines?f===80?2:f===132?1:0:0):w===6?y(w,m(n.origin)):w===7?y(w,m(n.wraparound)):w===8?y(w,3):w===9?y(w,m(o==="X10")):w===12?y(w,m(v.cursorBlink)):w===25?y(w,m(!u.isCursorHidden)):w===45?y(w,m(n.reverseWraparound)):w===66?y(w,m(n.applicationKeypad)):w===67?y(w,4):w===1e3?y(w,m(o==="VT200")):w===1002?y(w,m(o==="DRAG")):w===1003?y(w,m(o==="ANY")):w===1004?y(w,m(n.sendFocus)):w===1005?y(w,4):w===1006?y(w,m(a==="SGR")):w===1015?y(w,4):w===1016?y(w,m(a==="SGR_PIXELS")):w===1048?y(w,1):w===47||w===1047||w===1049?y(w,m(d===g)):w===2004?y(w,m(n.bracketedPasteMode)):w===2026?y(w,m(n.synchronizedOutput)):y(w,0)}_updateAttrColor(e,t,r,n,o){return t===2?(e|=50331648,e&=-16777216,e|=$o.fromColorRGB([r,n,o])):t===5&&(e&=-50331904,e|=33554432|r&255),e}_extractColor(e,t,r){let n=[0,0,-1,0,0,0],o=0,a=0;do{if(n[a+o]=e.params[t+a],e.hasSubParams(t+a)){let u=e.getSubParams(t+a),h=0;do n[1]===5&&(o=1),n[a+h+1+o]=u[h];while(++h<u.length&&h+a+1+o<n.length);break}if(n[1]===5&&a+o>=2||n[1]===2&&a+o>=5)break;n[1]&&(o=1)}while(++a+t<e.length&&a+o<n.length);for(let u=2;u<n.length;++u)n[u]===-1&&(n[u]=0);switch(n[0]){case 38:r.fg=this._updateAttrColor(r.fg,n[1],n[3],n[4],n[5]);break;case 48:r.bg=this._updateAttrColor(r.bg,n[1],n[3],n[4],n[5]);break;case 58:r.extended=r.extended.clone(),r.extended.underlineColor=this._updateAttrColor(r.extended.underlineColor,n[1],n[3],n[4],n[5])}return a}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=et.fg,e.bg=et.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 t=e.length,r,n=this._curAttrData;for(let o=0;o<t;o++)r=e.params[o],r>=30&&r<=37?(n.fg&=-50331904,n.fg|=16777216|r-30):r>=40&&r<=47?(n.bg&=-50331904,n.bg|=16777216|r-40):r>=90&&r<=97?(n.fg&=-50331904,n.fg|=16777216|r-90|8):r>=100&&r<=107?(n.bg&=-50331904,n.bg|=16777216|r-100|8):r===0?this._processSGR0(n):r===1?n.fg|=134217728:r===3?n.bg|=67108864:r===4?(n.fg|=268435456,this._processUnderline(e.hasSubParams(o)?e.getSubParams(o)[0]:1,n)):r===5?n.fg|=536870912:r===7?n.fg|=67108864:r===8?n.fg|=1073741824:r===9?n.fg|=2147483648:r===2?n.bg|=134217728:r===21?this._processUnderline(2,n):r===22?(n.fg&=-134217729,n.bg&=-134217729):r===23?n.bg&=-67108865:r===24?(n.fg&=-268435457,this._processUnderline(0,n)):r===25?n.fg&=-536870913:r===27?n.fg&=-67108865:r===28?n.fg&=-1073741825:r===29?n.fg&=2147483647:r===39?(n.fg&=-67108864,n.fg|=et.fg&16777215):r===49?(n.bg&=-67108864,n.bg|=et.bg&16777215):r===38||r===48||r===58?o+=this._extractColor(e,o,n):r===53?n.bg|=1073741824:r===55?n.bg&=-1073741825:r===59?(n.extended=n.extended.clone(),n.extended.underlineColor=-1,n.updateExtended()):r===100?(n.fg&=-67108864,n.fg|=et.fg&16777215,n.bg&=-67108864,n.bg|=et.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",r);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${V.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,r=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${V.ESC}[${t};${r}R`);break}return!0}deviceStatusPrivate(e){switch(e.params[0]){case 6:let t=this._activeBuffer.y+1,r=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${V.ESC}[?${t};${r}R`);break}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=et.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 t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){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 r=t%2===1;this._coreService.decPrivateModes.cursorBlink=r}return!0}setScrollRegion(e){let t=e.params[0]||1,r;return(e.length<2||(r=e.params[1])>this._bufferService.rows||r===0)&&(r=this._bufferService.rows),r>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=r-1,this._setCursor(0,0)),!0}windowOptions(e){if(!Mb(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${V.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>Pb&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>Pb&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());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 t=[],r=e.split(";");for(;r.length>1;){let n=r.shift(),o=r.shift();if(/^\d+$/.exec(n)){let a=parseInt(n);if(Lb(a))if(o==="?")t.push({type:0,index:a});else{let u=Rb(o);u&&t.push({type:1,index:a,color:u})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(";");if(t===-1)return!0;let r=e.slice(0,t).trim(),n=e.slice(t+1);return n?this._createHyperlink(r,n):r.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let r=e.split(":"),n,o=r.findIndex(a=>a.startsWith("id="));return o!==-1&&(n=r[o].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:n,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let r=e.split(";");for(let n=0;n<r.length&&!(t>=this._specialColors.length);++n,++t)if(r[n]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let o=Rb(r[n]);o&&this._onColor.fire([{type:1,index:this._specialColors[t],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 t=[],r=e.split(";");for(let n=0;n<r.length;++n)if(/^\d+$/.exec(r[n])){let o=parseInt(r[n]);Lb(o)&&t.push({type:2,index:o})}return t.length&&this._onColor.fire(t),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,mn),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(DB[e[0]],lt[e[1]]||mn),!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=et.clone(),this._eraseAttrDataInternal=et.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 fr;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){let r=this._activeBuffer.ybase+this._activeBuffer.y+t,n=this._activeBuffer.lines.get(r);n&&(n.fill(e),n.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let r=u=>(this._coreService.triggerDataEvent(`${V.ESC}${u}${V.ESC}\\`),!0),n=this._bufferService.buffer,o=this._optionsService.rawOptions;return r(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${n.scrollTop+1};${n.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,t){this._dirtyRowTracker.markRangeDirty(e,t)}},ug=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,t){e>t&&(Ib=e,e=t,t=Ib),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};ug=Ge([ne(0,Mt)],ug);function Lb(e){return 0<=e&&e<256}var RB=5e7,Bb=12,PB=50,MB=class extends xe{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 re),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){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 r;for(;r=this._writeBuffer.shift();){this._action(r);let n=this._callbacks.shift();n&&n()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>RB)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(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let r=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let n=this._writeBuffer[this._bufferOffset],o=this._action(n,t);if(o){let u=h=>performance.now()-r>=Bb?setTimeout(()=>this._innerWrite(0,h)):this._innerWrite(r,h);o.catch(h=>(queueMicrotask(()=>{throw h}),Promise.resolve(!1))).then(u);return}let a=this._callbacks[this._bufferOffset];if(a&&a(),this._bufferOffset++,this._pendingData-=n.length,performance.now()-r>=Bb)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>PB&&(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()}},cg=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let h=t.addMarker(t.ybase+t.y),f={data:e,id:this._nextId++,lines:[h]};return h.onDispose(()=>this._removeMarkerFromLink(f,h)),this._dataByLinkId.set(f.id,f),f.id}let r=e,n=this._getEntryIdKey(r),o=this._entriesWithId.get(n);if(o)return this.addLineToLink(o.id,t.ybase+t.y),o.id;let a=t.addMarker(t.ybase+t.y),u={id:this._nextId++,key:this._getEntryIdKey(r),data:r,lines:[a]};return a.onDispose(()=>this._removeMarkerFromLink(u,a)),this._entriesWithId.set(u.key,u),this._dataByLinkId.set(u.id,u),u.id}addLineToLink(e,t){let r=this._dataByLinkId.get(e);if(r&&r.lines.every(n=>n.line!==t)){let n=this._bufferService.buffer.addMarker(t);r.lines.push(n),n.onDispose(()=>this._removeMarkerFromLink(r,n))}}getLinkData(e){var t;return(t=this._dataByLinkId.get(e))==null?void 0:t.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let r=e.lines.indexOf(t);r!==-1&&(e.lines.splice(r,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};cg=Ge([ne(0,Mt)],cg);var Nb=!1,AB=class extends xe{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new ss),this._onBinary=this._register(new re),this.onBinary=this._onBinary.event,this._onData=this._register(new re),this.onData=this._onData.event,this._onLineFeed=this._register(new re),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new re),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new re),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new re),this._instantiationService=new iB,this.optionsService=this._register(new fB(e)),this._instantiationService.setService(At,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(sg)),this._instantiationService.setService(Mt,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(ng)),this._instantiationService.setService(Dx,this._logService),this.coreService=this._register(this._instantiationService.createInstance(og)),this._instantiationService.setService(Dn,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(ag)),this._instantiationService.setService(kx,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(yn)),this._instantiationService.setService(QA,this.unicodeService),this._charsetService=this._instantiationService.createInstance(mB),this._instantiationService.setService(JA,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(cg),this._instantiationService.setService(Ox,this._oscLinkService),this._inputHandler=this._register(new OB(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(bt.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(bt.forward(this._bufferService.onResize,this._onResize)),this._register(bt.forward(this.coreService.onData,this._onData)),this._register(bt.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 MB((t,r)=>this._inputHandler.parse(t,r))),this._register(bt.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new re),this._onScroll.event(e=>{var t;(t=this._onScrollApi)==null||t.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 t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=3&&!Nb&&(this._logService.warn("writeSync is unreliable and will be removed soon."),Nb=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,aT),t=Math.max(t,lT),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t){this._bufferService.scrollLines(e,t)}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 t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend==="conpty"&&t.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(Db.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(Db(this._bufferService),!1))),this._windowsWrappingHeuristics.value=ze(()=>{for(let t of e)t.dispose()})}}},IB={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 LB(e,t,r,n){var u;let o={type:0,cancel:!1,key:void 0},a=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key==="UIKeyInputUpArrow"?t?o.key=V.ESC+"OA":o.key=V.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?o.key=V.ESC+"OD":o.key=V.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?o.key=V.ESC+"OC":o.key=V.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?o.key=V.ESC+"OB":o.key=V.ESC+"[B");break;case 8:o.key=e.ctrlKey?"\b":V.DEL,e.altKey&&(o.key=V.ESC+o.key);break;case 9:if(e.shiftKey){o.key=V.ESC+"[Z";break}o.key=V.HT,o.cancel=!0;break;case 13:o.key=e.altKey?V.ESC+V.CR:V.CR,o.cancel=!0;break;case 27:o.key=V.ESC,e.altKey&&(o.key=V.ESC+V.ESC),o.cancel=!0;break;case 37:if(e.metaKey)break;a?o.key=V.ESC+"[1;"+(a+1)+"D":t?o.key=V.ESC+"OD":o.key=V.ESC+"[D";break;case 39:if(e.metaKey)break;a?o.key=V.ESC+"[1;"+(a+1)+"C":t?o.key=V.ESC+"OC":o.key=V.ESC+"[C";break;case 38:if(e.metaKey)break;a?o.key=V.ESC+"[1;"+(a+1)+"A":t?o.key=V.ESC+"OA":o.key=V.ESC+"[A";break;case 40:if(e.metaKey)break;a?o.key=V.ESC+"[1;"+(a+1)+"B":t?o.key=V.ESC+"OB":o.key=V.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(o.key=V.ESC+"[2~");break;case 46:a?o.key=V.ESC+"[3;"+(a+1)+"~":o.key=V.ESC+"[3~";break;case 36:a?o.key=V.ESC+"[1;"+(a+1)+"H":t?o.key=V.ESC+"OH":o.key=V.ESC+"[H";break;case 35:a?o.key=V.ESC+"[1;"+(a+1)+"F":t?o.key=V.ESC+"OF":o.key=V.ESC+"[F";break;case 33:e.shiftKey?o.type=2:e.ctrlKey?o.key=V.ESC+"[5;"+(a+1)+"~":o.key=V.ESC+"[5~";break;case 34:e.shiftKey?o.type=3:e.ctrlKey?o.key=V.ESC+"[6;"+(a+1)+"~":o.key=V.ESC+"[6~";break;case 112:a?o.key=V.ESC+"[1;"+(a+1)+"P":o.key=V.ESC+"OP";break;case 113:a?o.key=V.ESC+"[1;"+(a+1)+"Q":o.key=V.ESC+"OQ";break;case 114:a?o.key=V.ESC+"[1;"+(a+1)+"R":o.key=V.ESC+"OR";break;case 115:a?o.key=V.ESC+"[1;"+(a+1)+"S":o.key=V.ESC+"OS";break;case 116:a?o.key=V.ESC+"[15;"+(a+1)+"~":o.key=V.ESC+"[15~";break;case 117:a?o.key=V.ESC+"[17;"+(a+1)+"~":o.key=V.ESC+"[17~";break;case 118:a?o.key=V.ESC+"[18;"+(a+1)+"~":o.key=V.ESC+"[18~";break;case 119:a?o.key=V.ESC+"[19;"+(a+1)+"~":o.key=V.ESC+"[19~";break;case 120:a?o.key=V.ESC+"[20;"+(a+1)+"~":o.key=V.ESC+"[20~";break;case 121:a?o.key=V.ESC+"[21;"+(a+1)+"~":o.key=V.ESC+"[21~";break;case 122:a?o.key=V.ESC+"[23;"+(a+1)+"~":o.key=V.ESC+"[23~";break;case 123:a?o.key=V.ESC+"[24;"+(a+1)+"~":o.key=V.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=V.NUL:e.keyCode>=51&&e.keyCode<=55?o.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?o.key=V.DEL:e.keyCode===219?o.key=V.ESC:e.keyCode===220?o.key=V.FS:e.keyCode===221&&(o.key=V.GS);else if((!r||n)&&e.altKey&&!e.metaKey){let h=(u=IB[e.keyCode])==null?void 0:u[e.shiftKey?1:0];if(h)o.key=V.ESC+h;else if(e.keyCode>=65&&e.keyCode<=90){let f=e.ctrlKey?e.keyCode-64:e.keyCode+32,d=String.fromCharCode(f);e.shiftKey&&(d=d.toUpperCase()),o.key=V.ESC+d}else if(e.keyCode===32)o.key=V.ESC+(e.ctrlKey?V.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let f=e.code.slice(3,4);e.shiftKey||(f=f.toLowerCase()),o.key=V.ESC+f,o.cancel=!0}}else r&&!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=V.US),e.key==="@"&&(o.key=V.NUL));break}return o}var Ze=0,BB=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new Nl,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new Nl,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,a)=>this._getKey(o)-this._getKey(a)),t=0,r=0,n=new Array(this._array.length+this._insertedValues.length);for(let o=0;o<n.length;o++)r>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[r])?(n[o]=e[t],t++):n[o]=this._array[r++];this._array=n,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 t=this._getKey(e);if(t===void 0||(Ze=this._search(t),Ze===-1)||this._getKey(this._array[Ze])!==t)return!1;do if(this._array[Ze]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(Ze),!0;while(++Ze<this._array.length&&this._getKey(this._array[Ze])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((o,a)=>o-a),t=0,r=new Array(this._array.length-e.length),n=0;for(let o=0;o<this._array.length;o++)e[t]===o?t++:r[n++]=this._array[o];this._array=r,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&&(Ze=this._search(e),!(Ze<0||Ze>=this._array.length)&&this._getKey(this._array[Ze])===e))do yield this._array[Ze];while(++Ze<this._array.length&&this._getKey(this._array[Ze])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Ze=this._search(e),!(Ze<0||Ze>=this._array.length)&&this._getKey(this._array[Ze])===e))do t(this._array[Ze]);while(++Ze<this._array.length&&this._getKey(this._array[Ze])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,r=this._array.length-1;for(;r>=t;){let n=t+r>>1,o=this._getKey(this._array[n]);if(o>e)r=n-1;else if(o<e)t=n+1;else{for(;n>0&&this._getKey(this._array[n-1])===e;)n--;return n}}return t}},f_=0,qb=0,NB=class extends xe{constructor(){super(),this._decorations=new BB(e=>e==null?void 0:e.marker.line),this._onDecorationRegistered=this._register(new re),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new re),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(ze(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new qB(e);if(t){let r=t.marker.onDispose(()=>t.dispose()),n=t.onDispose(()=>{n.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),r.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,r){let n=0,o=0;for(let a of this._decorations.getKeyIterator(t))n=a.options.x??0,o=n+(a.options.width??1),e>=n&&e<o&&(!r||(a.options.layer??"bottom")===r)&&(yield a)}forEachDecorationAtCell(e,t,r,n){this._decorations.forEachByKey(t,o=>{f_=o.options.x??0,qb=f_+(o.options.width??1),e>=f_&&e<qb&&(!r||(o.options.layer??"bottom")===r)&&n(o)})}},qB=class extends Vi{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new re),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new re),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=$e.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=$e.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},FB=1e3,HB=class{constructor(e,t=FB){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,r){this._rowCount=r,e=e!==void 0?e:0,t=t!==void 0?t: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,t):t;let n=performance.now();if(n-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=n,this._innerRefresh();else if(!this._additionalRefreshRequested){let o=n-this._lastRefreshMs,a=this._debounceThresholdMS-o;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},a)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},Fb=20,ql=class extends xe{constructor(e,t,r,n){super(),this._terminal=e,this._coreBrowserService=r,this._renderService=n,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 a=0;a<this._terminal.rows;a++)this._rowElements[a]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[a]);if(this._topBoundaryFocusListener=a=>this._handleBoundaryFocus(a,0),this._bottomBoundaryFocusListener=a=>this._handleBoundaryFocus(a,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 HB(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(a=>this._handleResize(a.rows))),this._register(this._terminal.onRender(a=>this._refreshRows(a.start,a.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(a=>this._handleChar(a))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
88
|
+
`))),this._register(this._terminal.onA11yTab(a=>this._handleTab(a))),this._register(this._terminal.onKey(a=>this._handleKey(a.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(me(o,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(ze(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<Fb+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
89
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===Fb+1&&(this._liveRegion.textContent+=R_.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,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let r=this._terminal.buffer,n=r.lines.length.toString();for(let o=e;o<=t;o++){let a=r.lines.get(r.ydisp+o),u=[],h=(a==null?void 0:a.translateToString(!0,void 0,void 0,u))||"",f=(r.ydisp+o+1).toString(),d=this._rowElements[o];d&&(h.length===0?(d.textContent=" ",this._rowColumns.set(d,[0,1])):(d.textContent=h,this._rowColumns.set(d,u)),d.setAttribute("aria-posinset",f),d.setAttribute("aria-setsize",n),this._alignRowWidth(d))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let r=e.target,n=this._rowElements[t===0?1:this._rowElements.length-2],o=r.getAttribute("aria-posinset"),a=t===0?"1":`${this._terminal.buffer.lines.length}`;if(o===a||e.relatedTarget!==n)return;let u,h;if(t===0?(u=r,h=this._rowElements.pop(),this._rowContainer.removeChild(h)):(u=this._rowElements.shift(),h=r,this._rowContainer.removeChild(u)),u.removeEventListener("focus",this._topBoundaryFocusListener),h.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let f=this._createAccessibilityTreeNode();this._rowElements.unshift(f),this._rowContainer.insertAdjacentElement("afterbegin",f)}else{let f=this._createAccessibilityTreeNode();this._rowElements.push(f),this._rowContainer.appendChild(f)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){var h;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 t={node:e.anchorNode,offset:e.anchorOffset},r={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(r.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===r.node&&t.offset>r.offset)&&([t,r]=[r,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let n=this._rowElements.slice(-1)[0];if(r.node.compareDocumentPosition(n)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(r={node:n,offset:((h=n.textContent)==null?void 0:h.length)??0}),!this._rowContainer.contains(r.node))return;let o=({node:f,offset:d})=>{let g=f instanceof Text?f.parentNode:f,v=parseInt(g==null?void 0:g.getAttribute("aria-posinset"),10)-1;if(isNaN(v))return console.warn("row is invalid. Race condition?"),null;let y=this._rowColumns.get(g);if(!y)return console.warn("columns is null. Race condition?"),null;let m=d<y.length?y[d]:y.slice(-1)[0]+1;return m>=this._terminal.cols&&(++v,m=0),{row:v,column:m}},a=o(t),u=o(r);if(!(!a||!u)){if(a.row>u.row||a.row===u.row&&a.column>=u.column)throw new Error("invalid range");this._terminal.select(a.column,a.row,(u.row-a.row)*this._terminal.cols-a.column+u.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);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){var o,a;e.style.transform="";let t=e.getBoundingClientRect().width,r=(a=(o=this._rowColumns.get(e))==null?void 0:o.slice(-1))==null?void 0:a[0];if(!r)return;let n=r*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${n/t})`}};ql=Ge([ne(1,Qg),ne(2,gi),ne(3,vi)],ql);var hg=class extends xe{constructor(e,t,r,n,o){super(),this._element=e,this._mouseService=t,this._renderService=r,this._bufferService=n,this._linkProviderService=o,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new re),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new re),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(ze(()=>{var a;Cn(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,(a=this._activeProviderReplies)==null||a.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(me(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(me(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(me(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(me(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let r=e.composedPath();for(let n=0;n<r.length;n++){let o=r[n];if(o.classList.contains("xterm"))break;if(o.classList.contains("xterm-hover"))return}(!this._lastBufferCell||t.x!==this._lastBufferCell.x||t.y!==this._lastBufferCell.y)&&(this._handleHover(t),this._lastBufferCell=t)}_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,t){var n,o;(!this._activeProviderReplies||!t)&&((n=this._activeProviderReplies)==null||n.forEach(a=>{a==null||a.forEach(u=>{u.link.dispose&&u.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let r=!1;for(let[a,u]of this._linkProviderService.linkProviders.entries())t?(o=this._activeProviderReplies)!=null&&o.get(a)&&(r=this._checkLinkProviderResult(a,e,r)):u.provideLinks(e.y,h=>{var d,g;if(this._isMouseOut)return;let f=h==null?void 0:h.map(v=>({link:v}));(d=this._activeProviderReplies)==null||d.set(a,f),r=this._checkLinkProviderResult(a,e,r),((g=this._activeProviderReplies)==null?void 0:g.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let r=new Set;for(let n=0;n<t.size;n++){let o=t.get(n);if(o)for(let a=0;a<o.length;a++){let u=o[a],h=u.link.range.start.y<e?0:u.link.range.start.x,f=u.link.range.end.y>e?this._bufferService.cols:u.link.range.end.x;for(let d=h;d<=f;d++){if(r.has(d)){o.splice(a--,1);break}r.add(d)}}}}_checkLinkProviderResult(e,t,r){var a;if(!this._activeProviderReplies)return r;let n=this._activeProviderReplies.get(e),o=!1;for(let u=0;u<e;u++)(!this._activeProviderReplies.has(u)||this._activeProviderReplies.get(u))&&(o=!0);if(!o&&n){let u=n.find(h=>this._linkAtPosition(h.link,t));u&&(r=!0,this._handleNewLink(u))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!r)for(let u=0;u<this._activeProviderReplies.size;u++){let h=(a=this._activeProviderReplies.get(u))==null?void 0:a.find(f=>this._linkAtPosition(f.link,t));if(h){r=!0,this._handleNewLink(h);break}}return r}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&zB(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,Cn(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(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:()=>{var r,n;return(n=(r=this._currentLink)==null?void 0:r.state)==null?void 0:n.decorations.pointerCursor},set:r=>{var n;(n=this._currentLink)!=null&&n.state&&this._currentLink.state.decorations.pointerCursor!==r&&(this._currentLink.state.decorations.pointerCursor=r,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",r))}},underline:{get:()=>{var r,n;return(n=(r=this._currentLink)==null?void 0:r.state)==null?void 0:n.decorations.underline},set:r=>{var n,o,a;(n=this._currentLink)!=null&&n.state&&((a=(o=this._currentLink)==null?void 0:o.state)==null?void 0:a.decorations.underline)!==r&&(this._currentLink.state.decorations.underline=r,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,r))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(r=>{if(!this._currentLink)return;let n=r.start===0?0:r.start+1+this._bufferService.buffer.ydisp,o=this._bufferService.buffer.ydisp+1+r.end;if(this._currentLink.link.range.start.y>=n&&this._currentLink.link.range.end.y<=o&&(this._clearCurrentLink(n,o),this._lastMouseEvent)){let a=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);a&&this._askForLink(a,!1)}})))}_linkHover(e,t,r){var n;(n=this._currentLink)!=null&&n.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(r,t.text)}_fireUnderlineEvent(e,t){let r=e.range,n=this._bufferService.buffer.ydisp,o=this._createLinkUnderlineEvent(r.start.x-1,r.start.y-n-1,r.end.x,r.end.y-n-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(o)}_linkLeave(e,t,r){var n;(n=this._currentLink)!=null&&n.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(r,t.text)}_linkAtPosition(e,t){let r=e.range.start.y*this._bufferService.cols+e.range.start.x,n=e.range.end.y*this._bufferService.cols+e.range.end.x,o=t.y*this._bufferService.cols+t.x;return r<=o&&o<=n}_positionFromMouseEvent(e,t,r){let n=r.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(n)return{x:n[0],y:n[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,r,n,o){return{x1:e,y1:t,x2:r,y2:n,cols:this._bufferService.cols,fg:o}}};hg=Ge([ne(1,ev),ne(2,vi),ne(3,Mt),ne(4,Px)],hg);function zB(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var WB=class extends AB{constructor(e={}){super(e),this._linkifier=this._register(new ss),this.browser=Xx,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new ss),this._onCursorMove=this._register(new re),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new re),this.onKey=this._onKey.event,this._onRender=this._register(new re),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new re),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new re),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new re),this.onBell=this._onBell.event,this._onFocus=this._register(new re),this._onBlur=this._register(new re),this._onA11yCharEmitter=this._register(new re),this._onA11yTabEmitter=this._register(new re),this._onWillOpen=this._register(new re),this._setup(),this._decorationService=this._instantiationService.createInstance(NB),this._instantiationService.setService(Ko,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(PL),this._instantiationService.setService(Px,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(M_)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(t=>this.refresh((t==null?void 0:t.start)??0,(t==null?void 0:t.end)??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(t=>this._reportWindowsOptions(t))),this._register(this._inputHandler.onColor(t=>this._handleColorEvent(t))),this._register(bt.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(bt.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(bt.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(bt.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(ze(()=>{var t,r;this._customKeyEventHandler=void 0,(r=(t=this.element)==null?void 0:t.parentNode)==null||r.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 t of e){let r,n="";switch(t.index){case 256:r="foreground",n="10";break;case 257:r="background",n="11";break;case 258:r="cursor",n="12";break;default:r="ansi",n="4;"+t.index}switch(t.type){case 0:let o=qe.toColorRGB(r==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[r]);this.coreService.triggerDataEvent(`${V.ESC}]${n};${kB(o)}${Gx.ST}`);break;case 1:if(r==="ansi")this._themeService.modifyColors(a=>a.ansi[t.index]=tt.toColor(...t.color));else{let a=r;this._themeService.modifyColors(u=>u[a]=tt.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.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(ql,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(V.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var e;return(e=this.textarea)==null?void 0:e.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(V.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,t=this.buffer.lines.get(e);if(!t)return;let r=Math.min(this.buffer.x,this.cols-1),n=this._renderService.dimensions.css.cell.height,o=t.getWidth(r),a=this._renderService.dimensions.css.cell.width*o,u=this.buffer.y*this._renderService.dimensions.css.cell.height,h=r*this._renderService.dimensions.css.cell.width;this.textarea.style.left=h+"px",this.textarea.style.top=u+"px",this.textarea.style.width=a+"px",this.textarea.style.height=n+"px",this.textarea.style.lineHeight=n+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(me(this.element,"copy",t=>{this.hasSelection()&&KA(t,this._selectionService)}));let e=t=>VA(t,this.textarea,this.coreService,this.optionsService);this._register(me(this.textarea,"paste",e)),this._register(me(this.element,"paste",e)),Zx?this._register(me(this.element,"mousedown",t=>{t.button===2&&YC(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(me(this.element,"contextmenu",t=>{YC(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),lv&&this._register(me(this.element,"auxclick",t=>{t.button===1&&Cx(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(me(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(me(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(me(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(me(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(me(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(me(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(me(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){var o;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"),((o=this.element)==null?void 0:o.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 t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(me(this.screenElement,"mousemove",a=>this.updateCursorStyle(a))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let r=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",O_.get()),eT||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",()=>r.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(OL,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(gi,this._coreBrowserService),this._register(me(this.textarea,"focus",a=>this._handleTextAreaFocus(a))),this._register(me(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(Q_,this._document,this._helperContainer),this._instantiationService.setService(uu,this._charSizeService),this._themeService=this._instantiationService.createInstance(ig),this._instantiationService.setService(ls,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(Ll),this._instantiationService.setService(Rx,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(tg,this.rows,this.screenElement)),this._instantiationService.setService(vi,this._renderService),this._register(this._renderService.onRenderedViewportChange(a=>this._onRender.fire(a))),this.onResize(a=>this._renderService.resize(a.cols,a.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(X_,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(eg),this._instantiationService.setService(ev,this._mouseService);let n=this._linkifier.value=this._register(this._instantiationService.createInstance(hg,this.screenElement));this.element.appendChild(t);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(G_,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(a=>{super.scrollLines(a,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(rg,this.element,this.screenElement,n)),this._instantiationService.setService(tI,this._selectionService),this._register(this._selectionService.onRequestScrollLines(a=>this.scrollLines(a.amount,a.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(a=>this._renderService.handleSelectionChanged(a.start,a.end,a.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(a=>{this.textarea.value=a,this.textarea.focus(),this.textarea.select()})),this._register(bt.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{var a;this._selectionService.refresh(),(a=this._viewport)==null||a.queueSync()})),this._register(this._instantiationService.createInstance(Y_,this.screenElement)),this._register(me(this.element,"mousedown",a=>this._selectionService.handleMouseDown(a))),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(ql,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",a=>this._handleScreenReaderModeOptionChange(a))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Il,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",a=>{!this._overviewRulerRenderer&&a&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Il,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(J_,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function r(a){var d,g,v,y,m;let u=e._mouseService.getMouseReportCoords(a,e.screenElement);if(!u)return!1;let h,f;switch(a.overrideType||a.type){case"mousemove":f=32,a.buttons===void 0?(h=3,a.button!==void 0&&(h=a.button<3?a.button:3)):h=a.buttons&1?0:a.buttons&4?1:a.buttons&2?2:3;break;case"mouseup":f=0,h=a.button<3?a.button:3;break;case"mousedown":f=1,h=a.button<3?a.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(a)===!1)return!1;let w=a.deltaY;if(w===0||e.coreMouseService.consumeWheelEvent(a,(y=(v=(g=(d=e._renderService)==null?void 0:d.dimensions)==null?void 0:g.device)==null?void 0:v.cell)==null?void 0:y.height,(m=e._coreBrowserService)==null?void 0:m.dpr)===0)return!1;f=w<0?0:1,h=4;break;default:return!1}return f===void 0||h===void 0||h>4?!1:e.coreMouseService.triggerMouseEvent({col:u.col,row:u.row,x:u.x,y:u.y,button:h,action:f,ctrl:a.ctrlKey,alt:a.altKey,shift:a.shiftKey})}let n={mouseup:null,wheel:null,mousedrag:null,mousemove:null},o={mouseup:a=>(r(a),a.buttons||(this._document.removeEventListener("mouseup",n.mouseup),n.mousedrag&&this._document.removeEventListener("mousemove",n.mousedrag)),this.cancel(a)),wheel:a=>(r(a),this.cancel(a,!0)),mousedrag:a=>{a.buttons&&r(a)},mousemove:a=>{a.buttons||r(a)}};this._register(this.coreMouseService.onProtocolChange(a=>{a?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(a)),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()),a&8?n.mousemove||(t.addEventListener("mousemove",o.mousemove),n.mousemove=o.mousemove):(t.removeEventListener("mousemove",n.mousemove),n.mousemove=null),a&16?n.wheel||(t.addEventListener("wheel",o.wheel,{passive:!1}),n.wheel=o.wheel):(t.removeEventListener("wheel",n.wheel),n.wheel=null),a&2?n.mouseup||(n.mouseup=o.mouseup):(this._document.removeEventListener("mouseup",n.mouseup),n.mouseup=null),a&4?n.mousedrag||(n.mousedrag=o.mousedrag):(this._document.removeEventListener("mousemove",n.mousedrag),n.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(me(t,"mousedown",a=>{if(a.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(a)))return r(a),n.mouseup&&this._document.addEventListener("mouseup",n.mouseup),n.mousedrag&&this._document.addEventListener("mousemove",n.mousedrag),this.cancel(a)})),this._register(me(t,"wheel",a=>{var u,h,f,d,g;if(!n.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(a)===!1)return!1;if(!this.buffer.hasScrollback){if(a.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(a,(d=(f=(h=(u=e._renderService)==null?void 0:u.dimensions)==null?void 0:h.device)==null?void 0:f.cell)==null?void 0:d.height,(g=e._coreBrowserService)==null?void 0:g.dpr)===0)return this.cancel(a,!0);let v=V.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(a.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(v,!0),this.cancel(a,!0)}}},{passive:!1}))}refresh(e,t){var r;(r=this._renderService)==null||r.refreshRows(e,t)}updateCursorStyle(e){var t;(t=this._selectionService)!=null&&t.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,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),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 t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){wx(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 t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}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,t,r){this._selectionService.setSelection(e,t,r)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(!(!this._selectionService||!this._selectionService.hasSelection))return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var e;(e=this._selectionService)==null||e.clearSelection()}selectAll(){var e;(e=this._selectionService)==null||e.selectAll()}selectLines(e,t){var r;(r=this._selectionService)==null||r.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let r=LB(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),r.type===3||r.type===2){let n=this.rows-1;return this.scrollLines(r.type===2?-n:n),this.cancel(e,!0)}if(r.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(r.cancel&&this.cancel(e,!0),!r.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((r.key===V.ETX||r.key===V.CR)&&(this.textarea.value=""),this._onKey.fire({key:r.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(r.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let r=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState("AltGraph");return t.type==="keypress"?r:r&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(UB(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!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 t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){if(e===this.cols&&t===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,t)}_afterResize(e,t){var r;(r=this._charSizeService)==null||r.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(et));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){var t;this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),(t=this._selectionService)==null||t.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){var e;(e=this._renderService)==null||e.clearTextureAtlas()}_reportFocus(){var e;(e=this.element)!=null&&e.classList.contains("focus")?this.coreService.triggerDataEvent(V.ESC+"[I"):this.coreService.triggerDataEvent(V.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let t=this._renderService.dimensions.css.canvas.width.toFixed(0),r=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${V.ESC}[4;${r};${t}t`);break;case 1:let n=this._renderService.dimensions.css.cell.width.toFixed(0),o=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${V.ESC}[6;${o};${n}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function UB(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var jB=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let r={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(r),t.dispose=()=>this._wrappedAddonDispose(r),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let r=0;r<this._addons.length;r++)if(this._addons[r]===e){t=r;break}if(t===-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(t,1)}},$B=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new fr)}translateToString(e,t,r){return this._line.translateToString(e,t,r)}},Hb=class{constructor(e,t){this._buffer=e,this.type=t}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 t=this._buffer.lines.get(e);if(t)return new $B(t)}getNullCell(){return new fr}},KB=class extends xe{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new re),this.onBufferChange=this._onBufferChange.event,this._normal=new Hb(this._core.buffers.normal,"normal"),this._alternate=new Hb(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)}},VB=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,r=>t(r.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(r,n)=>t(r,n.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},GB=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}},YB=["cols","rows"],zr=0,XB=class extends xe{constructor(e){super(),this._core=this._register(new WB(e)),this._addonManager=this._register(new jB),this._publicOptions={...this._core.options};let t=n=>this._core.options[n],r=(n,o)=>{this._checkReadonlyOptions(n),this._core.options[n]=o};for(let n in this._core.options){let o={get:t.bind(this,n),set:r.bind(this,n)};Object.defineProperty(this._publicOptions,n,o)}}_checkReadonlyOptions(e){if(YB.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 VB(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new GB(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 KB(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any";break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,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 t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}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,t,r){this._verifyIntegers(e,t,r),this._core.select(e,t,r)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}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,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
|
|
90
|
+
`,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return O_.get()},set promptLabel(e){O_.set(e)},get tooMuchOutput(){return R_.get()},set tooMuchOutput(e){R_.set(e)}}}_verifyIntegers(...e){for(zr of e)if(zr===1/0||isNaN(zr)||zr%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(zr of e)if(zr&&(zr===1/0||isNaN(zr)||zr%1!==0||zr<0))throw new Error("This API only accepts positive integers")}};/**
|
|
91
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
92
|
+
* @license MIT
|
|
93
|
+
*
|
|
94
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
95
|
+
* @license MIT
|
|
96
|
+
*
|
|
97
|
+
* Originally forked from (with the author's permission):
|
|
98
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
99
|
+
* http://bellard.org/jslinux/
|
|
100
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
101
|
+
*/var ZB=2,JB=1,QB=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){var v;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 t=this._terminal.options.scrollback===0?0:((v=this._terminal.options.overviewRuler)==null?void 0:v.width)||14,r=window.getComputedStyle(this._terminal.element.parentElement),n=parseInt(r.getPropertyValue("height")),o=Math.max(0,parseInt(r.getPropertyValue("width"))),a=window.getComputedStyle(this._terminal.element),u={top:parseInt(a.getPropertyValue("padding-top")),bottom:parseInt(a.getPropertyValue("padding-bottom")),right:parseInt(a.getPropertyValue("padding-right")),left:parseInt(a.getPropertyValue("padding-left"))},h=u.top+u.bottom,f=u.right+u.left,d=n-h,g=o-f-t;return{cols:Math.max(ZB,Math.floor(g/e.css.cell.width)),rows:Math.max(JB,Math.floor(d/e.css.cell.height))}}};function eN({socket:e,terminalId:t}){const r=ge.useRef(null),n=ge.useRef(null),o=ge.useRef(null),[a,u]=ge.useState(!1),[h,f]=ge.useState("");ge.useEffect(()=>{if(!r.current||!e)return;const g=new XB({cursorBlink:!0,fontSize:14,fontFamily:'Menlo, Monaco, "Courier New", monospace',theme:{background:"#1e1e1e",foreground:"#d4d4d4",cursor:"#aeafad",black:"#000000",red:"#cd3131",green:"#0dbc79",yellow:"#e5e510",blue:"#2472c8",magenta:"#bc3fbc",cyan:"#11a8cd",white:"#e5e5e5",brightBlack:"#666666",brightRed:"#f14c4c",brightGreen:"#23d18b",brightYellow:"#f5f543",brightBlue:"#3b8eea",brightMagenta:"#d670d6",brightCyan:"#29b8db",brightWhite:"#e5e5e5"},minimumContrastRatio:4.5}),v=new QB;g.loadAddon(v),g.open(r.current),v.fit(),n.current=g,o.current=v;const y=D=>{D.terminalId===t&&(g.writeln("Terminal ready. Type commands below."),g.writeln(""),u(!0),f("Terminal ready. Type commands below."))},m=D=>{D.terminalId===t&&g.write(D.data)},w=D=>{D.terminalId===t&&g.writeln(`\r
|
|
102
|
+
Terminal exited with code ${D.exitCode}, signal ${D.signal}`)};e.on("terminal-ready",y),e.on("terminal-output",m),e.on("terminal-exit",w);const S=()=>{e.emit("create-terminal",{terminalId:t,cols:g.cols,rows:g.rows})};e.connected?S():e.once("connect",S),g.onData(D=>{e.connected&&e.emit("terminal-input",{terminalId:t,data:D})});let C=null;const E=()=>{o.current&&e.connected&&(o.current.fit(),e.emit("terminal-resize",{terminalId:t,cols:g.cols,rows:g.rows}))},x=()=>{C||(C=setTimeout(()=>{E(),C=null},100))},k=new ResizeObserver(()=>{x()});return r.current&&(k.observe(r.current),x()),()=>{C&&clearTimeout(C),e.off("terminal-ready",y),e.off("terminal-output",m),e.off("terminal-exit",w),e.emit("close-terminal",{terminalId:t}),g.dispose(),k.disconnect()}},[e,t]);const d=()=>{n.current&&n.current.focus()};return Fe.jsxs("div",{className:"terminal-pane",children:[Fe.jsx("div",{role:"status","aria-live":"polite","aria-atomic":"true",className:"sr-only",children:h}),Fe.jsxs("div",{className:"terminal-pane-header",children:[Fe.jsxs("span",{className:"terminal-id",children:["Terminal ",t]}),Fe.jsx("span",{className:`terminal-status ${a?"ready":"loading"}`,children:a?"●":"○"})]}),Fe.jsx("div",{ref:r,className:"terminal-content",role:"region","aria-label":`Interactive terminal ${t}`,tabIndex:0,onFocus:d})]})}function tN(){const[e,t]=ge.useState(null),[r,n]=ge.useState(!1),[o,a]=ge.useState("terminal-1"),[u,h]=ge.useState(1);ge.useEffect(()=>{const g=El({transports:["websocket","polling"],timeout:2e4,reconnectionAttempts:5,reconnectionDelay:1e3});return g.on("connect",()=>{console.log("Socket.IO connected"),n(!0)}),g.on("connect_error",v=>{console.error("Socket.IO connection error:",v)}),g.on("disconnect",()=>{console.log("Socket.IO disconnected"),n(!1)}),t(g),()=>{g.disconnect()}},[]);const f=()=>{const g=u+1;return h(g),`terminal-${g}`},d=(g,v)=>e?Fe.jsx(WC.MosaicWindow,{path:v,title:`Terminal ${g}`,createNode:f,children:Fe.jsx("div",{style:{height:"100%",width:"100%"},children:Fe.jsx(eN,{socket:e,terminalId:g})})}):null;return Fe.jsxs("div",{className:"app-container",children:[Fe.jsxs("div",{className:"app-header",children:[Fe.jsx("h1",{children:"AI Kanban Terminal"}),Fe.jsxs("div",{className:"connection-status",children:[Fe.jsx("span",{className:`status-indicator ${r?"connected":"disconnected"}`,"aria-label":r?"Connected":"Disconnected"}),Fe.jsx("span",{children:r?"Connected":"Disconnected"})]})]}),Fe.jsx("div",{className:"mosaic-container",children:o&&Fe.jsx(WC.Mosaic,{renderTile:d,value:o,onChange:a,className:"mosaic-blueprint-theme"})})]})}const cT=document.getElementById("root");if(!cT)throw new Error('Root element not found. Ensure there is a <div id="root"></div> in your HTML.');_D.createRoot(cT).render(Fe.jsx(uD.StrictMode,{children:Fe.jsx(tN,{})}));
|